PageSourceSearch

https://qrserwis.pl/assets/index-CFbfXpB0.js

js qrserwis.pl collected 2026-10-09 22:03:20 UTC 1,123,580 bytes, 850 lines download raw bytes

vendor: 6,850 bytes, lines 1-9
1var Y2=Object.defineProperty;var _w=e=>{throw TypeError(e)};var J2=(e,t,r)=>t in e?Y2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Hf=(e,t,r)=>J2(e,typeof t!="symbol"?t+"":t,r),Kf=(e,t,r)=>t.has(e)||_w("Cannot "+r);var X=(e,t,r)=>(Kf(e,t,"read from private field"),r?r.call(e):t.get(e)),it=(e,t,r)=>t.has(e)?_w("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),We=(e,t,r,n)=>(Kf(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),mr=(e,t,r)=>(Kf(e,t,"access private method"),r);var Cd=(e,t,r,n)=>({set _(s){We(e,t,s,r)},get _(){return X(e,t,n)}});function a_(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(n,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(s){if(s.ep)return;s.ep=!0;const a=r(s);fetch(s.href,a)}})();var X2=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ah(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function eP(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}var i_={exports:{}},Dh={},o_={exports:{}},Qe={};/**
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 sd=Symbol.for("react.element"),tP=Symbol.for("react.portal"),rP=Symbol.for("react.fragment"),nP=Symbol.for("react.strict_mode"),sP=Symbol.for("react.profiler"),aP=Symbol.for("react.provider"),iP=Symbol.for("react.context"),oP=Symbol.for("react.forward_ref"),lP=Symbol.for("react.suspense"),cP=Symbol.for("react.memo"),dP=Symbol.for("react.lazy"),jw=Symbol.iterator;function uP(e){return e===null||typeof e!="object"?null:(e=jw&&e[jw]||e["@@iterator"],typeof e=="function"?e:null)}var l_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},c_=Object.assign,d_={};function bl(e,t,r){this.props=e,this.context=t,this.refs=d_,this.updater=r||l_}bl.prototype.isReactComponent={};bl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};bl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function u_(){}u_.prototype=bl.prototype;function ty(e,t,r){this.props=e,this.context=t,this.refs=d_,this.updater=r||l_}var ry=ty.prototype=new u_;ry.constructor=ty;c_(ry,bl.prototype);ry.isPureReactComponent=!0;var kw=Array.isArray,h_=Object.prototype.hasOwnProperty,ny={current:null},f_={key:!0,ref:!0,__self:!0,__source:!0};function p_(e,t,r){var n,s={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)h_.call(t,n)&&!f_.hasOwnProperty(n)&&(s[n]=t[n]);var l=arguments.length-2;if(l===1)s.children=r;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];s.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)s[n]===void 0&&(s[n]=l[n]);return{$$typeof:sd,type:e,key:a,ref:o,props:s,_owner:ny.current}}function hP(e,t){return{$$typeof:sd,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function sy(e){return typeof e=="object"&&e!==null&&e.$$typeof===sd}function fP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Nw=/\/+/g;function Zf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?fP(""+e.key):t.toString(36)}function du(e,t,r,n,s){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case sd:case tP:o=!0}}if(o)return o=e,s=s(o),e=n===""?"."+Zf(o,0):n,kw(s)?(r="",e!=null&&(r=e.replace(Nw,"$&/")+"/"),du(s,t,r,"",function(d){return d})):s!=null&&(sy(s)&&(s=hP(s,r+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(Nw,"$&/")+"/")+e)),t.push(s)),1;if(o=0,n=n===""?".":n+":",kw(e))for(var l=0;l<e.length;l++){a=e[l];var c=n+Zf(a,l);o+=du(a,t,r,c,s)}else if(c=uP(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=n+Zf(a,l++),o+=du(a,t,r,c,s);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function zd(e,t,r){if(e==null)return e;var n=[],s=0;return du(e,n,"","",function(a){return t.call(r,a,s++)}),n}function pP(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Rr={current:null},uu={transition:null},mP={ReactCurrentDispatcher:Rr,ReactCurrentBatchConfig:uu,ReactCurrentOwner:ny};function m_(){throw Error("act(...) is not supported in production builds of React.")}Qe.Children={map:zd,forEach:function(e,t,r){zd(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return zd(e,function(){t++}),t},toArray:function(e){return zd(e,function(t){return t})||[]},only:function(e){if(!sy(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Qe.Component=bl;Qe.Fragment=rP;Qe.Profiler=sP;Qe.PureComponent=ty;Qe.StrictMode=nP;Qe.Suspense=lP;
vendor: 7,120 bytes, lines 9-25
9Qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mP;Qe.act=m_;Qe.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=c_({},e.props),s=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=ny.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)h_.call(t,c)&&!f_.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var d=0;d<c;d++)l[d]=arguments[d+2];n.children=l}return{$$typeof:sd,type:e.type,key:s,ref:a,props:n,_owner:o}};Qe.createContext=function(e){return e={$$typeof:iP,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:aP,_context:e},e.Consumer=e};Qe.createElement=p_;Qe.createFactory=function(e){var t=p_.bind(null,e);return t.type=e,t};Qe.createRef=function(){return{current:null}};Qe.forwardRef=function(e){return{$$typeof:oP,render:e}};Qe.isValidElement=sy;Qe.lazy=function(e){return{$$typeof:dP,_payload:{_status:-1,_result:e},_init:pP}};Qe.memo=function(e,t){return{$$typeof:cP,type:e,compare:t===void 0?null:t}};Qe.startTransition=function(e){var t=uu.transition;uu.transition={};try{e()}finally{uu.transition=t}};Qe.unstable_act=m_;Qe.useCallback=function(e,t){return Rr.current.useCallback(e,t)};Qe.useContext=function(e){return Rr.current.useContext(e)};Qe.useDebugValue=function(){};Qe.useDeferredValue=function(e){return Rr.current.useDeferredValue(e)};Qe.useEffect=function(e,t){return Rr.current.useEffect(e,t)};Qe.useId=function(){return Rr.current.useId()};Qe.useImperativeHandle=function(e,t,r){return Rr.current.useImperativeHandle(e,t,r)};Qe.useInsertionEffect=function(e,t){return Rr.current.useInsertionEffect(e,t)};Qe.useLayoutEffect=function(e,t){return Rr.current.useLayoutEffect(e,t)};Qe.useMemo=function(e,t){return Rr.current.useMemo(e,t)};Qe.useReducer=function(e,t,r){return Rr.current.useReducer(e,t,r)};Qe.useRef=function(e){return Rr.current.useRef(e)};Qe.useState=function(e){return Rr.current.useState(e)};Qe.useSyncExternalStore=function(e,t,r){return Rr.current.useSyncExternalStore(e,t,r)};Qe.useTransition=function(){return Rr.current.useTransition()};Qe.version="18.3.1";o_.exports=Qe;var f=o_.exports;const U=Ah(f),ay=a_({__proto__:null,default:U},[f]);/**
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 gP=f,yP=Symbol.for("react.element"),vP=Symbol.for("react.fragment"),wP=Object.prototype.hasOwnProperty,xP=gP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,bP={key:!0,ref:!0,__self:!0,__source:!0};function g_(e,t,r){var n,s={},a=null,o=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)wP.call(t,n)&&!bP.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:yP,type:e,key:a,ref:o,props:s,_owner:xP.current}}Dh.Fragment=vP;Dh.jsx=g_;Dh.jsxs=g_;i_.exports=Dh;var i=i_.exports,y_={exports:{}},ln={},v_={exports:{}},w_={};/**
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(e){function t(z,C){var B=z.length;z.push(C);e:for(;0<B;){var ce=B-1>>>1,A=z[ce];if(0<s(A,C))z[ce]=C,z[B]=A,B=ce;else break e}}function r(z){return z.length===0?null:z[0]}function n(z){if(z.length===0)return null;var C=z[0],B=z.pop();if(B!==C){z[0]=B;e:for(var ce=0,A=z.length,ee=A>>>1;ce<ee;){var te=2*(ce+1)-1,q=z[te],he=te+1,Z=z[he];if(0>s(q,B))he<A&&0>s(Z,q)?(z[ce]=Z,z[he]=B,ce=he):(z[ce]=q,z[te]=B,ce=te);else if(he<A&&0>s(Z,B))z[ce]=Z,z[he]=B,ce=he;else break e}}return C}function s(z,C){var B=z.sortIndex-C.sortIndex;return B!==0?B:z.id-C.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],d=[],u=1,h=null,p=3,m=!1,y=!1,g=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(z){for(var C=r(d);C!==null;){if(C.callback===null)n(d);else if(C.startTime<=z)n(d),C.sortIndex=C.expirationTime,t(c,C);else break;C=r(d)}}function _(z){if(g=!1,w(z),!y)if(r(c)!==null)y=!0,Q(j);else{var C=r(d);C!==null&&S(_,C.startTime-z)}}function j(z,C){y=!1,g&&(g=!1,b(P),P=-1),m=!0;var B=p;try{for(w(C),h=r(c);h!==null&&(!(h.expirationTime>C)||z&&!H());){var ce=h.callback;if(typeof ce=="function"){h.callback=null,p=h.priorityLevel;var A=ce(h.expirationTime<=C);C=e.unstable_now(),typeof A=="function"?h.callback=A:h===r(c)&&n(c),w(C)}else n(c);h=r(c)}if(h!==null)var ee=!0;else{var te=r(d);te!==null&&S(_,te.startTime-C),ee=!1}return ee}finally{h=null,p=B,m=!1}}var k=!1,N=null,P=-1,T=5,I=-1;function H(){return!(e.unstable_now()-I<T)}function M(){if(N!==null){var z=e.unstable_now();I=z;var C=!0;try{C=N(!0,z)}finally{C?L():(k=!1,N=null)}}else k=!1}var L;if(typeof v=="function")L=function(){v(M)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,Y=F.port2;F.port1.onmessage=M,L=function(){Y.postMessage(null)}}else L=function(){x(M,0)};function Q(z){N=z,k||(k=!0,L())}function S(z,C){P=x(function(){z(e.unstable_now())},C)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_continueExecution=function(){y||m||(y=!0,Q(j))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(z){switch(p){case 1:case 2:case 3:var C=3;break;default:C=p}var B=p;p=C;try{return z()}finally{p=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,C){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var B=p;p=z;try{return C()}finally{p=B}},e.unstable_scheduleCallback=function(z,C,B){var ce=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?ce+B:ce):B=ce,z){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=B+A,z={id:u++,callback:C,priorityLevel:z,startTime:B,expirationTime:A,s
vendor: 4,537 bytes, lines 25-33
25ortIndex:-1},B>ce?(z.sortIndex=B,t(d,z),r(c)===null&&z===r(d)&&(g?(b(P),P=-1):g=!0,S(_,B-ce))):(z.sortIndex=A,t(c,z),y||m||(y=!0,Q(j))),z},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(z){var C=p;return function(){var B=p;p=C;try{return z.apply(this,arguments)}finally{p=B}}}})(w_);v_.exports=w_;var _P=v_.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 jP=f,sn=_P;function ie(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var x_=new Set,xc={};function Zi(e,t){tl(e,t),tl(e+"Capture",t)}function tl(e,t){for(xc[e]=t,e=0;e<t.length;e++)x_.add(t[e])}var Us=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),im=Object.prototype.hasOwnProperty,kP=/^[: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]*$/,Sw={},Cw={};function NP(e){return im.call(Cw,e)?!0:im.call(Sw,e)?!1:kP.test(e)?Cw[e]=!0:(Sw[e]=!0,!1)}function SP(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function CP(e,t,r,n){if(t===null||typeof t>"u"||SP(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Or(e,t,r,n,s,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var pr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){pr[e]=new Or(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];pr[t]=new Or(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){pr[e]=new Or(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){pr[e]=new Or(e,2,!1,e,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(e){pr[e]=new Or(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){pr[e]=new Or(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){pr[e]=new Or(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){pr[e]=new Or(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){pr[e]=new Or(e,5,!1,e.toLowerCase(),null,!1,!1)});var iy=/[\-:]([a-z])/g;function oy(e){return e[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
33-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(e){var t=e.replace(iy,oy);pr[t]=new Or(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(iy,oy);pr[t]=new Or(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(iy,oy);pr[t]=new Or(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){pr[e]=new Or(e,1,!1,e.toLowerCase(),null,!1,!1)});pr.xlinkHref=new Or("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){pr[e]=new Or(e,1,!1,e.toLowerCase(),null,!0,!0)});function ly(e,t,r,n){var s=pr.hasOwnProperty(t)?pr[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(CP(t,r,s,n)&&(r=null),n||s===null?NP(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var ea=jP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ed=Symbol.for("react.element"),xo=Symbol.for("react.portal"),bo=Symbol.for("react.fragment"),cy=Symbol.for("react.strict_mode"),om=Symbol.for("react.profiler"),b_=Symbol.for("react.provider"),__=Symbol.for("react.context"),dy=Symbol.for("react.forward_ref"),lm=Symbol.for("react.suspense"),cm=Symbol.for("react.suspense_list"),uy=Symbol.for("react.memo"),ha=Symbol.for("react.lazy"),j_=Symbol.for("react.offscreen"),zw=Symbol.iterator;function $l(e){return e===null||typeof e!="object"?null:(e=zw&&e[zw]||e["@@iterator"],typeof e=="function"?e:null)}var Tt=Object.assign,Gf;function Jl(e){if(Gf===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Gf=t&&t[1]||""}return`
34`+Gf+e}var Qf=!1;function Yf(e,t){if(!e||Qf)return"";Qf=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var n=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){n=d}e.call(t.prototype)}else{try{throw Error()}catch(d){n=d}e()}}catch(d){if(d&&n&&typeof d.stack=="string"){for(var s=d.stack.split(`
35`),a=n.stack.split(`
36`),o=s.length-1,l=a.length-1;1<=o&&0<=l&&s[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(s[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||s[o]!==a[l]){var c=`
37`+s[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Qf=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Jl(e):""}function zP(e){switch(e.tag){case 5:return Jl(e.type);case 16:return Jl("Lazy");case 13:return Jl("Suspense");case 19:return Jl("SuspenseList");case 0:case 2:case 15:return e=Yf(e.type,!1),e;case 11:return e=Yf(e.type.render,!1),e;case 1:return e=Yf(e.type,!0),e;default:return""}}function dm(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case bo:return"Fragment";case xo:return"Portal";case om:return"Profiler";case cy:return"StrictMode";case lm:return"Suspense";case cm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case __:return(e.displayName||"Context")+".Consumer";case b_:return(e._context.displayName||"Context")+".Provider";case dy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case uy:return t=e.displayName||null,t!==null?t:dm(e.type)||"Memo";case ha:t=e._payload,e=e._init;try{return dm(e(t))}catch{}}return null}function EP(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return dm(t);case 8:return t===cy?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function $a(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function k_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function PP(e){var t=k_(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pd(e){e._valueTracker||(e._valueTracker=PP(e))}function N_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=k_(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Au(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function um(e,t){var r=t.checked;return Tt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Ew(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=$a(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function S_(e,t){t=t.checked,t!=null&&ly(e,"checked",t,!1)}function hm(e,t){S_(e,t);var r=$a(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?fm(e,t.type,r):t.hasOwnProperty("defaultValue")&&fm(e,t.type,$a(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Pw(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function fm(e,t,r){(t!=="number"||Au(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Xl=Array.isArray;function Oo(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+$a(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function pm(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ie(91));return Tt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Tw(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(ie(92));if(Xl(r)){if(1<r.length)throw Error(ie(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:$a(r)}}function C_(e,t){var r=$a(t.value),n=$a(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Rw(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function z_(e){switch(e){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 mm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?z_(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Td,E_=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Td=Td||document.createElement("div"),Td.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Td.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function bc(e,t){if(t){var r=e.firstChild;
vendor: 11,458 bytes, line 37
37if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ac={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},TP=["Webkit","ms","Moz","O"];Object.keys(ac).forEach(function(e){TP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ac[t]=ac[e]})});function P_(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ac.hasOwnProperty(e)&&ac[e]?(""+t).trim():t+"px"}function T_(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=P_(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var RP=Tt({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 gm(e,t){if(t){if(RP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ie(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ie(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ie(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ie(62))}}function ym(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 vm=null;function hy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wm=null,Ao=null,Do=null;function Ow(e){if(e=od(e)){if(typeof wm!="function")throw Error(ie(280));var t=e.stateNode;t&&(t=Lh(t),wm(e.stateNode,e.type,t))}}function R_(e){Ao?Do?Do.push(e):Do=[e]:Ao=e}function O_(){if(Ao){var e=Ao,t=Do;if(Do=Ao=null,Ow(e),t)for(e=0;e<t.length;e++)Ow(t[e])}}function A_(e,t){return e(t)}function D_(){}var Jf=!1;function I_(e,t,r){if(Jf)return e(t,r);Jf=!0;try{return A_(e,t,r)}finally{Jf=!1,(Ao!==null||Do!==null)&&(D_(),O_())}}function _c(e,t){var r=e.stateNode;if(r===null)return null;var n=Lh(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(ie(231,t,typeof r));return r}var xm=!1;if(Us)try{var Ll={};Object.defineProperty(Ll,"passive",{get:function(){xm=!0}}),window.addEventListener("test",Ll,Ll),window.removeEventListener("test",Ll,Ll)}catch{xm=!1}function OP(e,t,r,n,s,a,o,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(r,d)}catch(u){this.onError(u)}}var ic=!1,Du=null,Iu=!1,bm=null,AP={onError:function(e){ic=!0,Du=e}};function DP(e,t,r,n,s,a,o,l,c){ic=!1,Du=null,OP.apply(AP,arguments)}function IP(e,t,r,n,s,a,o,l,c){if(DP.apply(this,arguments),ic){if(ic){var d=Du;ic=!1,Du=null}else throw Error(ie(198));Iu||(Iu=!0,bm=d)}}function Gi(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function M_(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Aw(e){if(Gi(e)!==e)throw Error(ie(188))}function MP(e){var t=e.alternate;if(!t){if(t=Gi(e),t===null)throw Error(ie(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var a=s.alternate;if(a===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===a.child){for(a=s.child;a;){if(a===r)return Aw(s),e;if(a===n)return Aw(s),t;a=a.sibling}throw Error(ie(188))}if(r.return!==n.return)r=s,n=a;else{for(var o=!1,l=s.child;l;){if(l===r){o=!0,r=s,n=a;break}if(l===n){o=!0,n=s,r=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===r){o=!0,r=a,n=s;break}if(l===n){o=!0,n=a,r=s;break}l=l.sibling}if(!o)throw Error(ie(189))}}if(r.alternate!==n)throw Error(ie(190))}if(r.tag!==3)throw Error(ie(188));return r.stateNode.current===r?e:t}function F_(e){return e=MP(e),e!==null?$_(e):null}function $_(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=$_(e);if(t!==null)return t;e=e.sibling}return null}var L_=sn.unstable_scheduleCallback,Dw=sn.unstable_cancelCallback,FP=sn.unstable_shouldYield,$P=sn.unstable_requestPaint,Wt=sn.unstable_now,LP=sn.unstable_getCurrentPriorityLevel,fy=sn.unstable_ImmediatePriority,U_=sn.unstable_UserBlockingPriority,Mu=sn.unstable_NormalPriority,UP=sn.unstable_LowPriority,B_=sn.unstable_IdlePriority,Ih=null,ys=null;function BP(e){if(ys&&typeof ys.onCommitFiberRoot=="function")try{ys.onCommitFiberRoot(Ih,e,void 0,(e.current.flags&128)===128)}catch{}}var qn=Math.clz32?Math.clz32:qP,WP=Math.log,VP=Math.LN2;function qP(e){return e>>>=0,e===0?32:31-(WP(e)/VP|0)|0}var Rd=64,Od=4194304;function ec(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Fu(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~s;l!==0?n=ec(l):(a&=o,a!==0&&(n=ec(a)))}else o=r&~s,o!==0?n=ec(o):a!==0&&(n=ec(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,a=t&-t,s>=a||s===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-qn(t),s=1<<r,n|=e[r],t&=~s;return n}function HP(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 KP(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-qn(a),l=1<<o,c=s[o];c===-1?(!(l&r)||l&n)&&(s[o]=HP(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function _m(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function W_(){var e=Rd;return Rd<<=1,!(Rd&4194240)&&(Rd=64),e}function Xf(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function ad(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-qn(t),e[t]=r}function ZP(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-qn(r),a=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~a}}function py(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-qn(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var pt=0;function V_(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var q_,my,H_,K_,Z_,jm=!1,Ad=[],Ca=null,za=null,Ea=null,jc=new Map,kc=new Map,ma=[],GP="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 Iw(e,t){switch(e){case"focusin":case"focusout":Ca=null;break;case"dragenter":case"dragleave":za=null;break;case"mouseover":case"mouseout":Ea=null;break;case"pointerover":case"pointerout":jc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":kc.delete(t.pointerId)}}function Ul(e,t,r,n,s,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[s]},t!==null&&(t=od(t),t!==null&&my(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function QP(e,t,r,n,s){switch(t){case"focusin":return Ca=Ul(Ca,e,t,r,n,s),!0;case"dragenter":return za=Ul(za,e,t,r,n,s),!0;case"mouseover":return Ea=Ul(Ea,e,t,r,n,s),!0;case"pointerover":var a=s.pointerId;return jc.set(a,Ul(jc.get(a)||null,e,t,r,n,s)),!0;case"gotpointercapture":return a=s.pointerId,kc.set(a,Ul(kc.get(a)||null,e,t,r,n,s)),!0}return!1}function G_(e){var t=fi(e.target);if(t!==null){var r=Gi(t);if(r!==null){if(t=r.tag,t===13){if(t=M_(r),t!==null){e.blockedOn=t,Z_(e.priority,function(){H_(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function hu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=km(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);vm=n,r.target.dispatchEvent(n),vm=null}else return t=od(r),t!==null&&my(t),e.blockedOn=r,!1;t.shift()}return!0}function Mw(e,t,r){hu(e)&&r.delete(t)}function YP(){jm=!1,Ca!==null&&hu(Ca)&&(Ca=null),za!==null&&hu(za)&&(za=null),Ea!==null&&hu(Ea)&&(Ea=null),jc.forEach(Mw),kc.forEach(Mw)}function Bl(e,t){e.blockedOn===t&&(e.blockedOn=null,jm||(jm=!0,sn.unstable_scheduleCallback(sn.unstable_NormalPriority,YP)))}function Nc(e){function t(s){return Bl(s,e)}if(0<Ad.length){Bl(Ad[0],e);for(var r=1;r<Ad.length;r++){var n=Ad[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Ca!==null&&Bl(Ca,e),za!==null&&Bl(za,e),Ea!==null&&Bl(Ea,e),jc.forEach(t),kc.forEach(t),r=0;r<ma.length;r++)n=ma[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<ma.length&&(r=ma[0],r.blockedOn===null);)G_(r),r.blockedOn===null&&ma.shift()}var Io=ea.ReactCurrentBatchConfig,$u=!0;function JP(e,t,r,n){var s=pt,a=Io.transition;Io.transition=null;try{pt=1,gy(e,t,r,n)}finally{pt=s,Io.transition=a}}function XP(e,t,r,n){var s=pt,a=Io.transition;Io.transition=null;try{pt=4,gy(e,t,r,n)}finally{pt=s,Io.transition=a}}function gy(e,t,r,n){if($u){var s=km(e,t,r,n);if(s===null)cp(e,t,n,Lu,r),Iw(e,n);else if(QP(s,e,t,r,n))n.stopPropagation();else if(Iw(e,n),t&4&&-1<GP.indexOf(e)){for(;s!==null;){var a=od(s);if(a!==null&&q_(a),a=km(e,t,r,n),a===null&&cp(e,t,n,Lu,r),a===s)break;s=a}s!==null&&n.stopPropagation()}else cp(e,t,n,null,r)}}var Lu=null;function km(e,t,r,n){if(Lu=null,e=hy(n),e=fi(e),e!==null)if(t=Gi(e),t===null)e=null;else if(r=t.tag,r===13){if(e=M_(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Lu=e,null}
vendor: 8,729 bytes, line 37
37function Q_(e){switch(e){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(LP()){case fy:return 1;case U_:return 4;case Mu:case UP:return 16;case B_:return 536870912;default:return 16}default:return 16}}var ja=null,yy=null,fu=null;function Y_(){if(fu)return fu;var e,t=yy,r=t.length,n,s="value"in ja?ja.value:ja.textContent,a=s.length;for(e=0;e<r&&t[e]===s[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===s[a-n];n++);return fu=s.slice(e,1<n?1-n:void 0)}function pu(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Dd(){return!0}function Fw(){return!1}function cn(e){function t(r,n,s,a,o){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Dd:Fw,this.isPropagationStopped=Fw,this}return Tt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Dd)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Dd)},persist:function(){},isPersistent:Dd}),t}var _l={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vy=cn(_l),id=Tt({},_l,{view:0,detail:0}),eT=cn(id),ep,tp,Wl,Mh=Tt({},id,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wy,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Wl&&(Wl&&e.type==="mousemove"?(ep=e.screenX-Wl.screenX,tp=e.screenY-Wl.screenY):tp=ep=0,Wl=e),ep)},movementY:function(e){return"movementY"in e?e.movementY:tp}}),$w=cn(Mh),tT=Tt({},Mh,{dataTransfer:0}),rT=cn(tT),nT=Tt({},id,{relatedTarget:0}),rp=cn(nT),sT=Tt({},_l,{animationName:0,elapsedTime:0,pseudoElement:0}),aT=cn(sT),iT=Tt({},_l,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),oT=cn(iT),lT=Tt({},_l,{data:0}),Lw=cn(lT),cT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dT={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"},uT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hT(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=uT[e])?!!t[e]:!1}function wy(){return hT}var fT=Tt({},id,{key:function(e){if(e.key){var t=cT[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=pu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?dT[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wy,charCode:function(e){return e.type==="keypress"?pu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?pu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),pT=cn(fT),mT=Tt({},Mh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Uw=cn(mT),gT=Tt({},id,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wy}),yT=cn(gT),vT=Tt({},_l,{propertyName:0,elapsedTime:0,pseudoElement:0}),wT=cn(vT),xT=Tt({},Mh,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),bT=cn(xT),_T=[9,13,27,32],xy=Us&&"CompositionEvent"in window,oc=null;Us&&"documentMode"in document&&(oc=document.documentMode);var jT=Us&&"TextEvent"in window&&!oc,J_=Us&&(!xy||oc&&8<oc&&11>=oc),Bw=" ",Ww=!1;function X_(e,t){switch(e){case"keyup":return _T.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ej(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _o=!1;function kT(e,t){switch(e){case"compositionend":return ej(t);case"keypress":return t.which!==32?null:(Ww=!0,Bw);case"textInput":return e=t.data,e===Bw&&Ww?null:e;default:return null}}function NT(e,t){if(_o)return e==="compositionend"||!xy&&X_(e,t)?(e=Y_(),fu=yy=ja=null,_o=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return J_&&t.locale!=="ko"?null:t.data;default:return null}}var ST={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 Vw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ST[e.type]:t==="textarea"}function tj(e,t,r,n){R_(n),t=Uu(t,"onChange"),0<t.length&&(r=new vy("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var lc=null,Sc=null;function CT(e){hj(e,0)}function Fh(e){var t=No(e);if(N_(t))return e}function zT(e,t){if(e==="change")return t}var rj=!1;if(Us){var np;if(Us){var sp="oninput"in document;if(!sp){var qw=document.createElement("div");qw.setAttribute("oninput","return;"),sp=typeof qw.oninput=="function"}np=sp}else np=!1;rj=np&&(!document.documentMode||9<document.documentMode)}function Hw(){lc&&(lc.detachEvent("onpropertychange",nj),Sc=lc=null)}function nj(e){if(e.propertyName==="value"&&Fh(Sc)){var t=[];tj(t,Sc,e,hy(e)),I_(CT,t)}}function ET(e,t,r){e==="focusin"?(Hw(),lc=t,Sc=r,lc.attachEvent("onpropertychange",nj)):e==="focusout"&&Hw()}function PT(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Fh(Sc)}function TT(e,t){if(e==="click")return Fh(t)}function RT(e,t){if(e==="input"||e==="change")return Fh(t)}function OT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Gn=typeof Object.is=="function"?Object.is:OT;function Cc(e,t){if(Gn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!im.call(t,s)||!Gn(e[s],t[s]))return!1}return!0}function Kw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zw(e,t){var r=Kw(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Kw(r)}}function sj(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sj(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function aj(){for(var e=window,t=Au();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;
vendor: 6,173 bytes, line 37
37t=Au(e.document)}return t}function by(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function AT(e){var t=aj(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&sj(r.ownerDocument.documentElement,r)){if(n!==null&&by(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,a=Math.min(n.start,s);n=n.end===void 0?a:Math.min(n.end,s),!e.extend&&a>n&&(s=n,n=a,a=s),s=Zw(r,a);var o=Zw(r,n);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var DT=Us&&"documentMode"in document&&11>=document.documentMode,jo=null,Nm=null,cc=null,Sm=!1;function Gw(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Sm||jo==null||jo!==Au(n)||(n=jo,"selectionStart"in n&&by(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),cc&&Cc(cc,n)||(cc=n,n=Uu(Nm,"onSelect"),0<n.length&&(t=new vy("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=jo)))}function Id(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var ko={animationend:Id("Animation","AnimationEnd"),animationiteration:Id("Animation","AnimationIteration"),animationstart:Id("Animation","AnimationStart"),transitionend:Id("Transition","TransitionEnd")},ap={},ij={};Us&&(ij=document.createElement("div").style,"AnimationEvent"in window||(delete ko.animationend.animation,delete ko.animationiteration.animation,delete ko.animationstart.animation),"TransitionEvent"in window||delete ko.transitionend.transition);function $h(e){if(ap[e])return ap[e];if(!ko[e])return e;var t=ko[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in ij)return ap[e]=t[r];return e}var oj=$h("animationend"),lj=$h("animationiteration"),cj=$h("animationstart"),dj=$h("transitionend"),uj=new Map,Qw="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 Ga(e,t){uj.set(e,t),Zi(t,[e])}for(var ip=0;ip<Qw.length;ip++){var op=Qw[ip],IT=op.toLowerCase(),MT=op[0].toUpperCase()+op.slice(1);Ga(IT,"on"+MT)}Ga(oj,"onAnimationEnd");Ga(lj,"onAnimationIteration");Ga(cj,"onAnimationStart");Ga("dblclick","onDoubleClick");Ga("focusin","onFocus");Ga("focusout","onBlur");Ga(dj,"onTransitionEnd");tl("onMouseEnter",["mouseout","mouseover"]);tl("onMouseLeave",["mouseout","mouseover"]);tl("onPointerEnter",["pointerout","pointerover"]);tl("onPointerLeave",["pointerout","pointerover"]);Zi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Zi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Zi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Zi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Zi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Zi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var tc="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(" "),FT=new Set("cancel close invalid load scroll toggle".split(" ").concat(tc));function Yw(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,IP(n,t,void 0,e),e.currentTarget=null}function hj(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var o=n.length-1;0<=o;o--){var l=n[o],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==a&&s.isPropagationStopped())break e;Yw(s,l,d),a=c}else for(o=0;o<n.length;o++){if(l=n[o],c=l.instance,d=l.currentTarget,l=l.listener,c!==a&&s.isPropagationStopped())break e;Yw(s,l,d),a=c}}}if(Iu)throw e=bm,Iu=!1,bm=null,e}function jt(e,t){var r=t[Tm];r===void 0&&(r=t[Tm]=new Set);var n=e+"__bubble";r.has(n)||(fj(t,e,2,!1),r.add(n))}function lp(e,t,r){var n=0;t&&(n|=4),fj(r,e,n,t)}var Md="_reactListening"+Math.random().toString(36).slice(2);function zc(e){if(!e[Md]){e[Md]=!0,x_.forEach(function(r){r!=="selectionchange"&&(FT.has(r)||lp(r,!1,e),lp(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Md]||(t[Md]=!0,lp("selectionchange",!1,t))}}function fj(e,t,r,n){switch(Q_(t)){case 1:var s=JP;break;case 4:s=XP;break;default:s=gy}r=s.bind(null,t,r,e),s=void 0,!xm||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function cp(e,t,r,n,s){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;
vendor: 2,527 bytes, line 37
37if(l===s||l.nodeType===8&&l.parentNode===s)break;if(o===4)for(o=n.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;o=o.return}for(;l!==null;){if(o=fi(l),o===null)return;if(c=o.tag,c===5||c===6){n=a=o;continue e}l=l.parentNode}}n=n.return}I_(function(){var d=a,u=hy(r),h=[];e:{var p=uj.get(e);if(p!==void 0){var m=vy,y=e;switch(e){case"keypress":if(pu(r)===0)break e;case"keydown":case"keyup":m=pT;break;case"focusin":y="focus",m=rp;break;case"focusout":y="blur",m=rp;break;case"beforeblur":case"afterblur":m=rp;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=$w;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=rT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=yT;break;case oj:case lj:case cj:m=aT;break;case dj:m=wT;break;case"scroll":m=eT;break;case"wheel":m=bT;break;case"copy":case"cut":case"paste":m=oT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Uw}var g=(t&4)!==0,x=!g&&e==="scroll",b=g?p!==null?p+"Capture":null:p;g=[];for(var v=d,w;v!==null;){w=v;var _=w.stateNode;if(w.tag===5&&_!==null&&(w=_,b!==null&&(_=_c(v,b),_!=null&&g.push(Ec(v,_,w)))),x)break;v=v.return}0<g.length&&(p=new m(p,y,null,r,u),h.push({event:p,listeners:g}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",p&&r!==vm&&(y=r.relatedTarget||r.fromElement)&&(fi(y)||y[Bs]))break e;if((m||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,m?(y=r.relatedTarget||r.toElement,m=d,y=y?fi(y):null,y!==null&&(x=Gi(y),y!==x||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=d),m!==y)){if(g=$w,_="onMouseLeave",b="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(g=Uw,_="onPointerLeave",b="onPointerEnter",v="pointer"),x=m==null?p:No(m),w=y==null?p:No(y),p=new g(_,v+"leave",m,r,u),p.target=x,p.relatedTarget=w,_=null,fi(u)===d&&(g=new g(b,v+"enter",y,r,u),g.target=w,g.relatedTarget=x,_=g),x=_,m&&y)t:{for(g=m,b=y,v=0,w=g;w;w=eo(w))v++;for(w=0,_=b;_;_=eo(_))w++;for(;0<v-w;)g=eo(g),v--;for(;0<w-v;)b=eo(b),w--;for(;v--;){if(g===b||b!==null&&g===b.alternate)break t;g=eo(g),b=eo(b)}g=null}else g=null;m!==null&&Jw(h,p,m,g,!1),y!==null&&x!==null&&Jw(h,x,y,g,!0)}}
vendor: 5,810 bytes, lines 37-38
37e:{if(p=d?No(d):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var j=zT;else if(Vw(p))if(rj)j=RT;else{j=PT;var k=ET}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(j=TT);if(j&&(j=j(e,d))){tj(h,j,r,u);break e}k&&k(e,p,d),e==="focusout"&&(k=p._wrapperState)&&k.controlled&&p.type==="number"&&fm(p,"number",p.value)}switch(k=d?No(d):window,e){case"focusin":(Vw(k)||k.contentEditable==="true")&&(jo=k,Nm=d,cc=null);break;case"focusout":cc=Nm=jo=null;break;case"mousedown":Sm=!0;break;case"contextmenu":case"mouseup":case"dragend":Sm=!1,Gw(h,r,u);break;case"selectionchange":if(DT)break;case"keydown":case"keyup":Gw(h,r,u)}var N;if(xy)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else _o?X_(e,r)&&(P="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(P="onCompositionStart");P&&(J_&&r.locale!=="ko"&&(_o||P!=="onCompositionStart"?P==="onCompositionEnd"&&_o&&(N=Y_()):(ja=u,yy="value"in ja?ja.value:ja.textContent,_o=!0)),k=Uu(d,P),0<k.length&&(P=new Lw(P,e,null,r,u),h.push({event:P,listeners:k}),N?P.data=N:(N=ej(r),N!==null&&(P.data=N)))),(N=jT?kT(e,r):NT(e,r))&&(d=Uu(d,"onBeforeInput"),0<d.length&&(u=new Lw("onBeforeInput","beforeinput",null,r,u),h.push({event:u,listeners:d}),u.data=N))}hj(h,t)})}function Ec(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Uu(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,a=s.stateNode;s.tag===5&&a!==null&&(s=a,a=_c(e,r),a!=null&&n.unshift(Ec(e,a,s)),a=_c(e,t),a!=null&&n.push(Ec(e,a,s))),e=e.return}return n}function eo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Jw(e,t,r,n,s){for(var a=t._reactName,o=[];r!==null&&r!==n;){var l=r,c=l.alternate,d=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&d!==null&&(l=d,s?(c=_c(r,a),c!=null&&o.unshift(Ec(r,c,l))):s||(c=_c(r,a),c!=null&&o.push(Ec(r,c,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var $T=/\r\n?/g,LT=/\u0000|\uFFFD/g;function Xw(e){return(typeof e=="string"?e:""+e).replace($T,`
38`).replace(LT,"")}function Fd(e,t,r){if(t=Xw(t),Xw(e)!==t&&r)throw Error(ie(425))}function Bu(){}var Cm=null,zm=null;function Em(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pm=typeof setTimeout=="function"?setTimeout:void 0,UT=typeof clearTimeout=="function"?clearTimeout:void 0,ex=typeof Promise=="function"?Promise:void 0,BT=typeof queueMicrotask=="function"?queueMicrotask:typeof ex<"u"?function(e){return ex.resolve(null).then(e).catch(WT)}:Pm;function WT(e){setTimeout(function(){throw e})}function dp(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),Nc(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);Nc(t)}function Pa(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function tx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var jl=Math.random().toString(36).slice(2),ds="__reactFiber$"+jl,Pc="__reactProps$"+jl,Bs="__reactContainer$"+jl,Tm="__reactEvents$"+jl,VT="__reactListeners$"+jl,qT="__reactHandles$"+jl;function fi(e){var t=e[ds];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Bs]||r[ds]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=tx(e);e!==null;){if(r=e[ds])return r;e=tx(e)}return t}e=r,r=e.parentNode}return null}function od(e){return e=e[ds]||e[Bs],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function No(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ie(33))}function Lh(e){return e[Pc]||null}var Rm=[],So=-1;function Qa(e){return{current:e}}function kt(e){0>So||(e.current=Rm[So],Rm[So]=null,So--)}function wt(e,t){So++,Rm[So]=e.current,e.current=t}var La={},br=Qa(La),Lr=Qa(!1),Ei=La;function rl(e,t){var r=e.type.contextTypes;if(!r)return La;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},a;for(a in r)s[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ur(e){return e=e.childContextTypes,e!=null}function Wu(){kt(Lr),kt(br)}function rx(e,t,r){if(br.current!==La)throw Error(ie(168));wt(br,t),wt(Lr,r)}function pj(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(ie(108,EP(e)||"Unknown",s));return Tt({},r,n)}function Vu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||La,Ei=br.current,wt(br,e),wt(Lr,Lr.current),!0}function nx(e,t,r){var n=e.stateNode;if(!n)throw Error(ie(169));r?(e=pj(e,t,Ei),n.__reactInternalMemoizedMergedChildContext=e,kt(Lr),kt(br),wt(br,e)):kt(Lr),wt(Lr,r)}var Ds=null,Uh=!1,up=!1;function mj(e){Ds===null?Ds=[e]:Ds.push(e)}function HT(e){Uh=!0,mj(e)}function Ya(){if(!up&&Ds!==null){up=!0;var e=0,t=pt;try{var r=Ds;for(pt=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Ds=null,Uh=!1}catch(s){throw Ds!==null&&(Ds=Ds.slice(e+1)),L_(fy,Ya),s}finally{pt=t,up=!1}}return null}var Co=[],zo=0,qu=null,Hu=0,fn=[],pn=0,Pi=null,Fs=1,$s="";function ai(e,t){Co[zo++]=Hu,Co[zo++]=qu,qu=e,Hu=t}function gj(e,t,r){fn[pn++]=Fs,fn[pn++]=$s,fn[pn++]=Pi,Pi=e;var n=Fs;e=$s;var s=32-qn(n)-1;n&=~(1<<s),r+=1;var a=32-qn(t)+s;
vendor: 15,092 bytes, line 38
38if(30<a){var o=s-s%5;a=(n&(1<<o)-1).toString(32),n>>=o,s-=o,Fs=1<<32-qn(t)+s|r<<s|n,$s=a+e}else Fs=1<<a|r<<s|n,$s=e}function _y(e){e.return!==null&&(ai(e,1),gj(e,1,0))}function jy(e){for(;e===qu;)qu=Co[--zo],Co[zo]=null,Hu=Co[--zo],Co[zo]=null;for(;e===Pi;)Pi=fn[--pn],fn[pn]=null,$s=fn[--pn],fn[pn]=null,Fs=fn[--pn],fn[pn]=null}var tn=null,en=null,St=!1,Un=null;function yj(e,t){var r=yn(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function sx(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,tn=e,en=Pa(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,tn=e,en=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Pi!==null?{id:Fs,overflow:$s}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=yn(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,tn=e,en=null,!0):!1;default:return!1}}function Om(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Am(e){if(St){var t=en;if(t){var r=t;if(!sx(e,t)){if(Om(e))throw Error(ie(418));t=Pa(r.nextSibling);var n=tn;t&&sx(e,t)?yj(n,r):(e.flags=e.flags&-4097|2,St=!1,tn=e)}}else{if(Om(e))throw Error(ie(418));e.flags=e.flags&-4097|2,St=!1,tn=e}}}function ax(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;tn=e}function $d(e){if(e!==tn)return!1;if(!St)return ax(e),St=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Em(e.type,e.memoizedProps)),t&&(t=en)){if(Om(e))throw vj(),Error(ie(418));for(;t;)yj(e,t),t=Pa(t.nextSibling)}if(ax(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ie(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){en=Pa(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}en=null}}else en=tn?Pa(e.stateNode.nextSibling):null;return!0}function vj(){for(var e=en;e;)e=Pa(e.nextSibling)}function nl(){en=tn=null,St=!1}function ky(e){Un===null?Un=[e]:Un.push(e)}var KT=ea.ReactCurrentBatchConfig;function Vl(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(ie(309));var n=r.stateNode}if(!n)throw Error(ie(147,e));var s=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=s.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(ie(284));if(!r._owner)throw Error(ie(290,e))}return e}function Ld(e,t){throw e=Object.prototype.toString.call(t),Error(ie(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ix(e){var t=e._init;return t(e._payload)}function wj(e){function t(b,v){if(e){var w=b.deletions;w===null?(b.deletions=[v],b.flags|=16):w.push(v)}}function r(b,v){if(!e)return null;for(;v!==null;)t(b,v),v=v.sibling;return null}function n(b,v){for(b=new Map;v!==null;)v.key!==null?b.set(v.key,v):b.set(v.index,v),v=v.sibling;return b}function s(b,v){return b=Aa(b,v),b.index=0,b.sibling=null,b}function a(b,v,w){return b.index=w,e?(w=b.alternate,w!==null?(w=w.index,w<v?(b.flags|=2,v):w):(b.flags|=2,v)):(b.flags|=1048576,v)}function o(b){return e&&b.alternate===null&&(b.flags|=2),b}function l(b,v,w,_){return v===null||v.tag!==6?(v=vp(w,b.mode,_),v.return=b,v):(v=s(v,w),v.return=b,v)}function c(b,v,w,_){var j=w.type;return j===bo?u(b,v,w.props.children,_,w.key):v!==null&&(v.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ha&&ix(j)===v.type)?(_=s(v,w.props),_.ref=Vl(b,v,w),_.return=b,_):(_=bu(w.type,w.key,w.props,null,b.mode,_),_.ref=Vl(b,v,w),_.return=b,_)}function d(b,v,w,_){return v===null||v.tag!==4||v.stateNode.containerInfo!==w.containerInfo||v.stateNode.implementation!==w.implementation?(v=wp(w,b.mode,_),v.return=b,v):(v=s(v,w.children||[]),v.return=b,v)}function u(b,v,w,_,j){return v===null||v.tag!==7?(v=Ni(w,b.mode,_,j),v.return=b,v):(v=s(v,w),v.return=b,v)}function h(b,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return v=vp(""+v,b.mode,w),v.return=b,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Ed:return w=bu(v.type,v.key,v.props,null,b.mode,w),w.ref=Vl(b,null,v),w.return=b,w;case xo:return v=wp(v,b.mode,w),v.return=b,v;case ha:var _=v._init;return h(b,_(v._payload),w)}if(Xl(v)||$l(v))return v=Ni(v,b.mode,w,null),v.return=b,v;Ld(b,v)}return null}function p(b,v,w,_){var j=v!==null?v.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return j!==null?null:l(b,v,""+w,_);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ed:return w.key===j?c(b,v,w,_):null;case xo:return w.key===j?d(b,v,w,_):null;case ha:return j=w._init,p(b,v,j(w._payload),_)}if(Xl(w)||$l(w))return j!==null?null:u(b,v,w,_,null);Ld(b,w)}return null}function m(b,v,w,_,j){if(typeof _=="string"&&_!==""||typeof _=="number")return b=b.get(w)||null,l(v,b,""+_,j);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Ed:return b=b.get(_.key===null?w:_.key)||null,c(v,b,_,j);case xo:return b=b.get(_.key===null?w:_.key)||null,d(v,b,_,j);case ha:var k=_._init;return m(b,v,w,k(_._payload),j)}if(Xl(_)||$l(_))return b=b.get(w)||null,u(v,b,_,j,null);Ld(v,_)}return null}function y(b,v,w,_){for(var j=null,k=null,N=v,P=v=0,T=null;N!==null&&P<w.length;P++){N.index>P?(T=N,N=null):T=N.sibling;var I=p(b,N,w[P],_);if(I===null){N===null&&(N=T);break}e&&N&&I.alternate===null&&t(b,N),v=a(I,v,P),k===null?j=I:k.sibling=I,k=I,N=T}if(P===w.length)return r(b,N),St&&ai(b,P),j;if(N===null){for(;P<w.length;P++)N=h(b,w[P],_),N!==null&&(v=a(N,v,P),k===null?j=N:k.sibling=N,k=N);return St&&ai(b,P),j}for(N=n(b,N);P<w.length;P++)T=m(N,b,P,w[P],_),T!==null&&(e&&T.alternate!==null&&N.delete(T.key===null?P:T.key),v=a(T,v,P),k===null?j=T:k.sibling=T,k=T);return e&&N.forEach(function(H){return t(b,H)}),St&&ai(b,P),j}function g(b,v,w,_){var j=$l(w);if(typeof j!="function")throw Error(ie(150));if(w=j.call(w),w==null)throw Error(ie(151));for(var k=j=null,N=v,P=v=0,T=null,I=w.next();N!==null&&!I.done;P++,I=w.next()){N.index>P?(T=N,N=null):T=N.sibling;var H=p(b,N,I.value,_);if(H===null){N===null&&(N=T);break}e&&N&&H.alternate===null&&t(b,N),v=a(H,v,P),k===null?j=H:k.sibling=H,k=H,N=T}if(I.done)return r(b,N),St&&ai(b,P),j;if(N===null){for(;!I.done;P++,I=w.next())I=h(b,I.value,_),I!==null&&(v=a(I,v,P),k===null?j=I:k.sibling=I,k=I);return St&&ai(b,P),j}for(N=n(b,N);!I.done;P++,I=w.next())I=m(N,b,P,I.value,_),I!==null&&(e&&I.alternate!==null&&N.delete(I.key===null?P:I.key),v=a(I,v,P),k===null?j=I:k.sibling=I,k=I);return e&&N.forEach(function(M){return t(b,M)}),St&&ai(b,P),j}function x(b,v,w,_){if(typeof w=="object"&&w!==null&&w.type===bo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ed:e:{for(var j=w.key,k=v;k!==null;){if(k.key===j){if(j=w.type,j===bo){if(k.tag===7){r(b,k.sibling),v=s(k,w.props.children),v.return=b,b=v;break e}}else if(k.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ha&&ix(j)===k.type){r(b,k.sibling),v=s(k,w.props),v.ref=Vl(b,k,w),v.return=b,b=v;break e}r(b,k);break}else t(b,k);k=k.sibling}w.type===bo?(v=Ni(w.props.children,b.mode,_,w.key),v.return=b,b=v):(_=bu(w.type,w.key,w.props,null,b.mode,_),_.ref=Vl(b,v,w),_.return=b,b=_)}return o(b);case xo:e:{for(k=w.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){r(b,v.sibling),v=s(v,w.children||[]),v.return=b,b=v;break e}else{r(b,v);break}else t(b,v);v=v.sibling}v=wp(w,b.mode,_),v.return=b,b=v}return o(b);case ha:return k=w._init,x(b,v,k(w._payload),_)}if(Xl(w))return y(b,v,w,_);if($l(w))return g(b,v,w,_);Ld(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(r(b,v.sibling),v=s(v,w),v.return=b,b=v):(r(b,v),v=vp(w,b.mode,_),v.return=b,b=v),o(b)):r(b,v)}return x}var sl=wj(!0),xj=wj(!1),Ku=Qa(null),Zu=null,Eo=null,Ny=null;function Sy(){Ny=Eo=Zu=null}function Cy(e){var t=Ku.current;kt(Ku),e._currentValue=t}function Dm(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Mo(e,t){Zu=e,Ny=Eo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&($r=!0),e.firstContext=null)}function xn(e){var t=e._currentValue;if(Ny!==e)if(e={context:e,memoizedValue:t,next:null},Eo===null){if(Zu===null)throw Error(ie(308));Eo=e,Zu.dependencies={lanes:0,firstContext:e}}else Eo=Eo.next=e;return t}var pi=null;function zy(e){pi===null?pi=[e]:pi.push(e)}function bj(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,zy(t)):(r.next=s.next,s.next=r),t.interleaved=r,Ws(e,n)}function Ws(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var fa=!1;function Ey(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _j(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ls(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ta(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,nt&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,Ws(e,r)}return s=n.interleaved,s===null?(t.next=t,zy(n)):(t.next=s.next,s.next=t),n.interleaved=t,Ws(e,r)}function mu(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,py(e,r)}}function ox(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?s=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?s=a=t:a=a.next=t}else s=a=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Gu(e,t,r,n){var s=e.updateQueue;fa=!1;var a=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,d=c.next;c.next=null,o===null?a=d:o.next=d,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=d:l.next=d,u.lastBaseUpdate=c))}if(a!==null){var h=s.baseState;o=0,u=d=c=null,l=a;do{var p=l.lane,m=l.eventTime;if((n&p)===p){u!==null&&(u=u.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,g=l;switch(p=t,m=r,g.tag){case 1:if(y=g.payload,typeof y=="function"){h=y.call(m,h,p);break e}h=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=g.payload,p=typeof y=="function"?y.call(m,h,p):y,p==null)break e;h=Tt({},h,p);break e;case 2:fa=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=s.effects,p===null?s.effects=[l]:p.push(l))}else m={eventTime:m,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=m,c=h):u=u.next=m,o|=p;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;p=l,l=p.next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}while(!0);if(u===null&&(c=h),s.baseState=c,s.firstBaseUpdate=d,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else a===null&&(s.shared.lanes=0);Ri|=o,e.lanes=o,e.memoizedState=h}}function lx(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(ie(191,s));s.call(n)}}}var ld={},vs=Qa(ld),Tc=Qa(ld),Rc=Qa(ld);function mi(e){if(e===ld)throw Error(ie(174));return e}function Py(e,t){switch(wt(Rc,t),wt(Tc,e),wt(vs,ld),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:mm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=mm(t,e)}kt(vs),wt(vs,t)}function al(){kt(vs),kt(Tc),kt(Rc)}function jj(e){mi(Rc.current);var t=mi(vs.current),r=mm(t,e.type);t!==r&&(wt(Tc,e),wt(vs,r))}function Ty(e){Tc.current===e&&(kt(vs),kt(Tc))}var zt=Qa(0);function Qu(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var hp=[];function Ry(){for(var e=0;e<hp.length;e++)hp[e]._workInProgressVersionPrimary=null;hp.length=0}var gu=ea.ReactCurrentDispatcher,fp=ea.ReactCurrentBatchConfig,Ti=0,Et=null,Jt=null,ar=null,Yu=!1,dc=!1,Oc=0,ZT=0;function gr(){throw Error(ie(321))}function Oy(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Gn(e[r],t[r]))return!1;return!0}function Ay(e,t,r,n,s,a){if(Ti=a,Et=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,gu.current=e===null||e.memoizedState===null?JT:XT,e=r(n,s),dc){a=0;do{if(dc=!1,Oc=0,25<=a)throw Error(ie(301));a+=1,ar=Jt=null,t.updateQueue=null,gu.current=eR,e=r(n,s)}while(dc)}if(gu.current=Ju,t=Jt!==null&&Jt.next!==null,Ti=0,ar=Jt=Et=null,Yu=!1,t)throw Error(ie(300));return e}function Dy(){var e=Oc!==0;return Oc=0,e}function is(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ar===null?Et.memoizedState=ar=e:ar=ar.next=e,ar}function bn(){if(Jt===null){var e=Et.alternate;e=e!==null?e.memoizedState:null}else e=Jt.next;var t=ar===null?Et.memoizedState:ar.next;if(t!==null)ar=t,Jt=e;else{if(e===null)throw Error(ie(310));Jt=e,e={memoizedState:Jt.memoizedState,baseState:Jt.baseState,baseQueue:Jt.baseQueue,queue:Jt.queue,next:null},ar===null?Et.memoizedState=ar=e:ar=ar.next=e}return ar}function Ac(e,t){return typeof t=="function"?t(e):t}function pp(e){var t=bn(),r=t.queue;if(r===null)throw Error(ie(311));r.lastRenderedReducer=e;var n=Jt,s=n.baseQueue,a=r.pending;if(a!==null){if(s!==null){var o=s.next;s.next=a.next,a.next=o}n.baseQueue=s=a,r.pending=null}if(s!==null){a=s.next,n=n.baseState;var l=o=null,c=null,d=a;do{var u=d.lane;if((Ti&u)===u)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),n=d.hasEagerState?d.eagerState:e(n,d.action);else{var h={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=h,o=n):c=c.next=h,Et.lanes|=u,Ri|=u}d=d.next}while(d!==null&&d!==a);c===null?o=n:c.next=l,Gn(n,t.memoizedState)||($r=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do a=s.lane,Et.lanes|=a,Ri|=a,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);
vendor: 4,902 bytes, line 38
38return[t.memoizedState,r.dispatch]}function mp(e){var t=bn(),r=t.queue;if(r===null)throw Error(ie(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,a=t.memoizedState;if(s!==null){r.pending=null;var o=s=s.next;do a=e(a,o.action),o=o.next;while(o!==s);Gn(a,t.memoizedState)||($r=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function kj(){}function Nj(e,t){var r=Et,n=bn(),s=t(),a=!Gn(n.memoizedState,s);if(a&&(n.memoizedState=s,$r=!0),n=n.queue,Iy(zj.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||ar!==null&&ar.memoizedState.tag&1){if(r.flags|=2048,Dc(9,Cj.bind(null,r,n,s,t),void 0,null),lr===null)throw Error(ie(349));Ti&30||Sj(r,t,s)}return s}function Sj(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Et.updateQueue,t===null?(t={lastEffect:null,stores:null},Et.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Cj(e,t,r,n){t.value=r,t.getSnapshot=n,Ej(t)&&Pj(e)}function zj(e,t,r){return r(function(){Ej(t)&&Pj(e)})}function Ej(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Gn(e,r)}catch{return!0}}function Pj(e){var t=Ws(e,1);t!==null&&Hn(t,e,1,-1)}function cx(e){var t=is();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ac,lastRenderedState:e},t.queue=e,e=e.dispatch=YT.bind(null,Et,e),[t.memoizedState,e]}function Dc(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Et.updateQueue,t===null?(t={lastEffect:null,stores:null},Et.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function Tj(){return bn().memoizedState}function yu(e,t,r,n){var s=is();Et.flags|=e,s.memoizedState=Dc(1|t,r,void 0,n===void 0?null:n)}function Bh(e,t,r,n){var s=bn();n=n===void 0?null:n;var a=void 0;if(Jt!==null){var o=Jt.memoizedState;if(a=o.destroy,n!==null&&Oy(n,o.deps)){s.memoizedState=Dc(t,r,a,n);return}}Et.flags|=e,s.memoizedState=Dc(1|t,r,a,n)}function dx(e,t){return yu(8390656,8,e,t)}function Iy(e,t){return Bh(2048,8,e,t)}function Rj(e,t){return Bh(4,2,e,t)}function Oj(e,t){return Bh(4,4,e,t)}function Aj(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Dj(e,t,r){return r=r!=null?r.concat([e]):null,Bh(4,4,Aj.bind(null,t,e),r)}function My(){}function Ij(e,t){var r=bn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Oy(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Mj(e,t){var r=bn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Oy(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Fj(e,t,r){return Ti&21?(Gn(r,t)||(r=W_(),Et.lanes|=r,Ri|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,$r=!0),e.memoizedState=r)}function GT(e,t){var r=pt;pt=r!==0&&4>r?r:4,e(!0);var n=fp.transition;fp.transition={};try{e(!1),t()}finally{pt=r,fp.transition=n}}function $j(){return bn().memoizedState}function QT(e,t,r){var n=Oa(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Lj(e))Uj(t,r);else if(r=bj(e,t,r,n),r!==null){var s=Tr();Hn(r,e,n,s),Bj(r,t,n)}}function YT(e,t,r){var n=Oa(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Lj(e))Uj(t,s);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,r);if(s.hasEagerState=!0,s.eagerState=l,Gn(l,o)){var c=t.interleaved;c===null?(s.next=s,zy(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}r=bj(e,t,s,n),r!==null&&(s=Tr(),Hn(r,e,n,s),Bj(r,t,n))}}function Lj(e){var t=e.alternate;return e===Et||t!==null&&t===Et}function Uj(e,t){dc=Yu=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Bj(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,py(e,r)}}var Ju={readContext:xn,useCallback:gr,useContext:gr,useEffect:gr,useImperativeHandle:gr,useInsertionEffect:gr,useLayoutEffect:gr,useMemo:gr,useReducer:gr,useRef:gr,useState:gr,useDebugValue:gr,useDeferredValue:gr,useTransition:gr,useMutableSource:gr,useSyncExternalStore:gr,useId:gr,unstable_isNewReconciler:!1},JT={readContext:xn,useCallback:function(e,t){return is().memoizedState=[e,t===void 0?null:t],e},useContext:xn,useEffect:dx,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,yu(4194308,4,Aj.bind(null,t,e),r)},useLayoutEffect:function(e,t){return yu(4194308,4,e,t)},useInsertionEffect:function(e,t){return yu(4,2,e,t)},useMemo:function(e,t){var r=is();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=is();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=QT.bind(null,Et,e),[n.memoizedState,e]}
vendor: 5,924 bytes, lines 38-40
38,useRef:function(e){var t=is();return e={current:e},t.memoizedState=e},useState:cx,useDebugValue:My,useDeferredValue:function(e){return is().memoizedState=e},useTransition:function(){var e=cx(!1),t=e[0];return e=GT.bind(null,e[1]),is().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Et,s=is();if(St){if(r===void 0)throw Error(ie(407));r=r()}else{if(r=t(),lr===null)throw Error(ie(349));Ti&30||Sj(n,t,r)}s.memoizedState=r;var a={value:r,getSnapshot:t};return s.queue=a,dx(zj.bind(null,n,a,e),[e]),n.flags|=2048,Dc(9,Cj.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=is(),t=lr.identifierPrefix;if(St){var r=$s,n=Fs;r=(n&~(1<<32-qn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Oc++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=ZT++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},XT={readContext:xn,useCallback:Ij,useContext:xn,useEffect:Iy,useImperativeHandle:Dj,useInsertionEffect:Rj,useLayoutEffect:Oj,useMemo:Mj,useReducer:pp,useRef:Tj,useState:function(){return pp(Ac)},useDebugValue:My,useDeferredValue:function(e){var t=bn();return Fj(t,Jt.memoizedState,e)},useTransition:function(){var e=pp(Ac)[0],t=bn().memoizedState;return[e,t]},useMutableSource:kj,useSyncExternalStore:Nj,useId:$j,unstable_isNewReconciler:!1},eR={readContext:xn,useCallback:Ij,useContext:xn,useEffect:Iy,useImperativeHandle:Dj,useInsertionEffect:Rj,useLayoutEffect:Oj,useMemo:Mj,useReducer:mp,useRef:Tj,useState:function(){return mp(Ac)},useDebugValue:My,useDeferredValue:function(e){var t=bn();return Jt===null?t.memoizedState=e:Fj(t,Jt.memoizedState,e)},useTransition:function(){var e=mp(Ac)[0],t=bn().memoizedState;return[e,t]},useMutableSource:kj,useSyncExternalStore:Nj,useId:$j,unstable_isNewReconciler:!1};function An(e,t){if(e&&e.defaultProps){t=Tt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Im(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:Tt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Wh={isMounted:function(e){return(e=e._reactInternals)?Gi(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Tr(),s=Oa(e),a=Ls(n,s);a.payload=t,r!=null&&(a.callback=r),t=Ta(e,a,s),t!==null&&(Hn(t,e,s,n),mu(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Tr(),s=Oa(e),a=Ls(n,s);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=Ta(e,a,s),t!==null&&(Hn(t,e,s,n),mu(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Tr(),n=Oa(e),s=Ls(r,n);s.tag=2,t!=null&&(s.callback=t),t=Ta(e,s,n),t!==null&&(Hn(t,e,n,r),mu(t,e,n))}};function ux(e,t,r,n,s,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,o):t.prototype&&t.prototype.isPureReactComponent?!Cc(r,n)||!Cc(s,a):!0}function Wj(e,t,r){var n=!1,s=La,a=t.contextType;return typeof a=="object"&&a!==null?a=xn(a):(s=Ur(t)?Ei:br.current,n=t.contextTypes,a=(n=n!=null)?rl(e,s):La),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Wh,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=a),t}function hx(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Wh.enqueueReplaceState(t,t.state,null)}function Mm(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},Ey(e);var a=t.contextType;typeof a=="object"&&a!==null?s.context=xn(a):(a=Ur(t)?Ei:br.current,s.context=rl(e,a)),s.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Im(e,t,a,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Wh.enqueueReplaceState(s,s.state,null),Gu(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function il(e,t){try{var r="",n=t;do r+=zP(n),n=n.return;while(n);var s=r}catch(a){s=`
39Error generating stack: `+a.message+`
40`+a.stack}return{value:e,source:t,stack:s,digest:null}}function gp(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Fm(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var tR=typeof WeakMap=="function"?WeakMap:Map;function Vj(e,t,r){r=Ls(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){eh||(eh=!0,Zm=n),Fm(e,t)},r}function qj(e,t,r){r=Ls(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){Fm(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Fm(e,t),typeof n!="function"&&(Ra===null?Ra=new Set([this]):Ra.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function fx(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new tR;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=mR.bind(null,e,t,r),t.then(e,e))}function px(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function mx(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Ls(-1,1),t.tag=2,Ta(r,t,1))),r.lanes|=1),e)}var rR=ea.ReactCurrentOwner,$r=!1;function kr(e,t,r,n){t.child=e===null?xj(t,null,r,n):sl(t,e.child,r,n)}function gx(e,t,r,n,s){r=r.render;var a=t.ref;
vendor: 10,319 bytes, line 40
40return Mo(t,s),n=Ay(e,t,r,n,a,s),r=Dy(),e!==null&&!$r?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Vs(e,t,s)):(St&&r&&_y(t),t.flags|=1,kr(e,t,n,s),t.child)}function yx(e,t,r,n,s){if(e===null){var a=r.type;return typeof a=="function"&&!qy(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,Hj(e,t,a,n,s)):(e=bu(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&s)){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:Cc,r(o,n)&&e.ref===t.ref)return Vs(e,t,s)}return t.flags|=1,e=Aa(a,n),e.ref=t.ref,e.return=t,t.child=e}function Hj(e,t,r,n,s){if(e!==null){var a=e.memoizedProps;if(Cc(a,n)&&e.ref===t.ref)if($r=!1,t.pendingProps=n=a,(e.lanes&s)!==0)e.flags&131072&&($r=!0);else return t.lanes=e.lanes,Vs(e,t,s)}return $m(e,t,r,n,s)}function Kj(e,t,r){var n=t.pendingProps,s=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},wt(To,Gr),Gr|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,wt(To,Gr),Gr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,wt(To,Gr),Gr|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,wt(To,Gr),Gr|=n;return kr(e,t,s,r),t.child}function Zj(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function $m(e,t,r,n,s){var a=Ur(r)?Ei:br.current;return a=rl(t,a),Mo(t,s),r=Ay(e,t,r,n,a,s),n=Dy(),e!==null&&!$r?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Vs(e,t,s)):(St&&n&&_y(t),t.flags|=1,kr(e,t,r,s),t.child)}function vx(e,t,r,n,s){if(Ur(r)){var a=!0;Vu(t)}else a=!1;if(Mo(t,s),t.stateNode===null)vu(e,t),Wj(t,r,n),Mm(t,r,n,s),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,d=r.contextType;typeof d=="object"&&d!==null?d=xn(d):(d=Ur(r)?Ei:br.current,d=rl(t,d));var u=r.getDerivedStateFromProps,h=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||c!==d)&&hx(t,o,n,d),fa=!1;var p=t.memoizedState;o.state=p,Gu(t,n,o,s),c=t.memoizedState,l!==n||p!==c||Lr.current||fa?(typeof u=="function"&&(Im(t,r,u,n),c=t.memoizedState),(l=fa||ux(t,r,l,n,p,c,d))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),o.props=n,o.state=c,o.context=d,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,_j(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:An(t.type,l),o.props=d,h=t.pendingProps,p=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=xn(c):(c=Ur(r)?Ei:br.current,c=rl(t,c));var m=r.getDerivedStateFromProps;(u=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==h||p!==c)&&hx(t,o,n,c),fa=!1,p=t.memoizedState,o.state=p,Gu(t,n,o,s);var y=t.memoizedState;l!==h||p!==y||Lr.current||fa?(typeof m=="function"&&(Im(t,r,m,n),y=t.memoizedState),(d=fa||ux(t,r,d,n,p,y,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,y,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,y,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=y),o.props=n,o.state=y,o.context=c,n=d):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),n=!1)}return Lm(e,t,r,n,a,s)}function Lm(e,t,r,n,s,a){Zj(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return s&&nx(t,r,!1),Vs(e,t,a);n=t.stateNode,rR.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=sl(t,e.child,null,a),t.child=sl(t,null,l,a)):kr(e,t,l,a),t.memoizedState=n.state,s&&nx(t,r,!0),t.child}function Gj(e){var t=e.stateNode;t.pendingContext?rx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&rx(e,t.context,!1),Py(e,t.containerInfo)}function wx(e,t,r,n,s){return nl(),ky(s),t.flags|=256,kr(e,t,r,n),t.child}var Um={dehydrated:null,treeContext:null,retryLane:0};function Bm(e){return{baseLanes:e,cachePool:null,transitions:null}}function Qj(e,t,r){var n=t.pendingProps,s=zt.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),wt(zt,s&1),e===null)return Am(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,a?(n=t.mode,a=t.child,o={mode:"hidden",children:o},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Hh(o,n,0,null),e=Ni(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Bm(r),t.memoizedState=Um,e):Fy(t,o));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return nR(e,t,o,n,l,s,r);if(a){a=n.fallback,o=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=Aa(s,c),n.subtreeFlags=s.subtreeFlags&14680064),l!==null?a=Aa(l,a):(a=Ni(a,o,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,o=e.child.memoizedState,o=o===null?Bm(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=Um,n}return a=e.child,e=a.sibling,n=Aa(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Fy(e,t){return t=Hh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ud(e,t,r,n){return n!==null&&ky(n),sl(t,e.child,null,r),e=Fy(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nR(e,t,r,n,s,a,o){if(r)return t.flags&256?(t.flags&=-257,n=gp(Error(ie(422))),Ud(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,s=t.mode,n=Hh({mode:"visible",children:n.children},s,0,null),a=Ni(a,s,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&sl(t,e.child,null,o),t.child.memoizedState=Bm(o),t.memoizedState=Um,a);if(!(t.mode&1))return Ud(e,t,o,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(ie(419)),n=gp(a,n,void 0),Ud(e,t,o,n)}if(l=(o&e.childLanes)!==0,$r||l){if(n=lr,n!==null){switch(o&-o){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|o)?0:s,s!==0&&s!==a.retryLane&&(a.retryLane=s,Ws(e,s),Hn(n,e,s,-1))}return Vy(),n=gp(Error(ie(421))),Ud(e,t,o,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=gR.bind(null,e),s._reactRetry=t,null):(e=a.treeContext,en=Pa(s.nextSibling),tn=t,St=!0,Un=null,e!==null&&(fn[pn++]=Fs,fn[pn++]=$s,fn[pn++]=Pi,Fs=e.id,$s=e.overflow,Pi=t),t=Fy(t,n.children),t.flags|=4096,t)}function xx(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Dm(e.return,t,r)}function yp(e,t,r,n,s){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=s)}function Yj(e,t,r){var n=t.pendingProps,s=n.revealOrder,a=n.tail;if(kr(e,t,n.children,r),n=zt.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xx(e,r,t);else if(e.tag===19)xx(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(wt(zt,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&Qu(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),yp(t,!1,s,r,a);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Qu(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}yp(t,!0,r,null,a);break;case"together":yp(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function vu(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Vs(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Ri|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ie(153));if(t.child!==null){for(e=t.child,r=Aa(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Aa(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function sR(e,t,r){switch(t.tag){case 3:Gj(t),nl();break;case 5:jj(t);break;case 1:Ur(t.type)&&Vu(t);break;case 4:Py(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;wt(Ku,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(wt(zt,zt.current&1),t.flags|=128,null):r&t.child.childLanes?Qj(e,t,r):(wt(zt,zt.current&1),e=Vs(e,t,r),e!==null?e.sibling:null);
vendor: 4,824 bytes, line 40
40wt(zt,zt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Yj(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),wt(zt,zt.current),n)break;return null;case 22:case 23:return t.lanes=0,Kj(e,t,r)}return Vs(e,t,r)}var Jj,Wm,Xj,ek;Jj=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&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;r=r.return}r.sibling.return=r.return,r=r.sibling}};Wm=function(){};Xj=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,mi(vs.current);var a=null;switch(r){case"input":s=um(e,s),n=um(e,n),a=[];break;case"select":s=Tt({},s,{value:void 0}),n=Tt({},n,{value:void 0}),a=[];break;case"textarea":s=pm(e,s),n=pm(e,n),a=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Bu)}gm(r,n);var o;r=null;for(d in s)if(!n.hasOwnProperty(d)&&s.hasOwnProperty(d)&&s[d]!=null)if(d==="style"){var l=s[d];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(xc.hasOwnProperty(d)?a||(a=[]):(a=a||[]).push(d,null));for(d in n){var c=n[d];if(l=s!=null?s[d]:void 0,n.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(a||(a=[]),a.push(d,r)),r=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(xc.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&jt("scroll",e),a||l===c||(a=[])):(a=a||[]).push(d,c))}r&&(a=a||[]).push("style",r);var d=a;(t.updateQueue=d)&&(t.flags|=4)}};ek=function(e,t,r,n){r!==n&&(t.flags|=4)};function ql(e,t){if(!St)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function yr(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function aR(e,t,r){var n=t.pendingProps;switch(jy(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yr(t),null;case 1:return Ur(t.type)&&Wu(),yr(t),null;case 3:return n=t.stateNode,al(),kt(Lr),kt(br),Ry(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&($d(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Un!==null&&(Ym(Un),Un=null))),Wm(e,t),yr(t),null;case 5:Ty(t);var s=mi(Rc.current);if(r=t.type,e!==null&&t.stateNode!=null)Xj(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(ie(166));return yr(t),null}if(e=mi(vs.current),$d(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[ds]=t,n[Pc]=a,e=(t.mode&1)!==0,r){case"dialog":jt("cancel",n),jt("close",n);break;case"iframe":case"object":case"embed":jt("load",n);break;case"video":case"audio":for(s=0;s<tc.length;s++)jt(tc[s],n);break;case"source":jt("error",n);break;case"img":case"image":case"link":jt("error",n),jt("load",n);break;case"details":jt("toggle",n);break;case"input":Ew(n,a),jt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},jt("invalid",n);break;case"textarea":Tw(n,a),jt("invalid",n)}gm(r,a),s=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?n.textContent!==l&&(a.suppressHydrationWarning!==!0&&Fd(n.textContent,l,e),s=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Fd(n.textContent,l,e),s=["children",""+l]):xc.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&jt("scroll",n)}switch(r){case"input":Pd(n),Pw(n,a,!0);break;case"textarea":Pd(n),Rw(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=Bu)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=z_(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>
40",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[ds]=t,e[Pc]=n,Jj(e,t,!1,!1),t.stateNode=e;e:{switch(o=ym(r,n),r){case"dialog":jt("cancel",e),jt("close",e),s=n;break;case"iframe":case"object":case"embed":jt("load",e),s=n;break;case"video":case"audio":for(s=0;s<tc.length;s++)jt(tc[s],e);s=n;break;case"source":jt("error",e),s=n;break;case"img":case"image":case"link":jt("error",e),jt("load",e),s=n;break;case"details":jt("toggle",e),s=n;break;case"input":Ew(e,n),s=um(e,n),jt("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=Tt({},n,{value:void 0}),jt("invalid",e);break;case"textarea":Tw(e,n),s=pm(e,n),jt("invalid",e);break;default:s=n}gm(r,s),l=s;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?T_(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&E_(e,c)):a==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&bc(e,c):typeof c=="number"&&bc(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(xc.hasOwnProperty(a)?c!=null&&a==="onScroll"&&jt("scroll",e):c!=null&&ly(e,a,c,o))}switch(r){case"input":Pd(e),Pw(e,n,!1);break;case"textarea":Pd(e),Rw(e);break;case"option":n.value!=null&&e.setAttribute("value",""+$a(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?Oo(e,!!n.multiple,a,!1):n.defaultValue!=null&&Oo(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Bu)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return yr(t),null;case 6:if(e&&t.stateNode!=null)ek(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(ie(166));if(r=mi(Rc.current),mi(vs.current),$d(t)){if(n=t.stateNode,r=t.memoizedProps,n[ds]=t,(a=n.nodeValue!==r)&&(e=tn,e!==null))switch(e.tag){case 3:Fd(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Fd(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[ds]=t,t.stateNode=n}return yr(t),null;case 13:if(kt(zt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(St&&en!==null&&t.mode&1&&!(t.flags&128))vj(),nl(),t.flags|=98560,a=!1;else if(a=$d(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(ie(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(ie(317));a[ds]=t}else nl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yr(t),a=!1}else Un!==null&&(Ym(Un),Un=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||zt.current&1?Xt===0&&(Xt=3):Vy())),t.updateQueue!==null&&(t.flags|=4),yr(t),null);case 4:return al(),Wm(e,t),e===null&&zc(t.stateNode.containerInfo),yr(t),null;case 10:return Cy(t.type._context),yr(t),null;case 17:return Ur(t.type)&&Wu(),yr(t),null;case 19:if(kt(zt),a=t.memoizedState,a===null)return yr(t),null;if(n=(t.flags&128)!==0,o=a.rendering,o===null)if(n)ql(a,!1);else{if(Xt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Qu(e),o!==null){for(t.flags|=128,ql(a,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return wt(zt,zt.current&1|2),t.child}e=e.sibling}a.tail!==null&&Wt()>ol&&(t.flags|=128,n=!0,ql(a,!1),t.lanes=4194304)}else{if(!n)if(e=Qu(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ql(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!St)return yr(t),null}else 2*Wt()-a.renderingStartTime>ol&&r!==1073741824&&(t.flags|=128,n=!0,ql(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Wt(),t.sibling=null,r=zt.current,wt(zt,n?r&1|2:r&1),t):(yr(t),null);case 22:case 23:return Wy(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Gr&1073741824&&(yr(t),t.subtreeFlags&6&&(t.flags|=8192)):yr(t),null;case 24:return null;case 25:return null}throw Error(ie(156,t.tag))}function iR(e,t){switch(jy(t),t.tag){case 1:return Ur(t.type)&&Wu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;
vendor: 14,407 bytes, line 40
40case 3:return al(),kt(Lr),kt(br),Ry(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ty(t),null;case 13:if(kt(zt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ie(340));nl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return kt(zt),null;case 4:return al(),null;case 10:return Cy(t.type._context),null;case 22:case 23:return Wy(),null;case 24:return null;default:return null}}var Bd=!1,wr=!1,oR=typeof WeakSet=="function"?WeakSet:Set,xe=null;function Po(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Mt(e,t,n)}else r.current=null}function Vm(e,t,r){try{r()}catch(n){Mt(e,t,n)}}var bx=!1;function lR(e,t){if(Cm=$u,e=aj(),by(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,d=0,u=0,h=e,p=null;t:for(;;){for(var m;h!==r||s!==0&&h.nodeType!==3||(l=o+s),h!==a||n!==0&&h.nodeType!==3||(c=o+n),h.nodeType===3&&(o+=h.nodeValue.length),(m=h.firstChild)!==null;)p=h,h=m;for(;;){if(h===e)break t;if(p===r&&++d===s&&(l=o),p===a&&++u===n&&(c=o),(m=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=m}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(zm={focusedElem:e,selectionRange:r},$u=!1,xe=t;xe!==null;)if(t=xe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xe=e;else for(;xe!==null;){t=xe;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var g=y.memoizedProps,x=y.memoizedState,b=t.stateNode,v=b.getSnapshotBeforeUpdate(t.elementType===t.type?g:An(t.type,g),x);b.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ie(163))}}catch(_){Mt(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,xe=e;break}xe=t.return}return y=bx,bx=!1,y}function uc(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var a=s.destroy;s.destroy=void 0,a!==void 0&&Vm(t,r,a)}s=s.next}while(s!==n)}}function Vh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function qm(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function tk(e){var t=e.alternate;t!==null&&(e.alternate=null,tk(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ds],delete t[Pc],delete t[Tm],delete t[VT],delete t[qT])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function rk(e){return e.tag===5||e.tag===3||e.tag===4}function _x(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||rk(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hm(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Bu));else if(n!==4&&(e=e.child,e!==null))for(Hm(e,t,r),e=e.sibling;e!==null;)Hm(e,t,r),e=e.sibling}function Km(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Km(e,t,r),e=e.sibling;e!==null;)Km(e,t,r),e=e.sibling}var hr=null,$n=!1;function aa(e,t,r){for(r=r.child;r!==null;)nk(e,t,r),r=r.sibling}function nk(e,t,r){if(ys&&typeof ys.onCommitFiberUnmount=="function")try{ys.onCommitFiberUnmount(Ih,r)}catch{}switch(r.tag){case 5:wr||Po(r,t);case 6:var n=hr,s=$n;hr=null,aa(e,t,r),hr=n,$n=s,hr!==null&&($n?(e=hr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):hr.removeChild(r.stateNode));break;case 18:hr!==null&&($n?(e=hr,r=r.stateNode,e.nodeType===8?dp(e.parentNode,r):e.nodeType===1&&dp(e,r),Nc(e)):dp(hr,r.stateNode));break;case 4:n=hr,s=$n,hr=r.stateNode.containerInfo,$n=!0,aa(e,t,r),hr=n,$n=s;break;case 0:case 11:case 14:case 15:if(!wr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var a=s,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Vm(r,t,o),s=s.next}while(s!==n)}aa(e,t,r);break;case 1:if(!wr&&(Po(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Mt(r,t,l)}aa(e,t,r);break;case 21:aa(e,t,r);break;case 22:r.mode&1?(wr=(n=wr)||r.memoizedState!==null,aa(e,t,r),wr=n):aa(e,t,r);break;default:aa(e,t,r)}}function jx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new oR),t.forEach(function(n){var s=yR.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function Cn(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:hr=l.stateNode,$n=!1;break e;case 3:hr=l.stateNode.containerInfo,$n=!0;break e;case 4:hr=l.stateNode.containerInfo,$n=!0;break e}l=l.return}if(hr===null)throw Error(ie(160));nk(a,o,s),hr=null,$n=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(d){Mt(s,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)sk(t,e),t=t.sibling}function sk(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Cn(t,e),as(e),n&4){try{uc(3,e,e.return),Vh(3,e)}catch(g){Mt(e,e.return,g)}try{uc(5,e,e.return)}catch(g){Mt(e,e.return,g)}}break;case 1:Cn(t,e),as(e),n&512&&r!==null&&Po(r,r.return);break;case 5:if(Cn(t,e),as(e),n&512&&r!==null&&Po(r,r.return),e.flags&32){var s=e.stateNode;try{bc(s,"")}catch(g){Mt(e,e.return,g)}}if(n&4&&(s=e.stateNode,s!=null)){var a=e.memoizedProps,o=r!==null?r.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&S_(s,a),ym(l,o);var d=ym(l,a);for(o=0;o<c.length;o+=2){var u=c[o],h=c[o+1];u==="style"?T_(s,h):u==="dangerouslySetInnerHTML"?E_(s,h):u==="children"?bc(s,h):ly(s,u,h,d)}switch(l){case"input":hm(s,a);break;case"textarea":C_(s,a);break;case"select":var p=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?Oo(s,!!a.multiple,m,!1):p!==!!a.multiple&&(a.defaultValue!=null?Oo(s,!!a.multiple,a.defaultValue,!0):Oo(s,!!a.multiple,a.multiple?[]:"",!1))}s[Pc]=a}catch(g){Mt(e,e.return,g)}}break;case 6:if(Cn(t,e),as(e),n&4){if(e.stateNode===null)throw Error(ie(162));s=e.stateNode,a=e.memoizedProps;try{s.nodeValue=a}catch(g){Mt(e,e.return,g)}}break;case 3:if(Cn(t,e),as(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Nc(t.containerInfo)}catch(g){Mt(e,e.return,g)}break;case 4:Cn(t,e),as(e);break;case 13:Cn(t,e),as(e),s=e.child,s.flags&8192&&(a=s.memoizedState!==null,s.stateNode.isHidden=a,!a||s.alternate!==null&&s.alternate.memoizedState!==null||(Uy=Wt())),n&4&&jx(e);break;case 22:if(u=r!==null&&r.memoizedState!==null,e.mode&1?(wr=(d=wr)||u,Cn(t,e),wr=d):Cn(t,e),as(e),n&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!u&&e.mode&1)for(xe=e,u=e.child;u!==null;){for(h=xe=u;xe!==null;){switch(p=xe,m=p.child,p.tag){case 0:case 11:case 14:case 15:uc(4,p,p.return);break;case 1:Po(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){n=p,r=p.return;try{t=n,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(g){Mt(n,r,g)}}break;case 5:Po(p,p.return);break;case 22:if(p.memoizedState!==null){Nx(h);continue}}m!==null?(m.return=p,xe=m):Nx(h)}u=u.sibling}e:for(u=null,h=e;;){if(h.tag===5){if(u===null){u=h;try{s=h.stateNode,d?(a=s.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=h.stateNode,c=h.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=P_("display",o))}catch(g){Mt(e,e.return,g)}}}else if(h.tag===6){if(u===null)try{h.stateNode.nodeValue=d?"":h.memoizedProps}catch(g){Mt(e,e.return,g)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;u===h&&(u=null),h=h.return}u===h&&(u=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Cn(t,e),as(e),n&4&&jx(e);break;case 21:break;default:Cn(t,e),as(e)}}function as(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(rk(r)){var n=r;break e}r=r.return}throw Error(ie(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(bc(s,""),n.flags&=-33);var a=_x(e);Km(e,a,s);break;case 3:case 4:var o=n.stateNode.containerInfo,l=_x(e);Hm(e,l,o);break;default:throw Error(ie(161))}}catch(c){Mt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function cR(e,t,r){xe=e,ak(e)}function ak(e,t,r){for(var n=(e.mode&1)!==0;xe!==null;){var s=xe,a=s.child;if(s.tag===22&&n){var o=s.memoizedState!==null||Bd;if(!o){var l=s.alternate,c=l!==null&&l.memoizedState!==null||wr;l=Bd;var d=wr;if(Bd=o,(wr=c)&&!d)for(xe=s;xe!==null;)o=xe,c=o.child,o.tag===22&&o.memoizedState!==null?Sx(s):c!==null?(c.return=o,xe=c):Sx(s);for(;a!==null;)xe=a,ak(a),a=a.sibling;xe=s,Bd=l,wr=d}kx(e)}else s.subtreeFlags&8772&&a!==null?(a.return=s,xe=a):kx(e)}}function kx(e){for(;xe!==null;){var t=xe;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:wr||Vh(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!wr)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:An(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&lx(t,a,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}lx(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var u=d.memoizedState;if(u!==null){var h=u.dehydrated;h!==null&&Nc(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ie(163))}wr||t.flags&512&&qm(t)}catch(p){Mt(t,t.return,p)}}if(t===e){xe=null;break}if(r=t.sibling,r!==null){r.return=t.return,xe=r;break}xe=t.return}}function Nx(e){for(;xe!==null;){var t=xe;if(t===e){xe=null;break}var r=t.sibling;if(r!==null){r.return=t.return,xe=r;break}xe=t.return}}function Sx(e){for(;xe!==null;){var t=xe;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Vh(4,t)}catch(c){Mt(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(c){Mt(t,s,c)}}var a=t.return;try{qm(t)}catch(c){Mt(t,a,c)}break;case 5:var o=t.return;try{qm(t)}catch(c){Mt(t,o,c)}}}catch(c){Mt(t,t.return,c)}if(t===e){xe=null;break}var l=t.sibling;if(l!==null){l.return=t.return,xe=l;break}xe=t.return}}var dR=Math.ceil,Xu=ea.ReactCurrentDispatcher,$y=ea.ReactCurrentOwner,wn=ea.ReactCurrentBatchConfig,nt=0,lr=null,Kt=null,fr=0,Gr=0,To=Qa(0),Xt=0,Ic=null,Ri=0,qh=0,Ly=0,hc=null,Fr=null,Uy=0,ol=1/0,Os=null,eh=!1,Zm=null,Ra=null,Wd=!1,ka=null,th=0,fc=0,Gm=null,wu=-1,xu=0;function Tr(){return nt&6?Wt():wu!==-1?wu:wu=Wt()}function Oa(e){return e.mode&1?nt&2&&fr!==0?fr&-fr:KT.transition!==null?(xu===0&&(xu=W_()),xu):(e=pt,e!==0||(e=window.event,e=e===void 0?16:Q_(e.type)),e):1}function Hn(e,t,r,n){if(50<fc)throw fc=0,Gm=null,Error(ie(185));ad(e,r,n),(!(nt&2)||e!==lr)&&(e===lr&&(!(nt&2)&&(qh|=r),Xt===4&&ga(e,fr)),Br(e,n),r===1&&nt===0&&!(t.mode&1)&&(ol=Wt()+500,Uh&&Ya()))}function Br(e,t){var r=e.callbackNode;KP(e,t);var n=Fu(e,e===lr?fr:0);if(n===0)r!==null&&Dw(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&Dw(r),t===1)e.tag===0?HT(Cx.bind(null,e)):mj(Cx.bind(null,e)),BT(function(){!(nt&6)&&Ya()}),r=null;else{switch(V_(n)){case 1:r=fy;break;case 4:r=U_;break;case 16:r=Mu;break;case 536870912:r=B_;break;default:r=Mu}r=fk(r,ik.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function ik(e,t){if(wu=-1,xu=0,nt&6)throw Error(ie(327));var r=e.callbackNode;if(Fo()&&e.callbackNode!==r)return null;var n=Fu(e,e===lr?fr:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=rh(e,n);else{t=n;var s=nt;nt|=2;var a=lk();(lr!==e||fr!==t)&&(Os=null,ol=Wt()+500,ki(e,t));do try{fR();break}catch(l){ok(e,l)}while(!0);Sy(),Xu.current=a,nt=s,Kt!==null?t=0:(lr=null,fr=0,t=Xt)}if(t!==0){if(t===2&&(s=_m(e),s!==0&&(n=s,t=Qm(e,s))),t===1)throw r=Ic,ki(e,0),ga(e,n),Br(e,Wt()),r;if(t===6)ga(e,n);else{if(s=e.current.alternate,!(n&30)&&!uR(s)&&(t=rh(e,n),t===2&&(a=_m(e),a!==0&&(n=a,t=Qm(e,a))),t===1))throw r=Ic,ki(e,0),ga(e,n),Br(e,Wt()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(ie(345));case 2:ii(e,Fr,Os);break;case 3:if(ga(e,n),(n&130023424)===n&&(t=Uy+500-Wt(),10<t)){if(Fu(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){Tr(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Pm(ii.bind(null,e,Fr,Os),t);break}ii(e,Fr,Os);break;case 4:if(ga(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var o=31-qn(n);a=1<<o,o=t[o],o>s&&(s=o),n&=~a}if(n=s,n=Wt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*dR(n/1960))-n,10<n){e.timeoutHandle=Pm(ii.bind(null,e,Fr,Os),n);break}ii(e,Fr,Os);break;case 5:ii(e,Fr,Os);break;default:throw Error(ie(329))}}}return Br(e,Wt()),e.callbackNode===r?ik.bind(null,e):null}function Qm(e,t){var r=hc;return e.current.memoizedState.isDehydrated&&(ki(e,t).flags|=256),e=rh(e,t),e!==2&&(t=Fr,Fr=r,t!==null&&Ym(t)),e}function Ym(e){Fr===null?Fr=e:Fr.push.apply(Fr,e)}function uR(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;
vendor: 1,488 bytes, line 40
40n++){var s=r[n],a=s.getSnapshot;s=s.value;try{if(!Gn(a(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ga(e,t){for(t&=~Ly,t&=~qh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-qn(t),n=1<<r;e[r]=-1,t&=~n}}function Cx(e){if(nt&6)throw Error(ie(327));Fo();var t=Fu(e,0);if(!(t&1))return Br(e,Wt()),null;var r=rh(e,t);if(e.tag!==0&&r===2){var n=_m(e);n!==0&&(t=n,r=Qm(e,n))}if(r===1)throw r=Ic,ki(e,0),ga(e,t),Br(e,Wt()),r;if(r===6)throw Error(ie(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ii(e,Fr,Os),Br(e,Wt()),null}function By(e,t){var r=nt;nt|=1;try{return e(t)}finally{nt=r,nt===0&&(ol=Wt()+500,Uh&&Ya())}}function Oi(e){ka!==null&&ka.tag===0&&!(nt&6)&&Fo();var t=nt;nt|=1;var r=wn.transition,n=pt;try{if(wn.transition=null,pt=1,e)return e()}finally{pt=n,wn.transition=r,nt=t,!(nt&6)&&Ya()}}function Wy(){Gr=To.current,kt(To)}function ki(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,UT(r)),Kt!==null)for(r=Kt.return;r!==null;){var n=r;switch(jy(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Wu();break;case 3:al(),kt(Lr),kt(br),Ry();break;case 5:Ty(n);break;case 4:al();break;case 13:kt(zt);break;case 19:kt(zt);break;case 10:Cy(n.type._context);break;case 22:case 23:Wy()}r=r.return}
vendor: 10,140 bytes, line 40
40if(lr=e,Kt=e=Aa(e.current,null),fr=Gr=t,Xt=0,Ic=null,Ly=qh=Ri=0,Fr=hc=null,pi!==null){for(t=0;t<pi.length;t++)if(r=pi[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,a=r.pending;if(a!==null){var o=a.next;a.next=s,n.next=o}r.pending=n}pi=null}return e}function ok(e,t){do{var r=Kt;try{if(Sy(),gu.current=Ju,Yu){for(var n=Et.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}Yu=!1}if(Ti=0,ar=Jt=Et=null,dc=!1,Oc=0,$y.current=null,r===null||r.return===null){Xt=1,Ic=t,Kt=null;break}e:{var a=e,o=r.return,l=r,c=t;if(t=fr,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,u=l,h=u.tag;if(!(u.mode&1)&&(h===0||h===11||h===15)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var m=px(o);if(m!==null){m.flags&=-257,mx(m,o,l,a,t),m.mode&1&&fx(a,d,t),t=m,c=d;var y=t.updateQueue;if(y===null){var g=new Set;g.add(c),t.updateQueue=g}else y.add(c);break e}else{if(!(t&1)){fx(a,d,t),Vy();break e}c=Error(ie(426))}}else if(St&&l.mode&1){var x=px(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),mx(x,o,l,a,t),ky(il(c,l));break e}}a=c=il(c,l),Xt!==4&&(Xt=2),hc===null?hc=[a]:hc.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var b=Vj(a,c,t);ox(a,b);break e;case 1:l=c;var v=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof v.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ra===null||!Ra.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var _=qj(a,l,t);ox(a,_);break e}}a=a.return}while(a!==null)}dk(r)}catch(j){t=j,Kt===r&&r!==null&&(Kt=r=r.return);continue}break}while(!0)}function lk(){var e=Xu.current;return Xu.current=Ju,e===null?Ju:e}function Vy(){(Xt===0||Xt===3||Xt===2)&&(Xt=4),lr===null||!(Ri&268435455)&&!(qh&268435455)||ga(lr,fr)}function rh(e,t){var r=nt;nt|=2;var n=lk();(lr!==e||fr!==t)&&(Os=null,ki(e,t));do try{hR();break}catch(s){ok(e,s)}while(!0);if(Sy(),nt=r,Xu.current=n,Kt!==null)throw Error(ie(261));return lr=null,fr=0,Xt}function hR(){for(;Kt!==null;)ck(Kt)}function fR(){for(;Kt!==null&&!FP();)ck(Kt)}function ck(e){var t=hk(e.alternate,e,Gr);e.memoizedProps=e.pendingProps,t===null?dk(e):Kt=t,$y.current=null}function dk(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=iR(r,t),r!==null){r.flags&=32767,Kt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Xt=6,Kt=null;return}}else if(r=aR(r,t,Gr),r!==null){Kt=r;return}if(t=t.sibling,t!==null){Kt=t;return}Kt=t=e}while(t!==null);Xt===0&&(Xt=5)}function ii(e,t,r){var n=pt,s=wn.transition;try{wn.transition=null,pt=1,pR(e,t,r,n)}finally{wn.transition=s,pt=n}return null}function pR(e,t,r,n){do Fo();while(ka!==null);if(nt&6)throw Error(ie(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(ie(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(ZP(e,a),e===lr&&(Kt=lr=null,fr=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Wd||(Wd=!0,fk(Mu,function(){return Fo(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=wn.transition,wn.transition=null;var o=pt;pt=1;var l=nt;nt|=4,$y.current=null,lR(e,r),sk(r,e),AT(zm),$u=!!Cm,zm=Cm=null,e.current=r,cR(r),$P(),nt=l,pt=o,wn.transition=a}else e.current=r;if(Wd&&(Wd=!1,ka=e,th=s),a=e.pendingLanes,a===0&&(Ra=null),BP(r.stateNode),Br(e,Wt()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(eh)throw eh=!1,e=Zm,Zm=null,e;return th&1&&e.tag!==0&&Fo(),a=e.pendingLanes,a&1?e===Gm?fc++:(fc=0,Gm=e):fc=0,Ya(),null}function Fo(){if(ka!==null){var e=V_(th),t=wn.transition,r=pt;try{if(wn.transition=null,pt=16>e?16:e,ka===null)var n=!1;else{if(e=ka,ka=null,th=0,nt&6)throw Error(ie(331));var s=nt;for(nt|=4,xe=e.current;xe!==null;){var a=xe,o=a.child;if(xe.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(xe=d;xe!==null;){var u=xe;switch(u.tag){case 0:case 11:case 15:uc(8,u,a)}var h=u.child;if(h!==null)h.return=u,xe=h;else for(;xe!==null;){u=xe;var p=u.sibling,m=u.return;if(tk(u),u===d){xe=null;break}if(p!==null){p.return=m,xe=p;break}xe=m}}}var y=a.alternate;if(y!==null){var g=y.child;if(g!==null){y.child=null;do{var x=g.sibling;g.sibling=null,g=x}while(g!==null)}}xe=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,xe=o;else e:for(;xe!==null;){if(a=xe,a.flags&2048)switch(a.tag){case 0:case 11:case 15:uc(9,a,a.return)}var b=a.sibling;if(b!==null){b.return=a.return,xe=b;break e}xe=a.return}}var v=e.current;for(xe=v;xe!==null;){o=xe;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,xe=w;else e:for(o=v;xe!==null;){if(l=xe,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Vh(9,l)}}catch(j){Mt(l,l.return,j)}if(l===o){xe=null;break e}var _=l.sibling;if(_!==null){_.return=l.return,xe=_;break e}xe=l.return}}if(nt=s,Ya(),ys&&typeof ys.onPostCommitFiberRoot=="function")try{ys.onPostCommitFiberRoot(Ih,e)}catch{}n=!0}return n}finally{pt=r,wn.transition=t}}return!1}function zx(e,t,r){t=il(r,t),t=Vj(e,t,1),e=Ta(e,t,1),t=Tr(),e!==null&&(ad(e,1,t),Br(e,t))}function Mt(e,t,r){if(e.tag===3)zx(e,e,r);else for(;t!==null;){if(t.tag===3){zx(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ra===null||!Ra.has(n))){e=il(r,e),e=qj(t,e,1),t=Ta(t,e,1),e=Tr(),t!==null&&(ad(t,1,e),Br(t,e));break}}t=t.return}}function mR(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Tr(),e.pingedLanes|=e.suspendedLanes&r,lr===e&&(fr&r)===r&&(Xt===4||Xt===3&&(fr&130023424)===fr&&500>Wt()-Uy?ki(e,0):Ly|=r),Br(e,t)}function uk(e,t){t===0&&(e.mode&1?(t=Od,Od<<=1,!(Od&130023424)&&(Od=4194304)):t=1);var r=Tr();e=Ws(e,t),e!==null&&(ad(e,t,r),Br(e,r))}function gR(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),uk(e,r)}function yR(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ie(314))}n!==null&&n.delete(t),uk(e,r)}var hk;hk=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Lr.current)$r=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return $r=!1,sR(e,t,r);$r=!!(e.flags&131072)}else $r=!1,St&&t.flags&1048576&&gj(t,Hu,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;vu(e,t),e=t.pendingProps;var s=rl(t,br.current);Mo(t,r),s=Ay(null,t,n,e,s,r);var a=Dy();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ur(n)?(a=!0,Vu(t)):a=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Ey(t),s.updater=Wh,t.stateNode=s,s._reactInternals=t,Mm(t,n,e,r),t=Lm(null,t,n,!0,a,r)):(t.tag=0,St&&a&&_y(t),kr(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(vu(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=wR(n),e=An(n,e),s){case 0:t=$m(null,t,n,e,r);break e;case 1:t=vx(null,t,n,e,r);break e;case 11:t=gx(null,t,n,e,r);break e;case 14:t=yx(null,t,n,An(n.type,e),r);break e}throw Error(ie(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:An(n,s),$m(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:An(n,s),vx(e,t,n,s,r);case 3:e:{if(Gj(t),e===null)throw Error(ie(387));n=t.pendingProps,a=t.memoizedState,s=a.element,_j(e,t),Gu(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){s=il(Error(ie(423)),t),t=wx(e,t,n,r,s);break e}else if(n!==s){s=il(Error(ie(424)),t),t=wx(e,t,n,r,s);break e}else for(en=Pa(t.stateNode.containerInfo.firstChild),tn=t,St=!0,Un=null,r=xj(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(nl(),n===s){t=Vs(e,t,r);break e}kr(e,t,n,r)}t=t.child}return t;case 5:return jj(t),e===null&&Am(t),n=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,o=s.children,Em(n,s)?o=null:a!==null&&Em(n,a)&&(t.flags|=32),Zj(e,t),kr(e,t,o,r),t.child;case 6:return e===null&&Am(t),null;case 13:return Qj(e,t,r);case 4:return Py(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=sl(t,null,n,r):kr(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:An(n,s),gx(e,t,n,s,r);case 7:return kr(e,t,t.pendingProps,r),t.child;case 8:return kr(e,t,t.pendingProps.children,r),t.child;case 12:return kr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,a=t.memoizedProps,o=s.value,wt(Ku,n._currentValue),n._currentValue=o,a!==null)if(Gn(a.value,o)){if(a.children===s.children&&!Lr.current){t=Vs(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(a.tag===1){c=Ls(-1,r&-r),c.tag=2;var d=a.updateQueue;if(d!==null){d=d.shared;var u=d.pending;u===null?c.next=c:(c.next=u.next,u.next=c),d.pending=c}}a.lanes|=r,c=a.alternate,c!==null&&(c.lanes|=r),Dm(a.return,r,t),l.lanes|=r;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(ie(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Dm(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}kr(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Mo(t,r),s=xn(s),n=n(s),t.flags|=1,kr(e,t,n,r),t.child;case 14:return n=t.type,s=An(n,t.pendingProps),s=An(n.type,s),yx(e,t,n,s,r);case 15:return Hj(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:An(n,s),vu(e,t),t.tag=1,Ur(n)?(e=!0,Vu(t)):e=!1,Mo(t,r),Wj(t,n,s),Mm(t,n,s,r),Lm(null,t,n,!0,e,r);case 19:return Yj(e,t,r);case 22:return Kj(e,t,r)}throw Error(ie(156,t.tag))};function fk(e,t){return L_(e,t)}function vR(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.t
vendor: 7,571 bytes, line 40
40ype=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yn(e,t,r,n){return new vR(e,t,r,n)}function qy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wR(e){if(typeof e=="function")return qy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===dy)return 11;if(e===uy)return 14}return 2}function Aa(e,t){var r=e.alternate;return r===null?(r=yn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function bu(e,t,r,n,s,a){var o=2;if(n=e,typeof e=="function")qy(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case bo:return Ni(r.children,s,a,t);case cy:o=8,s|=8;break;case om:return e=yn(12,r,t,s|2),e.elementType=om,e.lanes=a,e;case lm:return e=yn(13,r,t,s),e.elementType=lm,e.lanes=a,e;case cm:return e=yn(19,r,t,s),e.elementType=cm,e.lanes=a,e;case j_:return Hh(r,s,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case b_:o=10;break e;case __:o=9;break e;case dy:o=11;break e;case uy:o=14;break e;case ha:o=16,n=null;break e}throw Error(ie(130,e==null?e:typeof e,""))}return t=yn(o,r,t,s),t.elementType=e,t.type=n,t.lanes=a,t}function Ni(e,t,r,n){return e=yn(7,e,n,t),e.lanes=r,e}function Hh(e,t,r,n){return e=yn(22,e,n,t),e.elementType=j_,e.lanes=r,e.stateNode={isHidden:!1},e}function vp(e,t,r){return e=yn(6,e,null,t),e.lanes=r,e}function wp(e,t,r){return t=yn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function xR(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xf(0),this.expirationTimes=Xf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xf(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Hy(e,t,r,n,s,a,o,l,c){return e=new xR(e,t,r,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=yn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ey(a),e}function bR(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:xo,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function pk(e){if(!e)return La;e=e._reactInternals;e:{if(Gi(e)!==e||e.tag!==1)throw Error(ie(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ur(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ie(171))}if(e.tag===1){var r=e.type;if(Ur(r))return pj(e,r,t)}return t}function mk(e,t,r,n,s,a,o,l,c){return e=Hy(r,n,!0,e,s,a,o,l,c),e.context=pk(null),r=e.current,n=Tr(),s=Oa(r),a=Ls(n,s),a.callback=t??null,Ta(r,a,s),e.current.lanes=s,ad(e,s,n),Br(e,n),e}function Kh(e,t,r,n){var s=t.current,a=Tr(),o=Oa(s);return r=pk(r),t.context===null?t.context=r:t.pendingContext=r,t=Ls(a,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Ta(s,t,o),e!==null&&(Hn(e,s,o,a),mu(e,s,o)),o}function nh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ex(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Ky(e,t){Ex(e,t),(e=e.alternate)&&Ex(e,t)}function _R(){return null}var gk=typeof reportError=="function"?reportError:function(e){console.error(e)};function Zy(e){this._internalRoot=e}Zh.prototype.render=Zy.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ie(409));Kh(e,t,null,null)};Zh.prototype.unmount=Zy.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Oi(function(){Kh(null,e,null,null)}),t[Bs]=null}};function Zh(e){this._internalRoot=e}Zh.prototype.unstable_scheduleHydration=function(e){if(e){var t=K_();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ma.length&&t!==0&&t<ma[r].priority;r++);ma.splice(r,0,e),r===0&&G_(e)}};function Gy(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Gh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Px(){}function jR(e,t,r,n,s){if(s){if(typeof n=="function"){var a=n;n=function(){var d=nh(o);a.call(d)}}var o=mk(t,n,e,0,null,!1,!1,"",Px);return e._reactRootContainer=o,e[Bs]=o.current,zc(e.nodeType===8?e.parentNode:e),Oi(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var l=n;n=function(){var d=nh(c);l.call(d)}}var c=Hy(e,0,!1,null,null,!1,!1,"",Px);return e._reactRootContainer=c,e[Bs]=c.current,zc(e.nodeType===8?e.parentNode:e),Oi(function(){Kh(t,c,r,n)}),c}function Qh(e,t,r,n,s){var a=r._reactRootContainer;if(a){var o=a;if(typeof s=="function"){var l=s;s=function(){var c=nh(o);l.call(c)}}Kh(t,o,e,s)}else o=jR(r,t,e,s,n);return nh(o)}q_=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=ec(t.pendingLanes);r!==0&&(py(t,r|1),Br(t,Wt()),!(nt&6)&&(ol=Wt()+500,Ya()))}break;case 13:Oi(function(){var n=Ws(e,1);if(n!==null){var s=Tr();Hn(n,e,1,s)}}),Ky(e,1)}};my=function(e){if(e.tag===13){var t=Ws(e,134217728);if(t!==null){var r=Tr();Hn(t,e,134217728,r)}Ky(e,134217728)}};H_=function(e){if(e.tag===13){var t=Oa(e),r=Ws(e,t);if(r!==null){var n=Tr();Hn(r,e,t,n)}Ky(e,t)}};K_=function(){return pt};Z_=function(e,t){var r=pt;try{return pt=e,t()}finally{pt=r}};wm=function(e,t,r){switch(t){case"input":if(hm(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=Lh(n);if(!s)throw Error(ie(90));N_(n),hm(n,s)}}}break;case"textarea":C_(e,r);break;case"select":t=r.value,t!=null&&Oo(e,!!r.multiple,t,!1)}};A_=By;D_=Oi;var kR={usingClientEntryPoint:!1,Events:[od,No,Lh,R_,O_,By]},Hl={findFiberByHostInstance:fi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},NR={bundleType:Hl.bundleType,version:Hl.version,rendererPackageName:Hl.rendererPackageName,rendererConfig:Hl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ea.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=F_(e),e===null?null:e.stateNode},findFiberByHostInstance:Hl.findFiberByHostInstance||_R,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vd.isDisabled&&Vd.supportsFiber)try{Ih=Vd.inject(NR),ys=Vd}catch{}}ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=kR;ln.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Gy(t))throw Error(ie(200));return bR(e,t,null,r)};ln.createRoot=function(e,t){if(!Gy(e))throw Error(ie(299));var r=!1,n="",s=gk;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Hy(e,1,!1,null,null,r,!1,n,s),e[Bs]=t.current,zc(e.nodeType===8?e.parentNode:e),new Zy(t)};ln.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ie(188)):(e=Object.keys(e).join(","),Error(ie(268,e)));return e=F_(t),e=e===null?null:e.stateNode,e};ln.flushSync=function(e){return Oi(e)};ln.hydrate=function(e,t,r){if(!Gh(t))throw Error(ie(200));return Qh(null,e,t,!0,r)};ln.hydrateRoot=function(e,t,r){if(!Gy(e))throw Error(ie(405));var n=r!=null&&r.hydratedSources||null,s=!1,a="",o=gk;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=mk(t,null,e,1,r??null,s,!1,a,o),e[Bs]=t.current,zc(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new Zh(t)};ln.render=function(e,t,r){if(!Gh(t))throw Error(ie(200));return Qh(null,e,t,!1,r)};ln.unmountComponentAtNode=function(e){if(!Gh(e))throw Error(ie(40));return e._reactRootContainer?(Oi(function(){Qh(null,null,e,!1,function(){e._reactRootContainer=null,e[Bs]=null})}),!0):!1};ln.unstable_batchedUpdates=By;ln.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Gh(r))throw Error(ie(200));if(e==null||e._reactInternals===void 0)throw Error(ie(38));return Qh(e,t,r,!1,n)};ln.version="18.3.1-next-f1338f8080-20240426";function yk(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(yk)}catch(e){console.error(e)}}yk(),y_.exports=ln;var Qi=y_.exports;const vk=Ah(Qi);var wk,Tx=Qi;wk=Tx.createRoot,Tx.hydrateRoot;const SR="modulepreload",CR=function(e){return"/"+e},Rx={},zR=function(t,r,n){let s=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(r.map(c=>{if(c=CR(c),c in Rx)return;Rx[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":SR,d||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),d)return new Promise((p,m)=>{h.addEventListener("load",p),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})};function ER(e={}){const{immediate:t=!1,onNeedRefresh:r,onOfflineReady:n,onRegistered:s,onRegisteredSW:a,onRegisterError:o}=e;let l,c;const d=async(h=!0)=>{await c};async function u(){if("serviceWorker"in navigator){if(l=await zR(async()=>{const{Workbox:h}=await import("./workbox-window.prod.es5-vqzQaGvo.js");return{Workbox:h}},[]).then(({Workbox:h})=>new h("/sw.js",{scope:"/",type:"classic"})).catch(h=>{o==null||o(h)}),!l)return;l.addEventListener("activated",h=>{(h.isUpdate||h.isExternal)&&window.location.reload()}),l.addEventListener("installed",h=>{h.isUpdate||n==null||n()}),l.register({immediate:t}).then(h=>{a?a("/sw.js",h):s==null||s(h)}).catch(h=>{o==null||o(h)})}}return c=u(),d}const PR=1,TR=1e6;let xp=0;function RR(){return xp=(xp+1)%Number.MAX_SAFE_INTEGER,xp.toString()}const bp=new Map,Ox=e=>{if(bp.has(e))return;const t=setTimeout(()=>{bp.delete(e),pc({type:"REMOVE_TOAST",toastId:e})},TR);bp.set(e,t)},OR=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,PR)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;
40return r?Ox(r):e.toasts.forEach(n=>{Ox(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},_u=[];let ju={toasts:[]};function pc(e){ju=OR(ju,e),_u.forEach(t=>{t(ju)})}function xk({...e}){const t=RR(),r=s=>pc({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>pc({type:"DISMISS_TOAST",toastId:t});return pc({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function Ar(){const[e,t]=f.useState(ju);return f.useEffect(()=>(_u.push(t),()=>{const r=_u.indexOf(t);r>-1&&_u.splice(r,1)}),[e]),{...e,toast:xk,dismiss:r=>pc({type:"DISMISS_TOAST",toastId:r})}}function ke(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function Ax(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ai(...e){return t=>{let r=!1;const n=e.map(s=>{const a=Ax(s,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let s=0;s<n.length;s++){const a=n[s];typeof a=="function"?a():Ax(e[s],null)}}}}function tt(...e){return f.useCallback(Ai(...e),e)}function AR(e,t){const r=f.createContext(t),n=a=>{const{children:o,...l}=a,c=f.useMemo(()=>l,Object.values(l));return i.jsx(r.Provider,{value:c,children:o})};n.displayName=e+"Provider";function s(a){const o=f.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[n,s]}function dn(e,t=[]){let r=[];function n(a,o){const l=f.createContext(o),c=r.length;r=[...r,o];const d=h=>{var b;const{scope:p,children:m,...y}=h,g=((b=p==null?void 0:p[e])==null?void 0:b[c])||l,x=f.useMemo(()=>y,Object.values(y));return i.jsx(g.Provider,{value:x,children:m})};d.displayName=a+"Provider";function u(h,p){var g;const m=((g=p==null?void 0:p[e])==null?void 0:g[c])||l,y=f.useContext(m);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${a}\``)}return[d,u]}const s=()=>{const a=r.map(o=>f.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return f.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[n,DR(s,...t)]}function DR(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=n.reduce((l,{useScope:c,scopeName:d})=>{const h=c(a)[`__scope${d}`];return{...l,...h}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function Di(e){const t=IR(e),r=f.forwardRef((n,s)=>{const{children:a,...o}=n,l=f.Children.toArray(a),c=l.find(MR);if(c){const d=c.props.children,u=l.map(h=>h===c?f.Children.count(d)>1?f.Children.only(null):f.isValidElement(d)?d.props.children:null:h);return i.jsx(t,{...o,ref:s,children:f.isValidElement(d)?f.cloneElement(d,void 0,u):null})}return i.jsx(t,{...o,ref:s,children:a})});return r.displayName=`${e}.Slot`,r}var Yi=Di("Slot");function IR(e){const t=f.forwardRef((r,n)=>{const{children:s,...a}=r;if(f.isValidElement(s)){const o=$R(s),l=FR(a,s.props);return s.type!==f.Fragment&&(l.ref=n?Ai(n,o):o),f.cloneElement(s,l)}return f.Children.count(s)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bk=Symbol("radix.slottable");function _k(e){const t=({children:r})=>i.jsx(i.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=bk,t}function MR(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bk}function FR(e,t){const r={...t};for(const n in t){const s=e[n],a=t[n];/^on[A-Z]/.test(n)?s&&a?r[n]=(...l)=>{const c=a(...l);return s(...l),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...a}:n==="className"&&(r[n]=[s,a].filter(Boolean).join(" "))}return{...e,...r}}function $R(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Yh(e){const t=e+"CollectionProvider",[r,n]=dn(t),[s,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:x,children:b}=g,v=U.useRef(null),w=U.useRef(new Map).current;return i.jsx(s,{scope:x,itemMap:w,collectionRef:v,children:b})};o.displayName=t;const l=e+"CollectionSlot",c=Di(l),d=U.forwardRef((g,x)=>{const{scope:b,children:v}=g,w=a(l,b),_=tt(x,w.collectionRef);return i.jsx(c,{ref:_,children:v})});d.displayName=l;const u=e+"CollectionItemSlot",h="data-radix-collection-item",p=Di(u),m=U.forwardRef((g,x)=>{const{scope:b,children:v,...w}=g,_=U.useRef(null),j=tt(x,_),k=a(u,b);return U.useEffect(()=>(k.itemMap.set(_,{ref:_,...w}),()=>void k.itemMap.delete(_))),i.jsx(p,{[h]:"",ref:j,children:v})});m.displayName=u;function y(g){const x=a(e+"CollectionConsumer",g);return U.useCallback(()=>
vendor: 8,276 bytes, line 40
40{const v=x.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${h}]`));return Array.from(x.itemMap.values()).sort((k,N)=>w.indexOf(k.ref.current)-w.indexOf(N.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:d,ItemSlot:m},y,n]}var LR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Se=LR.reduce((e,t)=>{const r=Di(`Primitive.${t}`),n=f.forwardRef((s,a)=>{const{asChild:o,...l}=s,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...l,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function jk(e,t){e&&Qi.flushSync(()=>e.dispatchEvent(t))}function _n(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function UR(e,t=globalThis==null?void 0:globalThis.document){const r=_n(e);f.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var BR="DismissableLayer",Jm="dismissableLayer.update",WR="dismissableLayer.pointerDownOutside",VR="dismissableLayer.focusOutside",Dx,kk=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kl=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,d=f.useContext(kk),[u,h]=f.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=f.useState({}),y=tt(t,N=>h(N)),g=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=g.indexOf(x),v=u?g.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,_=v>=b,j=HR(N=>{const P=N.target,T=[...d.branches].some(I=>I.contains(P));!_||T||(s==null||s(N),o==null||o(N),N.defaultPrevented||l==null||l())},p),k=KR(N=>{const P=N.target;[...d.branches].some(I=>I.contains(P))||(a==null||a(N),o==null||o(N),N.defaultPrevented||l==null||l())},p);return UR(N=>{v===d.layers.size-1&&(n==null||n(N),!N.defaultPrevented&&l&&(N.preventDefault(),l()))},p),f.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Dx=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),Ix(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Dx)}},[u,p,r,d]),f.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),Ix())},[u,d]),f.useEffect(()=>{const N=()=>m({});return document.addEventListener(Jm,N),()=>document.removeEventListener(Jm,N)},[]),i.jsx(Se.div,{...c,ref:y,style:{pointerEvents:w?_?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,k.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,j.onPointerDownCapture)})});kl.displayName=BR;var qR="DismissableLayerBranch",Nk=f.forwardRef((e,t)=>{const r=f.useContext(kk),n=f.useRef(null),s=tt(t,n);return f.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),i.jsx(Se.div,{...e,ref:s})});Nk.displayName=qR;function HR(e,t=globalThis==null?void 0:globalThis.document){const r=_n(e),n=f.useRef(!1),s=f.useRef(()=>{});return f.useEffect(()=>{const a=l=>{if(l.target&&!n.current){let c=function(){Sk(WR,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function KR(e,t=globalThis==null?void 0:globalThis.document){const r=_n(e),n=f.useRef(!1);return f.useEffect(()=>{const s=a=>{a.target&&!n.current&&Sk(VR,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Ix(){const e=new CustomEvent(Jm);document.dispatchEvent(e)}function Sk(e,t,r,{discrete:n}){const s=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?jk(s,a):s.dispatchEvent(a)}var ZR=kl,GR=Nk,dr=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},QR="Portal",cd=f.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[s,a]=f.useState(!1);dr(()=>a(!0),[]);const o=r||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?vk.createPortal(i.jsx(Se.div,{...n,ref:t}),o):null});cd.displayName=QR;function YR(e,t){return f.useReducer((r,n)=>t[r][n]??r,e)}var ts=e=>{const{present:t,children:r}=e,n=JR(t),s=typeof r=="function"?r({present:n.isPresent}):f.Children.only(r),a=tt(n.ref,XR(s));return typeof r=="function"||n.isPresent?f.cloneElement(s,{ref:a}):null};ts.displayName="Presence";function JR(e){const[t,r]=f.useState(),n=f.useRef(null),s=f.useRef(e),a=f.useRef("none"),o=e?"mounted":"unmounted",[l,c]=YR(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const d=qd(n.current);a.current=l==="mounted"?d:"none"},[l]),dr(()=>{const d=n.current,u=s.current;if(u!==e){const p=a.current,m=qd(d);e?c("MOUNT"):m==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(u&&p!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),dr(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,h=m=>{const g=qd(n.current).includes(m.animationName);if(m.target===t&&g&&(c("ANIMATION_END"),!s.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},p=m=>{m.target===t&&(a.current=qd(n.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:f.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function qd(e){return(e==null?void 0:e.animationName)||"none"}function XR(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var eO=ay[" useInsertionEffect ".trim().toString()]||dr;function jn({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,a,o]=tO({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:s;{const u=f.useRef(e!==void 0);f.useEffect(()=>{const h=u.current;h!==l&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=f.useCallback(u=>{var h;if(l){const p=rO(u)?u(e):u;p!==e&&((h=o.current)==null||h.call(o,p))}else a(u)},[l,e,a,o]);return[c,d]}function tO({defaultProp:e,onChange:t}){const[r,n]=f.useState(e),s=f.useRef(r),a=f.useRef(t);return eO(()=>{a.current=t},[t]),f.useEffect(()=>{var o;s.current!==r&&((o=a.current)==null||o.call(a,r),s.current=r)},[r,s]),[r,n,a]}function rO(e){return typeof e=="function"}var Ck=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),nO="VisuallyHidden",Jh=f.forwardRef((e,t)=>i.jsx(Se.span,{...e,ref:t,style:{...Ck,...e.style}}));Jh.displayName=nO;var sO=Jh,Qy="ToastProvider",[Yy,aO,iO]=Yh("Toast"),[zk,s7]=dn("Toast",[iO]),[oO,Xh]=zk(Qy),Ek=e
40=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:a=50,children:o}=e,[l,c]=f.useState(null),[d,u]=f.useState(0),h=f.useRef(!1),p=f.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Qy}\`. Expected non-empty \`string\`.`),i.jsx(Yy.Provider,{scope:t,children:i.jsx(oO,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:a,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:f.useCallback(()=>u(m=>m+1),[]),onToastRemove:f.useCallback(()=>u(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:p,children:o})})};Ek.displayName=Qy;var Pk="ToastViewport",lO=["F8"],Xm="toast.viewportPause",eg="toast.viewportResume",Tk=f.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=lO,label:s="Notifications ({hotkey})",...a}=e,o=Xh(Pk,r),l=aO(r),c=f.useRef(null),d=f.useRef(null),u=f.useRef(null),h=f.useRef(null),p=tt(t,h,o.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=o.toastCount>0;f.useEffect(()=>{const x=b=>{var w;n.length!==0&&n.every(_=>b[_]||b.code===_)&&((w=h.current)==null||w.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[n]),f.useEffect(()=>{const x=c.current,b=h.current;if(y&&x&&b){const v=()=>{if(!o.isClosePausedRef.current){const k=new CustomEvent(Xm);b.dispatchEvent(k),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const k=new CustomEvent(eg);b.dispatchEvent(k),o.isClosePausedRef.current=!1}},_=k=>{!x.contains(k.relatedTarget)&&w()},j=()=>{x.contains(document.activeElement)||w()};return x.addEventListener("focusin",v),x.addEventListener("focusout",_),x.addEventListener("pointermove",v),x.addEventListener("pointerleave",j),window.addEventListener("blur",v),window.addEventListener("focus",w),()=>{x.removeEventListener("focusin",v),x.removeEventListener("focusout",_),x.removeEventListener("pointermove",v),x.removeEventListener("pointerleave",j),window.removeEventListener("blur",v),window.removeEventListener("focus",w)}}},[y,o.isClosePausedRef]);const g=f.useCallback(({tabbingDirection:x})=>{const v=l().map(w=>{const _=w.ref.current,j=[_,...bO(_)];return x==="forwards"?j:j.reverse()});return(x==="forwards"?v.reverse():v).flat()},[l]);return f.useEffect(()=>{const x=h.current;if(x){const b=v=>{var j,k,N;const w=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!w){const P=document.activeElement,T=v.shiftKey;if(v.target===x&&T){(j=d.current)==null||j.focus();return}const M=g({tabbingDirection:T?"backwards":"forwards"}),L=M.findIndex(F=>F===P);_p(M.slice(L+1))?v.preventDefault():T?(k=d.current)==null||k.focus():(N=u.current)==null||N.focus()}};return x.addEventListener("keydown",b),()=>x.removeEventListener("keydown",b)}},[l,g]),i.jsxs(GR,{ref:c,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&i.jsx(tg,{ref:d,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"forwards"});_p(x)}}),i.jsx(Yy.Slot,{scope:r,children:i.jsx(Se.ol,{tabIndex:-1,...a,ref:p})}),y&&i.jsx(tg,{ref:u,onFocusFromOutsideViewport:()=>{const x=g({tabbingDirection:"backwards"});_p(x)}})]})});Tk.displayName=Pk;var Rk="ToastFocusProxy",tg=f.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,a=Xh(Rk,r);return i.jsx(Jh,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{var d;const l=o.relatedTarget;!((d=a.viewport)!=null&&d.contains(l))&&n()}})});tg.displayName=Rk;var dd="Toast",cO="toast.swipeStart",dO="toast.swipeMove",uO="toast.swipeCancel",hO="toast.swipeEnd",Ok=f.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:a,...o}=e,[l,c]=jn({prop:n,defaultProp:s??!0,onChange:a,caller:dd});return i.jsx(ts,{present:r||l,children:i.jsx(mO,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:_n(e.onPause),onResume:_n(e.onResume),onSwipeStart:ke(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ke(e.onSwipeMove,d=>{const{x:u,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:ke(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ke(e.onSwipeEnd,d=>{const{x:u,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});Ok.displayName=dd;var[fO,pO]=zk(dd,{onClose(){}}),mO=f.forwardRef((e,t)=>
40{const{__scopeToast:r,type:n="foreground",duration:s,open:a,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:h,onSwipeCancel:p,onSwipeEnd:m,...y}=e,g=Xh(dd,r),[x,b]=f.useState(null),v=tt(t,F=>b(F)),w=f.useRef(null),_=f.useRef(null),j=s||g.duration,k=f.useRef(0),N=f.useRef(j),P=f.useRef(0),{onToastAdd:T,onToastRemove:I}=g,H=_n(()=>{var Y;(x==null?void 0:x.contains(document.activeElement))&&((Y=g.viewport)==null||Y.focus()),o()}),M=f.useCallback(F=>{!F||F===1/0||(window.clearTimeout(P.current),k.current=new Date().getTime(),P.current=window.setTimeout(H,F))},[H]);f.useEffect(()=>{const F=g.viewport;if(F){const Y=()=>{M(N.current),d==null||d()},Q=()=>{const S=new Date().getTime()-k.current;N.current=N.current-S,window.clearTimeout(P.current),c==null||c()};return F.addEventListener(Xm,Q),F.addEventListener(eg,Y),()=>{F.removeEventListener(Xm,Q),F.removeEventListener(eg,Y)}}},[g.viewport,j,c,d,M]),f.useEffect(()=>{a&&!g.isClosePausedRef.current&&M(j)},[a,j,g.isClosePausedRef,M]),f.useEffect(()=>(T(),()=>I()),[T,I]);const L=f.useMemo(()=>x?Lk(x):null,[x]);return g.viewport?i.jsxs(i.Fragment,{children:[L&&i.jsx(gO,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),i.jsx(fO,{scope:r,onClose:H,children:Qi.createPortal(i.jsx(Yy.ItemSlot,{scope:r,children:i.jsx(ZR,{asChild:!0,onEscapeKeyDown:ke(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||H(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:i.jsx(Se.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":g.swipeDirection,...y,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ke(e.onKeyDown,F=>{F.key==="Escape"&&(l==null||l(F.nativeEvent),F.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,H()))}),onPointerDown:ke(e.onPointerDown,F=>{F.button===0&&(w.current={x:F.clientX,y:F.clientY})}),onPointerMove:ke(e.onPointerMove,F=>{if(!w.current)return;const Y=F.clientX-w.current.x,Q=F.clientY-w.current.y,S=!!_.current,z=["left","right"].includes(g.swipeDirection),C=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,B=z?C(0,Y):0,ce=z?0:C(0,Q),A=F.pointerType==="touch"?10:2,ee={x:B,y:ce},te={originalEvent:F,delta:ee};S?(_.current=ee,Hd(dO,h,te,{discrete:!1})):Mx(ee,g.swipeDirection,A)?(_.current=ee,Hd(cO,u,te,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(Y)>A||Math.abs(Q)>A)&&(w.current=null)}),onPointerUp:ke(e.onPointerUp,F=>{const Y=_.current,Q=F.target;if(Q.hasPointerCapture(F.pointerId)&&Q.releasePointerCapture(F.pointerId),_.current=null,w.current=null,Y){const S=F.currentTarget,z={originalEvent:F,delta:Y};Mx(Y,g.swipeDirection,g.swipeThreshold)?Hd(hO,m,z,{discrete:!0}):Hd(uO,p,z,{discrete:!0}),S.addEventListener("click",C=>C.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),gO=e=>{const{__scopeToast:t,children:r,...n}=e,s=Xh(dd,t),[a,o]=f.useState(!1),[l,c]=f.useState(!1);return wO(()=>o(!0)),f.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:i.jsx(cd,{asChild:!0,children:i.jsx(Jh,{...n,children:a&&i.jsxs(i.Fragment,{children:[s.label," ",r]})})})},yO="ToastTitle",Ak=f.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return i.jsx(Se.div,{...n,ref:t})});Ak.displayName=yO;var vO="ToastDescription",Dk=f.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return i.jsx(Se.div,{...n,ref:t})});Dk.displayName=vO;var Ik="ToastAction",Mk=f.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?i.jsx($k,{altText:r,asChild:!0,children:i.jsx(Jy,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ik}\`. Expected non-empty \`string\`.`),null)});Mk.displayName=Ik;var Fk="ToastClose",Jy=f.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=pO(Fk,r);return i.jsx($k,{asChild:!0,children:i.jsx(Se.button,{type:"button",...n,ref:t,onClick:ke(e.onClick,s.onClose)})})});Jy.displayName=Fk;var $k=f.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return i.jsx(Se.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function Lk(e){const t=[];
vendor: 5,771 bytes, lines 40-85
40return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),xO(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",a=n.dataset.radixToastAnnounceExclude==="";if(!s)if(a){const o=n.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...Lk(n))}}),t}function Hd(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?jk(s,a):s.dispatchEvent(a)}var Mx=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),a=n>s;return t==="left"||t==="right"?a&&n>r:!a&&s>r};function wO(e=()=>{}){const t=_n(e);dr(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function xO(e){return e.nodeType===e.ELEMENT_NODE}function bO(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function _p(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var _O=Ek,Uk=Tk,Bk=Ok,Wk=Ak,Vk=Dk,qk=Mk,Hk=Jy;function Kk(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Kk(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Zk(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Kk(e))&&(n&&(n+=" "),n+=t);return n}const Fx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,$x=Zk,Ji=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return $x(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:a}=t,o=Object.keys(s).map(d=>{const u=r==null?void 0:r[d],h=a==null?void 0:a[d];if(u===null)return null;const p=Fx(u)||Fx(h);return s[d][p]}),l=r&&Object.entries(r).reduce((d,u)=>{let[h,p]=u;return p===void 0||(d[h]=p),d},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,u)=>{let{class:h,className:p,...m}=u;return Object.entries(m).every(y=>{let[g,x]=y;return Array.isArray(x)?x.includes({...a,...l}[g]):{...a,...l}[g]===x})?[...d,h,p]:d},[]);return $x(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)};/**
41 * @license lucide-react v0.462.0 - ISC
42 *
43 * This source code is licensed under the ISC license.
44 * See the LICENSE file in the root directory of this source tree.
45 */const jO=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gk=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
46 * @license lucide-react v0.462.0 - ISC
47 *
48 * This source code is licensed under the ISC license.
49 * See the LICENSE file in the root directory of this source tree.
50 */var kO={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"};/**
51 * @license lucide-react v0.462.0 - ISC
52 *
53 * This source code is licensed under the ISC license.
54 * See the LICENSE file in the root directory of this source tree.
55 */const NO=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:a,iconNode:o,...l},c)=>f.createElement("svg",{ref:c,...kO,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Gk("lucide",s),...l},[...o.map(([d,u])=>f.createElement(d,u)),...Array.isArray(a)?a:[a]]));/**
56 * @license lucide-react v0.462.0 - ISC
57 *
58 * This source code is licensed under the ISC license.
59 * See the LICENSE file in the root directory of this source tree.
60 */const pe=(e,t)=>{const r=f.forwardRef(({className:n,...s},a)=>f.createElement(NO,{ref:a,iconNode:t,className:Gk(`lucide-${jO(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
61 * @license lucide-react v0.462.0 - ISC
62 *
63 * This source code is licensed under the ISC license.
64 * See the LICENSE file in the root directory of this source tree.
65 */const Lx=pe("Apple",[["path",{d:"M12 20.94c1.5 0 2.75 1.06 4 1.06 3 0 6-8 6-12.22A4.91 4.91 0 0 0 17 5c-2.22 0-4 1.44-5 2-1-.56-2.78-2-5-2a4.9 4.9 0 0 0-5 4.78C2 14 5 22 8 22c1.25 0 2.5-1.06 4-1.06Z",key:"3s7exb"}],["path",{d:"M10 2c1 .5 2 2 2 5",key:"fcco2y"}]]);/**
66 * @license lucide-react v0.462.0 - ISC
67 *
68 * This source code is licensed under the ISC license.
69 * See the LICENSE file in the root directory of this source tree.
70 */const ws=pe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
71 * @license lucide-react v0.462.0 - ISC
72 *
73 * This source code is licensed under the ISC license.
74 * See the LICENSE file in the root directory of this source tree.
75 */const Da=pe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
76 * @license lucide-react v0.462.0 - ISC
77 *
78 * This source code is licensed under the ISC license.
79 * See the LICENSE file in the root directory of this source tree.
80 */const Qk=pe("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
81 * @license lucide-react v0.462.0 - ISC
82 *
83 * This source code is licensed under the ISC license.
84 * See the LICENSE file in the root directory of this source tree.
85 */const Yk=pe("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"}
85],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
86 * @license lucide-react v0.462.0 - ISC
87 *
88 * This source code is licensed under the ISC license.
89 * See the LICENSE file in the root directory of this source tree.
90 */const SO=pe("CalendarDays",[["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"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
91 * @license lucide-react v0.462.0 - ISC
92 *
93 * This source code is licensed under the ISC license.
94 * See the LICENSE file in the root directory of this source tree.
95 */const Mc=pe("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"}]]);/**
96 * @license lucide-react v0.462.0 - ISC
97 *
98 * This source code is licensed under the ISC license.
99 * See the LICENSE file in the root directory of this source tree.
100 */const Dt=pe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
101 * @license lucide-react v0.462.0 - ISC
102 *
103 * This source code is licensed under the ISC license.
104 * See the LICENSE file in the root directory of this source tree.
105 */const ef=pe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
106 * @license lucide-react v0.462.0 - ISC
107 *
108 * This source code is licensed under the ISC license.
109 * See the LICENSE file in the root directory of this source tree.
110 */const CO=pe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
111 * @license lucide-react v0.462.0 - ISC
112 *
113 * This source code is licensed under the ISC license.
114 * See the LICENSE file in the root directory of this source tree.
115 */const Jk=pe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
116 * @license lucide-react v0.462.0 - ISC
117 *
118 * This source code is licensed under the ISC license.
119 * See the LICENSE file in the root directory of this source tree.
120 */const zO=pe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
121 * @license lucide-react v0.462.0 - ISC
122 *
123 * This source code is licensed under the ISC license.
124 * See the LICENSE file in the root directory of this source tree.
125 */const EO=pe("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
126 * @license lucide-react v0.462.0 - ISC
127 *
128 * This source code is licensed under the ISC license.
129 * See the LICENSE file in the root directory of this source tree.
130 */const sh=pe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
131 * @license lucide-react v0.462.0 - ISC
132 *
133 * This source code is licensed under the ISC license.
134 * See the LICENSE file in the root directory of this source tree.
135 */const Xk=pe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
136 * @license lucide-react v0.462.0 - ISC
137 *
138 * This source code is licensed under the ISC license.
139 * See the LICENSE file in the root directory of this source tree.
140 */const e1=pe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
141 * @license lucide-react v0.462.0 - ISC
142 *
143 * This source code is licensed under the ISC license.
144 * See the LICENSE file in the root directory of this source tree.
145 */const Ux=pe("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
146 * @license lucide-react v0.462.0 - ISC
147 *
148 * This source code is licensed under the ISC license.
149 * See the LICENSE file in the root directory of this source tree.
150 */const PO=pe("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/**
151 * @license lucide-react v0.462.0 - ISC
152 *
153 * This source code is licensed under the ISC license.
154 * See the LICENSE file in the root directory of this source tree.
155 */const t1=pe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
156 * @license lucide-react v0.462.0 - ISC
157 *
158 * This source code is licensed under the ISC license.
159 * See the LICENSE file in the root directory of this source tree.
160 */const Si=pe("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/**
161 * @license lucide-react v0.462.0 - ISC
162 *
163 * This source code is licensed under the ISC license.
164 * See the LICENSE file in the root directory of this source tree.
165 */const ll=pe("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
166 * @license lucide-react v0.462.0 - ISC
167 *
168 * This source code is licensed under the ISC license.
169 * See the LICENSE file in the root directory of this source tree.
170 */const Bx=pe("ClipboardPenLine",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",key:"1oijnt"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-.5",key:"1but9f"}],["path",{d:"M16 4h2a2 2 0 0 1 1.73 1",key:"1p8n7l"}],["path",{d:"M8 18h1",key:"13wk12"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}]]);/**
171 * @license lucide-react v0.462.0 - ISC
172 *
173 * This source code is licensed under the ISC license.
174 * See the LICENSE file in the root directory of this source tree.
175 */const Ua=pe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
176 * @license lucide-react v0.462.0 - ISC
177 *
178 * This source code is licensed under the ISC license.
179 * See the LICENSE file in the root directory of this source tree.
180 */const r1=pe("CloudOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]]);/**
181 * @license lucide-react v0.462.0 - ISC
182 *
183 * This source code is licensed under the ISC license.
184 * See the LICENSE file in the root directory of this source tree.
185 */const n1=pe("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
186 * @license lucide-react v0.462.0 - ISC
187 *
188 * This source code is licensed under the ISC license.
189 * See the LICENSE file in the root directory of this source tree.
190 */const Ii=pe("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["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"}
190],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
191 * @license lucide-react v0.462.0 - ISC
192 *
193 * This source code is licensed under the ISC license.
194 * See the LICENSE file in the root directory of this source tree.
195 */const TO=pe("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
196 * @license lucide-react v0.462.0 - ISC
197 *
198 * This source code is licensed under the ISC license.
199 * See the LICENSE file in the root directory of this source tree.
200 */const s1=pe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
201 * @license lucide-react v0.462.0 - ISC
202 *
203 * This source code is licensed under the ISC license.
204 * See the LICENSE file in the root directory of this source tree.
205 */const Wx=pe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
206 * @license lucide-react v0.462.0 - ISC
207 *
208 * This source code is licensed under the ISC license.
209 * See the LICENSE file in the root directory of this source tree.
210 */const Fc=pe("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
211 * @license lucide-react v0.462.0 - ISC
212 *
213 * This source code is licensed under the ISC license.
214 * See the LICENSE file in the root directory of this source tree.
215 */const RO=pe("Factory",[["path",{d:"M2 20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8l-7 5V8l-7 5V4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"159hny"}],["path",{d:"M17 18h1",key:"uldtlt"}],["path",{d:"M12 18h1",key:"s9uhes"}],["path",{d:"M7 18h1",key:"1neino"}]]);/**
216 * @license lucide-react v0.462.0 - ISC
217 *
218 * This source code is licensed under the ISC license.
219 * See the LICENSE file in the root directory of this source tree.
220 */const mn=pe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
221 * @license lucide-react v0.462.0 - ISC
222 *
223 * This source code is licensed under the ISC license.
224 * See the LICENSE file in the root directory of this source tree.
225 */const OO=pe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
226 * @license lucide-react v0.462.0 - ISC
227 *
228 * This source code is licensed under the ISC license.
229 * See the LICENSE file in the root directory of this source tree.
230 */const a1=pe("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/**
231 * @license lucide-react v0.462.0 - ISC
232 *
233 * This source code is licensed under the ISC license.
234 * See the LICENSE file in the root directory of this source tree.
235 */const AO=pe("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
236 * @license lucide-react v0.462.0 - ISC
237 *
238 * This source code is licensed under the ISC license.
239 * See the LICENSE file in the root directory of this source tree.
240 */const DO=pe("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
241 * @license lucide-react v0.462.0 - ISC
242 *
243 * This source code is licensed under the ISC license.
244 * See the LICENSE file in the root directory of this source tree.
245 */const rg=pe("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"}]]);/**
246 * @license lucide-react v0.462.0 - ISC
247 *
248 * This source code is licensed under the ISC license.
249 * See the LICENSE file in the root directory of this source tree.
250 */const IO=pe("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
251 * @license lucide-react v0.462.0 - ISC
252 *
253 * This source code is licensed under the ISC license.
254 * See the LICENSE file in the root directory of this source tree.
255 */const Vx=pe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
256 * @license lucide-react v0.462.0 - ISC
257 *
258 * This source code is licensed under the ISC license.
259 * See the LICENSE file in the root directory of this source tree.
260 */const i1=pe("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
261 * @license lucide-react v0.462.0 - ISC
262 *
263 * This source code is licensed under the ISC license.
264 * See the LICENSE file in the root directory of this source tree.
265 */const o1=pe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
266 * @license lucide-react v0.462.0 - ISC
267 *
268 * This source code is licensed under the ISC license.
269 * See the LICENSE file in the root directory of this source tree.
270 */const po=pe("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
271 * @license lucide-react v0.462.0 - ISC
272 *
273 * This source code is licensed under the ISC license.
274 * See the LICENSE file in the root directory of this source tree.
275 */const Nl=pe("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
276 * @license lucide-react v0.462.0 - ISC
277 *
278 * This source code is licensed under the ISC license.
279 * See the LICENSE file in the root directory of this source tree.
280 */const l1=pe("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
281 * @license lucide-react v0.462.0 - ISC
282 *
283 * This source code is licensed under the ISC license.
284 * See the LICENSE file in the root directory of this source tree.
285 */const MO=pe("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
286 * @license lucide-react v0.462.0 - ISC
287 *
288 * This source code is licensed under the ISC license.
289 * See the LICENSE file in the root directory of this source tree.
290 */const FO=pe("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
291 * @license lucide-react v0.462.0 - ISC
292 *
293 * This source code is licensed under the ISC license.
294 * See the LICENSE file in the root directory of this source tree.
295 */const cl=pe("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
296 * @license lucide-react v0.462.0 - ISC
297 *
298 * This source code is licensed under the ISC license.
299 * See the LICENSE file in the root directory of this source tree.
300 */const $O=pe("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
301 * @license lucide-react v0.462.0 - ISC
302 *
303 * This source code is licensed under the ISC license.
304 * See the LICENSE file in the root directory of this source tree.
305 */const $c=pe("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
306 * @license lucide-react v0.462.0 - ISC
307 *
308 * This source code is licensed under the ISC license.
309 * See the LICENSE file in the root directory of this source tree.
310 */const $o=pe("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"}]]);/**
311 * @license lucide-react v0.462.0 - ISC
312 *
313 * This source code is licensed under the ISC license.
314 * See the LICENSE file in the root directory of this source tree.
315 */const Lo=pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
316 * @license lucide-react v0.462.0 - ISC
317 *
318 * This source code is licensed under the ISC license.
319 * See the LICENSE file in the root directory of this source tree.
320 */const c1=pe("Printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]);/**
321 * @license lucide-react v0.462.0 - ISC
322 *
323 * This source code is licensed under the ISC license.
324 * See the LICENSE file in the root directory of this source tree.
325 */const Er=pe("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
326 * @license lucide-react v0.462.0 - ISC
327 *
328 * This source code is licensed under the ISC license.
329 * See the LICENSE file in the root directory of this source tree.
330 */const Ci=pe("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"}]]);/**
331 * @license lucide-react v0.462.0 - ISC
332 *
333 * This source code is licensed under the ISC license.
334 * See the LICENSE file in the root directory of this source tree.
335 */const d1=pe("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
336 * @license lucide-react v0.462.0 - ISC
337 *
338 * This source code is licensed under the ISC license.
339 * See the LICENSE file in the root directory of this source tree.
340 */const LO=pe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
341 * @license lucide-react v0.462.0 - ISC
342 *
343 * This source code is licensed under the ISC license.
344 * See the LICENSE file in the root directory of this source tree.
345 */const UO=pe("ScanLine",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]]);/**
346 * @license lucide-react v0.462.0 - ISC
347 *
348 * This source code is licensed under the ISC license.
349 * See the LICENSE file in the root directory of this source tree.
350 */const ud=pe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
351 * @license lucide-react v0.462.0 - ISC
352 *
353 * This source code is licensed under the ISC license.
354 * See the LICENSE file in the root directory of this source tree.
355 */const BO=pe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
356 * @license lucide-react v0.462.0 - ISC
357 *
358 * This source code is licensed under the ISC license.
359 * See the LICENSE file in the root directory of this source tree.
360 */const WO=pe("Share",[["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["polyline",{points:"16 6 12 2 8 6",key:"m901s6"}],["line",{x1:"12",x2:"12",y1:"2",y2:"15",key:"1p0rca"}]]);/**
361 * @license lucide-react v0.462.0 - ISC
362 *
363 * This source code is licensed under the ISC license.
364 * See the LICENSE file in the root directory of this source tree.
365 */const tf=pe("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",ke
365y:"oel41y"}]]);/**
366 * @license lucide-react v0.462.0 - ISC
367 *
368 * This source code is licensed under the ISC license.
369 * See the LICENSE file in the root directory of this source tree.
370 */const ng=pe("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
371 * @license lucide-react v0.462.0 - ISC
372 *
373 * This source code is licensed under the ISC license.
374 * See the LICENSE file in the root directory of this source tree.
375 */const VO=pe("Snowflake",[["line",{x1:"2",x2:"22",y1:"12",y2:"12",key:"1dnqot"}],["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"m20 16-4-4 4-4",key:"rquw4f"}],["path",{d:"m4 8 4 4-4 4",key:"12s3z9"}],["path",{d:"m16 4-4 4-4-4",key:"1tumq1"}],["path",{d:"m8 20 4-4 4 4",key:"9p200w"}]]);/**
376 * @license lucide-react v0.462.0 - ISC
377 *
378 * This source code is licensed under the ISC license.
379 * See the LICENSE file in the root directory of this source tree.
380 */const qO=pe("Stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]);/**
381 * @license lucide-react v0.462.0 - ISC
382 *
383 * This source code is licensed under the ISC license.
384 * See the LICENSE file in the root directory of this source tree.
385 */const HO=pe("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
386 * @license lucide-react v0.462.0 - ISC
387 *
388 * This source code is licensed under the ISC license.
389 * See the LICENSE file in the root directory of this source tree.
390 */const KO=pe("Thermometer",[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]);/**
391 * @license lucide-react v0.462.0 - ISC
392 *
393 * This source code is licensed under the ISC license.
394 * See the LICENSE file in the root directory of this source tree.
395 */const rf=pe("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"}]]);/**
396 * @license lucide-react v0.462.0 - ISC
397 *
398 * This source code is licensed under the ISC license.
399 * See the LICENSE file in the root directory of this source tree.
400 */const an=pe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
401 * @license lucide-react v0.462.0 - ISC
402 *
403 * This source code is licensed under the ISC license.
404 * See the LICENSE file in the root directory of this source tree.
405 */const Xy=pe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
406 * @license lucide-react v0.462.0 - ISC
407 *
408 * This source code is licensed under the ISC license.
409 * See the LICENSE file in the root directory of this source tree.
410 */const qs=pe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
411 * @license lucide-react v0.462.0 - ISC
412 *
413 * This source code is licensed under the ISC license.
414 * See the LICENSE file in the root directory of this source tree.
415 */const u1=pe("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
416 * @license lucide-react v0.462.0 - ISC
417 *
418 * This source code is licensed under the ISC license.
419 * See the LICENSE file in the root directory of this source tree.
420 */const Hs=pe("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}
vendor: 13,409 bytes, lines 420-435
420],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
421 * @license lucide-react v0.462.0 - ISC
422 *
423 * This source code is licensed under the ISC license.
424 * See the LICENSE file in the root directory of this source tree.
425 */const Sl=pe("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
426 * @license lucide-react v0.462.0 - ISC
427 *
428 * This source code is licensed under the ISC license.
429 * See the LICENSE file in the root directory of this source tree.
430 */const Ks=pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
431 * @license lucide-react v0.462.0 - ISC
432 *
433 * This source code is licensed under the ISC license.
434 * See the LICENSE file in the root directory of this source tree.
435 */const ZO=pe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),ev="-",GO=e=>{const t=YO(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(ev);return l[0]===""&&l.length!==1&&l.shift(),h1(l,t)||QO(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},h1=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?h1(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const a=e.join(ev);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},qx=/^\[(.+)\]$/,QO=e=>{if(qx.test(e)){const t=qx.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},YO=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return XO(Object.entries(e.classGroups),r).forEach(([a,o])=>{sg(o,n,a,t)}),n},sg=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?t:Hx(t,s);a.classGroupId=r;return}if(typeof s=="function"){if(JO(s)){sg(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([a,o])=>{sg(o,Hx(t,a),r,n)})})},Hx=(e,t)=>{let r=e;return t.split(ev).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},JO=e=>e.isThemeGetter,XO=(e,t)=>t?e.map(([r,n])=>{const s=n.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,l])=>[t+o,l])):a);return[r,s]}):e,eA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(a,o)=>{r.set(a,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(a){let o=r.get(a);if(o!==void 0)return o;if((o=n.get(a))!==void 0)return s(a,o),o},set(a,o){r.has(a)?r.set(a,o):s(a,o)}}},f1="!",tA=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],a=t.length,o=l=>{const c=[];let d=0,u=0,h;for(let x=0;x<l.length;x++){let b=l[x];if(d===0){if(b===s&&(n||l.slice(x,x+a)===t)){c.push(l.slice(u,x)),u=x+a;continue}if(b==="/"){h=x;continue}}b==="["?d++:b==="]"&&d--}const p=c.length===0?l:l.substring(u),m=p.startsWith(f1),y=m?p.substring(1):p,g=h&&h>u?h-u:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:g}};return r?l=>r({className:l,parseClassName:o}):o},rA=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},nA=e=>({cache:eA(e.cacheSize),parseClassName:tA(e),...GO(e)}),sA=/\s+/,aA=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,a=[],o=e.trim().split(sA);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{modifiers:u,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=r(d);let y=!!m,g=n(y?p.substring(0,m):p);if(!g){if(!y){l=d+(l.length>0?" "+l:l);continue}if(g=n(p),!g){l=d+(l.length>0?" "+l:l);continue}y=!1}const x=rA(u).join(":"),b=h?x+f1:x,v=b+g;if(a.includes(v))continue;a.push(v);const w=s(g,y);for(let _=0;_<w.length;++_){const j=w[_];a.push(b+j)}l=d+(l.length>0?" "+l:l)}return l};function iA(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=p1(t))&&(n&&(n+=" "),n+=r);return n}const p1=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=p1(e[n]))&&(r&&(r+=" "),r+=t);return r};function oA(e,...t){let r,n,s,a=o;function o(c){const d=t.reduce((u,h)=>h(u),e());return r=nA(d),n=r.cache.get,s=r.cache.set,a=l,l(c)}function l(c){const d=n(c);if(d)return d;const u=aA(c,r);return s(c,u),u}return function(){return a(iA.apply(null,arguments))}}const _t=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},m1=/^\[(?:([a-z-]+):)?(.+)\]$/i,lA=/^\d+\/\d+$/,cA=new Set(["px","full","screen"]),dA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uA=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,hA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,fA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zs=e=>Uo(e)||cA.has(e)||lA.test(e),ia=e=>Cl(e,"length",_A),Uo=e=>!!e&&!Number.isNaN(Number(e)),jp=e=>Cl(e,"number",Uo),Kl=e=>!!e&&Number.isInteger(Number(e)),mA=e=>e.endsWith("%")&&Uo(e.slice(0,-1)),qe=e=>m1.test(e),oa=e=>dA.test(e),gA=new Set(["length","size","percentage"]),yA=e=>Cl(e,gA,g1),vA=e=>Cl(e,"position",g1),wA=new Set(["image","url"]),xA=e=>Cl(e,wA,kA),bA=e=>Cl(e,"",jA),Zl=()=>!0,Cl=(e,t,r)=>{const n=m1.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},_A=e=>uA.test(e)&&!hA.test(e),g1=()=>!1,jA=e=>fA.test(e),kA=e=>pA.test(e),NA=()=>{const e=_t("colors"),t=_t("spacing"),r=_t("blur"),n=_t("brightness"),s=_t("borderColor"),a=_t("borderRadius"),o=_t("borderSpacing"),l=_t("borderWidth"),c=_t("contrast"),d=_t("grayscale"),u=_t("hueRotate"),h=_t("invert"),p=_t("gap"),m=_t("gradientColorStops"),y=_t("gradientColorStopPositions"),g=_t("inset"),x=_t("margin"),b=_t("opacity"),v=_t("padding"),w=_t("saturate"),_=_t("scale"),j=_t("sepia"),k=_t("skew"),N=_t("space"),P=_t("translate"),T=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto",qe,t],M=()=>[qe,t],L=()=>["",zs,ia],F=()=>["auto",Uo,qe],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q=()=>["solid","dashed","dotted","double","none"],S=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],z=()=>["start","end","center","between","around","evenly","stretch"],C=()=>["","0",qe],B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ce=()=>[Uo,qe];return{cacheSize:500,separator:":",theme:{colors:[Zl],spacing:[zs,ia],blur:["none","",oa,qe],brightness:ce(),borderColor:[e],borderRadius:["none","","full",oa,qe],borderSpacing:M(),borderWidth:L(),contrast:ce(),grayscale:C(),hueRotate:ce(),invert:C(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[mA,ia],inset:H(),margin:H(),opacity:ce(),padding:M(),saturate:ce(),scale:ce(),sepia:C(),skew:ce(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",qe]}],container:["container"],columns:[{columns:[oa]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Y(),qe]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Kl,qe]}],basis:[{basis:H()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",qe]}],grow:[{grow:C()}],shrink:[{shrink:C()}],order:[{order:["first","last","none",Kl,qe]}],"grid-cols":[{"grid-cols":[Zl]}],"col-start-end":[{col:["auto",{span:["full",Kl,qe]},qe]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[Zl]}],"row-start-end":[{row:["auto",{span:[Kl,qe]},qe]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",qe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",qe]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",qe,t]}],"min-w":[{"min-w":[qe,t,"min","max","fit"]}],"max-w":[{"max-w":[qe,t,"none","full","min","max","fit","prose",{screen:[oa]},oa]}],h:[{h:[qe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[qe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[qe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[qe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",oa,ia]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",jp]}],"font-family":[{font:[Zl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",qe]}],"line-clamp":[{"line-clamp":["none",Uo,jp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",zs,qe]}],"list-image":[{"list-image":["none",qe]}],"list-style-type":[{list:["none","disc","decimal",qe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",zs,ia]}],"underline-offset":[{"underline-offset":["auto",zs,qe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),vA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",yA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xA]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}
vendor: 5,182 bytes, line 435
435],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...Q(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:Q()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Q()]}],"outline-offset":[{"outline-offset":[zs,qe]}],"outline-w":[{outline:[zs,ia]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[zs,ia]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",oa,bA]}],"shadow-color":[{shadow:[Zl]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...S(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":S()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",oa,qe]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[h]}],saturate:[{saturate:[w]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",qe]}],duration:[{duration:ce()}],ease:[{ease:["linear","in","out","in-out",qe]}],delay:[{delay:ce()}],animate:[{animate:["none","spin","ping","pulse","bounce",qe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[Kl,qe]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",qe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",qe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
vendor: 4,642 bytes, line 435
435],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",qe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[zs,ia,jp]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},SA=oA(NA);function J(...e){return SA(Zk(e))}const CA=_O,y1=f.forwardRef(({className:e,...t},r)=>i.jsx(Uk,{ref:r,className:J("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));y1.displayName=Uk.displayName;const zA=Ji("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),v1=f.forwardRef(({className:e,variant:t,...r},n)=>i.jsx(Bk,{ref:n,className:J(zA({variant:t}),e),...r}));v1.displayName=Bk.displayName;const EA=f.forwardRef(({className:e,...t},r)=>i.jsx(qk,{ref:r,className:J("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));EA.displayName=qk.displayName;const w1=f.forwardRef(({className:e,...t},r)=>i.jsx(Hk,{ref:r,className:J("absolute right-2 top-2 rounded-md p-1 text-foreground
435/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:i.jsx(Ks,{className:"h-4 w-4"})}));w1.displayName=Hk.displayName;const x1=f.forwardRef(({className:e,...t},r)=>i.jsx(Wk,{ref:r,className:J("text-sm font-semibold",e),...t}));x1.displayName=Wk.displayName;const b1=f.forwardRef(({className:e,...t},r)=>i.jsx(Vk,{ref:r,className:J("text-sm opacity-90",e),...t}));b1.displayName=Vk.displayName;function PA(){const{toasts:e}=Ar();return i.jsxs(CA,{children:[e.map(function({id:t,title:r,description:n,action:s,...a}){return i.jsxs(v1,{...a,children:[i.jsxs("div",{className:"grid gap-1",children:[r&&i.jsx(x1,{children:r}),n&&i.jsx(b1,{children:n})]}),s,i.jsx(w1,{})]},t)}),i.jsx(y1,{})]})}var Kx=["light","dark"],TA="(prefers-color-scheme: dark)",RA=f.createContext(void 0),OA={setTheme:e=>{},themes:[]},AA=()=>{var e;return(e=f.useContext(RA))!=null?e:OA};f.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:a,value:o,attrs:l,nonce:c})=>{let d=a==="system",u=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,h=s?Kx.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(y,g=!1,x=!0)=>{let b=o?o[y]:y,v=g?y+"|| ''":`'${b}'`,w="";return s&&x&&!g&&Kx.includes(y)&&(w+=`d.style.colorScheme = '${y}';`),r==="class"?g||b?w+=`c.add(${v})`:w+="null":b&&(w+=`d[s](n,${v})`),w},m=e?`!function(){${u}${p(e)}}()`:n?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${TA}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${p(o?"x[e]":"e",!0)}}${d?"":"else{"+p(a,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${p(o?"x[e]":"e",!0)}}else{${p(a,!1,!1)};}${h}}catch(t){}}();`;return f.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:m}})});var DA=e=>{switch(e){case"success":return FA;case"info":return LA;case"warning":return $A;case"error":return UA;default:return null}},IA=Array(12).fill(0),MA=({visible:e,className:t})=>U.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},U.createElement("div",{className:"sonner-spinner"},IA.map((r,n)=>U.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),FA=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),$A=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),LA=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),UA=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),BA=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},U.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),U.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),WA=()=>{let[e,t]=U.useState(document.hidden);return U.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},ag=1,VA=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>
vendor: 1,050 bytes, line 435
435{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:ag++,a=this.toasts.find(l=>l.id===s),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),a?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:r}),{...l,...e,id:s,dismissible:o,title:r}):l):this.addToast({title:r,...n,dismissible:o,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
435this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,a,o=n.then(async c=>{if(a=["resolve",c],U.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(HA(c)&&!c.ok){s=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:d,description:u})}else if(t.success!==void 0){s=!1;let d=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:d,description:u})}}).catch(async c=>{if(a=["reject",c],t.error!==void 0){s=!1;let d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:d,description:u})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,d)=>o.then(()=>a[0]==="reject"?d(a[1]):c(a[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||ag++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Mr=new VA,qA=(e,t)=>{let r=(t==null?void 0:t.id)||ag++;return Mr.addToast({title:e,...t,id:r}),r},HA=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",KA=qA,ZA=()=>Mr.toasts,GA=()=>Mr.getActiveToasts(),xs=Object.assign(KA,{success:Mr.success,info:Mr.info,warning:Mr.warning,error:Mr.error,custom:Mr.custom,message:Mr.message,promise:Mr.promise,dismiss:Mr.dismiss,loading:Mr.loading},{getHistory:ZA,getToasts:GA});function QA(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}QA(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
435left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
435:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
435--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
436`);function Kd(e){return e.label!==void 0}var YA=3,JA="32px",XA="16px",Zx=4e3,eD=356,tD=14,rD=20,nD=200;function zn(...e){return e.filter(Boolean).join(" ")}function sD(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var aD=e=>{var t,r,n,s,a,o,l,c,d,u,h;let{invert:p,toast:m,unstyled:y,interacting:g,setHeights:x,visibleToasts:b,heights:v,index:w,toasts:_,expanded:j,removeToast:k,defaultRichColors:N,closeButton:P,style:T,cancelButtonStyle:I,actionButtonStyle:H,className:M="",descriptionClassName:L="",duration:F,position:Y,gap:Q,loadingIcon:S,expandByDefault:z,classNames:C,icons:B,closeButtonAriaLabel:ce="Close toast",pauseWhenPageIsHidden:A}=e,[ee,te]=U.useState(null),[q,he]=U.useState(null),[Z,me]=U.useState(!1),[ge,Ne]=U.useState(!1),[Ce,Oe]=U.useState(!1),[Xe,oe]=U.useState(!1),[Ve,Ue]=U.useState(!1),[re,De]=U.useState(0),[Te,E]=U.useState(0),O=U.useRef(m.duration||F||Zx),V=U.useRef(null),D=U.useRef(null),K=w===0,R=w+1<=b,W=m.type,se=m.dismissible!==!1,ye=m.className||"",ze=m.descriptionClassName||"",et=U.useMemo(()=>v.findIndex(le=>le.toastId===m.id)||0,[v,m.id]),at=U.useMemo(()=>{var le;return(le=m.closeButton)!=null?le:P},[m.closeButton,P]),Nt=U.useMemo(()=>m.duration||F||Zx,[m.duration,F]),He=U.useRef(0),ct=U.useRef(0),Rt=U.useRef(0),dt=U.useRef(null),[mt,Ft]=Y.split("-"),$t=U.useMemo(()=>v.reduce((le,Re,Be)=>Be>=et?le:le+Re.height,0),[v,et]),Lt=WA(),_r=m.invert||p,yt=W==="loading";ct.current=U.useMemo(()=>et*Q+$t,[et,$t]),U.useEffect(()=>{O.current=Nt},[Nt]),U.useEffect(()=>{me(!0)},[]),U.useEffect(()=>{let le=D.current;if(le){let Re=le.getBoundingClientRect().height;return E(Re),x(Be=>[{toastId:m.id,height:Re,position:m.position},...Be]),()=>x(Be=>Be.filter(Ye=>Ye.toastId!==m.id))}},[x,m.id]),U.useLayoutEffect(()=>{if(!Z)return;let le=D.current,Re=le.style.height;le.style.height="auto";let Be=le.getBoundingClientRect().height;le.style.height=Re,E(Be),x(Ye=>Ye.find(Gt=>Gt.toastId===m.id)?Ye.map(Gt=>Gt.toastId===m.id?{...Gt,height:Be}:Gt):[{toastId:m.id,height:Be,position:m.position},...Ye])},[Z,m.title,m.description,x,m.id]);let $=U.useCallback(()=>{Ne(!0),De(ct.current),x(le=>le.filter(Re=>Re.toastId!==m.id)),setTimeout(()=>{k(m)},nD)},[m,k,x,ct]);U.useEffect(()=>{if(m.promise&&W==="loading"||m.duration===1/0||m.type==="loading")return;let le;return j||g||A&&Lt?(()=>{if(Rt.current<He.current){let Re=new Date().getTime()-He.current;O.current=O.current-Re}
436Rt.current=new Date().getTime()})():O.current!==1/0&&(He.current=new Date().getTime(),le=setTimeout(()=>{var Re;(Re=m.onAutoClose)==null||Re.call(m,m),$()},O.current)),()=>clearTimeout(le)},[j,g,m,W,A,Lt,$]),U.useEffect(()=>{m.delete&&$()},[$,m.delete]);function ae(){var le,Re,Be;return B!=null&&B.loading?U.createElement("div",{className:zn(C==null?void 0:C.loader,(le=m==null?void 0:m.classNames)==null?void 0:le.loader,"sonner-loader"),"data-visible":W==="loading"},B.loading):S?U.createElement("div",{className:zn(C==null?void 0:C.loader,(Re=m==null?void 0:m.classNames)==null?void 0:Re.loader,"sonner-loader"),"data-visible":W==="loading"},S):U.createElement(MA,{className:zn(C==null?void 0:C.loader,(Be=m==null?void 0:m.classNames)==null?void 0:Be.loader),visible:W==="loading"})}return U.createElement("li",{tabIndex:0,ref:D,className:zn(M,ye,C==null?void 0:C.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,C==null?void 0:C.default,C==null?void 0:C[W],(r=m==null?void 0:m.classNames)==null?void 0:r[W]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:N,"data-styled":!(m.jsx||m.unstyled||y),"data-mounted":Z,"data-promise":!!m.promise,"data-swiped":Ve,"data-removed":ge,"data-visible":R,"data-y-position":mt,"data-x-position":Ft,"data-index":w,"data-front":K,"data-swiping":Ce,"data-dismissible":se,"data-type":W,"data-invert":_r,"data-swipe-out":Xe,"data-swipe-direction":q,"data-expanded":!!(j||z&&Z),style:{"--index":w,"--toasts-before":w,"--z-index":_.length-w,"--offset":`${ge?re:ct.current}px`,"--initial-height":z?"auto":`${Te}px`,...T,...m.style},onDragEnd:()=>{Oe(!1),te(null),dt.current=null},onPointerDown:le=>{yt||!se||(V.current=new Date,De(ct.current),le.target.setPointerCapture(le.pointerId),le.target.tagName!=="BUTTON"&&(Oe(!0),dt.current={x:le.clientX,y:le.clientY}))},onPointerUp:()=>{var le,Re,Be,Ye;if(Xe||!se)return;dt.current=null;let Gt=Number(((le=D.current)==null?void 0:le.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),un=Number(((Re=D.current)==null?void 0:Re.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Cs=new Date().getTime()-((Be=V.current)==null?void 0:Be.getTime()),Sn=ee==="x"?Gt:un,sa=Math.abs(Sn)/Cs;if(Math.abs(Sn)>=rD||sa>.11){De(ct.current),(Ye=m.onDismiss)==null||Ye.call(m,m),he(ee==="x"?Gt>0?"right":"left":un>0?"down":"up"),$(),oe(!0),Ue(!1);return}Oe(!1),te(null)},onPointerMove:le=>{var Re,Be,Ye,Gt;if(!dt.current||!se||((Re=window.getSelection())==null?void 0:Re.toString().length)>0)return;let un=le.clientY-dt.current.y,Cs=le.clientX-dt.current.x,Sn=(Be=e.swipeDirections)!=null?Be:sD(Y);!ee&&(Math.abs(Cs)>1||Math.abs(un)>1)&&te(Math.abs(Cs)>Math.abs(un)?"x":"y");let sa={x:0,y:0};ee==="y"?(Sn.includes("top")||Sn.includes("bottom"))&&(Sn.includes("top")&&un<0||Sn.includes("bottom")&&un>0)&&(sa.y=un):ee==="x"&&(Sn.includes("left")||Sn.includes("right"))&&(Sn.includes("left")&&Cs<0||Sn.includes("right")&&Cs>0)&&(sa.x=Cs),(Math.abs(sa.x)>0||Math.abs(sa.y)>0)&&Ue(!0),(Ye=D.current)==null||Ye.style.setProperty("--swipe-amount-x",`${sa.x}px`),(Gt=D.current)==null||Gt.style.setProperty("--swipe-amount-y",`${sa.y}px`)}},at&&!m.jsx?U.createElement("button",{"aria-label":ce,"data-disabled":yt,"data-close-button":!0,onClick:yt||!se?()=>{}:()=>{var le;$(),(le=m.onDismiss)==null||le.call(m,m)},className:zn(C==null?void 0:C.closeButton,(s=m==null?void 0:m.classNames)==null?void 0:s.closeButton)},(a=B==null?void 0:B.close)!=null?a:BA):null,m.jsx||f.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:U.createElement(U.Fragment,null,W||m.icon||m.promise?U.createElement("div",{"data-icon":"",className:zn(C==null?void 0:C.icon,(o=m==null?void 0:m.classNames)==null?void 0:o.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||ae():null,m.type!=="loading"?m.
vendor: 4,786 bytes, line 436
436icon||(B==null?void 0:B[W])||DA(W):null):null,U.createElement("div",{"data-content":"",className:zn(C==null?void 0:C.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},U.createElement("div",{"data-title":"",className:zn(C==null?void 0:C.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?U.createElement("div",{"data-description":"",className:zn(L,ze,C==null?void 0:C.description,(d=m==null?void 0:m.classNames)==null?void 0:d.description)},typeof m.description=="function"?m.description():m.description):null),f.isValidElement(m.cancel)?m.cancel:m.cancel&&Kd(m.cancel)?U.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||I,onClick:le=>{var Re,Be;Kd(m.cancel)&&se&&((Be=(Re=m.cancel).onClick)==null||Be.call(Re,le),$())},className:zn(C==null?void 0:C.cancelButton,(u=m==null?void 0:m.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,f.isValidElement(m.action)?m.action:m.action&&Kd(m.action)?U.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||H,onClick:le=>{var Re,Be;Kd(m.action)&&((Be=(Re=m.action).onClick)==null||Be.call(Re,le),!le.defaultPrevented&&$())},className:zn(C==null?void 0:C.actionButton,(h=m==null?void 0:m.classNames)==null?void 0:h.actionButton)},m.action.label):null))};function Gx(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function iD(e,t){let r={};return[e,t].forEach((n,s)=>{let a=s===1,o=a?"--mobile-offset":"--offset",l=a?XA:JA;function c(d){["top","right","bottom","left"].forEach(u=>{r[`${o}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${o}-${d}`]=l:r[`${o}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):c(l)}),r}var oD=f.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:a,closeButton:o,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:h,duration:p,style:m,visibleToasts:y=YA,toastOptions:g,dir:x=Gx(),gap:b=tD,loadingIcon:v,icons:w,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:j}=e,[k,N]=U.useState([]),P=U.useMemo(()=>Array.from(new Set([n].concat(k.filter(A=>A.position).map(A=>A.position)))),[k,n]),[T,I]=U.useState([]),[H,M]=U.useState(!1),[L,F]=U.useState(!1),[Y,Q]=U.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),S=U.useRef(null),z=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),C=U.useRef(null),B=U.useRef(!1),ce=U.useCallback(A=>{N(ee=>{var te;return(te=ee.find(q=>q.id===A.id))!=null&&te.delete||Mr.dismiss(A.id),ee.filter(({id:q})=>q!==A.id)})},[]);return U.useEffect(()=>Mr.subscribe(A=>{if(A.dismiss){N(ee=>ee.map(te=>te.id===A.id?{...te,delete:!0}:te));return}setTimeout(()=>{vk.flushSync(()=>{N(ee=>{let te=ee.findIndex(q=>q.id===A.id);return te!==-1?[...ee.slice(0,te),{...ee[te],...A},...ee.slice(te+1)]:[A,...ee]})})})}),[]),U.useEffect(()=>{if(u!=="system"){Q(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Q("dark"):Q("light")),typeof window>"u")return;let A=window.matchMedia("(prefers-color-scheme: dark)");try{A.addEventListener("change",({matches:ee})=>{Q(ee?"dark":"light")})}catch{A.addListener(({matches:te})=>{try{Q(te?"dark":"light")}catch(q){console.error(q)}})}},[u]),U.useEffect(()=>{k.length<=1&&M(!1)},[k]),U.useEffect(()=>{let A=ee=>{var te,q;s.every(he=>ee[he]||ee.code===he)&&(M(!0),(te=S.current)==null||te.focus()),ee.code==="Escape"&&(document.activeElement===S.current||(q=S.current)!=null&&q.contains(document.activeElement))&&M(!1)};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[s]),U.useEffect(()=>{if(S.current)return()=>{C.current&&(C.current.focus({preventScroll:!0}),C.current=null,B.current=!1)}},[S.current]),U.createElement("section",{ref:t,"aria-label":`${_} ${z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((A,ee)=>{var te;let[q,he]=A.split("-");return k.length?U.createElement("ol",{key:A,dir:x==="auto"?Gx():x,tabIndex:-1,ref:S,className:l,"data-sonner-toaster":!0,"data-theme":Y,"data-y-position":q,"data-lifted":H&&k.length>1&&!a,"data-x-position":he,style:{"--front-toast-height":`${((te=T[0])==null?void 0:te.height)||0}px`,"--width":`${eD}px`,"--gap":`${b}px`,...m,...iD(c,d)},onBlur:Z=>{B.current&&!Z.currentTarget.contains(Z.relatedTarget)&&(B.current=!1,C.current&&(C.current.focus({preventScroll:!0}
vendor: 4,942 bytes, line 436
436),C.current=null))},onFocus:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||B.current||(B.current=!0,C.current=Z.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{L||M(!1)},onDragEnd:()=>M(!1),onPointerDown:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||F(!0)},onPointerUp:()=>F(!1)},k.filter(Z=>!Z.position&&ee===0||Z.position===A).map((Z,me)=>{var ge,Ne;return U.createElement(aD,{key:Z.id,icons:w,index:me,toast:Z,defaultRichColors:h,duration:(ge=g==null?void 0:g.duration)!=null?ge:p,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:y,closeButton:(Ne=g==null?void 0:g.closeButton)!=null?Ne:o,interacting:L,position:A,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:ce,toasts:k.filter(Ce=>Ce.position==Z.position),heights:T.filter(Ce=>Ce.position==Z.position),setHeights:I,expandByDefault:a,gap:b,loadingIcon:v,expanded:H,pauseWhenPageIsHidden:j,swipeDirections:e.swipeDirections})})):null}))});const lD=({...e})=>{const{theme:t="system"}=AA();return i.jsx(oD,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var cD=ay[" useId ".trim().toString()]||(()=>{}),dD=0;function cr(e){const[t,r]=f.useState(cD());return dr(()=>{r(n=>n??String(dD++))},[e]),t?`radix-${t}`:""}const uD=["top","right","bottom","left"],Ba=Math.min,Yr=Math.max,ah=Math.round,Zd=Math.floor,bs=e=>({x:e,y:e}),hD={left:"right",right:"left",bottom:"top",top:"bottom"},fD={start:"end",end:"start"};function ig(e,t,r){return Yr(e,Ba(t,r))}function Zs(e,t){return typeof e=="function"?e(t):e}function Gs(e){return e.split("-")[0]}function zl(e){return e.split("-")[1]}function tv(e){return e==="x"?"y":"x"}function rv(e){return e==="y"?"height":"width"}const pD=new Set(["top","bottom"]);function fs(e){return pD.has(Gs(e))?"y":"x"}function nv(e){return tv(fs(e))}function mD(e,t,r){r===void 0&&(r=!1);const n=zl(e),s=nv(e),a=rv(s);let o=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=ih(o)),[o,ih(o)]}function gD(e){const t=ih(e);return[og(e),t,og(t)]}function og(e){return e.replace(/start|end/g,t=>fD[t])}const Qx=["left","right"],Yx=["right","left"],yD=["top","bottom"],vD=["bottom","top"];function wD(e,t,r){switch(e){case"top":case"bottom":return r?t?Yx:Qx:t?Qx:Yx;case"left":case"right":return t?yD:vD;default:return[]}}function xD(e,t,r,n){const s=zl(e);let a=wD(Gs(e),r==="start",n);return s&&(a=a.map(o=>o+"-"+s),t&&(a=a.concat(a.map(og)))),a}function ih(e){return e.replace(/left|right|bottom|top/g,t=>hD[t])}function bD(e){return{top:0,right:0,bottom:0,left:0,...e}}function _1(e){return typeof e!="number"?bD(e):{top:e,right:e,bottom:e,left:e}}function oh(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function Jx(e,t,r){let{reference:n,floating:s}=e;const a=fs(t),o=nv(t),l=rv(o),c=Gs(t),d=a==="y",u=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2,p=n[l]/2-s[l]/2;let m;switch(c){case"top":m={x:u,y:n.y-s.height};break;case"bottom":m={x:u,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:h};break;case"left":m={x:n.x-s.width,y:h};break;default:m={x:n.x,y:n.y}}switch(zl(t)){case"start":m[o]-=p*(r&&d?-1:1);break;case"end":m[o]+=p*(r&&d?-1:1);break}return m}const _D=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:a=[],platform:o}=r,l=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:h}=Jx(d,n,c),p=n,m={},y=0;for(let g=0;g<l.length;g++){const{name:x,fn:b}=l[g],{x:v,y:w,data:_,reset:j}=await b({x:u,y:h,initialPlacement:n,placement:p,strategy:s,middlewareData:m,rects:d,platform:o,elements:{reference:e,floating:t}});u=v??u,h=w??h,m={...m,[x]:{...m[x],..._}},j&&y<=50&&(y++,typeof j=="object"&&(j.placement&&(p=j.placement),j.rects&&(d=j.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):j.rects),{x:u,y:h}=Jx(d,p,c)),g=-1)}return{x:u,y:h,placement:p,strategy:s,middlewareData:m}};async function Lc(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:a,rects:o,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:p=!1,padding:m=0}=Zs(t,e),y=_1(m),x=l[p?h==="floating"?"reference":"floating":h],b=oh(await a.getClippingRect
vendor: 6,550 bytes, line 436
436({element:(r=await(a.isElement==null?void 0:a.isElement(x)))==null||r?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),v=h==="floating"?{x:n,y:s,width:o.floating.width,height:o.floating.height}:o.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),_=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},j=oh(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:w,strategy:c}):v);return{top:(b.top-j.top+y.top)/_.y,bottom:(j.bottom-b.bottom+y.bottom)/_.y,left:(b.left-j.left+y.left)/_.x,right:(j.right-b.right+y.right)/_.x}}const jD=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=Zs(e,t)||{};if(d==null)return{};const h=_1(u),p={x:r,y:n},m=nv(s),y=rv(m),g=await o.getDimensions(d),x=m==="y",b=x?"top":"left",v=x?"bottom":"right",w=x?"clientHeight":"clientWidth",_=a.reference[y]+a.reference[m]-p[m]-a.floating[y],j=p[m]-a.reference[m],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let N=k?k[w]:0;(!N||!await(o.isElement==null?void 0:o.isElement(k)))&&(N=l.floating[w]||a.floating[y]);const P=_/2-j/2,T=N/2-g[y]/2-1,I=Ba(h[b],T),H=Ba(h[v],T),M=I,L=N-g[y]-H,F=N/2-g[y]/2+P,Y=ig(M,F,L),Q=!c.arrow&&zl(s)!=null&&F!==Y&&a.reference[y]/2-(F<M?I:H)-g[y]/2<0,S=Q?F<M?F-M:F-L:0;return{[m]:p[m]+S,data:{[m]:Y,centerOffset:F-Y-S,...Q&&{alignmentOffset:S}},reset:Q}}}),kD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:a,rects:o,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:g=!0,...x}=Zs(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const b=Gs(s),v=fs(l),w=Gs(l)===l,_=await(c.isRTL==null?void 0:c.isRTL(d.floating)),j=p||(w||!g?[ih(l)]:gD(l)),k=y!=="none";!p&&k&&j.push(...xD(l,g,y,_));const N=[l,...j],P=await Lc(t,x),T=[];let I=((n=a.flip)==null?void 0:n.overflows)||[];if(u&&T.push(P[b]),h){const F=mD(s,o,_);T.push(P[F[0]],P[F[1]])}if(I=[...I,{placement:s,overflows:T}],!T.every(F=>F<=0)){var H,M;const F=(((H=a.flip)==null?void 0:H.index)||0)+1,Y=N[F];if(Y&&(!(h==="alignment"?v!==fs(Y):!1)||I.every(z=>z.overflows[0]>0&&fs(z.placement)===v)))return{data:{index:F,overflows:I},reset:{placement:Y}};let Q=(M=I.filter(S=>S.overflows[0]<=0).sort((S,z)=>S.overflows[1]-z.overflows[1])[0])==null?void 0:M.placement;if(!Q)switch(m){case"bestFit":{var L;const S=(L=I.filter(z=>{if(k){const C=fs(z.placement);return C===v||C==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(C=>C>0).reduce((C,B)=>C+B,0)]).sort((z,C)=>z[1]-C[1])[0])==null?void 0:L[0];S&&(Q=S);break}case"initialPlacement":Q=l;break}if(s!==Q)return{reset:{placement:Q}}}return{}}}};function Xx(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eb(e){return uD.some(t=>e[t]>=0)}const ND=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=Zs(e,t);switch(n){case"referenceHidden":{const a=await Lc(t,{...s,elementContext:"reference"}),o=Xx(a,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:eb(o)}}}case"escaped":{const a=await Lc(t,{...s,altBoundary:!0}),o=Xx(a,r.floating);return{data:{escapedOffsets:o,escaped:eb(o)}}}default:return{}}}}},j1=new Set(["left","top"]);async function SD(e,t){const{placement:r,platform:n,elements:s}=e,a=await(n.isRTL==null?void 0:n.isRTL(s.floating)),o=Gs(r),l=zl(r),c=fs(r)==="y",d=j1.has(o)?-1:1,u=a&&c?-1:1,h=Zs(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof y=="number"&&(m=l==="end"?y*-1:y),c?{x:m*u,y:p*d}:{x:p*d,y:m*u}}const CD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:a,placement:o,middlewareData:l}=t,c=await SD(t,e);return o===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:o}}}}},zD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:x=>{let{x:b,y:v}=x;return{x:b,y:v}}},...c}=Zs(e,t),d={x:r,y:n},u=await Lc(t,c),h=fs(Gs(s)),p=tv(h);let m=d[p],y=d[h];if(a){const x=p==="y"?"top":"left",b=p==="y"?"bottom":"right",v=m+u[x],w=m-u[b];m=ig(v,m,w)}if(o){const x=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=y+u[x],w=y-u[b];y=ig(v,y,w)}const g=l.fn({...t,[p]:m,[h]:y});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[p]:a,[h]:o}}}}}},ED=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Zs(e,t),u={x:r,y:n},h=fs(s),p=tv(h);let m=u[p],y=u[h];const g=Zs(l,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const w=p==="y"?"height":"width",_=a.reference[p]-a.floating[w]+x.mainAxis,j=a.reference[p]+a.reference[w]-x.mainAxis;m<_?m=_:m>j&&(m=j)}if(d){var b,v;const w=p==="y"?"width":"height",_=j1.has(Gs(s)),j=a.reference[h]-a.floating[w]+(_&&((b=o.offset)==null?void 0:b[h])||0)+(_?0:x.crossAxis),k=a.reference[h]+a.reference[w]+(_?0:((v=o.offset)==null?void 0:v[h])||0)-(_?x.crossAxis:0);y<j?y=j:y>k&&(y=k)}return{[p]:m,[h]:y}}}},PD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...d}=Zs(e,t),u=await Lc(t,d),h=Gs(s),p=zl(s),m=fs(s)==="y",{width:y,height:g}=a.floating;let x,b;h==="top"||h==="bottom"?(x=h,b=p===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(b=h,x=p==="end"?"top":"bottom");const v=g-u.top-u.bottom,w=y-u.left-u.right,_=Ba(g-u[x],v),j=Ba(y-u[b],w),k=!t.middlewareData.shift;let N=_,P=j;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(P=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=v),k&&!p){const I=Yr(u.left,0),H=Yr(u.right,0),M=Yr(u.top,0),L=Yr(u.bottom,0);m?P=y-2*(I!==0||H!==0?I+H:Yr(u.left,u.right)):N=g-2*(M!==0||L!==0?M+L:Yr(u.top,u.bottom))}await c({...t,availableWidth:P,availableHeight:N});const T=await o.getDimensions(l.floating);
vendor: 4,956 bytes, line 436
436return y!==T.width||g!==T.height?{reset:{rects:!0}}:{}}}};function nf(){return typeof window<"u"}function El(e){return k1(e)?(e.nodeName||"").toLowerCase():"#document"}function rn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ns(e){var t;return(t=(k1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function k1(e){return nf()?e instanceof Node||e instanceof rn(e).Node:!1}function Qn(e){return nf()?e instanceof Element||e instanceof rn(e).Element:!1}function js(e){return nf()?e instanceof HTMLElement||e instanceof rn(e).HTMLElement:!1}function tb(e){return!nf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof rn(e).ShadowRoot}const TD=new Set(["inline","contents"]);function hd(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=Yn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!TD.has(s)}const RD=new Set(["table","td","th"]);function OD(e){return RD.has(El(e))}const AD=[":popover-open",":modal"];function sf(e){return AD.some(t=>{try{return e.matches(t)}catch{return!1}})}const DD=["transform","translate","scale","rotate","perspective"],ID=["transform","translate","scale","rotate","perspective","filter"],MD=["paint","layout","strict","content"];function sv(e){const t=av(),r=Qn(e)?Yn(e):e;return DD.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||ID.some(n=>(r.willChange||"").includes(n))||MD.some(n=>(r.contain||"").includes(n))}function FD(e){let t=Wa(e);for(;js(t)&&!dl(t);){if(sv(t))return t;if(sf(t))return null;t=Wa(t)}return null}function av(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const $D=new Set(["html","body","#document"]);function dl(e){return $D.has(El(e))}function Yn(e){return rn(e).getComputedStyle(e)}function af(e){return Qn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Wa(e){if(El(e)==="html")return e;const t=e.assignedSlot||e.parentNode||tb(e)&&e.host||Ns(e);return tb(t)?t.host:t}function N1(e){const t=Wa(e);return dl(t)?e.ownerDocument?e.ownerDocument.body:e.body:js(t)&&hd(t)?t:N1(t)}function Uc(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=N1(e),a=s===((n=e.ownerDocument)==null?void 0:n.body),o=rn(s);if(a){const l=lg(o);return t.concat(o,o.visualViewport||[],hd(s)?s:[],l&&r?Uc(l):[])}return t.concat(s,Uc(s,[],r))}function lg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function S1(e){const t=Yn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=js(e),a=s?e.offsetWidth:r,o=s?e.offsetHeight:n,l=ah(r)!==a||ah(n)!==o;return l&&(r=a,n=o),{width:r,height:n,$:l}}function iv(e){return Qn(e)?e:e.contextElement}function Bo(e){const t=iv(e);if(!js(t))return bs(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:a}=S1(t);let o=(a?ah(r.width):r.width)/n,l=(a?ah(r.height):r.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const LD=bs(0);function C1(e){const t=rn(e);return!av()||!t.visualViewport?LD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function UD(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==rn(e)?!1:t}function Mi(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),a=iv(e);let o=bs(1);t&&(n?Qn(n)&&(o=Bo(n)):o=Bo(e));const l=UD(a,r,n)?C1(a):bs(0);let c=(s.left+l.x)/o.x,d=(s.top+l.y)/o.y,u=s.width/o.x,h=s.height/o.y;if(a){const p=rn(a),m=n&&Qn(n)?rn(n):n;let y=p,g=lg(y);for(;g&&n&&m!==y;){const x=Bo(g),b=g.getBoundingClientRect(),v=Yn(g),w=b.left+(g.clientLeft+parseFloat(v.paddingLeft))*x.x,_=b.top+(g.clientTop+parseFloat(v.paddingTop))*x.y;c*=x.x,d*=x.y,u*=x.x,h*=x.y,c+=w,d+=_,y=rn(g),g=lg(y)}}return oh({width:u,height:h,x:c,y:d})}function ov(e,t){const r=af(e).scrollLeft;return t?t.left+r:Mi(Ns(e)).left+r}function z1(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-(r?0:ov(e,n)),a=n.top+t.scrollTop;return{x:s,y:a}}function BD(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const a=s==="fixed",o=Ns(n),l=t?sf(t.floating):!1;if(n===o||l&&a)return r;let c={scrollLeft:0,scrollTop:0},d=bs(1);const u=bs(0),h=js(n);if((h||!h&&!a)&&((El(n)!=="body"||hd(o))&&(c=af(n)),js(n))){const m=Mi(n);d=Bo(n),u.x=m.x+n.clientLeft,u.y=m.y+n.clientTop}const p=o&&!h&&!a?z1(o,c,!0):bs(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+p.x,y:r.y*d.y-c.scrollTop*d.y+u.y+p.y}}function WD(e){return Array.from(e.getClientRects())}function VD(e){const t=Ns(e),r=af(e),n=e.ownerDocument.body,s=Yr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Yr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+ov(e);const l=-r.scrollTop;return Yn(n).direction==="rtl"&&(o+=Yr(t.clientWidth,n.clientWidth)-s),{width:s,height:a,x:o,y:l}}
vendor: 4,850 bytes, line 436
436function qD(e,t){const r=rn(e),n=Ns(e),s=r.visualViewport;let a=n.clientWidth,o=n.clientHeight,l=0,c=0;if(s){a=s.width,o=s.height;const d=av();(!d||d&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:a,height:o,x:l,y:c}}const HD=new Set(["absolute","fixed"]);function KD(e,t){const r=Mi(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,a=js(e)?Bo(e):bs(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=s*a.x,d=n*a.y;return{width:o,height:l,x:c,y:d}}function rb(e,t,r){let n;if(t==="viewport")n=qD(e,r);else if(t==="document")n=VD(Ns(e));else if(Qn(t))n=KD(t,r);else{const s=C1(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return oh(n)}function E1(e,t){const r=Wa(e);return r===t||!Qn(r)||dl(r)?!1:Yn(r).position==="fixed"||E1(r,t)}function ZD(e,t){const r=t.get(e);if(r)return r;let n=Uc(e,[],!1).filter(l=>Qn(l)&&El(l)!=="body"),s=null;const a=Yn(e).position==="fixed";let o=a?Wa(e):e;for(;Qn(o)&&!dl(o);){const l=Yn(o),c=sv(o);!c&&l.position==="fixed"&&(s=null),(a?!c&&!s:!c&&l.position==="static"&&!!s&&HD.has(s.position)||hd(o)&&!c&&E1(e,o))?n=n.filter(u=>u!==o):s=l,o=Wa(o)}return t.set(e,n),n}function GD(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const o=[...r==="clippingAncestors"?sf(t)?[]:ZD(t,this._c):[].concat(r),n],l=o[0],c=o.reduce((d,u)=>{const h=rb(t,u,s);return d.top=Yr(h.top,d.top),d.right=Ba(h.right,d.right),d.bottom=Ba(h.bottom,d.bottom),d.left=Yr(h.left,d.left),d},rb(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function QD(e){const{width:t,height:r}=S1(e);return{width:t,height:r}}function YD(e,t,r){const n=js(t),s=Ns(t),a=r==="fixed",o=Mi(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=bs(0);function d(){c.x=ov(s)}if(n||!n&&!a)if((El(t)!=="body"||hd(s))&&(l=af(t)),n){const m=Mi(t,!0,a,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else s&&d();a&&!n&&s&&d();const u=s&&!n&&!a?z1(s,l):bs(0),h=o.left+l.scrollLeft-c.x-u.x,p=o.top+l.scrollTop-c.y-u.y;return{x:h,y:p,width:o.width,height:o.height}}function kp(e){return Yn(e).position==="static"}function nb(e,t){if(!js(e)||Yn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ns(e)===r&&(r=r.ownerDocument.body),r}function P1(e,t){const r=rn(e);if(sf(e))return r;if(!js(e)){let s=Wa(e);for(;s&&!dl(s);){if(Qn(s)&&!kp(s))return s;s=Wa(s)}return r}let n=nb(e,t);for(;n&&OD(n)&&kp(n);)n=nb(n,t);return n&&dl(n)&&kp(n)&&!sv(n)?r:n||FD(e)||r}const JD=async function(e){const t=this.getOffsetParent||P1,r=this.getDimensions,n=await r(e.floating);return{reference:YD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function XD(e){return Yn(e).direction==="rtl"}const eI={convertOffsetParentRelativeRectToViewportRelativeRect:BD,getDocumentElement:Ns,getClippingRect:GD,getOffsetParent:P1,getElementRects:JD,getClientRects:WD,getDimensions:QD,getScale:Bo,isElement:Qn,isRTL:XD};function T1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tI(e,t){let r=null,n;const s=Ns(e);function a(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const d=e.getBoundingClientRect(),{left:u,top:h,width:p,height:m}=d;if(l||t(),!p||!m)return;const y=Zd(h),g=Zd(s.clientWidth-(u+p)),x=Zd(s.clientHeight-(h+m)),b=Zd(u),w={rootMargin:-y+"px "+-g+"px "+-x+"px "+-b+"px",threshold:Yr(0,Ba(1,c))||1};let _=!0;function j(k){const N=k[0].intersectionRatio;if(N!==c){if(!_)return o();N?o(!1,N):n=setTimeout(()=>{o(!1,1e-7)},1e3)}N===1&&!T1(d,e.getBoundingClientRect())&&o(),_=!1}try{r=new IntersectionObserver(j,{...w,root:s.ownerDocument})}catch{r=new IntersectionObserver(j,w)}r.observe(e)}return o(!0),a}function rI(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=iv(e),u=s||a?[...d?Uc(d):[],...Uc(t)]:[];u.forEach(b=>{s&&b.addEventListener("scroll",r,{passive:!0}),a&&b.addEventListener("resize",r)});const h=d&&l?tI(d,r):null;let p=-1,m=null;o&&(m=new ResizeObserver(b=>{let[v]=b;v&&v.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),r()}),d&&!c&&m.observe(d),m.observe(t));let y,g=c?Mi(e):null;c&&x();function x(){const b=Mi(e);g&&!T1(g,b)&&r(),g=b,y=requestAnimationFrame(x)}return r(),()=>{var b;u.forEach(v=>{s&&v.removeEventListener("scroll",r),a&&v.removeEventListener("resize",r)}),h==null||h(),(b=m)==null||b.disconnect(),m=null,c&&cancelAnimationFrame(y)}}const nI=CD,sI=zD,aI=kD,iI=PD,oI=ND,sb=jD,lI=ED,cI=(e,t,r)=>{const n=new Map,s={platform:eI,...r},a={...s.platform,_c:n};return _D(e,t,{...s,platform:a})};var dI=typeof document<"u",uI=function(){},ku=dI?f.useLayoutEffect:uI;function lh(e,t){if(e===t)return!0;
vendor: 4,143 bytes, line 436
436if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!lh(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const a=s[n];if(!(a==="_owner"&&e.$$typeof)&&!lh(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function R1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ab(e,t){const r=R1(e);return Math.round(t*r)/r}function Np(e){const t=f.useRef(e);return ku(()=>{t.current=e}),t}function hI(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,h]=f.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=f.useState(n);lh(p,n)||m(n);const[y,g]=f.useState(null),[x,b]=f.useState(null),v=f.useCallback(z=>{z!==k.current&&(k.current=z,g(z))},[]),w=f.useCallback(z=>{z!==N.current&&(N.current=z,b(z))},[]),_=a||y,j=o||x,k=f.useRef(null),N=f.useRef(null),P=f.useRef(u),T=c!=null,I=Np(c),H=Np(s),M=Np(d),L=f.useCallback(()=>{if(!k.current||!N.current)return;const z={placement:t,strategy:r,middleware:p};H.current&&(z.platform=H.current),cI(k.current,N.current,z).then(C=>{const B={...C,isPositioned:M.current!==!1};F.current&&!lh(P.current,B)&&(P.current=B,Qi.flushSync(()=>{h(B)}))})},[p,t,r,H,M]);ku(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,h(z=>({...z,isPositioned:!1})))},[d]);const F=f.useRef(!1);ku(()=>(F.current=!0,()=>{F.current=!1}),[]),ku(()=>{if(_&&(k.current=_),j&&(N.current=j),_&&j){if(I.current)return I.current(_,j,L);L()}},[_,j,L,I,T]);const Y=f.useMemo(()=>({reference:k,floating:N,setReference:v,setFloating:w}),[v,w]),Q=f.useMemo(()=>({reference:_,floating:j}),[_,j]),S=f.useMemo(()=>{const z={position:r,left:0,top:0};if(!Q.floating)return z;const C=ab(Q.floating,u.x),B=ab(Q.floating,u.y);return l?{...z,transform:"translate("+C+"px, "+B+"px)",...R1(Q.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:C,top:B}},[r,l,Q.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:L,refs:Y,elements:Q,floatingStyles:S}),[u,L,Y,Q,S])}const fI=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?sb({element:n.current,padding:s}).fn(r):{}:n?sb({element:n,padding:s}).fn(r):{}}}},pI=(e,t)=>({...nI(e),options:[e,t]}),mI=(e,t)=>({...sI(e),options:[e,t]}),gI=(e,t)=>({...lI(e),options:[e,t]}),yI=(e,t)=>({...aI(e),options:[e,t]}),vI=(e,t)=>({...iI(e),options:[e,t]}),wI=(e,t)=>({...oI(e),options:[e,t]}),xI=(e,t)=>({...fI(e),options:[e,t]});var bI="Arrow",O1=f.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...a}=e;return i.jsx(Se.svg,{...a,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});O1.displayName=bI;var _I=O1;function A1(e){const[t,r]=f.useState(void 0);return dr(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,l=d.blockSize}else o=e.offsetWidth,l=e.offsetHeight;r({width:o,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var lv="Popper",[D1,Pl]=dn(lv),[jI,I1]=D1(lv),M1=e=>{const{__scopePopper:t,children:r}=e,[n,s]=f.useState(null);return i.jsx(jI,{scope:t,anchor:n,onAnchorChange:s,children:r})};M1.displayName=lv;var F1="PopperAnchor",$1=f.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,a=I1(F1,r),o=f.useRef(null),l=tt(t,o);return f.useEffect(()=>{a.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:i.jsx(Se.div,{...s,ref:l})});$1.displayName=F1;var cv="PopperContent",[kI,NI]=D1(cv),L1=f.forwardRef((e,t)=>
vendor: 4,217 bytes, line 436
436{var Z,me,ge,Ne,Ce,Oe;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:y,...g}=e,x=I1(cv,r),[b,v]=f.useState(null),w=tt(t,Xe=>v(Xe)),[_,j]=f.useState(null),k=A1(_),N=(k==null?void 0:k.width)??0,P=(k==null?void 0:k.height)??0,T=n+(a!=="center"?"-"+a:""),I=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},H=Array.isArray(d)?d:[d],M=H.length>0,L={padding:I,boundary:H.filter(CI),altBoundary:M},{refs:F,floatingStyles:Y,placement:Q,isPositioned:S,middlewareData:z}=hI({strategy:"fixed",placement:T,whileElementsMounted:(...Xe)=>rI(...Xe,{animationFrame:m==="always"}),elements:{reference:x.anchor},middleware:[pI({mainAxis:s+P,alignmentAxis:o}),c&&mI({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?gI():void 0,...L}),c&&yI({...L}),vI({...L,apply:({elements:Xe,rects:oe,availableWidth:Ve,availableHeight:Ue})=>{const{width:re,height:De}=oe.reference,Te=Xe.floating.style;Te.setProperty("--radix-popper-available-width",`${Ve}px`),Te.setProperty("--radix-popper-available-height",`${Ue}px`),Te.setProperty("--radix-popper-anchor-width",`${re}px`),Te.setProperty("--radix-popper-anchor-height",`${De}px`)}}),_&&xI({element:_,padding:l}),zI({arrowWidth:N,arrowHeight:P}),p&&wI({strategy:"referenceHidden",...L})]}),[C,B]=W1(Q),ce=_n(y);dr(()=>{S&&(ce==null||ce())},[S,ce]);const A=(Z=z.arrow)==null?void 0:Z.x,ee=(me=z.arrow)==null?void 0:me.y,te=((ge=z.arrow)==null?void 0:ge.centerOffset)!==0,[q,he]=f.useState();return dr(()=>{b&&he(window.getComputedStyle(b).zIndex)},[b]),i.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:S?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[(Ne=z.transformOrigin)==null?void 0:Ne.x,(Ce=z.transformOrigin)==null?void 0:Ce.y].join(" "),...((Oe=z.hide)==null?void 0:Oe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(kI,{scope:r,placedSide:C,onArrowChange:j,arrowX:A,arrowY:ee,shouldHideArrow:te,children:i.jsx(Se.div,{"data-side":C,"data-align":B,...g,ref:w,style:{...g.style,animation:S?void 0:"none"}})})})});L1.displayName=cv;var U1="PopperArrow",SI={top:"bottom",right:"left",bottom:"top",left:"right"},B1=f.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,a=NI(U1,n),o=SI[a.placedSide];return i.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:i.jsx(_I,{...s,ref:r,style:{...s.style,display:"block"}})})});B1.displayName=U1;function CI(e){return e!==null}var zI=e=>({name:"transformOrigin",options:e,fn(t){var x,b,v;const{placement:r,rects:n,middlewareData:s}=t,o=((x=s.arrow)==null?void 0:x.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,u]=W1(r),h={start:"0%",center:"50%",end:"100%"}[u],p=(((b=s.arrow)==null?void 0:b.x)??0)+l/2,m=(((v=s.arrow)==null?void 0:v.y)??0)+c/2;let y="",g="";return d==="bottom"?(y=o?h:`${p}px`,g=`${-c}px`):d==="top"?(y=o?h:`${p}px`,g=`${n.floating.height+c}px`):d==="right"?(y=`${-c}px`,g=o?h:`${m}px`):d==="left"&&(y=`${n.floating.width+c}px`,g=o?h:`${m}px`),{data:{x:y,y:g}}}});function W1(e){const[t,r="center"]=e.split("-");return[t,r]}var dv=M1,of=$1,uv=L1,hv=B1,[lf,a7]=dn("Tooltip",[Pl]),cf=Pl(),V1="TooltipProvider",EI=700,cg="tooltip.open",[PI,fv]=lf(V1),q1=e=>{const{__scopeTooltip:t,delayDuration:r=EI,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:a}=e,o=f.useRef(!0),l=f.useRef(!1),c=f.useRef(0);return f.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),i.jsx(PI,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:f.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>
vendor: 5,049 bytes, line 436
436o.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:f.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:a})};q1.displayName=V1;var Bc="Tooltip",[TI,df]=lf(Bc),H1=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,c=fv(Bc,e.__scopeTooltip),d=cf(t),[u,h]=f.useState(null),p=cr(),m=f.useRef(0),y=o??c.disableHoverableContent,g=l??c.delayDuration,x=f.useRef(!1),[b,v]=jn({prop:n,defaultProp:s??!1,onChange:N=>{N?(c.onOpen(),document.dispatchEvent(new CustomEvent(cg))):c.onClose(),a==null||a(N)},caller:Bc}),w=f.useMemo(()=>b?x.current?"delayed-open":"instant-open":"closed",[b]),_=f.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x.current=!1,v(!0)},[v]),j=f.useCallback(()=>{window.clearTimeout(m.current),m.current=0,v(!1)},[v]),k=f.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{x.current=!0,v(!0),m.current=0},g)},[g,v]);return f.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),i.jsx(dv,{...d,children:i.jsx(TI,{scope:t,contentId:p,open:b,stateAttribute:w,trigger:u,onTriggerChange:h,onTriggerEnter:f.useCallback(()=>{c.isOpenDelayedRef.current?k():_()},[c.isOpenDelayedRef,k,_]),onTriggerLeave:f.useCallback(()=>{y?j():(window.clearTimeout(m.current),m.current=0)},[j,y]),onOpen:_,onClose:j,disableHoverableContent:y,children:r})})};H1.displayName=Bc;var dg="TooltipTrigger",K1=f.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=df(dg,r),a=fv(dg,r),o=cf(r),l=f.useRef(null),c=tt(t,l,s.onTriggerChange),d=f.useRef(!1),u=f.useRef(!1),h=f.useCallback(()=>d.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),i.jsx(of,{asChild:!0,...o,children:i.jsx(Se.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:ke(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ke(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:ke(e.onBlur,s.onClose),onClick:ke(e.onClick,s.onClose)})})});K1.displayName=dg;var RI="TooltipPortal",[i7,OI]=lf(RI,{forceMount:void 0}),ul="TooltipContent",Z1=f.forwardRef((e,t)=>{const r=OI(ul,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...a}=e,o=df(ul,e.__scopeTooltip);return i.jsx(ts,{present:n||o.open,children:o.disableHoverableContent?i.jsx(G1,{side:s,...a,ref:t}):i.jsx(AI,{side:s,...a,ref:t})})}),AI=f.forwardRef((e,t)=>{const r=df(ul,e.__scopeTooltip),n=fv(ul,e.__scopeTooltip),s=f.useRef(null),a=tt(t,s),[o,l]=f.useState(null),{trigger:c,onClose:d}=r,u=s.current,{onPointerInTransitChange:h}=n,p=f.useCallback(()=>{l(null),h(!1)},[h]),m=f.useCallback((y,g)=>{const x=y.currentTarget,b={x:y.clientX,y:y.clientY},v=$I(b,x.getBoundingClientRect()),w=LI(b,v),_=UI(g.getBoundingClientRect()),j=WI([...w,..._]);l(j),h(!0)},[h]);return f.useEffect(()=>()=>p(),[p]),f.useEffect(()=>{if(c&&u){const y=x=>m(x,u),g=x=>m(x,c);return c.addEventListener("pointerleave",y),u.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",y),u.removeEventListener("pointerleave",g)}}},[c,u,m,p]),f.useEffect(()=>{if(o){const y=g=>{const x=g.target,b={x:g.clientX,y:g.clientY},v=(c==null?void 0:c.contains(x))||(u==null?void 0:u.contains(x)),w=!BI(b,o);v?p():w&&(p(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,u,o,d,p]),i.jsx(G1,{...e,ref:a})}),[DI,II]=lf(Bc,{isInside:!1}),MI=_k("TooltipContent"),G1=f.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=df(ul,r),d=cf(r),{onClose:u}=c;return f.useEffect(()=>(document.addEventListener(cg,u),()=>document.removeEventListener(cg,u)),[u]),f.useEffect(()=>{if(c.trigger){const h=p=>{const m=p.target;m!=null&&m.contains(c.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,u]),i.jsx(kl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:u,children:i.jsxs(uv,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(MI,{children:n}),i.jsx(DI,{scope:r,isInside:!0,children:i.jsx(sO,{id:c.contentId,role:"tooltip",children:s||n})})]})})});Z1.displayName=ul;var Q1="TooltipArrow",FI=f.forwardRef((e,t)=>
436{const{__scopeTooltip:r,...n}=e,s=cf(r);return II(Q1,r).isInside?null:i.jsx(hv,{...s,...n,ref:t})});FI.displayName=Q1;function $I(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,s,a)){case a:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function LI(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function UI(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function BI(e,t){const{x:r,y:n}=e;let s=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a],c=t[o],d=l.x,u=l.y,h=c.x,p=c.y;u>n!=p>n&&r<(h-d)*(n-u)/(p-u)+d&&(s=!s)}return s}function WI(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),VI(t)}function VI(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(s.y-o.y)>=(a.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const a=r[r.length-1],o=r[r.length-2];if((a.x-o.x)*(s.y-o.y)>=(a.y-o.y)*(s.x-o.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var qI=q1,HI=H1,KI=K1,Y1=Z1;const pv=qI,J1=HI,X1=KI,mv=f.forwardRef(({className:e,sideOffset:t=4,...r},n)=>i.jsx(Y1,{ref:n,sideOffset:t,className:J("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));mv.displayName=Y1.displayName;var uf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},hf=typeof window>"u"||"Deno"in globalThis;function Dn(){}function ZI(e,t){return typeof e=="function"?e(t):e}function GI(e){return typeof e=="number"&&e>=0&&e!==1/0}function QI(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ug(e,t){return typeof e=="function"?e(t):e}function YI(e,t){return typeof e=="function"?e(t):e}function ib(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:a,queryKey:o,stale:l}=e;if(o){if(n){if(t.queryHash!==gv(o,t.options))return!1}else if(!Vc(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function ob(e,t){const{exact:r,status:n,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(Wc(t.options.mutationKey)!==Wc(a))return!1}else if(!Vc(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function gv(e,t){return((t==null?void 0:t.queryKeyHashFn)||Wc)(e)}function Wc(e){return JSON.stringify(e,(t,r)=>hg(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Vc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Vc(e[r],t[r])):!1}function eN(e,t){if(e===t)return e;const r=lb(e)&&lb(t);if(r||hg(e)&&hg(t)){const n=r?e:Object.keys(e),s=n.length,a=r?t:Object.keys(t),o=a.length,l=r?[]:{},c=new Set(n);let d=0;for(let u=0;u<o;u++){const h=r?u:a[u];(!r&&c.has(h)||r)&&e[h]===void 0&&t[h]===void 0?(l[h]=void 0,d++):(l[h]=eN(e[h],t[h]),l[h]===e[h]&&e[h]!==void 0&&d++)}return s===o&&d===s?e:l}return t}function lb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function hg(e){if(!cb(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!cb(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function cb(e){return Object.prototype.toString.call(e)==="[object Object]"}function JI(e){return new Promise(t=>{setTimeout(t,e)})}function XI(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?eN(e,t):t}function e4(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function t4(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var yv=Symbol();function tN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===yv?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var vi,va,Ko,Y0,r4=(Y0=class extends uf{constructor(){super();it(this,vi);it(this,va);it(this,Ko);We(this,Ko,t=>{if(!hf&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){X(this,va)||this.setEventListener(X(this,Ko))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,va))==null||t.call(this),We(this,va,void 0))}setEventListener(t){var r;We(this,Ko,t),(r=X(this,va))==null||r.call(this),We(this,va,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){X(this,vi)!==t&&(We(this,vi,t),this.onFocus())}onFocus(){const t=this.isFocused();
vendor: 4,924 bytes, line 436
436this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof X(this,vi)=="boolean"?X(this,vi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},vi=new WeakMap,va=new WeakMap,Ko=new WeakMap,Y0),rN=new r4,Zo,wa,Go,J0,n4=(J0=class extends uf{constructor(){super();it(this,Zo,!0);it(this,wa);it(this,Go);We(this,Go,t=>{if(!hf&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){X(this,wa)||this.setEventListener(X(this,Go))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,wa))==null||t.call(this),We(this,wa,void 0))}setEventListener(t){var r;We(this,Go,t),(r=X(this,wa))==null||r.call(this),We(this,wa,t(this.setOnline.bind(this)))}setOnline(t){X(this,Zo)!==t&&(We(this,Zo,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return X(this,Zo)}},Zo=new WeakMap,wa=new WeakMap,Go=new WeakMap,J0),ch=new n4;function s4(){let e,t;const r=new Promise((s,a)=>{e=s,t=a});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}function a4(e){return Math.min(1e3*2**e,3e4)}function nN(e){return(e??"online")==="online"?ch.isOnline():!0}var sN=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Sp(e){return e instanceof sN}function aN(e){let t=!1,r=0,n=!1,s;const a=s4(),o=g=>{var x;n||(p(new sN(g)),(x=e.abort)==null||x.call(e))},l=()=>{t=!0},c=()=>{t=!1},d=()=>rN.isFocused()&&(e.networkMode==="always"||ch.isOnline())&&e.canRun(),u=()=>nN(e.networkMode)&&e.canRun(),h=g=>{var x;n||(n=!0,(x=e.onSuccess)==null||x.call(e,g),s==null||s(),a.resolve(g))},p=g=>{var x;n||(n=!0,(x=e.onError)==null||x.call(e,g),s==null||s(),a.reject(g))},m=()=>new Promise(g=>{var x;s=b=>{(n||d())&&g(b)},(x=e.onPause)==null||x.call(e)}).then(()=>{var g;s=void 0,n||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(n)return;let g;const x=r===0?e.initialPromise:void 0;try{g=x??e.fn()}catch(b){g=Promise.reject(b)}Promise.resolve(g).then(h).catch(b=>{var k;if(n)return;const v=e.retry??(hf?0:3),w=e.retryDelay??a4,_=typeof w=="function"?w(r,b):w,j=v===!0||typeof v=="number"&&r<v||typeof v=="function"&&v(r,b);if(t||!j){p(b);return}r++,(k=e.onFail)==null||k.call(e,r,b),JI(_).then(()=>d()?void 0:m()).then(()=>{t?p(b):y()})})};return{promise:a,cancel:o,continue:()=>(s==null||s(),a),cancelRetry:l,continueRetry:c,canStart:u,start:()=>(u()?y():m().then(y),a)}}var i4=e=>setTimeout(e,0);function o4(){let e=[],t=0,r=l=>{l()},n=l=>{l()},s=i4;const a=l=>{t?e.push(l):s(()=>{r(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var Cr=o4(),wi,X0,iN=(X0=class{constructor(){it(this,wi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),GI(this.gcTime)&&We(this,wi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(hf?1/0:5*60*1e3))}clearGcTimeout(){X(this,wi)&&(clearTimeout(X(this,wi)),We(this,wi,void 0))}},wi=new WeakMap,X0),Qo,xi,hn,bi,vr,rd,_i,Mn,Rs,e_,l4=(e_=class extends iN{constructor(t){super();it(this,Mn);it(this,Qo);it(this,xi);it(this,hn);it(this,bi);it(this,vr);it(this,rd);it(this,_i);We(this,_i,!1),We(this,rd,t.defaultOptions),this.setOptions(t.options),this.observers=[],We(this,bi,t.client),We(this,hn,X(this,bi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,We(this,Qo,d4(this.options)),this.state=t.state??X(this,Qo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=X(this,vr))==null?void 0:t.promise}setOptions(t){this.options={...X(this,rd),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&X(this,hn).remove(this)}setData(t,r){const n=XI(this.state.data,t,this.options);return mr(this,Mn,Rs).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){mr(this,Mn,Rs).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=X(this,vr))==null?void 0:n.promise;return(s=X(this,vr))==null||s.cancel(t),r?r.then(Dn).catch(Dn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(X(this,Qo))}isActive(){return this.observers.some(t=>YI(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===yv||this.state.dataUpdateCount+this.state.errorUpdate
436Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ug(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!QI(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=X(this,vr))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=X(this,vr))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),X(this,hn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(X(this,vr)&&(X(this,_i)?X(this,vr).cancel({revert:!0}):X(this,vr).cancelRetry()),this.scheduleGc()),X(this,hn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||mr(this,Mn,Rs).call(this,{type:"invalidate"})}fetch(t,r){var d,u,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(X(this,vr))return X(this,vr).continueRetry(),X(this,vr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(m=>m.options.queryFn);p&&this.setOptions(p.options)}const n=new AbortController,s=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(We(this,_i,!0),n.signal)})},a=()=>{const p=tN(this.options,r),y=(()=>{const g={client:X(this,bi),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return We(this,_i,!1),this.options.persister?this.options.persister(p,y,this):p(y)},l=(()=>{const p={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:X(this,bi),state:this.state,fetchFn:a};return s(p),p})();(d=this.options.behavior)==null||d.onFetch(l,this),We(this,xi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=l.fetchOptions)==null?void 0:u.meta))&&mr(this,Mn,Rs).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta});const c=p=>{var m,y,g,x;Sp(p)&&p.silent||mr(this,Mn,Rs).call(this,{type:"error",error:p}),Sp(p)||((y=(m=X(this,hn).config).onError)==null||y.call(m,p,this),(x=(g=X(this,hn).config).onSettled)==null||x.call(g,this.state.data,p,this)),this.scheduleGc()};return We(this,vr,aN({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,abort:n.abort.bind(n),onSuccess:p=>{var m,y,g,x;if(p===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(b){c(b);return}(y=(m=X(this,hn).config).onSuccess)==null||y.call(m,p,this),(x=(g=X(this,hn).config).onSettled)==null||x.call(g,p,this.state.error,this),this.scheduleGc()},onError:c,onFail:(p,m)=>{mr(this,Mn,Rs).call(this,{type:"failed",failureCount:p,error:m})},onPause:()=>{mr(this,Mn,Rs).call(this,{type:"pause"})},onContinue:()=>{mr(this,Mn,Rs).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),X(this,vr).start()}},Qo=new WeakMap,xi=new WeakMap,hn=new WeakMap,bi=new WeakMap,vr=new WeakMap,rd=new WeakMap,_i=new WeakMap,Mn=new WeakSet,Rs=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...c4(n.data,this.options),fetchMeta:t.meta??null};case"success":return We(this,xi,void 0),{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Sp(s)&&s.revert&&X(this,xi)?{...X(this,xi),fetchStatus:"idle"}
vendor: 5,105 bytes, line 436
436:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Cr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),X(this,hn).notify({query:this,type:"updated",action:t})})},e_);function c4(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:nN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function d4(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var os,t_,u4=(t_=class extends uf{constructor(t={}){super();it(this,os);this.config=t,We(this,os,new Map)}build(t,r,n){const s=r.queryKey,a=r.queryHash??gv(s,r);let o=this.get(a);return o||(o=new l4({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){X(this,os).has(t.queryHash)||(X(this,os).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=X(this,os).get(t.queryHash);r&&(t.destroy(),r===t&&X(this,os).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Cr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return X(this,os).get(t)}getAll(){return[...X(this,os).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>ib(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>ib(t,n)):r}notify(t){Cr.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Cr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Cr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},os=new WeakMap,t_),ls,jr,ji,cs,da,r_,h4=(r_=class extends iN{constructor(t){super();it(this,cs);it(this,ls);it(this,jr);it(this,ji);this.mutationId=t.mutationId,We(this,jr,t.mutationCache),We(this,ls,[]),this.state=t.state||f4(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){X(this,ls).includes(t)||(X(this,ls).push(t),this.clearGcTimeout(),X(this,jr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){We(this,ls,X(this,ls).filter(r=>r!==t)),this.scheduleGc(),X(this,jr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){X(this,ls).length||(this.state.status==="pending"?this.scheduleGc():X(this,jr).remove(this))}continue(){var t;return((t=X(this,ji))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,o,l,c,d,u,h,p,m,y,g,x,b,v,w,_,j,k,N,P;const r=()=>{mr(this,cs,da).call(this,{type:"continue"})};We(this,ji,aN({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,I)=>{mr(this,cs,da).call(this,{type:"failed",failureCount:T,error:I})},onPause:()=>{mr(this,cs,da).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>X(this,jr).canRun(this)}));const n=this.state.status==="pending",s=!X(this,ji).canStart();try{if(n)r();else{mr(this,cs,da).call(this,{type:"pending",variables:t,isPaused:s}),await((o=(a=X(this,jr).config).onMutate)==null?void 0:o.call(a,t,this));const I=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));I!==this.state.context&&mr(this,cs,da).call(this,{type:"pending",context:I,variables:t,isPaused:s})}const T=await X(this,ji).start();return await((u=(d=X(this,jr).config).onSuccess)==null?void 0:u.call(d,T,t,this.state.context,this)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,T,t,this.state.context)),await((y=(m=X(this,jr).config).onSettled)==null?void 0:y.call(m,T,null,this.state.variables,this.state.context,this)),await((x=(g=this.options).onSettled)==null?void 0:x.call(g,T,null,t,this.state.context)),mr(this,cs,da).call(this,{type:"success",data:T}),T}catch(T){try{throw await((v=(b=X(this,jr).config).onError)==null?void 0:v.call(b,T,t,this.state.context,this)),await((_=(w=this.options).onError)==null?void 0:_.call(w,T,t,this.state.context)),await((k=(j=X(this,jr).config).onSettled)==null?void 0:k.call(j,void 0,T,this.state.variables,this.state.context,this)),await((P=(N=this.options).onSettled)==null?void 0:P.call(N,void 0,T,t,this.state.context)),T}finally{mr(this,cs,da).call(this,{type:"error",error:T})}}finally{X(this,jr).runNext(this)}}},ls=new WeakMap,jr=new WeakMap,ji=new WeakMap,cs=new WeakSet,da=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};
436case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Cr.batch(()=>{X(this,ls).forEach(n=>{n.onMutationUpdate(t)}),X(this,jr).notify({mutation:this,type:"updated",action:t})})},r_);function f4(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Is,Fn,nd,n_,p4=(n_=class extends uf{constructor(t={}){super();it(this,Is);it(this,Fn);it(this,nd);this.config=t,We(this,Is,new Set),We(this,Fn,new Map),We(this,nd,0)}build(t,r,n){const s=new h4({mutationCache:this,mutationId:++Cd(this,nd)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){X(this,Is).add(t);const r=Gd(t);if(typeof r=="string"){const n=X(this,Fn).get(r);n?n.push(t):X(this,Fn).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(X(this,Is).delete(t)){const r=Gd(t);if(typeof r=="string"){const n=X(this,Fn).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&X(this,Fn).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Gd(t);if(typeof r=="string"){const n=X(this,Fn).get(r),s=n==null?void 0:n.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=Gd(t);if(typeof r=="string"){const s=(n=X(this,Fn).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Cr.batch(()=>
vendor: 7,283 bytes, lines 436-445
436{X(this,Is).forEach(t=>{this.notify({type:"removed",mutation:t})}),X(this,Is).clear(),X(this,Fn).clear()})}getAll(){return Array.from(X(this,Is))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>ob(r,n))}findAll(t={}){return this.getAll().filter(r=>ob(t,r))}notify(t){Cr.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Cr.batch(()=>Promise.all(t.map(r=>r.continue().catch(Dn))))}},Is=new WeakMap,Fn=new WeakMap,nd=new WeakMap,n_);function Gd(e){var t;return(t=e.options.scope)==null?void 0:t.id}function db(e){return{onFetch:(t,r)=>{var u,h,p,m,y;const n=t.options,s=(p=(h=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:h.fetchMore)==null?void 0:p.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let g=!1;const x=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},b=tN(t.options,t.fetchOptions),v=async(w,_,j)=>{if(g)return Promise.reject();if(_==null&&w.pages.length)return Promise.resolve(w);const N=(()=>{const H={client:t.client,queryKey:t.queryKey,pageParam:_,direction:j?"backward":"forward",meta:t.options.meta};return x(H),H})(),P=await b(N),{maxPages:T}=t.options,I=j?t4:e4;return{pages:I(w.pages,P,T),pageParams:I(w.pageParams,_,T)}};if(s&&a.length){const w=s==="backward",_=w?m4:ub,j={pages:a,pageParams:o},k=_(n,j);l=await v(j,k,w)}else{const w=e??a.length;do{const _=c===0?o[0]??n.initialPageParam:ub(n,l);if(c>0&&_==null)break;l=await v(l,_),c++}while(c<w)}return l};t.options.persister?t.fetchFn=()=>{var g,x;return(x=(g=t.options).persister)==null?void 0:x.call(g,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=d}}}function ub(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function m4(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var At,xa,ba,Yo,Jo,_a,Xo,el,s_,g4=(s_=class{constructor(e={}){it(this,At);it(this,xa);it(this,ba);it(this,Yo);it(this,Jo);it(this,_a);it(this,Xo);it(this,el);We(this,At,e.queryCache||new u4),We(this,xa,e.mutationCache||new p4),We(this,ba,e.defaultOptions||{}),We(this,Yo,new Map),We(this,Jo,new Map),We(this,_a,0)}mount(){Cd(this,_a)._++,X(this,_a)===1&&(We(this,Xo,rN.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,At).onFocus())})),We(this,el,ch.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,At).onOnline())})))}unmount(){var e,t;Cd(this,_a)._--,X(this,_a)===0&&((e=X(this,Xo))==null||e.call(this),We(this,Xo,void 0),(t=X(this,el))==null||t.call(this),We(this,el,void 0))}isFetching(e){return X(this,At).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return X(this,xa).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=X(this,At).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=X(this,At).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(ug(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return X(this,At).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=X(this,At).get(n.queryHash),a=s==null?void 0:s.state.data,o=ZI(t,a);if(o!==void 0)return X(this,At).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Cr.batch(()=>X(this,At).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=X(this,At).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=X(this,At);Cr.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=X(this,At);return Cr.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Cr.batch(()=>X(this,At).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Dn).catch(Dn)}invalidateQueries(e,t={}){return Cr.batch(()=>(X(this,At).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Cr.batch(()=>X(this,At).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,r);return r.throwOnError||(a=a.catch(Dn)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Dn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=X(this,At).build(this,t);return r.isStaleByTime(ug(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Dn).catch(Dn)}fetchInfiniteQuery(e){return e.behavior=db(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Dn).catch(Dn)}ensureInfiniteQueryData(e){return e.behavior=db(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ch.isOnline()?X(this,xa).resumePausedMutations():Promise.resolve()}getQueryCache(){return X(this,At)}getMutationCache(){return X(this,xa)}getDefaultOptions(){return X(this,ba)}setDefaultOptions(e){We(this,ba,e)}setQueryDefaults(e,t){X(this,Yo).set(Wc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...X(this,Yo).values()],r={};return t.forEach(n=>{Vc(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){X(this,Jo).set(Wc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...X(this,Jo).values()],r={};return t.forEach(n=>{Vc(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...X(this,ba).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=gv(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===yv&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...X(this,ba).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){X(this,At).clear(),X(this,xa).clear()}},At=new WeakMap,xa=new WeakMap,ba=new WeakMap,Yo=new WeakMap,Jo=new WeakMap,_a=new WeakMap,Xo=new WeakMap,el=new WeakMap,s_),y4=f.createContext(void 0),v4=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(y4.Provider,{value:e,children:t}));/**
437 * @remix-run/router v1.23.0
438 *
439 * Copyright (c) Remix Software Inc.
440 *
441 * This source code is licensed under the MIT license found in the
442 * LICENSE.md file in the root directory of this source tree.
443 *
444 * @license MIT
445 */function qc(){return qc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
vendor: 5,028 bytes, line 445
445for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qc.apply(this,arguments)}var Na;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Na||(Na={}));const hb="popstate";function w4(e){e===void 0&&(e={});function t(n,s){let{pathname:a,search:o,hash:l}=n.location;return fg("",{pathname:a,search:o,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(n,s){return typeof s=="string"?s:dh(s)}return b4(t,r,null,e)}function Pt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function oN(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function x4(){return Math.random().toString(36).substr(2,8)}function fb(e,t){return{usr:e.state,key:e.key,idx:t}}function fg(e,t,r,n){return r===void 0&&(r=null),qc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Tl(t):t,{state:r,key:t&&t.key||n||x4()})}function dh(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Tl(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function b4(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:a=!1}=n,o=s.history,l=Na.Pop,c=null,d=u();d==null&&(d=0,o.replaceState(qc({},o.state,{idx:d}),""));function u(){return(o.state||{idx:null}).idx}function h(){l=Na.Pop;let x=u(),b=x==null?null:x-d;d=x,c&&c({action:l,location:g.location,delta:b})}function p(x,b){l=Na.Push;let v=fg(g.location,x,b);d=u()+1;let w=fb(v,d),_=g.createHref(v);try{o.pushState(w,"",_)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;s.location.assign(_)}a&&c&&c({action:l,location:g.location,delta:1})}function m(x,b){l=Na.Replace;let v=fg(g.location,x,b);d=u();let w=fb(v,d),_=g.createHref(v);o.replaceState(w,"",_),a&&c&&c({action:l,location:g.location,delta:0})}function y(x){let b=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof x=="string"?x:dh(x);return v=v.replace(/ $/,"%20"),Pt(b,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,b)}let g={get action(){return l},get location(){return e(s,o)},listen(x){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(hb,h),c=x,()=>{s.removeEventListener(hb,h),c=null}},createHref(x){return t(s,x)},createURL:y,encodeLocation(x){let b=y(x);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:p,replace:m,go(x){return o.go(x)}};return g}var pb;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(pb||(pb={}));function _4(e,t,r){return r===void 0&&(r="/"),j4(e,t,r,!1)}function j4(e,t,r,n){let s=typeof t=="string"?Tl(t):t,a=hl(s.pathname||"/",r);if(a==null)return null;let o=lN(e);k4(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=D4(a);l=O4(o[c],d,n)}return l}function lN(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let s=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(Pt(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let d=Ia([n,c.relativePath]),u=r.concat(c);a.children&&a.children.length>0&&(Pt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),lN(a.children,t,u,d)),!(a.path==null&&!a.index)&&t.push({path:d,score:T4(d,a.index),routesMeta:u})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))s(a,o);else for(let c of cN(a.path))s(a,o,c)}),t}function cN(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return s?[a,""]:[a];let o=cN(n.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),s&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function k4(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:R4(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const N4=/^:[\w-]+$/,S4=3,C4=2,z4=1,E4=10,P4=-2,mb=e=>e==="*";function T4(e,t){let r=e.split("/"),n=r.length;return r.some(mb)&&(n+=P4),t&&(n+=C4),r.filter(s=>!mb(s)).reduce((s,a)=>s+(N4.test(a)?S4:a===""?z4:E4),n)}function R4(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function O4(e,t,r){let{routesMeta:n}=e,s={},a="/",o=[];for(let l=0;l<n.length;++l){let c=n[l],d=l===n.length-1,u=a==="/"?t:t.slice(a.length)||"/",h=uh({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},u),p=c.route;if(!h&&d&&r&&!n[n.length-1].route.index&&(h=uh({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!h)return null;
vendor: 9,263 bytes, lines 445-454
445Object.assign(s,h.params),o.push({params:s,pathname:Ia([a,h.pathname]),pathnameBase:$4(Ia([a,h.pathnameBase])),route:p}),h.pathnameBase!=="/"&&(a=Ia([a,h.pathnameBase]))}return o}function uh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=A4(e.path,e.caseSensitive,e.end),s=t.match(r);if(!s)return null;let a=s[0],o=a.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:n.reduce((d,u,h)=>{let{paramName:p,isOptional:m}=u;if(p==="*"){let g=l[h]||"";o=a.slice(0,a.length-g.length).replace(/(.)\/+$/,"$1")}const y=l[h];return m&&!y?d[p]=void 0:d[p]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:o,pattern:e}}function A4(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),oN(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function D4(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return oN(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function hl(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function I4(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?Tl(e):e;return{pathname:r?r.startsWith("/")?r:M4(r,t):t,search:L4(n),hash:U4(s)}}function M4(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function Cp(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function F4(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function vv(e,t){let r=F4(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function wv(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=Tl(e):(s=qc({},e),Pt(!s.pathname||!s.pathname.includes("?"),Cp("?","pathname","search",s)),Pt(!s.pathname||!s.pathname.includes("#"),Cp("#","pathname","hash",s)),Pt(!s.search||!s.search.includes("#"),Cp("#","search","hash",s)));let a=e===""||s.pathname==="",o=a?"/":s.pathname,l;if(o==null)l=r;else{let h=t.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),h-=1;s.pathname=p.join("/")}l=h>=0?t[h]:"/"}let c=I4(s,l),d=o&&o!=="/"&&o.endsWith("/"),u=(a||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const Ia=e=>e.join("/").replace(/\/\/+/g,"/"),$4=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),L4=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,U4=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function B4(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const dN=["post","put","patch","delete"];new Set(dN);const W4=["get",...dN];new Set(W4);/**
446 * React Router v6.30.1
447 *
448 * Copyright (c) Remix Software Inc.
449 *
450 * This source code is licensed under the MIT license found in the
451 * LICENSE.md file in the root directory of this source tree.
452 *
453 * @license MIT
454 */function Hc(){return Hc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hc.apply(this,arguments)}const ff=f.createContext(null),uN=f.createContext(null),ta=f.createContext(null),pf=f.createContext(null),ra=f.createContext({outlet:null,matches:[],isDataRoute:!1}),hN=f.createContext(null);function V4(e,t){let{relative:r}=t===void 0?{}:t;Rl()||Pt(!1);let{basename:n,navigator:s}=f.useContext(ta),{hash:a,pathname:o,search:l}=mf(e,{relative:r}),c=o;return n!=="/"&&(c=o==="/"?n:Ia([n,o])),s.createHref({pathname:c,search:l,hash:a})}function Rl(){return f.useContext(pf)!=null}function rs(){return Rl()||Pt(!1),f.useContext(pf).location}function fN(e){f.useContext(ta).static||f.useLayoutEffect(e)}function Zt(){let{isDataRoute:e}=f.useContext(ra);return e?nM():q4()}function q4(){Rl()||Pt(!1);let e=f.useContext(ff),{basename:t,future:r,navigator:n}=f.useContext(ta),{matches:s}=f.useContext(ra),{pathname:a}=rs(),o=JSON.stringify(vv(s,r.v7_relativeSplatPath)),l=f.useRef(!1);return fN(()=>{l.current=!0}),f.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let h=wv(d,JSON.parse(o),a,u.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Ia([t,h.pathname])),(u.replace?n.replace:n.push)(h,u.state,u)},[t,n,o,a,e])}function Xi(){let{matches:e}=f.useContext(ra),t=e[e.length-1];return t?t.params:{}}function mf(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=f.useContext(ta),{matches:s}=f.useContext(ra),{pathname:a}=rs(),o=JSON.stringify(vv(s,n.v7_relativeSplatPath));return f.useMemo(()=>wv(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function H4(e,t){return K4(e,t)}function K4(e,t,r,n){Rl()||Pt(!1);let{navigator:s}=f.useContext(ta),{matches:a}=f.useContext(ra),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=rs(),u;if(t){var h;let x=typeof t=="string"?Tl(t):t;c==="/"||(h=x.pathname)!=null&&h.startsWith(c)||Pt(!1),u=x}else u=d;let p=u.pathname||"/",m=p;if(c!=="/"){let x=c.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(x.length).join("/")}let y=_4(e,{pathname:m}),g=J4(y&&y.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:Ia([c,s.encodeLocation?s.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:Ia([c,s.encodeLocation?s.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),a,r,n);return t&&g?f.createElement(pf.Provider,{value:{location:Hc({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Na.Pop}},g):g}function Z4(){let e=rM(),t=B4(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),r?f.createElement("pre",{style:s},r):null,null)}const G4=f.createElement(Z4,null);class Q4 extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?f.createElement(ra.Provider,{value:this.props.routeContext},f.createElement(hN.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Y4(e){let{routeContext:t,match:r,children:n}=e,s=f.useContext(ff);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),f.createElement(ra.Provider,{value:t},n)}function J4(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(s=r)==null?void 0:s.errors;if(l!=null){let u=o.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);u>=0||Pt(!1),o=o.slice(0,Math.min(o.length,u+1))}let c=!1,d=-1;if(r&&n&&n.v7_partialHydration)for(let u=0;u<o.length;u++){let h=o[u];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(d=u),h.route.id){let{loaderData:p,errors:m}=r,y=h.route.loader&&p[h.route.id]===void 0&&(!m||m[h.route.id]===void 0);if(h.route.lazy||y){c=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((u,h,p)=>{let m,y=!1,g=null,x=null;r&&(m=l&&h.route.id?l[h.route.id]:void 0,g=h.route.errorElement||G4,c&&(d<0&&p===0?(y=!0,x=null):d===p&&(y=!0,x=h.route.hydrateFallbackElement||null)));let b=t.concat(o.slice(0,p+1)),v=()=>{let w;return m?w=g:y?w=x:h.route.Component?w=f.createElement(h.route.Component,null):h.route.element?w=h.route.element:w=u,f.createElement(Y4,{match:h,routeC
454ontext:{outlet:u,matches:b,isDataRoute:r!=null},children:w})};return r&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?f.createElement(Q4,{location:r.location,revalidation:r.revalidation,component:g,error:m,children:v(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):v()},null)}var pN=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(pN||{}),hh=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(hh||{});function X4(e){let t=f.useContext(ff);return t||Pt(!1),t}function eM(e){let t=f.useContext(uN);return t||Pt(!1),t}function tM(e){let t=f.useContext(ra);return t||Pt(!1),t}function mN(e){let t=tM(),r=t.matches[t.matches.length-1];return r.route.id||Pt(!1),r.route.id}function rM(){var e;let t=f.useContext(hN),r=eM(hh.UseRouteError),n=mN(hh.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function nM(){let{router:e}=X4(pN.UseNavigateStable),t=mN(hh.UseNavigateStable),r=f.useRef(!1);return fN(()=>{r.current=!0}),f.useCallback(function(s,a){a===void 0&&(a={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Hc({fromRouteId:t},a)))},[e,t])}function sM(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function gb(e){let{to:t,replace:r,state:n,relative:s}=e;Rl()||Pt(!1);let{future:a,static:o}=f.useContext(ta),{matches:l}=f.useContext(ra),{pathname:c}=rs(),d=Zt(),u=wv(t,vv(l,a.v7_relativeSplatPath),c,s==="path"),h=JSON.stringify(u);return f.useEffect(()=>d(JSON.parse(h),{replace:r,state:n,relative:s}),[d,h,s,r,n]),null}function Ut(e){Pt(!1)}function aM(e){let{basename:t="/",children:r=null,location:n,navigationType:s=Na.Pop,navigator:a,static:o=!1,future:l}=e;Rl()&&Pt(!1);let c=t.replace(/^\/*/,"/"),d=f.useMemo(()=>({basename:c,navigator:a,static:o,future:Hc({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof n=="string"&&(n=Tl(n));let{pathname:u="/",search:h="",hash:p="",state:m=null,key:y="default"}=n,g=f.useMemo(()=>{let x=hl(u,c);return x==null?null:{location:{pathname:x,search:h,hash:p,state:m,key:y},navigationType:s}},[c,u,h,p,m,y,s]);return g==null?null:f.createElement(ta.Provider,{value:d},f.createElement(pf.Provider,{children:r,value:g}))}function iM(e){let{children:t,location:r}=e;return H4(pg(t),r)}new Promise(()=>{});function pg(e,t){t===void 0&&(t=[]);let r=[];return f.Children.forEach(e,(n,s)=>{if(!f.isValidElement(n))return;let a=[...t,s];if(n.type===f.Fragment){r.push.apply(r,pg(n.props.children,a));return}n.type!==Ut&&Pt(!1),!n.props.index||!n.props.children||Pt(!1);let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=pg(n.props.children,a)),r.push(o)}),r}/**
455 * React Router DOM v6.30.1
456 *
457 * Copyright (c) Remix Software Inc.
458 *
459 * This source code is licensed under the MIT license found in the
460 * LICENSE.md file in the root directory of this source tree.
461 *
462 * @license MIT
463 */function fh(){return fh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fh.apply(this,arguments)}function gN(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,a;for(a=0;a<n.length;a++)s=n[a],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}function oM(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function lM(e,t){return e.button===0&&(!t||t==="_self")&&!oM(e)}function mg(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(s=>[r,s]):[[r,n]])},[]))}function cM(e,t){let r=mg(e);return t&&t.forEach((n,s)=>
463{r.has(s)||t.getAll(s).forEach(a=>{r.append(s,a)})}),r}const dM=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],uM=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],hM="6";try{window.__reactRouterVersion=hM}catch{}const fM=f.createContext({isTransitioning:!1}),pM="startTransition",yb=ay[pM];function mM(e){let{basename:t,children:r,future:n,window:s}=e,a=f.useRef();a.current==null&&(a.current=w4({window:s,v5Compat:!0}));let o=a.current,[l,c]=f.useState({action:o.action,location:o.location}),{v7_startTransition:d}=n||{},u=f.useCallback(h=>{d&&yb?yb(()=>c(h)):c(h)},[c,d]);return f.useLayoutEffect(()=>o.listen(u),[o,u]),f.useEffect(()=>sM(n),[n]),f.createElement(aM,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const gM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",yM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ks=f.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:a,replace:o,state:l,target:c,to:d,preventScrollReset:u,viewTransition:h}=t,p=gN(t,dM),{basename:m}=f.useContext(ta),y,g=!1;if(typeof d=="string"&&yM.test(d)&&(y=d,gM))try{let w=new URL(window.location.href),_=d.startsWith("//")?new URL(w.protocol+d):new URL(d),j=hl(_.pathname,m);_.origin===w.origin&&j!=null?d=j+_.search+_.hash:g=!0}catch{}let x=V4(d,{relative:s}),b=xM(d,{replace:o,state:l,target:c,preventScrollReset:u,relative:s,viewTransition:h});function v(w){n&&n(w),w.defaultPrevented||b(w)}return f.createElement("a",fh({},p,{href:y||x,onClick:g||a?n:v,ref:r,target:c}))}),vM=f.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:s=!1,className:a="",end:o=!1,style:l,to:c,viewTransition:d,children:u}=t,h=gN(t,uM),p=mf(c,{relative:h.relative}),m=rs(),y=f.useContext(uN),{navigator:g,basename:x}=f.useContext(ta),b=y!=null&&bM(p)&&d===!0,v=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,w=m.pathname,_=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;s||(w=w.toLowerCase(),_=_?_.toLowerCase():null,v=v.toLowerCase()),_&&x&&(_=hl(_,x)||_);const j=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let k=w===v||!o&&w.startsWith(v)&&w.charAt(j)==="/",N=_!=null&&(_===v||!o&&_.startsWith(v)&&_.charAt(v.length)==="/"),P={isActive:k,isPending:N,isTransitioning:b},T=k?n:void 0,I;typeof a=="function"?I=a(P):I=[a,k?"active":null,N?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let H=typeof l=="function"?l(P):l;return f.createElement(ks,fh({},h,{"aria-current":T,className:I,ref:r,style:H,to:c,viewTransition:d}),typeof u=="function"?u(P):u)});var gg;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(gg||(gg={}));var vb;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(vb||(vb={}));function wM(e){let t=f.useContext(ff);return t||Pt(!1),t}function xM(e,t){let{target:r,replace:n,state:s,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=Zt(),d=rs(),u=mf(e,{relative:o});return f.useCallback(h=>{if(lM(h,r)){h.preventDefault();let p=n!==void 0?n:dh(d)===dh(u);c(e,{replace:p,state:s,preventScrollReset:a,relative:o,viewTransition:l})}},[d,c,u,n,s,r,e,a,o,l])}function yN(e){let t=f.useRef(mg(e)),r=f.useRef(!1),n=rs(),s=f.useMemo(()=>cM(n.search,r.current?null:t.current),[n.search]),a=Zt(),o=f.useCallback((l,c)=>{const d=mg(typeof l=="function"?l(s):l);r.current=!0,a("?"+d,c)},[a,s]);return[s,o]}function bM(e,t){t===void 0&&(t={});let r=f.useContext(fM);r==null&&Pt(!1);let{basename:n}=wM(gg.useViewTransitionState),s=mf(e,{relative:t.relative});if(!r.isTransitioning)return!1;let a=hl(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=hl(r.nextLocation.pathname,n)||r.nextLocation.pathname;return uh(s.pathname,o)!=null||uh(s.pathname,a)!=null}var yg=function(e,t){return yg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])},yg(e,t)};function vN(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");yg(e,t);function r(){this.constructor=e}
vendor: 4,280 bytes, line 463
463e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var gn=function(){return gn=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},gn.apply(this,arguments)};function Ja(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function wN(e,t,r,n){var s=arguments.length,a=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(s<3?o(a):s>3?o(t,r,a):o(t,r))||a);return s>3&&a&&Object.defineProperty(t,r,a),a}function xN(e,t){return function(r,n){t(r,n,e)}}function bN(e,t,r,n,s,a){function o(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var l=n.kind,c=l==="getter"?"get":l==="setter"?"set":"value",d=!t&&e?n.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),h,p=!1,m=r.length-1;m>=0;m--){var y={};for(var g in n)y[g]=g==="access"?{}:n[g];for(var g in n.access)y.access[g]=n.access[g];y.addInitializer=function(b){if(p)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(b||null))};var x=(0,r[m])(l==="accessor"?{get:u.get,set:u.set}:u[c],y);if(l==="accessor"){if(x===void 0)continue;if(x===null||typeof x!="object")throw new TypeError("Object expected");(h=o(x.get))&&(u.get=h),(h=o(x.set))&&(u.set=h),(h=o(x.init))&&s.unshift(h)}else(h=o(x))&&(l==="field"?s.unshift(h):u[c]=h)}d&&Object.defineProperty(d,n.name,u),p=!0}function _N(e,t,r){for(var n=arguments.length>2,s=0;s<t.length;s++)r=n?t[s].call(e,r):t[s].call(e);return n?r:void 0}function jN(e){return typeof e=="symbol"?e:"".concat(e)}function kN(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function NN(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function be(e,t,r,n){function s(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(u){try{d(n.next(u))}catch(h){o(h)}}function c(u){try{d(n.throw(u))}catch(h){o(h)}}function d(u){u.done?a(u.value):s(u.value).then(l,c)}d((n=n.apply(e,t||[])).next())})}function SN(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,s,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(d){return function(u){return c([d,u])}}function c(d){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,d[0]&&(r=0)),r;)try{if(n=1,s&&(a=d[0]&2?s.return:d[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,d[1])).done)return a;switch(s=0,a&&(d=[d[0]&2,a.value]),d[0]){case 0:case 1:a=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,s=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]<a[3])){r.label=d[1];break}if(d[0]===6&&r.label<a[1]){r.label=a[1],a=d;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(d);break}a[2]&&r.ops.pop(),r.trys.pop();continue}d=t.call(e,r)}catch(u){d=[6,u],s=0}finally{n=a=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}var gf=Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]};function CN(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&gf(t,e,r)}function ph(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);
vendor: 4,327 bytes, line 463
463if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function xv(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),s,a=[],o;try{for(;(t===void 0||t-- >0)&&!(s=n.next()).done;)a.push(s.value)}catch(l){o={error:l}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function zN(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(xv(arguments[t]));return e}function EN(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),s=0,t=0;t<r;t++)for(var a=arguments[t],o=0,l=a.length;o<l;o++,s++)n[s]=a[o];return n}function bv(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,a;n<s;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function fl(e){return this instanceof fl?(this.v=e,this):new fl(e)}function PN(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),s,a=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(m){return function(y){return Promise.resolve(y).then(m,h)}}function l(m,y){n[m]&&(s[m]=function(g){return new Promise(function(x,b){a.push([m,g,x,b])>1||c(m,g)})},y&&(s[m]=y(s[m])))}function c(m,y){try{d(n[m](y))}catch(g){p(a[0][3],g)}}function d(m){m.value instanceof fl?Promise.resolve(m.value.v).then(u,h):p(a[0][2],m)}function u(m){c("next",m)}function h(m){c("throw",m)}function p(m,y){m(y),a.shift(),a.length&&c(a[0][0],a[0][1])}}function TN(e){var t,r;return t={},n("next"),n("throw",function(s){throw s}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(s,a){t[s]=e[s]?function(o){return(r=!r)?{value:fl(e[s](o)),done:!1}:a?a(o):o}:a}}function RN(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof ph=="function"?ph(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(o){return new Promise(function(l,c){o=e[a](o),s(l,c,o.done,o.value)})}}function s(a,o,l,c){Promise.resolve(c).then(function(d){a({value:d,done:l})},o)}}function ON(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var _M=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},vg=function(e){return vg=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},vg(e)};function AN(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=vg(e),n=0;n<r.length;n++)r[n]!=="default"&&gf(t,e,r[n]);return _M(t,e),t}function DN(e){return e&&e.__esModule?e:{default:e}}function IN(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function MN(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r}function FN(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function $N(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,s;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(s=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");
vendor: 1,395 bytes, line 463
463s&&(n=function(){try{s.call(this)}catch(a){return Promise.reject(a)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var jM=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function LN(e){function t(a){e.error=e.hasError?new jM(a,e.error,"An error was suppressed during disposal."):a,e.hasError=!0}var r,n=0;function s(){for(;r=e.stack.pop();)try{if(!r.async&&n===1)return n=0,e.stack.push(r),Promise.resolve().then(s);if(r.dispose){var a=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(a).then(s,function(o){return t(o),s()})}else n|=1}catch(o){t(o)}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return s()}function UN(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,s,a,o){return n?t?".jsx":".js":s&&(!a||!o)?r:s+a+"."+o.toLowerCase()+"js"}):e}const kM={__extends:vN,__assign:gn,__rest:Ja,__decorate:wN,__param:xN,__esDecorate:bN,__runInitializers:_N,__propKey:jN,__setFunctionName:kN,__metadata:NN,__awaiter:be,__generator:SN,__createBinding:gf,__exportStar:CN,__values:ph,__read:xv,__spread:zN,__spreadArrays:EN,__spreadArray:bv,__await:fl,__asyncGenerator:PN,__asyncDelegator:TN,__asyncValues:RN,__makeTemplateOb
463ject:ON,__importStar:AN,__importDefault:DN,__classPrivateFieldGet:IN,__classPrivateFieldSet:MN,__classPrivateFieldIn:FN,__addDisposableResource:$N,__disposeResources:LN,__rewriteRelativeImportExtension:UN},NM=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:$N,get __assign(){return gn},__asyncDelegator:TN,__asyncGenerator:PN,__asyncValues:RN,__await:fl,__awaiter:be,__classPrivateFieldGet:IN,__classPrivateFieldIn:FN,__classPrivateFieldSet:MN,__createBinding:gf,__decorate:wN,__disposeResources:LN,__esDecorate:bN,__exportStar:CN,__extends:vN,__generator:SN,__importDefault:DN,__importStar:AN,__makeTemplateObject:ON,__metadata:NN,__param:xN,__propKey:jN,__read:xv,__rest:Ja,__rewriteRelativeImportExtension:UN,__runInitializers:_N,__setFunctionName:kN,__spread:zN,__spreadArray:bv,__spreadArrays:EN,__values:ph,default:kM},Symbol.toStringTag,{value:"Module"})),SM=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class _v extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}}class CM extends _v{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class wb extends _v{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class xb extends _v{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var wg;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(wg||(wg={}));class zM{constructor(t,{headers:r={},customFetch:n,region:s=wg.Any}={}){this.url=t,this.headers=r,this.region=s,this.fetch=SM(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return be(this,arguments,void 0,function*(r,n={}){var s;let a,o;try{const{headers:l,method:c,body:d,signal:u,timeout:h}=n;let p={},{region:m}=n;m||(m=this.region);const y=new URL(`${this.url}/${r}`);m&&m!=="any"&&(p["x-region"]=m,y.searchParams.set("forceFunctionRegion",m));let g;d&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&d instanceof Blob||d instanceof ArrayBuffer?(p["Content-Type"]="application/octet-stream",g=d):typeof d=="string"?(p["Content-Type"]="text/plain",g=d):typeof FormData<"u"&&d instanceof FormData?g=d:(p["Content-Type"]="application/json",g=JSON.stringify(d)):g=d;let x=u;h&&(o=new AbortController,a=setTimeout(()=>o.abort(),h),u?(x=o.signal,u.addEventListener("abort",()=>o.abort())):x=o.signal);const b=yield this.fetch(y.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},p),this.headers),l),body:g,signal:x}).catch(j=>{throw new CM(j)}),v=b.headers.get("x-relay-error");if(v&&v==="true")throw new wb(b);if(!b.ok)throw new xb(b);let w=((s=b.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),_;return w==="application/json"?_=yield b.json():w==="application/octet-stream"||w==="application/pdf"?_=yield b.blob():w==="text/event-stream"?_=b:w==="multipart/form-data"?_=yield b.formData():_=yield b.text(),{data:_,error:null,response:b}}catch(l){return{data:null,error:l,response:l instanceof xb||l instanceof wb?l.context:void 0}}finally{a&&clearTimeout(a)}})}}var zr={};const Ol=eP(NM);var Qd={},Yd={},Jd={},Xd={},eu={},tu={},bb;function BN(){if(bb)return tu;bb=1,Object.defineProperty(tu,"__esModule",{value:!0});class e extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.co
463de=r.code}}return tu.default=e,tu}var _b;function WN(){if(_b)return eu;_b=1,Object.defineProperty(eu,"__esModule",{value:!0});const t=Ol.__importDefault(BN());class r{constructor(s){var a,o;this.shouldThrowOnError=!1,this.method=s.method,this.url=s.url,this.headers=new Headers(s.headers),this.schema=s.schema,this.body=s.body,this.shouldThrowOnError=(a=s.shouldThrowOnError)!==null&&a!==void 0?a:!1,this.signal=s.signal,this.isMaybeSingle=(o=s.isMaybeSingle)!==null&&o!==void 0?o:!1,s.fetch?this.fetch=s.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(s,a){return this.headers=new Headers(this.headers),this.headers.set(s,a),this}then(s,a){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const o=this.fetch;let l=o(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async c=>{var d,u,h,p;let m=null,y=null,g=null,x=c.status,b=c.statusText;if(c.ok){if(this.method!=="HEAD"){const j=await c.text();j===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((d=this.headers.get("Accept"))===null||d===void 0)&&d.includes("application/vnd.pgrst.plan+text"))?y=j:y=JSON.parse(j))}const w=(u=this.headers.get("Prefer"))===null||u===void 0?void 0:u.match(/count=(exact|planned|estimated)/),_=(h=c.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");w&&_&&_.length>1&&(g=parseInt(_[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(y)&&(y.length>1?(m={code:"PGRST116",details:`Results contain ${y.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},y=null,g=null,x=406,b="Not Acceptable"):y.length===1?y=y[0]:y=null)}else{const w=await c.text();try{m=JSON.parse(w),Array.isArray(m)&&c.status===404&&(y=[],m=null,x=200,b="OK")}catch{c.status===404&&w===""?(x=204,b="No Content"):m={message:w}}if(m&&this.isMaybeSingle&&(!((p=m==null?void 0:m.details)===null||p===void 0)&&p.includes("0 rows"))&&(m=null,x=200,b="OK"),m&&this.shouldThrowOnError)throw new t.default(m)}return{error:m,data:y,count:g,status:x,statusText:b}});return this.shouldThrowOnError||(l=l.catch(c=>{var d,u,h,p,m,y;let g="";const x=c==null?void 0:c.cause;if(x){const b=(d=x==null?void 0:x.message)!==null&&d!==void 0?d:"",v=(u=x==null?void 0:x.code)!==null&&u!==void 0?u:"";g=`${(h=c==null?void 0:c.name)!==null&&h!==void 0?h:"FetchError"}: ${c==null?void 0:c.message}`,g+=`
464
465Caused by: ${(p=x==null?void 0:x.name)!==null&&p!==void 0?p:"Error"}: ${b}`,v&&(g+=` (${v})`),x!=null&&x.stack&&(g+=`
466${x.stack}`)}else g=(m=c==null?void 0:c.stack)!==null&&m!==void 0?m:"";return{error:{message:`${(y=c==null?void 0:c.name)!==null&&y!==void 0?y:"FetchError"}: ${c==null?void 0:c.message}`,details:g,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),l.then(s,a)}returns(){return this}overrideTypes(){return this}}return eu.default=r,eu}var jb;function VN(){if(jb)return Xd;jb=1,Object.defineProperty(Xd,"__esModule",{value:!0});const t=Ol.__importDefault(WN());class r extends t.default{select(s){let a=!1;const o=(s??"*").split("").map(l=>/\s/.test(l)&&!a?"":(l==='"'&&(a=!a),l)).join("");return this.url.searchParams.set("select",o),this.headers.append("Prefer","return=representation"),this}order(s,{ascending:a=!0,nullsFirst:o,foreignTable:l,referencedTable:c=l}={}){const d=c?`${c}.order`:"order",u=this.url.searchParams.get(d);return this.url.searchParams.set(d,`${u?`${u},`:""}${s}.${a?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(s,{foreignTable:a,referencedTable:o=a}={}){const l=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(l,`${s}`),this}range(s,a,{foreignTable:o,referencedTable:l=o}={}){const c=typeof l>"u"?"offset":`${l}.offset`,d=typeof l>"u"?"limit":`${l}.limit`;return this.url.searchParams.set(c,`${s}`),this.url.searchParams.set(d,`${a-s+1}`),this}abortSignal(s){return this.signal=s,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
466explain({analyze:s=!1,verbose:a=!1,settings:o=!1,buffers:l=!1,wal:c=!1,format:d="text"}={}){var u;const h=[s?"analyze":null,a?"verbose":null,o?"settings":null,l?"buffers":null,c?"wal":null].filter(Boolean).join("|"),p=(u=this.headers.get("Accept"))!==null&&u!==void 0?u:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${d}; for="${p}"; options=${h};`),d==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(s){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${s}`),this}}return Xd.default=r,Xd}var kb;function jv(){if(kb)return Jd;kb=1,Object.defineProperty(Jd,"__esModule",{value:!0});const t=Ol.__importDefault(VN()),r=new RegExp("[,()]");class n extends t.default{eq(a,o){return this.url.searchParams.append(a,`eq.${o}`),this}neq(a,o){return this.url.searchParams.append(a,`neq.${o}`),this}gt(a,o){return this.url.searchParams.append(a,`gt.${o}`),this}gte(a,o){return this.url.searchParams.append(a,`gte.${o}`),this}lt(a,o){return this.url.searchParams.append(a,`lt.${o}`),this}lte(a,o){return this.url.searchParams.append(a,`lte.${o}`),this}like(a,o){return this.url.searchParams.append(a,`like.${o}`),this}likeAllOf(a,o){return this.url.searchParams.append(a,`like(all).{${o.join(",")}}`),this}likeAnyOf(a,o){return this.url.searchParams.append(a,`like(any).{${o.join(",")}}`),this}ilike(a,o){return this.url.searchParams.append(a,`ilike.${o}`),this}ilikeAllOf(a,o){return this.url.searchParams.append(a,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(a,o){return this.url.searchParams.append(a,`ilike(any).{${o.join(",")}}`),this}regexMatch(a,o){return this.url.searchParams.append(a,`match.${o}`),this}regexIMatch(a,o){return this.url.searchParams.append(a,`imatch.${o}`),this}is(a,o){return this.url.searchParams.append(a,`is.${o}`),this}isDistinct(a,o){return this.url.searchParams.append(a,`isdistinct.${o}`),this}in(a,o){const l=Array.from(new Set(o)).map(c=>typeof c=="string"&&r.test(c)?`"${c}"`:`${c}`).join(",");return this.url.searchParams.append(a,`in.(${l})`),this}contains(a,o){return typeof o=="string"?this.url.searchParams.append(a,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(a,`cs.{${o.join(",")}}`):this.url.searchParams.append(a,`cs.${JSON.stringify(o)}`),this}containedBy(a,o){return typeof o=="string"?this.url.searchParams.append(a,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(a,`cd.{${o.join(",")}}`):this.url.searchParams.append(a,`cd.${JSON.stringify(o)}`),this}rangeGt(a,o){return this.url.searchParams.append(a,`sr.${o}`),this}rangeGte(a,o){return this.url.searchParams.append(a,`nxl.${o}`),this}rangeLt(a,o){return this.url.searchParams.append(a,`sl.${o}`),this}rangeLte(a,o){return this.url.searchParams.append(a,`nxr.${o}`),this}rangeAdjacent(a,o){return this.url.searchParams.append(a,`adj.${o}`),this}overlaps(a,o){return typeof o=="string"?this.url.searchParams.append(a,`ov.${o}`):this.url.searchParams.append(a,`ov.{${o.join(",")}}`),this}textSearch(a,o,{config:l,type:c}={}){let d="";c==="plain"?d="pl":c==="phrase"?d="ph":c==="websearch"&&(d="w");const u=l===void 0?"":`(${l})`;return this.url.searchParams.append(a,`${d}fts${u}.${o}`),this}match(a){return Object.entries(a).forEach(([o,l])=>{this.url.searchParams.append(o,`eq.${l}`)}),this}not(a,o,l){return this.url.searchParams.append(a,`not.${o}.${l}`),this}or(a,{foreignTable:o,referencedTable:l=o}={}){const c=l?`${l}.or`:"or";return this.url.searchParams.append(c,`(${a})`),this}filter(a,o,l){return this.url.searchParams.append(a,`${o}.${l}`),this}}return Jd.default=n,Jd}var Nb;function qN(){if(Nb)return Yd;Nb=1,Object.defineProperty(Yd,"__esModule",{value:!0});const t=Ol.__importDefault(jv());class r{constructor(s,{headers:a={},schema:o,fetch:l}){this.url=s,this.headers=new Headers(a),this.schema=o,this.fetch=l}select(s,a){const{head:o=!1,count:l}=a??{},c=o?"HEAD":"GET";let d=!1;const u=(s??"*").split("").map(h=>/\s/.test(h)&&!d?"":(h==='"'&&(d=!d),h)).join("");return this.url.searchParams.set("select",u),l&&this.headers.append("Prefer",`count=${l}`),new t.default({method:c,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(s,{count:a,defaultToNull:o=!0}={}){var l;const c="POST";if(a&&this.headers.append("Prefer",`count=${a}`),o||this.headers.append("Prefer","missing=default"),Array.isArray(s)){const d=s.reduce((u,h)=>u.concat(Object.keys(h)),[]);if(d.length>0){const u=[...new Set(d)].map(h=>`"${h}"`);this.url.searchParams.set("columns",u.join(","))}}return new t.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch})}upsert(s,{onConflict:a,ignoreDuplicates:o=!1,count:l,defaultToNull:c=!0}={}){var d;const u="POST";if(this.headers.append("Prefer",`resolution=${o?"ignore":"merge"}-duplicates`),a!==void 0&&this.url.searchParams.set("on_conflict",a),l&&this.headers.append("Prefer",`count=${l}`),c||this.headers.append("Prefer","missing=default"),Array.isArray(s)){const h=s.reduce((p,m)=>p.concat(Object.keys(m)),[]);if(h.length>0){const p=[...new Set(h)].map(m=>`"${m}"`);this.url.searchParams.set("columns",p.join(","))}}return new t.default({method:u,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(d=this.fetch)!==null&&d!==void 0?d:fetch})}update(s,{count:a}={}){var o;const l="PATCH";return a&&this.headers.append("Prefer",`count=${a}`),new t.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}delete({count:s}={}){var a;const o="DELETE";return s&&this.headers.append("Prefer",`count=${s}`),new t.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}}return Yd.default=r,Yd}var Sb;function EM(){if(Sb)return Qd;Sb=1,Object.defineProperty(Qd,"__esModule",{value:!0});const e=Ol,t=e.__importDefault(qN()),r=e.__importDefault(jv());
466class n{constructor(a,{headers:o={},schema:l,fetch:c}={}){this.url=a,this.headers=new Headers(o),this.schemaName=l,this.fetch=c}from(a){if(!a||typeof a!="string"||a.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");const o=new URL(`${this.url}/${a}`);return new t.default(o,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(a){return new n(this.url,{headers:this.headers,schema:a,fetch:this.fetch})}rpc(a,o={},{head:l=!1,get:c=!1,count:d}={}){var u;let h;const p=new URL(`${this.url}/rpc/${a}`);let m;l||c?(h=l?"HEAD":"GET",Object.entries(o).filter(([g,x])=>x!==void 0).map(([g,x])=>[g,Array.isArray(x)?`{${x.join(",")}}`:`${x}`]).forEach(([g,x])=>{p.searchParams.append(g,x)})):(h="POST",m=o);const y=new Headers(this.headers);return d&&y.set("Prefer",`count=${d}`),new r.default({method:h,url:p,headers:y,schema:this.schemaName,body:m,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}}return Qd.default=n,Qd}Object.defineProperty(zr,"__esModule",{value:!0});var HN=zr.PostgrestError=rS=zr.PostgrestBuilder=eS=zr.PostgrestTransformBuilder=JN=zr.PostgrestFilterBuilder=QN=zr.PostgrestQueryBuilder=ZN=zr.PostgrestClient=void 0;const Al=Ol,KN=Al.__importDefault(EM());var ZN=zr.PostgrestClient=KN.default;const GN=Al.__importDefault(qN());var QN=zr.PostgrestQueryBuilder=GN.default;const YN=Al.__importDefault(jv());var JN=zr.PostgrestFilterBuilder=YN.default;const XN=Al.__importDefault(VN());var eS=zr.PostgrestTransformBuilder=XN.default;const tS=Al.__importDefault(WN());var rS=zr.PostgrestBuilder=tS.default;const nS=Al.__importDefault(BN());HN=zr.PostgrestError=nS.default;var sS=zr.default={PostgrestClient:KN.default,PostgrestQueryBuilder:GN.default,PostgrestFilterBuilder:YN.default,PostgrestTransformBuilder:XN.default,PostgrestBuilder:tS.default,PostgrestError:nS.default};const PM=a_({__proto__:null,get PostgrestBuilder(){return rS},get PostgrestClient(){return ZN},get PostgrestError(){return HN},get PostgrestFilterBuilder(){return JN},get PostgrestQueryBuilder(){return QN},get PostgrestTransformBuilder(){return eS},default:sS},[zr]),{PostgrestClient:TM,PostgrestQueryBuilder:o7,PostgrestFilterBuilder:l7,PostgrestTransformBuilder:c7,PostgrestBuilder:d7,PostgrestError:u7}=sS||PM;class RM{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"){const r=process.versions;if(r&&r.node){const n=r.node,s=parseInt(n.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
467import ws from "ws"
468new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=`
469
470Suggested solution: ${t.workaround}`),new Error(r)}static createWebSocket(t,r){const n=this.getWebSocketConstructor();return new n(t,r)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const OM="2.86.0",AM=`realtime-js/${OM}`,aS="1.0.0",DM="2.0.0",Cb=aS,xg=1e4,IM=1e3,MM=100;var ci;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(ci||(ci={}));var Qt;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Qt||(Qt={}));var Ln;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(Ln||(Ln={}));var bg;(function(e){e.websocket="websocket"})(bg||(bg={}));var di;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(di||(di={}));class FM{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,r){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(t));let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(t){var r;return this._isArrayBuffer((r=t.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var r,n;const s=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(t){var r,n;const s=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},o=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,r,n){var s,a;const o=t.topic,l=(s=t.ref)!==null&&s!==void 0?s:"",c=(a=t.join_ref)!==null&&a!==void 0?a:"",d=t.payload.event,u=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},h=Object.keys(u).length===0?"":JSON.stringify(u);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`userEvent length ${d.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const p=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+o.length+d.length+h.length,m=new ArrayBuffer(this.HEADER_LENGTH+p);let y=new DataView(m),g=0;y.setUint8(g++,this.KINDS.userBroadcastPush),y.setUint8(g++,c.length),y.setUint8(g++,l.length),y.setUint8(g++,o.length),y.setUint8(g++,d.length),y.setUint8(g++,h.length),y.setUint8(g++,r),Array.from(c,b=>y.setUint8(g++,b.charCodeAt(0))),Array.from(l,b=>y.setUint8(g++,b.charCodeAt(0))),Array.from(o,b=>y.setUint8(g++,b.charCodeAt(0))),Array.from(d,b=>y.setUint8(g++,b.charCodeAt(0))),Array.from(h,b=>y.setUint8(g++,b.charCodeAt(0)));var x=new Uint8Array(m.byteLength+n.byteLength);return x.set(new Uint8Array(m),0),x.set(new Uint8Array(n),m.byteLength),x.buffer}decode(t,r){if(this._isArrayBuffer(t)){let n=this._binaryDecode(t);return r(n)}if(typeof t=="string"){const n=JSON.parse(t),[s,a,o,l,c]=n;return r({join_ref:s,ref:a,topic:o,event:l,payload:c})}return r({})}_binaryDecode(t){const r=new DataView(t),n=r.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,r,s)}}_decodeUserBroadcast(t,r,n){const s=r.getUint8(1),a=r.getUint8(2),o=r.getUint8(3),l=r.getUint8(4);let c=this.HEADER_LENGTH+4;const d=n.decode(t.slice(c,c+s));c=c+s;const u=n.decode(t.slice(c,c+a));c=c+a;
470const h=n.decode(t.slice(c,c+o));c=c+o;const p=t.slice(c,t.byteLength),m=l===this.JSON_ENCODING?JSON.parse(n.decode(p)):p,y={type:this.BROADCAST_EVENT,event:u,payload:m};return o>0&&(y.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:d,event:this.BROADCAST_EVENT,payload:y}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t==null?void 0:t.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(t,r){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([n])=>r.includes(n)))}}class iS{constructor(t,r){this.callback=t,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var vt;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(vt||(vt={}));const zb=(e,t,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((a,o)=>(a[o]=$M(o,e,t,s),a),{}):{}},$M=(e,t,r,n)=>{const s=t.find(l=>
470l.name===e),a=s==null?void 0:s.type,o=r[e];return a&&!n.includes(a)?oS(a,o):_g(o)},oS=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return WM(t,r)}switch(e){case vt.bool:return LM(t);case vt.float4:case vt.float8:case vt.int2:case vt.int4:case vt.int8:case vt.numeric:case vt.oid:return UM(t);case vt.json:case vt.jsonb:return BM(t);case vt.timestamp:return VM(t);case vt.abstime:case vt.date:case vt.daterange:case vt.int4range:case vt.int8range:case vt.money:case vt.reltime:case vt.text:case vt.time:case vt.timestamptz:case vt.timetz:case vt.tsrange:case vt.tstzrange:return _g(t);default:return _g(t)}},_g=e=>e,LM=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},UM=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},BM=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},WM=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let a;const o=e.slice(1,r);try{a=JSON.parse("["+o+"]")}catch{a=o?o.split(","):[]}return a.map(l=>oS(t,l))}return e},VM=e=>typeof e=="string"?e.replace(" ","T"):e,lS=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class zp{constructor(t,r,n={},s=xg){this.channel=t,this.event=r,this.payload=n,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,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(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,r){var n;return this._hasReceived(t)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:t,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(r))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var Eb;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Eb||(Eb={}));class mc{constructor(t,r){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},s=>{const{onJoin:a,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=mc.syncState(this.state,s,a,o),this.pendingDiffs.forEach(c=>{this.state=mc.syncDiff(this.state,c,a,o)}),this.pendingDiffs=[],l()}),this.channel._on(n.diff,{},s=>{const{onJoin:a,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=mc.syncDiff(this.state,s,a,o),l())}),this.onJoin((s,a,o)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:a,newPresences:o})}),this.onLeave((s,a,o)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:a,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,r,n,s){const a=this.cloneDeep(t),o=this.transformState(r),l={},c={};return this.map(a,(d,u)=>{o[d]||(c[d]=u)}),this.map(o,(d,u)=>{const h=a[d];if(h){const p=u.map(x=>x.presence_ref),m=h.map(x=>x.presence_ref),y=u.filter(x=>m.indexOf(x.presence_ref)<0),g=h.filter(x=>p.indexOf(x.presence_ref)<0);y.length>0&&(l[d]=y),g.length>0&&(c[d]=g)}else l[d]=u}),this.syncDiff(a,{joins:l,leaves:c},n,s)}static syncDiff(t,r,n,s){const{joins:a,leaves:o}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),s||(s=()=>{}),this.map(a,(l,c)=>{var d;const u=(d=t[l])!==null&&d!==void 0?d:[];if(t[l]=this.cloneDeep(c),u.length>0){const h=t[l].map(m=>m.presence_ref),p=u.filter(m=>h.indexOf(m.presence_ref)<0);t[l].unshift(...p)}n(l,u,c)}),this.map(o,(l,c)=>{let d=t[l];if(!d)return;const u=c.map(h=>h.presence_ref);d=d.filter(h=>u.indexOf(h.presence_ref)<0),t[l]=d,s(l,d,c),d.length===0&&delete t[l]}),t}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const s=t[n];return"metas"in s?r[n]=s.metas.map(a=>(a.presence_ref=a.phx_ref,delete a.phx_ref,delete a.phx_ref_prev,a)):r[n]=s,r},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var Pb;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Pb||(Pb={}));var gc;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(gc||(gc={}));var As;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(As||(As={}));class kv{constructor(t,r={config:{}},n){var s,a;if(this.topic=t,this.params=r,this.socket=n,this.bindings={},this.state=Qt.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new zp(this,Ln.join,this.params,this.timeout),this.rejoinTimer=new iS(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Qt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Qt.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Qt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Qt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Qt.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Ln.reply,{},(o,l)=>{this._trigger(this._replyEventName(l),o)}),this.presence=new mc(this),this.broadcastEndpointURL=lS(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((a=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||a===void 0)&&a.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,r=this.timeout){var n,s,a;if(this.socket.isConnected()||this.socket.connect(),this.state==Qt.closed){const{config:{broadcast:o,presence:l,private:c}}=this.params,d=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(m=>m.filter))!==null&&s!==void 0?s:[],u=!!this.bindings[gc.PRESENCE]&&this.bindings[gc.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,h={},p={broadcast:o,presence:Object.assign(Object.assign({},l),{enabled:u}),postgres_changes:d,private:c};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(m=>t==null?void 0:t(As.CHANNEL_ERROR,m)),this._onClose(()=>t==null?void 0:t(As.CLOSED)),this.updateJoinPayload(Object.assign({config:p},h)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:m})=>{var y;if(this.socket.setAuth(),m===void 0){t==null||t(As.SUBSCRIBED);return}else{const g=this.bindings.postgres_changes,x=(y=g==null?void 0:g.length)!==null&&y!==void 0?y:0,b=[];for(let v=0;v<x;v++){const w=g[v],{filter:{event:_,schema:j,table:k,filter:N}}=w,P=m&&m[v];if(P&&P.event===_&&P.schema===j&&P.table===k&&P.filter===N)b.push(Object.assign(Object.assign({},w),{id:P.id}));else{this.unsubscribe(),this.state=Qt.errored,t==null||t(As.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=b,t&&t(As.SUBSCRIBED);return}}).receive("error",m=>{this.state=Qt.errored,t==null||t(As.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(m).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(As.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,n){return this.state===Qt.joined&&t===gc.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(t,r,n)}async httpSend(t,r,n={}){var s;const a=this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"";if(r==null)return Promise.reject("Payload is required for httpSend()");const o={method:"POST",headers:{Authorization:a,apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(l.status===202)return{success:!0};let c=l.statusText;
470try{const d=await l.json();c=d.error||d.message||c}catch{}return Promise.reject(new Error(c))}async send(t,r={}){var n,s;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:a,payload:o}=t,c={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:o,private:this.private}]})};try{const d=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=d.body)===null||s===void 0?void 0:s.cancel()),d.ok?"ok":"error"}catch(d){return d.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var o,l,c;const d=this._push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(o=this.params)===null||o===void 0?void 0:o.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&a("ok"),d.receive("ok",()=>a("ok")),d.receive("error",()=>a("error")),d.receive("timeout",()=>a("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Qt.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Ln.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(s=>{n=new zp(this,Ln.leave,{},t),n.receive("ok",()=>{r(),s("ok")}).receive("timeout",()=>{r(),s("timed out")}).receive("error",()=>{s("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Qt.closed,this.bindings={}}async _fetchWithTimeout(t,r,n){const s=new AbortController,a=setTimeout(()=>s.abort(),n),o=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(a),o}_push(t,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new zp(this,t,r,n);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>MM){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(t,r,n){return r}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,r,n){var s,a;const o=t.toLocaleLowerCase(),{close:l,error:c,leave:d,join:u}=Ln;if(n&&[l,c,d,u].indexOf(o)>=0&&n!==this._joinRef())return;let p=this._onMessage(o,r,n);if(r&&!p)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(m=>{var y,g,x;return((y=m.filter)===null||y===void 0?void 0:y.event)==="*"||((x=(g=m.filter)===null||g===void 0?void 0:g.event)===null||x===void 0?void 0:x.toLocaleLowerCase())===o}).map(m=>m.callback(p,n)):(a=this.bindings[o])===null||a===void 0||a.filter(m=>{var y,g,x,b,v,w;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in m){const _=m.id,j=(y=m.filter)===null||y===void 0?void 0:y.event;return _&&((g=r.ids)===null||g===void 0?void 0:g.includes(_))&&(j==="*"||(j==null?void 0:j.toLocaleLowerCase())===((x=r.data)===null||x===void 0?void 0:x.type.toLocaleLowerCase()))}else{const _=(v=(b=m==null?void 0:m.filter)===null||b===void 0?void 0:b.event)===null||v===void 0?void 0:v.toLocaleLowerCase();return _==="*"||_===((w=r==null?void 0:r.event)===null||w===void 0?void 0:w.toLocaleLowerCase())}else return m.type.toLocaleLowerCase()===o}).map(m=>{if(typeof p=="object"&&"ids"in p){const y=p.data,{schema:g,table:x,commit_timestamp:b,type:v,errors:w}=y;p=Object.assign(Object.assign({},{schema:g,table:x,commit_timestamp:b,eventType:v,new:{},old:{},errors:w}),this._getPayloadRecords(y))}m.callback(p,n)})}_isClosed(){return this.state===Qt.closed}_isJoined(){return this.state===Qt.joined}_isJoining(){return this.state===Qt.joining}_isLeaving(){return this.state===Qt.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,r,n){const s=t.toLocaleLowerCase(),a={type:s,filter:r,callback:n};return this.bindings[s]?this.bindings[s].push(a):this.bindings[s]=[a],this}_off(t,r){const n=t.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(s=>{var a;return!(((a=s.type)===null||a===void 0?void 0:a.toLocaleLowerCase())===n&&kv.isEqual(s.filter,r))})),this}static isEqual(t,r){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(const n in t)if(t[n]!==r[n])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Ln.close,{},t)}_onError(t){this._on(Ln.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Qt.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=zb(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=zb(t.columns,t.old_record)),r}}const Ep=()=>{},ru={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},qM=[1e3,2e3,5e3,1e4],HM=1e4,KM=`
471  addEventListener("message", (e) => {
472    if (e.data.event === "start") {
473      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
474    }
475  });`;class ZM{constructor(t,r){var n;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=xg,this.transport=null,this.heartbeatIntervalMs=ru.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Ep,this.ref=0,this.reconnectTimer=null,this.vsn=Cb,this.logger=Ep,this.conn=null,this.sendBuffer=[],this.serializer
475=new FM,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=s=>s?(...a)=>s(...a):(...a)=>fetch(...a),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${t}/${bg.websocket}`,this.httpEndpoint=lS(t),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=RM.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const r=t.message;throw r.includes("Node.js")?new Error(`${r}
476
477To use Realtime in Node.js, you need to provide a WebSocket implementation:
478
479Option 1: Use Node.js 22+ which has native WebSocket support
480Option 2: Install and provide the "ws" package:
481
482  npm install ws
483
484  import ws from "ws"
485  const client = new RealtimeClient(url, {
486    ...options,
487    transport: ws
488  })`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,r??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const t=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,r,n){this.logger(t,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case ci.connecting:return di.Connecting;case ci.open:return di.Open;case ci.closing:return di.Closing;default:return di.Closed}}isConnected(){return this.connectionState()===di.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,r={config:{}}){const n=`realtime:${t}`,s=this.getChannels().find(a=>a.topic===n);if(s)return s;{const a=new kv(`realtime:${t}`,r,this);return this.channels.push(a),a}}push(t){const{topic:r,event:n,payload:s,ref:a}=t,o=()=>{this.encode(t,l=>{var c;(c=this.conn)===null||c===void 0||c.send(l)})};this.log("push",`${r} ${n} (${a})`,s),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(IM,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.sc
488heduleTimeout()},ru.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let r=this.channels.find(n=>n.topic===t&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${t}"`),r.unsubscribe())}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply")try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error")}catch(d){this.log("error","error in heartbeat callback",d)}r.ref&&r.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:n,event:s,payload:a,ref:o}=r,l=o?`(${o})`:"",c=a.status||"";this.log("receive",`${c} ${n} ${s} ${l}`.trim(),a),this.channels.filter(d=>d._isMember(n)).forEach(d=>d._trigger(s,a,o)),this._triggerStateCallbacks("message",r)})}_clearTimer(t){var r;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t))}_teardownConnection(){if(this.conn){if(this.conn.readyState===ci.open||this.conn.readyState===ci.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(r=>{this.log("error","error waiting for auth on connect",r),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this.workerRef.terminate()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(t){var r;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.sc
488heduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t)}_triggerChanError(){this.channels.forEach(t=>t._trigger(Ln.error))}_appendParams(t,r){if(Object.keys(r).length===0)return t;const n=t.match(/\?/)?"&":"?",s=new URLSearchParams(r);return`${t}${n}${s}`}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([KM],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_setConnectionState(t,r=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(t=null){let r;t?r=t:this.accessToken?r=await this.accessToken():r=this.accessTokenValue,this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(n=>{const s={access_token:r,version:AM};r&&n.updateJoinPayload(s),n.joinedOnce&&n._isJoined()&&n._push(Ln.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this.setAuth().catch(r=>{this.log("error",`error setting auth in ${t}`,r)})}_triggerStateCallbacks(t,r){try{this.stateChangeCallbacks[t].forEach(n=>{try{n(r)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(n){this.log("error",`error triggering ${t} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new iS(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},ru.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,n,s,a,o,l,c,d,u,h,p,m;switch(this.transport=(r=t==null?void 0:t.transport)!==null&&r!==void 0?r:null,this.timeout=(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:xg,this.heartbeatIntervalMs=(s=t==null?void 0:t.heartbeatIntervalMs)!==null&&s!==void 0?s:ru.HEARTBEAT_INTERVAL,this.worker=(a=t==null?void 0:t.worker)!==null&&a!==void 0?a:!1,this.accessToken=(o=t==null?void 0:t.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(l=t==null?void 0:t.heartbeatCallback)!==null&&l!==void 0?l:Ep,this.vsn=(c=t==null?void 0:t.vsn)!==null&&c!==void 0?c:Cb,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(d=t==null?void 0:t.reconnectAfterMs)!==null&&d!==void 0?d:y=>qM[y-1]||HM,this.vsn){case aS:this.encode=(u=t==null?void 0:t.encode)!==null&&u!==void 0?u:(y,g)=>g(JSON.stringify(y)),this.decode=(h=t==null?void 0:t.decode)!==null&&h!==void 0?h:(y,g)=>g(JSON.parse(y));break;case DM:this.encode=(p=t==null?void 0:t.encode)!==null&&p!==void 0?p:this.serializer.encode.bind(this.serializer),this.decode=(m=t==null?void 0:t.decode)!==null&&m!==void 0?m:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}class yf extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}}function Ct(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}class GM extends yf{constructor(t,r,n){super(t),this.name="StorageApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class jg extends yf{constructor(t,r){super(t),this.name="StorageUnknownError",this.originalError=r}}const Nv=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),QM=()=>Response,kg=e=>{if(Array.isArray(e))return e.map(r=>kg(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const s=r.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));t[s]=kg(n)}),t},YM=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},JM=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),Pp=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},XM=(e,t,r)=>be(void 0,void 0,void 0,function*(){const n=yield QM();e instanceof n&&!(r!=null&&r.noResolveJson)?e.json().then(s=>{const a=e.status||500,o=(s==null?void 0:s.statusCode)||a+"";t(new GM(Pp(s),a,o))}).catch(s=>{t(new jg(Pp(s),s))}):t(new jg(Pp(e),e))}),e3=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||!n?s:(YM(n)?(s.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),s.body=JSON.stringify(n)):s.body=n,t!=null&&t.duplex&&(s.duplex=t.duplex),Object.assign(Object.assign({},s),r))};function fd(e,t,r,n,s,a){return be(this,void 0,void 0,function*(){return new Promise((o,l)=>{e(r,e3(t,n,s,a)).then(c=>{if(!c.ok)throw c;return n!=null&&n.noResolveJson?c:c.json()}).then(c=>o(c)).catch(c=>XM(c,l,n))})})}function Kc(e,t,r,n){return be(this,void 0,void 0,function*(){return fd(e,"GET",t,r,n)})}function In(e,t,r,n,s){return be(this,void 0,void 0,function*(){return fd(e,"POST",t,n,s,r)})}function Ng(e,t,r,n,s){return be(this,void 0,void 0,function*(){return fd(e,"PUT",t,n,s,r)})}function t3(e,t,r,n){return be(this,void 0,void 0,function*(){return fd(e,"HEAD",t,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}function Sv(e,t,r,n,s){return be(this,void 0,void 0,function*(){return fd(e,"DELETE",t,n,s,r)})}class r3{constructor(t,r){this.downloadFn=t,this.shouldThrowOnError=r}then(t,r){return this.execute().then(t,r)}execute(){return be(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(Ct(t))return{data:null,error:t};throw t}})}}var cS;class n3{constructor(t,r){this.downloadFn=t,this.shouldThrowOnError=r,this[cS]="BlobDownloadBuilder",this.promise=null}asStream(){return new r3(this.downloadFn,this.shouldThrowOnError)}then(t,r){return this.getPromise().then(t,r)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return be(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(Ct(t))return{data:null,error:t};throw t}})}}cS=Symbol.toStringTag;const s3={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Tb={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class a3{constructor(t,r={},n,s){this.shouldThrowOnError=!1,this.url=t,this.headers=r,this.bucketId=n,this.fetch=Nv(s)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(t,r,n,s){return be(this,void 0,void 0,function*(){try{let a;const o=Object.assign(Object.assign({},Tb),s);let l=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&n instanceof Blob?(a=new FormData,a.append("cacheControl",o.cacheControl),c&&a.append("metadata",this.encodeMetadata(c)),a.append("",n)):typeof FormData<"u"&&n instanceof FormData?(a=n,a.has("cacheControl")||a.append("cacheControl",o.cacheControl),c&&!a.has("metadata")&&a.append("metadata",this.encodeMetadata(c))):(a=n,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=this.toBase64(this.encodeMetadata(c))),(typeof ReadableStream<"u"&&a 
488instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!o.duplex&&(o.duplex="half")),s!=null&&s.headers&&(l=Object.assign(Object.assign({},l),s.headers));const d=this._removeEmptyFolders(r),u=this._getFinalPath(d),h=yield(t=="PUT"?Ng:In)(this.fetch,`${this.url}/object/${u}`,a,Object.assign({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:d,id:h.Id,fullPath:h.Key},error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(Ct(a))return{data:null,error:a};throw a}})}upload(t,r,n){return be(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,r,n)})}uploadToSignedUrl(t,r,n,s){return be(this,void 0,void 0,function*(){const a=this._removeEmptyFolders(t),o=this._getFinalPath(a),l=new URL(this.url+`/object/upload/sign/${o}`);l.searchParams.set("token",r);try{let c;const d=Object.assign({upsert:Tb.upsert},s),u=Object.assign(Object.assign({},this.headers),{"x-upsert":String(d.upsert)});typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",d.cacheControl),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.append("cacheControl",d.cacheControl)):(c=n,u["cache-control"]=`max-age=${d.cacheControl}`,u["content-type"]=d.contentType);const h=yield Ng(this.fetch,l.toString(),c,{headers:u});return{data:{path:a,fullPath:h.Key},error:null}}catch(c){if(this.shouldThrowOnError)throw c;if(Ct(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(t,r){return be(this,void 0,void 0,function*(){try{let n=this._getFinalPath(t);const s=Object.assign({},this.headers);r!=null&&r.upsert&&(s["x-upsert"]="true");const a=yield In(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:s}),o=new URL(this.url+a.url),l=o.searchParams.get("token");if(!l)throw new yf("No token returned by API");return{data:{signedUrl:o.toString(),path:t,token:l},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ct(n))return{data:null,error:n};throw n}})}update(t,r,n){return be(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,r,n)})}move(t,r,n){return be(this,void 0,void 0,function*(){try{return{data:yield In(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Ct(s))return{data:null,error:s};throw s}})}copy(t,r,n){return be(this,void 0,void 0,function*(){try{return{data:{path:(yield In(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers})).Key},error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Ct(s))return{data:null,error:s};throw s}})}createSignedUrl(t,r,n){return be(this,void 0,void 0,function*(){try{let s=this._getFinalPath(t),a=yield In(this.fetch,`${this.url}/object/sign/${s}`,Object.assign({expiresIn:r},n!=null&&n.transform?{transform:n.transform}:{}),{headers:this.headers});const o=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return a={signedUrl:encodeURI(`${this.url}${a.signedURL}${o}`)},{data:a,error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Ct(s))return{data:null,error:s};throw s}})}createSignedUrls(t,r,n){return be(this,void 0,void 0,function*(){try{const s=yield In(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:t},{headers:this.headers}),a=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{data:s.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${a}`):null})),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Ct(s))return{data:null,error:s};throw s}})}download(t,r){const s=typeof(r==null?void 0:r.transform)<"u"?"render/image/authenticated":"object",a=this.transformOptsToQueryString((r==null?void 0:r.transform)||{}),o=a?`?${a}`:"",l=this._getFinalPath(t),c=()=>Kc(this.fetch,`${this.url}/${s}/${l}${o}`,{headers:this.headers,noResolveJson:!0});return new n3(c,this.shouldThrowOnError)}info(t){return be(this,void 0,void 0,function*(){const r=this._getFinalPath(t);try{const n=yield Kc(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:kg(n),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ct(n))return{data:null,error:n};throw n}})}exists(t){return be(this,void 0,void 0,function*(){const r=this._getFinalPath(t);try{return yield t3(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ct(n)&&n instanceof jg){const s=n.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:n}}throw n}})}getPublicUrl(t,r){const n=this._getFinalPath(t),s=[],a=r!=null&&r.download?`download=${r.download===!0?"":r.download}`:"";a!==""&&s.push(a);const l=typeof(r==null?void 0:r.transform)<"u"?"render/image":"object",c=this.transformOptsToQueryString((r==null?void 0:r.transform)||{});c!==""&&s.push(c);let d=s.join("&");return d!==""&&(d=`?${d}`),{data:{publicUrl:encodeURI(`${this.url}/${l}/public/${n}${d}`)}}}remove(t){return be(this,void 0,void 0,function*(){try{return{data:yield Sv(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ct(r))return{data:null,error:r};throw r}})}list(t,r,n){return be(this,void 0,void 0,function*(){try{const s=Object.assign(Object.assign(Object.assign({},s3),r),{prefix:t||""});return{data:yield In(this.fetch,`${this.url}/object/list/${this.bucketId}`,s,{headers:this.headers},n),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Ct(s))return{data:null,error:s};throw s}})}listV2(t,r){return be(this,void 0,void 0,function*(){try{const n=Object.assign({},t);return{data:yield In(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,n,{headers:this.headers},r),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ct(n))return{data:null,error:n};throw n}})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const r=[];return t.width&&r.push(`width=${t.width}`),t.height&&r.push(`height=${t.height}`),t.resize&&r.push(`resize=${t.resize}`),t.format&&r.push(`format=${t.format}`),t.quality&&r.push(`quality=${t.quality}`),r.join("&")}}const dS="2.86.0",uS={"X-Client-Info":`storage-js/${dS}`};class i3{constructor(t,r={},n,s){this.shouldThrowOnError=!1;const a=new URL(t);s!=null&&s.useNewHostname&&/supabase\.(co|in|red)$/.test(a.hostname)&&!a.hostname.includes("storage.supabase.")&&(a.hostname=a.hostname.replace("supabase.","storage.supabase.")),this.url=a.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},uS),r),this.fetch=Nv(n)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(t){return be(this,void 0,void 0,function*(){try{const r=this.listBucketOptionsToQueryString(t);return{data:yield Kc(this.fetch,`${this.url}/bucket${r}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ct(r))return{data:null,error:r};throw r}})}getBucket(t){return be(this,void 0,void 0,function*(){try{return{data:yield Kc(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ct(r))return{data:null,error:r};throw r}})}createBucket(t){return be(this,arguments,void 0,function*(r,n={public:!1}){try{return{data:yield In(this.fetch,`${this.url}/bucket`,{id:r,name:r,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Ct(s))return{data:null,error:s};throw s}})}updateBucket(t,r){return be(this,void 0,void 0,function*(){try{return{data:yield Ng(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ct(n))return{data:null,error:n};throw n}})}emptyBucket(t){return be(this,void 0,void 0,function*(){try{return{data:yield In(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ct(r))return{data:null,error:r};throw r}})}deleteBucket(t){return be(this,void 0,void 0,function*(){try{return{data:yield Sv(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ct(r))return{data:null,error:r};throw r}})}listBucketOptionsToQueryString(t){const r={};return t&&("limit"in t&&(r.limit=String(t.limit)),"offset"in t&&(r.offset=String(t.offset)),t.search&&(r.search=t.search),t.sortColumn&&(r.sortColumn=t.sortColumn),t.sortOrder&&(r.sortOrder=t.sortOrder)),Object.keys(r).length>0?"?"+new URLSearchParams(r).toString():""}}
488var Zc=class extends Error{constructor(e,t){var r;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((r=t.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function o3(e,t,r){const n=new URL(t,e);if(r)for(const[s,a]of Object.entries(r))a!==void 0&&n.searchParams.set(s,a);return n.toString()}async function l3(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function c3(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:a,headers:o}){const l=o3(e.baseUrl,n,s),c=await l3(e.auth),d=await t(l,{method:r,headers:{...a?{"Content-Type":"application/json"}:{},...c,...o},body:a?JSON.stringify(a):void 0}),u=await d.text(),h=(d.headers.get("content-type")||"").includes("application/json"),p=h&&u?JSON.parse(u):u;if(!d.ok){const m=h?p:void 0,y=m==null?void 0:m.error;throw new Zc((y==null?void 0:y.message)??`Request failed with status ${d.status}`,{status:d.status,icebergType:y==null?void 0:y.type,icebergCode:y==null?void 0:y.code,details:m})}return{status:d.status,headers:d.headers,data:p}}}}function nu(e){return e.join("�")}var d3=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:nu(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(e,t){const r={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${nu(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${nu(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${nu(e.namespace)}`}),!0}catch(t){if(t instanceof Zc&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof Zc&&r.status===409)return;throw r}}};function to(e){return e.join("�")}var u3=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${to(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${to(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${to(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${to(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${to(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${to(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof Zc&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof Zc&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},h3=class{constructor(e){var n;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=c3({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new d3(this.client,t),this.tableOps=new u3(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
488async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};class f3{constructor(t,r={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},uS),r),this.fetch=Nv(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(t){return be(this,void 0,void 0,function*(){try{return{data:yield In(this.fetch,`${this.url}/bucket`,{name:t},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ct(r))return{data:null,error:r};throw r}})}listBuckets(t){return be(this,void 0,void 0,function*(){try{const r=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&r.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&r.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&r.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&r.set("sortOrder",t.sortOrder),t!=null&&t.search&&r.set("search",t.search);const n=r.toString(),s=n?`${this.url}/bucket?${n}`:`${this.url}/bucket`;return{data:yield Kc(this.fetch,s,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ct(r))return{data:null,error:r};throw r}})}deleteBucket(t){return be(this,void 0,void 0,function*(){try{return{data:yield Sv(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ct(r))return{data:null,error:r};throw r}})}from(t){if(!JM(t))throw new yf("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");return new h3({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:()=>be(this,void 0,void 0,function*(){return this.headers})},fetch:this.fetch})}}const Cv={"X-Client-Info":`storage-js/${dS}`,"Content-Type":"application/json"};class hS extends Error{constructor(t){super(t),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}}function Jr(e){return typeof e=="object"&&e!==null&&"__isStorageVectorsError"in e}class Tp extends hS{constructor(t,r,n){super(t),this.name="StorageVectorsApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class p3 extends hS{constructor(t,r){super(t),this.name="StorageVectorsUnknownError",this.originalError=r}}var Rb;(function(e){e.InternalError="InternalError",e.S3VectorConflictException="S3VectorConflictException",e.S3VectorNotFoundException="S3VectorNotFoundException",e.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",e.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",e.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded"})(Rb||(Rb={}));const zv=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),m3=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Ob=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),g3=(e,t,r)=>be(void 0,void 0,void 0,function*(){if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(r!=null&&r.noResolveJson)){const s=e.status||500,a=e;if(typeof a.json=="function")a.json().then(o=>{const l=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||s+"";t(new Tp(Ob(o),s,l))}).catch(()=>{const o=s+"",l=a.statusText||`HTTP ${s} error`;t(new Tp(l,s,o))});else{const o=s+"",l=a.statusText||`HTTP ${s} error`;t(new Tp(l,s,o))}}else t(new p3(Ob(e),e))}),y3=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return n?(m3(n)?(s.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),s.body=JSON.stringify(n)):s.body=n,Object.assign(Object.assign({},s),r)):s};function v3(e,t,r,n,s,a){return be(this,void 0,void 0,function*(){return new Promise((o,l)=>{e(r,y3(t,n,s,a)).then(c=>{if(!c.ok)throw c;if(n!=null&&n.noResolveJson)return c;const d=c.headers.get("content-type");
488return!d||!d.includes("application/json")?{}:c.json()}).then(c=>o(c)).catch(c=>g3(c,l,n))})})}function Xr(e,t,r,n,s){return be(this,void 0,void 0,function*(){return v3(e,"POST",t,n,s,r)})}class w3{constructor(t,r={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Cv),r),this.fetch=zv(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(t){return be(this,void 0,void 0,function*(){try{return{data:(yield Xr(this.fetch,`${this.url}/CreateIndex`,t,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Jr(r))return{data:null,error:r};throw r}})}getIndex(t,r){return be(this,void 0,void 0,function*(){try{return{data:yield Xr(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:t,indexName:r},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Jr(n))return{data:null,error:n};throw n}})}listIndexes(t){return be(this,void 0,void 0,function*(){try{return{data:yield Xr(this.fetch,`${this.url}/ListIndexes`,t,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Jr(r))return{data:null,error:r};throw r}})}deleteIndex(t,r){return be(this,void 0,void 0,function*(){try{return{data:(yield Xr(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:t,indexName:r},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Jr(n))return{data:null,error:n};throw n}})}}class x3{constructor(t,r={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Cv),r),this.fetch=zv(n)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(t){return be(this,void 0,void 0,function*(){try{if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:(yield Xr(this.fetch,`${this.url}/PutVectors`,t,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Jr(r))return{data:null,error:r};throw r}})}getVectors(t){return be(this,void 0,void 0,function*(){try{return{data:yield Xr(this.fetch,`${this.url}/GetVectors`,t,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Jr(r))return{data:null,error:r};throw r}})}listVectors(t){return be(this,void 0,void 0,function*(){try{if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return{data:yield Xr(this.fetch,`${this.url}/ListVectors`,t,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Jr(r))return{data:null,error:r};throw r}})}queryVectors(t){return be(this,void 0,void 0,function*(){try{return{data:yield Xr(this.fetch,`${this.url}/QueryVectors`,t,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Jr(r))return{data:null,error:r};throw r}})}deleteVectors(t){return be(this,void 0,void 0,function*(){try{if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:(yield Xr(this.fetch,`${this.url}/DeleteVectors`,t,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Jr(r))return{data:null,error:r};throw r}})}}class b3{constructor(t,r={},n){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Cv),r),this.fetch=zv(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(t){return be(this,void 0,void 0,function*(){try{return{data:(yield Xr(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Jr(r))return{data:null,error:r};throw r}})}getBucket(t){return be(this,void 0,void 0,function*(){try{return{data:yield Xr(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:t},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Jr(r))return{data:null,error:r};throw r}})}listBuckets(){return be(this,arguments,void 0,function*(t={}){try{return{data:yield Xr(this.fetch,`${this.url}/ListVectorBuckets`,t,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Jr(r))return{data:null,error:r};throw r}})}deleteBucket(t){return be(this,void 0,void 0,function*(){try{return{data:(yield Xr(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Jr(r))return{data:null,error:r};throw r}})}}class _3 extends b3{constructor(t,r={}){super(t,r.headers||{},r.fetch)}from(t){return new j3(this.url,this.headers,t,this.fetch)}createBucket(t){const r=Object.create(null,{createBucket:{get:()=>super.createBucket}});return be(this,void 0,void 0,function*(){return r.createBucket.call(this,t)})}getBucket(t){const r=Object.create(null,{getBucket:{get:()=>super.getBucket}});return be(this,void 0,void 0,function*(){return r.getBucket.call(this,t)})}listBuckets(){const t=Object.create(null,{listBuckets:{get:()=>super.listBuckets}});return be(this,arguments,void 0,function*(r={}
488){return t.listBuckets.call(this,r)})}deleteBucket(t){const r=Object.create(null,{deleteBucket:{get:()=>super.deleteBucket}});return be(this,void 0,void 0,function*(){return r.deleteBucket.call(this,t)})}}class j3 extends w3{constructor(t,r,n,s){super(t,r,s),this.vectorBucketName=n}createIndex(t){const r=Object.create(null,{createIndex:{get:()=>super.createIndex}});return be(this,void 0,void 0,function*(){return r.createIndex.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){const t=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return be(this,arguments,void 0,function*(r={}){return t.listIndexes.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName}))})}getIndex(t){const r=Object.create(null,{getIndex:{get:()=>super.getIndex}});return be(this,void 0,void 0,function*(){return r.getIndex.call(this,this.vectorBucketName,t)})}deleteIndex(t){const r=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return be(this,void 0,void 0,function*(){return r.deleteIndex.call(this,this.vectorBucketName,t)})}index(t){return new k3(this.url,this.headers,this.vectorBucketName,t,this.fetch)}}class k3 extends x3{constructor(t,r,n,s,a){super(t,r,a),this.vectorBucketName=n,this.indexName=s}putVectors(t){const r=Object.create(null,{putVectors:{get:()=>super.putVectors}});return be(this,void 0,void 0,function*(){return r.putVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(t){const r=Object.create(null,{getVectors:{get:()=>super.getVectors}});return be(this,void 0,void 0,function*(){return r.getVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){const t=Object.create(null,{listVectors:{get:()=>super.listVectors}});return be(this,arguments,void 0,function*(r={}){return t.listVectors.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(t){const r=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return be(this,void 0,void 0,function*(){return r.queryVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(t){const r=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return be(this,void 0,void 0,function*(){return r.deleteVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}}class N3 extends i3{constructor(t,r={},n,s){super(t,r,n,s)}from(t){return new a3(this.url,this.headers,t,this.fetch)}get vectors(){return new _3(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new f3(this.url+"/iceberg",this.headers,this.fetch)}}const S3="2.86.0";let rc="";typeof Deno<"u"?rc="deno":typeof document<"u"?rc="web":typeof navigator<"u"&&navigator.product==="ReactNative"?rc="react-native":rc="node";const C3={"X-Client-Info":`supabase-js-${rc}/${S3}`},z3={headers:C3},E3={schema:"public"},P3={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},T3={},R3=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),O3=()=>Headers,A3=(e,t,r)=>{const n=R3(r),s=O3();return async(a,o)=>{var l;const c=(l=await t())!==null&&l!==void 0?l:e;let d=new s(o==null?void 0:o.headers);return d.has("apikey")||d.set("apikey",e),d.has("Authorization")||d.set("Authorization",`Bearer ${c}`),n(a,Object.assign(Object.assign({},o),{headers:d}))}};function D3(e){return e.endsWith("/")?e:e+"/"}function I3(e,t){var r,n;const{db:s,auth:a,realtime:o,global:l}=e,{db:c,auth:d,realtime:u,global:h}=t,p={db:Object.assign(Object.assign({},c),s),auth:Object.assign(Object.assign({},d),a),realtime:Object.assign(Object.assign({},u),o),storage:{},global:Object.assign(Object.assign(Object.assign({},h),l),{headers:Object.assign(Object.assign({},(r=h==null?void 0:h.headers)!==null&&r!==void 0?r:{}),(n=l==null?void 0:l.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return e.accessToken?p.accessToken=e.accessToken:delete p.accessToken,p}function M3(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");
488if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(D3(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const fS="2.86.0",mo=30*1e3,Sg=3,Rp=Sg*mo,F3="http://localhost:9999",$3="supabase.auth.token",L3={"X-Client-Info":`gotrue-js/${fS}`},Cg="X-Supabase-Api-Version",pS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},U3=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,B3=10*60*1e3;class Gc extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function Ee(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class W3 extends Gc{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function V3(e){return Ee(e)&&e.name==="AuthApiError"}class ui extends Gc{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class Xa extends Gc{constructor(t,r,n,s){super(t,n,s),this.name=r,this.status=n}}class Zr extends Xa{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function q3(e){return Ee(e)&&e.name==="AuthSessionMissingError"}class ro extends Xa{constructor(){super("Auth session or user missing","AuthInvalidToken
488ResponseError",500,void 0)}}class su extends Xa{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class au extends Xa{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function H3(e){return Ee(e)&&e.name==="AuthImplicitGrantRedirectError"}class Ab extends Xa{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class zg extends Xa{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function Op(e){return Ee(e)&&e.name==="AuthRetryableFetchError"}class Db extends Xa{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class Eg extends Xa{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const mh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Ib=` 	
489\r=`.split(""),K3=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Ib.length;t+=1)e[Ib[t].charCodeAt(0)]=-2;for(let t=0;t<mh.length;t+=1)e[mh[t].charCodeAt(0)]=t;return e})();function Mb(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(mh[n]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(mh[n]),t.queuedBits-=6}}function mS(e,t,r){const n=K3[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function Fb(e){const t=[],r=o=>{t.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},a=o=>{Q3(o,n,r)};for(let o=0;o<e.length;o+=1)mS(e.charCodeAt(o),s,a);return t.join("")}function Z3(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function G3(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){const s=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}Z3(n,t)}}function Q3(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&r(t.codepoint)}}function Wo(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};for(let s=0;s<e.length;s+=1)mS(e.charCodeAt(s),r,n);return new Uint8Array(t)}function Y3(e){const t=[];return G3(e,r=>t.push(r)),new Uint8Array(t)}function gi(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};return e.forEach(s=>Mb(s,r,n)),Mb(null,r,n),t.join("")}function J3(e){return Math.round(Date.now()/1e3)+e}function X3(){return Symbol("auth-callback")}const ur=()=>typeof window<"u"&&typeof document<"u",ni={tested:!1,writable:!1},gS=()=>{if(!ur())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ni.tested)return ni.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),ni.tested=!0,ni.writable=!0}catch{ni.tested=!0,ni.writable=!1}return ni.writable};function eF(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((s,a)=>{t[a]=s})}catch{}return r.searchParams.forEach((n,s)=>{t[s]=n}),t}const yS=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),tF=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",go=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},si=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},la=async(e,t)=>{await e.removeItem(t)};class vf{constructor(){this.promise=new vf.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}vf.promiseConstructor=Promise;function Ap(e){const t=e.split(".");if(t.length!==3)throw new Eg("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!U3.test(t[n]))throw new Eg("JWT not in base64url format");return{header:JSON.parse(Fb(t[0])),payload:JSON.parse(Fb(t[1])),signature:Wo(t[2]),raw:{header:t[0],payload:t[1]}}}async function rF(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function nF(e,t){return new Promise((n,s)=>{(async()=>{for(let a=0;a<1/0;a++)try{const o=await e(a);if(!t(a,null,o)){n(o);return}}catch(o){if(!t(a,o)){s(o);return}}})()})}function sF(e){return("0"+e.toString(16)).substr(-2)}function aF(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let a=0;a<56;a++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(t),Array.from(t,sF).join("")}async function iF(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(a=>String.fromCharCode(a)).join("")}async function oF(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code 
489challenge method will default to use plain instead of sha256."),e;const r=await iF(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function no(e,t,r=!1){const n=aF();let s=n;r&&(s+="/PASSWORD_RECOVERY"),await go(e,`${t}-code-verifier`,s);const a=await oF(n);return[a,n===a?"plain":"s256"]}const lF=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function cF(e){const t=e.headers.get(Cg);if(!t||!t.match(lF))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function dF(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function uF(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const hF=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function so(e){if(!hF.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Dp(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function fF(e,t){return new Proxy(e,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const a=n.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)"||a==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,s)}return!t.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(r,n,s)}})}function $b(e){return JSON.parse(JSON.stringify(e))}const oi=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),pF=[502,503,504];
489async function Lb(e){var t;if(!tF(e))throw new zg(oi(e),0);if(pF.includes(e.status))throw new zg(oi(e),e.status);let r;try{r=await e.json()}catch(a){throw new ui(oi(a),a)}let n;const s=cF(e);if(s&&s.getTime()>=pS["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Db(oi(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new Zr}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((a,o)=>a&&typeof o=="string",!0))throw new Db(oi(r),e.status,r.weak_password.reasons);throw new W3(oi(r),e.status||500,n)}const mF=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(n),Object.assign(Object.assign({},s),r))};async function Ae(e,t,r,n){var s;const a=Object.assign({},n==null?void 0:n.headers);a[Cg]||(a[Cg]=pS["2024-01-01"].name),n!=null&&n.jwt&&(a.Authorization=`Bearer ${n.jwt}`);const o=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(o.redirect_to=n.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await gF(e,t,r+l,{headers:a,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(c):{data:Object.assign({},c),error:null}}async function gF(e,t,r,n,s,a){const o=mF(t,n,s,a);let l;try{l=await e(r,Object.assign({},o))}catch(c){throw console.error(c),new zg(oi(c),0)}if(l.ok||await Lb(l),n!=null&&n.noResolveJson)return l;try{return await l.json()}catch(c){await Lb(c)}}function En(e){var t;let r=null;wF(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=J3(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:n},error:null}}function Ub(e){const t=En(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(t.data.weak_password=e.weak_password),t}function ya(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function yF(e){return{data:e,error:null}}function vF(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:a}=e,o=Ja(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:a},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function Bb(e){return e}function wF(e){return e.access_token&&e.refresh_token&&e.expires_in}const Ip=["global","local","others"];class xF{constructor({url:t="",headers:r={},fetch:n}){this.url=t,this.headers=r,this.fetch=yS(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,r=Ip[0]){if(Ip.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Ip.join(", ")}`);try{return await Ae(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Ee(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,r={}){try{return await Ae(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:ya})}catch(n){if(Ee(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=Ja(t,["options"]),s=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await Ae(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:vF,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(Ee(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await Ae(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:ya})}catch(r){if(Ee(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,n,s,a,o,l,c;try{const d={nextPage:null,lastPage:0,total:0},u=await Ae(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(a=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&a!==void 0?a:""},xform:Bb});if(u.error)throw u.error;const h=await u.json(),p=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,m=(c=(l=u.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(y=>{const g=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(y.split(";")[1].split("=")[1]);d[`${x}Page`]=g}),d.total=parseInt(p)),{data:Object.assign(Object.assign({},h),d),error:null}}catch(d){if(Ee(d))return{data:{users:[]},error:d};throw d}}async getUserById(t){so(t);try{return await Ae(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:ya})}catch(r){if(Ee(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){so(t);try{return await Ae(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:ya})}catch(n){if(Ee(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){so(t);
489try{return await Ae(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:ya})}catch(n){if(Ee(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){so(t.userId);try{const{data:r,error:n}=await Ae(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:r,error:n}}catch(r){if(Ee(r))return{data:null,error:r};throw r}}async _deleteFactor(t){so(t.userId),so(t.id);try{return{data:await Ae(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(Ee(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,n,s,a,o,l,c;try{const d={nextPage:null,lastPage:0,total:0},u=await Ae(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(a=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&a!==void 0?a:""},xform:Bb});if(u.error)throw u.error;const h=await u.json(),p=(o=u.headers.get("x-total-count"))!==null&&o!==void 0?o:0,m=(c=(l=u.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(y=>{const g=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(y.split(";")[1].split("=")[1]);d[`${x}Page`]=g}),d.total=parseInt(p)),{data:Object.assign(Object.assign({},h),d),error:null}}catch(d){if(Ee(d))return{data:{clients:[]},error:d};throw d}}async _createOAuthClient(t){try{return await Ae(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Ee(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await Ae(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Ee(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await Ae(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Ee(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await Ae(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Ee(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await Ae(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Ee(r))return{data:null,error:r};throw r}}}function Wb(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}const ao={debug:!!(globalThis&&gS()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class vS extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class bF extends vS{}async function _F(e,t,r){ao.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const n=new globalThis.AbortController;return t>0&&setTimeout(()=>{n.abort(),ao.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async s=>{if(s){ao.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,s.name);try{return await r()}finally{ao.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,s.name)}}else{if(t===0)throw ao.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new bF(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(ao.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 r()}}))}function jF(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function wS(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}
489" is invalid.`);return e.toLowerCase()}function kF(e){return parseInt(e,16)}function NF(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function SF(e){var t;const{chainId:r,domain:n,expirationTime:s,issuedAt:a=new Date,nonce:o,notBefore:l,requestId:c,resources:d,scheme:u,uri:h,version:p}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(p!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${p}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
490`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const m=wS(e.address),y=u?`${u}://${n}`:n,g=e.statement?`${e.statement}
491`:"",x=`${y} wants you to sign in with your Ethereum account:
492${m}
493
494${g}`;let b=`URI: ${h}
495Version: ${p}
496Chain ID: ${r}${o?`
497Nonce: ${o}`:""}
498Issued At: ${a.toISOString()}`;if(s&&(b+=`
499Expiration Time: ${s.toISOString()}`),l&&(b+=`
500Not Before: ${l.toISOString()}`),c&&(b+=`
501Request ID: ${c}`),d){let v=`
502Resources:`;for(const w of d){if(!w||typeof w!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${w}`);v+=`
503- ${w}`}b+=v}return`${x}
504${b}`}class Ht extends Error{constructor({message:t,code:r,cause:n,name:s}){var a;super(t,{cause:n}),this.__isWebAuthnError=!0,this.name=(a=s??(n instanceof Error?n.name:void 0))!==null&&a!==void 0?a:"Unknown Error",this.code=r}}class gh extends Ht{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function CF({error:e,options:t}){var r,n,s;const{publicKey:a}=t;if(!a)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ht({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=a.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new Ht({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((n=a.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new Ht({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((s=a.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new Ht({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Ht({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Ht({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return a.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new Ht({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Ht({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const o=window.location.hostname;if(xS(o)){if(a.rp.id!==o)return new Ht({message:`The RP ID "${a.rp.id}
504" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ht({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(a.user.id.byteLength<1||a.user.id.byteLength>64)return new Ht({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Ht({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Ht({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function zF({error:e,options:t}){const{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ht({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Ht({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(xS(n)){if(r.rpId!==n)return new Ht({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ht({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Ht({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Ht({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class EF{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const PF=new EF;function TF(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:r,excludeCredentials:n}=e,s=Ja(e,["challenge","user","excludeCredentials"]),a=Wo(t).buffer,o=Object.assign(Object.assign({},r),{id:Wo(r.id).buffer}),l=Object.assign(Object.assign({},s),{challenge:a,user:o});if(n&&n.length>0){l.excludeCredentials=new Array(n.length);for(let c=0;c<n.length;c++){const d=n[c];l.excludeCredentials[c]=Object.assign(Object.assign({},d),{id:Wo(d.id).buffer,type:d.type||"public-key",transports:d.transports})}}return l}function RF(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:r}=e,n=Ja(e,["challenge","allowCredentials"]),s=Wo(t).buffer,a=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){a.allowCredentials=new Array(r.length);for(let o=0;o<r.length;o++){const l=r[o];a.allowCredentials[o]=Object.assign(Object.assign({},l),{id:Wo(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return a}function OF(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e;return{id:e.id,rawId:e.id,response:{attestationObject:gi(new Uint8Array(e.response.attestationObject)),clientDataJSON:gi(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function AF(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e,n=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:gi(new Uint8Array(s.authenticatorData)),clientDataJSON:gi(new Uint8Array(s.clientDataJSON)),signature:gi(new Uint8Array(s.signature)),userHandle:s.userHandle?gi(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function xS(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Vb(){var e,t;return!!(ur()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function DF(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new gh("Browser returned unexpected credential type",t)}:{data:null,error:new gh("Empty credential response",t)}}
504catch(t){return{data:null,error:CF({error:t,options:e})}}}async function IF(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new gh("Browser returned unexpected credential type",t)}:{data:null,error:new gh("Empty credential response",t)}}catch(t){return{data:null,error:zF({error:t,options:e})}}}const MF={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},FF={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function yh(...e){const t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),r=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),n={};for(const s of e)if(s)for(const a in s){const o=s[a];if(o!==void 0)if(Array.isArray(o))n[a]=o;else if(r(o))n[a]=o;else if(t(o)){const l=n[a];t(l)?n[a]=yh(l,o):n[a]=yh(o)}else n[a]=o}return n}function $F(e,t){return yh(MF,e,t||{})}function LF(e,t){return yh(FF,e,t||{})}class UF{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:r,friendlyName:n,signal:s},a){try{const{data:o,error:l}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!o)return{data:null,error:l};const c=s??PF.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:d}=o.webauthn.credential_options.publicKey;d.name||(d.name=`${d.id}:${n}`),d.displayName||(d.displayName=d.name)}switch(o.webauthn.type){case"create":{const d=$F(o.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:u,error:h}=await DF({publicKey:d,signal:c});return u?{data:{factorId:t,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:u}},error:null}:{data:null,error:h}}case"request":{const d=LF(o.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:u,error:h}=await IF(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:d,signal:c}));return u?{data:{factorId:t,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:u}},error:null}:{data:null,error:h}}}}catch(o){return Ee(o)?{data:null,error:o}:{data:null,error:new ui("Unexpected error in challenge",o)}}}async _verify({challengeId:t,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:n})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},a){if(!r)return{data:null,error:new Gc("rpId is required for WebAuthn authentication")};try{if(!Vb())return{data:null,error:new ui("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:n},signal:s},{request:a});if(!o)return{data:null,error:l};const{webauthn:c}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:c.type,rpId:r,rpOrigins:n,credential_response:c.credential_response}})}catch(o){return Ee(o)?{data:null,error:o}:{data:null,error:new ui("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},a){if(!r)return{data:null,error:new Gc("rpId is required for WebAuthn registration")};try{if(!Vb())return{data:null,error:new ui("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this._enroll({friendlyName:t});if(!o)return await this.client.mfa.listFactors().then(u=>{var h;return(h=u.data)===null||h===void 0?void 0:h.all.find(p=>p.factor_type==="webauthn"&&p.friendly_name===t&&p.status!=="unverified")}).then(u=>u?this.client.mfa.unenroll({factorId:u==null?void 0:u.id}):void 0),{data:null,error:l};const{data:c,error:d}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:s},{create:a});return c?this._verify({factorId:o.id,challengeId:c.challengeId,webauthn:{rpId:r,rpOrigins:n,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:d}}catch(o){return Ee(o)?{data:null,error:o}:{data:null,error:new ui("Unexpected error in register",o)}}}}jF();const BF={url:F3,storageKey:$3,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:L3,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1};async function qb(e,t,r){return await r()}const io={};class Qc{get jwks(){var t,r;return(r=(t=io[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){io[this.storageKey]=Object.assign(Object.assign({},io[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=io[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){io[this.storageKey]=Object.assign(Object.assign({},io[this.storageKey]),{cachedAt:t})}constructor(t){var r,n,s;this.userStorage=null,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;const a=Object.assign(Object.assign({},BF),t);if(this.storageKey=a.storageKey,this.instanceID=(r=Qc.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,Qc.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.instanceID>0&&ur()){const o=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=a.persistSession,this.autoRefreshToken=a.autoRefreshToken,this.admin=new xF({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=yS(a.fetch),this.lock=a.lock||qb,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,this.throwOnError=a.throwOnError,a.lock?this.lock=a.lock:ur()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=_F:this.lock=qb,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new UF(this)}
504,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(a.storage?this.storage=a.storage:gS()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Wb(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=Wb(this.memoryStorage)),ur()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${fS}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let r={},n="none";if(ur()&&(r=eF(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),ur()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:a}=await this._getSessionFromURL(r,n);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),H3(a)){const c=(t=a.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:a}}return await this._removeSession(),{error:a}}const{session:o,redirectType:l}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return Ee(r)?this._returnResult({error:r}):this._returnResult({error:new ui("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,s;try{const a=await Ae(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:En}),{data:o,error:l}=a;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const c=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:d,session:c},error:null})}catch(a){if(Ee(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signUp(t){var r,n,s;try{let a;if("email"in t){const{email:u,password:h,options:p}=t;let m=null,y=null;this.flowType==="pkce"&&([m,y]=await no(this.storage,this.storageKey)),a=await Ae(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:p==null?void 0:p.emailRedirectTo,body:{email:u,password:h,data:(r=p==null?void 0:p.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:m,code_challenge_method:y},xform:En})}else if("phone"in t){const{phone:u,password:h,options:p}=t;a=await Ae(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:h,data:(n=p==null?void 0:p.data)!==null&&n!==void 0?n:{},channel:(s=p==null?void 0:p.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken}},xform:En}
504)}else throw new su("You must provide either an email or phone number and a password");const{data:o,error:l}=a;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const c=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:d,session:c},error:null})}catch(a){if(Ee(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithPassword(t){try{let r;if("email"in t){const{email:a,password:o,options:l}=t;r=await Ae(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:Ub})}else if("phone"in t){const{phone:a,password:o,options:l}=t;r=await Ae(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:Ub})}else throw new su("You must provide either an email or phone number and a password");const{data:n,error:s}=r;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!n||!n.session||!n.user){const a=new ro;return this._returnResult({data:{user:null,session:null},error:a})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:s})}catch(r){if(Ee(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,n,s,a;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=t.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(a=t.options)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,n,s,a,o,l,c,d,u,h,p;let m,y;if("message"in t)m=t.message,y=t.signature;else{const{chain:g,wallet:x,statement:b,options:v}=t;let w;if(ur())if(typeof x=="object")w=x;else{const T=window;if("ethereum"in T&&typeof T.ethereum=="object"&&"request"in T.ethereum&&typeof T.ethereum.request=="function")w=T.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof x!="object"||!(v!=null&&v.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=x}const _=new URL((r=v==null?void 0:v.url)!==null&&r!==void 0?r:window.location.href),j=await w.request({method:"eth_requestAccounts"}).then(T=>T).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!j||j.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const k=wS(j[0]);let N=(n=v==null?void 0:v.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!N){const T=await w.request({method:"eth_chainId"});N=kF(T)}const P={domain:_.host,address:k,statement:b,uri:_.href,version:"1",chainId:N,nonce:(s=v==null?void 0:v.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(o=(a=v==null?void 0:v.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(l=v==null?void 0:v.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=v==null?void 0:v.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(d=v==null?void 0:v.signInWithEthereum)===null||d===void 0?void 0:d.requestId,resources:(u=v==null?void 0:v.signInWithEthereum)===null||u===void 0?void 0:u.resources};m=SF(P),y=await w.request({method:"personal_sign",params:[NF(m),k]})}try{const{data:g,error:x}=await Ae(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:m,signature:y}
504,!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:En});if(x)throw x;if(!g||!g.session||!g.user){const b=new ro;return this._returnResult({data:{user:null,session:null},error:b})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:x})}catch(g){if(Ee(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var r,n,s,a,o,l,c,d,u,h,p,m;let y,g;if("message"in t)y=t.message,g=t.signature;else{const{chain:x,wallet:b,statement:v,options:w}=t;let _;if(ur())if(typeof b=="object")_=b;else{const k=window;if("solana"in k&&typeof k.solana=="object"&&("signIn"in k.solana&&typeof k.solana.signIn=="function"||"signMessage"in k.solana&&typeof k.solana.signMessage=="function"))_=k.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");_=b}const j=new URL((r=w==null?void 0:w.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in _&&_.signIn){const k=await _.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:j.host,uri:j.href}),v?{statement:v}:null));let N;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")N=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)N=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in N&&"signature"in N&&(typeof N.signedMessage=="string"||N.signedMessage instanceof Uint8Array)&&N.signature instanceof Uint8Array)y=typeof N.signedMessage=="string"?N.signedMessage:new TextDecoder().decode(N.signedMessage),g=N.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in _)||typeof _.signMessage!="function"||!("publicKey"in _)||typeof _!="object"||!_.publicKey||!("toBase58"in _.publicKey)||typeof _.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");y=[`${j.host} wants you to sign in with your Solana account:`,_.publicKey.toBase58(),...v?["",v,""]:[""],"Version: 1",`URI: ${j.href}`,`Issued At: ${(s=(n=w==null?void 0:w.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((a=w==null?void 0:w.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${w.signInWithSolana.notBefore}`]:[],...!((o=w==null?void 0:w.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${w.signInWithSolana.expirationTime}`]:[],...!((l=w==null?void 0:w.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${w.signInWithSolana.chainId}`]:[],...!((c=w==null?void 0:w.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${w.signInWithSolana.nonce}`]:[],...!((d=w==null?void 0:w.signInWithSolana)===null||d===void 0)&&d.requestId?[`Request ID: ${w.signInWithSolana.requestId}`]:[],...!((h=(u=w==null?void 0:w.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||h===void 0)&&h.length?["Resources",...w.signInWithSolana.resources.map(N=>`- ${N}`)]:[]].join(`
505`);const k=await _.signMessage(new TextEncoder().encode(y),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=k}}try{const{data:x,error:b}=await Ae(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:y,signature:gi(g)},!((p=t.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:En}
505);if(b)throw b;if(!x||!x.session||!x.user){const v=new ro;return this._returnResult({data:{user:null,session:null},error:v})}return x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),this._returnResult({data:Object.assign({},x),error:b})}catch(x){if(Ee(x))return this._returnResult({data:{user:null,session:null},error:x});throw x}}async _exchangeCodeForSession(t){const r=await si(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{const{data:a,error:o}=await Ae(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:En});if(await la(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!a||!a.session||!a.user){const l=new ro;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:Object.assign(Object.assign({},a),{redirectType:s??null}),error:o})}catch(a){if(Ee(a))return this._returnResult({data:{user:null,session:null,redirectType:null},error:a});throw a}}async signInWithIdToken(t){try{const{options:r,provider:n,token:s,access_token:a,nonce:o}=t,l=await Ae(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:a,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:En}),{data:c,error:d}=l;if(d)return this._returnResult({data:{user:null,session:null},error:d});if(!c||!c.session||!c.user){const u=new ro;return this._returnResult({data:{user:null,session:null},error:u})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:d})}catch(r){if(Ee(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,n,s,a,o;try{if("email"in t){const{email:l,options:c}=t;let d=null,u=null;this.flowType==="pkce"&&([d,u]=await no(this.storage,this.storageKey));const{error:h}=await Ae(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(r=c==null?void 0:c.data)!==null&&r!==void 0?r:{},create_user:(n=c==null?void 0:c.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:d,code_challenge_method:u},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in t){const{phone:l,options:c}=t,{data:d,error:u}=await Ae(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(s=c==null?void 0:c.data)!==null&&s!==void 0?s:{},create_user:(a=c==null?void 0:c.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:d==null?void 0:d.message_id},error:u})}throw new su("You must provide either an email or phone number.")}catch(l){if(Ee(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var r,n;try{let s,a;"options"in t&&(s=(r=t.options)===null||r===void 0?void 0:r.redirectTo,a=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:o,error:l}=await Ae(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:a}}),redirectTo:s,xform:En}
505);if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,d=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:d,session:c},error:null})}catch(s){if(Ee(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var r,n,s,a,o;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await no(this.storage,this.storageKey));const d=await Ae(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(n=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((s=t==null?void 0:t.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:yF});return!((a=d.data)===null||a===void 0)&&a.url&&ur()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(d.data.url),this._returnResult(d)}catch(l){if(Ee(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)throw n;if(!r)throw new Zr;const{error:s}=await Ae(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(Ee(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:n,type:s,options:a}=t,{error:o}=await Ae(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},redirectTo:a==null?void 0:a.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in t){const{phone:n,type:s,options:a}=t,{data:o,error:l}=await Ae(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l})}throw new su("You must provide either an email or phone number and a type")}catch(r){if(Ee(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await si(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not val
505id"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()<Rp:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){const o=await si(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=Dp()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};t.user=fF(t.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:s,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{session:null},error:a}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){return t?await this._getUser(t):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(t){try{return t?await Ae(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:ya}):await this._useSession(async r=>{var n,s,a;const{data:o,error:l}=r;if(l)throw l;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Zr}:await Ae(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&a!==void 0?a:void 0,xform:ya})})}catch(r){if(Ee(r))return q3(r)&&(await this._removeSession(),await la(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:s,error:a}=n;if(a)throw a;if(!s.session)throw new Zr;const o=s.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await no(this.storage,this.storageKey));const{data:d,error:u}=await Ae(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:o.access_token,xform:ya});if(u)throw u;return o.user=d.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(n){if(Ee(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Zr;const r=Date.now()/1e3;let n=r,s=!0,a=null;const{payload:o}=Ap(t.access_token);if(o.exp&&(n=o.exp,s=n<=r),s){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l)return{data:{user:null,session:null},error:null};a=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)throw c;a={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return this._returnResult({data:{user:a.user,session:a},error:null})}catch(r){if(Ee(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var n;if(!t){const{data:o,error:l}=r;if(l)throw l;t=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new Zr;const{data:s,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{user:null,session:null},error:a}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(Ee(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){try{if(!ur())throw new au("No browser detected.");
505if(t.error||t.error_description||t.error_code)throw new au(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Ab("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new au("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new Ab("No code detected.");const{data:v,error:w}=await this._exchangeCodeForSession(t.code);if(w)throw w;const _=new URL(window.location.href);return _.searchParams.delete("code"),window.history.replaceState(window.history.state,"",_.toString()),{data:{session:v.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:s,access_token:a,refresh_token:o,expires_in:l,expires_at:c,token_type:d}=t;if(!a||!l||!o||!d)throw new au("No session defined in URL");const u=Math.round(Date.now()/1e3),h=parseInt(l);let p=u+h;c&&(p=parseInt(c));const m=p-u;m*1e3<=mo&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${m}s, should have been closer to ${h}s`);const y=p-h;u-y>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",y,p,u):u-y<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",y,p,u);const{data:g,error:x}=await this._getUser(a);if(x)throw x;const b={provider_token:n,provider_refresh_token:s,access_token:a,expires_in:h,expires_at:p,refresh_token:o,token_type:d,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:b,redirectType:t.type},error:null})}catch(n){if(Ee(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){const r=await si(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:s,error:a}=r;if(a)return this._returnResult({error:a});const o=(n=s.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:l}=await this.admin.signOut(o,t);if(l&&!(V3(l)&&(l.status===404||l.status===401||l.status===403)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await la(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const r=X3(),n={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,s;try{const{data:{session:a},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",t,"session",a)}catch(a){await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",a),console.error(a)}})}async resetPasswordForEmail(t,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await no(this.storage,this.storageKey,!0));try{return await Ae(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(a){if(Ee(a))return this._returnResult({data:null,error:a});throw a}}async getUserIdentities(){var t;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if(Ee(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{const{data:n,error:s}=await this._useSession(async a=>{var o,l,c,d,u;const{data:h,error:p}=a;if(p)throw p;const m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await Ae(this.fetch,"GET",m,{headers:this.headers,jwt:(u=(d=h.session)===null||d===void 0?void 0:d.access_token)!==null&&u!==void 0?u:void 0})});if(s)throw s;return ur()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:t.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(Ee(n))return this._returnResult({data:{provider:t.provider,url:null},error:n});throw n}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var n;try{const{error:s,data:{session:a}}=r;if(s)throw s;const{options:o,provider:l,token:c,access_token:d,nonce:u}=t,h=await Ae(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=a==null?void 0:a.access_token)!==null&&n!==void 0?n:void 0,body:{provider:l,id_token:c,access_token:d,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:En}
505),{data:p,error:m}=h;return m?this._returnResult({data:{user:null,session:null},error:m}):!p||!p.session||!p.user?this._returnResult({data:{user:null,session:null},error:new ro}):(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("USER_UPDATED",p.session)),this._returnResult({data:p,error:m}))}catch(s){if(Ee(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var n,s;const{data:a,error:o}=r;if(o)throw o;return await Ae(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(n=a.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(r){if(Ee(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await nF(async s=>(s>0&&await rF(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await Ae(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:En})),(s,a)=>{const o=200*Math.pow(2,s);return a&&Op(a)&&Date.now()+o-n<mo})}catch(n){if(this._debug(r,"error",n),Ee(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",n),ur()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:t,url:n},error:null}}async _recoverAndRefresh(){var t,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await si(this.storage,this.storageKey);if(s&&this.userStorage){let o=await si(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await go(this.userStorage,this.storageKey+"-user",o)),s.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:Dp()}else if(s&&!s.user&&!s.user){const o=await si(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await la(this.storage,this.storageKey+"-user"),await go(this.storage,this.storageKey,s)):s.user=Dp()}if(this._debug(n,"session from storage",s),!this._isValidSession(s)){this._debug(n,"session is not valid"),s!==null&&await this._removeSession();return}const a=((r=s.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Rp;if(this._debug(n,`session has${a?"":" not"} expired with margin of ${Rp}s`),a){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),Op(o)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(s.access_token);!l&&(o!=null&&o.user)?(s.user=o.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(n,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(n,"error",s),console.error(s);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var r,n;if(!t)throw new Zr;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new vf;const{data:a,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!a.session)throw new Zr;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const l={data:a.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(a){if(this._debug(s,"error",a),Ee(a)){const o={data:null,error:a};return Op(a)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(a),a}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,r,n=!0){const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:t,session:r});const a=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,r)}catch(c){a.push(c)}});if(await Promise.all(o),a.length>0){for(let l=0;l<a.length;l+=1)console.error(a[l]);throw a[0]}}finally{this._debug(s,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0;const r=Object.assign({},t),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await go(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const a=$b(s);await go(this.storage,this.storageKey,a)}else{const s=$b(r);await go(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),await la(this.storage,this.storageKey),await la(this.storage,this.storageKey+"-code-verifier"),await la(this.storage,this.storageKey+"-user"),this.userStorage&&await la(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&ur()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}
505catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),mo);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-t)/mo);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${mo}ms, refresh threshold is ${Sg} ticks`),s<=Sg&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof vS)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ur()||!(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(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,n){const s=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[a,o]=await no(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(l.toString())}if(n!=null&&n.queryParams){const a=new URLSearchParams(n.queryParams);s.push(a.toString())}return n!=null&&n.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:s,error:a}=r;return a?this._returnResult({data:null,error:a}):await Ae(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(Ee(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,s;const{data:a,error:o}=r;if(o)return this._returnResult({data:null,error:o});const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:d}=await Ae(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return d?this._returnResult({data:null,error:d}):(t.factorType==="totp"&&c.type==="totp"&&(!((s=c==null?void 0:c.totp)===null||s===void 0)&&s.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(r){if(Ee(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:a}=r;if(a)return this._returnResult({data:null,error:a});const o=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?OF(t.webauthn.credential_response):AF(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await Ae(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:c}))})}catch(r){if(Ee(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:a}=r;if(a)return this._returnResult({data:null,error:a});const o=await Ae(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});if(o.error)return o;const{data:l}=o;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:TF(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:RF(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(Ee(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(t){const{data:r,error:n}=await this._challenge({factorId:t.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const s={all:[],phone:[],totp:[],webauthn:[]};for(const a of(t=r==null?void 0:r.factors)!==null&&t!==void 0?t:[])s.all.push(a),a.status==="verified"&&s[a.factor_type].push(a);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(){var t,r;const{data:{session:n},error:s}
505=await this.getSession();if(s)return this._returnResult({data:null,error:s});if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:a}=Ap(n.access_token);let o=null;a.aal&&(o=a.aal);let l=o;((r=(t=n.user.factors)===null||t===void 0?void 0:t.filter(u=>u.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(l="aal2");const d=a.amr||[];return{data:{currentLevel:o,nextLevel:l,currentAuthenticationMethods:d},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await Ae(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new Zr})})}catch(r){if(Ee(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:s},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!s)return this._returnResult({data:null,error:new Zr});const o=await Ae(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&ur()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(Ee(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:s},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!s)return this._returnResult({data:null,error:new Zr});const o=await Ae(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&ur()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(Ee(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await Ae(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Zr})})}catch(t){if(Ee(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?(await Ae(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Zr})})}catch(r){if(Ee(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let n=r.keys.find(l=>l.kid===t);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(l=>l.kid===t),n&&this.jwks_cached_at+B3>s)return n;const{data:a,error:o}=await Ae(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!a.keys||a.keys.length===0||(this.jwks=a,this.jwks_cached_at=s,n=a.keys.find(l=>l.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:m,error:y}
505=await this.getSession();if(y||!m.session)return this._returnResult({data:null,error:y});n=m.session.access_token}const{header:s,payload:a,signature:o,raw:{header:l,payload:c}}=Ap(n);r!=null&&r.allowExpired||dF(a.exp);const d=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!d){const{error:m}=await this.getUser(n);if(m)throw m;return{data:{claims:a,header:s,signature:o},error:null}}const u=uF(s.alg),h=await crypto.subtle.importKey("jwk",d,u,!0,["verify"]);if(!await crypto.subtle.verify(u,h,o,Y3(`${l}.${c}`)))throw new Eg("Invalid JWT signature");return{data:{claims:a,header:s,signature:o},error:null}}catch(n){if(Ee(n))return this._returnResult({data:null,error:n});throw n}}}Qc.nextInstanceID={};const WF=Qc;class VF extends WF{constructor(t){super(t)}}class qF{constructor(t,r,n){var s,a,o;this.supabaseUrl=t,this.supabaseKey=r;const l=M3(t);if(!r)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",l),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",l),this.storageUrl=new URL("storage/v1",l),this.functionsUrl=new URL("functions/v1",l);const c=`sb-${l.hostname.split(".")[0]}-auth-token`,d={db:E3,realtime:T3,auth:Object.assign(Object.assign({},P3),{storageKey:c}),global:z3},u=I3(n??{},d);this.storageKey=(s=u.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(a=u.global.headers)!==null&&a!==void 0?a:{},u.accessToken?(this.accessToken=u.accessToken,this.auth=new Proxy({},{get:(h,p)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(p)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=u.auth)!==null&&o!==void 0?o:{},this.headers,u.global.fetch),this.fetch=A3(r,this._getAccessToken.bind(this),u.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},u.realtime)),this.accessToken&&this.accessToken().then(h=>this.realtime.setAuth(h)).catch(h=>console.warn("Failed to set initial Realtime auth token:",h)),this.rest=new TM(new URL("rest/v1",l).href,{headers:this.headers,schema:u.db.schema,fetch:this.fetch}),this.storage=new N3(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),u.accessToken||this._listenForAuthEvents()}get functions(){return new zM(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,r={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,r,n)}channel(t,r={config:{}}){return this.realtime.channel(t,r)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t,r;if(this.accessToken)return await this.accessToken();const{data:n}=await this.auth.getSession();return(r=(t=n.session)===null||t===void 0?void 0:t.access_token)!==null&&r!==void 0?r:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:r,detectSessionInUrl:n,storage:s,userStorage:a,storageKey:o,flowType:l,lock:c,debug:d,throwOnError:u},h,p){const m={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new VF({url:this.authUrl.href,headers:Object.assign(Object.assign({},m),h),storageKey:o,autoRefreshToken:t,persistSession:r,detectSessionInUrl:n,storage:s,userStorage:a,flowType:l,lock:c,debug:d,throwOnError:u,fetch:p,hasCustomAuthorizationHeader:Object.keys(this.headers).some(y=>y.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new ZM(this.realtimeUrl.href,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n==null?void 0:n.access_token)})}_handleTokenChanged(t,r,n){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const HF=(e,t,r)=>new qF(e,t,r);function KF(){if(typeof window<"u"||typeof process>"u")return!1;const e=process.version;if(e==null)return!1;const t=e.match(/^v(\d+)\./);return t?parseInt(t[1],10)<=18:!1}KF()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to N
505ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const ZF="https://rpwmeilavicbpfyuxiiz.supabase.co",GF="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InJwd21laWxhdmljYnBmeXV4aWl6Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ0OTY2OTcsImV4cCI6MjA4MDA3MjY5N30.sEaHhJhfI6r2FaPt3BYQ4g_DjqrIhk2NMlrHcCDY9_I",ne=HF(ZF,GF,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),bS=f.createContext(void 0);function QF({children:e}){const[t,r]=f.useState(null),[n,s]=f.useState(null),[a,o]=f.useState(!0),l=!!(t!=null&&t.email_confirmed_at);f.useEffect(()=>{const{data:{subscription:h}}=ne.auth.onAuthStateChange((p,m)=>{s(m),r((m==null?void 0:m.user)??null),o(!1)});return ne.auth.getSession().then(({data:{session:p}})=>{s(p),r((p==null?void 0:p.user)??null),o(!1)}),()=>h.unsubscribe()},[]);const c=async(h,p,m)=>{const y=`${window.location.origin}/`,{error:g}=await ne.auth.signUp({email:h,password:p,options:{emailRedirectTo:y,data:{company_name:m}}});return!g&&m&&setTimeout(async()=>{const{data:{user:x}}=await ne.auth.getUser();x&&await ne.from("profiles").update({company_name:m}).eq("id",x.id)},1e3),{error:g}},d=async(h,p)=>{const{error:m}=await ne.auth.signInWithPassword({email:h,password:p});return{error:m}},u=async()=>{await ne.auth.signOut()};return i.jsx(bS.Provider,{value:{user:t,session:n,loading:a,isEmailConfirmed:l,signUp:c,signIn:d,signOut:u},children:e})}function qr(){const e=f.useContext(bS);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e}const Yc=Ji("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",accent:"bg-accent text-accent-foreground hover:bg-accent/90",warning:"bg-warning text-warning-foreground hover:bg-warning/90",success:"bg-success text-success-foreground hover:bg-success/90"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",xl:"h-12 rounded-md px-10 text-base",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),G=f.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},a)=>{const o=n?Yi:"button";return i.jsx(o,{className:J(Yc({variant:t,size:r,className:e})),ref:a,...s})});G.displayName="Button";const Hb="qrserwis_cookie_consent";function YF(){const[e,t]=f.useState(!1);f.useEffect(()=>{localStorage.getItem(Hb)||t(!0)},[]);const r=()=>{localStorage.setItem(Hb,"accepted"),t(!1)};return e?i.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50 border-t border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80 p-4 shadow-lg",children:i.jsxs("div",{className:"container flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Strona korzysta z plików cookies w celu realizacji usług, obsługi logowania i płatności. Korzystając z serwisu, wyrażasz zgodę na ich używanie zgodnie z"," ",i.jsx(ks,{to:"/polityka-prywatnosci",className:"text-primary underline hover:no-underline",children:"Polityką Prywatności"}),"."]}),i.jsx(G,{onClick:r,size:"sm",className:"shrink-0",children:"Rozumiem / Akceptuję"})]})}):null}function Dr(){const[e,t]=f.useState(navigator.onLine);return f.useEffect(()=>{const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r),window.addEventListener("offline",n),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n
505)}},[]),e}const JF="qrserwis-offline",XF=3,Je={tickets:"tickets",clients:"clients",devices:"devices",protocols:"protocols",syncQueue:"syncQueue",metadata:"metadata",pendingUploads:"pendingUploads",syncErrors:"syncErrors"};class e${constructor(){Hf(this,"db",null);Hf(this,"dbPromise",null)}async getDB(){return this.db?this.db:this.dbPromise?this.dbPromise:(this.dbPromise=new Promise((t,r)=>{const n=indexedDB.open(JF,XF);n.onerror=()=>{console.error("Failed to open IndexedDB:",n.error),r(n.error)},n.onsuccess=()=>{this.db=n.result,t(this.db)},n.onupgradeneeded=s=>{const a=s.target.result,o=s.oldVersion;if(!a.objectStoreNames.contains(Je.tickets)){const l=a.createObjectStore(Je.tickets,{keyPath:"id"});l.createIndex("status","status",{unique:!1}),l.createIndex("installer_id","installer_id",{unique:!1}),l.createIndex("scheduled_date","scheduled_date",{unique:!1})}if(a.objectStoreNames.contains(Je.clients)||a.createObjectStore(Je.clients,{keyPath:"id"}).createIndex("installer_id","installer_id",{unique:!1}),!a.objectStoreNames.contains(Je.devices)){const l=a.createObjectStore(Je.devices,{keyPath:"id"});l.createIndex("client_id","client_id",{unique:!1}),l.createIndex("installer_id","installer_id",{unique:!1})}a.objectStoreNames.contains(Je.protocols)||a.createObjectStore(Je.protocols,{keyPath:"id"}).createIndex("created_at","created_at",{unique:!1}),a.objectStoreNames.contains(Je.syncQueue)||a.createObjectStore(Je.syncQueue,{keyPath:"id"}).createIndex("createdAt","createdAt",{unique:!1}),a.objectStoreNames.contains(Je.metadata)||a.createObjectStore(Je.metadata,{keyPath:"key"}),a.objectStoreNames.contains(Je.pendingUploads)||a.createObjectStore(Je.pendingUploads,{keyPath:"id"}).createIndex("protocolId","protocolId",{unique:!1}),a.objectStoreNames.contains(Je.syncErrors)||a.createObjectStore(Je.syncErrors,{keyPath:"id"}).createIndex("timestamp","timestamp",{unique:!1}),o<3&&o>0&&console.log("IndexedDB migrated to version 3")}}),this.dbPromise)}async saveData(t,r){const n=await this.getDB();return new Promise((s,a)=>{const c=n.transaction(t,"readwrite").objectStore(t).put(r);c.onerror=()=>a(c.error),c.onsuccess=()=>s()})}async saveAllData(t,r){const n=await this.getDB();return new Promise((s,a)=>{const o=n.transaction(t,"readwrite"),l=o.objectStore(t);o.onerror=()=>a(o.error),o.oncomplete=()=>s(),l.clear(),r.forEach(c=>l.put(c))})}async getData(t,r){const n=await this.getDB();return new Promise((s,a)=>{const c=n.transaction(t,"readonly").objectStore(t).get(r);c.onerror=()=>a(c.error),c.onsuccess=()=>s(c.result)})}async getAllData(t){const r=await this.getDB();return new Promise((n,s)=>{const l=r.transaction(t,"readonly").objectStore(t).getAll();l.onerror=()=>s(l.error),l.onsuccess=()=>n(l.result)})}async deleteData(t,r){const n=await this.getDB();return new Promise((s,a)=>{const c=n.transaction(t,"readwrite").objectStore(t).delete(r);c.onerror=()=>a(c.error),c.onsuccess=()=>s()})}async clearStore(t){const r=await this.getDB();return new Promise((n,s)=>{const l=r.transaction(t,"readwrite").objectStore(t).clear();l.onerror=()=>s(l.error),l.onsuccess=()=>n()})}async addToSyncQueue(t){await this.saveData(Je.syncQueue,t)}async getSyncQueue(){return this.getAllData(Je.syncQueue)}async removeFromSyncQueue(t){await this.deleteData(Je.syncQueue,t)}
505async getSyncQueueCount(){return(await this.getSyncQueue()).length}async setLastSynced(t){const r=`${t}_lastSynced`;await this.saveData(Je.metadata,{id:r,key:r,lastSynced:Date.now()})}async getLastSynced(t){const r=await this.getData(Je.metadata,`${t}_lastSynced`);return(r==null?void 0:r.lastSynced)??null}async addPendingUpload(t){await this.saveData(Je.pendingUploads,t)}async getPendingUploadsForProtocol(t){return(await this.getAllData(Je.pendingUploads)).filter(n=>n.protocolId===t)}async removePendingUpload(t){await this.deleteData(Je.pendingUploads,t)}async clearPendingUploadsForProtocol(t){const r=await this.getPendingUploadsForProtocol(t);for(const n of r)await this.removePendingUpload(n.id)}async addSyncError(t,r){const n={id:crypto.randomUUID(),operationId:t,error:r,timestamp:Date.now()};await this.saveData(Je.syncErrors,n)}async getSyncErrors(){return this.getAllData(Je.syncErrors)}async clearSyncErrors(){await this.clearStore(Je.syncErrors)}async estimateStorageUsage(){if("storage"in navigator&&"estimate"in navigator.storage){const t=await navigator.storage.estimate(),r=t.usage||0,n=t.quota||0;return{usage:r,quota:n,percentUsed:n>0?r/n*100:0}}return null}async cleanupOldData(t={}){const{maxProtocolAgeDays:r=30,maxClosedTicketAgeDays:n=7,maxSyncErrorAgeDays:s=7}=t;let a=0;const o=Date.now(),l=await this.getAllData(Je.protocols);for(const h of l){const p=new Date(h.created_at).getTime();(o-p)/(1e3*60*60*24)>r&&!h._pendingSync&&(await this.deleteData(Je.protocols,h.id),a++)}const c=await this.getAllData(Je.tickets),d=["zakonczone","anulowane"];for(const h of c)if(d.includes(h.status)){const p=h.completed_date?new Date(h.completed_date).getTime():new Date(h.updated_at).getTime();(o-p)/(1e3*60*60*24)>n&&!h._pendingSync&&(await this.deleteData(Je.tickets,h.id),a++)}
505const u=await this.getSyncErrors();for(const h of u)(o-h.timestamp)/864e5>s&&(await this.deleteData(Je.syncErrors,h.id),a++);return console.log(`Cleaned up ${a} old records from IndexedDB`),{deletedCount:a}}async saveDataWithQuotaHandling(t,r){try{return await this.saveData(t,r),!0}catch(n){if((n==null?void 0:n.name)==="QuotaExceededError"){console.warn("Storage quota exceeded, attempting cleanup..."),await this.cleanupOldData();try{return await this.saveData(t,r),!0}catch(s){return console.error("Failed to save after cleanup:",s),!1}}throw n}}}const ve=new e$,t$=3;function Ss(){const e=Dr(),[t,r]=f.useState(0),[n,s]=f.useState(!1),a=f.useCallback(async()=>{const p=await ve.getSyncQueueCount();r(p)},[]),o=f.useCallback(async(p,m,y)=>{const g=crypto.randomUUID(),x={id:g,type:p,table:m,data:y,createdAt:Date.now(),retryCount:0};return await ve.addToSyncQueue(x),await a(),e&&l(x),g},[e,a]),l=async p=>{try{switch(p.type){case"create":const{error:m}=await ne.from(p.table).insert(p.data);if(m)throw m;break;case"update":const{id:y,...g}=p.data;if(["tickets","devices"].includes(p.table)&&p.data.updated_at){const{data:v,error:w}=await ne.from(p.table).select("updated_at").eq("id",y).single();if(!w&&v){const _=new Date(v.updated_at).getTime(),j=new Date(p.data.updated_at).getTime();if(_>j)return console.log("Conflict detected: server data is newer, skipping local update"),await ve.addSyncError(p.id,"Konflikt: dane na serwerze są nowsze"),!0}}const{error:x}=await ne.from(p.table).update(g).eq("id",y);if(x)throw x;break;case"delete":const{error:b}=await ne.from(p.table).delete().eq("id",p.data.id);if(b)throw b;break;case"create_protocol":await c(p);break}return await ve.removeFromSyncQueue(p.id),!0}catch(m){return console.error("Sync operation failed:",m),await ve.addSyncError(p.id,(m==null?void 0:m.message)||String(m)),p.retryCount<t$?await ve.addToSyncQueue({...p,retryCount:p.retryCount+1}):xs.error(`Nie udało się zsynchronizować: ${p.table}`,{description:"Operacja wymaga ręcznego ponowienia"}),!1}},c=async p=>{const{protocolId:m,ticketId:y,userId:g,protocolData:x,ticketUpdate:b,clientEmail:v,clientName:w,deviceName:_}=p.data;console.log(`[Sync] Starting protocol sync for ${m}`);const j=await ve.getPendingUploadsForProtocol(m);console.log(`[Sync] Found ${j.length} pending uploads`);let k=null;const N=j.find(L=>L.type==="signature");if(N)try{console.log("[Sync] Uploading signature...");const L=await d(N.data,N.mimeType);k=`${g}/${y}/signature.png`;const{error:F}=await ne.storage.from("signatures").upload(k,L,{upsert:!0});if(F)throw await ve.addSyncError(p.id,`Signature upload failed: ${F.message}`),F;console.log("[Sync] Signature uploaded successfully")}catch(L){throw console.error("[Sync] Signature upload error:",L),L}const P=[],T=j.filter(L=>L.type==="photo");for(let L=0;L<T.length;L++)try{console.log(`[Sync] Uploading photo ${L+1}/${T.length}...`);const F=T[L],Y=await d(F.data,F.mimeType),Q=`${g}/${y}/photo_${L}.${F.filename.split(".").pop()}`,{error:S}=await ne.storage.from("ticket-photos").upload(Q,Y,{upsert:!0});if(S)throw await ve.addSyncError(p.id,`Photo ${L} upload failed: ${S.message}`),S;P.push(Q),console.log(`[Sync] Photo ${L+1} uploaded successfully`)}catch(F){throw console.error(`[Sync] Photo ${L} upload error:`,F),F}console.log("[Sync] Creating protocol record...");const{error:I}=await ne.from("protocols").insert({id:m,ticket_id:y,technician_notes:x.technician_notes,client_signature_url:k,photos_urls:P,checklist:x.checklist});if(I)throw await ve.addSyncError(p.id,`Protocol insert failed: ${I.message}`),I;console.log("[Sync] Protocol record created"),console.log("[Sync] Updating ticket status...");const{error:H}=await ne.from("tickets").update(b).eq("id",y);if(H)throw await ve.addSyncError(p.id,`Ticket update failed: ${H.message}`),H;if(console.log("[Sync] Ticket status updated"),v){const L=`${window.location.origin}/protokol/${y}/podglad?source=public`;try{console.log("[Sync] Sending notification email..."),await ne.functions.invoke("send-notification-email",{body:{type:"service_completed",ticketId:y,clientEmail:v,clientName:w||"Klient",deviceName:_||"Urządzenie",protocolUrl:L}}
505),console.log("[Sync] Notification email sent")}catch(F){console.error("[Sync] Failed to send notification email:",F)}}await ve.clearPendingUploadsForProtocol(m);const M=await ve.getData("protocols",m);M&&M._pendingSync&&await ve.deleteData("protocols",m),console.log(`[Sync] Protocol ${m} sync completed successfully`)},d=async(p,m)=>(await fetch(p)).blob(),u=f.useCallback(async()=>{if(!(n||!e)){s(!0);try{const p=await ve.getSyncQueue();if(p.length===0){s(!1);return}p.sort((g,x)=>g.createdAt-x.createdAt);let m=0,y=0;for(const g of p)await l(g)?m++:y++;await a(),m>0&&xs.success(`Zsynchronizowano ${m} zmian`,{description:y>0?`${y} operacji wymaga ponowienia`:void 0})}catch(p){console.error("Error processing sync queue:",p)}finally{s(!1)}}},[n,e,a]),h=f.useCallback(async()=>{await ve.clearStore("syncQueue"),await a()},[a]);return f.useEffect(()=>{a()},[a]),f.useEffect(()=>{e&&t>0&&u()},[e]),f.useEffect(()=>{"serviceWorker"in navigator&&"sync"in window.ServiceWorkerRegistration.prototype&&navigator.serviceWorker.ready.then(p=>{var m;(m=p.sync)==null||m.register("sync-queue").catch(y=>{console.log("Background sync registration failed:",y)})})},[t]),f.useEffect(()=>{var m;const p=y=>{var g;((g=y.data)==null?void 0:g.type)==="SYNC_REQUIRED"&&u()};return(m=navigator.serviceWorker)==null||m.addEventListener("message",p),()=>{var y;(y=navigator.serviceWorker)==null||y.removeEventListener("message",p)}},[u]),{addOperation:o,pendingCount:t,isSyncing:n,processQueue:u,clearQueue:h,updatePendingCount:a}}function _S(){const e=Dr(),{pendingCount:t}=Ss();return e?null:i.jsxs("div",{className:"fixed top-0 left-0 right-0 z-50 bg-amber-500 text-amber-950 px-4 py-2 flex items-center justify-center gap-2 text-sm font-medium shadow-md",children:[i.jsx(Hs,{className:"h-4 w-4"}),i.jsxs("span",{children:["Tryb offline",t>0&&` - ${t} zmian zostanie zsynchronizowanych`]})]})}function wf(){const e=Zt(),t=rs(),[r,n]=f.useState(!1),s=t.pathname!=="/",[a,o]=f.useState(s);f.useEffect(()=>{if(s){o(!0);return}const d=()=>{o(window.scrollY>20)};return d(),window.addEventListener("scroll",d),()=>window.removeEventListener("scroll",d)},[s]);const l=d=>{if(t.pathname==="/"){const u=document.getElementById(d);u&&u.scrollIntoView({behavior:"smooth"})}else e(`/#${d}`);n(!1)},c=()=>{t.pathname==="/"?window.scrollTo({top:0,behavior:"smooth"}):e("/")};return i.jsx("nav",{className:J("fixed left-0 right-0 top-0 z-50 transition-all duration-300",a?"bg-background/95 shadow-md backdrop-blur-md border-b border-border":"bg-transparent"),children:i.jsxs("div",{className:"container",children:[i.jsxs("div",{className:"flex h-16 items-center justify-between",children:[i.jsxs("button",{onClick:c,className:"flex items-center gap-2 transition-opacity hover:opacity-80",children:[i.jsx(Er,{className:J("h-6 w-6 transition-colors",a?"text-primary":"text-primary-foreground")}),i.jsx("span",{className:J("text-lg font-bold transition-colors",a?"text-foreground":"text-primary-foreground"),children:"QRserwis"})]}),i.jsxs("div",{className:"hidden items-center gap-8 md:flex",children:[i.jsx("button",{onClick:()=>l("jak-to-dziala"),className:J("text-sm font-medium transition-colors hover:opacity-80",a?"text-foreground":"text-primary-foreground"),children:"Jak to działa"}),i.jsx("button",{onClick:()=>l("korzysci"),className:J("text-sm font-medium transition-colors hover:opacity-80",a?"text-foreground":"text-primary-foreground"),children:"Korzyści"}),i.jsx("button",{onClick:()=>l("cennik"),className:J("text-sm font-medium transition-colors hover:opacity-80",a?"text-foreground":"text-primary-foreground"),children:"Cennik"}),i.jsx("button",{onClick:()=>l("faq"),className:J("text-sm font-medium transition-colors hover:opacity-80",a?"text-foreground":"text-primary-foreground"),children:"FAQ"}),i.jsx("button",{onClick:()=>{e("/id")},className:J("text-sm font-medium transition-colors hover:opacity-80",a?"text-foreground":"text-primary-foreground"),children:"Problem ze skanowaniem?"})]}),i.jsxs("div",{className:"hidden items-center gap-3 md:flex",children:[i.jsx(G,{variant:"ghost",size:"sm",onClick:()=>e("/auth"),className:J("transition-colors",a?"text-foreground hover:bg-muted":"text-primary-foreground hover:bg-primary-foreground
505/10"),children:"Zaloguj się"}),i.jsxs(G,{size:"sm",onClick:()=>e("/auth"),className:J("group",a?"":"bg-white text-primary hover:bg-white/90"),children:["Rozpocznij za darmo",i.jsx(Da,{className:"ml-1.5 h-4 w-4 transition-transform group-hover:translate-x-0.5"})]})]}),i.jsx("button",{onClick:()=>n(!r),className:J("p-2 md:hidden",a?"text-foreground":"text-primary-foreground"),children:r?i.jsx(Ks,{className:"h-6 w-6"}):i.jsx(l1,{className:"h-6 w-6"})})]}),r&&i.jsx("div",{className:J("absolute left-0 right-0 top-16 border-b p-4 md:hidden",a?"bg-background/95 backdrop-blur-md border-border":"bg-primary border-primary-foreground/20"),children:i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsx("button",{onClick:()=>l("jak-to-dziala"),className:J("rounded-lg px-4 py-2 text-left text-sm font-medium transition-colors",a?"text-foreground hover:bg-muted":"text-primary-foreground hover:bg-primary-foreground/10"),children:"Jak to działa"}),i.jsx("button",{onClick:()=>l("korzysci"),className:J("rounded-lg px-4 py-2 text-left text-sm font-medium transition-colors",a?"text-foreground hover:bg-muted":"text-primary-foreground hover:bg-primary-foreground/10"),children:"Korzyści"}),i.jsx("button",{onClick:()=>l("cennik"),className:J("rounded-lg px-4 py-2 text-left text-sm font-medium transition-colors",a?"text-foreground hover:bg-muted":"text-primary-foreground hover:bg-primary-foreground/10"),children:"Cennik"}),i.jsx("button",{onClick:()=>l("faq"),className:J("rounded-lg px-4 py-2 text-left text-sm font-medium transition-colors",a?"text-foreground hover:bg-muted":"text-primary-foreground hover:bg-primary-foreground/10"),children:"FAQ"}),i.jsx("button",{onClick:()=>{e("/id"),n(!1)},className:J("rounded-lg px-4 py-2 text-left text-sm font-medium transition-colors",a?"text-foreground hover:bg-muted":"text-primary-foreground hover:bg-primary-foreground/10"),children:"Problem ze skanowaniem?"}),i.jsxs("div",{className:"mt-2 flex flex-col gap-2 border-t border-current/20 pt-4",children:[i.jsx(G,{variant:"ghost",onClick:()=>{e("/auth"),n(!1)},className:J("justify-start",a?"text-foreground hover:bg-muted":"text-primary-foreground hover:bg-primary-foreground/10"),children:"Zaloguj się"}),i.jsxs(G,{onClick:()=>{e("/auth"),n(!1)},className:J(a?"":"bg-white text-primary hover:bg-white/90"),children:["Rozpocznij za darmo",i.jsx(Da,{className:"ml-1.5 h-4 w-4"})]})]})]})})]})})}function xf(){const e=Zt();return i.jsx("footer",{className:"border-t border-border py-8",children:i.jsxs("div",{className:"container flex flex-col items-center justify-between gap-4 md:flex-row",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Er,{className:"h-5 w-5 text-primary"}),i.jsx("span",{className:"font-semibold",children:"QRserwis"})]}),i.jsx("a",{href:"https://sprawdzeni.online/sprawdzone-strony/80889b57-ea82-4a31-86ab-4f9f10d12df2",target:"_blank",rel:"noopener nofollow",children:i.jsx("img",{src:"https://sprawdzeni.online/api/public/badge.svg?id=80889b57-ea82-4a31-86ab-4f9f10d12df2",alt:"Zaufana strona sprawdzeni.online",width:"130",height:"40",loading:"lazy",decoding:"async",referrerPolicy:"strict-origin-when-cross-origin",className:"h-10 w-[130px]"})})]}),i.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4 text-sm text-muted-foreground",children:[i.jsx("button",{onClick:()=>e("/install"),className:"hover:text-foreground transition-colors",children:"Zainstaluj aplikację"}),i.jsx("span",{className:"hidden md:inline",children:"•"}),i.jsx("button",{onClick:()=>e("/regulamin"),className:"hover:text-foreground transition-colors",children:"Regulamin"}),i.jsx("span",{className:"hidden md:inline",children:"•"}),i.jsx("button",{onClick:()=>e("/polityka-prywatnosci"),className:"hover:text-foreground transition-colors",children:"Polityka Prywatności"}),i.jsx("span",{className:"hidden md:inline",children:"•"}),i.jsx("span",{children:"© 2024 QRserwis"})]})]})})}var bf="Collapsible",[r$,jS]=dn(bf),[n$,Ev]=r$(bf),kS=f.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:s,disabled:a,onOpenChange:o,...l}=e,[c,d]=jn({prop:n,defaultProp:s??!1,onChange:o,caller:bf});return i.jsx(n$,{scope:r,disabled:a,contentId:cr(),open:c,onOpenToggle:f.useCallback(()=>d(u=>!u),[d]),children:i.jsx(Se.div,{"data-state":Ov(c),"data-disabled":a?"":void 0,...l,ref:t})})});kS.displayName=bf;var NS="CollapsibleTrigger",Pv=f.forwardRef((e,t)=>
vendor: 1,792 bytes, line 505
505{const{__scopeCollapsible:r,...n}=e,s=Ev(NS,r);return i.jsx(Se.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Ov(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...n,ref:t,onClick:ke(e.onClick,s.onOpenToggle)})});Pv.displayName=NS;var Tv="CollapsibleContent",Rv=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Ev(Tv,e.__scopeCollapsible);return i.jsx(ts,{present:r||s.open,children:({present:a})=>i.jsx(s$,{...n,ref:t,present:a})})});Rv.displayName=Tv;var s$=f.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:s,...a}=e,o=Ev(Tv,r),[l,c]=f.useState(n),d=f.useRef(null),u=tt(t,d),h=f.useRef(0),p=h.current,m=f.useRef(0),y=m.current,g=o.open||l,x=f.useRef(g),b=f.useRef(void 0);return f.useEffect(()=>{const v=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(v)},[]),dr(()=>{const v=d.current;if(v){b.current=b.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();h.current=w.height,m.current=w.width,x.current||(v.style.transitionDuration=b.current.transitionDuration,v.style.animationName=b.current.animationName),c(n)}},[o.open,n]),i.jsx(Se.div,{"data-state":Ov(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!g,...a,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:g&&s})});function Ov(e){return e?"open":"closed"}var SS=kS,a$=Pv,i$=Rv,o$=f.createContext(void 0);function _f(e){const t=f.useContext(o$);return e||t||"ltr"}var ns="Accordion",l$=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Av,c$,d$]=Yh(ns),[jf,h7]=dn(ns,[d$,
505jS]),Dv=jS(),CS=U.forwardRef((e,t)=>{const{type:r,...n}=e,s=n,a=n;return i.jsx(Av.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?i.jsx(p$,{...a,ref:t}):i.jsx(f$,{...s,ref:t})})});CS.displayName=ns;var[zS,u$]=jf(ns),[ES,h$]=jf(ns,{collapsible:!1}),f$=U.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},collapsible:a=!1,...o}=e,[l,c]=jn({prop:r,defaultProp:n??"",onChange:s,caller:ns});return i.jsx(zS,{scope:e.__scopeAccordion,value:U.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:U.useCallback(()=>a&&c(""),[a,c]),children:i.jsx(ES,{scope:e.__scopeAccordion,collapsible:a,children:i.jsx(PS,{...o,ref:t})})})}),p$=U.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},...a}=e,[o,l]=jn({prop:r,defaultProp:n??[],onChange:s,caller:ns}),c=U.useCallback(u=>l((h=[])=>[...h,u]),[l]),d=U.useCallback(u=>l((h=[])=>h.filter(p=>p!==u)),[l]);return i.jsx(zS,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:d,children:i.jsx(ES,{scope:e.__scopeAccordion,collapsible:!0,children:i.jsx(PS,{...a,ref:t})})})}),[m$,kf]=jf(ns),PS=U.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:s,orientation:a="vertical",...o}=e,l=U.useRef(null),c=tt(l,t),d=c$(r),h=_f(s)==="ltr",p=ke(e.onKeyDown,m=>{var P;if(!l$.includes(m.key))return;const y=m.target,g=d().filter(T=>{var I;return!((I=T.ref.current)!=null&&I.disabled)}),x=g.findIndex(T=>T.ref.current===y),b=g.length;if(x===-1)return;m.preventDefault();let v=x;const w=0,_=b-1,j=()=>{v=x+1,v>_&&(v=w)},k=()=>{v=x-1,v<w&&(v=_)};switch(m.key){case"Home":v=w;break;case"End":v=_;break;case"ArrowRight":a==="horizontal"&&(h?j():k());break;case"ArrowDown":a==="vertical"&&j();break;case"ArrowLeft":a==="horizontal"&&(h?k():j());break;case"ArrowUp":a==="vertical"&&k();break}const N=v%b;(P=g[N].ref.current)==null||P.focus()});return i.jsx(m$,{scope:r,disabled:n,direction:s,orientation:a,children:i.jsx(Av.Slot,{scope:r,children:i.jsx(Se.div,{...o,"data-orientation":a,ref:c,onKeyDown:n?void 0:p})})})}),vh="AccordionItem",[g$,Iv]=jf(vh),TS=U.forwardRef((e,t)=>{const{__scopeAccordion:r,value:n,...s}=e,a=kf(vh,r),o=u$(vh,r),l=Dv(r),c=cr(),d=n&&o.value.includes(n)||!1,u=a.disabled||e.disabled;return i.jsx(g$,{scope:r,open:d,disabled:u,triggerId:c,children:i.jsx(SS,{"data-orientation":a.orientation,"data-state":MS(d),...l,...s,ref:t,disabled:u,open:d,onOpenChange:h=>{h?o.onItemOpen(n):o.onItemClose(n)}})})});TS.displayName=vh;var RS="AccordionHeader",OS=U.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=kf(ns,r),a=Iv(RS,r);return i.jsx(Se.h3,{"data-orientation":s.orientation,"data-state":MS(a.open),"data-disabled":a.disabled?"":void 0,...n,ref:t})});OS.displayName=RS;var Pg="AccordionTrigger",AS=U.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=kf(ns,r),a=Iv(Pg,r),o=h$(Pg,r),l=Dv(r);return i.jsx(Av.ItemSlot,{scope:r,children:i.jsx(a$,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":s.orientation,id:a.triggerId,...l,...n,ref:t})})});AS.displayName=Pg;var DS="AccordionContent",IS=U.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=kf(ns,r),a=Iv(DS,r),o=Dv(r);return i.jsx(i$,{role:"region","aria-labelledby":a.triggerId,"data-orientation":s.orientation,...o,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});IS.displayName=DS;function MS(e){return e?"open":"closed"}var y$=CS,v$=TS,w$=OS,FS=AS,$S=IS;const x$=y$,Pn=f.forwardRef(({className:e,...t},r)=>i.jsx(v$,{ref:r,className:J("border-b",e),...t}));Pn.displayName="AccordionItem";const Tn=f.forwardRef(({className:e,children:t,...r},n)=>i.jsx(w$,{className:"flex",children:i.jsxs(FS,{ref:n,className:J("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,i.jsx(ef,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Tn.displayName=FS.displayName;const Rn=f.forwardRef(({className:e,children:t,...r},n)=>i.jsx($S,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:i.jsx("div",{className:J("pb-4 pt-0",e),children:t})}));Rn.displayName=$S.displayName;const b$="/assets/hero-new-OaRlrOkI.png";function _$(){const{user:e,loading:t}
505=qr(),r=Zt(),n=rs();return f.useEffect(()=>{!t&&e&&r("/dashboard")},[e,t,r]),f.useEffect(()=>{if(n.hash){const s=n.hash.replace("#",""),a=document.getElementById(s);a&&setTimeout(()=>{a.scrollIntoView({behavior:"smooth"})},100)}},[n.hash]),t?i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:i.jsx(Er,{className:"h-12 w-12 animate-pulse text-primary"})}):i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(wf,{}),i.jsxs("div",{className:"gradient-primary relative overflow-hidden pt-16",children:[i.jsx("div",{className:"absolute inset-0 bg-[url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHZpZXdCb3g9IjAgMCA2MCA2MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxnIGZpbGw9IiNmZmYiIGZpbGwtb3BhY2l0eT0iMC4wNSI+PHBhdGggZD0iTTM2IDM0djItSDI0di0yaDEyem0wLTR2MkgyNHYtMmgxMnptMC00djJIMjR2LTJoMTJ6Ii8+PC9nPjwvZz48L3N2Zz4=')] opacity-50"}),i.jsx("div",{className:"container relative mx-auto max-w-5xl py-16 md:py-24 lg:py-32",children:i.jsxs("div",{className:"grid gap-12 lg:grid-cols-2 lg:gap-16",children:[i.jsxs("div",{className:"flex flex-col justify-center text-primary-foreground",children:[i.jsx("h1",{className:"text-3xl font-bold tracking-tight md:text-4xl lg:text-5xl",children:"Mniej papierologii. Więcej wracających klientów."}),i.jsx("p",{className:"mt-6 text-lg text-primary-foreground/90 md:text-xl",children:"Prosty system dla serwisantów HVAC. Zamień zwykłą naklejkę na urządzeniu w cyfrową historię serwisu. Twórz protokoły na telefonie, zbieraj podpisy i pozwól, by automat sam przypominał klientom o przeglądach."}),i.jsxs("div",{className:"mt-10 flex flex-col gap-4 sm:flex-row sm:items-center",children:[i.jsxs(G,{size:"xl",variant:"secondary",onClick:()=>r("/auth?tab=register"),className:"group",children:["Rozpocznij za darmo",i.jsx(Da,{className:"ml-2 h-5 w-5 transition-transform group-hover:translate-x-1"})]}),i.jsx(G,{size:"xl",variant:"ghost",className:"border border-primary-foreground/20 text-primary-foreground hover:bg-primary-foreground/10",onClick:()=>{var s;(s=document.getElementById("jak-to-dziala"))==null||s.scrollIntoView({behavior:"smooth"})},children:"Zobacz jak to działa"})]}),i.jsxs("div",{className:"mt-4 flex items-center gap-2 text-sm text-white/90",children:[i.jsx(a1,{className:"h-4 w-4 text-yellow-400"}),i.jsx("span",{children:"Sprawdź jak otrzymać 50 naklejek QR gratis."})]})]}),i.jsx("div",{className:"flex items-center justify-center lg:justify-end",children:i.jsx("img",{src:b$,alt:"Aplikacja QRserwis na telefonie pokazująca panel serwisowy HVAC",className:"max-h-[500px] w-auto rounded-3xl border-4 border-white/30 object-contain shadow-2xl shadow-blue-900/50"})})]})})]}),i.jsx("div",{id:"jak-to-dziala",className:"container scroll-mt-20 py-20",children:i.jsxs("div",{className:"mx-auto max-w-6xl",children:[i.jsx("h2",{className:"text-center text-3xl font-bold md:text-4xl",children:"Prosty serwis w 4 krokach"}),i.jsx("p",{className:"mx-auto mt-4 max-w-2xl text-center text-muted-foreground",children:"Od naklejki do protokołu."}),i.jsxs("div",{className:"mt-16 grid gap-8 sm:grid-cols-2 md:grid-cols-4",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl gradient-primary shadow-lg",children:i.jsx(Er,{className:"h-8 w-8 text-primary-foreground"})}),i.jsx("h3",{className:"mt-6 text-xl font-semibold",children:"1. Oznaczasz urządzenie"}),i.jsx("p",{className:"mt-3 text-muted-foreground",children:"Przyklejasz unikalny kod QR na urządzeniu klienta. To paszport maszyny – od teraz masz pełną kontrolę nad jej historią."})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl gradient-accent shadow-lg",children:i.jsx(ng,{className:"h-8 w-8 text-accent-foreground"})}),i.jsx("h3",{className:"mt-6 text-xl font-semibold",children:"2. Klient zgłasza problem"}),i.jsx("p",{className:"mt-3 text-muted-foreground",children:'Awaria? Przegląd? Klient skanuje kod i wybiera typ zgłoszenia. Ty otrzymujesz natychmiastowe powiadomienie. Koniec z "głuchym telefonem".'})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl gradient-success shadow-lg",children:i.jsx(Bx,{className:"h-8 w-8 text-success-foreground"})}),i.jsx("h3",{className:"mt-6 text-xl font-semibold",children:"3. Serwisujesz cyfrowo"}),i.jsx("p",{className:"mt-3 text-muted-foreground",children:"Wykonujesz usługę, a protokół tworzysz kilkoma kliknięciami w telefonie. Klient sk
505łada podpis bezpośrednio na Twoim ekranie. Żadnych papierów."})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-gradient-to-br from-violet-500 to-purple-600 shadow-lg",children:i.jsx(Ci,{className:"h-8 w-8 text-white"})}),i.jsx("h3",{className:"mt-6 text-xl font-semibold",children:"4. Budujesz lojalność"}),i.jsx("p",{className:"mt-3 text-muted-foreground",children:"Klient ma stały dostęp do historii napraw przez QR. A gdy zbliża się termin przeglądu? System sam wyśle przypomnienie, zapewniając Ci kolejne zlecenie."})]})]})]})}),i.jsx("div",{id:"korzysci",className:"scroll-mt-20 border-t border-border bg-muted/30 py-20",children:i.jsx("div",{className:"container",children:i.jsxs("div",{className:"mx-auto max-w-5xl",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("h2",{className:"text-3xl font-bold md:text-4xl",children:"Zmień chaos w system, który zarabia na siebie."}),i.jsx("p",{className:"mt-3 text-xl text-muted-foreground md:text-2xl",children:"Mniej papierów, więcej zleceń."})]}),i.jsxs("div",{className:"mt-16 grid gap-6 sm:grid-cols-2",children:[i.jsxs("div",{className:"group rounded-2xl border border-border/50 bg-card p-8 shadow-md transition-all duration-300 hover:-translate-y-1 hover:shadow-xl",children:[i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-xl bg-green-500/10",children:i.jsx(Qk,{className:"h-6 w-6 text-green-600"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-xl font-bold",children:"Automat do powracających zleceń"}),i.jsx("p",{className:"mt-1 text-sm font-medium text-primary",children:"Twój pasywny handlowiec"})]})]}),i.jsx("p",{className:"mt-4 text-muted-foreground",children:"Nie trać czasu na dzwonienie i przypominanie. System automatycznie wyśle klientowi powiadomienie o kończącym się terminie przeglądu. Klient zyskuje bezpieczeństwo, a Ty pewne zlecenie, zanim pomyśli o konkurencji."})]}),i.jsxs("div",{className:"group rounded-2xl border border-border/50 bg-card p-8 shadow-md transition-all duration-300 hover:-translate-y-1 hover:shadow-xl",children:[i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-xl bg-blue-500/10",children:i.jsx(Hs,{className:"h-6 w-6 text-blue-600"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-xl font-bold",children:"Biuro w kieszeni – nawet bez zasięgu"}),i.jsx("p",{className:"mt-1 text-sm font-medium text-primary",children:"Działa tam, gdzie Ty – nawet w piwnicy"})]})]}),i.jsx("p",{className:"mt-4 text-muted-foreground",children:"Dzięki technologii PWA masz pełną funkcjonalność aplikacji na swoim telefonie. Brak zasięgu w kotłowni? Żaden problem. Wypełnij protokół offline, a system zsynchronizuje dane, gdy tylko złapiesz sieć."})]}),i.jsxs("div",{className:"group rounded-2xl border border-border/50 bg-card p-8 shadow-md transition-all duration-300 hover:-translate-y-1 hover:shadow-xl",children:[i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-xl bg-purple-500/10",children:i.jsx(Bx,{className:"h-6 w-6 text-purple-600"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-xl font-bold",children:"Profesjonalizm, który widać"}),i.jsx("p",{className:"mt-1 text-sm font-medium text-primary",children:"Koniec z brudnymi papierami"})]})]}),i.jsx("p",{className:"mt-4 text-muted-foreground",children:"Zrób wrażenie na kliencie nowoczesnym podejściem. Wypełniasz czytelny protokół w aplikacji, klient podpisuje go na ekranie, i od razu ma do niego dostęp w historii serwisowej. Budujesz wizerunek eksperta."})]}),i.jsxs("div",{className:"group rounded-2xl border border-border/50 bg-card p-8 shadow-md transition-all duration-300 hover:-translate-y-1 hover:shadow-xl",children:[i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-xl bg-orange-500/10",children:i.jsx(UO,{className:"h-6 w-6 text-orange-600"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-xl font-bold",children:"Porządek w telefonie"}),i.jsx("p",{className:"mt-1 text-sm font-medium text-primary",children:"Telefon służy tylko do umawiania wizyt"})]})]}),i.jsx("p",{className:"mt-4 text-muted-foreground",children:"Koniec z szukaniem historii napraw w notesie czy pamięci. Dzięki aplikacji wiesz wszystko o urządzeniu. Przyjmujesz zgłoszenia przez aplikację, a przez telefon tylko ustalasz termin."})]})]})]})})}),i.jsx("div",{className:"border-t border-border bg-card py-8",children:i.jsxs("div",{className:"container",children:[i.jsx("p",{className:"mb-5 text-center text-sm font-medium text-muted-foreground",children:"Bezpieczna infrastruktura i zgodność ze standardami:"}),i.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-8 md:gap-12",children:[i.jsxs("div",{className:"flex items-center gap-2.5 text-foreground",children:[i.jsx(tf,{className:"h-5 w-5"}),i.jsx("span",{className:"text-base font-medium",children:"Szyfrowanie SSL"})]}),i.jsxs("div",{className:"flex items-center gap-2.5 text-foreground",children:[i.jsx(s1,{className:"h-5 w-5"}),i.jsx("span",{className:"text-base font-medium",children:"Backup w chmurze"})]}),i.jsxs("div",{className:"flex items-center gap-2.5 text-foreground",children:[i.jsx(i1,{className:"h-5 w-5"}),i.jsx("span",{className:"text-base font-medium",children:"Zgodność RODO"})]})]})]})}),i.jsx("div",{id:"cennik",className:"scroll-mt-20 border-t border-border py-20",children:i.jsx("div",{className:"container",children:i.jsxs("div",{className:"mx-auto max-w-4xl",children:[i.jsx("h2",{className:"text-center text-3xl font-bold md:text-4xl",children:"Cennik"}),i.jsx("p",{className:"mx-auto mt-4 max-w-2xl text-center text-muted-foreground",children:"Wybierz plan dopasowany do Twojego biznesu"}),i.jsxs("div",{className:"mt-12 grid gap-8 md:grid-cols-2",children:[i.jsxs("div",{className:"flex flex-col rounded-2xl border border-border bg-card p-8 shadow-md",children:[i.jsx("div",{className:"mb-4",children:i.jsx("span",{className:"rounded-full bg-muted px-3 py-1 text-sm font-medium text-muted-foreground",children:"Darmowy"})}),i.jsx("h3",{className:"text-2xl font-bold",children:"Starter"}),i.jsx("div",{className:"mt-4",children:i.jsx("span",{className:"text-4xl font-bold",children:"0 zł"})}),i.jsxs("ul",{className:"mt-6 space-y-3",children:[i.jsxs("li",{className:"flex items-center gap-3",children:[i.jsx(Dt,{className:"h-5 w-5 text-primary"}),i.jsx("span",{children:"Obsługa zgłoszeń"})]}),i.jsxs("li",{className:"flex items-center gap-3",children:[i.jsx(Dt,{className:"h-5 w-5 text-primary"}),i.jsx("span",{children:"Zarządzanie klientami"})]}),i.jsxs("li",{className:"flex items-center gap-3",children:[i.jsx(Dt,{className:"h-5 w-5 text-primary"}),i.jsx("span",{children:"Tworzenie i podgląd protokołów"})]}),i.jsxs("li",{className:"flex items-center gap-3",children:[i.jsx(Dt,{className:"h-5 w-5 text-primary"}),i.jsx("span",{children:"Powiadomienia bez limitów"})]}),i.jsxs("li",{className:"flex items-center gap-3",children:[i.jsx(Dt,{className:"h-5 w-5 text-primary"}),i.jsx("span",{children:"Do 10 aktywnych urządzeń"})]})]}),i.jsx("div",{className:"mt-auto pt-8",children:i.jsx(G,{variant:"secondary",className:"w-full",onClick:()=>r("/auth?tab=register"),children:"Rozpocznij za darmo"})})]}),i.jsxs("div",{className:"relative flex flex-col rounded-2xl border-2 border-primary bg-card p-8 shadow-xl",children:[i.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:i.jsx("span",{className:"rounded-full bg-primary px-4 py-1 text-sm font-medium text-primary-foreground",children:"Polecany"})}),i.jsx("div",{className:"mb-4",children:i.jsx("span",{className:"rounded-full bg-primary/10 px-3 py-1 text-sm font-medium text-primary",children:"Płatny"})}),i.jsx("h3",{className:"text-2xl font-bold",children:"Solo"}),i.jsxs("div",{className:"mt-4",children:[i.jsx("span",{className:"text-4xl font-bold",children:"79 zł"}),i.jsx("span",{className:"ml-1 text-muted-foreground",children:"netto / mies."})]}),i.jsxs("ul",{className:"mt-6 space-y-3",children:[i.jsxs("li",{className:"flex items-center gap-3",children:[i.jsx(Dt,{className:"h-5 w-5 text-primary"}),i.jsx("span",{children:"Obsługa zgłoszeń"})]}),i.jsxs("li",{className:"flex items-center gap-3",children:[i.jsx(Dt,{className:"h-5 w-5 text-primary"}),i.jsx("span",{children:"Zarządzanie klientami"})]}),i.jsxs("li",{className:"flex items-center gap-3",children:[i.jsx(Dt,{className:"h-5 w-5 text-primary"}),i.jsx("span",{children:"Tworzenie i podgląd protokołów"})]}),i.jsxs("li",{className:"flex items-center gap-3",children:[i.jsx(Dt,{className:"h-5 w-5 text-primary"}),i.jsx("span",{children:"Powiadomienia bez limitów"})]}),i.jsxs("li",{className:"flex items-center gap-3",children:[i.jsx(Dt,{className:"h-5 w-5 text-primary"}),i.jsx("span",{children:"Do 200 aktywnych urządzeń"})]}),i.jsxs("li",{className:"flex items-center gap-3",children:[i.jsx(Dt,{className:"h-5 w-5 text-primary"}),i.jsx("span",{children:"Darmowy pakiet 50 naklejek QR"})]})]}),i.jsx("div",{className:"mt-auto pt-8",children:i.jsxs(G,{className:"w-full",onClick:()=>r("/auth?tab=register"),children:["Wybierz",i.jsx(Da,{className:"ml-2 h-4 w-4"})]})})]})]})]})})}),i.jsx("div",{id:"faq",className:"scroll-mt-20 border-t border-border bg-muted/30 py-20",children:i.jsx("div",{className:"container",children:i.jsxs("div",{className:"mx-auto max-w-3xl",children:[i.jsx("h2",{className:"text-center text-3xl font-bold md:text-4xl",children:"Często zadawane pytania"}),i.jsx("p",{className:"mx-auto mt-4 max-w-2xl text-center text-muted-foreground",children:"Od
505powiedzi na najczęściej zadawane pytania o QRserwis"}),i.jsxs(x$,{type:"single",collapsible:!0,className:"mt-12",children:[i.jsxs(Pn,{value:"item-1",className:"border-b border-border",children:[i.jsx(Tn,{className:"text-left text-base font-medium hover:no-underline",children:"Jak długo trwa wdrożenie systemu?"}),i.jsx(Rn,{className:"text-muted-foreground",children:"Wdrożenie jest natychmiastowe. Po rejestracji możesz od razu dodawać urządzenia i generować kody QR. Naklejki wysyłamy w ciągu 2-3 dni roboczych po zamówieniu pakietu startowego w ramach planu Solo."})]}),i.jsxs(Pn,{value:"item-2",className:"border-b border-border",children:[i.jsx(Tn,{className:"text-left text-base font-medium hover:no-underline",children:"W mojej firmie działa kilku serwisantów, którzy łącznie obsługują ponad 200 urządzeń - czy istnieje plan dla zespołu?"}),i.jsx(Rn,{className:"text-muted-foreground",children:"W najlbliższym czasie zostanie wprowadzony plan Team z nieograniczoną liczbą urządzeń. Skontaktuj się z nami a otrzymasz informację o tej aktualizacji."})]}),i.jsxs(Pn,{value:"item-3",className:"border-b border-border",children:[i.jsx(Tn,{className:"text-left text-base font-medium hover:no-underline",children:"Czy darmowe naklejki są wodoodporne i trwałe?"}),i.jsx(Rn,{className:"text-muted-foreground",children:"Tak, nasze naklejki są wykonane z folii polipropylenowej i pokryte laminatem z klejem o bardzo silnej przyczepności. Idealnie nadają się do klimatyzatorów, pomp ciepła i innych urządzeń HVAC."})]}),i.jsxs(Pn,{value:"item-4",className:"border-b border-border",children:[i.jsx(Tn,{className:"text-left text-base font-medium hover:no-underline",children:"Czy muszę korzystać z protokołów online?"}),i.jsx(Rn,{className:"text-muted-foreground",children:"Nie, to jedynie przydatna funkcjonalność. Nadal możesz wypełniać protokoły ręcznie poza systemem, z możliwością wgrania skanu."})]}),i.jsxs(Pn,{value:"item-5",className:"border-b border-border",children:[i.jsx(Tn,{className:"text-left text-base font-medium hover:no-underline",children:"Czy system generuje protokoły zgodne z przepisami (F-gaz, serwisowe) i jakie urządzenia obsługuje?"}),i.jsxs(Rn,{className:"text-muted-foreground",children:['Tak. Nasze protokoły cyfrowe w pełni zastępują druki papierowe i są dedykowane dla rynku mieszkaniowego oraz małego biznesu. System oferuje dedykowane, "inteligentne" formularze zgodne z normami dla:',i.jsx("br",{}),"- Klimatyzacji i Pomp Ciepła (wymogi F-gaz/CRO, parametry pracy).",i.jsx("br",{}),"- Kotłów Gazowych (analiza spalin, szczelność gazowa).",i.jsx("br",{}),"- Wentylacji domowej / Rekuperacji (pomiary wydajności).",i.jsx("br",{}),"- Dla wszelkich innych urządzeń (np. kurtyny powietrzne, nagrzewnice) dostępny jest elastyczny Protokół Uniwersalny.",i.jsx("br",{}
505),"Uwaga: W celu zachowania czytelności, system nie posiada dedykowanych modułów dla ciężkiego przemysłu (np. duże chillery, centrale szpitalne)."]})]}),i.jsxs(Pn,{value:"item-6",className:"border-b border-border",children:[i.jsx(Tn,{className:"text-left text-base font-medium hover:no-underline",children:"Czy klient musi instalować aplikację?"}),i.jsx(Rn,{className:"text-muted-foreground",children:"Nie, klient nie musi niczego instalować. Wystarczy zeskanować kod QR aparatem telefonu i wybrać zgłoszenie awarii lub przeglądu. Bez rejestracji, bez logowania."})]}),i.jsxs(Pn,{value:"item-7",className:"border-b border-border",children:[i.jsx(Tn,{className:"text-left text-base font-medium hover:no-underline",children:"Czy klient może dokonać zgłoszenia bez QR?"}),i.jsx(Rn,{className:"text-muted-foreground",children:'Oczywiście - zgłaszanie przez skanowanie stanowi jedynie dodatkowy, wygodny sposób komunikacji. Klient nadal może kontaktować się z Tobą telefonicznie a Ty możesz utworzyć zgłoszenie ręcznie w systemie. Jeżeli kod QR jest nieczytelny, można również wybrać w menu "Problem ze skanowaniem?" i wpisać identyikator umieszczony pod kodem.'})]}),i.jsxs(Pn,{value:"item-8",className:"border-b border-border",children:[i.jsx(Tn,{className:"text-left text-base font-medium hover:no-underline",children:"Czy mogę anulować subskrypcję w dowolnym momencie?"}),i.jsx(Rn,{className:"text-muted-foreground",children:"Tak, możesz anulować subskrypcję w każdej chwili bez żadnych kar. Po anulowaniu Twoje konto zostanie automatycznie przeniesione do planu darmowego Starter po zakończeniu okresu rozliczeniowego z limitem 10 urządzeń."})]}),i.jsxs(Pn,{value:"item-9",className:"border-b border-border",children:[i.jsx(Tn,{className:"text-left text-base font-medium hover:no-underline",children:"Jak działają powiadomienia o zgłoszeniach?"}),i.jsx(Rn,{className:"text-muted-foreground",children:"Gdy klient zgłosi awarię lub poprosi o przegląd, otrzymasz natychmiastowe powiadomienie email z opisem, danymi klienta i linkiem do zgłoszenia."})]}),i.jsxs(Pn,{value:"item-10",className:"border-b border-border",children:[i.jsx(Tn,{className:"text-left text-base font-medium hover:no-underline",children:"Czy moje dane są bezpieczne?"}),i.jsx(Rn,{className:"text-muted-foreground",children:"Tak, bezpieczeństwo danych jest dla nas priorytetem. Wszystkie dane są szyfrowane protokołem SSL, przechowywane w bezpiecznej chmurze z regularnym backupem i zgodnie z wymogami RODO."})]})]})]})})}),i.jsx("div",{className:"border-t border-border bg-muted/50 py-16",children:i.jsxs("div",{className:"container text-center",children:[i.jsx("h2",{className:"text-2xl font-bold md:text-3xl",children:"Gotowy, aby usprawnić swój serwis?"}),i.jsx("p",{className:"mt-3 text-muted-foreground",children:"Dołącz do serwisantów, którzy oszczędzają czas dzięki QRserwis"}),i.jsxs(G,{size:"lg",className:"mt-6",onClick:()=>r("/auth"),children:["Rozpocznij za darmo",i.jsx(Da,{className:"ml-2 h-4 w-4"})]})]})}),i.jsx(xf,{})]})}const Pe=f.forwardRef(({className:e,type:t,...r},n)=>i.jsx("input",{type:t,className:J("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));Pe.displayName="Input";var j$="Label",LS=f.forwardRef((e,t)=>i.jsx(Se.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));LS.displayName=j$;var US=LS;const k$=Ji("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ue=f.forwardRef(({className:e,...t},r)=>i.jsx(US,{ref:r,className:J(k$(),e),...t}));ue.displayName=US.displayName;const Fe=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:J("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));
vendor: 4,175 bytes, line 505
505Fe.displayName="Card";const lt=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:J("flex flex-col space-y-1.5 p-6",e),...t}));lt.displayName="CardHeader";const ut=f.forwardRef(({className:e,...t},r)=>i.jsx("h3",{ref:r,className:J("text-2xl font-semibold leading-none tracking-tight",e),...t}));ut.displayName="CardTitle";const xr=f.forwardRef(({className:e,...t},r)=>i.jsx("p",{ref:r,className:J("text-sm text-muted-foreground",e),...t}));xr.displayName="CardDescription";const Me=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:J("p-6 pt-0",e),...t}));Me.displayName="CardContent";const N$=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:J("flex items-center p-6 pt-0",e),...t}));N$.displayName="CardFooter";var Mp="rovingFocusGroup.onEntryFocus",S$={bubbles:!1,cancelable:!0},pd="RovingFocusGroup",[Tg,BS,C$]=Yh(pd),[z$,WS]=dn(pd,[C$]),[E$,P$]=z$(pd),VS=f.forwardRef((e,t)=>i.jsx(Tg.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Tg.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(T$,{...e,ref:t})})}));VS.displayName=pd;var T$=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...h}=e,p=f.useRef(null),m=tt(t,p),y=_f(a),[g,x]=jn({prop:o,defaultProp:l??null,onChange:c,caller:pd}),[b,v]=f.useState(!1),w=_n(d),_=BS(r),j=f.useRef(!1),[k,N]=f.useState(0);return f.useEffect(()=>{const P=p.current;if(P)return P.addEventListener(Mp,w),()=>P.removeEventListener(Mp,w)},[w]),i.jsx(E$,{scope:r,orientation:n,dir:y,loop:s,currentTabStopId:g,onItemFocus:f.useCallback(P=>x(P),[x]),onItemShiftTab:f.useCallback(()=>v(!0),[]),onFocusableItemAdd:f.useCallback(()=>N(P=>P+1),[]),onFocusableItemRemove:f.useCallback(()=>N(P=>P-1),[]),children:i.jsx(Se.div,{tabIndex:b||k===0?-1:0,"data-orientation":n,...h,ref:m,style:{outline:"none",...e.style},onMouseDown:ke(e.onMouseDown,()=>{j.current=!0}),onFocus:ke(e.onFocus,P=>{const T=!j.current;if(P.target===P.currentTarget&&T&&!b){const I=new CustomEvent(Mp,S$);if(P.currentTarget.dispatchEvent(I),!I.defaultPrevented){const H=_().filter(Q=>Q.focusable),M=H.find(Q=>Q.active),L=H.find(Q=>Q.id===g),Y=[M,L,...H].filter(Boolean).map(Q=>Q.ref.current);KS(Y,u)}}j.current=!1}),onBlur:ke(e.onBlur,()=>v(!1))})})}),qS="RovingFocusGroupItem",HS=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:a,children:o,...l}=e,c=cr(),d=a||c,u=P$(qS,r),h=u.currentTabStopId===d,p=BS(r),{onFocusableItemAdd:m,onFocusableItemRemove:y,currentTabStopId:g}=u;return f.useEffect(()=>{if(n)return m(),()=>y()},[n,m,y]),i.jsx(Tg.ItemSlot,{scope:r,id:d,focusable:n,active:s,children:i.jsx(Se.span,{tabIndex:h?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:ke(e.onMouseDown,x=>{n?u.onItemFocus(d):x.preventDefault()}),onFocus:ke(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:ke(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const b=A$(x,u.orientation,u.dir);if(b!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let w=p().filter(_=>_.focusable).map(_=>_.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const _=w.indexOf(x.currentTarget);w=u.loop?D$(w,_+1):w.slice(_+1)}setTimeout(()=>KS(w))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:g!=null}):o})})});HS.displayName=qS;var R$={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function O$(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function A$(e,t,r){const n=O$(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return R$[n]}function KS(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function D$(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var I$=VS,M$=HS,Nf="Tabs",[F$,f7]=dn(Nf,[WS]),ZS=WS(),[$$,Mv]=F$(Nf),G
vendor: 4,823 bytes, line 505
505S=f.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:s,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=_f(l),[h,p]=jn({prop:n,onChange:s,defaultProp:a??"",caller:Nf});return i.jsx($$,{scope:r,baseId:cr(),value:h,onValueChange:p,orientation:o,dir:u,activationMode:c,children:i.jsx(Se.div,{dir:u,"data-orientation":o,...d,ref:t})})});GS.displayName=Nf;var QS="TabsList",YS=f.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...s}=e,a=Mv(QS,r),o=ZS(r);return i.jsx(I$,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:n,children:i.jsx(Se.div,{role:"tablist","aria-orientation":a.orientation,...s,ref:t})})});YS.displayName=QS;var JS="TabsTrigger",XS=f.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:s=!1,...a}=e,o=Mv(JS,r),l=ZS(r),c=rC(o.baseId,n),d=nC(o.baseId,n),u=n===o.value;return i.jsx(M$,{asChild:!0,...l,focusable:!s,active:u,children:i.jsx(Se.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...a,ref:t,onMouseDown:ke(e.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?o.onValueChange(n):h.preventDefault()}),onKeyDown:ke(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(n)}),onFocus:ke(e.onFocus,()=>{const h=o.activationMode!=="manual";!u&&!s&&h&&o.onValueChange(n)})})})});XS.displayName=JS;var eC="TabsContent",tC=f.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:s,children:a,...o}=e,l=Mv(eC,r),c=rC(l.baseId,n),d=nC(l.baseId,n),u=n===l.value,h=f.useRef(u);return f.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),i.jsx(ts,{present:s||u,children:({present:p})=>i.jsx(Se.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:p&&a})})});tC.displayName=eC;function rC(e,t){return`${e}-trigger-${t}`}function nC(e,t){return`${e}-content-${t}`}var L$=GS,sC=YS,aC=XS,iC=tC;const pl=L$,Fi=f.forwardRef(({className:e,...t},r)=>i.jsx(sC,{ref:r,className:J("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Fi.displayName=sC.displayName;const nn=f.forwardRef(({className:e,...t},r)=>i.jsx(aC,{ref:r,className:J("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));nn.displayName=aC.displayName;const Kn=f.forwardRef(({className:e,...t},r)=>i.jsx(iC,{ref:r,className:J("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Kn.displayName=iC.displayName;const U$=Ji("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",warning:"border-transparent bg-warning text-warning-foreground hover:bg-warning/80"}},defaultVariants:{variant:"default"}});function Ge({className:e,variant:t,...r}){return i.jsx("div",{className:J(U$({variant:t}),e),...r})}function oC(e){const t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Sf="Checkbox",[B$,p7]=dn(Sf),[W$,Fv]=B$(Sf);function V$(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:s,disabled:a,form:o,name:l,onCheckedChange:c,required:d,value:u="on",internal_do_not_use_render:h}=e,[p,m]=jn({prop:r,defaultProp:s??!1,onChange:c,caller:Sf}),[y,g]=f.useState(null),[x,b]=f.useState(null),v=f.useRef(!1),w=y?!!o||!!y.closest("form"):!0,_={checked:p,disabled:a,setChecked:m,control:y,setControl:g,name:l,form:o,value:u,hasConsumerStoppedPropagationRef:v,required:d,defaultChecked:Ma(s)?!1:s,isFormControl:w,bubbleInput:x,setBubbleInput:b};return i.jsx(W$,{scope:t,..._,children:q$(h)?h(_):n})}var lC="CheckboxTrigger",cC=f.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},s)=>{const{control:a,value:o,disabled:l,checked:c,required:d,setControl:u,setChecked:h,hasConsumerStoppedPropagationRef:p,isFormControl:m,bubbleInput:y}
505=Fv(lC,e),g=tt(s,u),x=f.useRef(c);return f.useEffect(()=>{const b=a==null?void 0:a.form;if(b){const v=()=>h(x.current);return b.addEventListener("reset",v),()=>b.removeEventListener("reset",v)}},[a,h]),i.jsx(Se.button,{type:"button",role:"checkbox","aria-checked":Ma(c)?"mixed":c,"aria-required":d,"data-state":pC(c),"data-disabled":l?"":void 0,disabled:l,value:o,...n,ref:g,onKeyDown:ke(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:ke(r,b=>{h(v=>Ma(v)?!0:!v),y&&m&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})})});cC.displayName=lC;var $v=f.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:s,defaultChecked:a,required:o,disabled:l,value:c,onCheckedChange:d,form:u,...h}=e;return i.jsx(V$,{__scopeCheckbox:r,checked:s,defaultChecked:a,disabled:l,required:o,onCheckedChange:d,name:n,form:u,value:c,internal_do_not_use_render:({isFormControl:p})=>i.jsxs(i.Fragment,{children:[i.jsx(cC,{...h,ref:t,__scopeCheckbox:r}),p&&i.jsx(fC,{__scopeCheckbox:r})]})})});$v.displayName=Sf;var dC="CheckboxIndicator",uC=f.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...s}=e,a=Fv(dC,r);return i.jsx(ts,{present:n||Ma(a.checked)||a.checked===!0,children:i.jsx(Se.span,{"data-state":pC(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});uC.displayName=dC;var hC="CheckboxBubbleInput",fC=f.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:s,checked:a,defaultChecked:o,required:l,disabled:c,name:d,value:u,form:h,bubbleInput:p,setBubbleInput:m}=Fv(hC,e),y=tt(r,m),g=oC(a),x=A1(n);f.useEffect(()=>{const v=p;if(!v)return;const w=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(w,"checked").set,k=!s.current;if(g!==a&&j){const N=new Event("click",{bubbles:k});v.indeterminate=Ma(a),j.call(v,Ma(a)?!1:a),v.dispatchEvent(N)}},[p,g,a,s]);const b=f.useRef(Ma(a)?!1:a);return i.jsx(Se.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??b.current,required:l,disabled:c,name:d,value:u,form:h,...t,tabIndex:-1,ref:y,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});fC.displayName=hC;function q$(e){return typeof e=="function"}function Ma(e){return e==="indeterminate"}function pC(e){return Ma(e)?"indeterminate":e?"checked":"unchecked"}const $i=f.forwardRef(({className:e,...t},r)=>i.jsx($v,{ref:r,className:J("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:i.jsx(uC,{className:J("flex items-center justify-center text-current"),children:i.jsx(Dt,{className:"h-4 w-4"})})}));$i.displayName=$v.displayName;var ot;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const a={};for(const o of s)a[o]=o;return a},e.getValidEnumValues=s=>{const a=e.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),o={};for(const l of a)o[l]=s[l];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(a){return s[a]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&a.push(o);return a},e.find=(s,a)=>{for(const o of s)if(a(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(ot||(ot={}));var Kb;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Kb||(Kb={}));const _e=ot.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pa=e=>{switch(typeof e){case"undefined":return _e.undefined;case"string":return _e.string;case"number":return Number.isNaN(e)?_e.nan:_e.number;case"boolean":return _e.boolean;case"function":return _e.function;case"bigint":return _e.bigint;case"symbol":return _e.symbol;case"object":return Array.isArray(e)?_e.array:e===null?_e.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?_e.promise:typeof Map<"u"&&e instanceof Map?_e.map:typeof Set<"u"&&e instanceof Set?_e.set:typeof Date<"u"&&e instanceof Date?_e.date:_e.object;default:return _e.unknown}}
vendor: 5,724 bytes, line 505
505,de=ot.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Qs extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(a){return a.message},n={_errors:[]},s=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let l=n,c=0;for(;c<o.path.length;){const d=o.path[c];c===o.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(r(o))):l[d]=l[d]||{_errors:[]},l=l[d],c++}}};return s(this),n}static assert(t){if(!(t instanceof Qs))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ot.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];r[a]=r[a]||[],r[a].push(t(s))}else n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Qs.create=e=>new Qs(e);const Rg=(e,t)=>{let r;switch(e.code){case de.invalid_type:e.received===_e.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case de.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ot.jsonStringifyReplacer)}`;break;case de.unrecognized_keys:r=`Unrecognized key(s) in object: ${ot.joinValues(e.keys,", ")}`;break;case de.invalid_union:r="Invalid input";break;case de.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ot.joinValues(e.options)}`;break;case de.invalid_enum_value:r=`Invalid enum value. Expected ${ot.joinValues(e.options)}, received '${e.received}'`;break;case de.invalid_arguments:r="Invalid function arguments";break;case de.invalid_return_type:r="Invalid function return type";break;case de.invalid_date:r="Invalid date";break;case de.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:ot.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case de.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case de.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case de.custom:r="Invalid input";break;case de.invalid_intersection_types:r="Intersection results could not be merged";break;case de.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case de.not_finite:r="Number must be finite";break;default:r=t.defaultError,ot.assertNever(e)}return{message:r}};let H$=Rg;function K$(){return H$}const Z$=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,a=[...r,...s.path||[]],o={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let l="";const c=n.filter(d=>!!d).slice().reverse();for(const d of c)l=d(o,{data:t,defaultError:l}).message;return{...s,path:a,message:l}};function we(e,t){const r=K$(),n=Z$({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Rg?void 0:Rg].filter(s=>!!s)});e.common.issues.push(n)}class on{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return $e;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const a=await s.key,o=await s.value;n.push({key:a,value:o})}return on.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:a,value:o}=s;
vendor: 16,835 bytes, line 505
505if(a.status==="aborted"||o.status==="aborted")return $e;a.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[a.value]=o.value)}return{status:t.value,value:n}}}const $e=Object.freeze({status:"aborted"}),nc=e=>({status:"dirty",value:e}),Nn=e=>({status:"valid",value:e}),Zb=e=>e.status==="aborted",Gb=e=>e.status==="dirty",ml=e=>e.status==="valid",wh=e=>typeof Promise<"u"&&e instanceof Promise;var je;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(je||(je={}));class Va{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Qb=(e,t)=>{if(ml(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Qs(e.common.issues);return this._error=r,this._error}}};function Ke(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,l)=>{const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??n??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??r??l.defaultError}},description:s}}class st{get description(){return this._def.description}_getType(t){return pa(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:pa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new on,ctx:{common:t.parent.common,data:t.data,parsedType:pa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(wh(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pa(t)},s=this._parseSync({data:t,path:n.path,parent:n});return Qb(n,s)}"~validate"(t){var n,s;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pa(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:r});return ml(a)?{value:a.value}:{issues:r.common.issues}}catch(a){(s=(n=a==null?void 0:a.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(a=>ml(a)?{value:a.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pa(t)},s=this._parse({data:t,path:n.path,parent:n}),a=await(wh(s)?s:Promise.resolve(s));return Qb(n,a)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,a)=>{const o=t(s),l=()=>a.addIssue({code:de.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new yl({schema:this,typeName:Le.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Fa.create(this,this._def)}nullable(){return vl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _s.create(this)}promise(){return jh.create(this,this._def)}or(t){return bh.create([this,t],this._def)}and(t){return _h.create(this,t,this._def)}transform(t){return new yl({...Ke(this._def),schema:this,typeName:Le.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Dg({...Ke(this._def),innerType:this,defaultValue:r,typeName:Le.ZodDefault})}brand(){return new yL({typeName:Le.ZodBranded,type:this,...Ke(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Ig({...Ke(this._def),innerType:this,catchValue:r,typeName:Le.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Lv.create(this,t)}readonly(){return Mg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const G$=/^c[^\s-]{8,}$/i,Q$=/^[0-9a-z]+$/,Y$=/^[0-9A-HJKMNP-TV-Z]{26}$/i,J$=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,X$=/^[a-z0-9_-]{21}$/i,eL=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,tL=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,rL=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nL="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Fp;const sL=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,aL=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,iL=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,oL=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,lL=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,cL=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mC="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dL=new RegExp(`^${mC}$`);function gC(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function uL(e){return new RegExp(`^${gC(e)}$`)}function hL(e){let t=`${mC}T${gC(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function fL(e,t){return!!((t==="v4"||!t)&&sL.test(e)||(t==="v6"||!t)&&iL.test(e))}function pL(e,t){if(!eL.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function mL(e,t){return!!((t==="v4"||!t)&&aL.test(e)||(t==="v6"||!t)&&oL.test(e))}class Sa extends st{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==_e.string){const a=this._getOrReturnCtx(t);return we(a,{code:de.invalid_type,expected:_e.string,received:a.parsedType}),$e}const n=new on;let s;for(const a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(s=this._getOrReturnCtx(t,s),we(s,{code:de.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(s=this._getOrReturnCtx(t,s),we(s,{code:de.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const o=t.data.length>a.value,l=t.data.length<a.value;(o||l)&&(s=this._getOrReturnCtx(t,s),o?we(s,{code:de.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):l&&we(s,{code:de.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")rL.test(t.data)||(s=this._getOrReturnCtx(t,s),we(s,{validation:"email",code:de.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")Fp||(Fp=new RegExp(nL,"u")),Fp.test(t.data)||(s=this._getOrReturnCtx(t,s),we(s,{validation:"emoji",code:de.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")J$.test(t.data)||(s=this._getOrReturnCtx(t,s),we(s,{validation:"uuid",code:de.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")X$.test(t.data)||(s=this._getOrReturnCtx(t,s),we(s,{validation:"nanoid",code:de.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")G$.test(t.data)||(s=this._getOrReturnCtx(t,s),we(s,{validation:"cuid",code:de.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Q$.test(t.data)||(s=this._getOrReturnCtx(t,s),we(s,{validation:"cuid2",code:de.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Y$.test(t.data)||(s=this._getOrReturnCtx(t,s),we(s,{validation:"ulid",code:de.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),we(s,{validation:"url",code:de.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),we(s,{validation:"regex",code:de.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(t,s),we(s,{code:de.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(s=this._getOrReturnCtx(t,s),we(s,{code:de.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(s=this._getOrReturnCtx(t,s),we(s,{code:de.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?hL(a).test(t.data)||(s=this._getOrReturnCtx(t,s),we(s,{code:de.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?dL.test(t.data)||(s=this._getOrReturnCtx(t,s),we(s,{code:de.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?uL(a).test(t.data)||(s=this._getOrReturnCtx(t,s),we(s,{code:de.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?tL.test(t.data)||(s=this._getOrReturnCtx(t,s),we(s,{validation:"duration",code:de.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?fL(t.data,a.version)||(s=this._getOrReturnCtx(t,s),we(s,{validation:"ip",code:de.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?pL(t.data,a.alg)||(s=this._getOrReturnCtx(t,s),we(s,{validation:"jwt",code:de.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?mL(t.data,a.version)||(s=this._getOrReturnCtx(t,s),we(s,{validation:"cidr",code:de.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?lL.test(t.data)||(s=this._getOrReturnCtx(t,s),we(s,{validation:"base64",code:de.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?cL.test(t.data)||(s=this._getOrReturnCtx(t,s),we(s,{validation:"base64url",code:de.invalid_string,message:a.message}),n.dirty()):ot.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:de.invalid_string,...je.errToObj(n)})}_addCheck(t){return new Sa({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...je.errToObj(t)})}url(t){return this._addCheck({kind:"url",...je.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...je.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...je.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...je.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...je.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...je.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...je.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...je.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...je.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...je.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...je.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...je.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...je.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...je.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...je.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...je.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...je.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...je.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...je.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...je.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...je.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...je.errToObj(r)})}nonempty(t){return this.min(1,je.errToObj(t))}trim(){return new Sa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Sa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Sa({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}
vendor: 4,670 bytes, line 505
505get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Sa.create=e=>new Sa({checks:[],typeName:Le.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Ke(e)});function gL(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,a=Number.parseInt(e.toFixed(s).replace(".","")),o=Number.parseInt(t.toFixed(s).replace(".",""));return a%o/10**s}class Jc extends st{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==_e.number){const a=this._getOrReturnCtx(t);return we(a,{code:de.invalid_type,expected:_e.number,received:a.parsedType}),$e}let n;const s=new on;for(const a of this._def.checks)a.kind==="int"?ot.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),we(n,{code:de.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),we(n,{code:de.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),we(n,{code:de.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?gL(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),we(n,{code:de.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),we(n,{code:de.not_finite,message:a.message}),s.dirty()):ot.assertNever(a);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,je.toString(r))}gt(t,r){return this.setLimit("min",t,!1,je.toString(r))}lte(t,r){return this.setLimit("max",t,!0,je.toString(r))}lt(t,r){return this.setLimit("max",t,!1,je.toString(r))}setLimit(t,r,n,s){return new Jc({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:je.toString(s)}]})}_addCheck(t){return new Jc({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:je.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:je.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:je.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:je.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:je.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:je.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:je.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:je.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:je.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ot.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}
vendor: 4,134 bytes, line 505
505}Jc.create=e=>new Jc({checks:[],typeName:Le.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ke(e)});class Xc extends st{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==_e.bigint)return this._getInvalidInput(t);let n;const s=new on;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),we(n,{code:de.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),we(n,{code:de.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),we(n,{code:de.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):ot.assertNever(a);return{status:s.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return we(r,{code:de.invalid_type,expected:_e.bigint,received:r.parsedType}),$e}gte(t,r){return this.setLimit("min",t,!0,je.toString(r))}gt(t,r){return this.setLimit("min",t,!1,je.toString(r))}lte(t,r){return this.setLimit("max",t,!0,je.toString(r))}lt(t,r){return this.setLimit("max",t,!1,je.toString(r))}setLimit(t,r,n,s){return new Xc({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:je.toString(s)}]})}_addCheck(t){return new Xc({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:je.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:je.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:je.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:je.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:je.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Xc.create=e=>new Xc({checks:[],typeName:Le.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Ke(e)});class Yb extends st{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==_e.boolean){const n=this._getOrReturnCtx(t);return we(n,{code:de.invalid_type,expected:_e.boolean,received:n.parsedType}),$e}return Nn(t.data)}}Yb.create=e=>new Yb({typeName:Le.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ke(e)});class xh extends st{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==_e.date){const a=this._getOrReturnCtx(t);return we(a,{code:de.invalid_type,expected:_e.date,received:a.parsedType}),$e}if(Number.isNaN(t.data.getTime())){const a=this._getOrReturnCtx(t);return we(a,{code:de.invalid_date}),$e}const n=new on;let s;for(const a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(s=this._getOrReturnCtx(t,s),we(s,{code:de.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(s=this._getOrReturnCtx(t,s),we(s,{code:de.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):ot.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new xh({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:je.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:je.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}xh.create=e=>new xh({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Le.ZodD
vendor: 8,543 bytes, line 505
505ate,...Ke(e)});class Jb extends st{_parse(t){if(this._getType(t)!==_e.symbol){const n=this._getOrReturnCtx(t);return we(n,{code:de.invalid_type,expected:_e.symbol,received:n.parsedType}),$e}return Nn(t.data)}}Jb.create=e=>new Jb({typeName:Le.ZodSymbol,...Ke(e)});class Xb extends st{_parse(t){if(this._getType(t)!==_e.undefined){const n=this._getOrReturnCtx(t);return we(n,{code:de.invalid_type,expected:_e.undefined,received:n.parsedType}),$e}return Nn(t.data)}}Xb.create=e=>new Xb({typeName:Le.ZodUndefined,...Ke(e)});class e0 extends st{_parse(t){if(this._getType(t)!==_e.null){const n=this._getOrReturnCtx(t);return we(n,{code:de.invalid_type,expected:_e.null,received:n.parsedType}),$e}return Nn(t.data)}}e0.create=e=>new e0({typeName:Le.ZodNull,...Ke(e)});class t0 extends st{constructor(){super(...arguments),this._any=!0}_parse(t){return Nn(t.data)}}t0.create=e=>new t0({typeName:Le.ZodAny,...Ke(e)});class r0 extends st{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Nn(t.data)}}r0.create=e=>new r0({typeName:Le.ZodUnknown,...Ke(e)});class qa extends st{_parse(t){const r=this._getOrReturnCtx(t);return we(r,{code:de.invalid_type,expected:_e.never,received:r.parsedType}),$e}}qa.create=e=>new qa({typeName:Le.ZodNever,...Ke(e)});class n0 extends st{_parse(t){if(this._getType(t)!==_e.undefined){const n=this._getOrReturnCtx(t);return we(n,{code:de.invalid_type,expected:_e.void,received:n.parsedType}),$e}return Nn(t.data)}}n0.create=e=>new n0({typeName:Le.ZodVoid,...Ke(e)});class _s extends st{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==_e.array)return we(r,{code:de.invalid_type,expected:_e.array,received:r.parsedType}),$e;if(s.exactLength!==null){const o=r.data.length>s.exactLength.value,l=r.data.length<s.exactLength.value;(o||l)&&(we(r,{code:o?de.too_big:de.too_small,minimum:l?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(we(r,{code:de.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(we(r,{code:de.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,l)=>s.type._parseAsync(new Va(r,o,r.path,l)))).then(o=>on.mergeArray(n,o));const a=[...r.data].map((o,l)=>s.type._parseSync(new Va(r,o,r.path,l)));return on.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new _s({...this._def,minLength:{value:t,message:je.toString(r)}})}max(t,r){return new _s({...this._def,maxLength:{value:t,message:je.toString(r)}})}length(t,r){return new _s({...this._def,exactLength:{value:t,message:je.toString(r)}})}nonempty(t){return this.min(1,t)}}_s.create=(e,t)=>new _s({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Le.ZodArray,...Ke(t)});function yo(e){if(e instanceof It){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Fa.create(yo(n))}return new It({...e._def,shape:()=>t})}else return e instanceof _s?new _s({...e._def,type:yo(e.element)}):e instanceof Fa?Fa.create(yo(e.unwrap())):e instanceof vl?vl.create(yo(e.unwrap())):e instanceof Li?Li.create(e.items.map(t=>yo(t))):e}class It extends st{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=ot.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==_e.object){const d=this._getOrReturnCtx(t);return we(d,{code:de.invalid_type,expected:_e.object,received:d.parsedType}),$e}const{status:n,ctx:s}=this._processInputParams(t),{shape:a,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof qa&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||l.push(d);const c=[];for(const d of o){const u=a[d],h=s.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Va(s,h,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof qa){const d=this._def.unknownKeys;if(d==="passthrough")for(const u of l)c.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(d==="strict")l.length>0&&(we(s,{code:de.unrecognized_keys,keys:l}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const u of l){const h=s.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Va(s,h,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const u of c){const h=await u.key,p=await u.value;d.push({key:h,value:p,alwaysSet:u.alwaysSet})}return d}).then(d=>on.mergeObjectSync(n,d)):on.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return je.errToObj,new It({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,o;const s=((o=(a=this._def).errorMap)==null?void 0:o.call(a,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:je.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new It({...this._def,unknownKeys:"strip"})}passthrough(){return new It({...this._def,unknownKeys:"passthrough"})}extend(t){return new It({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new It({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Le.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new It({...this._def,catchall:t})}pick(t){const r={};for(const n of ot.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new It({...this._def,shape:()=>r})}omit(t){const r={};for(const n of ot.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new It({...this._def,shape:()=>r})}deepPartial(){return yo(this)}partial(t){const r={};for(const n of ot.objectKeys(this.shape)){const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new It({...this._def,shape:()=>r})}required(t){const r={};for(const n of ot.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Fa;)a=a._def.innerType;r[n]=a}return new It({...this._def,shape:()=>r})}keyof(){return yC(ot.objectKeys(this.shape))}}It.create=(e,t)=>new It({shape:()=>e,unknownKeys:"strip",catchall:qa.create(),typeName:Le.ZodObject,...Ke(t)});It.strictCreate=(e,t)=>new It({shape:()=>e,unknownKeys:"strict",catchall:qa.create(),typeName:Le.ZodObject,...Ke(t)});It.lazycreate=(e,t)=>new It({shape:e,unknownKeys:"strip",catchall:qa.create(),typeName:Le.ZodObject,...Ke(t)});class bh extends st{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(a){for(const l of a)if(l.result.status==="valid")return l.result;for(const l of a)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;const o=a.map(l=>new Qs(l.ctx.common.issues));return we(r,{code:de.invalid_union,unionErrors:o}),$e}if(r.common.async)return Promise.all(n.map(async a=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(s);{let a;const o=[];for(const c of n){const d={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:d});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const l=o.map(c=>new Qs(c));return we(r,{code:de.invalid_union,unionErrors:l}),$e}}get options(){return this._def.options}}bh.create=(e,t)=>new bh({options:e,typeName:Le.ZodUnion,...Ke(t)});function Og(e,t){const r=pa(e),n=pa(t);if(e===t)return{valid:!0,data:e};if(r===_e.object&&n===_e.object){const s=ot.objectKeys(t),a=ot.objectKeys(e).filter(l=>s.indexOf(l)!==-1),o={...e,...t};for(const l of a){const c=Og(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(r===_e.array&&n===_e.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let a=0;a<e.length;a++){const o=e[a],l=t[a],c=Og(o,l);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===_e.date&&n===_e.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class _h extends st{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=(a,o)=>
vendor: 4,181 bytes, line 505
505{if(Zb(a)||Zb(o))return $e;const l=Og(a.value,o.value);return l.valid?((Gb(a)||Gb(o))&&r.dirty(),{status:r.value,value:l.data}):(we(n,{code:de.invalid_intersection_types}),$e)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>s(a,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}_h.create=(e,t,r)=>new _h({left:e,right:t,typeName:Le.ZodIntersection,...Ke(r)});class Li extends st{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==_e.array)return we(n,{code:de.invalid_type,expected:_e.array,received:n.parsedType}),$e;if(n.data.length<this._def.items.length)return we(n,{code:de.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$e;!this._def.rest&&n.data.length>this._def.items.length&&(we(n,{code:de.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...n.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new Va(n,o,n.path,l)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>on.mergeArray(r,o)):on.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new Li({...this._def,rest:t})}}Li.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Li({items:e,typeName:Le.ZodTuple,rest:null,...Ke(t)})};class s0 extends st{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==_e.map)return we(n,{code:de.invalid_type,expected:_e.map,received:n.parsedType}),$e;const s=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([l,c],d)=>({key:s._parse(new Va(n,l,n.path,[d,"key"])),value:a._parse(new Va(n,c,n.path,[d,"value"]))}));if(n.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const d=await c.key,u=await c.value;if(d.status==="aborted"||u.status==="aborted")return $e;(d.status==="dirty"||u.status==="dirty")&&r.dirty(),l.set(d.value,u.value)}return{status:r.value,value:l}})}else{const l=new Map;for(const c of o){const d=c.key,u=c.value;if(d.status==="aborted"||u.status==="aborted")return $e;(d.status==="dirty"||u.status==="dirty")&&r.dirty(),l.set(d.value,u.value)}return{status:r.value,value:l}}}}s0.create=(e,t,r)=>new s0({valueType:t,keyType:e,typeName:Le.ZodMap,...Ke(r)});class ed extends st{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==_e.set)return we(n,{code:de.invalid_type,expected:_e.set,received:n.parsedType}),$e;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(we(n,{code:de.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(we(n,{code:de.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const a=this._def.valueType;function o(c){const d=new Set;for(const u of c){if(u.status==="aborted")return $e;u.status==="dirty"&&r.dirty(),d.add(u.value)}return{status:r.value,value:d}}const l=[...n.data.values()].map((c,d)=>a._parse(new Va(n,c,n.path,d)));return n.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,r){return new ed({...this._def,minSize:{value:t,message:je.toString(r)}})}max(t,r){return new ed({...this._def,maxSize:{value:t,message:je.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}ed.create=(e,t)=>new ed({valueType:e,minSize:null,maxSize:null,typeName:Le.ZodSet,...Ke(t)});class a0 extends st{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}a0.create=(e,t)=>new a0({getter:e,typeName:Le.ZodLazy,...Ke(t)});class Ag extends st{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return we(r,{received:r.data,code:de.invalid_literal,expected:this._def.value}),$e}
vendor: 4,526 bytes, line 505
505return{status:"valid",value:t.data}}get value(){return this._def.value}}Ag.create=(e,t)=>new Ag({value:e,typeName:Le.ZodLiteral,...Ke(t)});function yC(e,t){return new gl({values:e,typeName:Le.ZodEnum,...Ke(t)})}class gl extends st{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return we(r,{expected:ot.joinValues(n),received:r.parsedType,code:de.invalid_type}),$e}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return we(r,{received:r.data,code:de.invalid_enum_value,options:n}),$e}return Nn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return gl.create(t,{...this._def,...r})}exclude(t,r=this._def){return gl.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}gl.create=yC;class i0 extends st{_parse(t){const r=ot.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==_e.string&&n.parsedType!==_e.number){const s=ot.objectValues(r);return we(n,{expected:ot.joinValues(s),received:n.parsedType,code:de.invalid_type}),$e}if(this._cache||(this._cache=new Set(ot.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=ot.objectValues(r);return we(n,{received:n.data,code:de.invalid_enum_value,options:s}),$e}return Nn(t.data)}get enum(){return this._def.values}}i0.create=(e,t)=>new i0({values:e,typeName:Le.ZodNativeEnum,...Ke(t)});class jh extends st{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.promise&&r.common.async===!1)return we(r,{code:de.invalid_type,expected:_e.promise,received:r.parsedType}),$e;const n=r.parsedType===_e.promise?r.data:Promise.resolve(r.data);return Nn(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}jh.create=(e,t)=>new jh({type:e,typeName:Le.ZodPromise,...Ke(t)});class yl extends st{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,a={addIssue:o=>{we(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const o=s.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async l=>{if(r.value==="aborted")return $e;const c=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return c.status==="aborted"?$e:c.status==="dirty"||r.value==="dirty"?nc(c.value):c});{if(r.value==="aborted")return $e;const l=this._def.schema._parseSync({data:o,path:n.path,parent:n});return l.status==="aborted"?$e:l.status==="dirty"||r.value==="dirty"?nc(l.value):l}}if(s.type==="refinement"){const o=l=>{const c=s.refinement(l,a);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?$e:(l.status==="dirty"&&r.dirty(),o(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?$e:(l.status==="dirty"&&r.dirty(),o(l.value).then(()=>({status:r.value,value:l.value}))))}if(s.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ml(o))return $e;const l=s.transform(o.value,a);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>ml(o)?Promise.resolve(s.transform(o.value,a)).then(l=>({status:r.value,value:l})):$e);ot.assertNever(s)}}yl.create=(e,t,r)=>new yl({schema:e,typeName:Le.ZodEffects,effect:t,...Ke(r)});yl.createWithPreprocess=(e,t,r)=>new yl({schema:t,effect:{type:"preprocess",transform:e},typeName:Le.ZodEffects,...Ke(r)});class Fa extends st{_parse(t){return this._getType(t)===_e.undefined?Nn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Fa.create=(e,t)=>
505new Fa({innerType:e,typeName:Le.ZodOptional,...Ke(t)});class vl extends st{_parse(t){return this._getType(t)===_e.null?Nn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}vl.create=(e,t)=>new vl({innerType:e,typeName:Le.ZodNullable,...Ke(t)});class Dg extends st{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===_e.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Dg.create=(e,t)=>new Dg({innerType:e,typeName:Le.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ke(t)});class Ig extends st{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return wh(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Qs(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Qs(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Ig.create=(e,t)=>new Ig({innerType:e,typeName:Le.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ke(t)});class o0 extends st{_parse(t){if(this._getType(t)!==_e.nan){const n=this._getOrReturnCtx(t);return we(n,{code:de.invalid_type,expected:_e.nan,received:n.parsedType}),$e}return{status:"valid",value:t.data}}}o0.create=e=>new o0({typeName:Le.ZodNaN,...Ke(e)});class yL extends st{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Lv extends st{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?$e:a.status==="dirty"?(r.dirty(),nc(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?$e:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new Lv({in:t,out:r,typeName:Le.ZodPipeline})}}class Mg extends st{_parse(t){const r=this._def.innerType._parse(t),n=s=>(ml(s)&&(s.value=Object.freeze(s.value)),s);return wh(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}Mg.create=(e,t)=>new Mg({innerType:e,typeName:Le.ZodReadonly,...Ke(t)});It.lazycreate;var Le;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Le||(Le={}));const vn=Sa.create;qa.create;_s.create;const md=It.create;It.strictCreate;bh.create;_h.create;Li.create;const vL=Ag.create;gl.create;jh.create;Fa.create;vl.create;const wL=md({email:vn().email("Nieprawidłowy adres email"),password:vn().min(6,"Hasło musi mieć co najmniej 6 znaków")}),xL=md({email:vn().email("Nieprawidłowy adres email"),password:vn().min(6,"Hasło musi mieć co najmniej 6 znaków"),confirmPassword:vn(),companyName:vn().optional(),acceptTerms:vL(!0,{errorMap:()=>({message:"Musisz zaakceptować Regulamin i Politykę Prywatności"})})}).refine(e=>e.password===e.confirmPassword,{message:"Hasła muszą być identyczne",path:["confirmPassword"]}),bL=md({email:vn().email("Nieprawidłowy adres email")});function _L(){const[e]=yN(),t=e.get("pending")==="true",r=e.get("tab")==="register"?"register":"login",[n,s]=f.useState(""),[a,o]=f.useState(""),[l,c]=f.useState(""),[d,u]=f.useState(""),[h,p]=f.useState(!1),[m,y]=f.useState(!1),[g,x]=f.useState(!1),[b,v]=f.useState(""),[w,_]=f.useState(!1),[j,k]=f.useState(null),{signIn:N,signUp:P,signOut:T,user:I,isEmailConfirmed:H}=qr(),M=Zt(),{toast:L}=Ar();f.useEffect(()=>{I&&H&&M("/dashboard")}
505,[I,H,M]);const F=async S=>{S.preventDefault();const z=wL.safeParse({email:n,password:a});if(!z.success){L({variant:"destructive",title:"Błąd walidacji",description:z.error.errors[0].message});return}y(!0);const{error:C}=await N(n,a);if(y(!1),C)if(C.message.includes("Email not confirmed")||C.message.includes("email_not_confirmed")){k(n);return}else C.message==="Invalid login credentials"?L({variant:"destructive",title:"Błąd logowania",description:"Nieprawidłowy email lub hasło"}):L({variant:"destructive",title:"Błąd logowania",description:C.message})},Y=async S=>{S.preventDefault();const z=xL.safeParse({email:n,password:a,confirmPassword:l,companyName:d,acceptTerms:h});if(!z.success){L({variant:"destructive",title:"Błąd walidacji",description:z.error.errors[0].message});return}y(!0);try{const{error:C}=await P(n,a,d);if(C){C.message.includes("already registered")?L({variant:"destructive",title:"Błąd rejestracji",description:"Ten adres email jest już zarejestrowany"}):L({variant:"destructive",title:"Błąd rejestracji",description:C.message});return}const{error:B}=await ne.functions.invoke("send-signup-confirmation",{body:{email:n,redirectTo:`${window.location.origin}/dashboard`}});B&&console.error("Error sending confirmation email:",B),_(!0)}catch(C){console.error("Signup error:",C),L({variant:"destructive",title:"Błąd rejestracji",description:"Wystąpił błąd podczas rejestracji. Spróbuj ponownie."})}finally{y(!1)}},Q=async S=>{S.preventDefault();const z=bL.safeParse({email:b});if(!z.success){L({variant:"destructive",title:"Błąd walidacji",description:z.error.errors[0].message});return}y(!0);try{const{error:C}=await ne.functions.invoke("send-password-reset",{body:{email:b,redirectTo:`${window.location.origin}/account`}});if(C)throw C;L({title:"Link wysłany",description:"Jeśli konto z tym adresem email istnieje, link do resetowania hasła został wysłany."}),x(!1),v("")}catch(C){console.error("Password reset error:",C),L({variant:"destructive",title:"Błąd",description:"Wystąpił błąd podczas wysyłania linku. Spróbuj ponownie."})}finally{y(!1)}};return(t||I)&&I&&!H?i.jsxs("div",{className:"flex min-h-screen flex-col lg:flex-row",children:[i.jsx("div",{className:"gradient-primary relative flex flex-1 flex-col justify-center p-8 text-primary-foreground lg:p-12",children:i.jsx("div",{className:"mx-auto max-w-md",children:i.jsxs("div",{className:"mb-8 flex items-center gap-3",children:[i.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-xl bg-primary-foreground/10 backdrop-blur",children:i.jsx(Er,{className:"h-8 w-8"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-3xl font-bold",children:"QRserwis"}),i.jsx("p",{className:"text-sm text-primary-foreground/80",children:"System zarządzania serwisem"})]})]})})}),i.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:i.jsxs(Fe,{className:"w-full max-w-md border-0 shadow-lg",children:[i.jsxs(lt,{className:"text-center",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-amber-100",children:i.jsx(po,{className:"h-8 w-8 text-amber-600"})}),i.jsx(ut,{className:"text-2xl",children:"Potwierdź adres email"}),i.jsx(xr,{className:"text-base",children:"Aby korzystać z aplikacji, musisz potwierdzić swój adres email."})]}),i.jsxs(Me,{className:"space-y-4",children:[i.jsx("div",{className:"rounded-lg border border-muted bg-muted/50 p-4",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(po,{className:"h-5 w-5 text-muted-foreground mt-0.5"}),i.jsxs("div",{className:"text-sm text-muted-foreground",children:[i.jsx("p",{children:"Wysłaliśmy email aktywacyjny na adres:"}),i.jsx("p",{className:"font-medium text-foreground mt-1",children:I.email})]})]})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(G,{variant:"outline",className:"flex-1",onClick:async()=>{await T(),M("/auth")},children:[i.jsx(o1,{className:"mr-2 h-4 w-4"}),"Wyloguj się"]}),i.jsx(G,{variant:"secondary",className:"flex-1",disabled:m,onClick:async()=>{y(!0);try{const{error:S}=await ne.functions.invoke("send-signup-confirmation",{body:{email:I.email,redirectTo:`${window.location.origin}/dashboard`}});if(S)throw S;L({title:"Email wysłany",description:"Sprawdź skrzynkę odbiorczą."})}catch{L({variant:"destructive",title:"Błąd",description:"Nie udało się wysłać emaila. Spróbuj ponownie."})}finally{y(!1)}},children:m?"Wysyłanie...":"Wyślij ponownie"})]})]})]})})]}):j?i.jsxs("div",{className:"flex min-h-screen flex-col lg:flex-row",children:[i.jsx("div",{className:"gradient-primary relative flex flex-1 flex-col justify-center p-8 text-primary-foreground lg:p-12",children:i.jsx("div",{className:"mx-auto max-w-md",children:i.jsxs("div",{className:"mb-8 flex items-center gap-3",children:[i.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-xl bg-primary-foreground
505/10 backdrop-blur",children:i.jsx(Er,{className:"h-8 w-8"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-3xl font-bold",children:"QRserwis"}),i.jsx("p",{className:"text-sm text-primary-foreground/80",children:"System zarządzania serwisem"})]})]})})}),i.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:i.jsxs(Fe,{className:"w-full max-w-md border-0 shadow-lg",children:[i.jsxs(lt,{className:"text-center",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-amber-100",children:i.jsx(po,{className:"h-8 w-8 text-amber-600"})}),i.jsx(ut,{className:"text-2xl",children:"Potwierdź adres email"}),i.jsx(xr,{className:"text-base",children:"Aby się zalogować, musisz najpierw potwierdzić swój adres email."})]}),i.jsxs(Me,{className:"space-y-4",children:[i.jsx("div",{className:"rounded-lg border border-muted bg-muted/50 p-4",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(po,{className:"h-5 w-5 text-muted-foreground mt-0.5"}),i.jsxs("div",{className:"text-sm text-muted-foreground",children:[i.jsx("p",{children:"Link aktywacyjny został wysłany na adres:"}),i.jsx("p",{className:"font-medium text-foreground mt-1",children:j})]})]})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(G,{variant:"outline",className:"flex-1",onClick:()=>{k(null),s(""),o("")},children:[i.jsx(ws,{className:"mr-2 h-4 w-4"}),"Powrót do logowania"]}),i.jsx(G,{variant:"secondary",className:"flex-1",disabled:m,onClick:async()=>{y(!0);try{const{error:S}=await ne.functions.invoke("send-signup-confirmation",{body:{email:j,redirectTo:`${window.location.origin}/dashboard`}});if(S)throw S;L({title:"Email wysłany",description:"Sprawdź skrzynkę odbiorczą."})}catch{L({variant:"destructive",title:"Błąd",description:"Nie udało się wysłać emaila. Spróbuj ponownie."})}finally{y(!1)}},children:m?"Wysyłanie...":"Wyślij ponownie"})]})]})]})})]}):w?i.jsxs("div",{className:"flex min-h-screen flex-col lg:flex-row",children:[i.jsx("div",{className:"gradient-primary relative flex flex-1 flex-col justify-center p-8 text-primary-foreground lg:p-12",children:i.jsx("div",{className:"mx-auto max-w-md",children:i.jsxs("div",{className:"mb-8 flex items-center gap-3",children:[i.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-xl bg-primary-foreground/10 backdrop-blur",children:i.jsx(Er,{className:"h-8 w-8"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-3xl font-bold",children:"QRserwis"}),i.jsx("p",{className:"text-sm text-primary-foreground/80",children:"System zarządzania serwisem"})]})]})})}),i.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:i.jsxs(Fe,{className:"w-full max-w-md border-0 shadow-lg",children:[i.jsxs(lt,{className:"text-center",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-green-100",children:i.jsx(e1,{className:"h-8 w-8 text-green-600"})}),i.jsx(ut,{className:"text-2xl",children:"Rejestracja pomyślna!"}),i.jsx(xr,{className:"text-base",children:"Sprawdź skrzynkę email i kliknij w link aktywacyjny, aby się zalogować."})]}),i.jsxs(Me,{className:"space-y-4",children:[i.jsx("div",{className:"rounded-lg border border-muted bg-muted/50 p-4",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(po,{className:"h-5 w-5 text-muted-foreground mt-0.5"}),i.jsxs("div",{className:"text-sm text-muted-foreground",children:[i.jsx("p",{children:"Wysłaliśmy email aktywacyjny na adres:"}),i.jsx("p",{className:"font-medium text-foreground mt-1",children:n})]})]})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(G,{variant:"outline",className:"flex-1",onClick:()=>{_(!1),s(""),o(""),c(""),u(""),p(!1)},children:[i.jsx(ws,{className:"mr-2 h-4 w-4"}),"Powrót do logowania"]}),i.jsx(G,{variant:"secondary",className:"flex-1",disabled:m,onClick:async()=>{y(!0);try{const{error:S}=await ne.functions.invoke("send-signup-confirmation",{body:{email:n,redirectTo:`${window.location.origin}/dashboard`}});if(S)throw S;L({title:"Email wysłany",description:"Sprawdź skrzynkę odbiorczą."})}catch{L({variant:"destructive",title:"Błąd",description:"Nie udało się wysłać emaila. Spróbuj ponownie."})}finally{y(!1)}},children:m?"Wysyłanie...":"Wyślij ponownie"})]})]})]})})]}):i.jsxs("div",{className:"flex min-h-screen flex-col lg:flex-row",children:[i.jsx("div",{className:"gradient-primary relative flex flex-1 flex-col justify-center p-8 text-primary-foreground lg:p-12",children:i.jsxs("div",{className:"mx-auto max-w-md",children:[i.jsxs("div",{className:"mb-8 flex items-center gap-3",children:[i.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-xl bg-primary-foreground
505/10 backdrop-blur",children:i.jsx(Er,{className:"h-8 w-8"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-3xl font-bold",children:"QRserwis"}),i.jsx("p",{className:"text-sm text-primary-foreground/80",children:"System zarządzania serwisem"})]})]}),i.jsx("h2",{className:"mb-4 text-2xl font-semibold",children:"Profesjonalne zarządzanie serwisem HVAC"}),i.jsx("p",{className:"mb-8 text-primary-foreground/80",children:"Kody QR na urządzeniach pozwalają klientom szybko zgłaszać awarie, a Tobie - efektywnie zarządzać zleceniami."}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary-foreground/10",children:i.jsx(ZO,{className:"h-5 w-5"})}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium",children:"Szybkie zgłoszenia"}),i.jsx("div",{className:"text-sm text-primary-foreground/70",children:"Klienci skanują QR i zgłaszają problem"})]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary-foreground/10",children:i.jsx(Sl,{className:"h-5 w-5"})}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium",children:"Pełna kontrola"}),i.jsx("div",{className:"text-sm text-primary-foreground/70",children:"Zarządzaj zgłoszeniami w jednym miejscu"})]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary-foreground/10",children:i.jsx(tf,{className:"h-5 w-5"})}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium",children:"Protokoły serwisowe"}),i.jsx("div",{className:"text-sm text-primary-foreground/70",children:"Elektroniczne podpisy i dokumentacja"})]})]})]})]})}),i.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:i.jsx(Fe,{className:"w-full max-w-md border-0 shadow-lg",children:g?i.jsxs(i.Fragment,{children:[i.jsxs(lt,{className:"text-center",children:[i.jsx(ut,{className:"text-2xl",children:"Resetowanie hasła"}),i.jsx(xr,{children:"Podaj swój adres email, a wyślemy Ci link do resetowania hasła"})]}),i.jsx(Me,{children:i.jsxs("form",{onSubmit:Q,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"forgot-email",children:"Email"}),i.jsx(Pe,{id:"forgot-email",type:"email",placeholder:"[email protected]",value:b,onChange:S=>v(S.target.value),required:!0})]}),i.jsx(G,{type:"submit",className:"w-full",disabled:m,children:m?"Wysyłanie...":"Wyślij link resetujący"}),i.jsxs(G,{type:"button",variant:"ghost",className:"w-full",onClick:()=>{x(!1),v("")},children:[i.jsx(ws,{className:"mr-2 h-4 w-4"}),"Powrót do logowania"]})]})})]}):i.jsxs(i.Fragment,{children:[i.jsxs(lt,{className:"text-center",children:[i.jsx(ut,{className:"text-2xl",children:"Witaj!"}),i.jsx(xr,{children:"Zaloguj się lub utwórz nowe konto"})]}),i.jsx(Me,{children:i.jsxs(pl,{defaultValue:r,className:"w-full",children:[i.jsxs(Fi,{className:"grid w-full grid-cols-2",children:[i.jsx(nn,{value:"login",children:"Logowanie"}),i.jsx(nn,{value:"register",children:"Rejestracja"})]}),i.jsx(Kn,{value:"login",children:i.jsxs("form",{onSubmit:F,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"login-email",children:"Email"}),i.jsx(Pe,{id:"login-email",type:"email",placeholder:"[email protected]",value:n,onChange:S=>s(S.target.value),required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"login-password",children:"Hasło"}),i.jsx(Pe,{id:"login-password",type:"password",placeholder:"••••••••",value:a,onChange:S=>o(S.target.value),required:!0})]}),i.jsx("button",{type:"button",onClick:()=>x(!0),className:"text-sm text-primary hover:underline",children:"Nie pamiętasz hasła?"}),i.jsx(G,{type:"submit",className:"w-full",disabled:m,children:m?"Logowanie...":"Zaloguj się"})]})}),i.jsx(Kn,{value:"register",children:i.jsxs("form",{onSubmit:Y,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"company",children:"Nazwa firmy (opcjonalnie)"}),i.jsx(Pe,{id:"company",type:"text",placeholder:"Twoja Firma Sp. z o.o.",value:d,onChange:S=>u(S.target.value)})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"register-email",children:"Email"}),i.jsx(Pe,{id:"register-email",type:"email",placeholder:"[email protected]",value:n,onChange:S=>s(S.target.value),required:!0}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Na ten adres będą wysyłane powiadomienia."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"register-password",children:"Hasło"}),i.jsx(Pe,{id:"register-password",type:"password",placeholder:"Min. 6 znaków",value:a,onChange:S=>o(S.target.value),required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"confirm-password",children:"Potwierdź hasło"}),i.jsx(Pe,{id:"confirm-password",type:"password",placeholder:"Powtórz hasło",value:l,onCh
vendor: 5,739 bytes, line 505
505ange:S=>c(S.target.value),required:!0})]}),i.jsxs("div",{className:"rounded-lg border border-muted bg-muted/50 p-4",children:[i.jsx("p",{className:"text-sm font-medium mb-2",children:"Plan:"}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-sm",children:"Starter (Darmowy)"}),i.jsx(Ge,{variant:"secondary",children:"Wybrany"})]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Możesz zmienić plan później w ustawieniach konta"})]}),i.jsxs("div",{className:"flex items-start space-x-2",children:[i.jsx($i,{id:"accept-terms",checked:h,onCheckedChange:S=>p(S===!0)}),i.jsxs("label",{htmlFor:"accept-terms",className:"text-sm leading-tight cursor-pointer",children:["Akceptuję"," ",i.jsx(ks,{to:"/regulamin",className:"text-primary underline hover:no-underline",target:"_blank",children:"Regulamin"})," ","oraz"," ",i.jsx(ks,{to:"/polityka-prywatnosci",className:"text-primary underline hover:no-underline",target:"_blank",children:"Politykę Prywatności"})," ","*"]})]}),i.jsx(G,{type:"submit",className:"w-full",disabled:m,children:m?"Rejestracja...":"Utwórz konto"})]})})]})})]})})})]})}const $p=768;function jL(){const[e,t]=f.useState(void 0);return f.useEffect(()=>{const r=window.matchMedia(`(max-width: ${$p-1}px)`),n=()=>{t(window.innerWidth<$p)};return r.addEventListener("change",n),t(window.innerWidth<$p),()=>r.removeEventListener("change",n)},[]),!!e}var kL="Separator",l0="horizontal",NL=["horizontal","vertical"],vC=f.forwardRef((e,t)=>{const{decorative:r,orientation:n=l0,...s}=e,a=SL(n)?n:l0,l=r?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return i.jsx(Se.div,{"data-orientation":a,...l,...s,ref:t})});vC.displayName=kL;function SL(e){return NL.includes(e)}var wC=vC;const ir=f.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>i.jsx(wC,{ref:s,decorative:r,orientation:t,className:J("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));ir.displayName=wC.displayName;var Lp="focusScope.autoFocusOnMount",Up="focusScope.autoFocusOnUnmount",c0={bubbles:!1,cancelable:!0},CL="FocusScope",Cf=f.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...o}=e,[l,c]=f.useState(null),d=_n(s),u=_n(a),h=f.useRef(null),p=tt(t,g=>c(g)),m=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(n){let g=function(w){if(m.paused||!l)return;const _=w.target;l.contains(_)?h.current=_:ua(h.current,{select:!0})},x=function(w){if(m.paused||!l)return;const _=w.relatedTarget;_!==null&&(l.contains(_)||ua(h.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const j of w)j.removedNodes.length>0&&ua(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const v=new MutationObserver(b);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),v.disconnect()}}},[n,l,m.paused]),f.useEffect(()=>{if(l){u0.add(m);const g=document.activeElement;if(!l.contains(g)){const b=new CustomEvent(Lp,c0);l.addEventListener(Lp,d),l.dispatchEvent(b),b.defaultPrevented||(zL(OL(xC(l)),{select:!0}),document.activeElement===g&&ua(l))}return()=>{l.removeEventListener(Lp,d),setTimeout(()=>{const b=new CustomEvent(Up,c0);l.addEventListener(Up,u),l.dispatchEvent(b),b.defaultPrevented||ua(g??document.body,{select:!0}),l.removeEventListener(Up,u),u0.remove(m)},0)}}},[l,d,u,m]);const y=f.useCallback(g=>{if(!r&&!n||m.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,b=document.activeElement;if(x&&b){const v=g.currentTarget,[w,_]=EL(v);w&&_?!g.shiftKey&&b===_?(g.preventDefault(),r&&ua(w,{select:!0})):g.shiftKey&&b===w&&(g.preventDefault(),r&&ua(_,{select:!0})):b===v&&g.preventDefault()}},[r,n,m.paused]);return i.jsx(Se.div,{tabIndex:-1,...o,ref:p,onKeyDown:y})});Cf.displayName=CL;function zL(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ua(n,{select:t}),document.activeElement!==r)return}function EL(e){const t=xC(e),r=d0(t,e),n=d0(t.reverse(),e);return[r,n]}function xC(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function d0(e,t){for(const r of e)if(!PL(r,{upTo:t}))return r}function PL(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function TL(e){return e instanceof HTMLInputElement&&"select"in e}function ua(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&TL(e)&&t&&e.select()}}var u0=RL();function RL(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=h0(e,t),e.unshift(t)},remove(t){var r;e=h0(e,t),(r=e[0])==null||r.resume()}}}function h0(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function OL(e){return e.filter(t=>t.tagName!=="A")}var Bp=0;function Uv(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??f0()),document.body.insertAdjacentElement("beforeend",e[1]??f0()),Bp++,()=>{Bp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Bp--}},[])}function f0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.
vendor: 4,904 bytes, lines 505-520
505style.position="fixed",e.style.pointerEvents="none",e}var Nu="right-scroll-bar-position",Su="width-before-scroll-bar",AL="with-scroll-bars-hidden",DL="--removed-body-scroll-bar-size";function Wp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function IL(e,t){var r=f.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var ML=typeof window<"u"?f.useLayoutEffect:f.useEffect,p0=new WeakMap;function FL(e,t){var r=IL(null,function(n){return e.forEach(function(s){return Wp(s,n)})});return ML(function(){var n=p0.get(r);if(n){var s=new Set(n),a=new Set(e),o=r.current;s.forEach(function(l){a.has(l)||Wp(l,null)}),a.forEach(function(l){s.has(l)||Wp(l,o)})}p0.set(r,e)},[e]),r}function $L(e){return e}function LL(e,t){t===void 0&&(t=$L);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var o=t(a,n);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(n=!0;r.length;){var o=r;r=[],o.forEach(a)}r={push:function(l){return a(l)},filter:function(){return r}}},assignMedium:function(a){n=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(a),o=r}var c=function(){var u=o;o=[],u.forEach(a)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){o.push(u),d()},filter:function(u){return o=o.filter(u),r}}}};return s}function UL(e){e===void 0&&(e={});var t=LL(null);return t.options=gn({async:!0,ssr:!1},e),t}var bC=function(e){var t=e.sideCar,r=Ja(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return f.createElement(n,gn({},r))};bC.isSideCarExport=!0;function BL(e,t){return e.useMedium(t),bC}var _C=UL(),Vp=function(){},zf=f.forwardRef(function(e,t){var r=f.useRef(null),n=f.useState({onScrollCapture:Vp,onWheelCapture:Vp,onTouchMoveCapture:Vp}),s=n[0],a=n[1],o=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,h=e.shards,p=e.sideCar,m=e.noRelative,y=e.noIsolation,g=e.inert,x=e.allowPinchZoom,b=e.as,v=b===void 0?"div":b,w=e.gapMode,_=Ja(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=p,k=FL([r,t]),N=gn(gn({},_),s);return f.createElement(f.Fragment,null,u&&f.createElement(j,{sideCar:_C,removeScrollBar:d,shards:h,noRelative:m,noIsolation:y,inert:g,setCallbacks:a,allowPinchZoom:!!x,lockRef:r,gapMode:w}),o?f.cloneElement(f.Children.only(l),gn(gn({},N),{ref:k})):f.createElement(v,gn({},N,{className:c,ref:k}),l))});zf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};zf.classNames={fullWidth:Su,zeroRight:Nu};var WL=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function VL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=WL();return t&&e.setAttribute("nonce",t),e}function qL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function HL(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var KL=function(){var e=0,t=null;return{add:function(r){e==0&&(t=VL())&&(qL(t,r),HL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ZL=function(){var e=KL();return function(t,r){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},jC=function(){var e=ZL(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},GL={left:0,top:0,right:0,gap:0},qp=function(e){return parseInt(e||"",10)||0},QL=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[qp(r),qp(n),qp(s)]},YL=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return GL;var t=QL(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},JL=jC(),Vo="data-scroll-locked",XL=function(e,t,r,n){var s=e.left,a=e.top,o=e.right,l=e.gap;return r===void 0&&(r="margin"),`
506  .`.concat(AL,` {
507   overflow: hidden `).concat(n,`;
508   padding-right: `).concat(l,"px ").concat(n,`;
509  }
510  body[`).concat(Vo,`] {
511    overflow: hidden `).concat(n,`;
512    overscroll-behavior: contain;
513    `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
514    padding-left: `.concat(s,`px;
515    padding-top: `).concat(a,`px;
516    padding-right: `).concat(o,`px;
517    margin-left:0;
518    margin-top:0;
519    margin-right: `).concat(l,"px ").concat(n,`;
520    `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";
520")].filter(Boolean).join(""),`
521  }
522  
523  .`).concat(Nu,` {
524    right: `).concat(l,"px ").concat(n,`;
525  }
526  
527  .`).concat(Su,` {
528    margin-right: `).concat(l,"px ").concat(n,`;
529  }
530  
531  .`).concat(Nu," .").concat(Nu,` {
532    right: 0 `).concat(n,`;
533  }
534  
535  .`).concat(Su," .").concat(Su,` {
536    margin-right: 0 `).concat(n,`;
537  }
538  
539  body[`).concat(Vo,`] {
540    `).concat(DL,": ").concat(l,`px;
541  }
542`)},m0=function(){var e=parseInt(document.body.getAttribute(Vo)||"0",10);return isFinite(e)?e:0},e5=function(){f.useEffect(function(){return document.body.setAttribute(Vo,(m0()+1).toString()),function(){var e=m0()-1;e<=0?document.body.removeAttribute(Vo):document.body.setAttribute(Vo,e.toString())}},[])},t5=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;e5();var a=f.useMemo(function(){return YL(s)},[s]);return f.createElement(JL,{styles:XL(a,!t,s,r?"":"!important")})},Fg=!1;if(typeof window<"u")try{var iu=Object.defineProperty({},"passive",{get:function(){return Fg=!0,!0}});window.addEventListener("test",iu,iu),window.removeEventListener("test",iu,iu)}catch{Fg=!1}var oo=Fg?{passive:!1}:!1,r5=function(e){return e.tagName==="TEXTAREA"},kC=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!r5(e)&&r[t]==="visible")},n5=function(e){return kC(e,"overflowY")},s5=function(e){return kC(e,"overflowX")},g0=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=NC(e,n);if(s){var a=SC(e,n),o=a[1],l=a[2];if(o>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},a5=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},i5=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},NC=function(e,t){return e==="v"?n5(t):s5(t)},SC=function(e,t){return e==="v"?a5(t):i5(t)},o5=function(e,t){return e==="h"&&t==="rtl"?-1:1},l5=function(e,t,r,n,s){var a=o5(e,window.getComputedStyle(t).direction),o=a*n,l=r.target,c=t.contains(l),d=!1,u=o>0,h=0,p=0;do{if(!l)break;var m=SC(e,l),y=m[0],g=m[1],x=m[2],b=g-x-a*y;(y||b)&&NC(e,l)&&(h+=b,p+=y);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&(Math.abs(h)<1||!s)||!u&&(Math.abs(p)<1||!s))&&(d=!0),d},ou=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},y0=function(e){return[e.deltaX,e.deltaY]},v0=function(e){return e&&"current"in e?e.current:e},c5=function(e,t){return e[0]===t[0]&&e[1]===t[1]},d5=function(e){return`
543  .block-interactivity-`.concat(e,` {pointer-events: none;}
544  .allow-interactivity-`).concat(e,` {pointer-events: all;}
545`)},u5=0,lo=[];function h5(e){var t=f.useRef([]),r=f.useRef([0,0]),n=f.useRef(),s=f.useState(u5++)[0],a=f.useState(jC)[0],o=f.useRef(e);f.useEffect(function(){o.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=bv([e.lockRef.current],(e.shards||[]).map(v0),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=f.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var b=ou(g),v=r.current,w="deltaX"in g?g.deltaX:v[0]-b[0],_="deltaY"in g?g.deltaY:v[1]-b[1],j,k=g.target,N=Math.abs(w)>Math.abs(_)?"h":"v";if("touches"in g&&N==="h"&&k.type==="range")return!1;var P=g0(N,k);if(!P)return!0;if(P?j=N:(j=N==="v"?"h":"v",P=g0(N,k)),!P)return!1;if(!n.current&&"changedTouches"in g&&(w||_)&&(n.current=j),!j)return!0;var T=n.current||j;return l5(T,x,g,T==="h"?w:_,!0)},[]),c=f.useCallback(function(g){var x=g;if(!(!lo.length||lo[lo.length-1]!==a)){var b="deltaY"in x?y0(x):ou(x),v=t.current.filter(function(j){return j.name===x.type&&(j.target===x.target||x.target===j.shadowParent)&&c5(j.delta,b)})[0];if(v&&v.should){x.cancelable&&x.preventDefault();return}
vendor: 4,333 bytes, line 545
545if(!v){var w=(o.current.shards||[]).map(v0).filter(Boolean).filter(function(j){return j.contains(x.target)}),_=w.length>0?l(x,w[0]):!o.current.noIsolation;_&&x.cancelable&&x.preventDefault()}}},[]),d=f.useCallback(function(g,x,b,v){var w={name:g,delta:x,target:b,should:v,shadowParent:f5(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(_){return _!==w})},1)},[]),u=f.useCallback(function(g){r.current=ou(g),n.current=void 0},[]),h=f.useCallback(function(g){d(g.type,y0(g),g.target,l(g,e.lockRef.current))},[]),p=f.useCallback(function(g){d(g.type,ou(g),g.target,l(g,e.lockRef.current))},[]);f.useEffect(function(){return lo.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",c,oo),document.addEventListener("touchmove",c,oo),document.addEventListener("touchstart",u,oo),function(){lo=lo.filter(function(g){return g!==a}),document.removeEventListener("wheel",c,oo),document.removeEventListener("touchmove",c,oo),document.removeEventListener("touchstart",u,oo)}},[]);var m=e.removeScrollBar,y=e.inert;return f.createElement(f.Fragment,null,y?f.createElement(a,{styles:d5(s)}):null,m?f.createElement(t5,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function f5(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const p5=BL(_C,h5);var Ef=f.forwardRef(function(e,t){return f.createElement(zf,gn({},e,{ref:t,sideCar:p5}))});Ef.classNames=zf.classNames;var m5=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},co=new WeakMap,lu=new WeakMap,cu={},Hp=0,CC=function(e){return e&&(e.host||CC(e.parentNode))},g5=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=CC(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},y5=function(e,t,r,n){var s=g5(t,Array.isArray(e)?e:[e]);cu[r]||(cu[r]=new WeakMap);var a=cu[r],o=[],l=new Set,c=new Set(s),d=function(h){!h||l.has(h)||(l.add(h),d(h.parentNode))};s.forEach(d);var u=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(p){if(l.has(p))u(p);else try{var m=p.getAttribute(n),y=m!==null&&m!=="false",g=(co.get(p)||0)+1,x=(a.get(p)||0)+1;co.set(p,g),a.set(p,x),o.push(p),g===1&&y&&lu.set(p,!0),x===1&&p.setAttribute(r,"true"),y||p.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",p,b)}})};return u(t),l.clear(),Hp++,function(){o.forEach(function(h){var p=co.get(h)-1,m=a.get(h)-1;co.set(h,p),a.set(h,m),p||(lu.has(h)||h.removeAttribute(n),lu.delete(h)),m||h.removeAttribute(r)}),Hp--,Hp||(co=new WeakMap,co=new WeakMap,lu=new WeakMap,cu={})}},Bv=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=m5(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),y5(n,s,r,"aria-hidden")):function(){return null}},Pf="Dialog",[zC,EC]=dn(Pf),[v5,ss]=zC(Pf),PC=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:a,modal:o=!0}=e,l=f.useRef(null),c=f.useRef(null),[d,u]=jn({prop:n,defaultProp:s??!1,onChange:a,caller:Pf});return i.jsx(v5,{scope:t,triggerRef:l,contentRef:c,contentId:cr(),titleId:cr(),descriptionId:cr(),open:d,onOpenChange:u,onOpenToggle:f.useCallback(()=>u(h=>!h),[u]),modal:o,children:r})};PC.displayName=Pf;var TC="DialogTrigger",RC=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ss(TC,r),a=tt(t,s.triggerRef);return i.jsx(Se.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":qv(s.open),...n,ref:a,onClick:ke(e.onClick,s.onOpenToggle)})});RC.displayName=TC;var Wv="DialogPortal",[w5,OC]=zC(Wv,{forceMount:void 0}),AC=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,a=ss(Wv,t);return i.jsx(w5,{scope:t,forceMount:r,children:f.Children.map(n,o=>i.jsx(ts,{present:r||a.open,children:i.jsx(cd,{asChild:!0,container:s,children:o})}))})};AC.displayName=Wv;var kh="DialogOverlay",DC=f.forwardRef((e,t)=>{const r=OC(kh,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,a=ss(kh,e.__scopeDialog);return a.modal?i.jsx(ts,{present:n||a.open,children:i.jsx(b5,{...s,ref:t})}):null});DC.displayName=kh;var x5=Di("DialogOverlay.RemoveScroll"),b5=f.forwardRef((e,t)=>
vendor: 4,972 bytes, lines 545-549
545{const{__scopeDialog:r,...n}=e,s=ss(kh,r);return i.jsx(Ef,{as:x5,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(Se.div,{"data-state":qv(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Ui="DialogContent",IC=f.forwardRef((e,t)=>{const r=OC(Ui,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,a=ss(Ui,e.__scopeDialog);return i.jsx(ts,{present:n||a.open,children:a.modal?i.jsx(_5,{...s,ref:t}):i.jsx(j5,{...s,ref:t})})});IC.displayName=Ui;var _5=f.forwardRef((e,t)=>{const r=ss(Ui,e.__scopeDialog),n=f.useRef(null),s=tt(t,r.contentRef,n);return f.useEffect(()=>{const a=n.current;if(a)return Bv(a)},[]),i.jsx(MC,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ke(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:ke(e.onFocusOutside,a=>a.preventDefault())})}),j5=f.forwardRef((e,t)=>{const r=ss(Ui,e.__scopeDialog),n=f.useRef(!1),s=f.useRef(!1);return i.jsx(MC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),a.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:a=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((d=r.triggerRef.current)==null?void 0:d.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),MC=f.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:a,...o}=e,l=ss(Ui,r),c=f.useRef(null),d=tt(t,c);return Uv(),i.jsxs(i.Fragment,{children:[i.jsx(Cf,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(kl,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":qv(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(N5,{titleId:l.titleId}),i.jsx(C5,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Vv="DialogTitle",FC=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ss(Vv,r);return i.jsx(Se.h2,{id:s.titleId,...n,ref:t})});FC.displayName=Vv;var $C="DialogDescription",LC=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ss($C,r);return i.jsx(Se.p,{id:s.descriptionId,...n,ref:t})});LC.displayName=$C;var UC="DialogClose",BC=f.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=ss(UC,r);return i.jsx(Se.button,{type:"button",...n,ref:t,onClick:ke(e.onClick,()=>s.onOpenChange(!1))})});BC.displayName=UC;function qv(e){return e?"open":"closed"}var WC="DialogTitleWarning",[k5,VC]=AR(WC,{contentName:Ui,titleName:Vv,docsSlug:"dialog"}),N5=({titleId:e})=>{const t=VC(WC),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
546
547If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
548
549For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},S5="DialogDescriptionWarning",C5=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${VC(S5).contentName}}.`;return f.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Tf=PC,qC=RC,Rf=AC,Dl=DC,Il=IC,gd=FC,yd=LC,Of=BC;const z5=Tf,E5=Rf,HC=f.forwardRef(({className:e,...t},r)=>i.jsx(Dl,{className:J("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));HC.displayName=Dl.displayName;const P5=Ji("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),KC=f.forwardRef(({side:e="right",className:t,children:r,...n},s)=>i.jsxs(E5,{children:[i.jsx(HC,{}),i.jsxs(Il,{ref:s,className:J(P5({side:e}),t),...n,children:[r,i.jsxs(Of,{className:"absolute right-4 top-4 roun
549ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[i.jsx(Ks,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));KC.displayName=Il.displayName;const T5=f.forwardRef(({className:e,...t},r)=>i.jsx(gd,{ref:r,className:J("text-lg font-semibold text-foreground",e),...t}));T5.displayName=gd.displayName;const R5=f.forwardRef(({className:e,...t},r)=>i.jsx(yd,{ref:r,className:J("text-sm text-muted-foreground",e),...t}));R5.displayName=yd.displayName;function hi({className:e,...t}){return i.jsx("div",{className:J("animate-pulse rounded-md bg-muted",e),...t})}const O5="sidebar:state",A5=60*60*24*7,D5="16rem",I5="18rem",M5="3rem",F5="b",ZC=f.createContext(null);function vd(){const e=f.useContext(ZC);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const GC=f.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:s,children:a,...o},l)=>{const c=jL(),[d,u]=f.useState(!1),[h,p]=f.useState(e),m=t??h,y=f.useCallback(v=>{const w=typeof v=="function"?v(m):v;r?r(w):p(w),document.cookie=`${O5}=${w}; path=/; max-age=${A5}`},[r,m]),g=f.useCallback(()=>c?u(v=>!v):y(v=>!v),[c,y,u]);f.useEffect(()=>{const v=w=>{w.key===F5&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),g())};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[g]);const x=m?"expanded":"collapsed",b=f.useMemo(()=>({state:x,open:m,setOpen:y,isMobile:c,openMobile:d,setOpenMobile:u,toggleSidebar:g}),[x,m,y,c,d,u,g]);return i.jsx(ZC.Provider,{value:b,children:i.jsx(pv,{delayDuration:0,children:i.jsx("div",{style:{"--sidebar-width":D5,"--sidebar-width-icon":M5,...s},className:J("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:l,...o,children:a})})})});GC.displayName="SidebarProvider";const QC=f.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:s,...a},o)=>{const{isMobile:l,state:c,openMobile:d,setOpenMobile:u}=vd();return r==="none"?i.jsx("div",{className:J("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:o,...a,children:s}):l?i.jsx(z5,{open:d,onOpenChange:u,...a,children:i.jsx(KC,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":I5},side:e,children:i.jsx("div",{className:"flex h-full w-full flex-col",children:s})})}):i.jsxs("div",{ref:o,className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?r:"","data-variant":t,"data-side":e,children:[i.jsx("div",{className:J("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),i.jsx("div",{className:J("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...a,children:i.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:s})})]})});QC.displayName="Sidebar";const YC=f.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:s}=vd();return i.jsxs(G,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:J("h-7 w-7",e),onClick:a=>{t==null||t(a),s()},...r,children:[i.jsx($O,{}),i.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});YC.displayName="SidebarTrigger";const $5=f.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=vd();return i.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:J("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 hover:after:bg-sidebar-border sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});$5.displayName="SidebarRail";const JC=f.forwardRef(({className:e,...t},r)=>i.jsx("main",{ref:r,className:J("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-
549h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));JC.displayName="SidebarInset";const L5=f.forwardRef(({className:e,...t},r)=>i.jsx(Pe,{ref:r,"data-sidebar":"input",className:J("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));L5.displayName="SidebarInput";const XC=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"header",className:J("flex flex-col gap-2 p-2",e),...t}));XC.displayName="SidebarHeader";const ez=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"footer",className:J("flex flex-col gap-2 p-2",e),...t}));ez.displayName="SidebarFooter";const U5=f.forwardRef(({className:e,...t},r)=>i.jsx(ir,{ref:r,"data-sidebar":"separator",className:J("mx-2 w-auto bg-sidebar-border",e),...t}));U5.displayName="SidebarSeparator";const tz=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"content",className:J("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));tz.displayName="SidebarContent";const rz=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"group",className:J("relative flex w-full min-w-0 flex-col p-2",e),...t}));rz.displayName="SidebarGroup";const nz=f.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const s=t?Yi:"div";return i.jsx(s,{ref:n,"data-sidebar":"group-label",className:J("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});nz.displayName="SidebarGroupLabel";const B5=f.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const s=t?Yi:"button";return i.jsx(s,{ref:n,"data-sidebar":"group-action",className:J("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...r})});B5.displayName="SidebarGroupAction";const sz=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"group-content",className:J("w-full text-sm",e),...t}));sz.displayName="SidebarGroupContent";const az=f.forwardRef(({className:e,...t},r)=>i.jsx("ul",{ref:r,"data-sidebar":"menu",className:J("flex w-full min-w-0 flex-col gap-1",e),...t}));az.displayName="SidebarMenu";const iz=f.forwardRef(({className:e,...t},r)=>i.jsx("li",{ref:r,"data-sidebar":"menu-item",className:J("group/menu-item relative",e),...t}));iz.displayName="SidebarMenuItem";const W5=Ji("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),oz=f.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:s,className:a,...o},l)=>{const c=e?Yi:"button",{isMobile:d,state:u}=vd(),h=i.jsx(c,{ref:l,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:J(W5({variant:r,size:n}),a),...o});return s?(typeof s=="string"&&(s={children:s}),i.jsxs(J1,{children:[i.jsx(X1,{asChild:!0,children:h}),i.jsx(mv,{side:"right",align:"center",hidden:u!=="collapsed"||d,...s})]})):h});oz.displayName="SidebarMenuButton";const V5=f.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},s)=>{const a=t?Yi:"button";return i.jsx(a,{ref:s,"data-sidebar":"menu-action",className:J("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n})});V5.displayName="SidebarMenuAction";const q5=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:J("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));q5.displayName="SidebarMenuBadge";const H5=f.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const s=f.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return i.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:J("flex h-8 items-center gap-2 rounded-md px-2",e),...r,children:[t&&i.jsx(hi,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),i.jsx(hi,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})});H5.displayName="SidebarMenuSkeleton";const K5=f.forwardRef(({className:e,...t},r)=>i.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:J("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));K5.displayName="SidebarMenuSub";const Z5=f.forwardRef(({...e},t)=>i.jsx("li",{ref:t,...e}));Z5.displayName="SidebarMenuSubItem";const G5=f.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...s},a)=>{const o=e?Yi:"a";return i.jsx(o,{ref:a,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:J("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...s})});G5.displayName="SidebarMenuSubButton";const lz=f.forwardRef(({className:e,activeClassName:t,pendingClassName:r,to:n,...s},a)=>i.jsx(vM,{ref:a,to:n,className:({isActive:o,isPending:l})=>J(e,o&&t,l&&r),...s}));
549lz.displayName="NavLink";var wd=e=>e.type==="checkbox",yi=e=>e instanceof Date,Nr=e=>e==null;const cz=e=>typeof e=="object";var Vt=e=>!Nr(e)&&!Array.isArray(e)&&cz(e)&&!yi(e),dz=e=>Vt(e)&&e.target?wd(e.target)?e.target.checked:e.target.value:e,Q5=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,uz=(e,t)=>e.has(Q5(t)),Y5=e=>{const t=e.constructor&&e.constructor.prototype;return Vt(t)&&t.hasOwnProperty("isPrototypeOf")},Hv=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Yt(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Hv&&(e instanceof Blob||n))&&(r||Vt(e)))if(t=r?[]:{},!r&&!Y5(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=Yt(e[s]));else return e;return t}var Af=e=>/^\w*$/.test(e),Bt=e=>e===void 0,Kv=e=>Array.isArray(e)?e.filter(Boolean):[],Zv=e=>Kv(e.replace(/["|']|\]/g,"").split(/\.|\[/)),fe=(e,t,r)=>{if(!t||!Vt(e))return r;const n=(Af(t)?[t]:Zv(t)).reduce((s,a)=>Nr(s)?s:s[a],e);return Bt(n)||n===e?Bt(e[t])?r:e[t]:n},Qr=e=>typeof e=="boolean",ht=(e,t,r)=>{let n=-1;const s=Af(t)?[t]:Zv(t),a=s.length,o=a-1;for(;++n<a;){const l=s[n];let c=r;if(n!==o){const d=e[l];c=Vt(d)||Array.isArray(d)?d:isNaN(+s[n+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=c,e=e[l]}};const Nh={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Bn={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Es={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Gv=U.createContext(null);Gv.displayName="HookFormContext";const Df=()=>U.useContext(Gv),J5=e=>{const{children:t,...r}=e;return U.createElement(Gv.Provider,{value:r},t)};var hz=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(s,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Bn.all&&(t._proxyFormState[o]=!n||Bn.all),r&&(r[o]=!0),e[o]}});return s};const Qv=typeof window<"u"?U.useLayoutEffect:U.useEffect;function X5(e){const t=Df(),{control:r=t.control,disabled:n,name:s,exact:a}=e||{},[o,l]=U.useState(r._formState),c=U.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Qv(()=>r._subscribe({name:s,formState:c.current,exact:a,callback:d=>{!n&&l({...r._formState,...d})}}),[s,n,a]),U.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),U.useMemo(()=>hz(o,r,c.current,!1),[o,r])}var ps=e=>typeof e=="string",fz=(e,t,r,n,s)=>ps(e)?(n&&t.watch.add(e),fe(r,e,s)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),fe(r,a))):(n&&(t.watchAll=!0),r),$g=e=>Nr(e)||!cz(e);function Ms(e,t,r=new WeakSet){if($g(e)||$g(t))return e===t;if(yi(e)&&yi(t))return e.getTime()===t.getTime();const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of n){const o=e[a];if(!s.includes(a))return!1;if(a!=="ref"){const l=t[a];if(yi(o)&&yi(l)||Vt(o)&&Vt(l)||Array.isArray(o)&&Array.isArray(l)?!Ms(o,l,r):o!==l)return!1}}return!0}function e8(e){const t=Df(),{control:r=t.control,name:n,defaultValue:s,disabled:a,exact:o,compute:l}=e||{},c=U.useRef(s),d=U.useRef(l),u=U.useRef(void 0);d.current=l;const h=U.useMemo(()=>r._getWatch(n,c.current),[r,n]),[p,m]=U.useState(d.current?d.current(h):h);return Qv(()=>r._subscribe({name:n,formState:{values:!0},exact:o,callback:y=>{if(!a){const g=fz(n,r._names,y.values||r._formValues,!1,c.current);if(d.current){const x=d.current(g);Ms(x,u.current)||(m(x),u.current=x)}else m(g)}}}),[r,a,n,o]),U.useEffect(()=>r._removeUnmounted()),p}function t8(e){const t=Df(),{name:r,disabled:n,control:s=t.control,shouldUnregister:a,defaultValue:o}=e,l=uz(s._names.array,r),c=U.useMemo(()=>fe(s._formValues,r,fe(s._defaultValues,r,o)),[s,r,o]),d=e8({control:s,name:r,defaultValue:c,exact:!0}),u=X5({control:s,name:r,exact:!0}),h=U.useRef(e),p=U.useRef(s.register(r,{...e.rules,value:d,...Qr(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const m=U.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!fe(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!fe(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!fe(u.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!fe(u.validatingFields,r)},error:{enumerable:!0,get:()=>fe(u.errors,r)}}),[u,r]),y=U.useCallback(v=>p.current.onChange({target:{value:dz(v),name:r},type:Nh.CHANGE}),[r]),g=U.useCallback(()=>p.current.onBlur({target:{value:fe(s._formValues,r),name:r},type:Nh.BLUR}),[r,s._formValues]),x=U.useCallback(v=>{const w=fe(s._fields,r);w&&v&&(w._f.ref={focus:()=>v.focus&&v.focus(),select:()=>v.select&&v.select(),setCustomValidity:_=>v.setCustomValidity(_),reportValidity:()=>v.reportValidity()})},[s._fields,r]),b=U.useMemo(()=>({name:r,value:d,...Qr(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:y,onBlur:g,ref:x}),[r,n,u.disabled,y,g,x,d]);return U.useEffect(()=>{const v=s._options.shouldUnregister||a;s.register(r,{...h.current.rules,...Qr(h.current.disabled)?{disabled:h.current.disabled}:{}});const w=(_,j)=>{const k=fe(s._fields,_);k&&k._f&&(k._f.mount=j)};if(w(r,!0),v){const _=Yt(fe(s._options.defaultValues,r));ht(s._defaultValues,r,_),Bt(fe(s._formValues,r))&&ht(s._formValues,r,_)}return!l&&s.register(r),()=>{(l?v&&!s._state.action:v)?s.unregister(r):w(r,!1)}},[r,s,l,a]),U.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),U.useMemo(()=>({field:b,formState:u,fieldState:m}),[b,u,m])}const r8=e=>e.render(t8(e));var pz=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},yc=e=>Array.isArray(e)?e:[e],w0=()=>{let e=[];return{get observers(){return e},next:s=>{for(const a of e)a.next&&a.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(a=>a!==s)}}),unsubscribe:()=>{e=[]}}},Ir=e=>Vt(e)&&!Object.keys(e).length,Yv=e=>e.type==="file",Wn=e=>typeof e=="function",Sh=e=>{if(!Hv)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},mz=e=>e.type==="select-multiple",Jv=e=>e.type==="radio",n8=e=>Jv(e)||wd(e),Kp=e=>Sh(e)&&e.isConnected;function s8(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Bt(e)?n++:e[t[n++]];return e}function a8(e){for(const t in e)if(e.hasOwnProperty(t)&&!Bt(e[t]))return!1;return!0}function qt(e,t){const r=Array.isArray(t)?t:Af(t)?[t]:Zv(t),n=r.length===1?e:s8(e,r),s=r.length-1,a=r[s];return n&&delete n[a],s!==0&&(Vt(n)&&Ir(n)||Array.isArray(n)&&a8(n))&&qt(e,r.slice(0,-1)),e}var gz=e=>{for(const t in e)if(Wn(e[t]))return!0;return!1};function Ch(e,t={}){const r=Array.isArray(e);if(Vt(e)||r)for(const n in e)Array.isArray(e[n])||Vt(e[n])&&!gz(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Ch(e[n],t[n])):Nr(e[n])||(t[n]=!0);return t}function yz(e,t,r){const n=Array.isArray(e);
vendor: 8,730 bytes, line 549
549if(Vt(e)||n)for(const s in e)Array.isArray(e[s])||Vt(e[s])&&!gz(e[s])?Bt(t)||$g(r[s])?r[s]=Array.isArray(e[s])?Ch(e[s],[]):{...Ch(e[s])}:yz(e[s],Nr(t)?{}:t[s],r[s]):r[s]=!Ms(e[s],t[s]);return r}var Gl=(e,t)=>yz(e,t,Ch(t));const x0={value:!1,isValid:!1},b0={value:!0,isValid:!0};var vz=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Bt(e[0].attributes.value)?Bt(e[0].value)||e[0].value===""?b0:{value:e[0].value,isValid:!0}:b0:x0}return x0},wz=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Bt(e)?e:t?e===""?NaN:e&&+e:r&&ps(e)?new Date(e):n?n(e):e;const _0={isValid:!1,value:null};var xz=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,_0):_0;function j0(e){const t=e.ref;return Yv(t)?t.files:Jv(t)?xz(e.refs).value:mz(t)?[...t.selectedOptions].map(({value:r})=>r):wd(t)?vz(e.refs).value:wz(Bt(t.value)?e.ref.value:t.value,e)}var i8=(e,t,r,n)=>{const s={};for(const a of e){const o=fe(t,a);o&&ht(s,a,o._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},zh=e=>e instanceof RegExp,Ql=e=>Bt(e)?e:zh(e)?e.source:Vt(e)?zh(e.value)?e.value.source:e.value:e,k0=e=>({isOnSubmit:!e||e===Bn.onSubmit,isOnBlur:e===Bn.onBlur,isOnChange:e===Bn.onChange,isOnAll:e===Bn.all,isOnTouch:e===Bn.onTouched});const N0="AsyncFunction";var o8=e=>!!e&&!!e.validate&&!!(Wn(e.validate)&&e.validate.constructor.name===N0||Vt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===N0)),l8=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),S0=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const vc=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const a=fe(e,s);if(a){const{_f:o,...l}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],s)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(vc(l,t))break}else if(Vt(l)&&vc(l,t))break}}};function C0(e,t,r){const n=fe(e,r);if(n||Af(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const a=s.join("."),o=fe(t,a),l=fe(e,a);if(o&&!Array.isArray(o)&&r!==a)return{name:r};if(l&&l.type)return{name:a,error:l};if(l&&l.root&&l.root.type)return{name:`${a}.root`,error:l.root};s.pop()}return{name:r}}var c8=(e,t,r,n)=>{r(e);const{name:s,...a}=e;return Ir(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!n||Bn.all))},d8=(e,t,r)=>!e||!t||e===t||yc(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),u8=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,h8=(e,t)=>!Kv(fe(e,t)).length&&qt(e,t),f8=(e,t,r)=>{const n=yc(fe(e,r));return ht(n,"root",t[r]),ht(e,r,n),e},Cu=e=>ps(e);function z0(e,t,r="validate"){if(Cu(e)||Array.isArray(e)&&e.every(Cu)||Qr(e)&&!e)return{type:r,message:Cu(e)?e:"",ref:t}}var uo=e=>Vt(e)&&!zh(e)?e:{value:e,message:""},E0=async(e,t,r,n,s,a)=>{const{ref:o,refs:l,required:c,maxLength:d,minLength:u,min:h,max:p,pattern:m,validate:y,name:g,valueAsNumber:x,mount:b}=e._f,v=fe(r,g);if(!b||t.has(g))return{};const w=l?l[0]:o,_=M=>{s&&w.reportValidity&&(w.setCustomValidity(Qr(M)?"":M||""),w.reportValidity())},j={},k=Jv(o),N=wd(o),P=k||N,T=(x||Yv(o))&&Bt(o.value)&&Bt(v)||Sh(o)&&o.value===""||v===""||Array.isArray(v)&&!v.length,I=pz.bind(null,g,n,j),H=(M,L,F,Y=Es.maxLength,Q=Es.minLength)=>{const S=M?L:F;j[g]={type:M?Y:Q,message:S,ref:o,...I(M?Y:Q,S)}};if(a?!Array.isArray(v)||!v.length:c&&(!P&&(T||Nr(v))||Qr(v)&&!v||N&&!vz(l).isValid||k&&!xz(l).isValid)){const{value:M,message:L}=Cu(c)?{value:!!c,message:c}:uo(c);if(M&&(j[g]={type:Es.required,message:L,ref:w,...I(Es.required,L)},!n))return _(L),j}if(!T&&(!Nr(h)||!Nr(p))){let M,L;const F=uo(p),Y=uo(h);if(!Nr(v)&&!isNaN(v)){const Q=o.valueAsNumber||v&&+v;Nr(F.value)||(M=Q>F.value),Nr(Y.value)||(L=Q<Y.value)}else{const Q=o.valueAsDate||new Date(v),S=B=>new Date(new Date().toDateString()+" "+B),z=o.type=="time",C=o.type=="week";ps(F.value)&&v&&(M=z?S(v)>S(F.value):C?v>F.value:Q>new Date(F.value)),ps(Y.value)&&v&&(L=z?S(v)<S(Y.value):C?v<Y.value:Q<new Date(Y.value))}if((M||L)&&(H(!!M,F.message,Y.message,Es.max,Es.min),!n))return _(j[g].message),j}if((d||u)&&!T&&(ps(v)||a&&Array.isArray(v))){const M=uo(d),L=uo(u),F=!Nr(M.value)&&v.length>+M.value,Y=!Nr(L.value)&&v.length<+L.value;if((F||Y)&&(H(F,M.message,L.message),!n))return _(j[g].message),j}if(m&&!T&&ps(v)){const{value:M,message:L}=uo(m);if(zh(M)&&!v.match(M)&&(j[g]={type:Es.pattern,message:L,ref:o,...I(Es.pattern,L)},!n))return _(L),j}if(y){if(Wn(y)){const M=await y(v,r),L=z0(M,w);if(L&&(j[g]={...L,...I(Es.validate,L.message)},!n))return _(L.message),j}else if(Vt(y)){let M={};for(const L in y){if(!Ir(M)&&!n)break;const F=z0(await y[L](v,r),w,L);F&&(M={...F,...I(L,F.message)},_(F.message),n&&(j[g]=M))}if(!Ir(M)&&(j[g]={ref:w,...M},!n))return j}}return _(!0),j};const p8={mode:Bn.onSubmit,reValidateMode:Bn.onChange,shouldFocusError:!0};function m8(e={}){let t={...p8,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:Wn(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=Vt(t.defaultValues)||Vt(t.values)?Yt(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:Yt(s),o={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let h={...u};const p={array:w0(),state:w0()},m=t.criteriaMode===Bn.all,y=E=>O=>{clearTimeout(d),d=setTimeout(E,O)},g=async E=>{if(!t.disabled&&(u.isValid||h.isValid||E)){const O=t.resolver?Ir((await N()).errors):await T(n,!0);O!==r.isValid&&p.state.next({isValid:O})}},x=(E,O)=>{!t.disabled&&(u.isValidating||u.validatingFields||h.isValidating||h.validatingFields)&&((E||Array.from(l.mount)).forEach(V=>{V&&(O?ht(r.validatingFields,V,O):qt(r.validatingFields,V))}),p.state.next({validatingFields:r.validatingFields,isValidating:!Ir(r.validatingFields)}))},b=(E,O=[],V,D,K=!0,R=!0)=>{if(D&&V&&!t.disabled){if(o.action=!0,R&&Array.isArray(fe(n,E))){const W=V(fe(n,E),D.argA,D.argB);K&&ht(n,E,W)}if(R&&Array.isArray(fe(r.errors,E))){const W=V(fe(r.errors,E),D.argA,D.argB);K&&ht(r.errors,E,W),h8(r.errors,E)}if((u.touchedFields||h.touchedFields)&&R&&Array.isArray(fe(r.touchedFields,E))){const W=V(fe(r.touchedFields,E),D.argA,D.argB);K&&ht(r.touchedFields,E,W)}(u.dirtyFields||h.dirtyFields)&&(r.dirtyFields=Gl(s,a)),p.state.next({name:E,isDirty:H(E,O),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ht(a,E,O)},v=(E,O)=>{ht(r.errors,E,O),p.state.next({errors:r.errors})},w=E=>{r.errors=E,p.state.next({errors:r.errors,isValid:!1})},_=(E,O,V,D)=>{const K=fe(n,E);if(K){const R=fe(a,E,Bt(V)?fe(s,E):V);Bt(R)||D&&D.defaultChecked||O?ht(a,E,O?R:j0(K._f)):F(E,R),o.mount&&g()}},j=(E,O,V,D,K)=>{let R=!1,W=!1;const se={name:E};if(!t.disabled){if(!V||D){(u.isDirty||h.isDirty)&&(W=r.isDirty,r.isDirty=se.isDirty=H(),R=W!==se.isDirty);const ye=Ms(fe(s,E),O);W=!!fe(r.dirtyFields,E),ye?qt(r.dirtyFields,E):ht(r.dirtyFields,E,!0),se.dirtyFields=r.dirtyFields,R=R||(u.dirtyFields||h.dirtyFields)&&W!==!ye}if(V){const ye=fe(r.touchedFields,E);ye||(ht(r.touchedFields,E,V),se.touchedFields=r.touchedFields,R=R||(u.touchedFields||h.touchedFields)&&ye!==V)}R&&K&&p.state.next(se)}return R?se:{}},k=(E,O,V,D)=>{const K=fe(r.errors,E),R=(u.isValid||h.isValid)&&Qr(O)&&r.isValid!==O;if(t.delayError&&V?(c=y(()=>v(E,V)),c(t.delayError)):(clearTimeout(d),c=null,V?ht(r.errors,E,V):qt(r.errors,E)),(V?!Ms(K,V):K)||!Ir(D)||R){const W={...D,...R&&Qr(O)?{isValid:O}:{},errors:r.errors,name:E};r={...r,...W},p.state.next(W)}},N=async E=>{x(E,!0);const O=await t.resolver(a,t.context,i8(E||l.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return x(E),O},P=async E=>{const{errors:O}=await N(E);if(E)for(const V of E){const D=fe(O,V);D?ht(r.errors,V,D):qt(r.errors,V)}else r.errors=O;return O},T=async(E,O,V={valid:!0})=>{for(const D in E){const K=E[D];if(K){const{_f:R,...W}=K;if(R){const se=l.array.has(R.name),ye=K._f&&o8(K._f);ye&&u.validatingFields&&x([D],!0);const ze=await E0(K,l.disabled,a,m,t.shouldUseNativeValidation&&!O,se);if(ye&&u.validatingFields&&x([D]),ze[R.name]&&(V.valid=!1,O))break;!O&&(fe(ze,R.name)?se?f8(r.errors,ze,R.name):ht(r.errors,R.name,ze[R.name]):qt(r.errors,R.name))}!Ir(W)&&await T(W,O,V)}}return V.valid},I=()=>{for(const E of l.unMount){const O=fe(n,E);O&&(O._f.refs?O._f.refs.every(V=>!Kp(V)):!Kp(O._f.ref))&&Z(E)}l.unMount=new Set},H=(E,O)=>
vendor: 10,625 bytes, line 549
549!t.disabled&&(E&&O&&ht(a,E,O),!Ms(B(),s)),M=(E,O,V)=>fz(E,l,{...o.mount?a:Bt(O)?s:ps(E)?{[E]:O}:O},V,O),L=E=>Kv(fe(o.mount?a:s,E,t.shouldUnregister?fe(s,E,[]):[])),F=(E,O,V={})=>{const D=fe(n,E);let K=O;if(D){const R=D._f;R&&(!R.disabled&&ht(a,E,wz(O,R)),K=Sh(R.ref)&&Nr(O)?"":O,mz(R.ref)?[...R.ref.options].forEach(W=>W.selected=K.includes(W.value)):R.refs?wd(R.ref)?R.refs.forEach(W=>{(!W.defaultChecked||!W.disabled)&&(Array.isArray(K)?W.checked=!!K.find(se=>se===W.value):W.checked=K===W.value||!!K)}):R.refs.forEach(W=>W.checked=W.value===K):Yv(R.ref)?R.ref.value="":(R.ref.value=K,R.ref.type||p.state.next({name:E,values:Yt(a)})))}(V.shouldDirty||V.shouldTouch)&&j(E,K,V.shouldTouch,V.shouldDirty,!0),V.shouldValidate&&C(E)},Y=(E,O,V)=>{for(const D in O){if(!O.hasOwnProperty(D))return;const K=O[D],R=E+"."+D,W=fe(n,R);(l.array.has(E)||Vt(K)||W&&!W._f)&&!yi(K)?Y(R,K,V):F(R,K,V)}},Q=(E,O,V={})=>{const D=fe(n,E),K=l.array.has(E),R=Yt(O);ht(a,E,R),K?(p.array.next({name:E,values:Yt(a)}),(u.isDirty||u.dirtyFields||h.isDirty||h.dirtyFields)&&V.shouldDirty&&p.state.next({name:E,dirtyFields:Gl(s,a),isDirty:H(E,R)})):D&&!D._f&&!Nr(R)?Y(E,R,V):F(E,R,V),S0(E,l)&&p.state.next({...r,name:E}),p.state.next({name:o.mount?E:void 0,values:Yt(a)})},S=async E=>{o.mount=!0;const O=E.target;let V=O.name,D=!0;const K=fe(n,V),R=ye=>{D=Number.isNaN(ye)||yi(ye)&&isNaN(ye.getTime())||Ms(ye,fe(a,V,ye))},W=k0(t.mode),se=k0(t.reValidateMode);if(K){let ye,ze;const et=O.type?j0(K._f):dz(E),at=E.type===Nh.BLUR||E.type===Nh.FOCUS_OUT,Nt=!l8(K._f)&&!t.resolver&&!fe(r.errors,V)&&!K._f.deps||u8(at,fe(r.touchedFields,V),r.isSubmitted,se,W),He=S0(V,l,at);ht(a,V,et),at?(K._f.onBlur&&K._f.onBlur(E),c&&c(0)):K._f.onChange&&K._f.onChange(E);const ct=j(V,et,at),Rt=!Ir(ct)||He;if(!at&&p.state.next({name:V,type:E.type,values:Yt(a)}),Nt)return(u.isValid||h.isValid)&&(t.mode==="onBlur"?at&&g():at||g()),Rt&&p.state.next({name:V,...He?{}:ct});if(!at&&He&&p.state.next({...r}),t.resolver){const{errors:dt}=await N([V]);if(R(et),D){const mt=C0(r.errors,n,V),Ft=C0(dt,n,mt.name||V);ye=Ft.error,V=Ft.name,ze=Ir(dt)}}else x([V],!0),ye=(await E0(K,l.disabled,a,m,t.shouldUseNativeValidation))[V],x([V]),R(et),D&&(ye?ze=!1:(u.isValid||h.isValid)&&(ze=await T(n,!0)));D&&(K._f.deps&&C(K._f.deps),k(V,ze,ye,ct))}},z=(E,O)=>{if(fe(r.errors,O)&&E.focus)return E.focus(),1},C=async(E,O={})=>{let V,D;const K=yc(E);if(t.resolver){const R=await P(Bt(E)?E:K);V=Ir(R),D=E?!K.some(W=>fe(R,W)):V}else E?(D=(await Promise.all(K.map(async R=>{const W=fe(n,R);return await T(W&&W._f?{[R]:W}:W)}))).every(Boolean),!(!D&&!r.isValid)&&g()):D=V=await T(n);return p.state.next({...!ps(E)||(u.isValid||h.isValid)&&V!==r.isValid?{}:{name:E},...t.resolver||!E?{isValid:V}:{},errors:r.errors}),O.shouldFocus&&!D&&vc(n,z,E?K:l.mount),D},B=E=>{const O={...o.mount?a:s};return Bt(E)?O:ps(E)?fe(O,E):E.map(V=>fe(O,V))},ce=(E,O)=>({invalid:!!fe((O||r).errors,E),isDirty:!!fe((O||r).dirtyFields,E),error:fe((O||r).errors,E),isValidating:!!fe(r.validatingFields,E),isTouched:!!fe((O||r).touchedFields,E)}),A=E=>{E&&yc(E).forEach(O=>qt(r.errors,O)),p.state.next({errors:E?r.errors:{}})},ee=(E,O,V)=>{const D=(fe(n,E,{_f:{}})._f||{}).ref,K=fe(r.errors,E)||{},{ref:R,message:W,type:se,...ye}=K;ht(r.errors,E,{...ye,...O,ref:D}),p.state.next({name:E,errors:r.errors,isValid:!1}),V&&V.shouldFocus&&D&&D.focus&&D.focus()},te=(E,O)=>Wn(E)?p.state.subscribe({next:V=>"values"in V&&E(M(void 0,O),V)}):M(E,O,!0),q=E=>p.state.subscribe({next:O=>{d8(E.name,O.name,E.exact)&&c8(O,E.formState||u,re,E.reRenderRoot)&&E.callback({values:{...a},...r,...O,defaultValues:s})}}).unsubscribe,he=E=>(o.mount=!0,h={...h,...E.formState},q({...E,formState:h})),Z=(E,O={})=>{for(const V of E?yc(E):l.mount)l.mount.delete(V),l.array.delete(V),O.keepValue||(qt(n,V),qt(a,V)),!O.keepError&&qt(r.errors,V),!O.keepDirty&&qt(r.dirtyFields,V),!O.keepTouched&&qt(r.touchedFields,V),!O.keepIsValidating&&qt(r.validatingFields,V),!t.shouldUnregister&&!O.keepDefaultValue&&qt(s,V);p.state.next({values:Yt(a)}),p.state.next({...r,...O.keepDirty?{isDirty:H()}:{}}),!O.keepIsValid&&g()},me=({disabled:E,name:O})=>{(Qr(E)&&o.mount||E||l.disabled.has(O))&&(E?l.disabled.add(O):l.disabled.delete(O))},ge=(E,O={})=>{let V=fe(n,E);const D=Qr(O.disabled)||Qr(t.disabled);return ht(n,E,{...V||{},_f:{...V&&V._f?V._f:{ref:{name:E}},name:E,mount:!0,...O}}),l.mount.add(E),V?me({disabled:Qr(O.disabled)?O.disabled:t.disabled,name:E}):_(E,!0,O.value),{...D?{disabled:O.disabled||t.disabled}:{},...t.progressive?{required:!!O.required,min:Ql(O.min),max:Ql(O.max),minLength:Ql(O.minLength),maxLength:Ql(O.maxLength),pattern:Ql(O.pattern)}:{},name:E,onChange:S,onBlur:S,ref:K=>{if(K){ge(E,O),V=fe(n,E);const R=Bt(K.value)&&K.querySelectorAll&&K.querySelectorAll("input,select,textarea")[0]||K,W=n8(R),se=V._f.refs||[];if(W?se.find(ye=>ye===R):R===V._f.ref)return;ht(n,E,{_f:{...V._f,...W?{refs:[...se.filter(Kp),R,...Array.isArray(fe(s,E))?[{}]:[]],ref:{type:R.type,name:E}}:{ref:R}}}),_(E,!1,void 0,R)}else V=fe(n,E,{}),V._f&&(V._f.mount=!1),(t.shouldUnregister||O.shouldUnregister)&&!(uz(l.array,E)&&o.action)&&l.unMount.add(E)}}},Ne=()=>t.shouldFocusError&&vc(n,z,l.mount),Ce=E=>{Qr(E)&&(p.state.next({disabled:E}),vc(n,(O,V)=>{const D=fe(n,V);D&&(O.disabled=D._f.disabled||E,Array.isArray(D._f.refs)&&D._f.refs.forEach(K=>{K.disabled=D._f.disabled||E}))},0,!1))},Oe=(E,O)=>async V=>{let D;V&&(V.preventDefault&&V.preventDefault(),V.persist&&V.persist());let K=Yt(a);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:R,values:W}=await N();r.errors=R,K=Yt(W)}else await T(n);if(l.disabled.size)for(const R of l.disabled)qt(K,R);if(qt(r.errors,"root"),Ir(r.errors)){p.state.next({errors:{}});try{await E(K,V)}catch(R){D=R}}else O&&await O({...r.errors},V),Ne(),setTimeout(Ne);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ir(r.errors)&&!D,submitCount:r.submitCount+1,errors:r.errors}),D)throw D},Xe=(E,O={})=>{fe(n,E)&&(Bt(O.defaultValue)?Q(E,Yt(fe(s,E))):(Q(E,O.defaultValue),ht(s,E,Yt(O.defaultValue))),O.keepTouched||qt(r.touchedFields,E),O.keepDirty||(qt(r.dirtyFields,E),r.isDirty=O.defaultValue?H(E,Yt(fe(s,E))):H()),O.keepError||(qt(r.errors,E),u.isValid&&g()),p.state.next({...r}))},oe=(E,O={})=>{const V=E?Yt(E):s,D=Yt(V),K=Ir(E),R=K?s:D;if(O.keepDefaultValues||(s=V),!O.keepValues){if(O.keepDirtyValues){const W=new Set([...l.mount,...Object.keys(Gl(s,a))]);for(const se of Array.from(W))fe(r.dirtyFields,se)?ht(R,se,fe(a,se)):Q(se,fe(R,se))}else{if(Hv&&Bt(E))for(const W of l.mount){const se=fe(n,W);if(se&&se._f){const ye=Array.isArray(se._f.refs)?se._f.refs[0]:se._f.ref;if(Sh(ye)){const ze=ye.closest("form");if(ze){ze.reset();break}}}}if(O.keepFieldsRef)for(const W of l.mount)Q(W,fe(R,W));else n={}}a=t.shouldUnregister?O.keepDefaultValues?Yt(s):{}:Yt(R),p.array.next({values:{...R}}),p.state.next({values:{...R}})}l={mount:O.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!u.isValid||!!O.keepIsValid||!!O.keepDirtyValues,o.watch=!!t.shouldUnregister,p.state.next({submitCount:O.keepSubmitCount?r.submitCount:0,isDirty:K?!1:O.keepDirty?r.isDirty:!!(O.keepDefaultValues&&!Ms(E,s)),isSubmitted:O.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:K?{}:O.keepDirtyValues?O.keepDefaultValues&&a?Gl(s,a):r.dirtyFields:O.keepDefaultValues&&E?Gl(s,E):O.keepDirty?r.dirtyFields:{},touchedFields:O.keepTouched?r.touchedFields:{},errors:O.keepErrors?r.errors:{},isSubmitSuccessful:O.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Ve=(E,O)=>oe(Wn(E)?E(a):E,O),Ue=(E,O={})=>{const V=fe(n,E),D=V&&V._f;if(D){const K=D.refs?D.refs[0]:D.ref;K.focus&&(K.focus(),O.shouldSelect&&Wn(K.select)&&K.select())}},re=E=>{r={...r,...E}},Te={control:{register:ge,unregister:Z,getFieldState:ce,handleSubmit:Oe,setError:ee,_subscribe:q,_runSchema:N,_focusError:Ne,_getWatch:M,_getDirty:H,_setValid:g,_setFieldArray:b,_setDisabledField:me,_setErrors:w,_getFieldArray:L,_reset:oe,_resetDefaultValues:()=>Wn(t.defaultValues)&&t.defaultValues().then(E=>{Ve(E,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:I,_disableForm:Ce,_subjects:p,_proxyFormState:u,get _fields(){return n},get _formValues(){return a},get _state(){return o},set _state(E){o=E},get _defaultValues(){return s},get _names(){return l},set _names(E){l=E},get _formState(){return r},get _options(){return t},set _options(E){t={...t,...E}}},subscribe:he,trigger:C,register:ge,handleSubmit:Oe,watch:te,setValue:Q,getValues:B,reset:Ve,resetField:Xe,clearErrors:A,unregister:Z,setError:ee,setFocus:Ue,getFieldState:ce};return{...Te,formControl:Te}}function g8(e={}){const t=U.useRef(void 0),r=U.useRef(void 0),[n,s]=U.useState({isDirty:!1,isValidating:!1,isLoading:Wn(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Wn(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!Wn(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...l}=m8(e);t.current={...l,formState:n}}const a=t.current.control;return a._options=e,Qv(()=>{const o=a._subscribe({formState:a._proxyFormState,callback:()=>s({...a._formState}),reRenderRoot:!0});return s(l=>({...l,isReady:!0})),a._formState.isReady=!0,o},[a]),U.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),U.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),U.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),U.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),U.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==n.isDirty&&a._subjects.state.next({isDirty:o})}},[a,n.isDirty]),U.useEffect(()=>{e.values&&!Ms(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),r.current=e.values,s(o=>({...o}))):a._resetDefaultValues()},[a,e.values]),U.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=hz(n,a),t.current}const P0=(e,t,r)=>{if(e&&"reportValidity"in e){const n=fe(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},bz=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?P0(n.ref,r,e):n.refs&&n.refs.forEac
vendor: 1,569 bytes, line 549
549h(s=>P0(s,r,e))}},y8=(e,t)=>{t.shouldUseNativeValidation&&bz(e,t);const r={};for(const n in e){const s=fe(t.fields,n),a=Object.assign(e[n]||{},{ref:s&&s.ref});if(v8(t.names||Object.keys(e),n)){const o=Object.assign({},fe(r,n));ht(o,"root",a),ht(r,n,o)}else ht(r,n,a)}return r},v8=(e,t)=>e.some(r=>r.startsWith(t+"."));var w8=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,a=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var l=n.unionErrors[0].errors[0];r[o]={message:l.message,type:l.code}}else r[o]={message:a,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(u){return u.errors.forEach(function(h){return e.push(h)})}),t){var c=r[o].types,d=c&&c[n.code];r[o]=pz(o,t,r,s,d?[].concat(d,n.message):n.message)}e.shift()}return r},x8=function(e,t,r){return r===void 0&&(r={}),function(n,s,a){try{return Promise.resolve(function(o,l){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(d){return a.shouldUseNativeValidation&&bz({},a),{errors:{},values:r.raw?n:d}})}catch(d){return l(d)}return c&&c.then?c.then(void 0,l):c}(0,function(o){if(function(l){return Array.isArray(l==null?void 0:l.errors)}(o))return{values:{},errors:y8(w8(o.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}}};const or=Tf,zi=qC,b8=Rf,_z=f.forwardRef(({className:e,...t},r)=>i.jsx(Dl,{ref:r,className:J("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));
549_z.displayName=Dl.displayName;const er=f.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(b8,{children:[i.jsx(_z,{}),i.jsxs(Il,{ref:n,className:J("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,i.jsxs(Of,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[i.jsx(Ks,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));er.displayName=Il.displayName;const tr=({className:e,...t})=>i.jsx("div",{className:J("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});tr.displayName="DialogHeader";const ms=({className:e,...t})=>i.jsx("div",{className:J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ms.displayName="DialogFooter";const rr=f.forwardRef(({className:e,...t},r)=>i.jsx(gd,{ref:r,className:J("text-lg font-semibold leading-none tracking-tight",e),...t}));rr.displayName=gd.displayName;const Vn=f.forwardRef(({className:e,...t},r)=>i.jsx(yd,{ref:r,className:J("text-sm text-muted-foreground",e),...t}));Vn.displayName=yd.displayName;const _8=J5,jz=f.createContext({}),Zp=({...e})=>i.jsx(jz.Provider,{value:{name:e.name},children:i.jsx(r8,{...e})}),If=()=>{const e=f.useContext(jz),t=f.useContext(kz),{getFieldState:r,formState:n}=Df(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...s}},kz=f.createContext({}),zu=f.forwardRef(({className:e,...t},r)=>{const n=f.useId();return i.jsx(kz.Provider,{value:{id:n},children:i.jsx("div",{ref:r,className:J("space-y-2",e),...t})})});zu.displayName="FormItem";const Eu=f.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=If();return i.jsx(ue,{ref:r,className:J(n&&"text-destructive",e),htmlFor:s,...t})});Eu.displayName="FormLabel";const Pu=f.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:a}=If();return i.jsx(Yi,{ref:t,id:n,"aria-describedby":r?`${s} ${a}`:`${s}`,"aria-invalid":!!r,...e})});Pu.displayName="FormControl";const j8=f.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=If();return i.jsx("p",{ref:r,id:n,className:J("text-sm text-muted-foreground",e),...t})});j8.displayName="FormDescription";const Tu=f.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:a}=If(),o=s?String(s==null?void 0:s.message):t;return o?i.jsx("p",{ref:n,id:a,className:J("text-sm font-medium text-destructive",e),...r,children:o}):null});Tu.displayName="FormMessage";const k8=md({paczkomatCode:vn().min(3,"Podaj prawidłowy kod paczkomatu"),phone:vn().min(9,"Podaj prawidłowy numer telefonu"),email:vn().email("Podaj prawidłowy adres email")});function N8({userId:e,defaultPhone:t,defaultEmail:r,isCollapsed:n,onClaimed:s}){const[a,o]=f.useState(!1),[l,c]=f.useState(!1),{toast:d}=Ar(),u=g8({resolver:x8(k8),defaultValues:{paczkomatCode:"",phone:t||"",email:r||""}}),h=async p=>{c(!0);try{const{error:m}=await ne.functions.invoke("send-notification-email",{body:{type:"sticker_pack_claim",paczkomatCode:p.paczkomatCode,phone:p.phone,email:p.email,userId:e}});m&&console.error("Error sending email:",m);const{error:y}=await ne.from("profiles").update({sticker_pack_claimed:!0}).eq("id",e);if(y)throw y;d({title:"Wniosek wysłany!",description:"Pakiet dotrze wkrótce."}),o(!1),s()}catch(m){console.error("Error claiming sticker pack:",m),d({title:"Błąd",description:"Nie udało się wysłać wniosku. Spróbuj ponownie.",variant:"destructive"})}finally{c(!1)}};return i.jsxs(or,{open:a,onOpenChange:o,children:[i.jsx(zi,{asChild:!0,children:i.jsxs(G,{variant:"ghost",className:"w-full justify-start gap-3 text-sidebar-foreground
549/80 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[i.jsx(a1,{className:"h-5 w-5 shrink-0 text-primary"}),!n&&i.jsx("span",{children:"Odbierz pakiet startowy"})]})}),i.jsxs(er,{className:"sm:max-w-md",children:[i.jsxs(tr,{children:[i.jsxs(rr,{className:"flex items-center gap-2",children:[i.jsx(cl,{className:"h-5 w-5 text-primary"}),"Odbierz darmowy pakiet naklejek"]}),i.jsx(Vn,{children:"Podaj dane do wysyłki. Pakiet 50 naklejek QR zostanie wysłany do wybranego paczkomatu InPost."})]}),i.jsx(_8,{...u,children:i.jsxs("form",{onSubmit:u.handleSubmit(h),className:"space-y-4",children:[i.jsx(Zp,{control:u.control,name:"paczkomatCode",render:({field:p})=>i.jsxs(zu,{children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(Eu,{children:"Paczkomat InPost (Kod) *"}),i.jsxs("a",{href:"https://inpost.pl/znajdz-paczkomat",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:["Znajdź paczkomat",i.jsx(Fc,{className:"h-3 w-3"})]})]}),i.jsx(Pu,{children:i.jsx(Pe,{placeholder:"np. WAW12A",...p})}),i.jsx(Tu,{})]})}),i.jsx(Zp,{control:u.control,name:"phone",render:({field:p})=>i.jsxs(zu,{children:[i.jsx(Eu,{children:"Numer telefonu *"}),i.jsx(Pu,{children:i.jsx(Pe,{placeholder:"np. 600123456",...p})}),i.jsx(Tu,{})]})}),i.jsx(Zp,{control:u.control,name:"email",render:({field:p})=>i.jsxs(zu,{children:[i.jsx(Eu,{children:"Adres email *"}),i.jsx(Pu,{children:i.jsx(Pe,{type:"email",placeholder:"[email protected]",...p})}),i.jsx(Tu,{})]})}),i.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[i.jsx(G,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Anuluj"}),i.jsx(G,{type:"submit",disabled:l,children:l?"Wysyłanie...":"Wyślij wniosek"})]})]})})]})]})}const S8=[{title:"Pulpit",url:"/dashboard",icon:IO},{title:"Zgłoszenia",url:"/tickets",icon:ll},{title:"Klienci",url:"/clients",icon:u1},{title:"Urządzenia",url:"/devices",icon:Ii}];function C8(){const{signOut:e,user:t}=qr(),{state:r}=vd(),n=r==="collapsed",s=Zt(),[a,o]=f.useState(null);f.useEffect(()=>{t&&l()},[t]);const l=async()=>{if(!t)return;const{data:u,error:h}=await ne.from("profiles").select("subscription_plan, sticker_pack_claimed, phone").eq("id",t.id).single();!h&&u&&o(u)},c=(a==null?void 0:a.subscription_plan)==="solo"&&!(a!=null&&a.sticker_pack_claimed),d=(a==null?void 0:a.subscription_plan)==="solo"&&(a==null?void 0:a.sticker_pack_claimed);return i.jsxs(QC,{collapsible:"icon",className:"border-r border-sidebar-border",children:[i.jsx(XC,{className:"border-b border-sidebar-border p-4",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-sidebar-primary",children:i.jsx(Er,{className:"h-5 w-5 text-sidebar-primary-foreground"})}),!n&&i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-lg font-bold text-sidebar-foreground",children:"QRserwis"}),i.jsx("span",{className:"text-xs text-sidebar-foreground/60",children:"Panel serwisanta"})]})]})}),i.jsx(tz,{className:"px-2 py-4",children:i.jsxs(rz,{children:[i.jsx(nz,{className:"text-sidebar-foreground/50 px-2 text-xs uppercase tracking-wider",children:!n&&"Menu główne"}),i.jsx(sz,{children:i.jsx(az,{children:S8.map(u=>i.jsx(iz,{children:i.jsx(oz,{asChild:!0,tooltip:u.title,children:i.jsxs(lz,{to:u.url,className:"flex items-center gap-3 rounded-lg px-3 py-2.5 text-sidebar-foreground/80 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",activeClassName:"bg-sidebar-accent text-sidebar-primary font-semibold",children:[i.jsx(u.icon,{className:"h-5 w-5 shrink-0"}),!n&&i.jsx("span",{children:u.title})]})})},u.title))})})]})}),i.jsxs(ez,{className:"border-t border-sidebar-border p-4",children:[!n&&t&&i.jsx("div",{className:"mb-3 truncate text-xs text-sidebar-foreground/60",children:t.email}),i.jsxs("div",{className:"flex flex-col gap-1",children:[c&&t&&i.jsx(N8,{userId:t.id,defaultPhone:a==null?void 0:a.phone,defaultEmail:t.email,isCollapsed:n,onClaimed:l}),d&&i.jsxs(G,{variant:"ghost",disabled:!0,className:"w-full justify-start gap-3 text-sidebar-foreground
549/50 cursor-default",children:[i.jsx(Xk,{className:"h-5 w-5 shrink-0 text-green-500"}),!n&&i.jsx("span",{children:"Pakiet odebrany"})]}),i.jsxs(G,{variant:"ghost",onClick:()=>s("/account"),className:"w-full justify-start gap-3 text-sidebar-foreground/80 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[i.jsx(PO,{className:"h-5 w-5 shrink-0"}),!n&&i.jsx("span",{children:"Konto"})]}),i.jsxs(G,{variant:"ghost",onClick:e,className:"w-full justify-start gap-3 text-sidebar-foreground/80 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[i.jsx(o1,{className:"h-5 w-5 shrink-0"}),!n&&i.jsx("span",{children:"Wyloguj się"})]})]})]})]})}function rt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Vr(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Sr(e,t){const r=rt(e);return isNaN(t)?Vr(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Jn(e,t){const r=rt(e);if(isNaN(t))return Vr(e,NaN);if(!t)return r;const n=r.getDate(),s=Vr(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const a=s.getDate();return n>=a?s:(r.setFullYear(s.getFullYear(),s.getMonth(),n),r)}const Xv=6048e5,z8=864e5;let E8={};function xd(){return E8}function kn(e,t){var l,c,d,u;const r=xd(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=rt(e),a=s.getDay(),o=(a<n?7:0)+a-n;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function Bi(e){return kn(e,{weekStartsOn:1})}function Nz(e){const t=rt(e),r=t.getFullYear(),n=Vr(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const s=Bi(n),a=Vr(e,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const o=Bi(a);return t.getTime()>=s.getTime()?r+1:t.getTime()>=o.getTime()?r:r-1}function wl(e){const t=rt(e);return t.setHours(0,0,0,0),t}function Eh(e){const t=rt(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function gs(e,t){const r=wl(e),n=wl(t),s=+r-Eh(r),a=+n-Eh(n);return Math.round((s-a)/z8)}function P8(e){const t=Nz(e),r=Vr(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),Bi(r)}function Lg(e,t){const r=t*7;return Sr(e,r)}function T8(e,t){return Jn(e,t*12)}function R8(e){let t;return e.forEach(function(r){const n=rt(r);(t===void 0||t<n||isNaN(Number(n)))&&(t=n)}),t||new Date(NaN)}function O8(e){let t;return e.forEach(r=>{const n=rt(r);(!t||t>n||isNaN(+n))&&(t=n)}),t||new Date(NaN)}function A8(e){return Vr(e,Date.now())}function Pr(e,t){const r=wl(e),n=wl(t);return+r==+n}function ew(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function D8(e){if(!ew(e)&&typeof e!="number")return!1;const t=rt(e);return!isNaN(Number(t))}function td(e,t){const r=rt(e),n=rt(t),s=r.getFullYear()-n.getFullYear(),a=r.getMonth()-n.getMonth();return s*12+a}function I8(e,t,r){const n=kn(e,r),s=kn(t,r),a=+n-Eh(n),o=+s-Eh(s);return Math.round((a-o)/Xv)}function tw(e){const t=rt(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function Wr(e){const t=rt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Sz(e){const t=rt(e),r=Vr(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function rw(e,t){var l,c,d,u;const r=xd(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,s=rt(e),a=s.getDay(),o=(a<n?-7:0)+6-(a-n);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function Cz(e){return rw(e,{weekStartsOn:1})}const M8={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},F8=(e,t,r)=>{let n;const s=M8[e];return typeof s=="string"?n=s:t===1?n=s.one:n=s.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function qo(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const $8={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},L8={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},U8={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},B8={date:qo({formats:$8,defaultWidth:"full"}),time:qo({formats:L8,defaultWidth:"full"}),dateTime:qo({formats:U8,defaultWidth:"full"})},W8={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},V8=(e,t,r,n)=>W8[e];function us(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let s;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):o;s=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;s=e.values[l]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return s[a]}}const q8={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},H8={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},K8={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Z8={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
549ay","Saturday"]},G8={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Q8={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Y8=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},J8={ordinalNumber:Y8,era:us({values:q8,defaultWidth:"wide"}),quarter:us({values:H8,defaultWidth:"wide",argumentCallback:e=>e-1}),month:us({values:K8,defaultWidth:"wide"}),day:us({values:Z8,defaultWidth:"wide"}),dayPeriod:us({values:G8,defaultWidth:"wide",formattingValues:Q8,defaultFormattingWidth:"wide"})};function hs(e){return(t,r={})=>{const n=r.width,s=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(s);if(!a)return null;const o=a[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?eU(l,h=>h.test(o)):X8(l,h=>h.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=r.valueCallback?r.valueCallback(d):d;const u=t.slice(o.length);return{value:d,rest:u}}}function X8(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function eU(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function zz(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const s=n[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=r.valueCallback?r.valueCallback(o):o;const l=t.slice(s.length);return{value:o,rest:l}}}const tU=/^(\d+)(th|st|nd|rd)?/i,rU=/\d+/i,nU={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},sU={any:[/^b/i,/^(a|c)/i]},aU={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},iU={any:[/1/i,/2/i,/3/i,/4/i]},oU={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},lU={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},cU={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},dU={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},uU={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},hU={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},fU={ordinalNumber:zz({matchPattern:tU,parsePattern:rU,valueCallback:e=>parseInt(e,10)}),era:hs({matchPatterns:nU,defaultMatchWidth:"wide",parsePatterns:sU,defaultParseWidth:"any"}),quarter:hs({matchPatterns:aU,defaultMatchWidth:"wide",parsePatterns:iU,defaultParseWidth:"any",valueCallback:e=>e+1}),month:hs({matchPatterns:oU,defaultMatchWidth:"wide",parsePatterns:lU,defaultParseWidth:"any"}),day:hs({matchPatterns:cU,defaultMatchWidth:"wide",parsePatterns:dU,defaultParseWidth:"any"}),dayPeriod:hs({matchPatterns:uU,defaultMatchWidth:"any",parsePatterns:hU,defaultParseWidth:"any"})},Ez={code:"en-US",formatDistance:F8,formatLong:B8,formatRelative:V8,localize:J8,match:fU,options:{weekStartsOn:0,firstWeekContainsDate:1}};function pU(e){const t=rt(e);return gs(t,Sz(t))+1}function Pz(e){const t=rt(e),r=+Bi(t)-+P8(t);return Math.round(r/Xv)+1}function Tz(e,t){var u,h,p,m;const r=rt(e),n=r.getFullYear(),s=xd(),a=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(p=s.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,o=Vr(e,0);o.setFullYear(n+1,0,a),o.setHours(0,0,0,0);const l=kn(o,t),c=Vr(e,0);c.setFullYear(n,0,a),c.setHours(0,0,0,0);const d=kn(c,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function mU(e,t){var l,c,d,u;const r=xd(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((u=(d=r.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=Tz(e,t),a=Vr(e,0);return a.setFullYear(s,0,n),a.setHours(0,0,0,0),kn(a,t)}function Rz(e,t){const r=rt(e),n=+kn(r,t)-+mU(r,t);return Math.round(n/Xv)+1}function ft(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const ca={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return ft(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):ft(r+1,2)},d(e,t){return ft(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return ft(e.getHours()%12||12,t.length)},H(e,t){return ft(e.getHours(),t.length)},m(e,t){return ft(e.getMinutes(),t.length)},s(e,t){return ft(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),s=Math.trunc(n*Math.pow(10,r-3));return ft(s,t.length)}},ho={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},T0={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),s=n>0?n:1-n;return r.ordinalNumber(s,{unit:"year"})}return ca.y(e,t)},Y:function(e,t,r,n){const s=Tz(e,n),a=s>0?s:1-s;if(t==="YY"){const o=a%100;return ft(o,2)}return t==="Yo"?r.ordinalNumber(a,{unit:"year"}):ft(a,t.length)},R:function(e,t){const r=Nz(e);return ft(r,t.length)},u:function(e,t){const r=e.getFullYear();return ft(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return ft(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return ft(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return ca.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return ft(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const s=Rz(e,n);return t==="wo"?r.ordinalNumber(s,{unit:"week"}):ft(s,t.length)},I:function(e,t,r){const n=Pz(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):ft(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):ca.d(e,t)},D:function(e,t,r){const n=pU(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):ft(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const s=e.getDay(),a=(s-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return ft(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const s=e.getDay(),a=(s-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return ft(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),s=n===0?7:n;switch(t){case"i":return String(s);case"ii":return ft(s,t.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let s;
vendor: 4,744 bytes, line 549
549switch(n===12?s=ho.noon:n===0?s=ho.midnight:s=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let s;switch(n>=17?s=ho.evening:n>=12?s=ho.afternoon:n>=4?s=ho.morning:s=ho.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return ca.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):ca.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):ft(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):ft(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):ca.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):ca.s(e,t)},S:function(e,t){return ca.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return O0(n);case"XXXX":case"XX":return li(n);case"XXXXX":case"XXX":default:return li(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return O0(n);case"xxxx":case"xx":return li(n);case"xxxxx":case"xxx":default:return li(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+R0(n,":");case"OOOO":default:return"GMT"+li(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+R0(n,":");case"zzzz":default:return"GMT"+li(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return ft(n,t.length)},T:function(e,t,r){const n=e.getTime();return ft(n,t.length)}};function R0(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=Math.trunc(n/60),a=n%60;return a===0?r+String(s):r+String(s)+t+ft(a,2)}function O0(e,t){return e%60===0?(e>0?"-":"+")+ft(Math.abs(e)/60,2):li(e,t)}function li(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),s=ft(Math.trunc(n/60),2),a=ft(n%60,2);return r+s+t+a}const A0=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Oz=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},gU=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return A0(e,t);let a;switch(n){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",A0(n,t)).replace("{{time}}",Oz(s,t))},yU={p:Oz,P:gU},vU=/^D+$/,wU=/^Y+$/,xU=["D","DD","YY","YYYY"];function bU(e){return vU.test(e)}function _U(e){return wU.test(e)}function jU(e,t,r){const n=kU(e,t,r);if(console.warn(n),xU.includes(e))throw new RangeError(n)}function kU(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const NU=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,SU=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,CU=/^'([^]*?)'?$/,zU=/''/g,EU=/[a-zA-Z]/;function xt(e,t,r){var u,h,p,m,y,g,x,b;const n=xd(),s=(r==null?void 0:r.locale)??n.locale??Ez,a=(r==null?void 0:r.firstWeekContainsDate)??((h=(u=r==null?void 0:r.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??n.firstWeekContainsDate??((m=(p=n.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,o=(r==null?void 0:r.weekStartsOn)??((g=(y=r==null?void 0:r.locale)==null?void 0:y.options)==null?void 0:g.weekStartsOn)??n.weekStartsOn??((b=(x=n.locale)==null?void 0:x.options)==null?void 0:b.weekStartsOn)??0,l=rt(e);if(!D8(l))throw new RangeError("Invalid time value");let c=t.match(SU).map(v=>{const w=v[0];if(w==="p"||w==="P"){const _=yU[w];return _(v,s.formatLong)}return v}).join("").match(NU).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const w=v[0];if(w==="'")return{isToken:!1,value:PU(v)};if(T0[w])return{isToken:!0,value:v};
549if(w.match(EU))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:v}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const d={firstWeekContainsDate:a,weekStartsOn:o,locale:s};return c.map(v=>{if(!v.isToken)return v.value;const w=v.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&_U(w)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&bU(w))&&jU(w,t,String(e));const _=T0[w[0]];return _(l,w,s.localize,d)}).join("")}function PU(e){const t=e.match(CU);return t?t[1].replace(zU,"'"):e}function TU(e){const t=rt(e),r=t.getFullYear(),n=t.getMonth(),s=Vr(e,0);return s.setFullYear(r,n+1,0),s.setHours(0,0,0,0),s.getDate()}function RU(e){return Math.trunc(+rt(e)/1e3)}function OU(e){const t=rt(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(0,0,0,0),t}function AU(e,t){return I8(OU(e),Wr(e),t)+1}function Ug(e,t){const r=rt(e),n=rt(t);return r.getTime()>n.getTime()}function Az(e,t){const r=rt(e),n=rt(t);return+r<+n}function DU(e){return+rt(e)<Date.now()}function IU(e,t,r){const n=kn(e,r),s=kn(t,r);return+n==+s}function nw(e,t){const r=rt(e),n=rt(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function MU(e,t){const r=rt(e),n=rt(t);return r.getFullYear()===n.getFullYear()}function D0(e){return Pr(e,A8(e))}function Gp(e,t){return Sr(e,-t)}function Qp(e,t){const r=rt(e),n=r.getFullYear(),s=r.getDate(),a=Vr(e,0);a.setFullYear(n,t,15),a.setHours(0,0,0,0);const o=TU(a);return r.setMonth(t,Math.min(s,o)),r}function I0(e,t){const r=rt(e);return isNaN(+r)?Vr(e,NaN):(r.setFullYear(t),r)}const FU={lessThanXSeconds:{one:{regular:"mniej niż sekunda",past:"mniej niż sekundę",future:"mniej niż sekundę"},twoFour:"mniej niż {{count}} sekundy",other:"mniej niż {{count}} sekund"},xSeconds:{one:{regular:"sekunda",past:"sekundę",future:"sekundę"},twoFour:"{{count}} sekundy",other:"{{count}} sekund"},halfAMinute:{one:"pół minuty",twoFour:"pół minuty",other:"pół minuty"},lessThanXMinutes:{one:{regular:"mniej niż minuta",past:"mniej niż minutę",future:"mniej niż minutę"},twoFour:"mniej niż {{count}} minuty",other:"mniej niż {{count}} minut"},xMinutes:{one:{regular:"minuta",past:"minutę",future:"minutę"},twoFour:"{{count}} minuty",other:"{{count}} minut"},aboutXHours:{one:{regular:"około godziny",past:"około godziny",future:"około godzinę"},twoFour:"około {{count}} godziny",other:"około {{count}} godzin"},xHours:{one:{regular:"godzina",past:"godzinę",future:"godzinę"},twoFour:"{{count}} godziny",other:"{{count}} godzin"},xDays:{one:{regular:"dzień",past:"dzień",future:"1 dzień"},twoFour:"{{count}} dni",other:"{{count}} dni"},aboutXWeeks:{one:"około tygodnia",twoFour:"około {{count}} tygodni",other:"około {{count}} tygodni"},xWeeks:{one:"tydzień",twoFour:"{{count}} tygodnie",other:"{{count}} tygodni"},aboutXMonths:{one:"około miesiąc",twoFour:"około {{count}} miesiące",other:"około {{count}} miesięcy"},xMonths:{one:"miesiąc",twoFour:"{{count}} miesiące",other:"{{count}} miesięcy"},aboutXYears:{one:"około rok",twoFour:"około {{count}} lata",other:"około {{count}} lat"},xYears:{one:"rok",twoFour:"{{count}} lata",other:"{{count}} lat"},overXYears:{one:"ponad rok",twoFour:"ponad {{count}} lata",other:"ponad {{count}} lat"},almostXYears:{one:"prawie rok",twoFour:"prawie {{count}} lata",other:"prawie {{count}} lat"}};function $U(e,t){if(t===1)return e.one;const r=t%100;if(r<=20&&r>10)return e.other;const n=r%10;return n>=2&&n<=4?e.twoFour:e.other}function Yp(e,t,r){const n=$U(e,t);return(typeof n=="string"?n:n[r]).replace("{{count}}",String(t))}const LU=(e,t,r)=>{const n=FU[e];return r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"za "+Yp(n,t,"future"):Yp(n,t,"past")+" temu":Yp(n,t,"regular")},UU={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},BU={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},WU={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},VU={date:qo({formats:UU,defaultWidth:"full"}),time:qo({formats:BU,defaultWidth:"full"}),dateTime:qo({formats:WU,defaultWidth:"full"})},qU={masculine:"ostatni",feminine:"ostatnia"},HU={masculine:"ten",feminine:"ta"},KU={masculine:"następny",feminine:"następna"},ZU={0:"feminine",1:"masculine",2:"masculine",3:"feminine",4:"masculine",5:"masculine",6:"feminine"};function M0(e,t,r,n){let s;if(IU(t,r,n))s=HU;else if(e==="lastWeek")s=qU;else if(e==="nextWeek")s=KU;else throw new Error(`Cannot determine adjectives for token ${e}`);const a=t.getDay(),o=ZU[a];return`'${s[o]}' eeee 'o' p`}const GU={lastWeek:M0,yesterday:"'wczoraj o' p",today:"'dzisiaj o' p",tomorrow:"'jutro o' p",nextWeek:M0,other:"P"},QU=(e,t,r,n)=>{const s=GU[e];return typeof s=="function"?s(e,t,r,n):s},YU={narrow:["p.n.e.","n.e."],abbreviated:["p.n.e.","n.e."],wide:["przed naszą erą","
549naszej ery"]},JU={narrow:["1","2","3","4"],abbreviated:["I kw.","II kw.","III kw.","IV kw."],wide:["I kwartał","II kwartał","III kwartał","IV kwartał"]},XU={narrow:["S","L","M","K","M","C","L","S","W","P","L","G"],abbreviated:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],wide:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"]},e6={narrow:["s","l","m","k","m","c","l","s","w","p","l","g"],abbreviated:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],wide:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"]},t6={narrow:["N","P","W","Ś","C","P","S"],short:["nie","pon","wto","śro","czw","pią","sob"],abbreviated:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."],wide:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"]},r6={narrow:["n","p","w","ś","c","p","s"],short:["nie","pon","wto","śro","czw","pią","sob"],abbreviated:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."],wide:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"]},n6={narrow:{am:"a",pm:"p",midnight:"półn.",noon:"poł",morning:"rano",afternoon:"popoł.",evening:"wiecz.",night:"noc"},abbreviated:{am:"AM",pm:"PM",midnight:"północ",noon:"południe",morning:"rano",afternoon:"popołudnie",evening:"wieczór",night:"noc"},wide:{am:"AM",pm:"PM",midnight:"północ",noon:"południe",morning:"rano",afternoon:"popołudnie",evening:"wieczór",night:"noc"}},s6={narrow:{am:"a",pm:"p",midnight:"o półn.",noon:"w poł.",morning:"rano",afternoon:"po poł.",evening:"wiecz.",night:"w nocy"},abbreviated:{am:"AM",pm:"PM",midnight:"o północy",noon:"w południe",morning:"rano",afternoon:"po południu",evening:"wieczorem",night:"w nocy"},wide:{am:"AM",pm:"PM",midnight:"o północy",noon:"w południe",morning:"rano",afternoon:"po południu",evening:"wieczorem",night:"w nocy"}},a6=(e,t)=>String(e),i6={ordinalNumber:a6,era:us({values:YU,defaultWidth:"wide"}),quarter:us({values:JU,defaultWidth:"wide",argumentCallback:e=>e-1}),month:us({values:XU,defaultWidth:"wide",formattingValues:e6,defaultFormattingWidth:"wide"}),day:us({values:t6,defaultWidth:"wide",formattingValues:r6,defaultFormattingWidth:"wide"}),dayPeriod:us({values:n6,defaultWidth:"wide",formattingValues:s6,defaultFormattingWidth:"wide"})},o6=/^(\d+)?/i,l6=/\d+/i,c6={narrow:/^(p\.?\s*n\.?\s*e\.?\s*|n\.?\s*e\.?\s*)/i,abbreviated:/^(p\.?\s*n\.?\s*e\.?\s*|n\.?\s*e\.?\s*)/i,wide:/^(przed\s*nasz(ą|a)\s*er(ą|a)|naszej\s*ery)/i},d6={any:[/^p/i,/^n/i]},u6={narrow:/^[1234]/i,abbreviated:/^(I|II|III|IV)\s*kw\.?/i,wide:/^(I|II|III|IV)\s*kwarta(ł|l)/i},h6={narrow:[/1/i,/2/i,/3/i,/4/i],any:[/^I kw/i,/^II kw/i,/^III kw/i,/^IV kw/i]},f6={narrow:/^[slmkcwpg]/i,abbreviated:/^(sty|lut|mar|kwi|maj|cze|lip|sie|wrz|pa(ź|z)|lis|gru)/i,wide:/^(stycznia|stycze(ń|n)|lutego|luty|marca|marzec|kwietnia|kwiecie(ń|n)|maja|maj|czerwca|czerwiec|lipca|lipiec|sierpnia|sierpie(ń|n)|wrze(ś|s)nia|wrzesie(ń|n)|pa(ź|z)dziernika|pa(ź|z)dziernik|listopada|listopad|grudnia|grudzie(ń|n))/i},p6={narrow:[/^s/i,/^l/i,/^m/i,/^k/i,/^m/i,/^c/i,/^l/i,/^s/i,/^w/i,/^p/i,/^l/i,/^g/i],any:[/^st/i,/^lu/i,/^mar/i,/^k/i,/^maj/i,/^c/i,/^lip/i,/^si/i,/^w/i,/^p/i,/^lis/i,/^g/i]},m6={narrow:/^[npwścs]/i,short:/^(nie|pon|wto|(ś|s)ro|czw|pi(ą|a)|sob)/i,abbreviated:/^(niedz|pon|wt|(ś|s)r|czw|pt|sob)\.?/i,wide:/^(niedziela|poniedzia(ł|l)ek|wtorek|(ś|s)roda|czwartek|pi(ą|a)tek|sobota)/i}
549,g6={narrow:[/^n/i,/^p/i,/^w/i,/^ś/i,/^c/i,/^p/i,/^s/i],abbreviated:[/^n/i,/^po/i,/^w/i,/^(ś|s)r/i,/^c/i,/^pt/i,/^so/i],any:[/^n/i,/^po/i,/^w/i,/^(ś|s)r/i,/^c/i,/^pi/i,/^so/i]},y6={narrow:/^(^a$|^p$|pó(ł|l)n\.?|o\s*pó(ł|l)n\.?|po(ł|l)\.?|w\s*po(ł|l)\.?|po\s*po(ł|l)\.?|rano|wiecz\.?|noc|w\s*nocy)/i,any:/^(am|pm|pó(ł|l)noc|o\s*pó(ł|l)nocy|po(ł|l)udnie|w\s*po(ł|l)udnie|popo(ł|l)udnie|po\s*po(ł|l)udniu|rano|wieczór|wieczorem|noc|w\s*nocy)/i},v6={narrow:{am:/^a$/i,pm:/^p$/i,midnight:/pó(ł|l)n/i,noon:/po(ł|l)/i,morning:/rano/i,afternoon:/po\s*po(ł|l)/i,evening:/wiecz/i,night:/noc/i},any:{am:/^am/i,pm:/^pm/i,midnight:/pó(ł|l)n/i,noon:/po(ł|l)/i,morning:/rano/i,afternoon:/po\s*po(ł|l)/i,evening:/wiecz/i,night:/noc/i}},w6={ordinalNumber:zz({matchPattern:o6,parsePattern:l6,valueCallback:e=>parseInt(e,10)}),era:hs({matchPatterns:c6,defaultMatchWidth:"wide",parsePatterns:d6,defaultParseWidth:"any"}),quarter:hs({matchPatterns:u6,defaultMatchWidth:"wide",parsePatterns:h6,defaultParseWidth:"any",valueCallback:e=>e+1}),month:hs({matchPatterns:f6,defaultMatchWidth:"wide",parsePatterns:p6,defaultParseWidth:"any"}),day:hs({matchPatterns:m6,defaultMatchWidth:"wide",parsePatterns:g6,defaultParseWidth:"any"}),dayPeriod:hs({matchPatterns:y6,defaultMatchWidth:"any",parsePatterns:v6,defaultParseWidth:"any"})},nr={code:"pl",formatDistance:LU,formatLong:VU,formatRelative:QU,localize:i6,match:w6,options:{weekStartsOn:1,firstWeekContainsDate:4}},F0=3,x6={create:"Tworzenie",update:"Aktualizacja",delete:"Usuwanie",create_protocol:"Protokół serwisowy"},b6={tickets:"Zgłoszenie",clients:"Klient",devices:"Urządzenie",protocols:"Protokół"};function _6(){const[e,t]=f.useState([]),[r,n]=f.useState(!1),[s,a]=f.useState(null),{processQueue:o,updatePendingCount:l}=Ss(),c=f.useCallback(async()=>{const m=(await ve.getSyncQueue()).filter(y=>y.retryCount>=F0);t(m)},[]);f.useEffect(()=>{c()},[c]),f.useEffect(()=>{if(!r)return;c();const p=setInterval(c,5e3);return()=>clearInterval(p)},[r,c]),f.useEffect(()=>{const p=()=>{c()};return window.addEventListener("online",p),()=>window.removeEventListener("online",p)},[c]);const d=async p=>{a(p.id);try{await ve.removeFromSyncQueue(p.id),await ve.addToSyncQueue({...p,retryCount:0}),await l(),await o(),await c()}catch(m){console.error("Error retrying operation:",m)}finally{a(null)}},u=async p=>{try{await ve.removeFromSyncQueue(p),await l(),await c()}catch(m){console.error("Error deleting operation:",m)}},h=async()=>{for(const p of e)await ve.removeFromSyncQueue(p.id),await ve.addToSyncQueue({...p,retryCount:0});await l(),await o(),await c()};return e.length===0?null:i.jsxs(or,{open:r,onOpenChange:n,children:[i.jsx(zi,{asChild:!0,children:i.jsxs(G,{variant:"ghost",size:"sm",className:"h-8 gap-2 text-xs font-normal text-destructive hover:text-destructive",children:[i.jsx(an,{className:"h-3.5 w-3.5"}),i.jsxs("span",{className:"hidden sm:inline",children:[e.length," błędów"]}),i.jsx("span",{className:"sm:hidden",children:e.length})]})}),i.jsxs(er,{className:"max-w-md",children:[i.jsxs(tr,{children:[i.jsxs(rr,{className:"flex items-center gap-2",children:[i.jsx(sh,{className:"h-5 w-5 text-destructive"}),"Nieudane operacje synchronizacji"]}),i.jsxs(Vn,{children:["Poniższe operacje nie zostały zsynchronizowane po ",F0," próbach. Możesz spróbować ponownie lub usunąć je."]})]}),i.jsx("div",{className:"mt-4 space-y-3 max-h-80 overflow-y-auto",children:e.map(p=>i.jsxs("div",{className:"rounded-lg border p-3 space-y-2 bg-muted/30",children:[i.jsx("div",{className:"flex items-start justify-between gap-2",children:i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ge,{variant:"outline",className:"text-xs",children:x6[p.type]||p.type}),i.jsxs(Ge,{variant:"secondary",className:"text-xs",children:[i.jsx(s1,{className:"h-3 w-3 mr-1"}),b6[p.table]||p.table]})]}),i.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[i.jsx(Ua,{className:"h-3 w-3"}),xt(new Date(p.createdAt),"PPp",{locale:nr})]})]})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(G,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>d(p),disabled:s===p.id,children:[s===p.id?i.jsx(Ci,{className:"h-3.5 w-3.5 mr-1 animate-spin"}):i.jsx(Ci,{className:"h-3.5 w-3.5 mr-1"}),"Ponów"]}),i.jsx(G,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>u(p.id),children:i.jsx(rf,{className:"h-3.5 w-3.5"})})]})]}
549,p.id))}),e.length>1&&i.jsx("div",{className:"mt-4 pt-4 border-t",children:i.jsxs(G,{variant:"outline",className:"w-full",onClick:h,children:[i.jsx(Ci,{className:"h-4 w-4 mr-2"}),"Ponów wszystkie (",e.length,")"]})})]})]})}function j6(){const e=Dr(),{pendingCount:t,isSyncing:r,processQueue:n}=Ss(),s=()=>{e&&t>0&&n()};return i.jsxs(pv,{children:[i.jsxs(J1,{children:[i.jsx(X1,{asChild:!0,children:i.jsx(G,{variant:"ghost",size:"sm",className:"h-8 gap-2 text-xs font-normal",onClick:s,disabled:!e||t===0||r,children:e?r?i.jsxs(i.Fragment,{children:[i.jsx(Ci,{className:"h-3.5 w-3.5 animate-spin text-primary"}),i.jsx("span",{className:"hidden sm:inline",children:"Synchronizacja..."})]}):t>0?i.jsxs(i.Fragment,{children:[i.jsx(Ci,{className:"h-3.5 w-3.5 text-amber-500"}),i.jsxs("span",{className:"hidden sm:inline text-amber-600",children:[t," do synchronizacji"]}),i.jsx("span",{className:"sm:hidden text-amber-600",children:t})]}):i.jsxs(i.Fragment,{children:[i.jsx(n1,{className:"h-3.5 w-3.5 text-green-500"}),i.jsx("span",{className:"hidden sm:inline text-muted-foreground",children:"Zsynchronizowano"})]}):i.jsxs(i.Fragment,{children:[i.jsx(r1,{className:"h-3.5 w-3.5 text-amber-500"}),i.jsx("span",{className:"hidden sm:inline text-amber-600",children:"Offline"}),t>0&&i.jsxs("span",{className:"text-amber-600",children:["(",t,")"]})]})})}),i.jsx(mv,{children:e?r?i.jsx("p",{children:"Trwa synchronizacja danych..."}):t>0?i.jsxs("p",{children:[t," zmian oczekuje na synchronizację.",i.jsx("br",{}),"Kliknij aby zsynchronizować teraz."]}):i.jsx("p",{children:"Wszystkie dane są zsynchronizowane"}):i.jsxs("p",{children:["Brak połączenia z internetem.",t>0&&i.jsxs(i.Fragment,{children:[i.jsx("br",{}),t," zmian zostanie zsynchronizowanych po powrocie online."]})]})})]}),i.jsx(_6,{})]})}function sr({children:e,title:t}){const{user:r,loading:n,isEmailConfirmed:s}=qr(),a=Zt();return f.useEffect(()=>{n||r&&s||a("/auth")},[r,n,s,a]),n||!r||!s?null:i.jsxs(GC,{children:[i.jsx(_S,{}),i.jsxs("div",{className:"flex min-h-screen w-full",children:[i.jsx(C8,{}),i.jsxs(JC,{className:"flex flex-1 flex-col min-w-0",children:[i.jsxs("header",{className:"sticky top-0 z-10 flex h-16 items-center gap-4 border-b border-border bg-background/95 px-4 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:[i.jsx(YC,{className:"-ml-1",children:i.jsx(G,{variant:"ghost",size:"icon",children:i.jsx(l1,{className:"h-5 w-5"})})}),t&&i.jsx("h1",{className:"flex-1 text-xl font-bold text-foreground",children:t}),i.jsx("div",{className:"ml-auto",children:i.jsx(j6,{})})]}),i.jsx("main",{className:"flex-1 min-w-0 overflow-y-auto overflow-x-hidden p-4 md:p-6",children:e})]})]})]})}function Xn({isCached:e,isOffline:t,lastSynced:r,onRefresh:n,isRefreshing:s=!1}){return!e&&!t?null:i.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-border bg-muted/50 px-3 py-2 text-sm",children:[i.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t?i.jsxs(i.Fragment,{children:[i.jsx(r1,{className:"h-4 w-4 text-amber-500"}),i.jsx("span",{children:"Tryb offline"})]}):i.jsxs(i.Fragment,{children:[i.jsx(n1,{className:"h-4 w-4"}),i.jsx("span",{children:"Dane z cache"})]}),r&&i.jsxs("span",{className:"text-xs",children:["(ostatnia sync: ",xt(r,"d MMM, HH:mm",{locale:nr}),")"]})]}),!t&&n&&i.jsxs(G,{variant:"ghost",size:"sm",onClick:n,disabled:s,className:"h-7 px-2",children:[i.jsx(Ci,{className:`h-3 w-3 mr-1 ${s?"animate-spin":""}`}),"Odśwież"]})]})}let $0=!1;function sw(e,t={}){const{autoFetch:r=!0,fetchFn:n}=t,s=Dr(),[a,o]=f.useState([]),[l,c]=f.useState(!0),[d,u]=f.useState(null),[h,p]=f.useState(!1),[m,y]=f.useState(null),g=f.useCallback(async()=>{try{const w=await ve.getAllData(e),_=await ve.getLastSynced(e);return w.length>0&&(o(w),p(!0)),_&&y(new Date(_)),w}catch(w){return console.error(`Error loading cached ${e}:`,w),[]}},[e]),x=f.useCallback(async()=>{if(!n)return null;try{const w=await n();return await ve.saveAllData(e,w),await ve.setLastSynced(e),o(w),p(!1),y(new Date),w}catch(w){throw console.error(`Error fetching ${e} from network:`,w),w}},[e,n]),b=f.useCallback(async()=>{c(!0),u(null);try{s&&n?await x():await g()}catch(w){(await g()).length===0&&u(w)}finally{c(!1)}},[s,n,x,g]),v=f.useCallback(async w=>{await ve.saveData(e,w),o(_=>{const j=_.findIndex(k=>k.id===w.id);if(j>=0){const k=[..._];return k[j]=w,k}return[..._,w]})},[e]);return f.useEffect(()=>{r&&b(),$0||($0=!0,ve.cleanupOldData().catch(w=>{console.error("Failed to cleanup old data:",w)}
549))},[r]),f.useEffect(()=>{s&&h&&n&&b()},[s]),{data:a,loading:l,error:d,isOffline:!s,isCached:h,lastSynced:m,refresh:b,saveLocal:v}}function Dz(e){return sw(Je.tickets,{autoFetch:!!e,fetchFn:e?async()=>{const{data:t,error:r}=await ne.from("tickets").select(`
550              *,
551              devices:device_id (
552                id,
553                name,
554                short_id,
555                clients:client_id (
556                  id,
557                  name,
558                  address,
559                  phone
560                )
561              )
562            `).eq("installer_id",e).order("scheduled_date",{ascending:!0,nullsFirst:!1});if(r)throw r;return t||[]}:void 0})}function aw(e){return sw(Je.clients,{autoFetch:!!e,fetchFn:e?async()=>{const{data:t,error:r}=await ne.from("clients").select("*").eq("installer_id",e).eq("is_active",!0).order("name");if(r)throw r;return t||[]}:void 0})}function k6(e){return sw(Je.devices,{autoFetch:!!e,fetchFn:e?async()=>{const{data:t,error:r}=await ne.from("devices").select(`
563              *,
564              clients:client_id (
565                id,
566                name,
567                address
568              )
569            `).eq("installer_id",e).eq("is_active",!0).order("created_at",{ascending:!1});if(r)throw r;return t||[]}:void 0})}const N6={nowe:"Nowe",w_toku:"W realizacji",oczekuje_na_czesci:"Oczekuje na części",zakonczone:"Zakończone",anulowane:"Anulowane"};function S6(){const{user:e}=qr(),t=Dr(),{data:r,isCached:n,lastSynced:s,refresh:a}=Dz(e==null?void 0:e.id),[o,l]=f.useState([]),[c,d]=f.useState([]),[u,h]=f.useState([]),[p,m]=f.useState(!0);f.useEffect(()=>{e&&g()},[e]),f.useEffect(()=>{!t&&r&&r.length>0&&(y(r),m(!1))},[r,t]);const y=w=>{const _=w.filter(N=>N.status==="w_toku"),j=w.filter(N=>N.status==="nowe"),k=w.filter(N=>N.status==="oczekuje_na_czesci").sort((N,P)=>N.scheduled_date?P.scheduled_date?new Date(N.scheduled_date).getTime()-new Date(P.scheduled_date).getTime():-1:1);l(_),d(j),h(k)},g=async()=>{if(t)try{const{data:w}=await ne.from("tickets").select(`
570          id,
571          description,
572          status,
573          priority,
574          created_at,
575          scheduled_date,
576          additional_devices_count,
577          is_critical,
578          devices (
579            name,
580            clients (
581              name,
582              address
583            )
584          )
585        `).eq("installer_id",e==null?void 0:e.id).in("status",["nowe","w_toku","oczekuje_na_czesci"]).order("scheduled_date",{ascending:!0,nullsFirst:!1});if(w){y(w);for(const _ of w)await ve.saveData("tickets",_)}}catch(w){console.error("Error fetching dashboard data:",w),r&&y(r)}finally{m(!1)}},x=async()=>{await a(),await g()},b=({ticket:w,showScheduleBadges:_=!0})=>{var N,P,T,I,H;const j=w.scheduled_date&&D0(new Date(w.scheduled_date)),k=w.scheduled_date&&DU(new Date(w.scheduled_date))&&!D0(new Date(w.scheduled_date));return i.jsx(ks,{to:`/tickets/${w.id}`,state:{from:"dashboard"},className:`block rounded-lg border bg-card p-4 transition-all hover:shadow-md hover:border-primary/50 ${_&&j?"border-primary border-2 bg-primary/5":_&&k?"border-destructive border-2 bg-destructive/5":"border-border"}`,children:i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[_&&k&&i.jsxs(Ge,{variant:"destructive",className:"shrink-0",children:[i.jsx(an,{className:"mr-1 h-3 w-3"}),"Zweryfikuj status"]}),_&&j&&!k&&i.jsxs(Ge,{variant:"default",className:"shrink-0 bg-primary",children:[i.jsx(SO,{className:"mr-1 h-3 w-3"}),"DZIŚ"]}),i.jsx("span",{className:"font-semibold truncate",children:((N=w.devices)==null?void 0:N.name)||"Nieznane urządzenie"}),i.jsx(Ge,{variant:w.status,className:"shrink-0",children:N6[w.status]}),w.is_critical&&i.jsxs(Ge,{variant:"destructive",className:"shrink-0",children:[i.jsx(an,{className:"mr-1 h-3 w-3"}),"PILNE / KRYTYCZNE"]}),w.additional_devices_count>0&&i.jsxs(Ge,{variant:"outline",className:"shrink-0 border-primary text-primary",children:["+",w.additional_devices_count," urządzeń"]})]}),i.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:((T=(P=w.devices)==null?void 0:P.clients)==null?void 0:T.name)||"Nieznany klient"}),((H=(I=w.devices)==null?void 0:I.clients)==null?void 0:H.address)&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:["📍 ",w.devices.clients.address]}),w.scheduled_date&&!j&&i.jsxs("p",{className:`text-xs mt-2 font-medium ${k?"text-destructive":"text-primary"}`,children:["🕒 ",xt(new Date(w.scheduled_date),"PPP 'o' HH:mm",{locale:nr})]}),w.description&&i.jsx("p",{className:"text-sm text-muted-foreground mt-2 line-clamp-2",children:w.description})]}),i.jsx(Da,{className:"h-4 w-4 text-muted-foreground shrink-0 mt-1"})]})})}
585,v=({icon:w,title:_,subtitle:j})=>i.jsxs("div",{className:"flex h-48 flex-col items-center justify-center text-center text-muted-foreground",children:[i.jsx(w,{className:"mb-2 h-8 w-8"}),i.jsx("p",{className:"font-medium",children:_}),i.jsx("p",{className:"text-sm",children:j})]});return i.jsx(sr,{title:"Pulpit",children:i.jsxs("div",{className:"animate-fade-in space-y-4",children:[i.jsx(Xn,{isCached:n,isOffline:!t,lastSynced:s,onRefresh:x}),i.jsxs(pl,{defaultValue:"tasks",className:"w-full",children:[i.jsxs(Fi,{className:"grid w-full grid-cols-3 mb-6",children:[i.jsxs(nn,{value:"tasks",className:"gap-2",children:[i.jsx(Sl,{className:"h-4 w-4"}),i.jsx("span",{className:"hidden sm:inline",children:"Moje Zadania"}),o.length>0&&i.jsx(Ge,{variant:"secondary",className:"ml-1",children:o.length})]}),i.jsxs(nn,{value:"new",className:"gap-2",children:[i.jsx(sh,{className:"h-4 w-4"}),i.jsx("span",{className:"hidden sm:inline",children:"Nowe"}),c.length>0&&i.jsx(Ge,{variant:"destructive",className:"ml-1 animate-pulse",children:c.length})]}),i.jsxs(nn,{value:"parts",className:"gap-2",children:[i.jsx(cl,{className:"h-4 w-4"}),i.jsx("span",{className:"hidden sm:inline",children:"Części"}),u.length>0&&i.jsx(Ge,{variant:"warning",className:"ml-1",children:u.length})]})]}),i.jsx(Kn,{value:"tasks",children:i.jsx(Fe,{children:i.jsx(Me,{className:"pt-6",children:p?i.jsx("div",{className:"flex h-48 items-center justify-center text-muted-foreground",children:"Ładowanie..."}):o.length===0?i.jsx(v,{icon:Ua,title:"Brak aktywnych zadań",subtitle:"Przyjmij nowe zgłoszenia, aby rozpocząć pracę"}):i.jsx("div",{className:"space-y-3",children:o.map(w=>i.jsx(b,{ticket:w},w.id))})})})}),i.jsx(Kn,{value:"new",children:i.jsx(Fe,{children:i.jsx(Me,{className:"pt-6",children:p?i.jsx("div",{className:"flex h-48 items-center justify-center text-muted-foreground",children:"Ładowanie..."}):c.length===0?i.jsx(v,{icon:sh,title:"Brak nowych zgłoszeń",subtitle:"Zgłoszenia od klientów pojawią się tutaj"}):i.jsx("div",{className:"space-y-3",children:c.map(w=>i.jsx(b,{ticket:w},w.id))})})})}),i.jsx(Kn,{value:"parts",children:i.jsx(Fe,{children:i.jsx(Me,{className:"pt-6",children:p?i.jsx("div",{className:"flex h-48 items-center justify-center text-muted-foreground",children:"Ładowanie..."}):u.length===0?i.jsx(v,{icon:cl,title:"Brak zgłoszeń oczekujących na części",subtitle:"Zgłoszenia wymagające części pojawią się tutaj"}):i.jsx("div",{className:"space-y-3",children:u.map(w=>i.jsx(b,{ticket:w,showScheduleBadges:!1},w.id))})})})})]})]})})}const Zn=f.forwardRef(({className:e,...t},r)=>i.jsx("textarea",{className:J("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
585ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));Zn.displayName="Textarea";function L0(e,[t,r]){return Math.min(r,Math.max(t,e))}var C6=[" ","Enter","ArrowUp","ArrowDown"],z6=[" ","Enter"],Wi="Select",[Mf,Ff,E6]=Yh(Wi),[Ml,m7]=dn(Wi,[E6,Pl]),$f=Pl(),[P6,ei]=Ml(Wi),[T6,R6]=Ml(Wi),Iz=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:h,disabled:p,required:m,form:y}=e,g=$f(t),[x,b]=f.useState(null),[v,w]=f.useState(null),[_,j]=f.useState(!1),k=_f(d),[N,P]=jn({prop:n,defaultProp:s??!1,onChange:a,caller:Wi}),[T,I]=jn({prop:o,defaultProp:l,onChange:c,caller:Wi}),H=f.useRef(null),M=x?y||!!x.closest("form"):!0,[L,F]=f.useState(new Set),Y=Array.from(L).map(Q=>Q.props.value).join(";");return i.jsx(dv,{...g,children:i.jsxs(P6,{required:m,scope:t,trigger:x,onTriggerChange:b,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:_,onValueNodeHasChildrenChange:j,contentId:cr(),value:T,onValueChange:I,open:N,onOpenChange:P,dir:k,triggerPointerDownPosRef:H,disabled:p,children:[i.jsx(Mf.Provider,{scope:t,children:i.jsx(T6,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(Q=>{F(S=>new Set(S).add(Q))},[]),onNativeOptionRemove:f.useCallback(Q=>{F(S=>{const z=new Set(S);return z.delete(Q),z})},[]),children:r})}),M?i.jsxs(iE,{"aria-hidden":!0,required:m,tabIndex:-1,name:u,autoComplete:h,value:T,onChange:Q=>I(Q.target.value),disabled:p,form:y,children:[T===void 0?i.jsx("option",{value:""}):null,Array.from(L)]},Y):null]})})};Iz.displayName=Wi;var Mz="SelectTrigger",Fz=f.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,a=$f(r),o=ei(Mz,r),l=o.disabled||n,c=tt(t,o.onTriggerChange),d=Ff(r),u=f.useRef("touch"),[h,p,m]=lE(g=>{const x=d().filter(w=>!w.disabled),b=x.find(w=>w.value===o.value),v=cE(x,g,b);v!==void 0&&o.onValueChange(v.value)}),y=g=>{l||(o.onOpenChange(!0),m()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return i.jsx(of,{asChild:!0,...a,children:i.jsx(Se.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":oE(o.value)?"":void 0,...s,ref:c,onClick:ke(s.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&y(g)}),onPointerDown:ke(s.onPointerDown,g=>{u.current=g.pointerType;const x=g.target;x.hasPointerCapture(g.pointerId)&&x.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(y(g),g.preventDefault())}),onKeyDown:ke(s.onKeyDown,g=>{const x=h.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&p(g.key),!(x&&g.key===" ")&&C6.includes(g.key)&&(y(),g.preventDefault())})})})});Fz.displayName=Mz;var $z="SelectValue",Lz=f.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:a,placeholder:o="",...l}=e,c=ei($z,r),{onValueNodeHasChildrenChange:d}=c,u=a!==void 0,h=tt(t,c.onValueNodeChange);return dr(()=>{d(u)},[d,u]),i.jsx(Se.span,{...l,ref:h,style:{pointerEvents:"none"},children:oE(c.value)?i.jsx(i.Fragment,{children:o}):a})});Lz.displayName=$z;var O6="SelectIcon",Uz=f.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return i.jsx(Se.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});Uz.displayName=O6;var A6="SelectPortal",Bz=e=>i.jsx(cd,{asChild:!0,...e});Bz.displayName=A6;var Vi="SelectContent",Wz=f.forwardRef((e,t)=>{const r=ei(Vi,e.__scopeSelect),[n,s]=f.useState();if(dr(()=>{s(new DocumentFragment)},[]),!r.open){const a=n;return a?Qi.createPortal(i.jsx(Vz,{scope:e.__scopeSelect,children:i.jsx(Mf.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),a):null}return i.jsx(qz,{...e,ref:t})});Wz.displayName=Vi;var On=10,[Vz,ti]=Ml(Vi),D6="SelectContentImpl",I6=Di("SelectContent.RemoveScroll"),qz=f.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:m,sticky:y,hideWhenDetached:g,avoidCollisions:x,...b}=e,v=ei(Vi,r),[w,_]=f.useState(null),[j,k]=f.useState(null),N=tt(t,Z=>_(Z)),[P,T]=f.useState(null),[I,H]=f.useState(null),M=Ff(r),[L,F]=f.useState(!1),Y=f.useRef(!1);f.useEffect(()=>{if(w)return Bv(w)},[w]),Uv();const Q=f.useCallback(Z=>{const[me,...ge]=M().map(Oe=>Oe.ref.current),[Ne]=ge.slice(-1),Ce=document.activeElement;for(const Oe of Z)if(Oe===Ce||(Oe==null||Oe.scrollIntoView({block:"nearest"}),Oe===me&&j&&(j.scrollTop=0),Oe===Ne&&j&&(j.scrollTop=j.scrollHeight),Oe==null||Oe.focus(),document.activeElement!==Ce))return},[M,j]),S=f.useCallback(()=>Q([P,w]),[Q,P,w]);f.useEffect(()=>{L&&S()},[L,S]);const{onOpenChange:z,triggerPointerDownPosRef:C}=v;f.useEffect(()=>{if(w){let Z={x:0,y:0};const me=Ne=>{var Ce,Oe;Z={x:Math.abs(Math.round(Ne.pageX)-(((Ce=C.current)==null?void 0:Ce.x)??0)),y:Math.abs(Math.round(Ne.pageY)-(((Oe=C.current)==null?void 0:Oe.y)??0))}},ge=Ne=>{Z.x<=10&&Z.y<=10?Ne.preventDefault():w.contains(Ne.target)||z(!1),document.removeEventListener("pointermove",me),C.current=null};return C.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",ge,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",ge,{capture:!0})}}},[w,z,C]),f.useEffect(()=>{const Z=()=>z(!1);return window.addEventListener("blur",Z),window.addEventListener("resize",Z),()=>{window.removeEventListener("blur",Z),window.removeEventListener("resize",Z)}},[z]);const[B,ce]=lE(Z=>{const me=M().filter(Ce=>!Ce.disabled),ge=me.find(Ce=>Ce.ref.current===document.activeElement),Ne=cE(me,Z,ge);Ne&&setTimeout(()=>Ne.ref.current.focus())}),A=f.useCallback((Z,me,ge)=>{const Ne=!Y.current&&!ge;(v.value!==void 0&&v.value===me||Ne)&&(T(Z),Ne&&(Y.current=!0))},[v.value]),ee=f.useCallback(()=>w==null?void 0:w.focus(),[w]),te=f.useCallback((Z,me,ge)=>{const Ne=!Y.current&&!ge;(v.value!==void 0&&v.value===me||Ne)&&H(Z)},[v.value]),q=n==="popper"?Bg:Hz,he=q===Bg?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:m,sticky:y,hideWhenDetached:g,avoidCollisions:x}:{};return i.jsx(Vz,{scope:r,content:w,viewport:j,onViewportChange:k,itemRefCallback:A,selectedItem:P,onItemLeave:ee,itemTextRefCallback:te,focusSelectedItem:S,selectedItemText:I,position:n,isPositioned:L,searchRef:B,children:i.jsx(Ef,{as:I6,allowPinchZoom:!0,children:i.jsx(Cf,{asChild:!0,trapped:v.open,onMountAutoFocus:Z=>{Z.preventDefault()},onUnmountAutoFocus:ke(s,Z=>{var me;(me=v.trigger)==null||me.focus({preventScroll:!0}),Z.preventDefault()}),children:i.jsx(kl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:Z=>Z.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:i.jsx(q,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:Z=>Z.preventDefault(),...b,...he,onPlaced:()=>F(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:ke(b.onKeyDown,Z=>{const me=Z.ctrlKey||Z.altKey||Z.metaKey;if(Z.key==="Tab"&&Z.preventDefault(),!me&&Z.key.length===1&&ce(Z.key),["ArrowUp","ArrowDown","Home","End"].includes(Z.key)){let Ne=M().filter(Ce=>!Ce.disabled).map(Ce=>Ce.ref.current);if(["ArrowUp","End"].includes(Z.key)&&(Ne=Ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(Z.key)){const Ce=Z.target,Oe=Ne.indexOf(Ce);Ne=Ne.slice(Oe+1)}setTimeout(()=>Q(Ne)),Z.preventDefault()}})})})})})})});qz.displayName=D6;var M6="SelectItemAlignedPosition",Hz=f.forwardRef((e,t)=>
vendor: 10,736 bytes, line 585
585{const{__scopeSelect:r,onPlaced:n,...s}=e,a=ei(Vi,r),o=ti(Vi,r),[l,c]=f.useState(null),[d,u]=f.useState(null),h=tt(t,N=>u(N)),p=Ff(r),m=f.useRef(!1),y=f.useRef(!0),{viewport:g,selectedItem:x,selectedItemText:b,focusSelectedItem:v}=o,w=f.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&d&&g&&x&&b){const N=a.trigger.getBoundingClientRect(),P=d.getBoundingClientRect(),T=a.valueNode.getBoundingClientRect(),I=b.getBoundingClientRect();if(a.dir!=="rtl"){const Ce=I.left-P.left,Oe=T.left-Ce,Xe=N.left-Oe,oe=N.width+Xe,Ve=Math.max(oe,P.width),Ue=window.innerWidth-On,re=L0(Oe,[On,Math.max(On,Ue-Ve)]);l.style.minWidth=oe+"px",l.style.left=re+"px"}else{const Ce=P.right-I.right,Oe=window.innerWidth-T.right-Ce,Xe=window.innerWidth-N.right-Oe,oe=N.width+Xe,Ve=Math.max(oe,P.width),Ue=window.innerWidth-On,re=L0(Oe,[On,Math.max(On,Ue-Ve)]);l.style.minWidth=oe+"px",l.style.right=re+"px"}const H=p(),M=window.innerHeight-On*2,L=g.scrollHeight,F=window.getComputedStyle(d),Y=parseInt(F.borderTopWidth,10),Q=parseInt(F.paddingTop,10),S=parseInt(F.borderBottomWidth,10),z=parseInt(F.paddingBottom,10),C=Y+Q+L+z+S,B=Math.min(x.offsetHeight*5,C),ce=window.getComputedStyle(g),A=parseInt(ce.paddingTop,10),ee=parseInt(ce.paddingBottom,10),te=N.top+N.height/2-On,q=M-te,he=x.offsetHeight/2,Z=x.offsetTop+he,me=Y+Q+Z,ge=C-me;if(me<=te){const Ce=H.length>0&&x===H[H.length-1].ref.current;l.style.bottom="0px";const Oe=d.clientHeight-g.offsetTop-g.offsetHeight,Xe=Math.max(q,he+(Ce?ee:0)+Oe+S),oe=me+Xe;l.style.height=oe+"px"}else{const Ce=H.length>0&&x===H[0].ref.current;l.style.top="0px";const Xe=Math.max(te,Y+g.offsetTop+(Ce?A:0)+he)+ge;l.style.height=Xe+"px",g.scrollTop=me-te+g.offsetTop}l.style.margin=`${On}px 0`,l.style.minHeight=B+"px",l.style.maxHeight=M+"px",n==null||n(),requestAnimationFrame(()=>m.current=!0)}},[p,a.trigger,a.valueNode,l,d,g,x,b,a.dir,n]);dr(()=>w(),[w]);const[_,j]=f.useState();dr(()=>{d&&j(window.getComputedStyle(d).zIndex)},[d]);const k=f.useCallback(N=>{N&&y.current===!0&&(w(),v==null||v(),y.current=!1)},[w,v]);return i.jsx($6,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:i.jsx(Se.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Hz.displayName=M6;var F6="SelectPopperPosition",Bg=f.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=On,...a}=e,o=$f(r);return i.jsx(uv,{...o,...a,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Bg.displayName=F6;var[$6,iw]=Ml(Vi,{}),Wg="SelectViewport",Kz=f.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,a=ti(Wg,r),o=iw(Wg,r),l=tt(t,a.onViewportChange),c=f.useRef(0);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),i.jsx(Mf.Slot,{scope:r,children:i.jsx(Se.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ke(s.onScroll,d=>{const u=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=o;if(p!=null&&p.current&&h){const m=Math.abs(c.current-u.scrollTop);if(m>0){const y=window.innerHeight-On*2,g=parseFloat(h.style.minHeight),x=parseFloat(h.style.height),b=Math.max(g,x);if(b<y){const v=b+m,w=Math.min(y,v),_=v-w;h.style.height=w+"px",h.style.bottom==="0px"&&(u.scrollTop=_>0?_:0,h.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Kz.displayName=Wg;var Zz="SelectGroup",[L6,U6]=Ml(Zz),B6=f.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=cr();return i.jsx(L6,{scope:r,id:s,children:i.jsx(Se.div,{role:"group","aria-labelledby":s,...n,ref:t})})});B6.displayName=Zz;var Gz="SelectLabel",Qz=f.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=U6(Gz,r);return i.jsx(Se.div,{id:s.id,...n,ref:t})});Qz.displayName=Gz;var Ph="SelectItem",[W6,Yz]=Ml(Ph),Jz=f.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:a,...o}=e,l=ei(Ph,r),c=ti(Ph,r),d=l.value===n,[u,h]=f.useState(a??""),[p,m]=f.useState(!1),y=tt(t,v=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,v,n,s)}),g=cr(),x=f.useRef("touch"),b=()=>{s||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(W6,{scope:r,value:n,disabled:s,textId:g,isSelected:d,onItemTextChange:f.useCallback(v=>{h(w=>w||((v==null?void 0:v.textContent)??"").trim())},[]),children:i.jsx(Mf.ItemSlot,{scope:r,value:n,disabled:s,textValue:u,children:i.jsx(Se.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:y,onFocus:ke(o.onFocus,()=>m(!0)),onBlur:ke(o.onBlur,()=>m(!1)),onClick:ke(o.onClick,()=>{x.current!=="mouse"&&b()}),onPointerUp:ke(o.onPointerUp,()=>{x.current==="mouse"&&b()}),onPointerDown:ke(o.onPointerDown,v=>{x.current=v.pointerType}),onPointerMove:ke(o.onPointerMove,v=>{var w;x.current=v.pointerType,s?(w=c.onItemLeave)==null||w.call(c):x.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(o.onPointerLeave,v=>{var w;v.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:ke(o.onKeyDown,v=>{var _;((_=c.searchRef)==null?void 0:_.current)!==""&&v.key===" "||(z6.includes(v.key)&&b(),v.key===" "&&v.preventDefault())})})})})});Jz.displayName=Ph;var sc="SelectItemText",Xz=f.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...a}=e,o=ei(sc,r),l=ti(sc,r),c=Yz(sc,r),d=R6(sc,r),[u,h]=f.useState(null),p=tt(t,b=>h(b),c.onItemTextChange,b=>{var v;return(v=l.itemTextRefCallback)==null?void 0:v.call(l,b,c.value,c.disabled)}),m=u==null?void 0:u.textContent,y=f.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:x}=d;return dr(()=>(g(y),()=>x(y)),[g,x,y]),i.jsxs(i.Fragment,{children:[i.jsx(Se.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Qi.createPortal(a.children,o.valueNode):null]})});Xz.displayName=sc;var eE="SelectItemIndicator",tE=f.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Yz(eE,r).isSelected?i.jsx(Se.span,{"aria-hidden":!0,...n,ref:t}):null});tE.displayName=eE;var Vg="SelectScrollUpButton",rE=f.forwardRef((e,t)=>{const r=ti(Vg,e.__scopeSelect),n=iw(Vg,e.__scopeSelect),[s,a]=f.useState(!1),o=tt(t,n.onScrollButtonChange);return dr(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;a(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?i.jsx(sE,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});rE.displayName=Vg;var qg="SelectScrollDownButton",nE=f.forwardRef((e,t)=>{const r=ti(qg,e.__scopeSelect),n=iw(qg,e.__scopeSelect),[s,a]=f.useState(!1),o=tt(t,n.onScrollButtonChange);return dr(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;a(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?i.jsx(sE,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});nE.displayName=qg;var sE=f.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,a=ti("SelectScrollButton",r),o=f.useRef(null),l=Ff(r),c=f.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return f.useEffect(()=>()=>c(),[c]),dr(()=>{var u;const d=l().find(h=>h.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[l]),i.jsx(Se.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ke(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:ke(s.onPointerMove,()=>{var d;(d=a.onItemLeave)==null||d.call(a),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:ke(s.onPointerLeave,()=>{c()})})}),V6="SelectSeparator",aE=f.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return i.jsx(Se.div,{"aria-hidden":!0,...n,ref:t})});aE.displayName=V6;var Hg="SelectArrow",q6=f.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=$f(r),a=ei(Hg,r),o=ti(Hg,r);return a.open&&o.position==="popper"?i.jsx(hv,{...s,...n,ref:t}):null});q6.displayName=Hg;var H6="SelectBubbleInput",iE=f.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=f.useRef(null),a=tt(n,s),o=oC(t);return f.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&u){const h=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(h)}},[o,t]),i.jsx(Se.select,{...r,style:{...Ck,...r.style},ref:a,defaultValue:t})});iE.displayName=H6;function oE(e){return e===""||e===void 0}function lE(e){const t=_n(e),r=f.useRef(""),n=f.useRef(0),s=f.useCallback(o=>{const l=r.current+o;t(l),function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),a=f.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,a]}function cE(e,t,r){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let o=K6(e,Math.max(a,0));s.length===1&&(o=o.filter(d=>d!==r));const c=o.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function K6(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Z6=Iz,dE=Fz,G6=Lz,Q6=Uz,Y6=Bz,uE=Wz,J6=Kz,hE=Qz,fE=Jz,X6=Xz,eB=tE,pE=rE,mE=nE,gE=aE;const Ha=Z6,Ka=G6,Ys=f.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(dE,{ref:n,className:J("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
585ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,i.jsx(Q6,{asChild:!0,children:i.jsx(ef,{className:"h-4 w-4 opacity-50"})})]}));Ys.displayName=dE.displayName;const yE=f.forwardRef(({className:e,...t},r)=>i.jsx(pE,{ref:r,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(zO,{className:"h-4 w-4"})}));yE.displayName=pE.displayName;const vE=f.forwardRef(({className:e,...t},r)=>i.jsx(mE,{ref:r,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(ef,{className:"h-4 w-4"})}));vE.displayName=mE.displayName;const Js=f.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>i.jsx(Y6,{children:i.jsxs(uE,{ref:s,className:J("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[i.jsx(yE,{}),i.jsx(J6,{className:J("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(vE,{})]})}));Js.displayName=uE.displayName;const tB=f.forwardRef(({className:e,...t},r)=>i.jsx(hE,{ref:r,className:J("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));tB.displayName=hE.displayName;const Xs=f.forwardRef(({className:e,children:t,...r},n)=>i.jsxs(fE,{ref:n,className:J("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...r,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(eB,{children:i.jsx(Dt,{className:"h-4 w-4"})})}),i.jsx(X6,{children:t})]}));Xs.displayName=fE.displayName;const rB=f.forwardRef(({className:e,...t},r)=>i.jsx(gE,{ref:r,className:J("-mx-1 my-1 h-px bg-muted",e),...t}));rB.displayName=gE.displayName;var U0=1,nB=.9,sB=.8,aB=.17,Jp=.1,Xp=.999,iB=.9999,oB=.99,lB=/[\\\/_+.#"@\[\(\{&]/,cB=/[\\\/_+.#"@\[\(\{&]/g,dB=/[\s-]/,wE=/[\s-]/g;function Kg(e,t,r,n,s,a,o){if(a===t.length)return s===e.length?U0:oB;var l=`${s},${a}`;if(o[l]!==void 0)return o[l];for(var c=n.charAt(a),d=r.indexOf(c,s),u=0,h,p,m,y;d>=0;)h=Kg(e,t,r,n,d+1,a+1,o),h>u&&(d===s?h*=U0:lB.test(e.charAt(d-1))?(h*=sB,m=e.slice(s,d-1).match(cB),m&&s>0&&(h*=Math.pow(Xp,m.length))):dB.test(e.charAt(d-1))?(h*=nB,y=e.slice(s,d-1).match(wE),y&&s>0&&(h*=Math.pow(Xp,y.length))):(h*=aB,s>0&&(h*=Math.pow(Xp,d-s))),e.charAt(d)!==t.charAt(a)&&(h*=iB)),(h<Jp&&r.charAt(d-1)===n.charAt(a+1)||n.charAt(a+1)===n.charAt(a)&&r.charAt(d-1)!==n.charAt(a))&&(p=Kg(e,t,r,n,d+1,a+2,o),p*Jp>h&&(h=p*Jp)),h>u&&(u=h),d=r.indexOf(c,d+1);return o[l]=u,u}function B0(e){return e.toLowerCase().replace(wE," ")}function uB(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Kg(e,t,B0(e),B0(t),0,0,{})}var Yl='[cmdk-group=""]',em='[cmdk-group-items=""]',hB='[cmdk-group-heading=""]',xE='[cmdk-item=""]',W0=`${xE}:not([aria-disabled="true"])`,Zg="cmdk-item-select",vo="data-value",fB=(e,t,r)=>uB(e,t,r),bE=f.createContext(void 0),bd=()=>f.useContext(bE),_E=f.createContext(void 0),ow=()=>f.useContext(_E),jE=f.createContext(void 0),kE=f.forwardRef((e,t)=>{let r=wo(()=>{var A,ee;return{search:"",value:(ee=(A=e.value)!=null?A:e.defaultValue)!=null?ee:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=wo(()=>new Set),s=wo(()=>new Map),a=wo(()=>new Map),o=wo(()=>new Set),l=NE(e),{label:c,children:d,value:u,onValueChange:h,filter:p,shouldFilter:m,loop:y,disablePointerSelection:g=!1,vimBindings:x=!0,...b}=e,v=cr(),w=cr(),_=cr(),j=f.useRef(null),k=kB();qi(()=>
vendor: 14,467 bytes, line 585
585{if(u!==void 0){let A=u.trim();r.current.value=A,N.emit()}},[u]),qi(()=>{k(6,L)},[]);let N=f.useMemo(()=>({subscribe:A=>(o.current.add(A),()=>o.current.delete(A)),snapshot:()=>r.current,setState:(A,ee,te)=>{var q,he,Z,me;if(!Object.is(r.current[A],ee)){if(r.current[A]=ee,A==="search")M(),I(),k(1,H);else if(A==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ge=document.getElementById(_);ge?ge.focus():(q=document.getElementById(v))==null||q.focus()}if(k(7,()=>{var ge;r.current.selectedItemId=(ge=F())==null?void 0:ge.id,N.emit()}),te||k(5,L),((he=l.current)==null?void 0:he.value)!==void 0){let ge=ee??"";(me=(Z=l.current).onValueChange)==null||me.call(Z,ge);return}}N.emit()}},emit:()=>{o.current.forEach(A=>A())}}),[]),P=f.useMemo(()=>({value:(A,ee,te)=>{var q;ee!==((q=a.current.get(A))==null?void 0:q.value)&&(a.current.set(A,{value:ee,keywords:te}),r.current.filtered.items.set(A,T(ee,te)),k(2,()=>{I(),N.emit()}))},item:(A,ee)=>(n.current.add(A),ee&&(s.current.has(ee)?s.current.get(ee).add(A):s.current.set(ee,new Set([A]))),k(3,()=>{M(),I(),r.current.value||H(),N.emit()}),()=>{a.current.delete(A),n.current.delete(A),r.current.filtered.items.delete(A);let te=F();k(4,()=>{M(),(te==null?void 0:te.getAttribute("id"))===A&&H(),N.emit()})}),group:A=>(s.current.has(A)||s.current.set(A,new Set),()=>{a.current.delete(A),s.current.delete(A)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:v,inputId:_,labelId:w,listInnerRef:j}),[]);function T(A,ee){var te,q;let he=(q=(te=l.current)==null?void 0:te.filter)!=null?q:fB;return A?he(A,r.current.search,ee):0}function I(){if(!r.current.search||l.current.shouldFilter===!1)return;let A=r.current.filtered.items,ee=[];r.current.filtered.groups.forEach(q=>{let he=s.current.get(q),Z=0;he.forEach(me=>{let ge=A.get(me);Z=Math.max(ge,Z)}),ee.push([q,Z])});let te=j.current;Y().sort((q,he)=>{var Z,me;let ge=q.getAttribute("id"),Ne=he.getAttribute("id");return((Z=A.get(Ne))!=null?Z:0)-((me=A.get(ge))!=null?me:0)}).forEach(q=>{let he=q.closest(em);he?he.appendChild(q.parentElement===he?q:q.closest(`${em} > *`)):te.appendChild(q.parentElement===te?q:q.closest(`${em} > *`))}),ee.sort((q,he)=>he[1]-q[1]).forEach(q=>{var he;let Z=(he=j.current)==null?void 0:he.querySelector(`${Yl}[${vo}="${encodeURIComponent(q[0])}"]`);Z==null||Z.parentElement.appendChild(Z)})}function H(){let A=Y().find(te=>te.getAttribute("aria-disabled")!=="true"),ee=A==null?void 0:A.getAttribute(vo);N.setState("value",ee||void 0)}function M(){var A,ee,te,q;if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let he=0;for(let Z of n.current){let me=(ee=(A=a.current.get(Z))==null?void 0:A.value)!=null?ee:"",ge=(q=(te=a.current.get(Z))==null?void 0:te.keywords)!=null?q:[],Ne=T(me,ge);r.current.filtered.items.set(Z,Ne),Ne>0&&he++}for(let[Z,me]of s.current)for(let ge of me)if(r.current.filtered.items.get(ge)>0){r.current.filtered.groups.add(Z);break}r.current.filtered.count=he}function L(){var A,ee,te;let q=F();q&&(((A=q.parentElement)==null?void 0:A.firstChild)===q&&((te=(ee=q.closest(Yl))==null?void 0:ee.querySelector(hB))==null||te.scrollIntoView({block:"nearest"})),q.scrollIntoView({block:"nearest"}))}function F(){var A;return(A=j.current)==null?void 0:A.querySelector(`${xE}[aria-selected="true"]`)}function Y(){var A;return Array.from(((A=j.current)==null?void 0:A.querySelectorAll(W0))||[])}function Q(A){let ee=Y()[A];ee&&N.setState("value",ee.getAttribute(vo))}function S(A){var ee;let te=F(),q=Y(),he=q.findIndex(me=>me===te),Z=q[he+A];(ee=l.current)!=null&&ee.loop&&(Z=he+A<0?q[q.length-1]:he+A===q.length?q[0]:q[he+A]),Z&&N.setState("value",Z.getAttribute(vo))}function z(A){let ee=F(),te=ee==null?void 0:ee.closest(Yl),q;for(;te&&!q;)te=A>0?_B(te,Yl):jB(te,Yl),q=te==null?void 0:te.querySelector(W0);q?N.setState("value",q.getAttribute(vo)):S(A)}let C=()=>Q(Y().length-1),B=A=>{A.preventDefault(),A.metaKey?C():A.altKey?z(1):S(1)},ce=A=>{A.preventDefault(),A.metaKey?Q(0):A.altKey?z(-1):S(-1)};return f.createElement(Se.div,{ref:t,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:A=>{var ee;(ee=b.onKeyDown)==null||ee.call(b,A);let te=A.nativeEvent.isComposing||A.keyCode===229;if(!(A.defaultPrevented||te))switch(A.key){case"n":case"j":{x&&A.ctrlKey&&B(A);break}case"ArrowDown":{B(A);break}case"p":case"k":{x&&A.ctrlKey&&ce(A);break}case"ArrowUp":{ce(A);break}case"Home":{A.preventDefault(),Q(0);break}case"End":{A.preventDefault(),C();break}case"Enter":{A.preventDefault();let q=F();if(q){let he=new Event(Zg);q.dispatchEvent(he)}}}}},f.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:SB},c),Lf(e,A=>f.createElement(_E.Provider,{value:N},f.createElement(bE.Provider,{value:P},A))))}),pB=f.forwardRef((e,t)=>{var r,n;let s=cr(),a=f.useRef(null),o=f.useContext(jE),l=bd(),c=NE(e),d=(n=(r=c.current)==null?void 0:r.forceMount)!=null?n:o==null?void 0:o.forceMount;qi(()=>{if(!d)return l.item(s,o==null?void 0:o.id)},[d]);let u=SE(s,a,[e.value,e.children,a],e.keywords),h=ow(),p=Za(k=>k.value&&k.value===u.current),m=Za(k=>d||l.filter()===!1?!0:k.search?k.filtered.items.get(s)>0:!0);f.useEffect(()=>{let k=a.current;if(!(!k||e.disabled))return k.addEventListener(Zg,y),()=>k.removeEventListener(Zg,y)},[m,e.onSelect,e.disabled]);function y(){var k,N;g(),(N=(k=c.current).onSelect)==null||N.call(k,u.current)}function g(){h.setState("value",u.current,!0)}if(!m)return null;let{disabled:x,value:b,onSelect:v,forceMount:w,keywords:_,...j}=e;return f.createElement(Se.div,{ref:Ai(a,t),...j,id:s,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!p,"data-disabled":!!x,"data-selected":!!p,onPointerMove:x||l.getDisablePointerSelection()?void 0:g,onClick:x?void 0:y},e.children)}),mB=f.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...a}=e,o=cr(),l=f.useRef(null),c=f.useRef(null),d=cr(),u=bd(),h=Za(m=>s||u.filter()===!1?!0:m.search?m.filtered.groups.has(o):!0);qi(()=>u.group(o),[]),SE(o,l,[e.value,e.heading,c]);let p=f.useMemo(()=>({id:o,forceMount:s}),[s]);return f.createElement(Se.div,{ref:Ai(l,t),...a,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&f.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),Lf(e,m=>f.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},f.createElement(jE.Provider,{value:p},m))))}),gB=f.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=f.useRef(null),a=Za(o=>!o.search);return!r&&!a?null:f.createElement(Se.div,{ref:Ai(s,t),...n,"cmdk-separator":"",role:"separator"})}),yB=f.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=e.value!=null,a=ow(),o=Za(d=>d.search),l=Za(d=>d.selectedItemId),c=bd();return f.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),f.createElement(Se.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?e.value:o,onChange:d=>{s||a.setState("search",d.target.value),r==null||r(d.target.value)}})}),vB=f.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,a=f.useRef(null),o=f.useRef(null),l=Za(d=>d.selectedItemId),c=bd();return f.useEffect(()=>{if(o.current&&a.current){let d=o.current,u=a.current,h,p=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let m=d.offsetHeight;u.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return p.observe(d),()=>{cancelAnimationFrame(h),p.unobserve(d)}}},[]),f.createElement(Se.div,{ref:Ai(a,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},Lf(e,d=>f.createElement("div",{ref:Ai(o,c.listInnerRef),"cmdk-list-sizer":""},d)))}),wB=f.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:a,container:o,...l}=e;return f.createElement(Tf,{open:r,onOpenChange:n},f.createElement(Rf,{container:o},f.createElement(Dl,{"cmdk-overlay":"",className:s}),f.createElement(Il,{"aria-label":e.label,"cmdk-dialog":"",className:a},f.createElement(kE,{ref:t,...l}))))}),xB=f.forwardRef((e,t)=>Za(r=>r.filtered.count===0)?f.createElement(Se.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),bB=f.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...a}=e;return f.createElement(Se.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Lf(e,o=>f.createElement("div",{"aria-hidden":!0},o)))}),Hr=Object.assign(kE,{List:vB,Item:pB,Input:yB,Group:mB,Separator:gB,Dialog:wB,Empty:xB,Loading:bB});function _B(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function jB(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function NE(e){let t=f.useRef(e);return qi(()=>{t.current=e}),t}var qi=typeof window>"u"?f.useEffect:f.useLayoutEffect;function wo(e){let t=f.useRef();return t.current===void 0&&(t.current=e()),t}function Za(e){let t=ow(),r=()=>e(t.snapshot());return f.useSyncExternalStore(t.subscribe,r,r)}function SE(e,t,r,n=[]){let s=f.useRef(),a=bd();return qi(()=>{var o;let l=(()=>{var d;for(let u of r){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(d=u.current.textContent)==null?void 0:d.trim():s.current}})(),c=n.map(d=>d.trim());a.value(e,l,c),(o=t.current)==null||o.setAttribute(vo,l),s.current=l}),s}var kB=()=>{let[e,t]=f.useState(),r=wo(()=>new Map);return qi(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,s)=>{r.current.set(n,s),t({})}};function NB(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Lf({asChild:e,children:t},r){return e&&f.isValidElement(t)?f.cloneElement(NB(t),{ref:t.ref},r(t.props.children)):r(t)}var SB={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const CE=f.forwardRef(({className:e,...t},r)=>i.jsx(Hr,{ref:r,className:J("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));CE.displayName=Hr.displayName;const zE=f.forwardRef(({className:e,...t},r)=>i.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[i.jsx(ud,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),i.jsx(Hr.Input,{ref:r,className:J("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));zE.displayName=Hr.Input.displayName;const EE=f.forwardRef(({className:e,...t},r)=>i.jsx(Hr.List,{ref:r,className:J("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));EE.displayName=Hr.List.displayName;const PE=f.forwardRef((e,t)=>i.jsx(Hr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));PE.displayName=Hr.Empty.displayName;const TE=f.forwardRef(({className:e,...t},r)=>i.jsx(Hr.Group,{ref:r,className:J("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));TE.displayName=Hr.Group.displayName;const CB=f.forwardRef(({className:e,...t},r)=>i.jsx(Hr.Separator,{ref:r,className:J("-mx-1 h-px bg-border",e),...t}));CB.displayName=Hr.Separator.displayName;const RE=f.forwardRef(({className:e,...t},r)=>i.jsx(Hr.Item,{ref:r,className:J("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));RE.displayName=Hr.Item.displayName;var Uf="Popover",[OE,g7]=dn(Uf,[Pl]),_d=Pl(),[zB,ri]=OE(Uf),AE=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:s,onOpenChange:a,modal:o=!1}=e,l=_d(t),c=f.useRef(null),[d,u]=f.useState(!1),[h,p]=jn({prop:n,defaultProp:s??!1,onChange:a,caller:Uf});return i.jsx(dv,{...l,children:i.jsx(zB,{scope:t,contentId:cr(),triggerRef:c,open:h,onOpenChange:p,onOpenToggle:f.useCallback(()=>p(m=>!m),[p]),hasCustomAnchor:d,onCustomAnchorAdd:f.useCallback(()=>u(!0),[]),onCustomAnchorRemove:f.useCallback(()=>u(!1),[]),modal:o,children:r})})};AE.displayName=Uf;var DE="PopoverAnchor",EB=f.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=ri(DE,r),a=_d(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=s;return f.useEffect(()=>(o(),()=>l()),[o,l]),i.jsx(of,{...a,...n,ref:t})});EB.displayName=DE;var IE="PopoverTrigger",ME=f.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=ri(IE,r),a=_d(r),o=tt(t,s.triggerRef),l=i.jsx(Se.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":BE(s.open),...n,ref:o,onClick:ke(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:i.jsx(of,{asChild:!0,...a,children:l})});ME.displayName=IE;var lw="PopoverPortal",[PB,TB]=OE(lw,{forceMount:void 0}),FE=e=>{const{__scopePopover:t,forceMount:r,children:n,container:s}=e,a=ri(lw,t);return i.jsx(PB,{scope:t,forceMount:r,children:i.jsx(ts,{present:r||a.open,children:i.jsx(cd,{asChild:!0,container:s,children:n})})})};FE.displayName=lw;var xl="PopoverContent",$E=f.forwardRef((e,t)=>{const r=TB(xl,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,a=ri(xl,e.__scopePopover);return i.jsx(ts,{present:n||a.open,children:a.modal?i.jsx(OB,{...s,ref:t}):i.jsx(AB,{...s,ref:t})})});$E.displayName=xl;var RB=Di("PopoverContent.RemoveScroll"),OB=f.forwardRef((e,t)=>{const r=ri(xl,e.__scopePopover),n=f.useRef(null),s=tt(t,n),a=f.useRef(!1);return f.useEffect(()=>{const o=n.current;if(o)return Bv(o)},[]),i.jsx(Ef,{as:RB,allowPinchZoom:!0,children:i.jsx(LE,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),a.current||(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ke(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:ke(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),AB=f.forwardRef((e,t)=>
585{const r=ri(xl,e.__scopePopover),n=f.useRef(!1),s=f.useRef(!1);return i.jsx(LE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),a.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:a=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((d=r.triggerRef.current)==null?void 0:d.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),LE=f.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...h}=e,p=ri(xl,r),m=_d(r);return Uv(),i.jsx(Cf,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(kl,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>p.onOpenChange(!1),children:i.jsx(uv,{"data-state":BE(p.open),role:"dialog",id:p.contentId,...m,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),UE="PopoverClose",DB=f.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=ri(UE,r);return i.jsx(Se.button,{type:"button",...n,ref:t,onClick:ke(e.onClick,()=>s.onOpenChange(!1))})});DB.displayName=UE;var IB="PopoverArrow",MB=f.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=_d(r);return i.jsx(hv,{...s,...n,ref:t})});MB.displayName=IB;function BE(e){return e?"open":"closed"}var FB=AE,$B=ME,LB=FE,WE=$E;const VE=FB,qE=$B,cw=f.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>i.jsx(LB,{children:i.jsx(WE,{ref:s,align:t,sideOffset:r,className:J("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));cw.displayName=WE.displayName;function dw({clients:e,value:t,onValueChange:r,placeholder:n="Wybierz klienta...",disabled:s=!1}){const[a,o]=f.useState(!1),l=e.find(c=>c.id===t);return i.jsxs(VE,{open:a,onOpenChange:o,children:[i.jsx(qE,{asChild:!0,children:i.jsxs(G,{variant:"outline",role:"combobox","aria-expanded":a,className:"w-full justify-between font-normal",disabled:s,children:[l?l.name:n,i.jsx(EO,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),i.jsx(cw,{className:"w-[--radix-popover-trigger-width] p-0 z-50",align:"start",children:i.jsxs(CE,{children:[i.jsx(zE,{placeholder:"Szukaj klienta..."}),i.jsxs(EE,{children:[i.jsx(PE,{children:"Nie znaleziono klienta."}),i.jsx(TE,{children:e.map(c=>i.jsxs(RE,{value:c.name,onSelect:()=>{r(c.id===t?"":c.id),o(!1)},children:[i.jsx(Dt,{className:J("mr-2 h-4 w-4",t===c.id?"opacity-100":"opacity-0")}),c.name]},c.id))})]})]})})]})}var Ie=function(){return Ie=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Ie.apply(this,arguments)};function UB(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function HE(e,t,r){for(var n=0,s=t.length,a;n<s;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}
585function jd(e){return e.mode==="multiple"}function kd(e){return e.mode==="range"}function Bf(e){return e.mode==="single"}var BB={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function WB(e,t){return xt(e,"LLLL y",t)}function VB(e,t){return xt(e,"d",t)}function qB(e,t){return xt(e,"LLLL",t)}function HB(e){return"".concat(e)}function KB(e,t){return xt(e,"cccccc",t)}function ZB(e,t){return xt(e,"yyyy",t)}var GB=Object.freeze({__proto__:null,formatCaption:WB,formatDay:VB,formatMonthCaption:qB,formatWeekNumber:HB,formatWeekdayName:KB,formatYearCaption:ZB}),QB=function(e,t,r){return xt(e,"do MMMM (EEEE)",r)},YB=function(){return"Month: "},JB=function(){return"Go to next month"},XB=function(){return"Go to previous month"},eW=function(e,t){return xt(e,"cccc",t)},tW=function(e){return"Week n. ".concat(e)},rW=function(){return"Year: "},nW=Object.freeze({__proto__:null,labelDay:QB,labelMonthDropdown:YB,labelNext:JB,labelPrevious:XB,labelWeekNumber:tW,labelWeekday:eW,labelYearDropdown:rW});function sW(){var e="buttons",t=BB,r=Ez,n={},s={},a=1,o={},l=new Date;return{captionLayout:e,classNames:t,formatters:GB,labels:nW,locale:r,modifiersClassNames:n,modifiers:s,numberOfMonths:a,styles:o,today:l,mode:"default"}}function aW(e){var t=e.fromYear,r=e.toYear,n=e.fromMonth,s=e.toMonth,a=e.fromDate,o=e.toDate;return n?a=Wr(n):t&&(a=new Date(t,0,1)),s?o=tw(s):r&&(o=new Date(r,11,31)),{fromDate:a?wl(a):void 0,toDate:o?wl(o):void 0}}var KE=f.createContext(void 0);function iW(e){var t,r=e.initialProps,n=sW(),s=aW(r),a=s.fromDate,o=s.toDate,l=(t=r.captionLayout)!==null&&t!==void 0?t:n.captionLayout;l!=="buttons"&&(!a||!o)&&(l="buttons");var c;(Bf(r)||jd(r)||kd(r))&&(c=r.onSelect);var d=Ie(Ie(Ie({},n),r),{captionLayout:l,classNames:Ie(Ie({},n.classNames),r.classNames),components:Ie({},r.components),formatters:Ie(Ie({},n.formatters),r.formatters),fromDate:a,labels:Ie(Ie({},n.labels),r.labels),mode:r.mode||n.mode,modifiers:Ie(Ie({},n.modifiers),r.modifiers),modifiersClassNames:Ie(Ie({},n.modifiersClassNames),r.modifiersClassNames),onSelect:c,styles:Ie(Ie({},n.styles),r.styles),toDate:o});return i.jsx(KE.Provider,{value:d,children:e.children})}function bt(){var e=f.useContext(KE);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function ZE(e){var t=bt(),r=t.locale,n=t.classNames,s=t.styles,a=t.formatters.formatCaption;return i.jsx("div",{className:n.caption_label,style:s.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:a(e.displayMonth,{locale:r})})}function oW(e){return i.jsx("svg",Ie({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:i.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}
vendor: 1,470 bytes, line 585
585function GE(e){var t,r,n=e.onChange,s=e.value,a=e.children,o=e.caption,l=e.className,c=e.style,d=bt(),u=(r=(t=d.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&r!==void 0?r:oW;return i.jsxs("div",{className:l,style:c,children:[i.jsx("span",{className:d.classNames.vhidden,children:e["aria-label"]}),i.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:s,onChange:n,children:a}),i.jsxs("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true",children:[o,i.jsx(u,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})]})]})}function lW(e){var t,r=bt(),n=r.fromDate,s=r.toDate,a=r.styles,o=r.locale,l=r.formatters.formatMonthCaption,c=r.classNames,d=r.components,u=r.labels.labelMonthDropdown;if(!n)return i.jsx(i.Fragment,{});if(!s)return i.jsx(i.Fragment,{});var h=[];if(MU(n,s))for(var p=Wr(n),m=n.getMonth();m<=s.getMonth();m++)h.push(Qp(p,m));else for(var p=Wr(new Date),m=0;m<=11;m++)h.push(Qp(p,m));var y=function(x){var b=Number(x.target.value),v=Qp(Wr(e.displayMonth),b);e.onChange(v)},g=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:GE;return i.jsx(g,{name:"months","aria-label":u(),className:c.dropdown_month,style:a.dropdown_month,onChange:y,value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:o}),children:h.map(function(x){return i.jsx("option",{value:x.getMonth(),children:l(x,{locale:o})},x.getMonth())})})}
585function cW(e){var t,r=e.displayMonth,n=bt(),s=n.fromDate,a=n.toDate,o=n.locale,l=n.styles,c=n.classNames,d=n.components,u=n.formatters.formatYearCaption,h=n.labels.labelYearDropdown,p=[];if(!s)return i.jsx(i.Fragment,{});if(!a)return i.jsx(i.Fragment,{});for(var m=s.getFullYear(),y=a.getFullYear(),g=m;g<=y;g++)p.push(I0(Sz(new Date),g));var x=function(v){var w=I0(Wr(r),Number(v.target.value));e.onChange(w)},b=(t=d==null?void 0:d.Dropdown)!==null&&t!==void 0?t:GE;return i.jsx(b,{name:"years","aria-label":h(),className:c.dropdown_year,style:l.dropdown_year,onChange:x,value:r.getFullYear(),caption:u(r,{locale:o}),children:p.map(function(v){return i.jsx("option",{value:v.getFullYear(),children:u(v,{locale:o})},v.getFullYear())})})}function dW(e,t){var r=f.useState(e),n=r[0],s=r[1],a=t===void 0?n:t;return[a,s]}function uW(e){var t=e.month,r=e.defaultMonth,n=e.today,s=t||r||n||new Date,a=e.toDate,o=e.fromDate,l=e.numberOfMonths,c=l===void 0?1:l;if(a&&td(a,s)<0){var d=-1*(c-1);s=Jn(a,d)}return o&&td(s,o)<0&&(s=o),Wr(s)}function hW(){var e=bt(),t=uW(e),r=dW(t,e.month),n=r[0],s=r[1],a=function(o){var l;if(!e.disableNavigation){var c=Wr(o);s(c),(l=e.onMonthChange)===null||l===void 0||l.call(e,c)}};return[n,a]}function fW(e,t){for(var r=t.reverseMonths,n=t.numberOfMonths,s=Wr(e),a=Wr(Jn(s,n)),o=td(a,s),l=[],c=0;c<o;c++){var d=Jn(s,c);l.push(d)}return r&&(l=l.reverse()),l}function pW(e,t){if(!t.disableNavigation){var r=t.toDate,n=t.pagedNavigation,s=t.numberOfMonths,a=s===void 0?1:s,o=n?a:1,l=Wr(e);if(!r)return Jn(l,o);var c=td(r,e);if(!(c<a))return Jn(l,o)}}function mW(e,t){if(!t.disableNavigation){var r=t.fromDate,n=t.pagedNavigation,s=t.numberOfMonths,a=s===void 0?1:s,o=n?a:1,l=Wr(e);if(!r)return Jn(l,-o);var c=td(l,r);if(!(c<=0))return Jn(l,-o)}}var QE=f.createContext(void 0);function gW(e){var t=bt(),r=hW(),n=r[0],s=r[1],a=fW(n,t),o=pW(n,t),l=mW(n,t),c=function(h){return a.some(function(p){return nw(h,p)})},d=function(h,p){c(h)||(p&&Az(h,p)?s(Jn(h,1+t.numberOfMonths*-1)):s(h))},u={currentMonth:n,displayMonths:a,goToMonth:s,goToDate:d,previousMonth:l,nextMonth:o,isDateDisplayed:c};return i.jsx(QE.Provider,{value:u,children:e.children})}function Nd(){var e=f.useContext(QE);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function V0(e){var t,r=bt(),n=r.classNames,s=r.styles,a=r.components,o=Nd().goToMonth,l=function(u){o(Jn(u,e.displayIndex?-e.dis
585playIndex:0))},c=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:ZE,d=i.jsx(c,{id:e.id,displayMonth:e.displayMonth});return i.jsxs("div",{className:n.caption_dropdowns,style:s.caption_dropdowns,children:[i.jsx("div",{className:n.vhidden,children:d}),i.jsx(lW,{onChange:l,displayMonth:e.displayMonth}),i.jsx(cW,{onChange:l,displayMonth:e.displayMonth})]})}function yW(e){return i.jsx("svg",Ie({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:i.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function vW(e){return i.jsx("svg",Ie({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:i.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Th=f.forwardRef(function(e,t){var r=bt(),n=r.classNames,s=r.styles,a=[n.button_reset,n.button];e.className&&a.push(e.className);var o=a.join(" "),l=Ie(Ie({},s.button_reset),s.button);return e.style&&Object.assign(l,e.style),i.jsx("button",Ie({},e,{ref:t,type:"button",className:o,style:l}))});function wW(e){var t,r,n=bt(),s=n.dir,a=n.locale,o=n.classNames,l=n.styles,c=n.labels,d=c.labelPrevious,u=c.labelNext,h=n.components;if(!e.nextMonth&&!e.previousMonth)return i.jsx(i.Fragment,{});var p=d(e.previousMonth,{locale:a}),m=[o.nav_button,o.nav_button_previous].join(" "),y=u(e.nextMonth,{locale:a}),g=[o.nav_button,o.nav_button_next].join(" "),x=(t=h==null?void 0:h.IconRight)!==null&&t!==void 0?t:vW,b=(r=h==null?void 0:h.IconLeft)!==null&&r!==void 0?r:yW;return i.jsxs("div",{className:o.nav,style:l.nav,children:[!e.hidePrevious&&i.jsx(Th,{name:"previous-month","aria-label":p,className:m,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:s==="rtl"?i.jsx(x,{className:o.nav_icon,style:l.nav_icon}):i.jsx(b,{className:o.nav_icon,style:l.nav_icon})}),!e.hideNext&&i.jsx(Th,{name:"next-month","aria-label":y,className:g,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:s==="rtl"?i.jsx(b,{className:o.nav_icon,style:l.nav_icon}):i.jsx(x,{className:o.nav_icon,style:l.nav_icon})})]})}function q0(e){var t=bt().numberOfMonths,r=Nd(),n=r.previousMonth,s=r.nextMonth,a=r.goToMonth,o=r.displayMonths,l=o.findIndex(function(y){return nw(e.displayMonth,y)}),c=l===0,d=l===o.length-1,u=t>1&&(c||!d),h=t>1&&(d||!c),p=function(){n&&a(n)},m=function(){s&&a(s)};return i.jsx(wW,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:h,nextMonth:s,previousMonth:n,onPreviousClick:p,onNextClick:m})}function xW(e){var t,r=bt(),n=r.classNames,s=r.disableNavigation,a=r.styles,o=r.captionLayout,l=r.components,c=(t=l==null?void 0:l.CaptionLabel)!==null&&t!==void 0?t:ZE,d;return s?d=i.jsx(c,{id:e.id,displayMonth:e.displayMonth}):o==="dropdown"?d=i.jsx(V0,{displayMonth:e.displayMonth,id:e.id}):o==="dropdown-buttons"?d=i.jsxs(i.Fragment,{children:[i.jsx(V0,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),i.jsx(q0,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):d=i.jsxs(i.Fragment,{children:[i.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),i.jsx(q0,{displayMonth:e.displayMonth,id:e.id})]}),i.jsx("div",{className:n.caption,style:a.caption,children:d})}
585function bW(e){var t=bt(),r=t.footer,n=t.styles,s=t.classNames.tfoot;return r?i.jsx("tfoot",{className:s,style:n.tfoot,children:i.jsx("tr",{children:i.jsx("td",{colSpan:8,children:r})})}):i.jsx(i.Fragment,{})}function _W(e,t,r){for(var n=r?Bi(new Date):kn(new Date,{locale:e,weekStartsOn:t}),s=[],a=0;a<7;a++){var o=Sr(n,a);s.push(o)}return s}function jW(){var e=bt(),t=e.classNames,r=e.styles,n=e.showWeekNumber,s=e.locale,a=e.weekStartsOn,o=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,d=_W(s,a,o);return i.jsxs("tr",{style:r.head_row,className:t.head_row,children:[n&&i.jsx("td",{style:r.head_cell,className:t.head_cell}),d.map(function(u,h){return i.jsx("th",{scope:"col",className:t.head_cell,style:r.head_cell,"aria-label":c(u,{locale:s}),children:l(u,{locale:s})},h)})]})}function kW(){var e,t=bt(),r=t.classNames,n=t.styles,s=t.components,a=(e=s==null?void 0:s.HeadRow)!==null&&e!==void 0?e:jW;return i.jsx("thead",{style:n.head,className:r.head,children:i.jsx(a,{})})}function NW(e){var t=bt(),r=t.locale,n=t.formatters.formatDay;return i.jsx(i.Fragment,{children:n(e.date,{locale:r})})}var uw=f.createContext(void 0);function SW(e){if(!jd(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return i.jsx(uw.Provider,{value:t,children:e.children})}return i.jsx(CW,{initialProps:e.initialProps,children:e.children})}function CW(e){var t=e.initialProps,r=e.children,n=t.selected,s=t.min,a=t.max,o=function(d,u,h){var p,m;(p=t.onDayClick)===null||p===void 0||p.call(t,d,u,h);var y=!!(u.selected&&s&&(n==null?void 0:n.length)===s);if(!y){var g=!!(!u.selected&&a&&(n==null?void 0:n.length)===a);if(!g){var x=n?HE([],n):[];if(u.selected){var b=x.findIndex(function(v){return Pr(d,v)});x.splice(b,1)}else x.push(d);(m=t.onSelect)===null||m===void 0||m.call(t,x,d,u,h)}}},l={disabled:[]};n&&l.disabled.push(function(d){var u=a&&n.length>a-1,h=n.some(function(p){return Pr(p,d)});return!!(u&&!h)});var c={selected:n,onDayClick:o,modifiers:l};return i.jsx(uw.Provider,{value:c,children:r})}function hw(){var e=f.useContext(uw);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function zW(e,t){var r=t||{},n=r.from,s=r.to;return n&&s?Pr(s,e)&&Pr(n,e)?void 0:Pr(s,e)?{from:s,to:void 0}:Pr(n,e)?void 0:Ug(n,e)?{from:e,to:s}:{from:n,to:e}:s?Ug(e,s)?{from:s,to:e}:{from:e,to:s}:n?Az(e,n)?{from:e,to:n}:{from:n,to:e}:{from:e,to:void 0}}var fw=f.createContext(void 0);function EW(e){if(!kd(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return i.jsx(fw.Provider,{value:t,children:e.children})}return i.jsx(PW,{initialProps:e.initialProps,children:e.children})}function PW(e){var t=e.initialProps,r=e.children,n=t.selected,s=n||{},a=s.from,o=s.to,l=t.min,c=t.max,d=function(m,y,g){var x,b;(x=t.onDayClick)===null||x===void 0||x.call(t,m,y,g);var v=zW(m,n);(b=t.onSelect)===null||b===void 0||b.call(t,v,m,y,g)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(u.range_start=[a],o?(u.range_end=[o],Pr(a,o)||(u.range_middle=[{after:a,before:o}])):u.range_end=[a]):o&&(u.range_start=[o],u.range_end=[o]),l&&(a&&!o&&u.disabled.push({after:Gp(a,l-1),before:Sr(a,l-1)}),a&&o&&u.disabled.push({after:a,before:Sr(a,l-1)}),!a&&o&&u.disabled.push({after:Gp(o,l-1),before:Sr(o,l-1)})),c){if(a&&!o&&(u.disabled.push({before:Sr(a,-c+1)}),u.disabled.push({after:Sr(a,c-1)})),a&&o){var h=gs(o,a)+1,p=c-h;u.disabled.push({before:Gp(a,p)}),u.disabled.push({after:Sr(o,p)})}!a&&o&&(u.disabled.push({before:Sr(o,-c+1)}),u.disabled.push({after:Sr(o,c-1)}))}return i.jsx(fw.Provider,{value:{selected:n,onDayClick:d,modifiers:u},children:r})}function pw(){var e=f.useContext(fw);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Ru(e){return Array.isArray(e)?HE([],e):e!==void 0?[e]:[]}function TW(e){var t={};return Object.entries(e).forEach(function(r){var n=r[0],s=r[1];t[n]=Ru(s)}),t}var es;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(es||(es={}));var RW=es.Selected,Ps=es.Disabled,OW=es.Hidden,AW=es.Today,tm=es.RangeEnd,rm=es.RangeMiddle,nm=es.RangeStart,DW=es.Outside;function IW(e,t,r){var n,s=(n={},n[RW]=Ru(e.selected),n[Ps]=Ru(e.disabled),n[OW]=Ru(e.hidden),n[AW]=[e.today],n[tm]=[],n[rm]=[],n[nm]=[],n[DW]=[],n);return e.fromDate&&s[Ps].push({before:e.fromDate}),e.toDate&&s[Ps].push({after:e.toDate}),jd(e)?s[Ps]=s[Ps].concat(t.modifiers[Ps]):kd(e)&&(s[Ps]=s[Ps].concat(r.modifiers[Ps]),s[nm]=r.modifiers[nm],s[rm]=r.modifiers[rm],s[tm]=r.modifiers[tm]),s}var YE=f.createContext(void 0);
585function MW(e){var t=bt(),r=hw(),n=pw(),s=IW(t,r,n),a=TW(t.modifiers),o=Ie(Ie({},s),a);return i.jsx(YE.Provider,{value:o,children:e.children})}function JE(){var e=f.useContext(YE);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function FW(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function $W(e){return!!(e&&typeof e=="object"&&"from"in e)}function LW(e){return!!(e&&typeof e=="object"&&"after"in e)}function UW(e){return!!(e&&typeof e=="object"&&"before"in e)}function BW(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function WW(e,t){var r,n=t.from,s=t.to;if(n&&s){var a=gs(s,n)<0;a&&(r=[s,n],n=r[0],s=r[1]);var o=gs(e,n)>=0&&gs(s,e)>=0;return o}return s?Pr(s,e):n?Pr(n,e):!1}function VW(e){return ew(e)}function qW(e){return Array.isArray(e)&&e.every(ew)}function HW(e,t){return t.some(function(r){if(typeof r=="boolean")return r;if(VW(r))return Pr(e,r);if(qW(r))return r.includes(e);if($W(r))return WW(e,r);if(BW(r))return r.dayOfWeek.includes(e.getDay());if(FW(r)){var n=gs(r.before,e),s=gs(r.after,e),a=n>0,o=s<0,l=Ug(r.before,r.after);return l?o&&a:a||o}return LW(r)?gs(e,r.after)>0:UW(r)?gs(r.before,e)>0:typeof r=="function"?r(e):!1})}function mw(e,t,r){var n=Object.keys(t).reduce(function(a,o){var l=t[o];return HW(e,l)&&a.push(o),a},[]),s={};return n.forEach(function(a){return s[a]=!0}),r&&!nw(e,r)&&(s.outside=!0),s}function KW(e,t){for(var r=Wr(e[0]),n=tw(e[e.length-1]),s,a,o=r;o<=n;){var l=mw(o,t),c=!l.disabled&&!l.hidden;if(!c){o=Sr(o,1);continue}if(l.selected)return o;l.today&&!a&&(a=o),s||(s=o),o=Sr(o,1)}return a||s}var ZW=365;function XE(e,t){var r=t.moveBy,n=t.direction,s=t.context,a=t.modifiers,o=t.retry,l=o===void 0?{count:0,lastFocused:e}:o,c=s.weekStartsOn,d=s.fromDate,u=s.toDate,h=s.locale,p={day:Sr,week:Lg,month:Jn,year:T8,startOfWeek:function(x){return s.ISOWeek?Bi(x):kn(x,{locale:h,weekStartsOn:c})},endOfWeek:function(x){return s.ISOWeek?Cz(x):rw(x,{locale:h,weekStartsOn:c})}},m=p[r](e,n==="after"?1:-1);n==="before"&&d?m=R8([d,m]):n==="after"&&u&&(m=O8([u,m]));var y=!0;if(a){var g=mw(m,a);y=!g.disabled&&!g.hidden}return y?m:l.count>ZW?l.lastFocused:XE(m,{moveBy:r,direction:n,context:s,modifiers:a,retry:Ie(Ie({},l),{count:l.count+1})})}var e2=f.createContext(void 0);function GW(e){var t=Nd(),r=JE(),n=f.useState(),s=n[0],a=n[1],o=f.useState(),l=o[0],c=o[1],d=KW(t.displayMonths,r),u=s??(l&&t.isDateDisplayed(l))?l:d,h=function(){c(s),a(void 0)},p=function(x){a(x)},m=bt(),y=function(x,b){if(s){var v=XE(s,{moveBy:x,direction:b,context:m,modifiers:r});Pr(s,v)||(t.goToDate(v,s),p(v))}},g={focusedDay:s,focusTarget:u,blur:h,focus:p,focusDayAfter:function(){return y("day","after")},focusDayBefore:function(){return y("day","before")},focusWeekAfter:function(){return y("week","after")},focusWeekBefore:function(){return y("week","before")},focusMonthBefore:function(){return y("month","before")},focusMonthAfter:function(){return y("month","after")},focusYearBefore:function(){return y("year","before")},focusYearAfter:function(){return y("year","after")},focusStartOfWeek:function(){return y("startOfWeek","before")},focusEndOfWeek:function(){return y("endOfWeek","after")}};return i.jsx(e2.Provider,{value:g,children:e.children})}function gw(){var e=f.useContext(e2);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function QW(e,t){var r=JE(),n=mw(e,r,t);return n}var yw=f.createContext(void 0);function YW(e){if(!Bf(e.initialProps)){var t={selected:void 0};return i.jsx(yw.Provider,{value:t,children:e.children})}return i.jsx(JW,{initialProps:e.initialProps,children:e.children})}function JW(e){var t=e.initialProps,r=e.children,n=function(a,o,l){var c,d,u;if((c=t.onDayClick)===null||c===void 0||c.call(t,a,o,l),o.selected&&!t.required){(d=t.onSelect)===null||d===void 0||d.call(t,void 0,a,o,l);return}(u=t.onSelect)===null||u===void 0||u.call(t,a,a,o,l)},s={selected:t.selected,onDayClick:n};return i.jsx(yw.Provider,{value:s,children:r})}function t2(){var e=f.useContext(yw);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function XW(e,t){var r=bt(),n=t2(),s=hw(),a=pw(),o=gw(),l=o.focusDayAfter,c=o.focusDayBefore,d=o.focusWeekAfter,u=o.focusWeekBefore,h=o.blur,p=o.focus,m=o.focusMonthBefore,y=o.focusMonthAfter,g=o.focusYearBefore,x=o.focusYearAfter,b=o.focusStartOfWeek,v=o.focusEndOfWeek,w=function(S){var z,C,B,ce;
585Bf(r)?(z=n.onDayClick)===null||z===void 0||z.call(n,e,t,S):jd(r)?(C=s.onDayClick)===null||C===void 0||C.call(s,e,t,S):kd(r)?(B=a.onDayClick)===null||B===void 0||B.call(a,e,t,S):(ce=r.onDayClick)===null||ce===void 0||ce.call(r,e,t,S)},_=function(S){var z;p(e),(z=r.onDayFocus)===null||z===void 0||z.call(r,e,t,S)},j=function(S){var z;h(),(z=r.onDayBlur)===null||z===void 0||z.call(r,e,t,S)},k=function(S){var z;(z=r.onDayMouseEnter)===null||z===void 0||z.call(r,e,t,S)},N=function(S){var z;(z=r.onDayMouseLeave)===null||z===void 0||z.call(r,e,t,S)},P=function(S){var z;(z=r.onDayPointerEnter)===null||z===void 0||z.call(r,e,t,S)},T=function(S){var z;(z=r.onDayPointerLeave)===null||z===void 0||z.call(r,e,t,S)},I=function(S){var z;(z=r.onDayTouchCancel)===null||z===void 0||z.call(r,e,t,S)},H=function(S){var z;(z=r.onDayTouchEnd)===null||z===void 0||z.call(r,e,t,S)},M=function(S){var z;(z=r.onDayTouchMove)===null||z===void 0||z.call(r,e,t,S)},L=function(S){var z;(z=r.onDayTouchStart)===null||z===void 0||z.call(r,e,t,S)},F=function(S){var z;(z=r.onDayKeyUp)===null||z===void 0||z.call(r,e,t,S)},Y=function(S){var z;switch(S.key){case"ArrowLeft":S.preventDefault(),S.stopPropagation(),r.dir==="rtl"?l():c();break;case"ArrowRight":S.preventDefault(),S.stopPropagation(),r.dir==="rtl"?c():l();break;case"ArrowDown":S.preventDefault(),S.stopPropagation(),d();break;case"ArrowUp":S.preventDefault(),S.stopPropagation(),u();break;case"PageUp":S.preventDefault(),S.stopPropagation(),S.shiftKey?g():m();break;case"PageDown":S.preventDefault(),S.stopPropagation(),S.shiftKey?x():y();break;case"Home":S.preventDefault(),S.stopPropagation(),b();break;case"End":S.preventDefault(),S.stopPropagation(),v();break}(z=r.onDayKeyDown)===null||z===void 0||z.call(r,e,t,S)},Q={onClick:w,onFocus:_,onBlur:j,onKeyDown:Y,onKeyUp:F,onMouseEnter:k,onMouseLeave:N,onPointerEnter:P,onPointerLeave:T,onTouchCancel:I,onTouchEnd:H,onTouchMove:M,onTouchStart:L};return Q}function e9(){var e=bt(),t=t2(),r=hw(),n=pw(),s=Bf(e)?t.selected:jd(e)?r.selected:kd(e)?
585n.selected:void 0;return s}function t9(e){return Object.values(es).includes(e)}function r9(e,t){var r=[e.classNames.day];return Object.keys(t).forEach(function(n){var s=e.modifiersClassNames[n];if(s)r.push(s);else if(t9(n)){var a=e.classNames["day_".concat(n)];a&&r.push(a)}}),r}function n9(e,t){var r=Ie({},e.styles.day);return Object.keys(t).forEach(function(n){var s;r=Ie(Ie({},r),(s=e.modifiersStyles)===null||s===void 0?void 0:s[n])}),r}function s9(e,t,r){var n,s,a,o=bt(),l=gw(),c=QW(e,t),d=XW(e,c),u=e9(),h=!!(o.onDayClick||o.mode!=="default");f.useEffect(function(){var k;c.outside||l.focusedDay&&h&&Pr(l.focusedDay,e)&&((k=r.current)===null||k===void 0||k.focus())},[l.focusedDay,e,r,h,c.outside]);var p=r9(o,c).join(" "),m=n9(o,c),y=!!(c.outside&&!o.showOutsideDays||c.hidden),g=(a=(s=o.components)===null||s===void 0?void 0:s.DayContent)!==null&&a!==void 0?a:NW,x=i.jsx(g,{date:e,displayMonth:t,activeModifiers:c}),b={style:m,className:p,children:x,role:"gridcell"},v=l.focusTarget&&Pr(l.focusTarget,e)&&!c.outside,w=l.focusedDay&&Pr(l.focusedDay,e),_=Ie(Ie(Ie({},b),(n={disabled:c.disabled,role:"gridcell"},n["aria-selected"]=c.selected,n.tabIndex=w||v?0:-1,n)),d),j={isButton:h,isHidden:y,activeModifiers:c,selectedDays:u,buttonProps:_,divProps:b};return j}function a9(e){var t=f.useRef(null),r=s9(e.date,e.displayMonth,t);return r.isHidden?i.jsx("div",{role:"gridcell"}):r.isButton?i.jsx(Th,Ie({name:"day",ref:t},r.buttonProps)):i.jsx("div",Ie({},r.divProps))}function i9(e){var t=e.number,r=e.dates,n=bt(),s=n.onWeekNumberClick,a=n.styles,o=n.classNames,l=n.locale,c=n.labels.labelWeekNumber,d=n.formatters.formatWeekNumber,u=d(Number(t),{locale:l});if(!s)return i.jsx("span",{className:o.weeknumber,style:a.weeknumber,children:u});var h=c(Number(t),{locale:l}),p=function(m){s(t,r,m)};return i.jsx(Th,{name:"week-number","aria-label":h,className:o.weeknumber,style:a.weeknumber,onClick:p,children:u})}function o9(e){var t,r,n=bt(),s=n.styles,a=n.classNames,o=n.showWeekNumber,l=n.components,c=(t=l==null?void 0:l.Day)!==null&&t!==void 0?t:a9,d=(r=l==null?void 0:l.WeekNumber)!==null&&r!==void 0?r:i9,u;return o&&(u=i.jsx("td",{className:a.cell,style:s.cell,children:i.jsx(d,{number:e.weekNumber,dates:e.dates})})),i.jsxs("tr",{className:a.row,style:s.row,children:[u,e.dates.map(function(h){return i.jsx("td",{className:a.cell,style:s.cell,role:"presentation",children:i.jsx(c,{displayMonth:e.displayMonth,date:h})},RU(h))})]})}function H0(e,t,r){for(var n=r!=null&&r.ISOWeek?Cz(t):rw(t,r),s=r!=null&&r.ISOWeek?Bi(e):kn(e,r),a=gs(n,s),o=[],l=0;l<=a;l++)o.push(Sr(s,l));var c=o.reduce(function(d,u){var h=r!=null&&r.ISOWeek?Pz(u):Rz(u,r),p=d.find(function(m){return m.weekNumber===h});return p?(p.dates.push(u),d):(d.push({weekNumber:h,dates:[u]}),d)},[]);return c}function l9(e,t){var r=H0(Wr(e),tw(e),t);if(t!=null&&t.useFixedWeeks){var n=AU(e,t);if(n<6){var s=r[r.length-1],a=s.dates[s.dates.length-1],o=Lg(a,6-n),l=H0(Lg(a,1),o,t);r.push.apply(r,l)}}return r}function c9(e){var t,r,n,s=bt(),a=s.locale,o=s.classNames,l=s.styles,c=s.hideHead,d=s.fixedWeeks,u=s.components,h=s.weekStartsOn,p=s.firstWeekContainsDate,m=s.ISOWeek,y=l9(e.displayMonth,{useFixedWeeks:!!d,ISOWeek:m,locale:a,weekStartsOn:h,firstWeekContainsDate:p}),g=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:kW,x=(r=u==null?void 0:u.Row)!==null&&r!==void 0?r:o9,b=(n=u==null?void 0:u.Footer)!==null&&n!==void 0?n:bW;return i.jsxs("table",{id:e.id,className:o.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&i.jsx(g,{}),i.jsx("tbody",{className:o.tbody,style:l.tbody,children:y.map(function(v){return i.jsx(x,{displayMonth:e.displayMonth,dates:v.dates,weekNumber:v.weekNumber},v.weekNumber)})}),i.jsx(b,{displayMonth:e.displayMonth})]})}function d9(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var u9=d9()?f.useLayoutEffect:f.useEffect,sm=!1,h9=0;function K0(){return"react-day-picker-".concat(++h9)}function f9(e){var t,r=e??(sm?K0():null),n=f.useState(r),s=n[0],a=n[1];return u9(function(){s===null&&a(K0())},[]),f.useEffect(function(){sm===!1&&(sm=!0)},[]),(t=e??s)!==null&&t!==void 0?t:void 0}function p9(e){var t,r,n=bt(),s=n.dir,a=n.classNames,o=n.styles,l=n.components,c=Nd().displayMonths,d=f9(n.id?"".concat(n.id,"-").concat(e.displayIndex):void 0),u=n.id?"".concat(n.id,"-grid-").concat(e.displayIndex):void 0,h=[a.month],p=o.month,m=e.displayIndex===0,y=e.displayIndex===c.length-1,g=!m&&!y;s==="rtl"&&(t=[m,y],y=t[0],m=t[1]),m&&(h.push(a.caption_start),p=Ie(Ie({},p),o.caption_start)),y&&(h.push(a.caption_end),p=Ie(Ie({},p),o.caption_end)),g&&(h.push(a.caption_between),p=Ie(Ie({},p),o.caption_between));var x=(r=l==null?void 0:l.Caption)!==null&&r!==void 0?r:xW;return i.jsxs("div",{className:h.join(" "),style:p,children:[i.jsx(x,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),i.jsx(c9,{id:u,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}
585function m9(e){var t=bt(),r=t.classNames,n=t.styles;return i.jsx("div",{className:r.months,style:n.months,children:e.children})}function g9(e){var t,r,n=e.initialProps,s=bt(),a=gw(),o=Nd(),l=f.useState(!1),c=l[0],d=l[1];f.useEffect(function(){s.initialFocus&&a.focusTarget&&(c||(a.focus(a.focusTarget),d(!0)))},[s.initialFocus,c,a.focus,a.focusTarget,a]);var u=[s.classNames.root,s.className];s.numberOfMonths>1&&u.push(s.classNames.multiple_months),s.showWeekNumber&&u.push(s.classNames.with_weeknumber);var h=Ie(Ie({},s.styles.root),s.style),p=Object.keys(n).filter(function(y){return y.startsWith("data-")}).reduce(function(y,g){var x;return Ie(Ie({},y),(x={},x[g]=n[g],x))},{}),m=(r=(t=n.components)===null||t===void 0?void 0:t.Months)!==null&&r!==void 0?r:m9;return i.jsx("div",Ie({className:u.join(" "),style:h,dir:s.dir,id:s.id,nonce:n.nonce,title:n.title,lang:n.lang},p,{children:i.jsx(m,{children:o.displayMonths.map(function(y,g){return i.jsx(p9,{displayIndex:g,displayMonth:y},g)})})}))}function y9(e){var t=e.children,r=UB(e,["children"]);return i.jsx(iW,{initialProps:r,children:i.jsx(gW,{children:i.jsx(YW,{initialProps:r,children:i.jsx(SW,{initialProps:r,children:i.jsx(EW,{initialProps:r,children:i.jsx(MW,{children:i.jsx(GW,{children:t})})})})})})})}function v9(e){return i.jsx(y9,Ie({},e,{children:i.jsx(g9,{initialProps:e})}))}function r2({className:e,classNames:t,showOutsideDays:r=!0,...n}){return i.jsx(v9,{showOutsideDays:r,className:J("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:J(Yc({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:J(Yc({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...s})=>i.jsx(CO,{className:"h-4 w-4"}),IconRight:({...s})=>i.jsx(Jk,{className:"h-4 w-4"})},...n})}r2.displayName="Calendar";function wc({value:e,onChange:t,label:r}){const[n,s]=f.useState(e?xt(e,"HH:mm"):""),a=l=>{if(!l){t(void 0);return}if(n&&n.includes(":")){const[c,d]=n.split(":").map(Number);!isNaN(c)&&!isNaN(d)?l.setHours(c,d,0,0):l.setHours(0,0,0,0)}else l.setHours(0,0,0,0);t(l)},o=l=>{if(s(l),e){const[c,d]=l.split(":").map(Number),u=new Date(e);u.setHours(c,d,0,0),t(u)}};return i.jsxs("div",{className:"space-y-2",children:[r&&i.jsx(ue,{children:r}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(VE,{children:[i.jsx(qE,{asChild:!0,children:i.jsxs(G,{variant:"outline",className:J("flex-1 justify-start text-left font-normal",!e&&"text-muted-foreground"),children:[i.jsx(Mc,{className:"mr-2 h-4 w-4"}),e?xt(e,"PPP",{locale:nr}):i.jsx("span",{children:"Wybierz datę"})]})}),i.jsx(cw,{className:"w-auto p-0",align:"start",children:i.jsx(r2,{mode:"single",selected:e,onSelect:a,initialFocus:!0,className:"pointer-events-auto",locale:nr})})]}),i.jsx(Pe,{type:"time",value:n,onChange:l=>o(l.target.value),className:"w-32"})]})]})}function Fl({className:e}){return i.jsxs(Ge,{variant:"secondary",className:e,children:[i.jsx(Ua,{className:"h-3 w-3 mr-1"}),"Oczekuje na sync"]})}const w9={nowe:"Nowe",w_toku:"W realizacji",oczekuje_na_czesci:"Oczekuje na części",zakonczone:"Zakończone",anulowane:"Anulowane"},x9=[{value:"all",label:"Wszystkie",icon:ll},{value:"nowe",label:"Nowe",icon:sh},{value:"active",label:"W realizacji",icon:Ua},{value:"zakonczone",label:"Zakończone",icon:e1},{value:"anulowane",label:"Anulowane",icon:OO}];function b9(){const{user:e}=qr(),{toast:t}=Ar(),r=Zt(),n=Dr(),{addOperation:s}=Ss(),{data:a,loading:o,isCached:l,lastSynced:c,refresh:d}=Dz(e==null?void 0:e.id),{data:u}=aw(e==null?void 0:e.id),[h,p]=f.useState([]),[m,y]=f.useState(!0),[g,x]=f.useState("all"),[b,v]=f.useState(!1),[w,_]=f.useState([]),[j,k]=f.useState([]),[N,P]=f.useState(""),[T,I]=f.useState(""),[H,M]=f.useState(""),[L,F]=f.useState(!1),[Y,Q]=f.useState(""),[S,z]=f.useState("awaria"),[C,B]=f.useState(void 0),[ce,A]=f.useState(!1),[ee,te]=f.useState(0);f.useEffect(()=>{e&&(q(),he())},[e]),f.useEffect(()=>{a&&a.length>0&&!n&&(p(a),y(!1))},[a,n]),f.useEffect(()=>{u&&u.length>0&&(n||_(u.map(oe=>({id:oe.id,name:oe.name}))))},[u,n]),f.useEffect(()=>{N?(Z(N),I("")):k([])},[N]);const q=async()=>
585{if(!n){y(o);return}try{const{data:oe,error:Ve}=await ne.from("tickets").select(`
586          id,
587          description,
588          status,
589          priority,
590          scheduled_date,
591          created_at,
592          is_remote_report,
593          is_critical,
594          devices (
595            name,
596            category,
597            clients (
598              name,
599              address
600            )
601          )
602        `).eq("installer_id",e==null?void 0:e.id).order("created_at",{ascending:!1});if(Ve)throw Ve;if(p(oe||[]),oe)for(const Ue of oe)await ve.saveData("tickets",Ue)}catch(oe){console.error("Error fetching tickets:",oe),a&&p(a)}finally{y(!1)}},he=async()=>{if(n)try{const{data:oe,error:Ve}=await ne.from("clients").select("id, name").eq("installer_id",e==null?void 0:e.id).eq("is_active",!0).order("name");if(Ve)throw Ve;_(oe||[])}catch(oe){console.error("Error fetching clients:",oe)}},Z=async oe=>{if(!n){const Ue=(await ve.getAllData("devices")).filter(re=>re.client_id===oe);k(Ue);return}try{const{data:Ve,error:Ue}=await ne.from("devices").select("id, name, client_id").eq("client_id",oe).eq("is_active",!0).order("name");if(Ue)throw Ue;k(Ve||[])}catch(Ve){console.error("Error fetching devices:",Ve)}},me=async()=>{if(!T||!e)return;if(S==="awaria"&&!H.trim()){t({variant:"destructive",title:"Błąd",description:"Opis problemu jest wymagany dla zgłoszenia awarii"});return}F(!0);const oe=!!C,Ve=S==="przeglad"?"Zlecenie przeglądu okresowego":H||null,Ue={device_id:T,installer_id:e.id,description:Ve,priority:ce?"wysoki":"normalny",status:oe?"w_toku":"nowe",is_remote_report:!1,is_critical:S==="awaria"?ce:!1,scheduled_date:(C==null?void 0:C.toISOString())||null,additional_devices_count:S==="przeglad"?ee:0};if(!n){try{const re=crypto.randomUUID(),De=await ve.getData("devices",T),Te=De!=null&&De.client_id?await ve.getData("clients",De.client_id):null,E={...Ue,id:re,created_at:new Date().toISOString(),_pendingSync:!0,devices:De?{name:De.name,category:De.category||null,clients:Te?{name:Te.name,address:Te.address}:null}:null};await ve.saveData("tickets",E),await s("create","tickets",{...Ue,id:re}),p(O=>[E,...O]),xs.info("Zgłoszenie zostanie dodane po powrocie online",{description:"Zapisano lokalnie"}),v(!1),ge()}catch(re){console.error("Error saving offline ticket:",re),t({variant:"destructive",title:"Błąd",description:"Nie udało się zapisać zgłoszenia lokalnie"})}finally{F(!1)}return}try{const{error:re}=await ne.from("tickets").insert([Ue]);if(re)throw re;t({title:"Zgłoszenie utworzone",description:oe?"Zgłoszenie zostało zaplanowane":"Nowe zgłoszenie zostało dodane"}),v(!1),ge(),q()}catch(re){console.error("Error creating ticket:",re),t({variant:"destructive",title:"Błąd",description:"Nie udało się utworzyć zgłoszenia"})}finally{F(!1)}},ge=()=>{P(""),I(""),M(""),z("awaria"),B(void 0),A(!1),te(0)},Ne=async()=>{await d(),await q()},Ce=h.filter(oe=>{var E,O,V,D,K,R;let Ve=!0;if(g==="active"?Ve=["w_toku","oczekuje_na_czesci"].includes(oe.status):g!=="all"&&(Ve=oe.status===g),!Y.trim())return Ve;const Ue=Y.toLowerCase(),re=((V=(O=(E=oe.devices)==null?void 0:E.clients)==null?void 0:O.name)==null?void 0:V.toLowerCase())||"",De=((K=(D=oe.devices)==null?void 0:D.name)==null?void 0:K.toLowerCase())||"",Te=((R=oe.description)==null?void 0:R.toLowerCase())||"";return Ve&&(re.includes(Ue)||De.includes(Ue)||Te.includes(Ue))}),Xe={all:h.length,nowe:h.filter(oe=>oe.status==="nowe").length,active:h.filter(oe=>["w_toku","oczekuje_na_czesci"].includes(oe.status)).length,zakonczone:h.filter(oe=>oe.status==="zakonczone").length,anulowane:h.filter(oe=>oe.status==="anulowane").length};return i.jsxs(sr,{title:"Zgłoszenia",children:[i.jsxs("div",{className:"space-y-6 animate-fade-in overflow-hidden",children:[i.jsx(Xn,{isCached:l,isOffline:!n,lastSynced:c,onRefresh:Ne}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:justify-between sm:items-center",children:[i.jsxs("div",{className:"relative flex-1 max-w-md",children:[i.jsx(ud,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),i.jsx(Pe,{placeholder:"Szukaj po kliencie, urządzeniu...",value:Y,onChange:oe=>Q(oe.target.value),className:"pl-9"})]}),i.jsxs(G,{onClick:()=>v(!0),children:[i.jsx(Lo,{className:"mr-2 h-4 w-4"}),"Dodaj zgłoszenie ręcznie"]})]}),i.jsxs(pl,{value:g,onValueChange:x,children:[i.jsx("div",{className:"w-full max-w-full overflow-x-auto overflow-y-hidden pb-2",children:i.jsx(Fi,{className:"inline-flex w-max flex-nowrap",children:x9.map(oe=>i.jsxs(nn,{value:oe.value,className:"gap-2 px-3 whitespace-nowrap",children:[i.jsx(oe.icon,{className:"h-4 w-4 shrink-0"}),i.jsx("span",{children:oe.label}),i.jsx(Ge,{variant:"secondary",className:"ml-1",children:Xe[oe.value]})]},oe.value))})}),i.jsx(Kn,{value:g,className:"mt-6",children:m?i.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"Ładowanie zgłoszeń..."}):Ce.length===0?i.jsx(Fe,{children:i.jsxs(Me,{className:"flex h-64 flex-col items-center justify-center text-center",children:[i.jsx(ll,{className:"mb-4 h-12 w-12 text-muted-foreground"}),i.jsx("h3",{className:"text-lg font-semibold",children:"Brak zgłoszeń"}),i.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:g==="nowe"?"Nie masz nowych zgłoszeń":"Zgłoszenia pojawią się tutaj"})]})}):i.jsx("div",{className:"space-y-3",children:Ce.map((oe,Ve)=>{var Ue,re,De;return i.jsx(ks,{to:`/tickets/${oe.id}`,className:"block animate-fade-in",style:{animationDelay:`${Ve*30}ms`},children:i.jsx(Fe,{className:"transition-all hover:shadow-md hover:border-primary/50",children:i.jsx(Me,{className:"p-4",children:i.jsxs("div",{className:"flex items-start justify-between gap-4",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsx("span",{className:"font-semibold",children:((Ue=oe.devices)==null?void 0:Ue.name)||"Nieznane urządzenie"}),i.jsx(Ge,{variant:oe.status,children:w9[oe.status]}),oe.is_critical&&!["zakonczone","anulowane"].includes(oe.status)&&i.jsxs(Ge,{variant:"destructive",children:[i.jsx(an,{className:"mr-1 h-3 w-3"}),"PILNE / KRYTYCZNE"]}),oe._pendingSync&&i.jsx(Fl,{})]}),i.jsx("p",{className:"mt-2 text-sm text-muted-foreground line-clamp-2",children:oe.description||"Brak opisu"}),i.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-4 text-xs text-muted-foreground",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(Nl,{className:"h-3 w-3"}),((De=(re=oe.devices)==null?void 0:re.clients)==null?void 0:De.name)||"Nieznany klient"]}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(Mc,{className:"h-3 w-3"}),xt(new Date(oe.created_at),"d MMM yyyy, HH:mm",{locale:nr})]}),oe.scheduled_date&&i.jsxs("span",{className:"flex items-center gap-1 text-primary",children:[i.jsx(Ua,{className:"h-3 w-3"}),"Zaplanowane: ",xt(new Date(oe.scheduled_date),"d MMM yyyy",{locale:nr})]})]})]}),i.jsx(Da,{className:"h-5 w-5 shrink-0 text-muted-foreground"})]})})})},oe.id)})})})]})]}),i.jsx(or,{open:b,onOpenChange:v,children:i.jsxs(er,{className:"max-w-lg",children:[i.jsxs(tr,{children:[i.jsx(rr,{children:"Dodaj zgłoszenie ręcznie"}),i.jsx(Vn,{children:"Utwórz zgłoszenie na podstawie rozmowy telefonicznej"})]}),i.jsxs("div",{className:"space-y-4 pt-4",children:[i.jsx(pl,{value:S,onValueChange:oe=>z(oe),className:"w-full",children:i.jsxs(Fi,{className:"grid w-full grid-cols-2",children:[i.jsxs(nn,{value:"awaria",className:"gap-2",children:[i.jsx(Sl,{className:"h-4 w-4"}),"Awaria"]}),i.jsxs(nn,{value:"przeglad",className:"gap-2",children:[i.jsx(BO,{className:"h-4 w-4"}),"Przegląd"]})]})}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(ue,{children:"Klient *"}),i.jsxs(G,{variant:"ghost",size:"sm",className:"h-auto p-0 text-xs text-primary hover:text-primary/80",onClick:()=>{v(!1),r("/clients?action=new")},children:[i.jsx(Lo,{className:"mr-1 h-3 w-3"}),"Nowy"]})]}),i.jsx(dw,{clients:w,value:N,onValueChange:P,placeholder:"Wyszukaj klienta..."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{children:"Urządzenie *"}),i.jsxs(Ha,{value:T,onValueChange:I,disabled:!N,children:[i.jsx(Ys,{children:i.jsx(Ka,{placeholder:N?"Wybierz urządzenie":"Najpierw wybierz klienta"})}),i.jsx(Js,{children:j.map(oe=>i.jsx(Xs,{value:oe.id,children:oe.name},oe.id))})]})]}),i.jsx(wc,{label:"Termin wizyty",value:C,onChange:B}),S==="awaria"?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{children:"Opis problemu *"}),i.jsx(Zn,{value:H,onChange:oe=>M(oe.target.value),placeholder:"Opisz zgłoszony problem...",rows:3})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx($i,{id:"critical",checked:ce,onCheckedChange:oe=>A(oe===!0)}),i.jsx(ue,{htmlFor:"critical",className:"text-sm font-normal cursor-pointer",children:"Pilne / Krytyczne"})]})]}):i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{children:"Dodatkowe urządzenia do przeglądu"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(G,{type:"button",variant:"outline",size:"icon",onClick:()=>te(Math.max(0,ee-1)),disabled:ee===0,children:i.jsx(MO,{className:"h-4 w-4"})}),i.jsx("span",{className:"w-8 text-center font-medium",children:ee}),i.jsx(G,{type:"button",variant:"outline",size:"icon",onClick:()=>te(ee+1),children:i.jsx(Lo,{className:"h-4 w-4"})})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Oprócz wybranego urządzenia"})]})]}),i.jsxs(ms,{className:"mt-6",children:[i.jsx(G,{variant:"outline",onClick:()=>v(!1),children:"Anuluj"}),i.jsx(G,{onClick:me,disabled:L||!T||S==="awaria"&&!H.trim(),children:L?"Tworzenie...":"Utwórz zgłoszenie"})]})]})})]})}var n2="AlertDialog",[_9,y7]=dn(n2,[EC]),na=EC(),s2=e=>{const{__scopeAlertDialog:t,...r}=e,n=na(t);return i.jsx(Tf,{...n,...r,modal:!0})};s2.displayName=n2;var j9="AlertDialogTrigger",k9=f.forwardRef((e,t)=>
602{const{__scopeAlertDialog:r,...n}=e,s=na(r);return i.jsx(qC,{...s,...n,ref:t})});k9.displayName=j9;var N9="AlertDialogPortal",a2=e=>{const{__scopeAlertDialog:t,...r}=e,n=na(t);return i.jsx(Rf,{...n,...r})};a2.displayName=N9;var S9="AlertDialogOverlay",i2=f.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=na(r);return i.jsx(Dl,{...s,...n,ref:t})});i2.displayName=S9;var Ho="AlertDialogContent",[C9,z9]=_9(Ho),E9=_k("AlertDialogContent"),o2=f.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,a=na(r),o=f.useRef(null),l=tt(t,o),c=f.useRef(null);return i.jsx(k5,{contentName:Ho,titleName:l2,docsSlug:"alert-dialog",children:i.jsx(C9,{scope:r,cancelRef:c,children:i.jsxs(Il,{role:"alertdialog",...a,...s,ref:l,onOpenAutoFocus:ke(s.onOpenAutoFocus,d=>{var u;d.preventDefault(),(u=c.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[i.jsx(E9,{children:n}),i.jsx(T9,{contentRef:o})]})})})});o2.displayName=Ho;var l2="AlertDialogTitle",c2=f.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=na(r);return i.jsx(gd,{...s,...n,ref:t})});c2.displayName=l2;var d2="AlertDialogDescription",u2=f.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=na(r);return i.jsx(yd,{...s,...n,ref:t})});u2.displayName=d2;var P9="AlertDialogAction",h2=f.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=na(r);return i.jsx(Of,{...s,...n,ref:t})});h2.displayName=P9;var f2="AlertDialogCancel",p2=f.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=z9(f2,r),a=na(r),o=tt(t,s);return i.jsx(Of,{...a,...n,ref:o})});p2.displayName=f2;var T9=({contentRef:e})=>{const t=`\`${Ho}\` requires a description for the component to be accessible for screen reader users.
603
604You can add a description to the \`${Ho}\` by passing a \`${d2}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
605
606Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ho}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
607
608For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return f.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},R9=s2,O9=a2,m2=i2,g2=o2,y2=h2,v2=p2,w2=c2,x2=u2;const A9=R9,D9=O9,b2=f.forwardRef(({className:e,...t},r)=>i.jsx(m2,{className:J("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));b2.displayName=m2.displayName;const _2=f.forwardRef(({className:e,...t},r)=>i.jsxs(D9,{children:[i.jsx(b2,{}),i.jsx(g2,{ref:r,className:J("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));_2.displayName=g2.displayName;const j2=({className:e,...t})=>i.jsx("div",{className:J("flex flex-col space-y-2 text-center sm:text-left",e),...t});j2.displayName="AlertDialogHeader";const k2=({className:e,...t})=>i.jsx("div",{className:J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});k2.displayName="AlertDialogFooter";const N2=f.forwardRef(({className:e,...t},r)=>i.jsx(w2,{ref:r,className:J("text-lg font-semibold",e),...t}));N2.displayName=w2.displayName;const S2=f.forwardRef(({className:e,...t},r)=>i.jsx(x2,{ref:r,className:J("text-sm text-muted-foreground",e),...t}));S2.displayName=x2.displayName;const C2=f.forwardRef(({className:e,...t},r)=>i.jsx(y2,{ref:r,className:J(Yc(),e),...t}));C2.displayName=y2.displayName;const z2=f.forwardRef(({className:e,...t},r)=>i.jsx(v2,{ref:r,className:J(Yc({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));z2.displayName=v2.displayName;function Wf({open:e,onOpenChange:t,onConfirm:r,title:n,description:s,confirmText:a="Potwierdź",cancelText:o="Wróć",variant:l="default"}){return i.jsx(A9,{open:e,onOpenChange:t,children:i.jsxs(_2,{children:[i.jsxs(j2,{children:[i.jsx(N2,{children:n}),i.jsx(S2,{children:s})]}),i.jsxs(k2,{children:[i.jsx(z2,{children:o}),i.jsx(C2,{onClick:r,className:l==="destructive"?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"",children:a})]})]})})}const I9={nowe:"Nowe",w_toku:"W realizacji",oczekuje_na_czesci:"Oczekuje na części",zakonczone:"Zakończone",anulowane:"Anulowane"};function M9(){var K,R,W,se,ye,ze,et,at,Nt,He,ct,Rt,dt,mt,Ft,$t,Lt,_r,yt;const{id:e}=Xi(),t=Zt();rs();const{user:r}=qr(),{toast:n}=Ar(),s=Dr(),{addOperation:a}=Ss(),[o,l]=f.useState(null),[c,d]=f.useState(!0),[u,h]=f.useState(!1),[p,m]=f.useState(!1),[y,g]=f.useState(""),[x,b]=f.useState(!1),[v,w]=f.useState(!1),[_,j]=f.useState(void 0),[k,N]=f.useState(!1),[P,T]=f.useState(void 0),[I,H]=f.useState(!1),[M,L]=f.useState(void 0),[F,Y]=f.useState(!1),[Q,S]=f.useState(!1),[z,C]=f.useState(!1),[B,ce]=f.useState(!1),[A,ee]=f.useState(null);f.useEffect(()=>{e&&r&&te()},[e,r]);const te=async()=>
608{if(!s)try{const $=await ve.getData("tickets",e);if($){l($),g($.private_notes||""),m(!0),d(!1);return}}catch($){console.error("Error loading cached ticket:",$)}try{const{data:$,error:ae}=await ne.from("tickets").select(`
609          *,
610          devices (
611            id,
612            name,
613            serial_number,
614            category,
615            clients (
616              id,
617              name,
618              address,
619              phone,
620              lat,
621              lng
622            )
623          )
624        `).eq("id",e).eq("installer_id",r==null?void 0:r.id).single();if(ae)throw ae;l($),g($.private_notes||""),m(!1),await ve.saveData("tickets",$)}catch($){console.error("Error fetching ticket:",$);try{const ae=await ve.getData("tickets",e);ae?(l(ae),g(ae.private_notes||""),m(!0)):n({variant:"destructive",title:"Błąd",description:"Nie udało się pobrać szczegółów zgłoszenia"})}catch{n({variant:"destructive",title:"Błąd",description:"Nie udało się pobrać szczegółów zgłoszenia"})}}finally{d(!1)}},q=async $=>{if(!o)return;const ae={...o,...$,updated_at:new Date().toISOString(),_pendingSync:!0};l(ae),await ve.saveData("tickets",ae),await a("update","tickets",{id:o.id,...$,updated_at:ae.updated_at})},he=async()=>{if(o){if(b(!0),!s){await q({private_notes:y}
624),n({title:"Notatki zapisane lokalnie",description:"Zostaną zsynchronizowane po powrocie online"}),b(!1);return}try{const{error:$}=await ne.from("tickets").update({private_notes:y}).eq("id",o.id);if($)throw $;n({title:"Notatki zapisane"})}catch($){console.error("Error saving notes:",$),n({variant:"destructive",title:"Błąd",description:"Nie udało się zapisać notatek"})}finally{b(!1)}}},Z=async()=>{if(!o||!_)return;h(!0);const $={status:"w_toku",scheduled_date:_.toISOString()};if(!s){await q($),n({title:"Zgłoszenie przyjęte lokalnie",description:"Zostanie zsynchronizowane po powrocie online"}),w(!1),j(void 0),h(!1);return}try{const{error:ae}=await ne.from("tickets").update($).eq("id",o.id);if(ae)throw ae;n({title:"Zgłoszenie przyjęte",description:"Wizyta została zaplanowana i rozpoczęta"}),w(!1),j(void 0),te()}catch(ae){console.error("Error accepting ticket:",ae),n({variant:"destructive",title:"Błąd",description:"Nie udało się przyjąć zgłoszenia"})}finally{h(!1)}},me=async()=>{if(!o||!P)return;h(!0);const $={status:"w_toku",scheduled_date:P.toISOString()};if(!s){await q($),n({title:"Praca wznowiona lokalnie",description:"Zostanie zsynchronizowane po powrocie online"}),N(!1),T(void 0),h(!1);return}try{const{error:ae}=await ne.from("tickets").update($).eq("id",o.id);if(ae)throw ae;n({title:"Praca wznowiona",description:"Zaplanowano następną wizytę"}),N(!1),T(void 0),te()}catch(ae){console.error("Error resuming work:",ae),n({variant:"destructive",title:"Błąd",description:"Nie udało się wznowić pracy"})}finally{h(!1)}},ge=async()=>{if(!o||!M)return;h(!0);const $={scheduled_date:M.toISOString()};if(!s){await q($),n({title:"Termin zaktualizowany lokalnie",description:"Zostanie zsynchronizowane po powrocie online"}),H(!1),L(void 0),h(!1);return}try{const{error:ae}=await ne.from("tickets").update($).eq("id",o.id);if(ae)throw ae;n({title:"Termin zaktualizowany",description:"Nowy termin wizyty został zapisany"}),H(!1),L(void 0),te()}catch(ae){console.error("Error updating scheduled date:",ae),n({variant:"destructive",title:"Błąd",description:"Nie udało się zaktualizować terminu"})}finally{h(!1)}},Ne=async()=>{if(!o)return;h(!0);const $={status:"oczekuje_na_czesci"};if(!s){await q($),n({title:"Status zmieniony lokalnie",description:"Zostanie zsynchronizowane po powrocie online"}),h(!1);return}try{const{error:ae}=await ne.from("tickets").update($).eq("id",o.id);if(ae)throw ae;n({title:"Status zmieniony",description:"Zgłoszenie oczekuje na części"}),te()}catch(ae){console.error("Error updating status:",ae),n({variant:"destructive",title:"Błąd",description:"Nie udało się zaktualizować statusu"})}finally{h(!1)}},Ce=async()=>{if(!o)return;h(!0);const $={status:"anulowane"};if(!s){await q($),n({title:"Zgłoszenie anulowane lokalnie",description:"Zostanie zsynchronizowane po powrocie online"}),Y(!1),h(!1);return}try{const{error:ae}=await ne.from("tickets").update({status:"anulowane"}).eq("id",o.id);if(ae)throw ae;n({title:"Zgłoszenie anulowane"}),Y(!1),te()}catch(ae){console.error("Error canceling ticket:",ae),n({variant:"destructive",title:"Błąd",description:"Nie udało się anulować zgłoszenia"})}finally{h(!1)}},Oe=async()=>{if(!o)return;C(!0);const $={status:"zakonczone",completed_date:new Date().toISOString(),resolution_notes:"Protokół sporządzono w wersji papierowej"};if(!s){await q($),n({title:"Zgłoszenie zamknięte lokalnie",description:"Zostanie zsynchronizowane po powrocie online"}),S(!1),C(!1);return}try{const{error:ae}=await ne.from("tickets").update($).eq("id",o.id);if(ae)throw ae;n({title:"Zgłoszenie zakończone",description:"Zapisano informację o protokole papierowym"}),S(!1),te()}catch(ae){console.error("Error closing ticket with paper protocol:",ae),n({variant:"destructive",title:"Błąd",description:"Nie udało się zamknąć zgłoszenia"})}finally{C(!1)}},Xe=()=>{var $,ae;if((ae=($=o==null?void 0:o.devices)==null?void 0:$.clients)!=null&&ae.address){const le=encodeURIComponent(o.devices.clients.address);window.open(`https://www.google.com/maps/dir/?api=1&destination=${le}`,"_blank")}},oe=async $=>{if(!(!o||!r)){ce(!0);try{const ae=$.name.split(".").pop()||"jpg",le=`${r.id}/${o.id}/paper_protocol_${Date.now()}.${ae}`,{error:Re}=await ne.storage.from("ticket-photos").upload(le,$);if(Re)throw Re;const Be=[...o.paper_protocol_photos||[],le],{error:Ye}=await ne.from("tickets").update({paper_protocol_photos:Be}
624).eq("id",o.id);if(Ye)throw Ye;l({...o,paper_protocol_photos:Be}),n({title:"Zdjęcie dodane",description:"Zdjęcie protokołu zostało zapisane"})}catch(ae){console.error("Error uploading paper protocol photo:",ae),n({variant:"destructive",title:"Błąd",description:"Nie udało się dodać zdjęcia"})}finally{ce(!1)}}},Ve=async $=>{var ae,le;if(o){ee($);try{const Re=(ae=o.paper_protocol_photos)==null?void 0:ae[$];if(!Re)return;const{error:Be}=await ne.storage.from("ticket-photos").remove([Re]);if(Be)throw Be;const Ye=((le=o.paper_protocol_photos)==null?void 0:le.filter((un,Cs)=>Cs!==$))||[],{error:Gt}=await ne.from("tickets").update({paper_protocol_photos:Ye}).eq("id",o.id);if(Gt)throw Gt;l({...o,paper_protocol_photos:Ye}),n({title:"Zdjęcie usunięte"})}catch(Re){console.error("Error removing paper protocol photo:",Re),n({variant:"destructive",title:"Błąd",description:"Nie udało się usunąć zdjęcia"})}finally{ee(null)}}};if(c)return i.jsx(sr,{title:"Szczegóły zgłoszenia",children:i.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"Ładowanie..."})});if(!o)return i.jsx(sr,{title:"Szczegóły zgłoszenia",children:i.jsxs("div",{className:"flex h-64 flex-col items-center justify-center text-center",children:[i.jsx("p",{className:"text-lg font-semibold",children:"Zgłoszenie nie znalezione"}),i.jsx(G,{variant:"link",onClick:()=>t("/tickets"),children:"Wróć do listy zgłoszeń"})]})});const Ue=o.status==="nowe",re=o.status==="oczekuje_na_czesci",De=o.status==="w_toku",Te=o.status==="w_toku",E=!["zakonczone","anulowane"].includes(o.status),O=o.status==="zakonczone";o.status;const V=o._pendingSync||((R=(K=o.devices)==null?void 0:K.clients)==null?void 0:R.address)&&!["zakonczone","anulowane"].includes(o.status)||Ue||re||Te||De||O&&(o==null?void 0:o.resolution_notes)!=="Protokół sporządzono w wersji papierowej"||E,D=o.is_remote_report&&(o.reporter_name||o.reporter_phone)&&(o.reporter_name!==((se=(W=o.devices)==null?void 0:W.clients)==null?void 0:se.name)||o.reporter_phone!==((ze=(ye=o.devices)==null?void 0:ye.clients)==null?void 0:ze.phone));return i.jsx(sr,{title:"Szczegóły zgłoszenia",children:i.jsxs("div",{className:"space-y-6 animate-fade-in",children:[p&&i.jsx(Xn,{isCached:p,isOffline:!s,lastSynced:null,onRefresh:te}),!s&&!p&&i.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-warning/10 border border-warning/20 text-warning-foreground",children:[i.jsx(Hs,{className:"h-4 w-4"}),i.jsx("span",{className:"text-sm",children:"Tryb offline - zmiany będą zsynchronizowane po powrocie online"})]}),i.jsxs(G,{variant:"ghost",onClick:()=>t(-1),className:"-ml-2",children:[i.jsx(ws,{className:"mr-2 h-4 w-4"}),"Wróć"]}),V&&i.jsx(Fe,{className:"sticky top-0 z-10 border-2 shadow-lg",children:i.jsx(Me,{className:"py-4",children:i.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o._pendingSync&&i.jsx(Fl,{}),((at=(et=o.devices)==null?void 0:et.clients)==null?void 0:at.address)&&!["zakonczone","anulowane"].includes(o.status)&&i.jsxs(G,{size:"sm",variant:"outline",onClick:Xe,children:[i.jsx(FO,{className:"mr-2 h-4 w-4"}),"Nawiguj"]}),Ue&&i.jsxs(G,{size:"sm",onClick:()=>w(!0),disabled:u,children:[i.jsx(Ux,{className:"mr-2 h-4 w-4"}),"Przyjmij i zaplanuj"]}),re&&i.jsxs(G,{size:"sm",onClick:()=>N(!0),disabled:u,children:[i.jsx(Ux,{className:"mr-2 h-4 w-4"}),"Rozpocznij realizację"]}),Te&&i.jsxs(G,{size:"sm",variant:"outline",onClick:Ne,disabled:u,children:[i.jsx(cl,{className:"mr-2 h-4 w-4"}),"Brak części"]}),De&&i.jsxs(G,{size:"sm",variant:"default",onClick:()=>S(!0),children:[i.jsx(mn,{className:"mr-2 h-4 w-4"}),"Protokół"]}),O&&(o==null?void 0:o.resolution_notes)!=="Protokół sporządzono w wersji papierowej"&&i.jsxs(G,{size:"sm",variant:"outline",onClick:()=>t(`/protokol/${o.id}/podglad?source=admin`),children:[i.jsx(mn,{className:"mr-2 h-4 w-4"}),"Zobacz protokół"]}),E&&i.jsxs(G,{size:"sm",variant:"destructive",onClick:()=>Y(!0),disabled:u,className:"ml-auto",children:[i.jsx(Ks,{className:"mr-2 h-4 w-4"}),"Anuluj"]})]})})}),i.jsxs(Fe,{children:[i.jsxs(lt,{children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[i.jsx(Ge,{variant:o.status,className:"text-sm px-3 py-1",children:I9[o.status]}),o.is_critical&&i.jsxs(Ge,{variant:"destructive",className:"text-sm px-3 py-1 animate-pulse",children:[i.jsx(an,{className:"mr-1 h-3 w-3"}),"PILNE / KRYTYCZNE"]}),o.additional_devices_count>0&&i.jsxs(Ge,{variant:"outline",className:"text-sm px-3 py-1 border-primary text-primary",children:["+",o.additional_devices_count," dodatkowych urządzeń"]})]}),i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{children:[i.jsx(ut,{className:"text-xl",children:(Nt=o.devices)==null?void 0:Nt.name}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:((He=o.devices)==null?void 0:He.serial_number)&&`S/N: ${o.devices.serial_number}`}
624),((ct=o.devices)==null?void 0:ct.id)&&i.jsxs(G,{variant:"link",size:"sm",className:"h-auto p-0 mt-1",onClick:()=>t(`/devices/${o.devices.id}`),children:[i.jsx(cl,{className:"h-3 w-3 mr-1"}),"Zobacz urządzenie"]})]}),o.status==="w_toku"&&o.scheduled_date&&i.jsxs(G,{variant:"ghost",size:"sm",onClick:()=>{L(new Date(o.scheduled_date)),H(!0)},children:[i.jsx($c,{className:"h-4 w-4 mr-1"}),"Zmień termin"]})]})]}),i.jsxs(Me,{className:"space-y-4",children:[o.description&&i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-1",children:"Opis problemu"}),i.jsx("p",{className:"text-base",children:o.description})]}),o.error_code&&i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-1",children:"Kod błędu"}),i.jsx("p",{className:"font-mono bg-destructive/10 text-destructive px-2 py-1 rounded inline-block",children:o.error_code})]}),i.jsx(ir,{}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("h4",{className:"font-semibold flex items-center gap-2",children:[i.jsx(qs,{className:"h-4 w-4"}),"Klient"]}),i.jsx("p",{className:"font-medium",children:(dt=(Rt=o.devices)==null?void 0:Rt.clients)==null?void 0:dt.name}),i.jsxs("p",{className:"flex items-center gap-2 text-muted-foreground",children:[i.jsx(Nl,{className:"h-4 w-4 shrink-0"}),(Ft=(mt=o.devices)==null?void 0:mt.clients)==null?void 0:Ft.address]}),((Lt=($t=o.devices)==null?void 0:$t.clients)==null?void 0:Lt.phone)&&i.jsxs("p",{className:"flex items-center gap-2",children:[i.jsx($o,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),i.jsx("a",{href:`tel:${o.devices.clients.phone}`,className:"text-primary hover:underline",children:o.devices.clients.phone})]})]}),D&&i.jsxs(i.Fragment,{children:[i.jsx(ir,{}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("h4",{className:"font-semibold flex items-center gap-2",children:[i.jsx($o,{className:"h-4 w-4"}),"Osoba zgłaszająca"]}),o.reporter_name&&i.jsx("p",{className:"font-medium",children:o.reporter_name}),o.reporter_phone&&i.jsxs("p",{className:"flex items-center gap-2",children:[i.jsx($o,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),i.jsx("a",{href:`tel:${o.reporter_phone}`,className:"text-primary hover:underline",children:o.reporter_phone})]})]})]}),o.contact_person&&i.jsxs(i.Fragment,{children:[i.jsx(ir,{}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h4",{className:"font-semibold",children:"Osoba kontaktowa"}),i.jsx("p",{children:o.contact_person})]})]}),o.preferred_time_slot&&i.jsxs(i.Fragment,{children:[i.jsx(ir,{}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("h4",{className:"font-semibold flex items-center gap-2",children:[i.jsx(Ua,{className:"h-4 w-4"}),"Preferowany termin"]}),i.jsxs("p",{children:[o.preferred_time_slot==="morning"&&"Rano (8:00-12:00)",o.preferred_time_slot==="afternoon"&&"Po południu (12:00-17:00)",o.preferred_time_slot==="evening"&&"Wieczorem (17:00-20:00)"]})]})]}),i.jsx(ir,{}),i.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[i.jsxs("div",{children:[i.jsxs("p",{className:"text-muted-foreground flex items-center gap-1",children:[i.jsx(Mc,{className:"h-3 w-3"}),"Utworzono"]}),i.jsx("p",{className:"font-medium",children:xt(new Date(o.created_at),"d MMMM yyyy, HH:mm",{locale:nr})})]}),o.scheduled_date&&i.jsxs("div",{children:[i.jsxs("p",{className:"text-muted-foreground flex items-center gap-1",children:[i.jsx(Ua,{className:"h-3 w-3"}),"Zaplanowano"]}),i.jsx("p",{className:"font-medium text-primary",children:xt(new Date(o.scheduled_date),"d MMMM yyyy, HH:mm",{locale:nr})})]}),o.completed_date&&i.jsxs("div",{children:[i.jsx("p",{className:"text-muted-foreground",children:"Zakończono"}),i.jsx("p",{className:"font-medium",children:xt(new Date(o.completed_date),"d MMMM yyyy, HH:mm",{locale:nr})})]})]}),o.photos_urls&&o.photos_urls.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(ir,{}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("h4",{className:"font-semibold flex items-center gap-2",children:[i.jsx(rg,{className:"h-4 w-4"}),"Zdjęcia od klienta (",o.photos_urls.length,")"]}),i.jsx("div",{className:"flex flex-wrap gap-2",children:o.photos_urls.map(($,ae)=>{const le=ne.storage.from("ticket-photos").getPublicUrl($).data.publicUrl;return i.jsx("a",{href:le,target:"_blank",rel:"noopener noreferrer",className:"block",children:i.jsx("img",{src:le,alt:`Zdjęcie ${ae+1}`,className:"h-20 w-20 rounded-lg object-cover border border-border hover:border-primary transition-colors"})},ae)})})]})]}),O&&o.resolution_notes&&i.jsxs(i.Fragment,{children:[i.jsx(ir,{}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("h4",{className:"font-semibold flex items-center gap-2",children:[i.jsx(mn,{className:"h-4 w-4"}),"Wykonane czynności"]}),i.jsx("p",{className:"whitespace-pre-wrap text-sm",children:o.resolution_notes}),o.resolution_notes==="Protokół sporządzono w wersji papierowej"&&i.jsxs("div",{className:"mt-4 space-y-3",children:[o.paper_protocol_photos&&o.paper_protocol_photos.length>0&&i.jsx("div",{className:"flex flex-wrap gap-2",children:o.paper_protocol_photos.map(($,ae)=>{const le=ne.storage.from("ticket-photos").getPublicUrl($).data.publicUrl;return i.jsxs("div",{className:"relative group",children:[i.jsx("a",{href:le,target:"_blank",rel:"noopener noreferrer",children:i.jsx("img",{src:le,alt:`Zdjęcie protokołu ${ae+1}`,className:"h-24 w-24 rounded-lg object-cover border border-border hover:border-primary transition-colors"})}),i.jsx(G,{size:"icon",variant:"destructive",className:"absolute -top-2 -right-2 h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>Ve(ae),disabled:A===ae,children:A===ae?i.jsx(Vx,{className:"h-3 w-3 animate-spin"}):i.jsx(Ks,{className:"h-3 w-3"})})]},ae)})}),(((_r=o.paper_protocol_photos)==null?void 0:_r.length)||0)<4&&i.jsxs("label",{className:"cursor-pointer inline-block",children:[i.jsx("input",{type:"file",accept:"image/*",className:"hidden",onChange:$=>{var le;const ae=(le=$.target.files)==null?void 0:le[0];ae&&(oe(ae),$.target.value="")},disabled:B}),i.jsx(G,{variant:"outline",size:"sm",asChild:!0,disabled:B,children:i.jsxs("span",{children:[B?i.jsx(Vx,{className:"mr-2 h-4 w-4 animate-spin"}):i.jsx(Xy,{className:"mr-2 h-4 w-4"}),B?"Dodawanie...":"Dodaj zdjęcie protokołu"]})})]}),(((yt=o.paper_protocol_photos)==null?void 0:yt.length)||0)>=4&&i.jsx("p",{className:"text-xs text-muted-foreground",children:"Osiągnięto limit 4 zdjęć"})]})]})]})]})]}),i.jsxs(Fe,{children:[i.jsx(lt,{children:i.jsxs(ut,{className:"text-lg flex items-center gap-2",children:[i.jsx(mn,{className:"h-5 w-5"}),"Notatki prywatne"]})}),i.jsxs(Me,{className:"space-y-3",children:[i.jsx(Zn,{placeholder:"Twoje prywatne notatki do tego zgłoszenia...",value:y,onChange:$=>g($.target.value),rows:4}),i.jsxs(G,{onClick:he,disabled:x,size:"sm",children:[i.jsx(LO,{className:"mr-2 h-4 w-4"}),x?"Zapisywanie...":"Zapisz notatki"]})]})]}),i.jsx(or,{open:v,onOpenChange:w,children:i.jsxs(er,{children:[i.jsxs(tr,{children:[i.jsx(rr,{children:"Przyjmij zgłoszenie"}),i.jsx(Vn,{children:"Wybierz termin wizyty u klienta"})]}),i.jsx("div",{className:"py-4",children:i.jsx(wc,{label:"Termin wizyty",value:_,onCh
624ange:j})}),i.jsxs(ms,{children:[i.jsx(G,{variant:"outline",onClick:()=>w(!1),children:"Anuluj"}),i.jsx(G,{onClick:Z,disabled:!_||u,children:u?"Zapisywanie...":"Przyjmij i zaplanuj"})]})]})}),i.jsx(or,{open:k,onOpenChange:N,children:i.jsxs(er,{children:[i.jsxs(tr,{children:[i.jsx(rr,{children:"Wznów realizację"}),i.jsx(Vn,{children:"Wybierz nowy termin wizyty"})]}),i.jsx("div",{className:"py-4",children:i.jsx(wc,{label:"Termin wizyty",value:P,onChange:T})}),i.jsxs(ms,{children:[i.jsx(G,{variant:"outline",onClick:()=>N(!1),children:"Anuluj"}),i.jsx(G,{onClick:me,disabled:!P||u,children:u?"Zapisywanie...":"Zaplanuj wizytę"})]})]})}),i.jsx(or,{open:I,onOpenChange:H,children:i.jsxs(er,{children:[i.jsxs(tr,{children:[i.jsx(rr,{children:"Zmień termin wizyty"}),i.jsx(Vn,{children:"Wybierz nowy termin wizyty u klienta"})]}),i.jsx("div",{className:"py-4",children:i.jsx(wc,{label:"Nowy termin",value:M,onChange:L})}),i.jsxs(ms,{children:[i.jsx(G,{variant:"outline",onClick:()=>H(!1),children:"Anuluj"}),i.jsx(G,{onClick:ge,disabled:!M||u,children:u?"Zapisywanie...":"Zapisz nowy termin"})]})]})}),i.jsx(Wf,{open:F,onOpenChange:Y,title:"Anuluj zgłoszenie",description:"Czy na pewno chcesz anulować to zgłoszenie? Ta operacja jest nieodwracalna.",confirmText:u?"Anulowanie...":"Anuluj zgłoszenie",onConfirm:Ce,variant:"destructive"}),i.jsx(or,{open:Q,onOpenChange:S,children:i.jsxs(er,{className:"sm:max-w-md",children:[i.jsxs(tr,{children:[i.jsx(rr,{children:"Wybierz typ protokołu"}),i.jsx(Vn,{children:"W jaki sposób chcesz udokumentować wykonaną usługę?"})]}),i.jsxs("div",{className:"space-y-3 py-4",children:[i.jsx("button",{className:"w-full p-4 rounded-lg border-2 border-border text-left hover:border-primary hover:bg-primary/5 transition-colors",onClick:()=>{S(!1),t(`/tickets/${o.id}/protocol`)},children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(mn,{className:"h-5 w-5 text-primary mt-0.5"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:"Formularz online"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Wypełnij protokół cyfrowy z podpisem klienta i zdjęciami"})]})]})}),i.jsx("button",{className:"w-full p-4 rounded-lg border-2 border-border text-left hover:border-primary hover:bg-primary/5 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",onClick:Oe,disabled:z,children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(ll,{className:"h-5 w-5 text-muted-foreground mt-0.5"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:z?"Zamykanie...":"Sporządzono wersję papierową"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Protokół został spisany na papierze - zamknij zgłoszenie"})]})]})})]}),i.jsx(ms,{children:i.jsx(G,{variant:"outline",onClick:()=>S(!1),children:"Anuluj"})})]})})]})})}function Gg(){return Gg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gg.apply(null,arguments)}function F9(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function $9(e,t){if(e==null)return{};var r,n,s=F9(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Qg(e){"@babel/helpers - typeof";return Qg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qg(e)}function L9(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function U9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yg(e,t){return Yg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Yg(e,t)}function B9(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yg(e,t)}
624function Rh(e){return Rh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Rh(e)}function E2(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(E2=function(){return!!e})()}function W9(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V9(e,t){if(t&&(Qg(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return W9(e)}function q9(e){var t=E2();return function(){var r,n=Rh(e);if(t){var s=Rh(this).constructor;r=Reflect.construct(n,arguments,s)}else r=n.apply(this,arguments);return V9(this,r)}}var P2={exports:{}},H9="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",K9=H9,Z9=K9;function T2(){}function R2(){}R2.resetWarningCache=T2;var G9=function(){function e(n,s,a,o,l,c){if(c!==Z9){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:R2,resetWarningCache:T2};return r.PropTypes=r,r};P2.exports=G9();var Q9=P2.exports;const Kr=Ah(Q9);/*!
625 * Signature Pad v2.3.2
626 * https://github.com/szimek/signature_pad
627 *
628 * Copyright 2017 Szymon Nowak
629 * Released under the MIT license
630 *
631 * The main idea and some parts of the code (e.g. drawing variable width Bézier curve) are taken from:
632 * http://corner.squareup.com/2012/07/smoother-signatures.html
633 *
634 * Implementation of interpolation using cubic Bézier curves is taken from:
635 * http://benknowscode.wordpress.com/2012/09/14/path-interpolation-using-cubic-bezier-and-control-point-estimation-in-javascript
636 *
637 * Algorithm for approximated length of a Bézier curve is taken from:
638 * http://www.lemoda.net/maths/bezier-length/index.html
639 *
640 */function Hi(e,t,r){this.x=e,this.y=t,this.time=r||new Date().getTime()}Hi.prototype.velocityFrom=function(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):1};Hi.prototype.distanceTo=function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))};Hi.prototype.equals=function(e){return this.x===e.x&&this.y===e.y&&this.time===e.time};function vw(e,t,r,n){this.startPoint=e,this.control1=t,this.control2=r,this.endPoint=n}vw.prototype.length=function(){for(var e=10,t=0,r=void 0,n=void 0,s=0;s<=e;s+=1){var a=s/e,o=this._point(a,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),l=this._point(a,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(s>0){var c=o-r,d=l-n;t+=Math.sqrt(c*c+d*d)}r=o,n=l}return t};vw.prototype._point=function(e,t,r,n,s){return t*(1-e)*(1-e)*(1-e)+3*r*(1-e)*(1-e)*e+3*n*(1-e)*e*e+s*e*e*e};function Y9(e,t,r){var n,s,a,o=null,l=0;r||(r={});var c=function(){l=r.leading===!1?0:Date.now(),o=null,a=e.apply(n,s),o||(n=s=null)};return function(){var d=Date.now();!l&&r.leading===!1&&(l=d);var u=t-(d-l);return n=this,s=arguments,u<=0||u>t?(o&&(clearTimeout(o),o=null),l=d,a=e.apply(n,s),o||(n=s=null)):!o&&r.trailing!==!1&&(o=setTimeout(c,u)),a}}function gt(e,t){var r=this,n=t||{};this.velocityFilterWeight=n.velocityFilterWeight||.7,this.minWidth=n.minWidth||.5,this.maxWidth=n.maxWidth||2.5,this.throttle="throttle"in n?n.throttle:16,this.minDistance="minDistance"in n?n.minDistance:5,this.throttle?this._strokeMoveUpdate=Y9(gt.prototype._strokeUpdate,this.throttle):this._strokeMoveUpdate=gt.prototype._strokeUpdate,this.dotSize=n.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=n.penColor||"black",this.backgroundColor=n.backgroundColor||"rgba(0,0,0,0)",this.onBegin=n.onBegin,this.onEnd=n.onEnd,this._canvas=e,this._ctx=e.getContext("2d"),this.clear(),this._handleMouseDown=function(s){s.which===1&&(r._mouseButtonDown=!0,r._strokeBegin(s))}
640,this._handleMouseMove=function(s){r._mouseButtonDown&&r._strokeMoveUpdate(s)},this._handleMouseUp=function(s){s.which===1&&r._mouseButtonDown&&(r._mouseButtonDown=!1,r._strokeEnd(s))},this._handleTouchStart=function(s){if(s.targetTouches.length===1){var a=s.changedTouches[0];r._strokeBegin(a)}},this._handleTouchMove=function(s){s.preventDefault();var a=s.targetTouches[0];r._strokeMoveUpdate(a)},this._handleTouchEnd=function(s){var a=s.target===r._canvas;a&&(s.preventDefault(),r._strokeEnd(s))},this.on()}gt.prototype.clear=function(){var e=this._ctx,t=this._canvas;e.fillStyle=this.backgroundColor,e.clearRect(0,0,t.width,t.height),e.fillRect(0,0,t.width,t.height),this._data=[],this._reset(),this._isEmpty=!0};gt.prototype.fromDataURL=function(e){var t=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=new Image,s=r.ratio||window.devicePixelRatio||1,a=r.width||this._canvas.width/s,o=r.height||this._canvas.height/s;this._reset(),n.src=e,n.onload=function(){t._ctx.drawImage(n,0,0,a,o)},this._isEmpty=!1};gt.prototype.toDataURL=function(e){var t;switch(e){case"image/svg+xml":return this._toSVG();default:for(var r=arguments.length,n=Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return(t=this._canvas).toDataURL.apply(t,[e].concat(n))}};gt.prototype.on=function(){this._handleMouseEvents(),this._handleTouchEvents()};gt.prototype.off=function(){this._canvas.removeEventListener("mousedown",this._handleMouseDown),this._canvas.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),this._canvas.removeEventListener("touchstart",this._handleTouchStart),this._canvas.removeEventListener("touchmove",this._handleTouchMove),this._canvas.removeEventListener("touchend",this._handleTouchEnd)};gt.prototype.isEmpty=function(){return this._isEmpty};gt.prototype._strokeBegin=function(e){this._data.push([]),this._reset(),this._strokeUpdate(e),typeof this.onBegin=="function"&&this.onBegin(e)};gt.prototype._strokeUpdate=function(e){var t=e.clientX,r=e.clientY,n=this._createPoint(t,r),s=this._data[this._data.length-1],a=s&&s[s.length-1],o=a&&n.distanceTo(a)<this.minDistance;if(!(a&&o)){var l=this._addPoint(n),c=l.curve,d=l.widths;c&&d&&this._drawCurve(c,d.start,d.end),this._data[this._data.length-1].push({x:n.x,y:n.y,time:n.time,color:this.penColor})}};gt.prototype._strokeEnd=function(e){var t=this.points.length>2,r=this.points[0];if(!t&&r&&this._drawDot(r),r){var n=this._data[this._data.length-1],s=n[n.length-1];r.equals(s)||n.push({x:r.x,y:r.y,time:r.time,color:this.penColor})}typeof this.onEnd=="function"&&this.onEnd(e)};gt.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this._canvas.addEventListener("mousedown",this._handleMouseDown),this._canvas.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp)};gt.prototype._handleTouchEvents=function(){this._canvas.style.msTouchAction="none",this._canvas.style.touchAction="none",this._canvas.addEventListener("touchstart",this._handleTouchStart),this._canvas.addEventListener("touchmove",this._handleTouchMove),this._canvas.addEventListener("touchend",this._handleTouchEnd)};gt.prototype._reset=function(){this.points=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._ctx.fillStyle=this.penColor};gt.prototype._createPoint=function(e,t,r){var n=this._canvas.getBoundingClientRect();return new Hi(e-n.left,t-n.top,r||new Date().getTime())};gt.prototype._addPoint=function(e){var t=this.points,r=void 0;if(t.push(e),t.length>2){t.length===3&&t.unshift(t[0]),r=this._calculateCurveControlPoints(t[0],t[1],t[2]);var n=r.c2;r=this._calculateCurveControlPoints(t[1],t[2],t[3]);var s=r.c1,a=new vw(t[1],n,s,t[2]),o=this._calculateCurveWidths(a);return t.shift(),{curve:a,widths:o}}return{}};gt.prototype._calculateCurveControlPoints=function(e,t,r){var n=e.x-t.x,s=e.y-t.y,a=t.x-r.x,o=t.y-r.y,l={x:(e.x+t.x)/2,y:(e.y+t.y)/2},c={x:(t.x+r.x)/2,y:(t.y+r.y)/2},d=Math.sqrt(n*n+s*s),u=Math.sqrt(a*a+o*o),h=l.x-c.x,p=l.y-c.y,m=u/(d+u),y={x:c.x+h*m,y:c.y+p*m},g=t.x-y.x,x=t.y-y.y;return{c1:new Hi(l.x+g,l.y+x),c2:new Hi(c.x+g,c.y+x)}};gt.prototype._calculateCurveWidths=function(e){var t=e.startPoint,r=e.endPoint,n={start:null,end:null},s=this.velocityFilterWeight*r.velocityFrom(t)+(1-this.velocityFilterWeight)*this._lastVelocity,a=this._strokeWidth(s);return n.start=this._lastWidth,n.end=a,this._lastVelocity=s,this._lastWidth=a,n};gt.prototype._strokeWidth=function(e){return Math.max(this.maxWidth/(e+1),this.minWidth)};gt.prototype._drawPoint=function(e,t,r){var n=this._ctx;n.moveTo(e,t),n.arc(e,t,r,0,2*Math.PI,!1),this._isEmpty=!1};gt.prototype._drawCurve=function(e,t,r){var n=this._ctx,s=r-t,a=Math.floor(e.length());n.beginPath();for(var o=0;o<a;o+=1){var l=o/a,c=l*l,d=c*l,u=1-l,h=u*u,p=h*u,m=p*e.startPoint.x;m+=3*h*l*e.control1.x,m+=3*u*c*e.control2.x,m+=d*e.endPoint.x;var y=p*e.startPoint.y;y+=3*h*l*e.control1.y,y+=3*u*c*e.control2.y,y+=d*e.endPoint.y;var g=t+d*s;this._drawPoint(m,y,g)}n.closePath(),n.fill()};gt.prototype._drawDot=function(e){var t=this._ctx,r=typeof this.dotSize=="function"?this.dotSize():this.dotSize;t.beginPath(),this._drawPoint(e.x,e.y,r),t.closePath(),t.fill()};gt.prototype._fromData=function(e,t,r){for(var n=0;n<e.length;n+=1){var s=e[n];if(s.length>1)for(var a=0;a<s.length;a+=1){var o=s[a],l=new Hi(o.x,o.y,o.time),c=o.color;if(a===0)this.penColor=c,this._reset(),this._addPoint(l);else if(a!==s.length-1){var d=this._addPoint(l),u=d.curve,h=d.widths;u&&h&&t(u,h,c)}}else{this._reset();var p=s[0];r(p)}}};gt.prototype._toSVG=function(){var e=this,t=this._data,r=this._canvas,n=Math.max(window.devicePixelRatio||1,1),s=0,a=0,o=r.width/n,l=r.height/n,c=document.createElementNS("http://www.w3.org/2000/svg","svg");c.setAttributeNS(null,"width",r.width),c.setAttributeNS(null,"height",r.height),this._fromData(t,function(b,v,w){var _=document.createElement("path");if(!isNaN(b.control1.x)&&!isNaN(b.control1.y)&&!isNaN(b.control2.x)&&!isNaN(b.control2.y)){var j="M "+b.startPoint.x.toFixed(3)+","+b.startPoint.y.toFixed(3)+" "+("C "+b.control1.x.toFixed(3)+","+b.control1.y.toFixed(3)+" ")+(b.control2.x.toFixed(3)+","+b.control2.y.toFixed(3)+" ")+(b.endPoint.x.toFixed(3)+","+b.endPoint.y.toFixed(3));_.setAttribute("d",j),_.setAttribute("stroke-width",(v.end*2.25).toFixed(3)),_.setAttribute("stroke",w),_.setAttribute("fill","none"),_.setAttribute("stroke-linecap","round"),c.appendChild(_)}},function(b){var v=document.createElement("circle"),w=typeof e.dotSize=="function"?e.dotSize():e.dotSize;v.setAttribute("r",w),v.setAttribute("cx",b.x),v.setAttribute("cy",b.y),v.setAttribute("fill",b.color),c.appendChild(v)});var d="data:image/svg+xml;base64,",u='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"'+(' viewB
640ox="'+s+" "+a+" "+o+" "+l+'"')+(' width="'+o+'"')+(' height="'+l+'"')+">",h=c.innerHTML;if(h===void 0){var p=document.createElement("dummy"),m=c.childNodes;p.innerHTML="";for(var y=0;y<m.length;y+=1)p.appendChild(m[y].cloneNode(!0));h=p.innerHTML}var g="</svg>",x=u+h+g;return d+btoa(x)};gt.prototype.fromData=function(e){var t=this;this.clear(),this._fromData(e,function(r,n){return t._drawCurve(r,n.start,n.end)},function(r){return t._drawDot(r)}),this._data=e};gt.prototype.toData=function(){return this._data};var O2={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(X2,function(){return function(r){function n(a){if(s[a])return s[a].exports;var o=s[a]={exports:{},id:a,loaded:!1};return r[a].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var s={};return n.m=r,n.c=s,n.p="",n(0)}([function(r,n){function s(d){var u=d.getContext("2d"),h=d.width,p=d.height,m=u.getImageData(0,0,h,p).data,y=l(!0,h,p,m),g=l(!1,h,p,m),x=c(!0,h,p,m),b=c(!1,h,p,m),v=b-x+1,w=g-y+1,_=u.getImageData(x,y,v,w);return d.width=v,d.height=w,u.clearRect(0,0,v,w),u.putImageData(_,0,0),d}function a(d,u,h,p){return{red:p[4*(h*u+d)],green:p[4*(h*u+d)+1],blue:p[4*(h*u+d)+2],alpha:p[4*(h*u+d)+3]}}function o(d,u,h,p){return a(d,u,h,p).alpha}function l(d,u,h,p){for(var m=d?1:-1,y=d?0:h-1,g=y;d?g<h:g>-1;g+=m)for(var x=0;x<u;x++)if(o(x,g,u,p))return g;return null}function c(d,u,h,p){for(var m=d?1:-1,y=d?0:u-1,g=y;d?g<u:g>-1;g+=m)for(var x=0;x<h;x++)if(o(g,x,u,p))return g;return null}Object.defineProperty(n,"__esModule",{value:!0}),n.default=s}])})})(O2);var J9=O2.exports;const X9=Ah(J9);var eV=["canvasProps","clearOnResize"],Sd=function(e){B9(r,e);var t=q9(r);function r(){var n;U9(this,r);for(var s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];return n=t.call.apply(t,[this].concat(a)),n.staticThis=n.constructor,n._sigPad=null,n._canvas=null,n.setRef=function(l){n._canvas=l,n._canvas===null&&(n._sigPad=null)},n._excludeOurProps=function(){var l=n.props;l.canvasProps,l.clearOnResize;var c=$9(l,eV);return c},n.componentDidMount=function(){var l=n.getCanvas();n._sigPad=new gt(l,n._excludeOurProps()),n._resizeCanvas(),n.on()},n.componentWillUnmount=function(){n.off()},n.componentDidUpdate=function(){Object.assign(n._sigPad,n._excludeOurProps())},n.getCanvas=function(){if(n._canvas===null)throw n.staticThis.refNullError;return n._canvas},n.getTrimmedCanvas=function(){var l=n.getCanvas(),c=document.createElement("canvas");return c.width=l.width,c.height=l.height,c.getContext("2d").drawImage(l,0,0),X9(c)},n.getSignaturePad=function(){if(n._sigPad===null)throw n.staticThis.refNullError;return n._sigPad},n._checkClearOnResize=function(){n.props.clearOnResize&&n._resizeCanvas()},n._resizeCanvas=function(){var l,c,d=(l=n.props.canvasProps)!==null&&l!==void 0?l:{},u=d.width,h=d.height;if(!(typeof u<"u"&&typeof h<"u")){var p=n.getCanvas(),m=Math.max((c=window.devicePixelRatio)!==null&&c!==void 0?c:1,1);typeof u>"u"&&(p.width=p.offsetWidth*m),typeof h>"u"&&(p.height=p.offsetHeight*m),p.getContext("2d").scale(m,m),n.clear()}},n.render=function(){var l=n.props.canvasProps;return U.createElement("canvas",Gg({ref:n.setRef},l))},n.on=function(){return window.addEventListener("resize",n._checkClearOnResize),n.getSignaturePad().on()},n.off=function(){return window.removeEventListener("resize",n._checkClearOnResize),n.getSignaturePad().off()},n.clear=function(){return n.getSignaturePad().clear()},n.isEmpty=function(){return n.getSignaturePad().isEmpty()},n.fromDataURL=function(l,c){return n.getSignaturePad().fromDataURL(l,c)},n.toDataURL=function(l,c){return n.getSignaturePad().toDataURL(l,c)},n.fromData=function(l){return n.getSignaturePad().fromData(l)},n.toData=function(){return n.getSignaturePad().toData()},n}return L9(r)}(f.Component);Sd.propTypes={velocityFilterWeight:Kr.number,minWidth:Kr.number,maxWidth:Kr.number,minDistance:Kr.number,dotSize:Kr.oneOfType([Kr.number,Kr.func]),penColor:Kr.string,throttle:Kr.number,onEnd:Kr.func,onBegin:Kr.func,canvasProps:Kr.object,clearOnResize:Kr.bool};Sd.defaultProps={clearOnResize:!0};Sd.refNullError=new Error("react-signature-canvas is currently mounting or unmounting: React refs are null during this phase.");const tV=SS,rV=Pv,nV=Rv,Z0={id:"klimatyzacja",label:"Klimatyzacja / Pompa ciepła",maintenanceChecklist:[{id:"filter_cleaning",label:"Czyszczenie filtrów powietrza"},{id:"condenser_cleaning",label:"Czyszczenie wymiennika / skraplacza"}
640,{id:"leak_check_fgas",label:"Kontrola szczelności układu chłodniczego (F-gaz)"},{id:"refrigerant_params",label:"Sprawdzenie parametrów czynnika (ciśnienia ssania/tłoczenia)"},{id:"electrical_safety",label:"Kontrola instalacji elektrycznej i zabezpieczeń"},{id:"condensate_drain",label:"Sprawdzenie drożności odpływu skroplin"},{id:"controls_sensors",label:"Kontrola elementów sterowania i czujników"},{id:"operation_test",label:"Test pracy urządzenia w trybie grzanie/chłodzenie"}],faultChecklist:[{id:"diagnosis",label:"Diagnoza usterki"},{id:"repair",label:"Usunięcie usterki"},{id:"refrigerant_refill",label:"Uzupełnienie / wymiana czynnika chłodniczego"},{id:"post_repair_test",label:"Sprawdzenie poprawności działania po naprawie"}],measurements:[{id:"suction_pressure",label:"Ciśnienie ssania",unit:"bar",placeholder:"np. 5.2"},{id:"discharge_pressure",label:"Ciśnienie tłoczenia",unit:"bar",placeholder:"np. 28"},{id:"supply_temp",label:"Temperatura nawiewu",unit:"°C",placeholder:"np. 12"},{id:"return_temp",label:"Temperatura powrotu",unit:"°C",placeholder:"np. 24"},{id:"superheat",label:"Przegrzanie",unit:"K",placeholder:"np. 6"},{id:"subcooling",label:"Dochłodzenie",unit:"K",placeholder:"np. 4"},{id:"refrigerant_amount",label:"Ilość czynnika (uzupełniono/odzyskano)",unit:"g",placeholder:"np. 500"},{id:"refrigerant_type",label:"Rodzaj czynnika",unit:"",placeholder:"np. R32, R410A"}]},sV={id:"kociol",label:"Kocioł gazowy",maintenanceChecklist:[{id:"combustion_chamber",label:"Kontrola wizualna komory spalania i palnika"},{id:"heat_exchanger_clean",label:"Czyszczenie wymiennika ciepła"},{id:"gas_tightness",label:"Kontrola szczelności instalacji gazowej (manometrem)"},{id:"flue_gas_analysis",label:"Analiza spalin (pomiar CO, CO₂, O₂)"},{id:"chimney_draft",label:"Sprawdzenie ciągu kominowego"},{id:"safety_valves",label:"Kontrola zaworów bezpieczeństwa i naczynia przeponowego"},{id:"water_pressure",label:"Sprawdzenie ciśnienia wody w instalacji"},{id:"electrical_automation",label:"Kontrola instalacji elektrycznej i automatyki"}],faultChecklist:[{id:"diagnosis_error_code",label:"Diagnoza usterki (odczyt kodu błędu)"},{id:"repair",label:"Usunięcie usterki"},{id:"post_repair_tightness",label:"Kontrola szczelności po naprawie"},{id:"post_repair_test",label:"Sprawdzenie poprawności działania"}],measurements:[{id:"co_ppm",label:"CO",unit:"ppm",placeholder:"np. 15"},{id:"co2_percent",label:"CO₂",unit:"%",placeholder:"np. 9.2"},{id:"o2_percent",label:"O₂",unit:"%",placeholder:"np. 4.5"},{id:"flue_gas_temp",label:"Temperatura spalin",unit:"°C",placeholder:"np. 120"},{id:"gas_pressure_inlet",label:"Ciśnienie gazu na wejściu",unit:"mbar",placeholder:"np. 20"},{id:"water_pressure_bar",label:"Ciśnienie wody w instalacji",unit:"bar",placeholder:"np. 1.5"},{id:"combustion_efficiency",label:"Sprawność spalania",unit:"%",placeholder:"np. 94"}]},aV={id:"wentylacja",label:"Wentylacja / Rekuperacja",maintenanceChecklist:[{id:"filter_replace_clean",label:"Wymiana / czyszczenie filtrów powietrza"},{id:"recuperator_clean",label:"Czyszczenie wymiennika ciepła (rekuperatora)"},{id:"fan_bearings",label:"Kontrola wentylatorów i łożysk"},{id:"airflow_measurement",label:"Pomiar wydajności nawiewu i wywiewu"},{id:"duct_tightness",label:"Kontrola szczelności kanałów"},{id:"automation_sensors",label:"Sprawdzenie automatyki i czujników (CO₂, wilgotność)"},{id:"condensate_drain",label:"Kontrola odprowadzenia skroplin"},{id:"bypass_test",label:"Test bypass'u letniego"}],faultChecklist:[{id:"diagnosis",label:"Diagnoza usterki"},{id:"repair",label:"Usunięcie usterki"},{id:"post_repair_airflow",label:"Pomiar wydajności po naprawie"},{id:"post_repair_test",label:"Sprawdzenie poprawności działania"}],measurements:[{id:"supply_airflow",label:"Wydajność nawiewu",unit:"m³/h",placeholder:"np. 350"},{id:"exhaust_airflow",label:"Wydajność wywiewu",unit:"m³/h",placeholder:"np. 340"},{id:"supply_temp",label:"Temperatura nawiewu",unit:"°C",placeholder:"np. 20"},{id:"exhaust_temp",label:"Temperatura wywiewu",unit:"°C",placeholder:"np. 5"}
640,{id:"heat_recovery_efficiency",label:"Sprawność odzysku ciepła",unit:"%",placeholder:"np. 85"}]},Jg={id:"uniwersalny",label:"Protokół Uniwersalny",maintenanceChecklist:[{id:"visual_inspection",label:"Oględziny ogólne urządzenia"},{id:"cleaning",label:"Czyszczenie elementów roboczych i filtrów"},{id:"electrical_check",label:"Kontrola połączeń elektrycznych"},{id:"safety_check",label:"Kontrola elementów bezpieczeństwa"},{id:"operation_test",label:"Test poprawności działania"}],faultChecklist:[{id:"diagnosis",label:"Diagnoza usterki"},{id:"repair",label:"Usunięcie usterki"},{id:"post_repair_test",label:"Sprawdzenie poprawności działania"}],measurements:[],customMeasurements:!0},iV={klimatyzacja:Z0,pompa_ciepla:Z0,kociol:sV,wentylacja:aV,inne:Jg};function Ou(e){return e&&iV[e]||Jg}function oV(e){const t={};for(const r of[...e.maintenanceChecklist,...e.faultChecklist])t[r.id]=r.label;return t}function lV(e){const t={};for(const r of e.measurements)t[r.id]={label:r.label,unit:r.unit};return t}const ww=[{value:"individual",label:"Osoba fizyczna"},{value:"company",label:"Firma"}];function A2(e){var t;return e?((t=ww.find(r=>r.value===e))==null?void 0:t.label)||e:"Nieokreślony"}const cV={id:"awaria_klimatyzacja",label:"Awaria — Klimatyzacja (multi/split)",ticketType:"fault",deviceCategory:"klimatyzacja",sections:[{id:"metadane",title:"Dane protokołu",icon:"FileText",fields:[{id:"protocol_number",label:"Nr protokołu",type:"text",editable:!1,autoFill:"meta.protocol_number"},{id:"datetime",label:"Data i godzina",type:"datetime",editable:!1,autoFill:"meta.datetime"},{id:"ticket_type",label:"Rodzaj zgłoszenia",type:"text",editable:!1,autoFill:"meta.ticket_type"}]},{id:"klient",title:"Dane klienta",icon:"User",fields:[{id:"client_type",label:"Typ klienta",type:"text",editable:!1,autoFill:"client.client_type"},{id:"client_name",label:"Imię i nazwisko / Nazwa firmy",type:"text",editable:!0,autoFill:"client.name",required:!0},{id:"client_nip",label:"NIP",type:"text",editable:!0,placeholder:"np. 123-456-78-90",autoFill:"client.nip",showIf:{field:"client_type",value:"Firma"}},{id:"client_address",label:"Adres",type:"text",editable:!0,autoFill:"client.address"},{id:"client_phone",label:"Telefon",type:"text",editable:!0,autoFill:"client.phone"},{id:"client_email",label:"Email",type:"text",editable:!0,autoFill:"client.email"}]},{id:"urzadzenie",title:"Dane urządzenia",icon:"Cpu",fields:[{id:"device_category",label:"Kategoria",type:"text",editable:!1,autoFill:"device.category"},{id:"device_manufacturer",label:"Producent",type:"text",editable:!0,autoFill:"device.manufacturer"},{id:"device_model",label:"Model",type:"text",editable:!0,autoFill:"device.model"},{id:"device_serial",label:"Nr seryjny",type:"text",editable:!0,autoFill:"device.serial_number"},{id:"aggregate_serial",label:"Nr seryjny agregatu",type:"text",editable:!0,placeholder:"Jeśli dotyczy"},{id:"refrigerant_type",label:"Rodzaj czynnika chłodniczego",type:"select",options:["R32","R410A","R407C","R134a","R290","Inny"],editable:!0},{id:"refrigerant_nominal_kg",label:"Nominalna ilość czynnika",type:"number",unit:"kg",editable:!0,placeholder:"np. 1.2"},{id:"cro_subject",label:"Podlega CRO?",type:"select",options:["TAK","NIE"],editable:!0},{id:"cro_number",label:"Numer Karty CRO",type:"text",editable:!0,placeholder:"Numer karty",showIf:{field:"cro_subject",value:"TAK"}}]},{id:"diagnoza",title:"Diagnoza i czynności",icon:"Stethoscope",fields:[{id:"reported_fault",label:"Zgłaszana usterka (opis klienta)",type:"textarea",editable:!0,autoFill:"ticket.description",placeholder:"Opis usterki zgłoszonej przez klienta"},{id:"technician_diagnosis",label:"Diagnoza serwisanta",type:"textarea",editable:!0,placeholder:"Wynik oględzin i diagnostyki",required:!0},{id:"actions_performed",label:"Wykonane czynności",type:"textarea",editable:!0,placeholder:"Szczegółowy opis wykonanych prac",required:!0},{id:"materials_used",label:"Użyte materiały i części",type:"textarea",editable:!0,placeholder:"np. Czynnik R32: 500g, filtr: 1 szt."}]},{id:"fgazy",title:"F-gazy",icon:"Snowflake",fields:[{id:"refrigerant_intervention",label:"Ingerencja w obieg chłodniczy?",type:"select",options:["TAK","NIE"],editable:!0},{id:"recovered_kg",label:"Odzyskany czynnik",type:"number",unit:"kg",editable:!0,placeholder:"np. 0.5",showIf:{field:"refrigerant_intervention",value:"TAK"}},{id:"added_kg",label:"Dodany czynnik",type:"number",unit:"kg",editable:!0,placeholder:"np. 1.2",showIf:{field:"refrigerant_intervention",value:"TAK"}},{id:"leak_check",label:"Przeprowadzono kontrolę szczelności?",type:"select",options:["TAK","NIE"],editable:!0,showIf:{field:"refrigerant_intervention",value:"TAK"}},{id:"leak_check_result",label:"Wynik kontroli szczelności",type:"select",options:["Szczelny","Nieszczelny — naprawiono","Nieszczelny — wymaga dalszych prac"],editable:!0,showIf:{field:"leak_check",value:"TAK"}}]},{id:"final",title:"Podsumowanie",icon:"CheckCircle",fields:[{id:"status_after_service",label:"Status urządzenia po serwisie",type:"select",options:["Sprawne","Niesprawne — wymaga dalszych prac","Wyłączone z eksploatacji"],editable:!0,required:!0},{id:"udt_certificate",label:"Nr Certyfikatu UDT serwisanta",type:"text",editable:!0,placeholder:"np. F-GAZ/123/2025"}
640,{id:"technician_signature",label:"Podpis serwisanta",type:"signature"},{id:"client_signature",label:"Podpis klienta",type:"signature"}]}]},dV={id:"przeglad_klimatyzacja",label:"Przegląd — Klimatyzacja (multi/split)",ticketType:"maintenance",deviceCategory:"klimatyzacja",sections:[{id:"metadane",title:"Dane protokołu",icon:"FileText",fields:[{id:"protocol_number",label:"Nr protokołu",type:"text",editable:!1,autoFill:"meta.protocol_number"},{id:"datetime",label:"Data i godzina",type:"datetime",editable:!1,autoFill:"meta.datetime"},{id:"ticket_type",label:"Rodzaj zgłoszenia",type:"text",editable:!1,autoFill:"meta.ticket_type"}]},{id:"klient",title:"Dane klienta",icon:"User",fields:[{id:"client_type",label:"Typ klienta",type:"text",editable:!1,autoFill:"client.client_type"},{id:"client_name",label:"Imię i nazwisko / Nazwa firmy",type:"text",editable:!0,autoFill:"client.name",required:!0},{id:"client_nip",label:"NIP",type:"text",editable:!0,placeholder:"np. 123-456-78-90",autoFill:"client.nip",showIf:{field:"client_type",value:"Firma"}},{id:"client_address",label:"Adres",type:"text",editable:!0,autoFill:"client.address"},{id:"client_phone",label:"Telefon",type:"text",editable:!0,autoFill:"client.phone"},{id:"client_email",label:"Email",type:"text",editable:!0,autoFill:"client.email"}]},{id:"urzadzenie",title:"Dane urządzenia",icon:"Cpu",fields:[{id:"device_category",label:"Kategoria",type:"text",editable:!1,autoFill:"device.category"},{id:"device_manufacturer",label:"Producent",type:"text",editable:!0,autoFill:"device.manufacturer"},{id:"device_model",label:"Model",type:"text",editable:!0,autoFill:"device.model"},{id:"device_serial",label:"Nr seryjny",type:"text",editable:!0,autoFill:"device.serial_number"},{id:"aggregate_serial",label:"Nr seryjny agregatu",type:"text",editable:!0,placeholder:"Jeśli dotyczy"},{id:"refrigerant_type",label:"Rodzaj czynnika chłodniczego",type:"select",options:["R32","R410A","R407C","R134a","R290","Inny"],editable:!0},{id:"refrigerant_nominal_kg",label:"Nominalna ilość czynnika",type:"number",unit:"kg",editable:!0,placeholder:"np. 1.2"},{id:"cro_subject",label:"Podlega CRO?",type:"select",options:["TAK","NIE"],editable:!0},{id:"cro_number",label:"Numer Karty CRO",type:"text",editable:!0,placeholder:"Numer karty",showIf:{field:"cro_subject",value:"TAK"}}]},{id:"checklista",title:"Checklista przeglądowa",icon:"ClipboardCheck",fields:[{id:"evaporator_cleaning",label:"Czyszczenie / dezynfekcja parownika",type:"select",options:["Wykonano","Brak dostępu","Naprawa"],editable:!0,required:!0},{id:"condenser_cleaning",label:"Czyszczenie skraplacza",type:"select",options:["Wykonano","Brak dostępu","Naprawa"],editable:!0,required:!0},{id:"drain_check",label:"Sprawdzenie odpływu skroplin",type:"select",options:["Drożny","Udrożniono","Awaria"],editable:!0,required:!0},{id:"leak_test",label:"Szczelność obwodu chłodniczego",type:"select",options:["Szczelny","Wykryto nieszczelność"],editable:!0,required:!0},{id:"refrigerant_intervention",label:"Ingerencja w układ chłodniczy",type:"select",options:["TAK","NIE"],editable:!0},{id:"refrigerant_amount_kg",label:"Ilość dodanego/usuniętego czynnika",type:"number",unit:"kg",editable:!0,placeholder:"np. 0.5",showIf:{field:"refrigerant_intervention",value:"TAK"}},{id:"supply_air_temp",label:"Temperatura nawiewu po serwisie",type:"number",unit:"°C",editable:!0,placeholder:"np. 12"}]},{id:"final",title:"Podsumowanie",icon:"CheckCircle",fields:[{id:"status_after_service",label:"Status urządzenia po serwisie",type:"select",options:["Sprawne","Niesprawne — wymaga dalszych prac","Wyłączone z eksploatacji"],editable:!0,required:!0},{id:"recommendations",label:"Uwagi / Zalecenia dla klienta",type:"textarea",editable:!0,placeholder:"Dodatkowe uwagi lub zalecenia"},{id:"udt_certificate",label:"Nr Certyfikatu UDT serwisanta",type:"text",editable:!0,placeholder:"np. F-GAZ/123/2025"},{id:"technician_signature",label:"Podpis serwisanta",type:"signature"},{id:"consent_reminders",label:"Wyrażam zgodę na otrzymywanie przypomnień o przeglądach serwisowych drogą SMS/email",type:"checkbox",editable:!0},{id:"client_signature",label:"Podpis klienta",type:"signature"}]}]},uV={id:"awaria_pompa_ciepla",label:"Awaria — Pompa ciepła",ticketType:"fault",deviceCategory:"pompa_ciepla",sections:[{id:"metadane",title:"Dane protokołu",icon:"FileText",fields:[{id:"protocol_number",label:"Nr protokołu",type:"text",editable:!1,autoFill:"meta.protocol_number"},{id:"datetime",label:"Data i godzina",type:"datetime",editable:!1,autoFill:"meta.datetime"},{id:"ticket_type",label:"Rodzaj zgłoszenia",type:"text",editable:!1,autoFill:"meta.ticket_type"}]},{id:"klient",title:"Dane klienta",icon:"User",fields:[{id:"client_type",label:"Typ klienta",type:"text",editable:!1,autoFill:"client.client_type"},{id:"client_name",label:"Imię i nazwisko / Nazwa firmy",type:"text",editable:!0,autoFill:"client.name",required:!0},{id:"client_nip",label:"NIP",type:"text",editable:!0,placeholder:"np. 123-456-78-90",autoFill:"client.nip",showIf:{field:"client_type",value:"Firma"}},{id:"client_address",label:"Adres",type:"text",editable:!0,autoFill:"client.address"},{id:"client_phone",label:"Telefon",type:"text",editable:!0,autoFill:"client.phone"},{id:"client_email",label:"Email",type:"text",editable:!0,autoFill:"client.email"}]},{id:"urzadzenie",title:"Dane urządzenia",icon:"Cpu",fields:[{id:"device_category",label:"Kategoria",type:"text",editable:!1,autoFill:"device.category"},{id:"device_manufacturer",label:"Producent",type:"text",editable:!0,autoFill:"device.manufacturer"},{id:"device_model",label:"Model",type:"text",editable:!0,autoFill:"device.model"}
640,{id:"device_serial",label:"Nr seryjny",type:"text",editable:!0,autoFill:"device.serial_number"},{id:"aggregate_serial",label:"Nr seryjny agregatu",type:"text",editable:!0,placeholder:"Jeśli dotyczy"},{id:"refrigerant_type",label:"Rodzaj czynnika chłodniczego",type:"select",options:["R32","R410A","Inny"],editable:!0},{id:"cro_subject",label:"Podlega CRO?",type:"select",options:["TAK","NIE"],editable:!0},{id:"cro_number",label:"Numer Karty CRO",type:"text",editable:!0,placeholder:"Numer karty",showIf:{field:"cro_subject",value:"TAK"}}]},{id:"diagnoza",title:"Diagnoza i czynności",icon:"Stethoscope",fields:[{id:"reported_fault",label:"Zgłaszana usterka (opis klienta)",type:"textarea",editable:!0,autoFill:"ticket.description",placeholder:"Opis usterki zgłoszonej przez klienta"},{id:"technician_diagnosis",label:"Diagnoza serwisanta",type:"textarea",editable:!0,placeholder:"Wynik oględzin i diagnostyki",required:!0},{id:"actions_performed",label:"Wykonane czynności",type:"textarea",editable:!0,placeholder:"Szczegółowy opis wykonanych prac",required:!0},{id:"materials_used",label:"Użyte materiały i części",type:"textarea",editable:!0,placeholder:"np. Czynnik R32: 500g, filtr: 1 szt."}]},{id:"fgazy",title:"F-gazy",icon:"Snowflake",fields:[{id:"refrigerant_intervention",label:"Ingerencja w obieg chłodniczy?",type:"select",options:["TAK","NIE"],editable:!0},{id:"recovered_kg",label:"Odzyskany czynnik",type:"number",unit:"kg",editable:!0,placeholder:"np. 0.5",showIf:{field:"refrigerant_intervention",value:"TAK"}},{id:"added_kg",label:"Dodany czynnik",type:"number",unit:"kg",editable:!0,placeholder:"np. 1.2",showIf:{field:"refrigerant_intervention",value:"TAK"}},{id:"leak_check",label:"Przeprowadzono kontrolę szczelności?",type:"select",options:["TAK","NIE"],editable:!0,showIf:{field:"refrigerant_intervention",value:"TAK"}},{id:"leak_check_result",label:"Wynik kontroli szczelności",type:"select",options:["Szczelny","Nieszczelny"],editable:!0,showIf:{field:"leak_check",value:"TAK"}}]},{id:"final",title:"Podsumowanie",icon:"CheckCircle",fields:[{id:"status_after_service",label:"Status urządzenia po serwisie",type:"select",options:["Sprawne","Niesprawne — wymaga dalszych prac","Wyłączone z eksploatacji"],editable:!0,required:!0},{id:"recommendations",label:"Uwagi / Zalecenia dla klienta",type:"textarea",editable:!0,placeholder:"Dodatkowe uwagi lub zalecenia"},{id:"udt_certificate",label:"Nr Certyfikatu UDT serwisanta",type:"text",editable:!0,placeholder:"np. F-GAZ/123/2025"},{id:"technician_signature",label:"Podpis serwisanta",type:"signature"},{id:"client_signature",label:"Podpis klienta",type:"signature"}]}]},hV={id:"przeglad_pompa_ciepla",label:"Przegląd — Pompa ciepła",ticketType:"maintenance",deviceCategory:"pompa_ciepla",sections:[{id:"metadane",title:"Dane protokołu",icon:"FileText",fields:[{id:"protocol_number",label:"Nr protokołu",type:"text",editable:!1,autoFill:"meta.protocol_number"},{id:"datetime",label:"Data i godzina",type:"datetime",editable:!1,autoFill:"meta.datetime"},{id:"ticket_type",label:"Rodzaj zgłoszenia",type:"text",editable:!1,autoFill:"meta.ticket_type"}]},{id:"klient",title:"Dane klienta",icon:"User",fields:[{id:"client_type",label:"Typ klienta",type:"text",editable:!1,autoFill:"client.client_type"},{id:"client_name",label:"Imię i nazwisko / Nazwa firmy",type:"text",editable:!0,autoFill:"client.name",required:!0},{id:"client_nip",label:"NIP",type:"text",editable:!0,placeholder:"np. 123-456-78-90",autoFill:"client.nip",showIf:{field:"client_type",value:"Firma"}},{id:"client_address",label:"Adres",type:"text",editable:!0,autoFill:"client.address"},{id:"client_phone",label:"Telefon",type:"text",editable:!0,autoFill:"client.phone"},{id:"client_email",label:"Email",type:"text",editable:!0,autoFill:"client.email"}]},{id:"urzadzenie",title:"Dane urządzenia",icon:"Cpu",fields:[{id:"device_category",label:"Kategoria",type:"text",editable:!1,autoFill:"device.category"},{id:"device_manufacturer",label:"Producent",type:"text",editable:!0,autoFill:"device.manufacturer"},{id:"device_model",label:"Model",type:"text",editable:!0,autoFill:"device.model"}
640,{id:"device_serial",label:"Nr seryjny",type:"text",editable:!0,autoFill:"device.serial_number"},{id:"aggregate_serial",label:"Nr seryjny agregatu",type:"text",editable:!0,placeholder:"Jeśli dotyczy"},{id:"refrigerant_type",label:"Rodzaj czynnika chłodniczego",type:"select",options:["R32","R410A","Inny"],editable:!0},{id:"refrigerant_nominal_kg",label:"Nominalna ilość czynnika",type:"number",unit:"kg",editable:!0,placeholder:"np. 1.2"},{id:"cro_subject",label:"Podlega CRO?",type:"select",options:["TAK","NIE"],editable:!0},{id:"cro_number",label:"Numer Karty CRO",type:"text",editable:!0,placeholder:"Numer karty",showIf:{field:"cro_subject",value:"TAK"}}]},{id:"checklista",title:"Checklista przeglądowa",icon:"ClipboardCheck",fields:[{id:"leak_test",label:"Kontrola szczelności",type:"select",options:["Szczelna","Nieszczelność","Brak"],editable:!0,required:!0},{id:"refrigerant_added_kg",label:"Dodano czynnik",type:"number",unit:"kg",editable:!0,placeholder:"np. 0.5",showIf:{field:"leak_test",value:"Nieszczelność"}},{id:"heat_exchanger_cleaning",label:"Czyszczenie wymienników",type:"checkbox",editable:!0},{id:"hydraulic_filter_cleaning",label:"Czyszczenie filtrów hydraulicznych",type:"checkbox",editable:!0},{id:"expansion_vessel_check",label:"Kontrola ciśnienia naczynia wzbiorczego",type:"checkbox",editable:!0}]},{id:"final",title:"Podsumowanie",icon:"CheckCircle",fields:[{id:"recommendations",label:"Uwagi / Zalecenia dla klienta",type:"textarea",editable:!0,placeholder:"Dodatkowe uwagi lub zalecenia"},{id:"status_after_service",label:"Status urządzenia po serwisie",type:"select",options:["Sprawne","Niesprawne — wymaga dalszych prac","Wyłączone z eksploatacji"],editable:!0,required:!0},{id:"udt_certificate",label:"Nr Certyfikatu UDT serwisanta",type:"text",editable:!0,placeholder:"np. F-GAZ/123/2025"},{id:"technician_signature",label:"Podpis serwisanta",type:"signature"},{id:"consent_reminders",label:"Wyrażam zgodę na otrzymywanie przypomnień o przeglądach serwisowych drogą SMS/email",type:"checkbox",editable:!0},{id:"client_signature",label:"Podpis klienta",type:"signature"}]}]},fV={id:"awaria_inne",label:"Awaria — Inne",ticketType:"fault",deviceCategory:"inne",sections:[{id:"metadane",title:"Dane protokołu",icon:"FileText",fields:[{id:"protocol_number",label:"Nr protokołu",type:"text",editable:!1,autoFill:"meta.protocol_number"},{id:"datetime",label:"Data i godzina",type:"datetime",editable:!1,autoFill:"meta.datetime"},{id:"ticket_type",label:"Rodzaj zgłoszenia",type:"text",editable:!1,autoFill:"meta.ticket_type"}]},{id:"klient",title:"Dane klienta",icon:"User",fields:[{id:"client_type",label:"Typ klienta",type:"text",editable:!1,autoFill:"client.client_type"},{id:"client_name",label:"Imię i nazwisko / Nazwa firmy",type:"text",editable:!0,autoFill:"client.name",required:!0},{id:"client_nip",label:"NIP",type:"text",editable:!0,placeholder:"np. 123-456-78-90",autoFill:"client.nip",showIf:{field:"client_type",value:"Firma"}},{id:"client_address",label:"Adres",type:"text",editable:!0,autoFill:"client.address"},{id:"client_phone",label:"Telefon",type:"text",editable:!0,autoFill:"client.phone"},{id:"client_email",label:"Email",type:"text",editable:!0,autoFill:"client.email"}]},{id:"urzadzenie",title:"Dane urządzenia",icon:"Cpu",fields:[{id:"device_category",label:"Kategoria",type:"text",editable:!1,autoFill:"device.category"},{id:"device_name",label:"Nazwa urządzenia",type:"text",editable:!0,placeholder:"np. Chiller, VRF, Osuszacz"},{id:"device_manufacturer",label:"Producent",type:"text",editable:!0,autoFill:"device.manufacturer"},{id:"device_model",label:"Model",type:"text",editable:!0,autoFill:"device.model"},{id:"device_serial",label:"Nr seryjny",type:"text",editable:!0,autoFill:"device.serial_number"},{id:"refrigerant_type",label:"Rodzaj czynnika chłodniczego",type:"select",options:["R32","R410A","Inny"],editable:!0},{id:"refrigerant_nominal_kg",label:"Nominalna ilość czynnika",type:"number",unit:"kg",editable:!0,placeholder:"np. 1.2"},{id:"cro_subject",label:"Podlega CRO?",type:"select",options:["TAK","NIE"],editable:!0},{id:"cro_number",label:"Numer Karty CRO",type:"text",editable:!0,placeholder:"Numer karty",showIf:{field:"cro_subject",value:"TAK"}}]},{id:"diagnoza",title:"Diagnoza i czynności",icon:"Stethoscope",fields:[{id:"reported_fault",label:"Zgłaszana usterka (opis klienta)",type:"textarea",editable:!0,autoFill:"ticket.description",placeholder:"Opis usterki zgłoszonej przez klienta"}
640,{id:"technician_diagnosis",label:"Diagnoza serwisanta",type:"textarea",editable:!0,placeholder:"Wynik oględzin i diagnostyki",required:!0},{id:"actions_performed",label:"Wykonane czynności",type:"textarea",editable:!0,placeholder:"Szczegółowy opis wykonanych prac",required:!0},{id:"materials_used",label:"Użyte materiały i części",type:"textarea",editable:!0,placeholder:"np. Czynnik R32: 500g, filtr: 1 szt."}]},{id:"fgazy",title:"F-gazy",icon:"Snowflake",fields:[{id:"refrigerant_intervention",label:"Ingerencja w obieg chłodniczy?",type:"select",options:["TAK","NIE"],editable:!0},{id:"recovered_kg",label:"Odzyskany czynnik",type:"number",unit:"kg",editable:!0,placeholder:"np. 0.5",showIf:{field:"refrigerant_intervention",value:"TAK"}},{id:"added_kg",label:"Dodany czynnik",type:"number",unit:"kg",editable:!0,placeholder:"np. 1.2",showIf:{field:"refrigerant_intervention",value:"TAK"}},{id:"leak_check",label:"Przeprowadzono kontrolę szczelności?",type:"select",options:["TAK","NIE"],editable:!0,showIf:{field:"refrigerant_intervention",value:"TAK"}},{id:"leak_check_result",label:"Wynik kontroli szczelności",type:"select",options:["Szczelny","Nieszczelny"],editable:!0,showIf:{field:"leak_check",value:"TAK"}}]},{id:"final",title:"Podsumowanie",icon:"CheckCircle",fields:[{id:"status_after_service",label:"Status urządzenia po serwisie",type:"select",options:["Sprawne","Niesprawne — wymaga dalszych prac","Wyłączone z eksploatacji"],editable:!0,required:!0},{id:"recommendations",label:"Uwagi / Zalecenia dla klienta",type:"textarea",editable:!0,placeholder:"Dodatkowe uwagi lub zalecenia"},{id:"udt_certificate",label:"Nr Certyfikatu UDT serwisanta",type:"text",editable:!0,placeholder:"np. F-GAZ/123/2025"},{id:"technician_signature",label:"Podpis serwisanta",type:"signature"},{id:"client_signature",label:"Podpis klienta",type:"signature"}]}]},pV={id:"przeglad_inne",label:"Przegląd — Inne",ticketType:"maintenance",deviceCategory:"inne",sections:[{id:"metadane",title:"Dane protokołu",icon:"FileText",fields:[{id:"protocol_number",label:"Nr protokołu",type:"text",editable:!1,autoFill:"meta.protocol_number"},{id:"datetime",label:"Data i godzina",type:"datetime",editable:!1,autoFill:"meta.datetime"},{id:"ticket_type",label:"Rodzaj zgłoszenia",type:"text",editable:!1,autoFill:"meta.ticket_type"}]},{id:"klient",title:"Dane klienta",icon:"User",fields:[{id:"client_type",label:"Typ klienta",type:"text",editable:!1,autoFill:"client.client_type"},{id:"client_name",label:"Imię i nazwisko / Nazwa firmy",type:"text",editable:!0,autoFill:"client.name",required:!0},{id:"client_nip",label:"NIP",type:"text",editable:!0,placeholder:"np. 123-456-78-90",autoFill:"client.nip",showIf:{field:"client_type",value:"Firma"}},{id:"client_address",label:"Adres",type:"text",editable:!0,autoFill:"client.address"},{id:"client_phone",label:"Telefon",type:"text",editable:!0,autoFill:"client.phone"},{id:"client_email",label:"Email",type:"text",editable:!0,autoFill:"client.email"}]},{id:"urzadzenie",title:"Dane urządzenia",icon:"Cpu",fields:[{id:"device_category",label:"Kategoria",type:"text",editable:!1,autoFill:"device.category"},{id:"device_name",label:"Nazwa urządzenia",type:"text",editable:!0,required:!0,placeholder:"np. Agregat wody lodowej"},{id:"device_manufacturer",label:"Producent",type:"text",editable:!0,autoFill:"device.manufacturer"},{id:"device_model",label:"Model",type:"text",editable:!0,autoFill:"device.model"},{id:"device_serial",label:"Nr seryjny",type:"text",editable:!0,autoFill:"device.serial_number"},{id:"cro_subject",label:"Podlega CRO?",type:"select",options:["TAK","NIE"],editable:!0},{id:"refrigerant_type",label:"Rodzaj czynnika",type:"select",options:["R32","R410A","Inny"],editable:!0,showIf:{field:"cro_subject",value:"TAK"}},{id:"refrigerant_nominal_kg",label:"Nominalna ilość czynnika",type:"number",unit:"kg",editable:!0,placeholder:"np. 2.5",showIf:{field:"cro_subject",value:"TAK"}},{id:"cro_number",label:"Numer Karty CRO",type:"text",editable:!0,placeholder:"np. CRO/123/2025",showIf:{field:"cro_subject",value:"TAK"}}]},{id:"checklista",title:"Checklista przeglądowa",icon:"ClipboardCheck",fields:[{id:"leak_check_result",label:"Kontrola 
640szczelności",type:"select",options:["Szczelna","Nieszczelność","Brak"],editable:!0,showIf:{field:"cro_subject",value:"TAK"}},{id:"added_kg",label:"Dodano czynnik",type:"number",unit:"kg",editable:!0,placeholder:"np. 0.5",showIf:{field:"leak_check_result",value:"Nieszczelność"}},{id:"actions_performed",label:"Wykonane czynności",type:"textarea",editable:!0,placeholder:"Opisz wykonane czynności serwisowe"}]},{id:"final",title:"Podsumowanie",icon:"CheckCircle",fields:[{id:"recommendations",label:"Uwagi / Zalecenia dla klienta",type:"textarea",editable:!0,placeholder:"Dodatkowe uwagi lub zalecenia"},{id:"status_after_service",label:"Status urządzenia po serwisie",type:"select",options:["Sprawne","Niesprawne — wymaga dalszych prac","Wyłączone z eksploatacji"],editable:!0,required:!0},{id:"udt_certificate",label:"Nr Certyfikatu UDT serwisanta",type:"text",editable:!0,placeholder:"np. F-GAZ/123/2025",showIf:{field:"cro_subject",value:"TAK"}},{id:"technician_signature",label:"Podpis serwisanta",type:"signature"},{id:"consent_reminders",label:"Wyrażam zgodę na otrzymywanie przypomnień o przeglądach serwisowych drogą SMS/email",type:"checkbox",editable:!0},{id:"client_signature",label:"Podpis klienta",type:"signature"}]}]},mV={id:"awaria_kociol",label:"Awaria — Kocioł gazowy",ticketType:"fault",deviceCategory:"kociol",sections:[{id:"metadane",title:"Dane protokołu",icon:"FileText",fields:[{id:"protocol_number",label:"Nr protokołu",type:"text",editable:!1,autoFill:"meta.protocol_number"},{id:"datetime",label:"Data i godzina",type:"datetime",editable:!1,autoFill:"meta.datetime"},{id:"ticket_type",label:"Rodzaj zgłoszenia",type:"text",editable:!1,autoFill:"meta.ticket_type"}]},{id:"klient",title:"Dane klienta",icon:"User",fields:[{id:"client_type",label:"Typ klienta",type:"text",editable:!1,autoFill:"client.client_type"},{id:"client_name",label:"Imię i nazwisko / Nazwa firmy",type:"text",editable:!0,autoFill:"client.name",required:!0},{id:"client_nip",label:"NIP",type:"text",editable:!0,placeholder:"np. 123-456-78-90",autoFill:"client.nip",showIf:{field:"client_type",value:"Firma"}},{id:"client_address",label:"Adres",type:"text",editable:!0,autoFill:"client.address"},{id:"client_phone",label:"Telefon",type:"text",editable:!0,autoFill:"client.phone"},{id:"client_email",label:"Email",type:"text",editable:!0,autoFill:"client.email"}]},{id:"urzadzenie",title:"Dane urządzenia",icon:"Cpu",fields:[{id:"device_category",label:"Kategoria",type:"text",editable:!1,autoFill:"device.category"},{id:"device_manufacturer",label:"Producent",type:"text",editable:!0,autoFill:"device.manufacturer"},{id:"device_model",label:"Model",type:"text",editable:!0,autoFill:"device.model"},{id:"device_serial",label:"Nr seryjny",type:"text",editable:!0,autoFill:"device.serial_number"}]},{id:"diagnoza",title:"Diagnoza i naprawa",icon:"Stethoscope",fields:[{id:"reported_fault",label:"Zgłaszana usterka",type:"textarea",editable:!1,autoFill:"ticket.description"},{id:"technician_diagnosis",label:"Diagnoza serwisanta",type:"textarea",editable:!0,placeholder:"Opisz zdiagnozowaną przyczynę usterki"},{id:"actions_performed",label:"Wykonane czynności",type:"textarea",editable:!0,placeholder:"Opisz wykonane czynności naprawcze"},{id:"materials_used",label:"Użyte materiały i części",type:"textarea",editable:!0,placeholder:"Wymień użyte części zamienne i materiały"}]},{id:"measurements",title:"Pomiary",icon:"Stethoscope",fields:[{id:"gas_leak_test",label:"Kontrola szczelności instalacji gazowej",type:"select",options:["Szczelna","Nieszczelna"],editable:!0,required:!0},{id:"safety_check",label:"Sprawdzenie działania zabezpieczeń",type:"select",options:["Poprawne","Wadliwe"],editable:!0,required:!0},{id:"flue_gas_analysis",label:"Wykonano analizę spalin",type:"select",options:["Tak","Nie"],editable:!0,required:!0},{id:"co_ppm",label:"Stężenie CO",type:"number",unit:"ppm",editable:!0,placeholder:"np. 50",showIf:{field:"flue_gas_analysis",value:"Tak"}},{id:"o2_percent",label:"O₂",type:"number",unit:"%",editable:!0,placeholder:"np. 5.2",showIf:{field:"flue_gas_analysis",value:"Tak"}},{id:"efficiency_percent",label:"Sprawność",type:"number",unit:"%",editable:!0,placeholder:"np. 92",showIf:{field:"flue_gas_analysis",value:"Tak"}}]},{id:"final",title:"Podsumowanie",icon:"CheckCircle",fields:[{id:"status_after_service",label:"Status urządzenia po serwisie",type:"select",options:["Sprawne","Niesprawne — wymaga dalszych prac","Wyłączone z eksploatacji"],editable:!0,required:!0},{id:"recommendations",label:"Uwagi / Zalecenia dla klienta",type:"textarea",editable:!0,placeholder:"Zalecenia dla klienta"}
640,{id:"technician_signature",label:"Podpis serwisanta",type:"signature"},{id:"qualification_certificate",label:"Numer świadectwa kwalifikowanego",type:"text",editable:!0},{id:"client_signature",label:"Podpis klienta",type:"signature"}]}]},gV={id:"przeglad_kociol",label:"Przegląd — Kocioł gazowy",ticketType:"maintenance",deviceCategory:"kociol",sections:[{id:"metadane",title:"Dane protokołu",icon:"FileText",fields:[{id:"protocol_number",label:"Nr protokołu",type:"text",autoFill:"meta.protocol_number",editable:!1},{id:"datetime",label:"Data i godzina",type:"datetime",autoFill:"meta.datetime",editable:!1},{id:"ticket_type",label:"Rodzaj zgłoszenia",type:"text",autoFill:"meta.ticket_type",editable:!1}]},{id:"klient",title:"Dane klienta",icon:"User",fields:[{id:"client_type",label:"Typ klienta",type:"text",autoFill:"client.client_type",editable:!1},{id:"client_name",label:"Imię i nazwisko / Nazwa firmy",type:"text",autoFill:"client.name",editable:!0,required:!0},{id:"client_nip",label:"NIP",type:"text",autoFill:"client.nip",editable:!0,placeholder:"np. 123-456-78-90",showIf:{field:"client_type",value:"Firma"}},{id:"client_address",label:"Adres",type:"text",autoFill:"client.address",editable:!0},{id:"client_phone",label:"Telefon",type:"text",autoFill:"client.phone",editable:!0},{id:"client_email",label:"Email",type:"text",autoFill:"client.email",editable:!0}]},{id:"urzadzenie",title:"Dane urządzenia",icon:"Cpu",fields:[{id:"device_category",label:"Kategoria",type:"text",autoFill:"device.category",editable:!1},{id:"device_name",label:"Nazwa urządzenia",type:"text",editable:!0},{id:"device_manufacturer",label:"Producent",type:"text",autoFill:"device.manufacturer",editable:!0},{id:"device_model",label:"Model",type:"text",autoFill:"device.model",editable:!0},{id:"device_serial",label:"Nr seryjny",type:"text",autoFill:"device.serial_number",editable:!0},{id:"boiler_type",label:"Rodzaj kotła",type:"select",options:["Kondensacyjny","Tradycyjny otwarta komora","Tradycyjny zamknięta komora"],editable:!0},{id:"gas_type",label:"Rodzaj gazu",type:"select",options:["GZ-50","GZ-41,5","GZ-35","LPG"],editable:!0}]},{id:"checklista",title:"Checklista przeglądowa",icon:"ClipboardCheck",fields:[{id:"check_heat_exchanger",label:"Czyszczenie głównego wymiennika",type:"checkbox"},{id:"check_burner_electrodes",label:"Czyszczenie palnika i elektrod",type:"checkbox"},{id:"check_expansion_vessel",label:"Naczynie przeponowe (ciśnienie)",type:"checkbox"},{id:"check_filters",label:"Czyszczenie filtrów (woda/gaz)",type:"checkbox"},{id:"check_safety_controls",label:"Kontrola zabezpieczeń",type:"checkbox"}]},{id:"measurements",title:"Pomiary",icon:"Stethoscope",fields:[{id:"gas_tightness",label:"Szczelność instalacji gazowej",type:"select",options:["Szczelna","Nieszczelna"],editable:!0},{id:"repair_actions",label:"Podjęte działania naprawcze",type:"textarea",editable:!0,showIf:{field:"gas_tightness",value:"Nieszczelna"},placeholder:"Opisz podjęte działania..."},{id:"flue_gas_analysis",label:"Wykonano analizę spalin",type:"select",options:["Tak","Nie"],editable:!0},{id:"flue_gas_temp",label:"Temperatura spalin [°C]",type:"number",editable:!0,showIf:{field:"flue_gas_analysis",value:"Tak"}},{id:"flue_gas_o2",label:"Tlen (O₂) [%]",type:"number",editable:!0,showIf:{field:"flue_gas_analysis",value:"Tak"}},{id:"flue_gas_co",label:"Tlenek węgla (CO) [ppm]",type:"number",editable:!0,showIf:{field:"flue_gas_analysis",value:"Tak"}},{id:"draft_sensor_test",label:"Test ciągu i czujnika spalin",type:"checkbox",showIf:{field:"flue_gas_analysis",value:"Nie"}}]},{id:"final",title:"Podsumowanie",icon:"CheckCircle",fields:[{id:"recommendations",label:"Uwagi / Zalecenia dla klienta",type:"textarea",editable:!0,placeholder:"Zalecenia dla klienta"},{id:"status_after_service",label:"Status urządzenia po serwisie",type:"select",options:["Sprawne","Niesprawne — wymaga dalszych prac","Wyłączone z eksploatacji"],editable:!0,required:!0},{id:"qualification_certificate",label:"Numer świadectwa kwalifikowanego",type:"text",editable:!0},{id:"technician_signature",label:"Podpis serwisanta",type:"signature"},{id:"consent_reminders",label:"Wyrażam zgodę na otrzymywanie przypomnień o przeglądach serwisowych drogą SMS/email",type:"checkbox",editable:!0},{id:"client_signature",label:"Podpis klienta",type:"signature"}]}]},yV={id:"awaria_wentylacja",label:"Awaria — Wentylacja / Rekuperacja",ticketType:"fault",deviceCategory:"wentylacja",sections:[{id:"metadane",title:"Dane protokołu",icon:"FileText",fields:[{id:"protocol_number",label:"Nr protokołu",type:"text",editable:!1,autoFill:"meta.protocol_number"},{id:"datetime",label:"Data i godzina",type:"datetime",editable:!1,autoFill:"meta.datetime"},{id:"ticket_type",label:"Rodzaj zgłoszenia",type:"text",editable:!1,autoFill:"meta.ticket_type"}]},{id:"klient",title:"Dane klienta",icon:"User",fields:[{id:"client_type",label:"Typ klienta",type:"text",editable:!1,autoFill:"client.client_type"},{id:"client_name",label:"Imię i nazwisko / Nazwa firmy",type:"text",editable:!0,autoFill:"client.name",required:!0},{id:"client_nip",label:"NIP",type:"text",editable:!0,placeholder:"np. 123-456-78-90",autoFill:"client.nip",showIf:{field:"client_type",value:"Firma"}},{id:"client_address",label:"Adres",type:"text",editable:!0,autoFill:"client.address"},{id:"client_phone",label:"Telefon",type:"text",editable:!0,autoFill:"client.phone"},{id:"client_email",label:"Email",type:"text",editable:!0,autoFill:"client.email"}]},{id:"urzadzenie",title:"Dane urządzenia",icon:"Cpu",fields:[{id:"device_category",label:"Kategoria",type:"text",editable:!1,autoFill:"device.category"},{id:"device_manufacturer",label:"Producent",type:"text",editable:!0,autoFill:"device.manufacturer"},{id:"device_model",label:"Model",type:"text",editable:!0,autoFill:"device.model"}
640,{id:"device_serial",label:"Nr seryjny",type:"text",editable:!0,autoFill:"device.serial_number"}]},{id:"diagnoza",title:"Diagnoza i naprawa",icon:"Stethoscope",fields:[{id:"reported_fault",label:"Zgłaszana usterka (opis klienta)",type:"textarea",editable:!0,autoFill:"ticket.description",placeholder:"Opis usterki zgłoszonej przez klienta"},{id:"technician_diagnosis",label:"Diagnoza serwisanta",type:"textarea",editable:!0,placeholder:"Wynik oględzin i diagnostyki",required:!0},{id:"actions_performed",label:"Wykonane czynności",type:"textarea",editable:!0,placeholder:"Szczegółowy opis wykonanych prac",required:!0},{id:"materials_used",label:"Użyte materiały i części",type:"textarea",editable:!0,placeholder:"np. filtr: 1 szt., wkład: 1 szt."}]},{id:"final",title:"Podsumowanie",icon:"CheckCircle",fields:[{id:"status_after_service",label:"Status urządzenia po serwisie",type:"select",options:["Sprawne","Niesprawne — wymaga dalszych prac","Wyłączone z eksploatacji"],editable:!0,required:!0},{id:"recommendations",label:"Uwagi / Zalecenia dla klienta",type:"textarea",editable:!0,placeholder:"Dodatkowe uwagi lub zalecenia"},{id:"technician_signature",label:"Podpis serwisanta",type:"signature"},{id:"client_signature",label:"Podpis klienta",type:"signature"}]}]},vV={id:"przeglad_wentylacja",label:"Przegląd — Wentylacja / Rekuperacja",ticketType:"maintenance",deviceCategory:"wentylacja",sections:[{id:"metadane",title:"Dane protokołu",icon:"FileText",fields:[{id:"protocol_number",label:"Nr protokołu",type:"text",editable:!1,autoFill:"meta.protocol_number"},{id:"datetime",label:"Data i godzina",type:"datetime",editable:!1,autoFill:"meta.datetime"},{id:"ticket_type",label:"Rodzaj zgłoszenia",type:"text",editable:!1,autoFill:"meta.ticket_type"}]},{id:"klient",title:"Dane klienta",icon:"User",fields:[{id:"client_type",label:"Typ klienta",type:"text",editable:!1,autoFill:"client.client_type"},{id:"client_name",label:"Imię i nazwisko / Nazwa firmy",type:"text",editable:!0,autoFill:"client.name",required:!0},{id:"client_nip",label:"NIP",type:"text",editable:!0,placeholder:"np. 123-456-78-90",autoFill:"client.nip",showIf:{field:"client_type",value:"Firma"}},{id:"client_address",label:"Adres",type:"text",editable:!0,autoFill:"client.address"},{id:"client_phone",label:"Telefon",type:"text",editable:!0,autoFill:"client.phone"},{id:"client_email",label:"Email",type:"text",editable:!0,autoFill:"client.email"}]},{id:"urzadzenie",title:"Dane urządzenia",icon:"Cpu",fields:[{id:"device_category",label:"Kategoria",type:"text",editable:!1,autoFill:"device.category"},{id:"device_name",label:"Nazwa urządzenia",type:"text",editable:!0,placeholder:"np. Rekuperator centralny"},{id:"device_manufacturer",label:"Producent",type:"text",editable:!0,autoFill:"device.manufacturer"},{id:"device_model",label:"Model",type:"text",editable:!0,autoFill:"device.model"},{id:"device_serial",label:"Nr seryjny",type:"text",editable:!0,autoFill:"device.serial_number"}]},{id:"checklista",title:"Checklista przeglądowa",icon:"ClipboardCheck",fields:[{id:"air_filters",label:"Stan filtrów powietrza",type:"select",options:["Wymieniono na nowe","Oczyszczono","Czyste"],editable:!0,required:!0},{id:"exchanger_cleaning",label:"Czyszczenie wymiennika",type:"select",options:["Wykonano","Nie wymagało czyszczenia"],editable:!0,required:!0},{id:"condensate_drain",label:"Odpływ kondensatu",type:"select",options:["Drożny","Udrożniono","Brak (entalpiczny)"],editable:!0,required:!0},{id:"fans_status",label:"Stan wentylatorów",type:"select",options:["Prawidłowy","Wymaga naprawy/wymiany"],editable:!0,required:!0},{id:"performance_measurements",label:"Pomiary wydajności",type:"select",options:["Wykonano","Nie zlecono"],editable:!0,required:!0}]},{id:"final",title:"Podsumowanie",icon:"CheckCircle",fields:[{id:"recommendations",label:"Uwagi / Zalecenia dla klienta",type:"textarea",editable:!0,placeholder:"Dodatkowe uwagi lub zalecenia"},{id:"status_after_service",label:"Status urządzenia po serwisie",type:"select",options:["Sprawne","Niesprawne — wymaga dalszych prac","Wyłączone z eksploatacji"],editable:!0,required:!0}
640,{id:"technician_signature",label:"Podpis serwisanta",type:"signature"},{id:"consent_reminders",label:"Wyrażam zgodę na otrzymywanie przypomnień o przeglądach serwisowych drogą SMS/email",type:"checkbox",editable:!0},{id:"client_signature",label:"Podpis klienta",type:"signature"}]}]},wV=[cV,dV,uV,hV,fV,pV,mV,gV,yV,vV];function xw(e,t){return t&&wV.find(r=>r.ticketType===e&&r.deviceCategory===t)||null}function xV(e){const t={};if(t["meta.protocol_number"]=e.protocolNumber,t["meta.datetime"]=new Date().toISOString(),t["meta.ticket_type"]=e.ticketType==="fault"?"Awaria":"Przegląd",e.client){const r=e.client;r.client_type&&(t["client.client_type"]=A2(r.client_type)),r.name&&(t["client.name"]=r.name),r.nip&&(t["client.nip"]=r.nip),r.address&&(t["client.address"]=r.address),r.phone&&(t["client.phone"]=r.phone),r.email&&(t["client.email"]=r.email)}if(e.device){const r=e.device;r.category&&(t["device.category"]=r.category),r.manufacturer&&(t["device.manufacturer"]=r.manufacturer),r.model&&(t["device.model"]=r.model),r.serial_number&&(t["device.serial_number"]=r.serial_number)}return e.ticketDescription&&(t["ticket.description"]=e.ticketDescription),t}const bV={FileText:mn,User:qs,Cpu:Ii,Stethoscope:qO,Snowflake:VO,CheckCircle:Xk,ClipboardCheck:Si};function D2({profile:e,autoFillData:t,onSubmit:r,saving:n}){const[s,a]=f.useState({}),o=f.useRef({}),[l,c]=f.useState(!1);f.useEffect(()=>{if(l)return;const y={};for(const g of e.sections)for(const x of g.fields)x.autoFill&&t[x.autoFill]&&(y[x.id]=t[x.autoFill]);a(y),c(!0)},[e,t,l]);const d=f.useCallback((y,g)=>{a(x=>({...x,[y]:g}))},[]),u=f.useCallback(y=>{if(!y.showIf)return!0;const g=s[y.showIf.field]||"";return Array.isArray(y.showIf.value)?y.showIf.value.includes(g):g===y.showIf.value},[s]),h=()=>{const y={};for(const g of e.sections)for(const x of g.fields)if(x.type==="signature"){const b=o.current[x.id];b&&!b.isEmpty()&&(y[x.id]=b.toDataURL("image/png"))}r(s,y)},p=y=>{var b;if(!u(y))return null;const g=y.editable===!1,x=s[y.id]||"";switch(y.type){case"text":return i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs(ue,{htmlFor:y.id,className:"text-sm",children:[y.label,y.required&&i.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),i.jsx(Pe,{id:y.id,value:x,onChange:v=>d(y.id,v.target.value),placeholder:y.placeholder,readOnly:g,className:g?"bg-muted":""})]},y.id);case"number":return i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs(ue,{htmlFor:y.id,className:"text-sm",children:[y.label,y.unit&&i.jsxs("span",{className:"text-muted-foreground ml-1",children:["[",y.unit,"]"]}),y.required&&i.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),i.jsx(Pe,{id:y.id,type:"number",step:"any",value:x,onChange:v=>d(y.id,v.target.value),placeholder:y.placeholder,readOnly:g,className:g?"bg-muted":""})]},y.id);case"select":return i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs(ue,{className:"text-sm",children:[y.label,y.required&&i.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),i.jsxs(Ha,{value:x,onValueChange:v=>d(y.id,v),children:[i.jsx(Ys,{children:i.jsx(Ka,{placeholder:"Wybierz..."})}),i.jsx(Js,{children:(b=y.options)==null?void 0:b.map(v=>i.jsx(Xs,{value:v,children:v},v))})]})]},y.id);case"textarea":return i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs(ue,{htmlFor:y.id,className:"text-sm",children:[y.label,y.required&&i.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),i.jsx(Zn,{id:y.id,value:x,onChange:v=>d(y.id,v.target.value),placeholder:y.placeholder,rows:3,readOnly:g,className:g?"bg-muted":""})]},y.id);case"datetime":return i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(ue,{className:"text-sm",children:y.label}),g?i.jsx(Pe,{value:x?new Date(x).toLocaleString("pl-PL",{dateStyle:"short",timeStyle:"short"}):"",readOnly:!0,className:"bg-muted"}):i.jsx(wc,{value:x?new Date(x):new Date,onChange:v=>d(y.id,v.toISOString())})]},y.id);case"checkbox":return i.jsxs("div",{className:"flex items-start gap-3 py-2",children:[i.jsx($i,{id:y.id,checked:x==="true",onCheckedChange:v=>d(y.id,v?"true":"false"),disabled:g}),i.jsx(ue,{htmlFor:y.id,className:"text-sm leading-snug cursor-pointer",children:y.label})]},y.id);case"signature":return i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(ue,{className:"text-sm font-semibold",children:y.label}),i.jsxs(G,{variant:"ghost",size:"sm",type:"button",onClick:()=>{var v;return(v=o.current[y.id])==null?void 0:v.clear()},children:[i.jsx(d1,{className:"mr-1 h-3 w-3"}),"Wyczyść"]})]}),i.jsx("div",{className:"rounded-lg border-2 border-border bg-card",children:i.jsx(Sd,{ref:v=>{o.current[y.id]=v},canvasProps:{className:"w-full h-40 rounded-lg",style:{width:"100%",height:"160px"}},penColor:"hsl(222, 47%, 11%)"})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:y.id.includes("client")?"Poproś klienta o złożenie podpisu":"Podpis serwisanta"})]},y.id);default:return null}},m=y=>{const g=y.icon?bV[y.icon]:mn;y.fields.filter(w=>w.type!=="signature"||u(w));const x=y.fields.some(w=>w.type!=="signature"&&u(w)),b=y.fields.filter(w=>w.type==="signature"),v=y.fields.filter(w=>w.type!=="signature");return i.jsxs(Fe,{children:[i.jsx(lt,{className:"pb-3",children:i.jsxs(ut,{className:"text-lg flex items-center gap-2",children:[g&&i.jsx(g,{className:"h-5 w-5 text-primary"}),y.title]})}),i.jsxs(Me,{className:"space-y-4",children:[x&&i.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:v.map(w=>{if(!u(w))return null;const _=w.type==="textarea"||w.type==="checkbox";return i.jsx("div",{className:_?"sm:col-span-2":"",children:p(w)},w.id)})}),b.map(w=>p(w))]})]},y.id)};return i.jsxs("div",{className:"space-y-6",children:[e.sections.map(m),i.jsx(G,{onClick:h,disabled:n,className:"w-full",size:"lg",children:n?"Zapisywanie...":"Zakończ i zapisz protokół"})]})}function _V(){var Ue,re,De,Te,E,O,V;const{id:e}=Xi(),t=Zt(),{user:r}=qr(),{toast:n}=Ar(),s=f.useRef(null),a=Dr(),{addOperation:o}=Ss(),[l,c]=f.useState(null),[d,u]=f.useState(!0),[h,p]=f.useState(!1),[m,y]=f.useState(!1),[g,x]=f.useState(""),[b,v]=f.useState(""),[w,_]=f.useState({}),[j,k]=f.useState([]),[N,P]=f.useState([]),[T,I]=f.useState(!1),[H,M]=f.useState(""),[L,F]=f.useState(!1),[Y,Q]=f.useState({}),[S,z]=f.useState([{param:"",value:"",unit:""}]),C=(Ue=l==null?void 0:l.description)==null?void 0:Ue.startsWith("Zlecenie przeglądu okresowego"),B=C?"Przegląd":"Awaria",ce=C?"maintenance":"fault",A=Ou((re=l==null?void 0:l.devices)==null?void 0:re.category),ee=C?A.maintenanceChecklist:A.faultChecklist,te=l?xw(ce,(De=l.devices)==null?void 0:De.category):null,q=()=>{const D=new Date,K=D.getFullYear(),R=String(D.getMonth()+1).padStart(2,"0"),W=String(Math.floor(Math.random()*1e3)).padStart(3,"0");return`QRS-${K}-${R}-${W}`};f.useEffect(()=>{e&&r&&he()},[e,r]);const he=async()=>{try{if(a){const{data:D,error:K}=await ne.from("tickets").select(`
641            id,
642            is_remote_report,
643            description,
644            error_code,
645            devices (
646              name,
647              qr_code_uuid,
648              category,
649              manufacturer,
650              model,
651              serial_number,
652              clients (
653                name,
654                email,
655                address,
656                phone,
657                nip,
658                client_type
659              )
660            )
661          `).eq("id",e).eq("installer_id",r==null?void 0:r.id).single();if(K)throw K;c(D),y(!1)}else{const D=await ve.getData("tickets",e);D&&(c({id:D.id,is_remote_report:D.is_remote_report,description:D.description,error_code:D.error_code,devices:D.devices}),y(!0))}}catch(D){console.error("Error fetching ticket:",D);try{const K=await ve.getData("tickets",e);K&&(c({id:K.id,is_remote_report:K.is_remote_report,description:K.description,error_code:K.error_code,devices:K.devices}),y(!0))}catch(K){console.error("Error loading from cache:",K)}}finally{u(!1)}},Z=async(D,K)=>{var ze,et,at,Nt,He,ct,Rt,dt;if(!l||!r)return;if(!K.client_signature){n({variant:"destructive",title:"Brak podpisu klienta",description:"Poproś klienta o podpisanie protokołu"});return}p(!0);const R=crypto.randomUUID(),W={};for(const mt of te.sections){const Ft={};for(const $t of mt.fields)$t.type!=="signature"&&D[$t.id]!==void 0&&D[$t.id]!==""&&(Ft[$t.id]=D[$t.id]);W[mt.id]=Ft}const se={profileVersion:2,profileId:te.id,ticketType:ce,deviceCategory:((ze=l.devices)==null?void 0:ze.category)||"inne",sections:W},ye=[D.technician_diagnosis&&`DIAGNOZA:
662${D.technician_diagnosis}`,D.actions_performed&&`WYKONANE CZYNNOŚCI:
663${D.actions_performed}`,D.materials_used&&`UŻYTE MATERIAŁY:
664${D.materials_used}
664`].filter(Boolean).join(`
665
666`);if(!a)try{for(const[Ft,$t]of Object.entries(K)){const Lt={id:crypto.randomUUID(),protocolId:R,type:"signature",data:$t,filename:`${Ft}.png`,mimeType:"image/png",createdAt:Date.now()};await ve.addPendingUpload(Lt)}await ve.saveData("protocols",{id:R,ticket_id:l.id,technician_notes:ye,client_signature_url:null,photos_urls:[],checklist:se,created_at:new Date().toISOString(),_pendingSync:!0});const mt=await ve.getData("tickets",l.id);mt&&await ve.saveData("tickets",{...mt,status:"zakonczone",completed_date:new Date().toISOString(),resolution_notes:ye,consent_reminders:D.consent_reminders==="true",_pendingSync:!0}),await o("create_protocol","protocols",{protocolId:R,ticketId:l.id,userId:r.id,protocolData:{id:R,ticket_id:l.id,technician_notes:ye,checklist:se,created_at:new Date().toISOString()},ticketUpdate:{status:"zakonczone",completed_date:new Date().toISOString(),resolution_notes:ye,consent_reminders:D.consent_reminders==="true"},clientEmail:(at=(et=l.devices)==null?void 0:et.clients)==null?void 0:at.email,clientName:(He=(Nt=l.devices)==null?void 0:Nt.clients)==null?void 0:He.name,deviceName:(ct=l.devices)==null?void 0:ct.name}),n({title:"Protokół zapisany lokalnie",description:"Dane zostaną wysłane po powrocie online"}),t("/tickets");return}catch(mt){console.error("Error saving V2 protocol offline:",mt),n({variant:"destructive",title:"Błąd zapisu offline"}),p(!1);return}try{const mt={};for(const[yt,$]of Object.entries(K)){const ae=await fetch($).then(Be=>Be.blob()),le=`${r.id}/${l.id}/${yt}.png`,{error:Re}=await ne.storage.from("signatures").upload(le,ae,{upsert:!0});if(Re)throw Re;mt[yt]=le}const Ft={...se,technicianSignatureUrl:mt.technician_signature||null,clientSignatureUrl:mt.client_signature||null},{error:$t}=await ne.from("protocols").insert({id:R,ticket_id:l.id,technician_notes:ye,client_signature_url:mt.client_signature||null,photos_urls:[],checklist:Ft});if($t)throw $t;const{error:Lt}=await ne.from("tickets").update({status:"zakonczone",completed_date:new Date().toISOString(),resolution_notes:ye,consent_reminders:D.consent_reminders==="true"}).eq("id",l.id);if(Lt)throw Lt;const _r=(dt=(Rt=l.devices)==null?void 0:Rt.clients)==null?void 0:dt.email;if(_r){const yt=`${window.location.origin}/protokol/${l.id}/podglad?source=public`;ne.functions.invoke("send-protocol-pdf",{body:{ticketId:l.id,protocolUrl:yt}}).catch($=>{console.error("Failed to send protocol PDF email:",$)})}n({title:"Protokół zapisany",description:_r?"Zgłoszenie zakończone. Powiadomienie wysłane do klienta.":"Zgłoszenie zostało zakończone"}),t("/tickets")}catch(mt){console.error("Error saving V2 protocol:",mt),n({variant:"destructive",title:"Błąd",description:"Nie udało się zapisać protokołu"})}finally{p(!1)}},me=D=>{const K=Array.from(D.target.files||[]);if(j.length+K.length>5){n({variant:"destructive",title:"Za dużo zdjęć",description:"Maksymalnie można dodać 5 zdjęć"});return}k([...j,...K]),K.forEach(R=>{const W=new FileReader;W.onload=se=>{P(ye=>{var ze;return[...ye,(ze=se.target)==null?void 0:ze.result]})},W.readAsDataURL(R)})},ge=D=>{k(j.filter((K,R)=>R!==D)),P(N.filter((K,R)=>R!==D))},Ne=()=>{var D;(D=s.current)==null||D.clear()},Ce=()=>{z([...S,{param:"",value:"",unit:""}])},Oe=D=>{z(S.filter((K,R)=>R!==D))},Xe=(D,K,R)=>{const W=[...S];W[D]={...W[D],[K]:R},z(W)},oe=()=>{const D=A.customMeasurements?{custom:S.filter(W=>W.param||W.value)}:Y,K=A.customMeasurements?S.filter(W=>W.param&&W.value).map(W=>`${W.param}: ${W.value}${W.unit?" "+W.unit:""}`).join(", "):Object.entries(Y).filter(([,W])=>W).map(([W,se])=>{const ye=A.measurements.find(ze=>ze.id===W);return ye?`${ye.label}: ${se}${ye.unit?" "+ye.unit:""}`:`${W}: ${se}`}).join(", ");return{technician_notes:[g&&`OPIS WYKONANYCH CZYNNOŚCI:
667${g}`,!C&&H&&`
668UŻYTE MATERIAŁY:
669${H}`,K&&`
670POMIARY: ${K}`,b&&`
671ZALECENIA DLA UŻYTKOWNIKA:
672${b}`].filter(Boolean).join(`
673`),checklist:{type:C?"maintenance":"fault",profile:A.id,items:w,measurements:D,materialsUsed:C?null:H,recommendations:b}}},Ve=async()=>{var se,ye,ze,et,at,Nt,He,ct,Rt,dt,mt,Ft,$t;if(!l||!r)return;
673if((se=s.current)!=null&&se.isEmpty()){n({variant:"destructive",title:"Brak podpisu",description:"Poproś klienta o podpisanie protokołu"});return}p(!0);const D=crypto.randomUUID(),{technician_notes:K,checklist:R}=oe(),W={id:D,ticket_id:l.id,technician_notes:K,client_signature_url:null,photos_urls:[],checklist:R,created_at:new Date().toISOString()};if(!a)try{const Lt=(ye=s.current)==null?void 0:ye.toDataURL("image/png");if(Lt){const yt={id:crypto.randomUUID(),protocolId:D,type:"signature",data:Lt,filename:"signature.png",mimeType:"image/png",createdAt:Date.now()};await ve.addPendingUpload(yt)}for(let yt=0;yt<N.length;yt++){const $={id:crypto.randomUUID(),protocolId:D,type:"photo",data:N[yt],filename:`photo_${yt}.${((et=(ze=j[yt])==null?void 0:ze.name)==null?void 0:et.split(".").pop())||"jpg"}`,mimeType:((at=j[yt])==null?void 0:at.type)||"image/jpeg",createdAt:Date.now()};await ve.addPendingUpload($)}await ve.saveData("protocols",{...W,_pendingSync:!0});const _r=await ve.getData("tickets",l.id);_r&&await ve.saveData("tickets",{..._r,status:"zakonczone",completed_date:new Date().toISOString(),resolution_notes:g,consent_reminders:C?T:!1,_pendingSync:!0}),await o("create_protocol","protocols",{protocolId:D,ticketId:l.id,userId:r.id,protocolData:W,ticketUpdate:{status:"zakonczone",completed_date:new Date().toISOString(),resolution_notes:g,consent_reminders:C?T:!1},clientEmail:(He=(Nt=l.devices)==null?void 0:Nt.clients)==null?void 0:He.email,clientName:(Rt=(ct=l.devices)==null?void 0:ct.clients)==null?void 0:Rt.name,deviceName:(dt=l.devices)==null?void 0:dt.name}),n({title:"Protokół zapisany lokalnie",description:"Dane zostaną wysłane automatycznie po powrocie online"}),t("/tickets");return}catch(Lt){console.error("Error saving protocol offline:",Lt),n({variant:"destructive",title:"Błąd zapisu offline",description:"Nie udało się zapisać protokołu lokalnie"}),p(!1);return}try{const Lt=(mt=s.current)==null?void 0:mt.toDataURL("image/png"),_r=await fetch(Lt||"").then(Ye=>Ye.blob()),yt=`${r.id}/${l.id}/signature.png`,{error:$}=await ne.storage.from("signatures").upload(yt,_r,{upsert:!0});if($)throw $;const ae=[];for(let Ye=0;Ye<j.length;Ye++){const Gt=`${r.id}/${l.id}/photo_${Ye}.${j[Ye].name.split(".").pop()}`,{error:un}=await ne.storage.from("ticket-photos").upload(Gt,j[Ye],{upsert:!0});if(un)throw un;ae.push(Gt)}const{error:le}=await ne.from("protocols").insert({id:D,ticket_id:l.id,technician_notes:K,client_signature_url:yt,photos_urls:ae,checklist:R});if(le)throw le;const{error:Re}=await ne.from("tickets").update({status:"zakonczone",completed_date:new Date().toISOString(),resolution_notes:g,consent_reminders:C?T:!1}).eq("id",l.id);if(Re)throw Re;const Be=($t=(Ft=l.devices)==null?void 0:Ft.clients)==null?void 0:$t.email;if(Be){const Ye=`${window.location.origin}/protokol/${l.id}/podglad?source=public`;ne.functions.invoke("send-protocol-pdf",{body:{ticketId:l.id,protocolUrl:Ye}}).catch(Gt=>{console.error("Failed to send protocol PDF email:",Gt)})}n({title:"Protokół zapisany",description:Be?"Zgłoszenie zakończone. Powiadomienie wysłane do klienta.":"Zgłoszenie zostało zakończone"}),t("/tickets")}catch(Lt){console.error("Error saving protocol:",Lt),n({variant:"destructive",title:"Błąd",description:"Nie udało się zapisać protokołu"})}finally{p(!1)}};if(d)return i.jsx(sr,{title:"Protokół serwisowy",children:i.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"Ładowanie..."})});if(!l)return i.jsx(sr,{title:"Protokół serwisowy",children:i.jsxs("div",{className:"flex h-64 flex-col items-center justify-center text-center",children:[i.jsx("p",{className:"text-lg font-semibold",children:"Zgłoszenie nie znalezione"}),i.jsx(G,{variant:"link",onClick:()=>t("/tickets"),children:"Wróć do listy zgłoszeń"})]})});if(te){const D=xV({ticketType:ce,protocolNumber:q(),ticketDescription:l.description,client:(Te=l.devices)==null?void 0:Te.clients,device:l.devices});return i.jsx(sr,{title:"Protokół serwisowy",children:i.jsxs("div",{className:"mx-auto max-w-2xl space-y-6 animate-fade-in",children:[!a&&i.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Hs,{className:"h-5 w-5 text-amber-600 dar
673k:text-amber-400"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium text-amber-800 dark:text-amber-200",children:"Tryb offline"}),i.jsx("p",{className:"text-sm text-amber-700 dark:text-amber-300",children:"Protokół zostanie zapisany lokalnie i wysłany automatycznie po powrocie online."})]})]})}),m&&i.jsx(Xn,{isCached:m,isOffline:!a,lastSynced:null,onRefresh:he}),i.jsxs(G,{variant:"ghost",onClick:()=>t(-1),className:"-ml-2",children:[i.jsx(ws,{className:"mr-2 h-4 w-4"}),"Wróć"]}),i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsxs(Ge,{variant:C?"default":"destructive",className:"flex items-center gap-1",children:[C?i.jsx(Si,{className:"h-3 w-3"}):i.jsx(an,{className:"h-3 w-3"}),B]}),i.jsx(Ge,{variant:"outline",className:"text-xs",children:te.label})]}),i.jsx(D2,{profile:te,autoFillData:D,onSubmit:Z,saving:h})]})})}return i.jsx(sr,{title:"Protokół serwisowy",children:i.jsxs("div",{className:"mx-auto max-w-2xl space-y-6 animate-fade-in",children:[!a&&i.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Hs,{className:"h-5 w-5 text-amber-600 dark:text-amber-400"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium text-amber-800 dark:text-amber-200",children:"Tryb offline"}),i.jsx("p",{className:"text-sm text-amber-700 dark:text-amber-300",children:"Protokół zostanie zapisany lokalnie i wysłany automatycznie po powrocie online."})]})]})}),m&&i.jsx(Xn,{isCached:m,isOffline:!a,lastSynced:null,onRefresh:he}),i.jsxs(G,{variant:"ghost",onClick:()=>t(-1),className:"-ml-2",children:[i.jsx(ws,{className:"mr-2 h-4 w-4"}),"Wróć"]}),i.jsxs(Fe,{children:[i.jsxs(lt,{children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs(ut,{children:["Protokół dla: ",(E=l.devices)==null?void 0:E.name]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs(Ge,{variant:C?"default":"destructive",className:"flex items-center gap-1",children:[C?i.jsx(Si,{className:"h-3 w-3"}):i.jsx(an,{className:"h-3 w-3"}),B]}),i.jsx(Ge,{variant:"outline",className:"text-xs",children:A.label})]})]}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Klient: ",(V=(O=l.devices)==null?void 0:O.clients)==null?void 0:V.name]}),!C&&l.error_code&&i.jsxs("p",{className:"text-sm text-destructive font-medium mt-1",children:["Kod błędu: ",l.error_code]})]}),i.jsxs(Me,{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsxs(ue,{className:"text-base font-semibold flex items-center gap-2",children:[i.jsx(Si,{className:"h-4 w-4"}),"Lista kontrolna - ",B]}),i.jsx("div",{className:"rounded-lg border p-4 space-y-3 bg-muted/30",children:ee.map(D=>i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx($i,{id:D.id,checked:w[D.id]||!1,onCheckedChange:K=>_({...w,[D.id]:K})}),i.jsx(ue,{htmlFor:D.id,className:"font-normal cursor-pointer",children:D.label})]},D.id))})]}),!C&&i.jsxs("div",{className:"space-y-2",children:[i.jsxs(ue,{htmlFor:"materials",className:"text-base font-semibold flex items-center gap-2",children:[i.jsx(Sl,{className:"h-4 w-4"}),"Użyte materiały i robocizna"]}),i.jsx(Zn,{id:"materials",placeholder:"np. Czynnik R32: 500g, Filtr: 1 szt., Czas pracy: 2h",value:H,onChange:D=>M(D.target.value),rows:3}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Wymień zużyte części, materiały i czas pracy"})]}),i.jsxs(tV,{open:L,onOpenChange:F,children:[i.jsx(rV,{asChild:!0,children:i.jsxs(G,{variant:"outline",className:"w-full justify-between",children:[i.jsx("span",{className:"flex items-center gap-2",children:"Pomiary (opcjonalne)"}),i.jsx(ef,{className:`h-4 w-4 transition-transform ${L?"rotate-180":""}`})]})}),i.jsx(nV,{className:"pt-4",children:A.customMeasurements?i.jsxs("div",{className:"space-y-3",children:[S.map((D,K)=>i.jsxs("div",{className:"grid grid-cols-[1fr_1fr_auto_auto] gap-2 items-end",children:[i.jsxs("div",{className:"space-y-1",children:[K===0&&i.jsx(ue,{className:"text-xs text-muted-foreground",children:"Parametr"}),i.jsx(Pe,{placeholder:"np. Temperatura",value:D.param,onChange:R=>Xe(K,"param",R.target.value)})]}),i.jsxs("div",{className:"space-y-1",children:[K===0&&i.jsx(ue,{className:"text-xs text-muted-foreground",children:"Wartość"}),i.jsx(Pe,{placeholder:"np. 22",value:D.value,onChange:R=>Xe(K,"value",R.target.value)})]}),i.jsxs("div",{className:"space-y-1",children:[K===0&&i.jsx(ue,{className:"text-xs text-muted-foreground",children:"Jedn."}),i.jsx(Pe,{placeholder:"°C",value:D.unit,onChange:R=>Xe(K,"unit",R.target.value),className:"w-16"})]}),i.jsx(G,{variant:"ghost",size:"icon",onClick:()=>Oe(K),disabled:S.length===1,className:"h-10 w-10",children:i.jsx(rf,{className:"h-4 w-4"})})]},K)),i.jsxs(G,{variant:"outline",size:"sm",onClick:Ce,className:"w-full",children:[i.jsx(Lo,{className:"mr-2 h-4 w-4"}),"Dodaj pomiar"]})]}):i.jsx("div",{className:"grid grid-cols-2 gap-3",children:A.measurements.map(D=>i.jsxs("div",{className:"space-y-1",children:[i.jsxs(ue,{htmlFor:D.id,className:"text-sm",children:[D.label," ",D.unit&&i.jsxs("span",{className:"text-muted-foreground",children:["[",D.unit,"]"]})]}),i.jsx(Pe,{id:D.id,placeholder:D.placeholder,value:Y[D.id]||"",onChange:K=>Q({...Y,[D.id]:K.target.value})})]},D.id))})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"workDescription",className:"text-base font-semibold",children:"Opis wykonanych czynności"}),i.jsx(Zn,{id:"workDescription",placeholder:"Szczegółowo opisz wykonane prace serwisowe...",value:g,onChange:D=>x(D.target.value),rows:4})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"recommendations",className:"text-base font-semibold",children:"Zalecenia dla użytkownika"}),i.jsx(Zn,{id:"recommendations",placeholder:"Np. zalecana wymiana filtrów co 3 miesiące, następny przegląd za rok...",value:b,onChange:D=>v(D.target.value),rows:3})]}),C&&i.jsxs("div",{className:"flex items-start space-x-3 p-4 rounded-lg border bg-primary/5 border-primary/20",children:[i.jsx($i,{id:"consent",checked:T,onCheckedChange:D=>I(D)}),i.jsx(ue,{htmlFor:"consent",className:"font-normal cursor-pointer text-sm leading-relaxed",children:"Wyrażam zgodę na cykliczne przypomnienia SMS/Email o przeglądach"})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(ue,{className:"text-base font-semibold",children:"Zdjęcia (max. 5)"}),i.jsxs("div",{className:"flex flex-wrap gap-3",children:[N.map((D,K)=>i.jsxs("div",{className:"relative",children:[i.jsx("img",{src:D,alt:`Zdjęcie ${K+1}`,className:"h-20 w-20 rounded-lg object-cover"}),i.jsx("button",{type:"button",onClick:()=>ge(K),className:"absolute -right-2 -top-2 flex h-6 w-6 items-center justify-center rounded-full bg-destructive text-destructive-foreground",children:i.jsx(Ks,{className:"h-3 w-3"})})]},K)),j.length<5&&i.jsxs("label",{className:"flex h-20 w-20 cursor-pointer items-center justify-center rounded-lg border-2 border-dashed border-border hover:border-primary transition-colors",children:[i.jsx(Xy,{className:"h-6 w-6 text-muted-foreground"}),i.jsx("input",{type:"file",accept:"image/*",multiple:!0,onChange:me,className:"hidden"})]})]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(ue,{className:"text-base font-semibold",children:"Podpis klienta"}),i.jsxs(G,{variant:"ghost",size:"sm",onClick:Ne,children:[i.jsx(d1,{className:"mr-2 h-4 w-4"}),"Wyczyść"]})]}),i.jsx("div",{className:"rounded-lg border-2 border-border bg-card",children:i.jsx(Sd,{ref:s,canvasProps:{className:"w-full h-48 rounded-lg",style:{width:"100%",height:"192px"}},penColor:"hsl(222, 47%, 11%)"})}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Poproś klienta o złożenie podpisu palcem lub rysikiem"})]}),i.jsx(G,{onClick:Ve,disabled:h,className:"w-full",size:"lg",children:h?"Zapisywanie...":i.jsxs(i.Fragment,{children:[i.jsx(Dt,{className:"mr-2 h-5 w-5"}),"Zakończ i zapisz protokół"]})})]})]})]})})}const jV={inspection:"Przeprowadzono oględziny urządzenia",cleaning:"Wyczyszczono filtry/elementy",test:"Przeprowadzono test działania",parameters:"Sprawdzono parametry pracy",issue_resolved:"Problem został rozwiązany",heat_exchangers_filters:"Czyszczenie wymienników ciepła i filtrów",leak_check_refrigerant:"Kontrola 
673szczelności i parametrów czynnika",electrical_control:"Weryfikacja instalacji elektrycznej i sterowania",condensate_hydraulics:"Kontrola odpływu skroplin i hydrauliki",diagnosis:"Diagnoza usterki",repair:"Usunięcie usterki",verification:"Sprawdzenie poprawności działania"},kV={tempInlet:"Temp. wlot",tempOutlet:"Temp. wylot",pressure:"Ciśnienie"};function am(e){return e&&typeof e=="object"&&e.profileVersion===2}function NV(){var Ne,Ce,Oe,Xe,oe,Ve,Ue,re,De,Te,E,O,V,D,K;const{id:e}=Xi(),[t]=yN(),r=Zt(),n=t.get("source"),s=Dr(),a=n==="public",[o,l]=f.useState(null),[c,d]=f.useState(!0),[u,h]=f.useState(null),[p,m]=f.useState(null),[y,g]=f.useState([]),[x,b]=f.useState(!1),[v,w]=f.useState(null);f.useEffect(()=>{e&&_()},[e]);const _=async()=>{try{if(n==="public"){const{data:R,error:W}=await ne.rpc("get_public_protocol_data",{protocol_ticket_id:e});if(W)throw W;if(R){const se=R,ye={id:se.id,technician_notes:se.technician_notes,client_signature_url:se.client_signature_url,photos_urls:se.photos_urls,checklist:se.checklist,created_at:se.created_at,tickets:{id:se.ticket_id,description:se.ticket_description,completed_date:se.ticket_completed_date,is_remote_report:se.ticket_is_remote_report,consent_reminders:se.ticket_consent_reminders,devices:{name:se.device_name,serial_number:se.device_serial_number,category:se.device_category||null,clients:{name:se.client_name,address:se.client_address||""}}}};if(l(ye),await k(se.client_signature_url,se.photos_urls),am(se.checklist)&&se.checklist.technicianSignatureUrl){const{data:ze}=ne.storage.from("signatures").getPublicUrl(se.checklist.technicianSignatureUrl);m(ze.publicUrl)}}}else{const{data:R,error:W}=await ne.from("protocols").select(`
674            *,
675            tickets!protocols_ticket_id_fkey (
676              id,
677              description,
678              completed_date,
679              is_remote_report,
680              consent_reminders,
681              devices!tickets_device_id_fkey (
682                name,
683                serial_number,
684                category,
685                clients!devices_client_id_fkey (
686                  name,
687                  address,
688                  phone
689                )
690              )
691            )
692          `).eq("ticket_id",e).maybeSingle();if(W)throw W;if(R){if(l(R),await k(R.client_signature_url,R.photos_urls),am(R.checklist)&&R.checklist.technicianSignatureUrl){const{data:se}=ne.storage.from("signatures").getPublicUrl(R.checklist.technicianSignatureUrl);m(se.publicUrl)}await ve.saveData("protocols",R)}}}catch(R){console.error("Error fetching protocol:",R),await j()}finally{d(!1)}},j=async()=>{if(e)try{const W=(await ve.getAllData("protocols")).find(se=>se.ticket_id===e||se.id===e);if(W){b(!0);const se=await ve.getLastSynced("protocols");if(w(se),W._pendingSync){const Nt=await ve.getPendingUploadsForProtocol(W.id),He=Nt.find(dt=>dt.type==="signature"&&dt.filename==="client_signature.png");He&&h(He.data);const ct=Nt.find(dt=>dt.type==="signature"&&dt.filename==="technician_signature.png");ct&&m(ct.data);const Rt=Nt.filter(dt=>dt.type==="photo");Rt.length>0&&g(Rt.map(dt=>dt.data))}else await k(W.client_signature_url,W.photos_urls);const ye=await ve.getData("tickets",e),ze=ye!=null&&ye.device_id?await ve.getData("devices",ye.device_id):null,et=ze!=null&&ze.client_id?await ve.getData("clients",ze.client_id):null,at={id:W.id,technician_notes:W.technician_notes,client_signature_url:W.client_signature_url,photos_urls:W.photos_urls,checklist:W.checklist,created_at:W.created_at,tickets:ye?{id:ye.id,description:ye.description,completed_date:ye.completed_date,is_remote_report:ye.is_remote_report,consent_reminders:ye.consent_reminders,devices:ze?{name:ze.name,serial_number:ze.serial_number,category:ze.category||null,clients:et?{name:et.name,address:et.address}:null}:null}:null};l(at)}}catch(R){console.error("Error loading from cache:",R)}},k=async(R,W)=>{if(R){const{data:se}=ne.storage.from("signatures").getPublicUrl(R);h(se.publicUrl)}if(W&&W.length>0){const se=W.map(ye=>{const{data:ze}=ne.storage.from("ticket-photos").getPublicUrl(ye);return ze.publicUrl});g(se)}},N=()=>{r(n==="public"?-1:n==="admin"?`/tickets/${e}`:"/")};if(c)return i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsxs("div",{className:"text-center",children:[i.jsx(mn,{className:"mx-auto h-12 w-12 animate-pulse text-primary"}),i.jsx("p",{className:"mt-4 text-muted-foreground",children:"Ładowanie protokołu..."})]})});if(!o)return i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsx(Fe,{className:"max-w-md w-full",children:i.jsxs(Me,{className:"flex flex-col items-center py-12 text-center",children:[i.jsx(mn,{className:"h-16 w-16 text-muted-foreground mb-4"}),i.jsx("h1",{className:"text-xl font-bold",children:"Protokół nie znaleziony"}),i.jsx("p",{className:"mt-2 text-muted-foreground mb-4",children:"Ten protokół nie istnieje lub został usunięty."}),i.jsx(G,{variant:"outline",onClick:N,children:"Wróć"})]})})});const P=o.checklist;if(am(P)){const R=P,W=xw(R.ticketType,R.deviceCategory),se=R.ticketType==="maintenance",ye=se?"Przegląd":"Awaria";return i.jsx("div",{className:"min-h-screen bg-background p-4",children:i.jsxs("div",{className:"mx-auto max-w-2xl space-y-6",children:[i.jsxs(G,{variant:"ghost",onClick:N,className:"-ml-2",children:[i.jsx(ws,{className:"mr-2 h-4 w-4"}),"Wróć"]}),i.jsx(Xn,{isCached:x,isOffline:!s,lastSynced:v?new Date(v):null}),!s&&i.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 flex items-center gap-2 text-amber-800 dark:border-amber-800 dark:bg-amber-950 dar
692k:text-amber-200",children:[i.jsx(Hs,{className:"h-4 w-4"}),i.jsx("span",{className:"text-sm",children:"Tryb offline - dane z pamięci podręcznej"})]}),i.jsxs(Fe,{children:[i.jsxs(lt,{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(ut,{className:"text-xl",children:"Protokół serwisowy"}),i.jsxs("div",{className:"flex items-center gap-2 flex-wrap justify-end",children:[i.jsxs(Ge,{variant:se?"default":"destructive",className:"flex items-center gap-1",children:[se?i.jsx(Si,{className:"h-3 w-3"}):i.jsx(an,{className:"h-3 w-3"}),ye]}),W&&i.jsx(Ge,{variant:"outline",className:"text-xs",children:W.label}),i.jsx(Ge,{variant:"secondary",children:"Zakończone"})]})]}),i.jsx(ir,{}),((Ne=o.tickets)==null?void 0:Ne.completed_date)&&i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Data zakończenia: ",xt(new Date(o.tickets.completed_date),"PPP 'o' HH:mm",{locale:nr})]})]}),i.jsxs(Me,{className:"space-y-6",children:[W?W.sections.map(ze=>{if(a&&ze.id==="klient")return null;const et=R.sections[ze.id]||{},at=Object.values(et).some(He=>He),Nt=ze.fields.filter(He=>He.type!=="signature");return!at&&Nt.length>0?null:i.jsxs("div",{className:"space-y-3",children:[i.jsx("h3",{className:"font-semibold text-base",children:ze.title}),i.jsx("div",{className:"rounded-lg border p-4 bg-muted/30 space-y-2",children:Nt.map(He=>{const ct=et[He.id];if(!ct||He.type==="checkbox"&&ct==="false")return null;let Rt=ct;if(He.type==="checkbox")Rt=ct==="true"?"Tak":"Nie";else if(He.type==="datetime")try{Rt=new Date(ct).toLocaleString("pl-PL",{dateStyle:"short",timeStyle:"short"})}catch{}return i.jsxs("div",{className:"flex justify-between gap-2 text-sm",children:[i.jsxs("span",{className:"text-muted-foreground shrink-0",children:[He.label,He.unit&&` [${He.unit}]`,":"]}),i.jsx("span",{className:"font-medium text-right break-words max-w-[60%]",children:Rt})]},He.id)})})]},ze.id)}):Object.entries(R.sections).filter(([ze,et])=>!(a&&ze==="klient")&&Object.values(et).some(at=>at)).map(([ze,et])=>i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"font-semibold capitalize",children:ze}),i.jsx("div",{className:"rounded-lg border p-4 bg-muted/30 space-y-1 text-sm",children:Object.entries(et).filter(([,at])=>at).map(([at,Nt])=>i.jsxs("div",{className:"flex justify-between",children:[i.jsxs("span",{className:"text-muted-foreground",children:[at,":"]}),i.jsx("span",{className:"font-medium",children:Nt})]},at))})]},ze)),o.technician_notes&&i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"font-semibold",children:"Notatki"}),i.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap rounded-lg border p-3 bg-muted/30",children:o.technician_notes})]}),y.length>0&&i.jsxs("div",{className:"space-y-3",children:[i.jsxs("h3",{className:"font-semibold flex items-center gap-2",children:[i.jsx(rg,{className:"h-4 w-4"}),"Zdjęcia (",y.length,")"]}),i.jsx("div",{className:"grid grid-cols-3 gap-2",children:y.map((ze,et)=>i.jsx("a",{href:ze,target:"_blank",rel:"noopener noreferrer",className:"aspect-square rounded-lg overflow-hidden border hover:opacity-80 transition-opacity",children:i.jsx("img",{src:ze,alt:`Zdjęcie ${et+1}`,className:"w-full h-full object-cover"})},et))})]}),!a&&p&&i.jsxs("div",{className:"space-y-3",children:[i.jsx("h3",{className:"font-semibold",children:"Podpis serwisanta"}),i.jsx("div",{className:"rounded-lg border bg-card p-4",children:i.jsx("img",{src:p,alt:"Podpis serwisanta",className:"max-h-32 mx-auto"})})]}),!a&&u&&i.jsxs("div",{className:"space-y-3",children:[i.jsx("h3",{className:"font-semibold",children:"Podpis klienta"}),i.jsx("div",{className:"rounded-lg border bg-card p-4",children:i.jsx("img",{src:u,alt:"Podpis klienta",className:"max-h-32 mx-auto"})})]})]})]})]})})}const T=o.checklist,I=T&&typeof T=="object"&&"profile"in T,H=T&&typeof T=="object"&&"type"in T,M=(Oe=(Ce=o.tickets)==null?void 0:Ce.description)==null?void 0:Oe.startsWith("Zlecenie przeglądu okresowego"),L=M?"Przegląd":"Awaria",F=H?T.items||{}:T||{},Q=(()=>
692{if(I){const R=T.profile,W=Ou(R);return oV(W)}return jV})(),S=H?T.measurements:null,z=H?T.materialsUsed:null,C=H?T.recommendations:null,B=S&&typeof S=="object"&&"custom"in S,ce=B?S.custom||[]:[],A=!B&&S?S:{},ee=R=>{if(I){const W=T.profile,se=Ou(W);return lV(se)[R]||{label:R,unit:""}}return{label:kV[R]||R,unit:""}},te=Object.values(A).some(R=>R),q=ce.length>0&&ce.some(R=>R.param||R.value),he=te||q,Z=(Ve=(oe=(Xe=o.tickets)==null?void 0:Xe.devices)==null?void 0:oe.clients)==null?void 0:Ve.name,me=(De=(re=(Ue=o.tickets)==null?void 0:Ue.devices)==null?void 0:re.clients)==null?void 0:De.address,ge=I?Ou(T.profile).label:null;return i.jsx("div",{className:"min-h-screen bg-background p-4",children:i.jsxs("div",{className:"mx-auto max-w-2xl space-y-6",children:[i.jsxs(G,{variant:"ghost",onClick:N,className:"-ml-2",children:[i.jsx(ws,{className:"mr-2 h-4 w-4"}),"Wróć"]}),i.jsx(Xn,{isCached:x,isOffline:!s,lastSynced:v?new Date(v):null}),!s&&i.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 flex items-center gap-2 text-amber-800 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-200",children:[i.jsx(Hs,{className:"h-4 w-4"}),i.jsx("span",{className:"text-sm",children:"Tryb offline - dane z pamięci podręcznej"})]}),i.jsxs(Fe,{children:[i.jsxs(lt,{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(ut,{className:"text-xl",children:"Protokół serwisowy"}),i.jsxs("div",{className:"flex items-center gap-2 flex-wrap justify-end",children:[i.jsxs(Ge,{variant:M?"default":"destructive",className:"flex items-center gap-1",children:[M?i.jsx(Si,{className:"h-3 w-3"}):i.jsx(an,{className:"h-3 w-3"}),L]}),ge&&i.jsx(Ge,{variant:"outline",className:"text-xs",children:ge}),i.jsx(Ge,{variant:"secondary",children:"Zakończone"})]})]}),i.jsx(ir,{}),!a&&i.jsxs("div",{className:"space-y-1",children:[i.jsxs("p",{className:"font-semibold text-lg",children:["Klient: ",Z||i.jsx("span",{className:"text-muted-foreground",children:"Brak danych"})]}),i.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[i.jsx(Nl,{className:"h-3 w-3"}),me||"Brak adresu"]})]}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Urządzenie: ",((E=(Te=o.tickets)==null?void 0:Te.devices)==null?void 0:E.name)||"Brak danych"]})]}),i.jsxs(Me,{className:"space-y-6",children:[i.jsxs("div",{className:"grid gap-4 text-sm",children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:"Data zakończenia:"}),i.jsx("span",{className:"font-medium",children:(O=o.tickets)!=null&&O.completed_date?xt(new Date(o.tickets.completed_date),"PPP 'o' HH:mm",{locale:nr}):"-"})]}),((D=(V=o.tickets)==null?void 0:V.devices)==null?void 0:D.serial_number)&&i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:"Numer seryjny:"}),i.jsx("span",{className:"font-mono",children:o.tickets.devices.serial_number})]})]}),Object.keys(F).length>0&&i.jsxs("div",{className:"space-y-3",children:[i.jsxs("h3",{className:"font-semibold flex items-center gap-2",children:[i.jsx(Si,{className:"h-4 w-4"}),"Lista kontrolna - ",L]}),i.jsx("div",{className:"rounded-lg border p-4 space-y-2 bg-muted/30",children:Object.entries(F).filter(([,R])=>R).map(([R])=>i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[i.jsx(Dt,{className:"h-4 w-4 text-green-600"}),i.jsx("span",{children:Q[R]||R})]},R))})]}),!M&&z&&i.jsxs("div",{className:"space-y-2",children:[i.jsxs("h3",{className:"font-semibold flex items-center gap-2",children:[i.jsx(Sl,{className:"h-4 w-4"}),"Użyte materiały i robocizna"]}),i.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap rounded-lg border p-3 bg-muted/30",children:z})]}),he&&i.jsxs("div",{className:"space-y-2",children:[i.jsxs("h3",{className:"font-semibold flex items-center gap-2",children:[i.jsx(KO,{className:"h-4 w-4"}),"Pomiary"]}),q?i.jsx("div",{className:"rounded-lg border bg-muted/30 overflow-hidden",children:i.jsxs("table",{className:"w-full text-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b",children:[i.jsx("th",{className:"text-left p-2 font-medium text-muted-foreground",children:"Parametr"}),i.jsx("th",{className:"text-right p-2 font-medium text-muted-foreground",children:"Wartość"})]})}),i.jsx("tbody",{children:ce.filter(R=>R.param||R.value).map((R,W)=>i.jsxs("tr",{className:"border-b last:border-0",children:[i.jsx("td",{className:"p-2",children:R.param}),i.jsxs("td",{className:"p-2 text-right font-medium",children:[R.value,R.unit?` ${R.unit}`:""]})]},W))})]})}):i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3 text-sm",children:Object.entries(A).filter(([,R])=>R).map(([R,W])=>{const se=ee(R);return i.jsxs("div",{className:"rounded-lg border p-3 bg-muted/30 text-center",children:[i.jsx("p",{className:"text-muted-foreground text-xs",children:se.label}),i.jsxs("p",{className:"font-medium",children:[W,se.unit?` ${se.unit}`:""]})]},R)})})]}),o.technician_notes&&i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"font-semibold",children:"Opis wykonanych czynności"}),i.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap rounded-lg border p-3 bg-muted/30",children:(()=>{const R=o.technician_notes,W=R.match(/OPIS WYKONANYCH CZYNNOŚCI:\n([\s\S]*?)(?:\n\nUŻYTE MATERIAŁY:|\n\nPOMIARY:|\n\nZALECENIA DLA UŻYTKOWNIKA:|$)/);return W?W[1].trim():R})()})]}),C&&i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"font-semibold",children:"Zalecenia dla użytkownika"}),i.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap rounded-lg border p-3 bg-muted/30",children:C})]}),M&&((K=o.tickets)==null?void 0:K.consent_reminders)!==null&&i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"font-semibold",children:"Zgoda na przypomnienia"}),i.jsx("p",{className:"text-sm text-muted-foreground flex items-center gap-2",children:o.tickets.consent_reminders?i.jsxs(i.Fragment,{children:[i.jsx(Dt,{className:"h-4 w-4 text-green-600"}),"Wyrażono zgodę na cykliczne przypomnienia SMS/Email o przeglądach"]}
692):i.jsxs(i.Fragment,{children:[i.jsx(Ks,{className:"h-4 w-4 text-muted-foreground"}),"Brak zgody na przypomnienia"]})})]}),y.length>0&&i.jsxs("div",{className:"space-y-3",children:[i.jsxs("h3",{className:"font-semibold flex items-center gap-2",children:[i.jsx(rg,{className:"h-4 w-4"}),"Zdjęcia (",y.length,")"]}),i.jsx("div",{className:"grid grid-cols-3 gap-2",children:y.map((R,W)=>i.jsx("a",{href:R,target:"_blank",rel:"noopener noreferrer",className:"aspect-square rounded-lg overflow-hidden border hover:opacity-80 transition-opacity",children:i.jsx("img",{src:R,alt:`Zdjęcie ${W+1}`,className:"w-full h-full object-cover"})},W))})]}),!a&&u&&i.jsxs("div",{className:"space-y-3",children:[i.jsx("h3",{className:"font-semibold",children:"Podpis klienta"}),i.jsx("div",{className:"rounded-lg border bg-card p-4",children:i.jsx("img",{src:u,alt:"Podpis klienta",className:"max-h-32 mx-auto"})})]})]})]})]})})}function SV(){const e=Zt(),{user:t}=qr(),{toast:r}=Ar(),n=Dr(),{addOperation:s}=Ss(),{data:a,loading:o,isCached:l,isOffline:c,lastSynced:d,refresh:u}=aw(t==null?void 0:t.id),[h,p]=f.useState([]),[m,y]=f.useState(!0),[g,x]=f.useState(""),[b,v]=f.useState(!1),[w,_]=f.useState(!1),[j,k]=f.useState(""),[N,P]=f.useState(""),[T,I]=f.useState(""),[H,M]=f.useState(""),[L,F]=f.useState(""),[Y,Q]=f.useState(""),[S,z]=f.useState("");f.useEffect(()=>{t&&B()},[t]),f.useEffect(()=>{a.length>0&&!m&&C(a)},[a]);const C=async q=>{try{if(n){const{data:he}=await ne.from("devices").select("client_id").eq("installer_id",t==null?void 0:t.id).eq("is_active",!0),Z={};he==null||he.forEach(ge=>{Z[ge.client_id]=(Z[ge.client_id]||0)+1});const me=q.map(ge=>({...ge,device_count:Z[ge.id]||0}));p(me)}else p(q)}catch(he){console.error("Error getting device counts:",he),p(q)}},B=async()=>{try{if(!n){y(o);return}const{data:q,error:he}=await ne.from("clients").select("*").eq("installer_id",t==null?void 0:t.id).eq("is_active",!0).order("created_at",{ascending:!1});if(he)throw he;const{data:Z,error:me}=await ne.from("devices").select("client_id").eq("installer_id",t==null?void 0:t.id).eq("is_active",!0);if(me)throw me;const ge={};Z==null||Z.forEach(Ce=>{ge[Ce.client_id]=(ge[Ce.client_id]||0)+1});const Ne=(q||[]).map(Ce=>({...Ce,device_count:ge[Ce.id]||0}));p(Ne)}catch(q){console.error("Error fetching clients:",q),a.length>0&&(p(a),xs.info("Wyświetlam dane z cache",{description:"Nie udało się pobrać aktualnych danych"}))}finally{y(!1)}},ce=async q=>{if(q.preventDefault(),!t)return;if(!j){r({variant:"destructive",title:"Brak typu klienta",description:"Wybierz typ klienta"});return}_(!0);const he={installer_id:t.id,client_type:j,name:N,address:T,phone:H,email:L||null,nip:Y||null,notes:S||null,is_active:!0};try{if(!n){const me=crypto.randomUUID(),ge={...he,id:me,created_at:new Date().toISOString(),_pendingSync:!0};await s("create","clients",{...he,id:me}),await ve.saveData("clients",ge),p(Ne=>[ge,...Ne]),xs.info("Klient zostanie dodany po powrocie online"),v(!1),A(),_(!1);return}const{error:Z}=await ne.from("clients").insert(he);if(Z)throw Z;r({title:"Klient dodany",description:"Nowy klient został dodany do listy"}),v(!1),A(),B()}catch(Z){console.error("Error adding client:",Z),r({variant:"destructive",title:"Błąd",description:"Nie udało się dodać klienta"})}finally{_(!1)}},A=()=>{k(""),P(""),I(""),M(""),F(""),Q(""),z("")},ee=async()=>{y(!0),await u(),await B()},te=h.filter(q=>q.name.toLowerCase().includes(g.toLowerCase())||q.address.toLowerCase().includes(g.toLowerCase()));return i.jsx(sr,{title:"Klienci",children:i.jsxs("div",{className:"space-y-6 animate-fade-in",children:[i.jsx(Xn,{isCached:l,isOffline:c,lastSynced:d,onRefresh:ee,isRefreshing:m}),i.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[i.jsxs("div",{className:"relative flex-1 max-w-sm",children:[i.jsx(ud,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),i.jsx(Pe,{placeholder:"Szukaj klientów...",value:g,onChange:q=>x(q.target.value),className:"pl-10"})]}),i.jsxs(or,{open:b,onOpenChange:v,children:[i.jsx(zi,{asChild:!0,children:i.jsxs(G,{children:[i.jsx(Lo,{className:"mr-2 h-4 w-4"}),"Dodaj klienta"]})}),i.jsxs(er,{children:[i.jsx(tr,{children:i.jsx(rr,{children:"Nowy klient"})}),i.jsxs("form",{onSubmit:ce,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{children:"Typ klienta *"}),i.jsxs(Ha,{value:j,onValueChange:q=>{k(q),q==="individual"&&Q("")},children:[i.jsx(Ys,{children:i.jsx(Ka,{placeholder:"Wybierz typ klienta..."})}),i.jsx(Js,{children:ww.map(q=>i.jsx(Xs,{value:q.value,children:q.label},q.value))})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"name",children:"Nazwa / Imię i nazwisko *"}),i.jsx(Pe,{id:"name",value:N,onChange:q=>P(q.target.value),placeholder:"Jan Kowalski",required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"address",children:"Adres *"}),i.jsx(Pe,{id:"address",value:T,onChange:q=>I(q.target.value),placeholder:"ul. Przykładowa 10, 00-001 Warszawa",required:!0})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"phone",children:"Telefon *"}),i.jsx(Pe,{id:"phone",type:"tel",value:H,onChange:q=>M(q.target.value),placeholder:"+48 123 456 789",required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"email",children:"Email"}),i.jsx(Pe,{id:"email",type:"email",value:L,onChange:q=>F(q.target.value),placeholder:"[email protected]"})]})]}),j!=="individual"&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"nip",children:"NIP"}),i.jsx(Pe,{id:"nip",value:Y,onChange:q=>Q(q.target.value),placeholder:"1234567890"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"notes",children:"Notatki"}),i.jsx(Zn,{id:"notes",value:S,onChange:q=>z(q.target.value),placeholder:"Dodatkowe informacje o kliencie...",rows:3})]}),i.jsx(G,{type:"submit",className:"w-full",disabled:w||!j,children:w?"Zapisywanie...":"Dodaj klienta"})]})]})]})]}),m?i.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"Ładowanie..."}):te.length===0?i.jsx(Fe,{children:i.jsxs(Me,{className:"flex h-64 flex-col items-center justify-center text-center",children:[i.jsx(u1,{className:"mb-4 h-12 w-12 text-muted-foreground"}),i.jsx("h3",{className:"text-lg font-semibold",children:g?"Brak wyników":"Brak klientów"}),i.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:g?"Spróbuj innego wyszukiwania":"Dod
692aj pierwszego klienta"})]})}):i.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:te.map((q,he)=>i.jsx(Fe,{className:"animate-fade-in cursor-pointer hover:border-primary/50 transition-colors",style:{animationDelay:`${he*30}ms`},onClick:()=>e(`/clients/${q.id}`),children:i.jsxs(Me,{className:"p-5",children:[i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h3",{className:"font-semibold text-lg truncate",children:q.name}),q._pendingSync&&i.jsx(Fl,{className:"mt-1"})]}),i.jsx(Jk,{className:"h-5 w-5 text-muted-foreground shrink-0"})]}),i.jsxs("div",{className:"mt-3 space-y-2 text-sm text-muted-foreground",children:[i.jsxs("p",{className:"flex items-center gap-2",children:[i.jsx(Nl,{className:"h-4 w-4 shrink-0"}),i.jsx("span",{className:"truncate",children:q.address})]}),i.jsxs("p",{className:"flex items-center gap-2",children:[i.jsx(Ii,{className:"h-4 w-4 shrink-0"}),i.jsxs("span",{children:["Liczba urządzeń: ",q.device_count||0]})]}),q.phone&&i.jsxs("p",{className:"flex items-center gap-2",children:[i.jsx($o,{className:"h-4 w-4 shrink-0"}),i.jsx("a",{href:`tel:${q.phone}`,className:"hover:underline",onClick:Z=>Z.stopPropagation(),children:q.phone})]})]})]})},q.id))})]})})}function CV({client:e,open:t,onOpenChange:r,onSuccess:n}){const{toast:s}=Ar(),a=Dr(),{addOperation:o}=Ss(),[l,c]=f.useState(!1),[d,u]=f.useState(""),[h,p]=f.useState(""),[m,y]=f.useState(""),[g,x]=f.useState(""),[b,v]=f.useState(""),[w,_]=f.useState(""),[j,k]=f.useState("");f.useEffect(()=>{e&&(u(e.client_type||""),p(e.name),y(e.address),x(e.phone||""),v(e.email||""),_(e.nip||""),k(e.notes||""))},[e]);const N=async P=>{if(P.preventDefault(),!e)return;if(!d){s({variant:"destructive",title:"Brak typu klienta",description:"Wybierz typ klienta"});return}c(!0);const T={client_type:d,name:h,address:m,phone:g,email:b||null,nip:w||null,notes:j||null};if(!a){try{const I={...e,...T,_pendingSync:!0};await ve.saveData("clients",I),await o("update","clients",{id:e.id,...T}),xs.info("Zmiany zostaną zapisane po powrocie online",{description:"Zapisano lokalnie"}),r(!1),n()}catch(I){console.error("Error saving offline:",I),s({variant:"destructive",title:"Błąd",description:"Nie udało się zapisać zmian lokalnie"})}finally{c(!1)}return}try{const{error:I}=await ne.from("clients").update(T).eq("id",e.id);if(I)throw I;s({title:"Klient zaktualizowany",description:"Dane klienta zostały zapisane"}),r(!1),n()}catch(I){console.error("Error updating client:",I),s({variant:"destructive",title:"Błąd",description:"Nie udało się zaktualizować klienta"})}finally{c(!1)}};return i.jsx(or,{open:t,onOpenChange:r,children:i.jsxs(er,{children:[i.jsx(tr,{children:i.jsx(rr,{children:"Edytuj klienta"})}),i.jsxs("form",{onSubmit:N,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{children:"Typ klienta *"}),i.jsxs(Ha,{value:d,onValueChange:P=>{u(P),P==="individual"&&_("")},children:[i.jsx(Ys,{children:i.jsx(Ka,{placeholder:"Wybierz typ klienta..."})}),i.jsx(Js,{children:ww.map(P=>i.jsx(Xs,{value:P.value,children:P.label},P.value))})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"edit-name",children:"Nazwa / Imię i nazwisko *"}),i.jsx(Pe,{id:"edit-name",value:h,onChange:P=>p(P.target.value),required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"edit-address",children:"Adres *"}),i.jsx(Pe,{id:"edit-address",value:m,onChange:P=>y(P.target.value),required:!0})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"edit-phone",children:"Telefon *"}),i.jsx(Pe,{id:"edit-phone",type:"tel",value:g,onChange:P=>x(P.target.value),required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"edit-email",children:"Email"}),i.jsx(Pe,{id:"edit-email",type:"email",value:b,onChange:P=>v(P.target.value)})]})]}),d!=="individual"&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"edit-nip",children:"NIP"}),i.jsx(Pe,{id:"edit-nip",value:w,onChange:P=>_(P.target.value),placeholder:"1234567890"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"edit-notes",children:"Notatki"}),i.jsx(Zn,{id:"edit-notes",value:j,onChange:P=>k(P.target.value),rows:3})]}),i.jsx(G,{type:"submit",className:"w-full",disabled:l||!d,children:l?"Zapisywanie...":"Zapisz zmiany"})]})]})})}const Vf=[{value:"klimatyzacja",label:"Klimatyzacja (split/multi)"},{value:"pompa_ciepla",label:"Pompa ciepła"},{value:"kociol",label:"Kocioł gazowy"},{value:"wentylacja",label:"Wentylacja / Rekuperacja"},{value:"inne",label:"Inne"}];function qf(e){var t;return e?((t=Vf.find(r=>r.value===e))==null?void 0:t.label)||e:"Nieokreślona"}function zV(){const{id:e}=Xi(),t=Zt(),{user:r}=qr(),{toast:n}=Ar(),s=Dr(),[a,o]=f.useState(null),[l,c]=f.useState([]),[d,u]=f.useState(!0),[h,p]=f.useState(!1),[m,y]=f.useState(!1),[g,x]=f.useState(!1),[b,v]=f.useState(!1);f.useEffect(()=>{r&&e&&w()},[r,e]);const w=async()=>
692{if(!s)try{const j=await ve.getData("clients",e),N=(await ve.getAllData("devices")).filter(P=>P.client_id===e);if(j){o(j),c(N),p(!0),u(!1);return}}catch(j){console.error("Error loading cached client:",j)}try{const[j,k]=await Promise.all([ne.from("clients").select("*").eq("id",e).eq("installer_id",r==null?void 0:r.id).eq("is_active",!0).maybeSingle(),ne.from("devices").select("id, name, serial_number, short_id, install_date, category").eq("client_id",e).eq("installer_id",r==null?void 0:r.id).eq("is_active",!0).order("created_at",{ascending:!1})]);if(j.error)throw j.error;if(k.error)throw k.error;o(j.data),c(k.data||[]),p(!1),j.data&&await ve.saveData("clients",j.data)}catch(j){console.error("Error fetching client details:",j);try{const k=await ve.getData("clients",e),P=(await ve.getAllData("devices")).filter(T=>T.client_id===e);k&&(o(k),c(P),p(!0))}catch(k){console.error("Error loading from cache:",k)}}finally{u(!1)}},_=async()=>{if(a){if(!s){n({variant:"destructive",title:"Brak połączenia",description:"Ta operacja wymaga połączenia z internetem"});return}v(!0);try{if(l.length>0){n({variant:"destructive",title:"Błąd",description:"Nie można usunąć klienta z aktywnymi urządzeniami. Najpierw usuń urządzenia."}),v(!1),x(!1);return}const{error:j}=await ne.from("clients").update({is_active:!1}).eq("id",a.id);if(j)throw j;n({title:"Klient usunięty"}),t("/clients")}catch(j){console.error("Error deleting client:",j),n({variant:"destructive",title:"Błąd",description:"Nie udało się usunąć klienta"})}finally{v(!1)}}};return d?i.jsx(sr,{title:"Szczegóły klienta",children:i.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"Ładowanie..."})}):a?i.jsx(sr,{title:a.name,children:i.jsxs("div",{className:"space-y-6 animate-fade-in",children:[h&&i.jsx(Xn,{isCached:h,isOffline:!s,lastSynced:null,onRefresh:w}),!s&&!h&&i.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-warning/10 border border-warning/20 text-warning-foreground",children:[i.jsx(Hs,{className:"h-4 w-4"}),i.jsx("span",{className:"text-sm",children:"Tryb offline - niektóre operacje są niedostępne"})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs(G,{variant:"ghost",onClick:()=>t("/clients"),className:"gap-2",children:[i.jsx(ws,{className:"h-4 w-4"}),"Wróć do listy"]}),i.jsxs("div",{className:"flex gap-2",children:[a._pendingSync&&i.jsx(Fl,{}),i.jsxs(G,{variant:"outline",onClick:()=>y(!0),children:[i.jsx($c,{className:"mr-2 h-4 w-4"}),"Edytuj"]}),i.jsxs(G,{variant:"destructive",onClick:()=>x(!0),disabled:!s,children:[i.jsx(rf,{className:"mr-2 h-4 w-4"}),"Usuń"]})]})]}),i.jsxs(Fe,{children:[i.jsx(lt,{children:i.jsx(ut,{children:a.name})}),i.jsxs(Me,{className:"space-y-3",children:[a.client_type&&i.jsxs("p",{className:"flex items-center gap-2 text-muted-foreground",children:[a.client_type==="company"?i.jsx(Yk,{className:"h-4 w-4 shrink-0"}):i.jsx(qs,{className:"h-4 w-4 shrink-0"}),A2(a.client_type)]}),i.jsxs("p",{className:"flex items-center gap-2 text-muted-foreground",children:[i.jsx(Nl,{className:"h-4 w-4 shrink-0"}),a.address]}),a.phone&&i.jsxs("p",{className:"flex items-center gap-2",children:[i.jsx($o,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),i.jsx("a",{href:`tel:${a.phone}`,className:"text-primary hover:underline",children:a.phone})]}),a.email&&i.jsxs("p",{className:"flex items-center gap-2",children:[i.jsx(po,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),i.jsx("a",{href:`mailto:${a.email}`,className:"text-primary hover:underline",children:a.email})]}),a.nip&&i.jsxs("p",{className:"flex items-center gap-2 text-muted-foreground",children:[i.jsx("span",{className:"text-xs font-medium bg-muted px-2 py-0.5 rounded",children:"NIP"}),a.nip]}),a.notes&&i.jsx("div",{className:"border-t border-border pt-3 mt-3",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:a.notes})})]})]}),i.jsxs(Fe,{children:[i.jsxs(lt,{className:"flex flex-row items-center justify-between",children:[i.jsxs(ut,{className:"flex items-center gap-2",children:[i.jsx(Ii,{className:"h-5 w-5"}),"Urządzenia (",l.length,")"]}),i.jsx(G,{variant:"outline",size:"sm",onClick:()=>t("/devices"),children:"Zarządzaj urządzeniami"})]}),i.jsx(Me,{children:l.length===0?i.jsx("p",{className:"text-muted-foreground text-sm text-center py-4",children:"Brak urządzeń przypisanych do tego klienta"}):i.jsx("div",{className:"space-y-3",children:l.map(j=>i.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border border-border hover:bg-accent/50 transition-colors cursor-pointer",onClick:()=>t(`/devices/${j.id}`),children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsx("p",{className:"font-medium truncate",children:j.name}),j.category&&i.jsx(Ge,{variant:"outline",className:"text-xs shrink-0",children:qf(j.category)})]}),i.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground mt-1 flex-wrap",children:[i.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded text-xs",children:j.short_id}),j.serial_number&&i.jsxs("span",{className:"truncate",children:["S/N: ",j.serial_number]}),j.install_date&&i.jsxs("span",{children:["Montaż: ",xt(new Date(j.install_date),"d MMM yyyy",{locale:nr})]})]})]}),i.jsx(Er,{className:"h-5 w-5 text-muted-foreground shrink-0 ml-2"})]},j.id))})})]}),i.jsx(CV,{client:a,open:m,onOpenChange:y,onSuccess:w}),i.jsx(Wf,{open:g,onOpenChange:x,title:"Usuń klienta",description:l.length>0?`Nie można usunąć klienta "${a.name}" ponieważ ma ${l.length} aktywnych urządzeń. Najpierw usuń urządzenia.`:`Czy na pewno chcesz usunąć klienta "${a.name}
692"? Ta operacja jest nieodwracalna.`,confirmText:b?"Usuwanie...":"Usuń",onConfirm:_,variant:"destructive"})]})}):i.jsx(sr,{title:"Szczegóły klienta",children:i.jsx(Fe,{children:i.jsxs(Me,{className:"flex h-64 flex-col items-center justify-center text-center",children:[i.jsx("p",{className:"text-muted-foreground",children:"Nie znaleziono klienta"}),i.jsx(G,{variant:"link",onClick:()=>t("/clients"),children:"Wróć do listy klientów"})]})})})}function I2({device:e,clients:t,open:r,onOpenChange:n,onSuccess:s}){const{toast:a}=Ar(),o=Dr(),{addOperation:l}=Ss(),[c,d]=f.useState(!1),[u,h]=f.useState(""),[p,m]=f.useState(""),[y,g]=f.useState(""),[x,b]=f.useState(""),[v,w]=f.useState(""),[_,j]=f.useState(""),[k,N]=f.useState(""),[P,T]=f.useState(""),[I,H]=f.useState(""),[M,L]=f.useState(""),F=S=>{H(S),!u&&(S||M)&&h(`${S} ${M}`.trim())},Y=S=>{L(S),!u&&(I||S)&&h(`${I} ${S}`.trim())};f.useEffect(()=>{var S;e&&(h(e.name),m(e.serial_number||""),g(e.install_date||""),b(e.client_id||((S=e.clients)==null?void 0:S.id)||""),w(e.location||""),j(e.warranty_end||""),N(e.notes||""),T(e.category||""),H(e.manufacturer||""),L(e.model||""))},[e]);const Q=async S=>{if(S.preventDefault(),!e||!x||!P){P||a({variant:"destructive",title:"Brak kategorii",description:"Wybierz kategorię urządzenia"});return}d(!0);const z={name:u,serial_number:p||null,install_date:y||null,location:v||null,warranty_end:_||null,notes:k||null,category:P||null,manufacturer:I||null,model:M||null,client_id:x};if(!o){try{const C={...e,...z,_pendingSync:!0};await ve.saveData("devices",C),await l("update","devices",{id:e.id,...z}),xs.info("Zmiany zostaną zapisane po powrocie online",{description:"Zapisano lokalnie"}),n(!1),s()}catch(C){console.error("Error saving offline:",C),a({variant:"destructive",title:"Błąd",description:"Nie udało się zapisać zmian lokalnie"})}finally{d(!1)}return}try{const{error:C}=await ne.from("devices").update(z).eq("id",e.id);if(C)throw C;a({title:"Urządzenie zaktualizowane",description:"Dane urządzenia zostały zapisane"}),n(!1),s()}catch(C){console.error("Error updating device:",C),a({variant:"destructive",title:"Błąd",description:"Nie udało się zaktualizować urządzenia"})}finally{d(!1)}};return i.jsx(or,{open:r,onOpenChange:n,children:i.jsxs(er,{children:[i.jsx(tr,{children:i.jsx(rr,{children:"Edytuj urządzenie"})}),i.jsxs("form",{onSubmit:Q,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{children:"Klient *"}),i.jsx(dw,{clients:t,value:x,onValueChange:b,placeholder:"Wyszukaj klienta..."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{children:"Kategoria urządzenia *"}),i.jsxs(Ha,{value:P,onValueChange:T,children:[i.jsx(Ys,{children:i.jsx(Ka,{placeholder:"Wybierz kategorię..."})}),i.jsx(Js,{children:Vf.map(S=>i.jsx(Xs,{value:S.value,children:S.label},S.value))})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"edit-manufacturer",children:"Producent"}),i.jsx(Pe,{id:"edit-manufacturer",value:I,onChange:S=>F(S.target.value),placeholder:"np. Daikin, Mitsubishi, LG"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"edit-model",children:"Model"}),i.jsx(Pe,{id:"edit-model",value:M,onChange:S=>Y(S.target.value),placeholder:"np. FTXM35"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"edit-device-name",children:"Nazwa urządzenia *"}),i.jsx(Pe,{id:"edit-device-name",value:u,onChange:S=>h(S.target.value),required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"edit-serial",children:"Numer seryjny"}),i.jsx(Pe,{id:"edit-serial",value:p,onChange:S=>m(S.target.value)})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"edit-installDate",children:"Data montażu"}),i.jsx(Pe,{id:"edit-installDate",type:"date",value:y,onChange:S=>g(S.target.value)})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"edit-warrantyEnd",children:"Koniec gwarancji"}),i.jsx(Pe,{id:"edit-warrantyEnd",type:"date",value:_,onChange:S=>j(S.target.value)})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"edit-location",children:"Lokalizacja w budynku"}
692),i.jsx(Pe,{id:"edit-location",value:v,onChange:S=>w(S.target.value),placeholder:"np. Salon, Dach, Biuro 104"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"edit-notes",children:"Dodatkowe informacje techniczne"}),i.jsx("textarea",{id:"edit-notes",value:k,onChange:S=>N(S.target.value),placeholder:"np. potrzebna długa drabina",className:"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"})]}),i.jsx(G,{type:"submit",className:"w-full",disabled:c||!x||!P,children:c?"Zapisywanie...":"Zapisz zmiany"})]})]})})}const EV=Ji("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),M2=f.forwardRef(({className:e,variant:t,...r},n)=>i.jsx("div",{ref:n,role:"alert",className:J(EV({variant:t}),e),...r}));M2.displayName="Alert";const F2=f.forwardRef(({className:e,...t},r)=>i.jsx("h5",{ref:r,className:J("mb-1 font-medium leading-none tracking-tight",e),...t}));F2.displayName="AlertTitle";const $2=f.forwardRef(({className:e,...t},r)=>i.jsx("div",{ref:r,className:J("text-sm [&_p]:leading-relaxed",e),...t}));$2.displayName="AlertDescription";var PV=Object.defineProperty,Oh=Object.getOwnPropertySymbols,L2=Object.prototype.hasOwnProperty,U2=Object.prototype.propertyIsEnumerable,G0=(e,t,r)=>t in e?PV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xg=(e,t)=>{for(var r in t||(t={}))L2.call(t,r)&&G0(e,r,t[r]);if(Oh)for(var r of Oh(t))U2.call(t,r)&&G0(e,r,t[r]);return e},ey=(e,t)=>{var r={};for(var n in e)L2.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Oh)for(var n of Oh(e))t.indexOf(n)<0&&U2.call(e,n)&&(r[n]=e[n]);return r};/**
693 * @license QR Code generator library (TypeScript)
694 * Copyright (c) Project Nayuki.
695 * SPDX-License-Identifier: MIT
696 */var Ki;(e=>{const t=class Ze{constructor(c,d,u,h){if(this.version=c,this.errorCorrectionLevel=d,this.modules=[],this.isFunction=[],c<Ze.MIN_VERSION||c>Ze.MAX_VERSION)throw new RangeError("Version value out of range");if(h<-1||h>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let p=[];for(let y=0;y<this.size;y++)p.push(!1);for(let y=0;y<this.size;y++)this.modules.push(p.slice()),this.isFunction.push(p.slice());this.drawFunctionPatterns();const m=this.addEccAndInterleave(u);if(this.drawCodewords(m),h==-1){let y=1e9;for(let g=0;g<8;g++){this.applyMask(g),this.drawFormatBits(g);const x=this.getPenaltyScore();x<y&&(h=g,y=x),this.applyMask(g)}}s(0<=h&&h<=7),this.mask=h,this.applyMask(h),this.drawFormatBits(h),this.isFunction=[]}static encodeText(c,d){const u=e.QrSegment.makeSegments(c);return Ze.encodeSegments(u,d)}static encodeBinary(c,d){const u=e.QrSegment.makeBytes(c);return Ze.encodeSegments([u],d)}static encodeSegments(c,d,u=1,h=40,p=-1,m=!0){if(!(Ze.MIN_VERSION<=u&&u<=h&&h<=Ze.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let y,g;for(y=u;;y++){const w=Ze.getNumDataCodewords(y,d)*8,_=o.getTotalBits(c,y);if(_<=w){g=_;break}if(y>=h)throw new RangeError("Data too long")}for(const w of[Ze.Ecc.MEDIUM,Ze.Ecc.QUARTILE,Ze.Ecc.HIGH])m&&g<=Ze.getNumDataCodewords(y,w)*8&&(d=w);let x=[];for(const w of c){r(w.mode.modeBits,4,x),r(w.numChars,w.mode.numCharCountBits(y),x);for(const _ of w.getData())x.push(_)}s(x.length==g);const b=Ze.getNumDataCodewords(y,d)*8;s(x.length<=b),r(0,Math.min(4,b-x.length),x),r(0,(8-x.length%8)%8,x),s(x.length%8==0);for(let w=236;x.length<b;w^=253)r(w,8,x);let v=[];for(;v.length*8<x.length;)v.push(0);return x.forEach((w,_)=>v[_>>>3]|=w<<7-(_&7)),new Ze(y,d,v,p)}getModule(c,d){return 0<=c&&c<this.size&&0<=d&&d<this.size&&this.modules[d][c]}getModules(){return this.modules}drawFunctionPatterns(){for(let u=0;u<this.size;u++)this.setFunctionModule(6,u,u%2==0),this.setFunctionModule(u,6,u%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const c=this.getAlignmentPatternPositions(),d=c.length;for(let u=0;u<d;u++)for(let h=0;h<d;h++)u==0&&h==0||u==0&&h==d-1||u==d-1&&h==0||this.drawAlignmentPattern(c[u],c[h]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(c){const d=this.errorCorrectionLevel.formatBits<<3|c;let u=d;for(let p=0;p<10;p++)u=u<<1^(u>>>9)*1335;const h=(d<<10|u)^21522;s(h>>>15==0);for(let p=0;p<=5;p++)this.setFunctionModule(8,p,n(h,p));this.setFunctionModule(8,7,n(h,6)),this.setFunctionModule(8,8,n(h,7)),this.setFunctionModule(7,8,n(h,8));for(let p=9;p<15;p++)this.setFunctionModule(14-p,8,n(h,p));for(let p=0;p<8;p++)this.setFunctionModule(this.size-1-p,8,n(h,p));for(let p=8;p<15;p++)this.setFunctionModule(8,this.size-15+p,n(h,p));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let c=this.version;for(let u=0;u<12;u++)c=c<<1^(c>>>11)*7973;const d=this.version<<12|c;s(d>>>18==0);for(let u=0;u<18;u++){const h=n(d,u),p=this.size-11+u%3,m=Math.floor(u/3);this.setFunctionModule(p,m,h),this.setFunctionModule(m,p,h)}}drawFinderPattern(c,d){for(let u=-4;u<=4;u++)for(let h=-4;h<=4;h++){const p=Math.max(Math.abs(h),Math.abs(u)),m=c+h,y=d+u;0<=m&&m<this.size&&0<=y&&y<this.size&&this.setFunctionModule(m,y,p!=2&&p!=4)}}drawAlignmentPattern(c,d){for(let u=-2;u<=2;u++)for(let h=-2;h<=2;h++)this.setFunctionModule(c+h,d+u,Math.max(Math.abs(h),Math.abs(u))!=1)}setFunctionModule(c,d,u){this.modules[d][c]=u,this.isFunction[d][c]=!0}addEccAndInterleave(c){const d=this.version,u=this.errorCorrectionLevel;if(c.length!=Ze.getNumDataCodewords(d,u))throw new RangeError("Invalid argument");const h=Ze.NUM_ERROR_CORRECTION_BLOCKS[u.ordinal][d],p=Ze.ECC_CODEWORDS_PER_BLOCK[u.ordinal][d],m=
696Math.floor(Ze.getNumRawDataModules(d)/8),y=h-m%h,g=Math.floor(m/h);let x=[];const b=Ze.reedSolomonComputeDivisor(p);for(let w=0,_=0;w<h;w++){let j=c.slice(_,_+g-p+(w<y?0:1));_+=j.length;const k=Ze.reedSolomonComputeRemainder(j,b);w<y&&j.push(0),x.push(j.concat(k))}let v=[];for(let w=0;w<x[0].length;w++)x.forEach((_,j)=>{(w!=g-p||j>=y)&&v.push(_[w])});return s(v.length==m),v}drawCodewords(c){if(c.length!=Math.floor(Ze.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let d=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let h=0;h<this.size;h++)for(let p=0;p<2;p++){const m=u-p,g=(u+1&2)==0?this.size-1-h:h;!this.isFunction[g][m]&&d<c.length*8&&(this.modules[g][m]=n(c[d>>>3],7-(d&7)),d++)}}s(d==c.length*8)}applyMask(c){if(c<0||c>7)throw new RangeError("Mask value out of range");for(let d=0;d<this.size;d++)for(let u=0;u<this.size;u++){let h;switch(c){case 0:h=(u+d)%2==0;break;case 1:h=d%2==0;break;case 2:h=u%3==0;break;case 3:h=(u+d)%3==0;break;case 4:h=(Math.floor(u/3)+Math.floor(d/2))%2==0;break;case 5:h=u*d%2+u*d%3==0;break;case 6:h=(u*d%2+u*d%3)%2==0;break;case 7:h=((u+d)%2+u*d%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[d][u]&&h&&(this.modules[d][u]=!this.modules[d][u])}}getPenaltyScore(){let c=0;for(let p=0;p<this.size;p++){let m=!1,y=0,g=[0,0,0,0,0,0,0];for(let x=0;x<this.size;x++)this.modules[p][x]==m?(y++,y==5?c+=Ze.PENALTY_N1:y>5&&c++):(this.finderPenaltyAddHistory(y,g),m||(c+=this.finderPenaltyCountPatterns(g)*Ze.PENALTY_N3),m=this.modules[p][x],y=1);c+=this.finderPenaltyTerminateAndCount(m,y,g)*Ze.PENALTY_N3}for(let p=0;p<this.size;p++){let m=!1,y=0,g=[0,0,0,0,0,0,0];for(let x=0;x<this.size;x++)this.modules[x][p]==m?(y++,y==5?c+=Ze.PENALTY_N1:y>5&&c++):(this.finderPenaltyAddHistory(y,g),m||(c+=this.finderPenaltyCountPatterns(g)*Ze.PENALTY_N3),m=this.modules[x][p],y=1);c+=this.finderPenaltyTerminateAndCount(m,y,g)*Ze.PENALTY_N3}for(let p=0;p<this.size-1;p++)for(let m=0;m<this.size-1;m++){const y=this.modules[p][m];y==this.modules[p][m+1]&&y==this.modules[p+1][m]&&y==this.modules[p+1][m+1]&&(c+=Ze.PENALTY_N2)}let d=0;for(const p of this.modules)d=p.reduce((m,y)=>m+(y?1:0),d);const u=this.size*this.size,h=Math.ceil(Math.abs(d*20-u*10)/u)-1;return s(0<=h&&h<=9),c+=h*Ze.PENALTY_N4,s(0<=c&&c<=2568888),c}getAlignmentPatternPositions(){if(this.version==1)return[];{const c=Math.floor(this.version/7)+2,d=this.version==32?26:Math.ceil((this.version*4+4)/(c*2-2))*2;let u=[6];for(let h=this.size-7;u.length<c;h-=d)u.splice(1,0,h);return u}}static getNumRawDataModules(c){if(c<Ze.MIN_VERSION||c>Ze.MAX_VERSION)throw new RangeError("Version number out of range");let d=(16*c+128)*c+64;if(c>=2){const u=Math.floor(c/7)+2;d-=(25*u-10)*u-55,c>=7&&(d-=36)}return s(208<=d&&d<=29648),d}static getNumDataCodewords(c,d){return Math.floor(Ze.getNumRawDataModules(c)/8)-Ze.ECC_CODEWORDS_PER_BLOCK[d.ordinal][c]*Ze.NUM_ERROR_CORRECTION_BLOCKS[d.ordinal][c]}static reedSolomonComputeDivisor(c){if(c<1||c>255)throw new RangeError("Degree out of range");let d=[];for(let h=0;h<c-1;h++)d.push(0);d.push(1);let u=1;for(let h=0;h<c;h++){for(let p=0;p<d.length;p++)d[p]=Ze.reedSolomonMultiply(d[p],u),p+1<d.length&&(d[p]^=d[p+1]);u=Ze.reedSolomonMultiply(u,2)}return d}static reedSolomonComputeRemainder(c,d){let u=d.map(h=>0);for(const h of c){const p=h^u.shift();u.push(0),d.forEach((m,y)=>u[y]^=Ze.reedSolomonMultiply(m,p))}return u}static reedSolomonMultiply(c,d){if(c>>>8||d>>>8)throw new RangeError("Byte out of range");let u=0;for(let h=7;h>=0;h--)u=u<<1^(u>>>7)*285,u^=(d>>>h&1)*c;return s(u>>>8==0),u}finderPenaltyCountPatterns(c){const d=c[1];s(d<=this.size*3);const u=d>0&&c[2]==d&&c[3]==d*3&&c[4]==d&&c[5]==d;return(u&&c[0]>=d*4&&c[6]>=d?1:0)+(u&&c[6]>=d*4&&c[0]>=d?1:0)}finderPenaltyTerminateAndCount(c,d,u){return c&&(this.finderPenaltyAddHistory(d,u),d=0),d+=this.size,this.finderPenaltyAddHistory(d,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(c,d){d[0]==0&&(c+=this.size),d.pop(),d.unshift(c)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function r(l,c,d){if(c<0||c>31||l>>>c)throw new RangeError("Value out of range");for(let u=c-1;u>=0;u--)d.push(l>>>u&1)}function n(l,c){return(l>>>c&1)!=0}function s(l){if(!l)throw new Error("Assertion error")}const a=class Ot{constructor(c,d,u){if(this.mode=c,this.numChars=d,this.bitData=u,d<0)throw new RangeError("Invalid argument");this.bitData=u.slice()}static makeBytes(c){let d=[];for(const u of c)r(u,8,d);return new Ot(Ot.Mode.BYTE,c.length,d)}static makeNumeric(c){if(!Ot.isNumeric(c))throw new RangeError("String contains 
696non-numeric characters");let d=[];for(let u=0;u<c.length;){const h=Math.min(c.length-u,3);r(parseInt(c.substring(u,u+h),10),h*3+1,d),u+=h}return new Ot(Ot.Mode.NUMERIC,c.length,d)}static makeAlphanumeric(c){if(!Ot.isAlphanumeric(c))throw new RangeError("String contains unencodable characters in alphanumeric mode");let d=[],u;for(u=0;u+2<=c.length;u+=2){let h=Ot.ALPHANUMERIC_CHARSET.indexOf(c.charAt(u))*45;h+=Ot.ALPHANUMERIC_CHARSET.indexOf(c.charAt(u+1)),r(h,11,d)}return u<c.length&&r(Ot.ALPHANUMERIC_CHARSET.indexOf(c.charAt(u)),6,d),new Ot(Ot.Mode.ALPHANUMERIC,c.length,d)}static makeSegments(c){return c==""?[]:Ot.isNumeric(c)?[Ot.makeNumeric(c)]:Ot.isAlphanumeric(c)?[Ot.makeAlphanumeric(c)]:[Ot.makeBytes(Ot.toUtf8ByteArray(c))]}static makeEci(c){let d=[];if(c<0)throw new RangeError("ECI assignment value out of range");if(c<128)r(c,8,d);else if(c<16384)r(2,2,d),r(c,14,d);else if(c<1e6)r(6,3,d),r(c,21,d);else throw new RangeError("ECI assignment value out of range");return new Ot(Ot.Mode.ECI,0,d)}static isNumeric(c){return Ot.NUMERIC_REGEX.test(c)}static isAlphanumeric(c){return Ot.ALPHANUMERIC_REGEX.test(c)}getData(){return this.bitData.slice()}static getTotalBits(c,d){let u=0;for(const h of c){const p=h.mode.numCharCountBits(d);if(h.numChars>=1<<p)return 1/0;u+=4+p+h.bitData.length}return u}static toUtf8ByteArray(c){c=encodeURI(c);let d=[];for(let u=0;u<c.length;u++)c.charAt(u)!="%"?d.push(c.charCodeAt(u)):(d.push(parseInt(c.substring(u+1,u+3),16)),u+=2);return d}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let o=a;e.QrSegment=a})(Ki||(Ki={}));(e=>{(t=>{const r=class{constructor(s,a){this.ordinal=s,this.formatBits=a}};r.LOW=new r(0,1),r.MEDIUM=new r(1,0),r.QUARTILE=new r(2,3),r.HIGH=new r(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(Ki||(Ki={}));(e=>{(t=>{const r=class{constructor(s,a){this.modeBits=s,this.numBitsCharCount=a}numCharCountBits(s){return this.numBitsCharCount[Math.floor((s+7)/17)]}};r.NUMERIC=new r(1,[10,12,14]),r.ALPHANUMERIC=new r(2,[9,11,13]),r.BYTE=new r(4,[8,16,16]),r.KANJI=new r(8,[8,10,12]),r.ECI=new r(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(Ki||(Ki={}));var Ro=Ki;/**
697 * @license qrcode.react
698 * Copyright (c) Paul O'Shannessy
699 * SPDX-License-Identifier: ISC
700 */var TV={L:Ro.QrCode.Ecc.LOW,M:Ro.QrCode.Ecc.MEDIUM,Q:Ro.QrCode.Ecc.QUARTILE,H:Ro.QrCode.Ecc.HIGH},B2=128,W2="L",V2="#FFFFFF",q2="#000000",H2=!1,K2=1,RV=4,OV=0,AV=.1;function Z2(e,t=0){const r=[];return e.forEach(function(n,s){let a=null;
700n.forEach(function(o,l){if(!o&&a!==null){r.push(`M${a+t} ${s+t}h${l-a}v1H${a+t}z`),a=null;return}if(l===n.length-1){if(!o)return;a===null?r.push(`M${l+t},${s+t} h1v1H${l+t}z`):r.push(`M${a+t},${s+t} h${l+1-a}v1H${a+t}z`);return}o&&a===null&&(a=l)})}),r.join("")}function G2(e,t){return e.slice().map((r,n)=>n<t.y||n>=t.y+t.h?r:r.map((s,a)=>a<t.x||a>=t.x+t.w?s:!1))}function DV(e,t,r,n){if(n==null)return null;const s=e.length+r*2,a=Math.floor(t*AV),o=s/t,l=(n.width||a)*o,c=(n.height||a)*o,d=n.x==null?e.length/2-l/2:n.x*o,u=n.y==null?e.length/2-c/2:n.y*o,h=n.opacity==null?1:n.opacity;let p=null;if(n.excavate){let y=Math.floor(d),g=Math.floor(u),x=Math.ceil(l+d-y),b=Math.ceil(c+u-g);p={x:y,y:g,w:x,h:b}}const m=n.crossOrigin;return{x:d,y:u,h:c,w:l,excavation:p,opacity:h,crossOrigin:m}}function IV(e,t){return t!=null?Math.max(Math.floor(t),0):e?RV:OV}function Q2({value:e,level:t,minVersion:r,includeMargin:n,marginSize:s,imageSettings:a,size:o,boostLevel:l}){let c=U.useMemo(()=>{const y=(Array.isArray(e)?e:[e]).reduce((g,x)=>(g.push(...Ro.QrSegment.makeSegments(x)),g),[]);return Ro.QrCode.encodeSegments(y,TV[t],r,void 0,void 0,l)},[e,t,r,l]);const{cells:d,margin:u,numCells:h,calculatedImageSettings:p}=U.useMemo(()=>{let m=c.getModules();const y=IV(n,s),g=m.length+y*2,x=DV(m,o,y,a);return{cells:m,margin:y,numCells:g,calculatedImageSettings:x}},[c,o,a,n,s]);return{qrcode:c,margin:u,cells:d,numCells:h,calculatedImageSettings:p}}var MV=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),FV=U.forwardRef(function(t,r){const n=t,{value:s,size:a=B2,level:o=W2,bgColor:l=V2,fgColor:c=q2,includeMargin:d=H2,minVersion:u=K2,boostLevel:h,marginSize:p,imageSettings:m}=n,g=ey(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:x}=g,b=ey(g,["style"]),v=m==null?void 0:m.src,w=U.useRef(null),_=U.useRef(null),j=U.useCallback(F=>{w.current=F,typeof r=="function"?r(F):r&&(r.current=F)},[r]),[k,N]=U.useState(!1),{margin:P,cells:T,numCells:I,calculatedImageSettings:H}=Q2({value:s,level:o,minVersion:u,boostLevel:h,includeMargin:d,marginSize:p,imageSettings:m,size:a});U.useEffect(()=>{if(w.current!=null){const F=w.current,Y=F.getContext("2d");if(!Y)return;let Q=T;const S=_.current,z=H!=null&&S!==null&&S.complete&&S.naturalHeight!==0&&S.naturalWidth!==0;z&&H.excavation!=null&&(Q=G2(T,H.excavation));const C=window.devicePixelRatio||1;F.height=F.width=a*C;const B=a/I*C;Y.scale(B,B),Y.fillStyle=l,Y.fillRect(0,0,I,I),Y.fillStyle=c,MV?Y.fill(new Path2D(Z2(Q,P))):T.forEach(function(ce,A){ce.forEach(function(ee,te){ee&&Y.fillRect(te+P,A+P,1,1)})}),H&&(Y.globalAlpha=H.opacity),z&&Y.drawImage(S,H.x+P,H.y+P,H.w,H.h)}}),U.useEffect(()=>{N(!1)},[v]);const M=Xg({height:a,width:a},x);let L=null;return v!=null&&(L=U.createElement("img",{src:v,key:v,style:{display:"none"},onLoad:()=>{N(!0)},ref:_,crossOrigin:H==null?void 0:H.crossOrigin})),U.createElement(U.Fragment,null,U.createElement("canvas",Xg({style:M,height:a,width:a,ref:j,role:"img"},b)),L)});FV.displayName="QRCodeCanvas";var bw=U.forwardRef(function(t,r){const n=t,{value:s,size:a=B2,level:o=W2,bgColor:l=V2,fgColor:c=q2,includeMargin:d=H2,minVersion:u=K2,boostLevel:h,title:p,marginSize:m,imageSettings:y}=n,g=ey(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:x,cells:b,numCells:v,calculatedImageSettings:w}=Q2({value:s,level:o,minVersion:u,boostLevel:h,includeMargin:d,marginSize:m,imageSettings:y,size:a});let _=b,j=null;y!=null&&w!=null&&(w.excavation!=null&&(_=G2(b,w.excavation)),j=U.createElement("image",{href:y.src,height:w.h,width:w.w,x:w.x+x,y:w.y+x,preserveAspectRatio:"none",opacity:w.opacity,crossOrigin:w.crossOrigin}));const k=Z2(_,x);return U.createElement("svg",Xg({height:a,width:a,viewBox:`0 0 ${v} ${v}`,ref:r,role:"img"},g),!!p&&U.createElement("title",null,p),U.createElement("path",{fill:l,d:`M0,0 h${v}v${v}H0z`,shapeRendering:"crispEdges"}),U.createElement("path",{fill:c,d:k,shapeRendering:"crispEdges"}),j)});bw.displayName="QRCodeSVG";const fo={free:10,solo:200};function $V(){var yt;const e=Zt(),{user:t}=qr(),{toast:r}=Ar(),n=Dr(),{addOperation:s}=Ss(),{data:a,loading:o,isCached:l,isOffline:c,lastSynced:d,refresh:u}=k6(t==null?void 0:t.id),{data:h}=aw(t==null?void 0:t.id),[p,m]=f.useState([]),[y,g]=f.useState([]),[x,b]=f.useState(!0),[v,w]=f.useState(""),[_,j]=f.useState(!1),[k,N]=f.useState(!1),[P,T]=f.useState(null),[I,H]=f.useState(!1),[M,L]=f.useState(null),[F,Y]=f.useState(!1),[Q,S]=f.useState(!1),[z,C]=f.useState(null),[B,ce]=f.useState(!1),[A,ee]=f.useState(!1),[te,q]=f.useState(null),[he,Z]=f.useState(""),[me,ge]=f.useState(""),[Ne,Ce]=f.useState(""),[Oe,Xe]=f.useState(""),[oe,Ve]=f.useState(""),[Ue,re]=f.useState(""),[De,Te]=f.useState(""),[E,O]=f.useState(""),[V,D]=f.useState(""),[K,R]=f.useState(""),[W,se]=f.useState("generate"),[ye,ze]=f.useState(""),et=$=>{D($),!he&&($||K)&&Z(`${$} ${K}`.trim())},at=$=>{R($),!he&&(V||$)&&Z(`${V} ${$}`.trim())};f.useEffect(()=>{t&&(He(),ct(),Nt())},[t]),f.useEffect(()=>{a.length>0&&!x&&m(a)},[a]),f.useEffect(()=>{h.length>0&&g(h.map($=>({id:$.id,name:$.name})))},[h]);const Nt=async()=>
700{if(!t)return;const{data:$}=await ne.from("profiles").select("subscription_plan").eq("id",t.id).maybeSingle();$&&L($)},He=async()=>{try{if(!n){b(o);return}const{data:$,error:ae}=await ne.from("devices").select(`
701          *,
702          clients (
703            id,
704            name,
705            address
706          )
707        `).eq("installer_id",t==null?void 0:t.id).eq("is_active",!0).order("created_at",{ascending:!1});if(ae)throw ae;m($||[])}catch($){console.error("Error fetching devices:",$),a.length>0&&(m(a),xs.info("Wyświetlam dane z cache"))}finally{b(!1)}},ct=async()=>{try{if(!n)return;const{data:$,error:ae}=await ne.from("clients").select("id, name").eq("installer_id",t==null?void 0:t.id).eq("is_active",!0).order("name");if(ae)throw ae;g($||[])}catch($){console.error("Error fetching clients:",$)}},Rt=async $=>{if($.preventDefault(),!t||!Oe||!E){E||r({variant:"destructive",title:"Brak kategorii",description:"Wybierz kategorię urządzenia"});return}H(!0);const ae={installer_id:t.id,client_id:Oe,name:he,serial_number:me||null,install_date:Ne||null,location:oe||null,warranty_end:Ue||null,notes:De||null,category:E||null,manufacturer:V||null,model:K||null,is_active:!0};try{if(!n){const le=crypto.randomUUID(),Re=`TEMP${le.slice(0,4).toUpperCase()}`,Be={...ae,id:le,qr_code_uuid:crypto.randomUUID(),short_id:Re,created_at:new Date().toISOString(),clients:y.find(Ye=>Ye.id===Oe)?{id:Oe,name:y.find(Ye=>Ye.id===Oe).name,address:""}:null,_pendingSync:!0};await s("create","devices",{...ae,id:le,short_id:Re}),await ve.saveData("devices",Be),m(Ye=>[Be,...Ye]),xs.info("Urządzenie zostanie dodane po powrocie online"),j(!1),mt(),H(!1);return}if(W==="physical"&&ye){const le=ye.toUpperCase().trim();if(!le.startsWith("X")||le.length!==7){r({variant:"destructive",title:"Nieprawidłowy format",description:"Kod musi zaczynać się od 'X' i mieć dokładnie 7 znaków (np. XA1B2C3)"}),H(!1);return}const{data:Re}=await ne.from("devices").select("id").eq("short_id",le).eq("is_active",!0).maybeSingle();if(Re){r({variant:"destructive",title:"Błąd",description:"Urządzenie z tym ID QR już istnieje"}),H(!1);return}const{error:Be}=await ne.from("devices").insert({...ae,short_id:le});if(Be)throw Be}else{const{error:le}=await ne.from("devices").insert(ae);if(le)throw le}r({title:"Urządzenie dodane",description:"Nowe urządzenie zostało dodane"}),j(!1),mt(),He()}catch(le){console.error("Error adding device:",le),r({variant:"destructive",title:"Błąd",description:"Nie udało się dodać urządzenia"})}finally{H(!1)}},dt=async()=>{if(z){ce(!0);try{if(!n){await s("update","devices",{id:z.id,is_active:!1}),m(le=>le.filter(Re=>Re.id!==z.id)),await ve.deleteData("devices",z.id),xs.info("Urządzenie zostanie usunięte po powrocie online"),S(!1),C(null),ce(!1);return}const{data:$}=await ne.from("tickets").select("id").eq("device_id",z.id).not("status","in",'("zakonczone","anulowane")').limit(1);if($&&$.length>0){r({variant:"destructive",title:"Błąd",description:"Nie można usunąć urządzenia z aktywnymi zgłoszeniami"}),ce(!1);return}const{error:ae}=await ne.from("devices").update({is_active:!1}).eq("id",z.id);if(ae)throw ae;r({title:"Urządzenie usunięte",description:"Kod QR tego urządzenia został dezaktywowany"}),S(!1),C(null),He()}catch($){console.error("Error deleting device:",$),r({variant:"destructive",title:"Błąd",description:"Nie udało się usunąć urządzenia"})}finally{ce(!1)}}},mt=()=>{Z(""),ge(""),Ce(""),Xe(""),Ve(""),re(""),Te(""),O(""),D(""),R(""),se("generate"),ze("")},Ft=$=>`${window.location.origin}/urzadzenie/${$}`,$t=()=>{if(!P)return;const $=window.open("","_blank");if($){const ae=Ft(P.qr_code_uuid);$.document.write(`
708        <!DOCTYPE html>
709        <html>
710        <head>
711          <title>QR - ${P.short_id}</title>
712          <style>
713            @page { 
714              size: 50mm 50mm; 
715              margin: 0; 
716            }
717            * { 
718              margin: 0; 
719              padding: 0; 
720              box-sizing: border-box; 
721            }
722            body { 
723              font-family: Arial, sans-serif; 
724              display: flex; 
725              flex-direction: column; 
726              align-items: center; 
727              justify-content: center; 
728              width: 50mm;
729              height: 50mm;
730              padding: 2mm;
731            }
732            .qr-label {
733              display: flex;
734              flex-direction: column;
735              align-items: center;
736              justify-content: center;
737              text-align: center;
738              width: 100%;
739              height: 100%;
740              border: 1px solid #ccc;
741              border-radius: 3mm;
742              padding: 2mm;
743            }
744            .qr-code { 
745              width: 32mm; 
746              height: 32mm; 
747            }
748            .short-id { 
749              font-size: 14pt; 
750              font-weight: bold; 
751              font-family: monospace;
752              letter-spacing: 2px;
753              margin-top: 0mm;
754            }
755            .scan-text { 
756              font-size: 6pt; 
757              color: #666; 
758              margin-top: 1mm;
759            }
760          </style>
761        </head>
762        <body>
763          <div class="qr-label">
764            <img class="qr-code" src="https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(ae)}" alt="QR" />
765            <div class="short-id">${P.short_id}</div>
766            <div class="scan-text">Zeskanuj, aby zgłosić awarię lub przegląd.<br>Problem z odczytem? Odwiedź: qrserwis.pl</div>
767          </div>
768          <script>
769            window.onload = function() { 
770              setTimeout(function() { window.print(); }, 500);
771            }
772          <\/script>
773        </body>
774        </html>
775      `),$.document.close()}},Lt=async()=>{b(!0),await u(),await He()},_r=p.filter($=>{var ae,le,Re;return $.name.toLowerCase().includes(v.toLowerCase())||((ae=$.clients)==null?void 0:ae.name.toLowerCase().includes(v.toLowerCase()))||((le=$.serial_number)==null?void 0:le.toLowerCase().includes(v.toLowerCase()))||((Re=$.short_id)==null?void 0:Re.toLowerCase().includes(v.toLowerCase()))});return i.jsx(sr,{title:"Urządzenia",children:i.jsxs("div",{className:"space-y-6 animate-fade-in",children:[i.jsx(Xn,{isCached:l,isOffline:c,lastSynced:d,onRefresh:Lt,isRefreshing:x}),i.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[i.jsxs("div",{className:"relative flex-1 max-w-sm",children:[i.jsx(ud,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}
775),i.jsx(Pe,{placeholder:"Szukaj urządzeń...",value:v,onChange:$=>w($.target.value),className:"pl-10"})]}),i.jsx(or,{open:F,onOpenChange:Y,children:i.jsxs(er,{className:"max-w-md",children:[i.jsx(tr,{children:i.jsxs(rr,{className:"flex items-center gap-2 text-destructive",children:[i.jsx(an,{className:"h-5 w-5"}),"Osiągnięto limit urządzeń"]})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("p",{className:"text-muted-foreground",children:["Osiągnięto limit ",fo.free," urządzeń w planie darmowym. Przejdź na plan Solo, aby dodać więcej urządzeń (do ",fo.solo,")."]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx(G,{variant:"outline",onClick:()=>Y(!1),className:"flex-1",children:"Zamknij"}),i.jsx(G,{onClick:()=>e("/account"),className:"flex-1",children:"Przejdź do konta"})]})]})]})}),i.jsxs(or,{open:_,onOpenChange:$=>{j($),$||mt()},children:[i.jsx(zi,{asChild:!0,children:i.jsxs(G,{disabled:y.length===0,onClick:$=>{const le=((M==null?void 0:M.subscription_plan)||"free")==="solo"?fo.solo:fo.free;p.length>=le&&($.preventDefault(),Y(!0))},children:[i.jsx(Lo,{className:"mr-2 h-4 w-4"}),"Dodaj urządzenie"]})}),i.jsxs(er,{className:"max-h-[90vh] overflow-y-auto",children:[i.jsx(tr,{children:i.jsx(rr,{children:"Nowe urządzenie"})}),i.jsxs("form",{onSubmit:Rt,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{children:"Klient *"}),i.jsx(dw,{clients:y,value:Oe,onValueChange:Xe,placeholder:"Wyszukaj klienta..."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{children:"Kategoria urządzenia *"}),i.jsxs(Ha,{value:E,onValueChange:O,children:[i.jsx(Ys,{children:i.jsx(Ka,{placeholder:"Wybierz kategorię..."})}),i.jsx(Js,{children:Vf.map($=>i.jsx(Xs,{value:$.value,children:$.label},$.value))})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"manufacturer",children:"Producent"}),i.jsx(Pe,{id:"manufacturer",value:V,onChange:$=>et($.target.value),placeholder:"np. Daikin, Mitsubishi, LG"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"model",children:"Model"}),i.jsx(Pe,{id:"model",value:K,onChange:$=>at($.target.value),placeholder:"np. FTXM35"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"name",children:"Nazwa urządzenia *"}),i.jsx(Pe,{id:"name",value:he,onChange:$=>Z($.target.value),placeholder:"np. Klimatyzator Daikin FTXM35",required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"serial",children:"Numer seryjny"}),i.jsx(Pe,{id:"serial",value:me,onChange:$=>ge($.target.value),placeholder:"np. ABC123456"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"installDate",children:"Data montażu"}),i.jsx(Pe,{id:"installDate",type:"date",value:Ne,onChange:$=>Ce($.target.value)})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"warrantyEnd",children:"Koniec gwarancji"}),i.jsx(Pe,{id:"warrantyEnd",type:"date",value:Ue,onChange:$=>re($.target.value)})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"location",children:"Lokalizacja w budynku"}),i.jsx(Pe,{id:"location",value:oe,onChange:$=>Ve($.target.value),placeholder:"np. Salon, Dach, Biuro 104"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"notes",children:"Dodatkowe informacje techniczne"}),i.jsx("textarea",{id:"notes",value:De,onChange:$=>Te($.target.value),placeholder:"np. potrzebna długa drabina",className:"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
775ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"})]}),n&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{children:"Kod QR"}),i.jsxs(pl,{value:W,onValueChange:$=>se($),children:[i.jsxs(Fi,{className:"grid w-full grid-cols-2",children:[i.jsx(nn,{value:"generate",children:"Generuj QR"}),i.jsx(nn,{value:"physical",children:"Przypisz fizyczny QR"})]}),i.jsx(Kn,{value:"generate",className:"mt-2",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:"Nowy kod QR zostanie wygenerowany automatycznie."})}),i.jsxs(Kn,{value:"physical",className:"mt-2 space-y-2",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Wpisz kod z naklejki QR:"}),i.jsx(Pe,{value:ye,onChange:$=>ze($.target.value.toUpperCase().slice(0,7)),placeholder:"np. XA1B2C3",maxLength:7,className:"font-mono text-center text-lg tracking-widest"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Kod musi zaczynać się od 'X' i mieć 7 znaków (np. XA1B2C3)"})]})]})]}),i.jsx(G,{type:"submit",className:"w-full",disabled:I||!Oe||!E||W==="physical"&&ye.length<3,children:I?"Zapisywanie...":"Dodaj urządzenie"})]})]})]})]}),y.length===0&&!x&&i.jsx(Fe,{children:i.jsxs(Me,{className:"flex h-32 flex-col items-center justify-center text-center p-6",children:[i.jsx(qs,{className:"mb-2 h-8 w-8 text-muted-foreground"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Najpierw dodaj klienta, aby móc dodać urządzenie"}),i.jsx(G,{variant:"link",className:"mt-2",onClick:()=>e("/clients"),children:"Przejdź do klientów"})]})}),(M==null?void 0:M.subscription_plan)==="free"&&p.length>fo.free&&i.jsxs(M2,{variant:"destructive",className:"animate-fade-in",children:[i.jsx(an,{className:"h-4 w-4"}),i.jsx(F2,{children:"Twój plan wygasł"}),i.jsxs($2,{children:["Część urządzeń została dezaktywowana. Odnów subskrypcję, aby przywrócić dostęp do wszystkich urządzeń.",i.jsx(G,{variant:"link",className:"h-auto p-0 ml-2",onClick:()=>e("/account"),children:"Przejdź do konta →"})]})]}),x?i.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"Ładowanie..."}):_r.length===0&&y.length>0?i.jsx(Fe,{children:i.jsxs(Me,{className:"flex h-64 flex-col items-center justify-center text-center",children:[i.jsx(Ii,{className:"mb-4 h-12 w-12 text-muted-foreground"}),i.jsx("h3",{className:"text-lg font-semibold",children:v?"Brak wyników":"Brak urządzeń"}),i.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:v?"Spróbuj innego wyszukiwania":"Dodaj pierwsze urządzenie"})]})}):i.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:_r.map(($,ae)=>{var Re;const le=(M==null?void 0:M.subscription_plan)==="free"&&ae>=fo.free;return i.jsx(Fe,{className:`animate-fade-in transition-colors ${le?"opacity-60 border-dashed bg-muted/50 cursor-not-allowed":"cursor-pointer hover:border-primary/50"}`,style:{animationDelay:`${ae*30}ms`},onClick:()=>!le&&e(`/devices/${$.id}`),children:i.jsxs(Me,{className:"p-5",children:[le&&i.jsxs(Ge,{variant:"secondary",className:"mb-2 gap-1",children:[i.jsx(i1,{className:"h-3 w-3"}),"Nieaktywne (Limit planu)"]}),$._pendingSync&&i.jsx(Fl,{className:"mb-2"}),i.jsx("h3",{className:`font-semibold text-lg leading-tight break-words mb-1 ${le?"text-muted-foreground":""}`,children:$.name}),$.category&&i.jsx(Ge,{variant:"outline",className:"text-xs mb-2",children:qf($.category)}),i.jsxs("div",{className:"flex items-center justify-between gap-2 text-sm mb-2",children:[i.jsxs("p",{className:"font-mono text-xs bg-muted px-2 py-1 rounded",children:["ID: ",$.short_id]}),i.jsxs("button",{onClick:Be=>{var Ye;Be.stopPropagation(),e(`/clients/${(Ye=$.clients)==null?void 0:Ye.id}`)},className:"text-primary hover:underline flex items-center gap-1 text-right",children:[i.jsx(qs,{className:"h-3 w-3 shrink-0"}),i.jsx("span",{className:"truncate max-w-[150px]",children:(Re=$.clients)==null?void 0:Re.name})]})]}),i.jsxs("div",{className:"space-y-1 text-sm",children:[$.location&&i.jsx("p",{className:"text-muted-foreground",children:$.location}),$.serial_number&&i.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:$.serial_number})]})]})},$.id)})}),i.jsx(or,{open:k,onOpenChange:N,children:i.jsxs(er,{className:"max-w-sm",children:[i.jsx(tr,{children:i.jsx(rr,{className:"text-center",children:"Kod QR urządzenia"})}),P&&i.jsxs("div",{className:"flex flex-col items-center space-y-4 py-4",children:[i.jsx("div",{className:"rounded-lg bg-card p-4 border border-border",children:i.jsx(bw,{value:Ft(P.qr_code_uuid),size:200,level:"H"})}),i.jsxs("div",{className:"text-center",children:[i.jsx("p",{className:"font-semibold truncate max-w-[250px]",children:P.name}),i.jsx("p",{className:"text-sm text-muted-foreground",children:(yt=P.clients)==null?void 0:yt.name}),i.jsx("p",{className:"font-mono text-lg mt-2 bg-muted px-3 py-1 rounded",children:P.short_id})]}),i.jsxs("div",{className:"flex gap-2 w-full",children:[i.jsxs(G,{variant:"outline",className:"flex-1",onClick:$t,children:[i.jsx(c1,{className:"mr-2 h-4 w-4"}
775),"Drukuj QR"]}),i.jsxs(G,{variant:"outline",className:"flex-1",onClick:()=>window.open(Ft(P.qr_code_uuid),"_blank"),children:[i.jsx(Fc,{className:"mr-2 h-4 w-4"}),"Podgląd"]})]})]})]})}),i.jsx(I2,{device:te,clients:y,open:A,onOpenChange:ee,onSuccess:He}),i.jsx(Wf,{open:Q,onOpenChange:S,title:"Usuń urządzenie",description:`Czy na pewno chcesz usunąć urządzenie "${z==null?void 0:z.name}"? Kod QR zostanie dezaktywowany.`,confirmText:B?"Usuwanie...":"Usuń",onConfirm:dt,variant:"destructive"})]})})}const LV={nowe:"Nowe",w_toku:"W realizacji",oczekuje_na_czesci:"Oczekuje na części",zakonczone:"Zakończone",anulowane:"Anulowane"};function UV(){var Y,Q,S,z;const{id:e}=Xi(),t=Zt(),{user:r}=qr(),{toast:n}=Ar(),s=Dr(),[a,o]=f.useState(null),[l,c]=f.useState([]),[d,u]=f.useState(!0),[h,p]=f.useState(!1),[m,y]=f.useState(!1),[g,x]=f.useState([]),[b,v]=f.useState(!0),[w,_]=f.useState(!1),[j,k]=f.useState(!1),[N,P]=f.useState(!1);f.useEffect(()=>{r&&e&&(T(),I(),H())},[r,e]);const T=async()=>{if(!s)try{const C=await ve.getData("devices",e);if(C){o(C),y(!0),u(!1);return}}catch(C){console.error("Error loading cached device:",C)}try{const{data:C,error:B}=await ne.from("devices").select(`
776          *,
777          clients (
778            id,
779            name,
780            address
781          )
782        `).eq("id",e).eq("installer_id",r==null?void 0:r.id).eq("is_active",!0).single();if(B)throw B;o(C),y(!1),await ve.saveData("devices",C)}catch(C){console.error("Error fetching device:",C);try{const B=await ve.getData("devices",e);B?(o(B),y(!0)):t("/devices")}catch{t("/devices")}}finally{u(!1)}},I=async()=>{if(!s){try{const C=await ve.getAllData("clients");c(C.map(B=>({id:B.id,name:B.name})))}catch(C){console.error("Error loading cached clients:",C)}return}try{const{data:C,error:B}=await ne.from("clients").select("id, name").eq("installer_id",r==null?void 0:r.id).eq("is_active",!0).order("name");if(B)throw B;c(C||[])}catch(C){console.error("Error fetching clients:",C)}},H=async()=>{if(!s){try{const B=(await ve.getAllData("tickets")).filter(ce=>ce.device_id===e);x(B)}catch(C){console.error("Error loading cached tickets:",C)}v(!1);return}try{const{data:C,error:B}=await ne.from("tickets").select("id, description, status, priority, scheduled_date, created_at, is_critical").eq("device_id",e).eq("installer_id",r==null?void 0:r.id).order("created_at",{ascending:!1});if(B)throw B;x(C||[])}catch(C){console.error("Error fetching device tickets:",C)}finally{v(!1)}},M=async()=>{if(a){if(!s){n({variant:"destructive",title:"Brak połączenia",description:"Ta operacja wymaga połączenia z internetem"});return}k(!0);try{const{data:C}=await ne.from("tickets").select("id").eq("device_id",a.id).not("status","in",'("zakonczone","anulowane")').limit(1);if(C&&C.length>0){n({variant:"destructive",title:"Błąd",description:"Nie można usunąć urządzenia z aktywnymi zgłoszeniami"}),k(!1);return}const{error:B}=await ne.from("devices").update({is_active:!1}).eq("id",a.id);if(B)throw B;n({title:"Urządzenie usunięte",description:"Kod QR tego urządzenia został dezaktywowany"}),t("/devices")}catch(C){console.error("Error deleting device:",C),n({variant:"destructive",title:"Błąd",description:"Nie udało się usunąć urządzenia"})}finally{k(!1)}}},L=C=>`${window.location.origin}/urzadzenie/${C}`,F=()=>{if(!a)return;const C=window.open("","_blank");if(C){const B=L(a.qr_code_uuid);C.document.write(`
783        <!DOCTYPE html>
784        <html>
785        <head>
786          <title>QR - ${a.short_id}</title>
787          <style>
788            @page { 
789              size: 50mm 50mm; 
790              margin: 0; 
791            }
792            * { 
793              margin: 0; 
794              padding: 0; 
795              box-sizing: border-box; 
796            }
797            body { 
798              font-family: Arial, sans-serif; 
799              display: flex; 
800              flex-direction: column; 
801              align-items: center; 
802              justify-content: center; 
803              width: 50mm;
804              height: 50mm;
805              padding: 2mm;
806            }
807            .qr-label {
808              display: flex;
809              flex-direction: column;
810              align-items: center;
811              justify-content: center;
812              text-align: center;
813              width: 100%;
814              height: 100%;
815              border: 1px solid #ccc;
816              border-radius: 3mm;
817              padding: 2mm;
818            }
819            .qr-code { 
820              width: 32mm; 
821              height: 32mm; 
822            }
823            .short-id { 
824              font-size: 14pt; 
825              font-weight: bold; 
826              font-family: monospace;
827              letter-spacing: 2px;
828              margin-top: 0mm;
829            }
830            .scan-text { 
831              font-size: 6pt; 
832              color: #666; 
833              margin-top: 1mm;
834            }
835          </style>
836        </head>
837        <body>
838          <div class="qr-label">
839            <img class="qr-code" src="https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(B)}" alt="QR" />
840            <div class="short-id">${a.short_id}</div>
841            <div class="scan-text">Zeskanuj, aby zgłosić awarię lub przegląd.<br>Problem z odczytem? Odwiedź: qrserwis.pl</div>
842          </div>
843          <script>
844            window.onload = function() { 
845              setTimeout(function() { window.print(); }, 500);
846            }
847          <\/script>
848        </body>
849        </html>
850      `),C.document.close()}};return d?i.jsx(sr,{title:"Urządzenie",children:i.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"Ładowanie..."})}):a?i.jsx(sr,{title:"Szczegóły urządzenia",children:i.jsxs("div",{className:"space-y-6 animate-fade-in",children:[m&&i.jsx(Xn,{isCached:m,isOffline:!s,lastSynced:null,onRefresh:T}),!s&&!m&&i.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-warning/10 border border-warning/20 text-warning-foreground",children:[i.jsx(Hs,{className:"h-4 w-4"}),i.jsx("span",{className:"text-sm",children:"Tryb offline - niektóre operacje są niedostępne"})]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(G,{variant:"ghost",size:"icon",onClick:()=>t(-1),children:i.jsx(ws,{className:"h-5 w-5"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h1",{className:"text-2xl font-bold",children:a.name}),i.jsxs("button",{onClick:()=>{var C;return t(`/clients/${(C=a.clients)==null?void 0:C.id}`)},className:"text-sm text-primary hover:underline flex items-center gap-1 mt-1",children:[i.jsx(qs,{className:"h-3 w-3"}),(Y=a.clients)==null?void 0:Y.name]})]})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[a._pendingSync&&i.jsx(Fl,{}),i.jsxs(G,{variant:"outline",onClick:()=>p(!0),children:[i.jsx(Er,{className:"mr-2 h-4 w-4"}),"Pokaż QR"]}),i.jsxs(G,{variant:"outline",onClick:()=>
850P(!0),children:[i.jsx($c,{className:"mr-2 h-4 w-4"}),"Edytuj"]}),i.jsxs(G,{variant:"outline",onClick:()=>_(!0),className:"text-destructive hover:text-destructive hover:bg-destructive/10",disabled:!s,children:[i.jsx(rf,{className:"mr-2 h-4 w-4"}),"Usuń"]})]}),i.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[i.jsxs(Fe,{children:[i.jsx(lt,{children:i.jsxs(ut,{className:"text-lg flex items-center gap-2",children:[i.jsx(Ii,{className:"h-5 w-5"}),"Informacje podstawowe"]})}),i.jsxs(Me,{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(AO,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"ID:"}),i.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded text-sm",children:a.short_id})]}),a.category&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(HO,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Kategoria:"}),i.jsx(Ge,{variant:"outline",children:qf(a.category)})]}),a.manufacturer&&i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(RO,{className:"h-4 w-4 text-muted-foreground mt-0.5"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Producent:"}),i.jsx("span",{className:"text-sm",children:a.manufacturer})]}),a.model&&i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(Ii,{className:"h-4 w-4 text-muted-foreground mt-0.5"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Model:"}),i.jsx("span",{className:"text-sm",children:a.model})]}),a.serial_number&&i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(mn,{className:"h-4 w-4 text-muted-foreground mt-0.5"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Numer seryjny:"}),i.jsx("span",{className:"font-mono text-sm",children:a.serial_number})]}),a.location&&i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(Nl,{className:"h-4 w-4 text-muted-foreground mt-0.5"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Lokalizacja:"}),i.jsx("span",{className:"text-sm",children:a.location})]})]})]}),i.jsxs(Fe,{children:[i.jsx(lt,{children:i.jsxs(ut,{className:"text-lg flex items-center gap-2",children:[i.jsx(Mc,{className:"h-5 w-5"}),"Daty"]})}),i.jsxs(Me,{className:"space-y-3",children:[a.install_date&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm text-muted-foreground",children:"Data montażu:"}),i.jsx("span",{className:"text-sm",children:xt(new Date(a.install_date),"d MMMM yyyy",{locale:nr})})]}),a.warranty_end&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(tf,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:"Koniec gwarancji:"}),i.jsx("span",{className:"text-sm",children:xt(new Date(a.warranty_end),"d MMMM yyyy",{locale:nr})})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm text-muted-foreground",children:"Dodano:"}),i.jsx("span",{className:"text-sm",children:xt(new Date(a.created_at),"d MMMM yyyy",{locale:nr})})]})]})]}),i.jsxs(Fe,{children:[i.jsx(lt,{children:i.jsxs(ut,{className:"text-lg flex items-center gap-2",children:[i.jsx(qs,{className:"h-5 w-5"}),"Klient"]})}),i.jsxs(Me,{className:"space-y-2",children:[i.jsx("p",{className:"font-medium",children:(Q=a.clients)==null?void 0:Q.name}),i.jsx("p",{className:"text-sm text-muted-foreground",children:(S=a.clients)==null?void 0:S.address})]})]}),a.notes&&i.jsxs(Fe,{children:[i.jsx(lt,{children:i.jsxs(ut,{className:"text-lg flex items-center gap-2",children:[i.jsx(mn,{className:"h-5 w-5"}),"Dodatkowe informacje"]})}),i.jsx(Me,{children:i.jsx("p",{className:"text-sm whitespace-pre-wrap",children:a.notes})})]}),i.jsxs(Fe,{className:"md:col-span-2",children:[i.jsx(lt,{children:i.jsxs(ut,{className:"text-lg flex items-center gap-2",children:[i.jsx(ll,{className:"h-5 w-5"}),"Zgłoszenia (",g.length,")"]})}),i.jsx(Me,{children:b?i.jsx("div",{className:"text-center py-4 text-muted-foreground",children:"Ładowanie zgłoszeń..."}):g.length===0?i.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[i.jsx(ll,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),i.jsx("p",{children:"Brak zgłoszeń dla tego urządzenia"})]}):i.jsx("div",{className:"space-y-2",children:g.map(C=>i.jsx("button",{onClick:()=>t(`/tickets/${C.id}`),className:"w-full p-3 rounded-lg border text-left hover:bg-muted/50 transition-colors",children:i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"font-medium truncate",children:C.description||"Brak opisu"}),i.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1 mt-1",children:[i.jsx(Mc,{className:"h-3 w-3"}),xt(new Date(C.created_at),"d MMMM yyyy",{locale:nr})]})]}),i.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[C.is_critical&&i.jsx(an,{className:"h-4 w-4 text-destructive"}),i.jsx(Ge,{variant:C.status==="nowe"?"default":C.status==="zakonczone"?"secondary":"outline",children:LV[C.status]||C.status})]})]})},C.id))})})]})]}),i.jsx(or,{open:h,onOpenChange:p,children:i.jsxs(er,{className:"max-w-sm",children:[i.jsx(tr,{children:i.jsx(rr,{className:"text-center",children:"Kod QR urządzenia"})}),i.jsxs("div",{className:"flex flex-col items-center space-y-4 py-4",children:[i.jsx("div",{className:"rounded-lg bg-card p-4 border border-border",children:i.jsx(bw,{value:L(a.qr_code_uuid),size:200,level:"H"})}),i.jsxs("div",{className:"text-center",children:[i.jsx("p",{className:"font-semibold truncate max-w-[250px]",children:a.name}),i.jsx("p",{className:"text-sm text-muted-foreground",children:(z=a.clients)==null?void 0:z.name}),i.jsx("p",{className:"font-mono text-lg mt-2 bg-muted px-3 py-1 rounded",children:a.short_id})]}),i.jsxs("div",{className:"flex gap-2 w-full",children:[i.jsxs(G,{variant:"outline",className:"flex-1",onClick:F,children:[i.jsx(c1,{className:"mr-2 h-4 w-4"}
850),"Drukuj QR"]}),i.jsxs(G,{variant:"outline",className:"flex-1",onClick:()=>window.open(L(a.qr_code_uuid),"_blank"),children:[i.jsx(Fc,{className:"mr-2 h-4 w-4"}),"Podgląd"]})]})]})]})}),i.jsx(I2,{device:a,clients:l,open:N,onOpenChange:P,onSuccess:T}),i.jsx(Wf,{open:w,onOpenChange:_,title:"Usuń urządzenie",description:`Czy na pewno chcesz usunąć urządzenie "${a.name}"? Kod QR zostanie dezaktywowany.`,confirmText:j?"Usuwanie...":"Usuń",onConfirm:M,variant:"destructive"})]})}):i.jsx(sr,{title:"Urządzenie",children:i.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"Nie znaleziono urządzenia"})})}const Q0={nowe:"Nowe",w_toku:"W realizacji",oczekuje_na_czesci:"Oczekuje na części",zakonczone:"Zakończone",anulowane:"Anulowane"};function BV(){var Ue;const{qrUuid:e}=Xi(),{toast:t}=Ar(),[r,n]=f.useState(null),[s,a]=f.useState([]),[o,l]=f.useState(!0),[c,d]=f.useState(!1),[u,h]=f.useState(!1),[p,m]=f.useState(!1),[y,g]=f.useState(!1),[x,b]=f.useState(!1),[v,w]=f.useState(""),[_,j]=f.useState(""),[k,N]=f.useState(""),[P,T]=f.useState(""),[I,H]=f.useState(!1),[M,L]=f.useState([]),[F,Y]=f.useState([]),[Q,S]=f.useState(""),[z,C]=f.useState(!1),B=_.trim().length>0,ce=s.some(re=>!["zakonczone","anulowane"].includes(re.status)),A=s.find(re=>re.status==="nowe");f.useEffect(()=>{e&&ee()},[e]);const ee=async()=>{try{const{data:re,error:De}=await ne.rpc("get_public_device_by_uuid",{qr_uuid:e}),Te=re;if(De||!Te){d(!0);return}if(!Te.is_active){d(!0);return}const E={name:Te.device_name,serial_number:Te.serial_number,category:Te.category,qr_code_uuid:Te.qr_code_uuid,is_active:Te.is_active};n(E);const{data:O}=await ne.rpc("get_public_ticket_history",{device_qr_uuid:e});a(O||[]),l(!1)}catch(re){console.error("Error fetching device:",re),d(!0),l(!1)}},te=re=>{const De=Array.from(re.target.files||[]),Te=3-M.length,E=De.slice(0,Te);L([...M,...E]),E.forEach(O=>{const V=new FileReader;V.onloadend=()=>{Y(D=>[...D,V.result])},V.readAsDataURL(O)})},q=re=>{L(M.filter((De,Te)=>Te!==re)),Y(F.filter((De,Te)=>Te!==re))},he=async()=>{const re=[];for(const De of M){const Te=De.name.split(".").pop(),E=`${e}/${Date.now()}.${Te}`,{error:O}=await ne.storage.from("ticket-photos").upload(E,De);if(O){console.error("Error uploading photo:",O);continue}const{data:{publicUrl:V}}=ne.storage.from("ticket-photos").getPublicUrl(E);re.push(V)}return re},Z=()=>{w(""),j(""),N(""),T(""),H(!1),L([]),Y([])},[me,ge]=f.useState(0),[Ne,Ce]=f.useState("flexible"),Oe=()=>{j(""),N(""),ge(0),Ce("flexible")},Xe=async()=>{if(!(!r||!v.trim()||!e)){if(B&&!k.trim()){t({variant:"destructive",title:"Błąd",description:"Podaj numer telefonu jeśli podajesz imię i nazwisko"});return}C(!0);try{const re=await he(),{data:De,error:Te}=await ne.rpc("create_public_ticket",{p_device_qr_uuid:e,p_ticket_type:"fault",p_description:v,p_reporter_name:_||null,p_reporter_phone:k||null,p_error_code:P||null,p_is_critical:I,p_photo_urls:re.length>0?re:null}),E=De;if(Te)throw Te;if(!E.success)throw new Error(E.error||"Błąd tworzenia zgłoszenia");E.installer_id&&E.ticket_id&&ne.functions.invoke("send-notification-email",{body:{type:"new_ticket_installer",installerId:E.installer_id,ticketId:E.ticket_id,ticketType:"fault",deviceName:E.device_name,clientName:E.client_name||"Klient",description:v,isCritical:I}}).catch(O=>console.error("Error sending email notification:",O)),t({title:"Zgłoszenie wysłane",description:"Serwisant skontaktuje się z Tobą wkrótce"}),h(!1),Z(),ee()}catch(re){console.error("Error submitting report:",re),t({variant:"destructive",title:"Błąd",description:re instanceof Error?re.message:"Nie udało się wysłać zgłoszenia"})}finally{C(!1)}}},oe=async()=>{if(!(!r||!e)){if(B&&!k.trim()){t({variant:"destructive",title:"Błąd",description:"Podaj numer telefonu jeśli podajesz imię i nazwisko"});return}C(!0);try{const{data:re,error:De}=await ne.rpc("create_public_ticket",{p_device_qr_uuid:e,p_ticket_type:"maintenance",p_description:null,p_reporter_name:_||null,p_reporter_phone:k||null,p_additional_devices_count:me,p_preferred_time_slot:Ne}),Te=re;if(De)throw De;if(!Te.success)throw new Error(Te.error||"Błąd tworzenia zlecenia");const E=me>0?`Zlecenie przeglądu okresowego (+${me} dodatkowych urządzeń)`:"Zlecenie przeglądu okresowego";Te.installer_id&&Te.ticket_id&&ne.functions.invoke("send-notification-email",{body:{type:"new_ticket_installer",installerId:Te.installer_id,ticketId:Te.ticket_id,ticketType:"maintenance",deviceName:Te.device_name,clientName:Te.client_name||"Klient",description:E,isCritical:!1}}).catch(O=>console.error("Error sending email notification:",O)),t({title:"Zlecenie przeglądu wysłane",description:"Serwisant skontaktuje się w celu umówienia terminu"}),m(!1),Oe(),ee()}catch(re){console.error("Error submitting maintenance:",re),t({variant:"destructive",title:"Błąd",description:re instanceof Error?re.message:"Nie udało się wysłać zlecenia"})}finally{C(!1)}}},Ve=async()=>
850{if(!(!A||!r)){C(!0);try{const{error:re}=await ne.from("tickets").update({status:"anulowane",resolution_notes:Q||"Anulowane przez klienta"}).eq("id",A.id);if(re)throw re;t({title:"Zgłoszenie anulowane"}),b(!1),S(""),ee()}catch(re){console.error("Error canceling ticket:",re),t({variant:"destructive",title:"Błąd",description:"Nie udało się anulować zgłoszenia"})}finally{C(!1)}}};return o?i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsxs("div",{className:"text-center",children:[i.jsx(Er,{className:"mx-auto h-12 w-12 animate-pulse text-primary"}),i.jsx("p",{className:"mt-4 text-muted-foreground",children:"Ładowanie..."})]})}):c||!r?i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsx(Fe,{className:"max-w-md w-full",children:i.jsxs(Me,{className:"flex flex-col items-center py-12 text-center",children:[i.jsx(t1,{className:"h-16 w-16 text-destructive mb-4"}),i.jsx("h1",{className:"text-xl font-bold",children:"Nieprawidłowy kod QR"}),i.jsx("p",{className:"mt-2 text-muted-foreground mb-4",children:"To urządzenie nie zostało znalezione w systemie."}),i.jsx(G,{asChild:!0,variant:"outline",children:i.jsx(ks,{to:"/id",children:"Wprowadź ID ręcznie"})})]})})}):i.jsxs("div",{className:"min-h-screen bg-background p-4",children:[i.jsxs("div",{className:"mx-auto max-w-md space-y-4",children:[i.jsx(Fe,{className:"gradient-primary text-primary-foreground",children:i.jsxs(Me,{className:"py-6 text-center",children:[i.jsx(Er,{className:"mx-auto h-12 w-12 mb-3"}),i.jsx("h1",{className:"text-2xl font-bold",children:r.name}),r.category&&i.jsx(Ge,{variant:"secondary",className:"mt-2",children:qf(r.category)}),r.serial_number&&i.jsxs("p",{className:"mt-2 text-xs text-primary-foreground/60 font-mono",children:["S/N: ",r.serial_number]})]})}),ce&&i.jsx(Fe,{className:"border-warning bg-warning/5",children:i.jsx(Me,{className:"py-4",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Ua,{className:"h-5 w-5 text-warning shrink-0"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"font-medium text-sm",children:"Masz aktywne zgłoszenie"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Status: ",Q0[((Ue=s.find(re=>!["zakonczone","anulowane"].includes(re.status)))==null?void 0:Ue.status)||"nowe"]]})]}),A&&i.jsx(G,{variant:"outline",size:"sm",onClick:()=>b(!0),children:"Anuluj"})]})})}),i.jsxs("div",{className:"grid gap-3",children:[i.jsxs(or,{open:u,onOpenChange:h,children:[i.jsx(zi,{asChild:!0,children:i.jsxs(G,{variant:"default",size:"xl",className:"w-full hover:scale-[1.02] transition-transform",disabled:ce,children:[i.jsx(an,{className:"mr-2 h-5 w-5"}),"Zgłoś awarię"]})}),i.jsxs(er,{className:"max-h-[90vh] overflow-y-auto",children:[i.jsxs(tr,{children:[i.jsx(rr,{children:"Zgłoś awarię"}),i.jsx(Vn,{children:"Opisz problem, a serwisant skontaktuje się z Tobą"})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"desc",children:"Opis problemu *"}),i.jsx(Zn,{id:"desc",value:v,onChange:re=>w(re.target.value),placeholder:"Opisz co się dzieje, np. urządzenie nie chłodzi, głośna praca wentylatora, wyciek wody, nie reaguje na pilota...",rows:4})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"errorCode",children:"Kod błędu (jeśli widoczny)"}),i.jsx(Pe,{id:"errorCode",value:P,onChange:re=>T(re.target.value),placeholder:"np. H62, E4, F1"})]}),i.jsxs("div",{className:"flex items-center space-x-3 p-3 rounded-lg border bg-muted/30",children:[i.jsx("input",{type:"checkbox",id:"isCritical",checked:I,onChange:re=>H(re.target.checked),className:"h-5 w-5 rounded border-input text-primary focus:ring-primary"}),i.jsxs("div",{className:"flex-1",children:[i.jsx(ue,{htmlFor:"isCritical",className:"text-sm font-medium cursor-pointer",children:"Awaria krytyczna / Pilne"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"np. wyciek wody, całkowity brak grzania"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"name",children:"Imię i nazwisko zgłaszającego (opcjonalnie)"}
850),i.jsx(Pe,{id:"name",value:_,onChange:re=>j(re.target.value),placeholder:"Jan Kowalski"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(ue,{htmlFor:"phone",children:["Telefon zgłaszającego ",B?i.jsx("span",{className:"text-destructive",children:"*"}):"(opcjonalnie)"]}),i.jsx(Pe,{id:"phone",type:"tel",value:k,onChange:re=>N(re.target.value),placeholder:"+48 123 456 789",className:B&&!k.trim()?"border-destructive":""}),B&&!k.trim()&&i.jsx("p",{className:"text-xs text-destructive",children:"Telefon jest wymagany gdy podajesz imię i nazwisko"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{children:"Zdjęcia (max. 3)"}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[F.map((re,De)=>i.jsxs("div",{className:"relative",children:[i.jsx("img",{src:re,alt:`Zdjęcie ${De+1}`,className:"h-16 w-16 rounded object-cover"}),i.jsx("button",{type:"button",onClick:()=>q(De),className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-destructive text-destructive-foreground",children:i.jsx(Ks,{className:"h-3 w-3"})})]},De)),M.length<3&&i.jsxs("label",{className:"flex h-16 w-16 cursor-pointer items-center justify-center rounded border-2 border-dashed border-border hover:border-primary transition-colors",children:[i.jsx(Xy,{className:"h-5 w-5 text-muted-foreground"}),i.jsx("input",{type:"file",accept:"image/*",multiple:!0,onChange:te,className:"hidden"})]})]})]})]}),i.jsxs(ms,{className:"gap-2 sm:gap-0",children:[i.jsx(G,{variant:"outline",onClick:()=>h(!1),children:"Wróć"}),i.jsx(G,{onClick:Xe,disabled:z||!v.trim(),children:z?"Wysyłanie...":"Wyślij zgłoszenie"})]})]})]}),i.jsxs(or,{open:p,onOpenChange:m,children:[i.jsx(zi,{asChild:!0,children:i.jsxs(G,{variant:"outline",size:"lg",className:"w-full border-2 hover:bg-accent hover:text-accent-foreground transition-colors",disabled:ce,children:[i.jsx(Sl,{className:"mr-2 h-5 w-5"}),"Zamów przegląd"]})}),i.jsxs(er,{className:"max-h-[90vh] overflow-y-auto",children:[i.jsxs(tr,{children:[i.jsx(rr,{children:"Zamów przegląd okresowy"}),i.jsx(Vn,{children:"Wypełnij formularz, a serwisant skontaktuje się w celu umówienia terminu"})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{children:"Czy posiadasz inne urządzenia do przeglądu w tym lokalu?"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(G,{type:"button",variant:"outline",size:"sm",onClick:()=>ge(Math.max(0,me-1)),disabled:me===0,children:"-"}),i.jsx("span",{className:"w-12 text-center font-medium text-lg",children:me}),i.jsx(G,{type:"button",variant:"outline",size:"sm",onClick:()=>ge(me+1),children:"+"})]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Serwisant zarezerwuje więcej czasu na wizytę"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"time-slot",children:"Preferowana pora wizyty"}),i.jsxs("select",{id:"time-slot",value:Ne,onChange:re=>Ce(re.target.value),className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
850ing-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:[i.jsx("option",{value:"flexible",children:"Elastycznie / Obojętnie"}),i.jsx("option",{value:"morning",children:"Rano (8:00 - 12:00)"}),i.jsx("option",{value:"midday",children:"Południe (12:00 - 16:00)"}),i.jsx("option",{value:"afternoon",children:"Popołudnie (po 16:00)"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"maint-name",children:"Imię i nazwisko zgłaszającego (opcjonalnie)"}),i.jsx(Pe,{id:"maint-name",value:_,onChange:re=>j(re.target.value),placeholder:"Jan Kowalski"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(ue,{htmlFor:"maint-phone",children:["Telefon zgłaszającego ",B?i.jsx("span",{className:"text-destructive",children:"*"}):"(opcjonalnie)"]}),i.jsx(Pe,{id:"maint-phone",type:"tel",value:k,onChange:re=>N(re.target.value),placeholder:"+48 123 456 789",className:B&&!k.trim()?"border-destructive":""}),B&&!k.trim()&&i.jsx("p",{className:"text-xs text-destructive",children:"Telefon jest wymagany gdy podajesz imię i nazwisko"})]})]}),i.jsxs(ms,{className:"gap-2 sm:gap-0",children:[i.jsx(G,{variant:"outline",onClick:()=>m(!1),children:"Wróć"}),i.jsx(G,{onClick:oe,disabled:z,children:z?"Wysyłanie...":"Zamów przegląd"})]})]})]}),i.jsxs(or,{open:y,onOpenChange:g,children:[i.jsx(zi,{asChild:!0,children:i.jsxs(G,{variant:"outline",size:"lg",className:"w-full border-2 hover:bg-accent hover:text-accent-foreground transition-colors",children:[i.jsx(DO,{className:"mr-2 h-5 w-5"}),"Historia zgłoszeń"]})}),i.jsxs(er,{className:"max-w-lg",children:[i.jsx(tr,{children:i.jsx(rr,{children:"Historia zgłoszeń"})}),i.jsx("div",{className:"max-h-[60vh] overflow-y-auto py-4",children:s.length===0?i.jsx("p",{className:"text-center text-muted-foreground py-8",children:"Brak historii zgłoszeń"}):i.jsx("div",{className:"space-y-3",children:s.map(re=>i.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(Ge,{variant:re.status,children:Q0[re.status]}),i.jsx("span",{className:"text-xs text-muted-foreground",children:xt(new Date(re.created_at),"d MMM yyyy",{locale:nr})})]}),re.scheduled_date&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:["📅 ",xt(new Date(re.scheduled_date),"PPP 'o' HH:mm",{locale:nr})]}),i.jsxs("p",{className:"text-sm",children:["Typ: ",re.description==="Przegląd"?"Przegląd okresowy":"Zgłoszenie awarii"]}),re.status==="zakonczone"&&re.resolution_notes!=="Protokół sporządzono w wersji papierowej"&&i.jsx(G,{variant:"outline",size:"sm",className:"w-full mt-2",asChild:!0,children:i.jsxs(ks,{to:`/protokol/${re.id}/podglad?source=public`,children:[i.jsx(mn,{className:"mr-2 h-4 w-4"}),"Zobacz protokół"]})})]},re.id))})}),i.jsx(ms,{children:i.jsx(G,{variant:"outline",onClick:()=>g(!1),children:"Wróć"})})]})]})]}),i.jsx("p",{className:"text-center text-xs text-muted-foreground pt-4",children:"System QRserwis • Szybki kontakt z serwisem"})]}),i.jsx(or,{open:x,onOpenChange:b,children:i.jsxs(er,{children:[i.jsxs(tr,{children:[i.jsx(rr,{children:"Anuluj zgłoszenie"}),i.jsx(Vn,{children:"Czy na pewno chcesz anulować to zgłoszenie? Ta operacja nie może być cofnięta."})]}),i.jsx("div",{className:"py-4",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"cancel-reason",children:"Powód anulowania (opcjonalnie)"}),i.jsx(Zn,{id:"cancel-reason",value:Q,onChange:re=>S(re.target.value),placeholder:"np. Problem rozwiązał się sam",rows:3})]})}),i.jsxs(ms,{className:"gap-2 sm:gap-0",children:[i.jsx(G,{variant:"outline",onClick:()=>b(!1),children:"Wróć"}),i.jsx(G,{variant:"destructive",onClick:Ve,disabled:z,children:z?"Anulowanie...":"Anuluj zgłoszenie"})]})]})})]})}function WV(){const[e,t]=f.useState(""),[r,n]=f.useState(!1),s=Zt(),{toast:a}=Ar(),o=async l=>{if(l.preventDefault(),!!e.trim()){n(!0);try{const{data:c,error:d}=await ne.rpc("get_public_device_info",{lookup_code:e.trim()}),u=c;if(d||!u||!u.qr_code_uuid){a({variant:"destructive",title:"Nie znaleziono urządzenia",description:"Sprawdź poprawność wprowadzonego ID"});return}s(`/urzadzenie/${u.qr_code_uuid}`)}catch(c){console.error("Error looking up device:",c),a({variant:"destructive",title:"Błąd",description:"Wystąpił błąd podczas wyszukiwania"})}finally{n(!1)}}};return i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:i.jsxs(Fe,{className:"w-full max-w-md",children:[i.jsxs(lt,{className:"text-center",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-primary/10",children:i.jsx(Er,{className:"h-8 w-8 text-primary"})}),i.jsx(ut,{className:"text-2xl",children:"QRserwis"}),i.jsx(xr,{children:"Nie możesz zeskanować kodu QR? Wprowadź ID urządzenia ręcznie"})]}),i.jsx(Me,{children:i.jsxs("form",{onSubmit:o,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"shortId",children:"ID urządzenia"}),i.jsx(Pe,{id:"shortId",type:"text",placeholder:"np. A1B2C3",value:e,onCh
850ange:l=>t(l.target.value.toUpperCase()),maxLength:6,className:"text-center text-lg font-mono tracking-wider",required:!0}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Kod z naklejki QR"})]}),i.jsxs(G,{type:"submit",className:"w-full",disabled:r,children:[i.jsx(ud,{className:"mr-2 h-4 w-4"}),r?"Wyszukiwanie...":"Wyszukaj urządzenie"]})]})})]})})}function VV(){const{shortId:e}=Xi(),t=Zt(),[r,n]=f.useState(!0),[s,a]=f.useState(!1);f.useEffect(()=>{e&&o()},[e]);const o=async()=>{try{const{data:l,error:c}=await ne.rpc("get_public_device_info",{lookup_code:e.trim()}),d=l;if(c)throw c;d&&d.is_active?t(`/urzadzenie/${d.qr_code_uuid}`,{replace:!0}):(a(!0),n(!1))}catch(l){console.error("Error looking up device:",l),a(!0),n(!1)}};return r&&!s?i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsxs("div",{className:"text-center",children:[i.jsx(Er,{className:"mx-auto h-12 w-12 animate-pulse text-primary"}),i.jsx("p",{className:"mt-4 text-muted-foreground",children:"Wyszukiwanie urządzenia..."})]})}):i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:i.jsx(Fe,{className:"max-w-md w-full",children:i.jsxs(Me,{className:"flex flex-col items-center py-12 text-center",children:[i.jsx(t1,{className:"h-16 w-16 text-destructive mb-4"}),i.jsx("h1",{className:"text-xl font-bold",children:"Urządzenie nieaktywne lub nieprzypisane"}),i.jsxs("p",{className:"mt-2 text-muted-foreground mb-6",children:["Kod ",i.jsx("span",{className:"font-mono font-bold",children:e==null?void 0:e.toUpperCase()})," nie został znaleziony w systemie lub urządzenie zostało dezaktywowane."]}),i.jsx(G,{asChild:!0,variant:"outline",children:i.jsxs(ks,{to:"/id",children:["Wprowadź kod ręcznie",i.jsx(Da,{className:"ml-2 h-4 w-4"})]})})]})})})}const qV=md({newPassword:vn().min(6,"Hasło musi mieć co najmniej 6 znaków"),confirmPassword:vn()}).refine(e=>e.newPassword===e.confirmPassword,{message:"Hasła muszą być identyczne",path:["confirmPassword"]});function HV(){const{user:e}=qr(),{toast:t}=Ar(),[r,n]=f.useState(null),[s,a]=f.useState(0),[o,l]=f.useState(!0),[c,d]=f.useState(!1),[u,h]=f.useState(""),[p,m]=f.useState(""),[y,g]=f.useState(!1),[x,b]=f.useState(!1),[v,w]=f.useState(!1),[_,j]=f.useState(""),[k,N]=f.useState(""),[P,T]=f.useState(null);f.useEffect(()=>{(async()=>{if(e)try{const{data:z,error:C}=await ne.from("profiles").select("*").eq("id",e.id).maybeSingle();if(C)throw C;n(z);const{count:B,error:ce}=await ne.from("devices").select("*",{count:"exact",head:!0}).eq("installer_id",e.id).eq("is_active",!0);if(ce)throw ce;a(B||0)}catch(z){console.error("Error fetching account data:",z)}finally{l(!1)}})()},[e]);const I=S=>{switch(S){case"solo":return"Solo";case"free":default:return"Darmowy"}},H=S=>{switch(S){case"active":return"Aktywna";case"inactive":return"Nieaktywna";case"cancelled":return"Anulowana";case"past_due":return"Zaległa płatność";default:return S}},M=S=>{switch(S){case"active":return"default";case"past_due":return"destructive";case"cancelled":case"inactive":return"secondary";default:return"outline"}},L=S=>{switch(S){case"solo":return 200;case"free":default:return 10}},F=async(S,z)=>{if(e){T(S);try{const{error:C}=await ne.from("profiles").update({[S]:z.trim()||null}).eq("id",e.id);if(C)throw C;n(B=>B?{...B,[S]:z.trim()||null}:null),t({title:"Zapisano",description:"Dane zostały zaktualizowane"}),S==="full_name"&&b(!1),S==="company_name"&&w(!1)}catch(C){console.error("Error saving field:",C),t({variant:"destructive",title:"Błąd",description:"Nie udało się zapisać zmian"})}finally{T(null)}}},Y=async S=>{if(e){d(!0);try{const{error:z}=await ne.from("profiles").update({notify_new_tickets:S}).eq("id",e.id);if(z)throw z;n(C=>C?{...C,notify_new_tickets:S}:null),t({title:S?"Powiadomienia włączone":"Powiadomienia wyłączone",description:S?"Będziesz otrzymywać e-mail przy nowych zgłoszeniach":"Nie będziesz już otrzymywać powiadomień e-mail"})}catch(z){console.error("Error updating notification preference:",z),t({variant:"destructive",title:"Błąd",description:"Nie udało się zaktualizować ustawień powiadomień"})}finally{d(!1)}}},Q=async S=>{S.preventDefault();const z=qV.safeParse({newPassword:u,confirmPassword:p});if(!z.success){t({variant:"destructive",title:"Błąd walidacji",description:z.error.errors[0].message});return}g(!0);try{const{error:C}=await ne.auth.updateUser({password:u});if(C)throw C;
850t({title:"Sukces",description:"Hasło zostało zmienione pomyślnie."}),h(""),m("")}catch(C){console.error("Error changing password:",C),t({variant:"destructive",title:"Błąd",description:C.message||"Nie udało się zmienić hasła"})}finally{g(!1)}};return o?i.jsx(sr,{title:"Moje konto",children:i.jsx("div",{className:"max-w-2xl mx-auto",children:i.jsxs(Fe,{children:[i.jsxs(lt,{children:[i.jsx(hi,{className:"h-6 w-32"}),i.jsx(hi,{className:"h-4 w-48"})]}),i.jsxs(Me,{className:"space-y-4",children:[i.jsx(hi,{className:"h-4 w-full"}),i.jsx(hi,{className:"h-4 w-3/4"}),i.jsx(hi,{className:"h-4 w-1/2"})]})]})})}):i.jsx(sr,{title:"Moje konto",children:i.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[i.jsxs(Fe,{children:[i.jsxs(lt,{children:[i.jsxs(ut,{className:"flex items-center gap-2",children:[i.jsx(qs,{className:"h-5 w-5"}),"Dane użytkownika"]}),i.jsx(xr,{children:"Podstawowe informacje o Twoim koncie"})]}),i.jsxs(Me,{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-sm text-muted-foreground",children:"Email"}),i.jsx("span",{className:"font-medium",children:e==null?void 0:e.email})]}),i.jsx(ir,{}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[i.jsx(qs,{className:"h-4 w-4"}),"Imię i nazwisko"]}),x?i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Pe,{value:_,onChange:S=>j(S.target.value),className:"h-8 w-48",autoFocus:!0,placeholder:"Wpisz imię i nazwisko"}),i.jsx(G,{size:"sm",onClick:()=>F("full_name",_),disabled:P==="full_name",children:P==="full_name"?"...":"Zapisz"}),i.jsx(G,{size:"sm",variant:"ghost",onClick:()=>b(!1),children:"Anuluj"})]}):i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-medium",children:(r==null?void 0:r.full_name)||"-"}),i.jsx(G,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:()=>{j((r==null?void 0:r.full_name)||""),b(!0)},children:i.jsx($c,{className:"h-3 w-3"})})]})]}),i.jsx(ir,{}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[i.jsx(Yk,{className:"h-4 w-4"}),"Nazwa firmy"]}),v?i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Pe,{value:k,onChange:S=>N(S.target.value),className:"h-8 w-48",autoFocus:!0,placeholder:"Wpisz nazwę firmy"}),i.jsx(G,{size:"sm",onClick:()=>F("company_name",k),disabled:P==="company_name",children:P==="company_name"?"...":"Zapisz"}),i.jsx(G,{size:"sm",variant:"ghost",onClick:()=>w(!1),children:"Anuluj"})]}):i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-medium",children:(r==null?void 0:r.company_name)||"-"}),i.jsx(G,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:()=>{N((r==null?void 0:r.company_name)||""),w(!0)},children:i.jsx($c,{className:"h-3 w-3"})})]})]}),i.jsx(ir,{}),(r==null?void 0:r.phone)&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[i.jsx($o,{className:"h-4 w-4"}),"Telefon"]}),i.jsx("span",{className:"font-medium",children:r.phone})]}),i.jsx(ir,{})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-sm text-muted-foreground",children:"Data rejestracji"}),i.jsx("span",{className:"font-medium",children:r!=null&&r.created_at?new Date(r.created_at).toLocaleDateString("pl-PL",{year:"numeric",month:"long",day:"numeric"}):"-"})]})]})]}),i.jsxs(Fe,{children:[i.jsxs(lt,{children:[i.jsxs(ut,{className:"flex items-center gap-2",children:[i.jsx(TO,{className:"h-5 w-5"}),"Subskrypcja"]}),i.jsx(xr,{children:"Szczegóły Twojego planu"})]}),i.jsxs(Me,{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-sm text-muted-foreground",children:"Plan"}),i.jsx(Ge,{variant:"outline",className:"text-base",children:I((r==null?void 0:r.subscription_plan)||"free")})]}),i.jsx(ir,{}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-sm text-muted-foreground",children:"Status"}),i.jsx(Ge,{variant:M((r==null?void 0:r.subscription_status)||"active"),children:H((r==null?void 0:r.subscription_status)||"active")})]}),i.jsx(ir,{}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-sm text-muted-foreground",children:"Pakiet naklejek"}),i.jsx("span",{className:"font-medium",children:r!=null&&r.sticker_pack_claimed?"Odebrany":"Nieodebrany"})]}),i.jsx(ir,{}),i.jsx("div",{className:"pt-2",children:(r==null?void 0:r.subscription_plan)==="solo"?i.jsxs(G,{variant:"outline",className:"w-full",onClick:()=>window.open("https://billing.stripe.com/p/login/7sYfZj76AbyNcDneeO3cc00","_blank"),children:[i.jsx(Fc,{className:"mr-2 h-4 w-4"}),"Zarządzaj subskrypcją / Faktury"]}):i.jsxs(G,{className:"w-full",onClick:()=>window.open(`https://buy.stripe.com/7sYfZj76AbyNcDneeO3cc00?client_reference_id=${e==null?void 0:e.id}`,"_blank"),children:[i.jsx(Fc,{className:"mr-2 h-4 w-4"}),"Ulepsz do planu Solo"]})})]})]}),i.jsxs(Fe,{children:[i.jsxs(lt,{children:[i.jsxs(ut,{className:"flex items-center gap-2",children:[i.jsx(Qk,{className:"h-5 w-5"}),"Powiadomienia"]}),i.jsx(xr,{children:"Ustawienia powiadomień"})]}),i.jsx(Me,{className:"space-y-6",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx($i,{id:"notify_new_tickets",checked:(r==null?void 0:r.notify_new_tickets)||!1,onCheckedChange:Y,disabled:c}),i.jsx(ue,{htmlFor:"notify_new_tickets",className:"text-sm font-medium cursor-pointer",children:"Powiadamiaj o nowych zgłoszeniach przez e-mail"})]}),i.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"Otrzymasz powiadomienie e-mail, gdy klient zgłosi awarię lub zamówi przegląd przez kod QR."})]})})]}),i.jsxs(Fe,{children:[i.jsxs(lt,{children:[i.jsxs(ut,{className:"flex items-center gap-2",children:[i.jsx(tf,{className:"h-5 w-5"}),"Bezpieczeństwo"]}),i.jsx(xr,{children:"Zmień hasło do konta"})]}),i.jsx(Me,{children:i.jsxs("form",{onSubmit:Q,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"new-password",children:"Nowe hasło"}),i.jsx(Pe,{id:"new-password",type:"password",placeholder:"Min. 6 znaków",value:u,onChange:S=>h(S.target.value),required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ue,{htmlFor:"confirm-new-password",children:"Potwierdź nowe hasło"}),i.jsx(Pe,{id:"confirm-new-password",type:"password",placeholder:"Powtórz hasło",value:p,onChange:S=>m(S.target.value),required:!0})]}),i.jsx(G,{type:"submit",disabled:y,children:y?"Zmieniam...":"Zmień hasło"})]})})]}),i.jsxs(Fe,{children:[i.jsxs(lt,{children:[i.jsxs(ut,{className:"flex items-center gap-2",children:[i.jsx(cl,{className:"h-5 w-5"}),"Wykorzystanie"]}),i.jsx(xr,{children:"Statystyki Twojego konta"})]}),i.jsx(Me,{className:"space-y-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-sm text-muted-foreground",children:"Aktywne urządzenia"}),i.jsxs("span",{className:"font-medium",children:[s," / ",L((r==null?void 0:r.subscription_plan)||"free")]})]})})]})]})})}function KV(){return i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(wf,{}),i.jsx("main",{className:"container py-10 pt-24 md:py-14 md:pt-28",children:i.jsxs("article",{className:"legal-document mx-auto max-w-3xl",children:[i.jsxs("header",{className:"mb-10 border-b border-border pb-6 text-center",children:[i.jsx("h1",{className:"text-2xl font-bold uppercase tracking-wide md:text-3xl",children:"Regulamin Serwisu"}),i.jsx("p",{className:"mt-2 text-muted-foreground",children:"QRserwis.pl"})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§1. Postanowienia ogólne"}),i.jsxs("ol",{className:"list-decimal space-y-3 pl-6 text-[15px] leading-relaxed text-foreground
850/90",children:[i.jsx("li",{children:'Niniejszy Regulamin określa zasady korzystania z serwisu internetowego dostępnego pod adresem qrserwis.pl (zwanego dalej „Serwisem" lub „Aplikacją"), świadczonego drogą elektroniczną w modelu SaaS (Software as a Service).'}),i.jsx("li",{children:'Właścicielem i administratorem Serwisu jest: PROCLEVER PATRYK OLEJNICZAK z siedzibą w Jasin, ul. Augusta 8A/2, 62-020, NIP: 7811859458, zwany dalej „Usługodawcą".'}),i.jsxs("li",{children:["Kontakt z Usługodawcą możliwy jest pod adresem e‑mail:"," ",i.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"}),"."]}),i.jsx("li",{children:"Niniejszy Regulamin jest regulaminem, o którym mowa w art. 8 ustawy z dnia 18 lipca 2002 r. o świadczeniu usług drogą elektroniczną."}),i.jsx("li",{children:"Aplikacja dedykowana jest wyłącznie dla przedsiębiorców (B2B). Usługodawca nie świadczy usług na rzecz konsumentów w rozumieniu Kodeksu Cywilnego."})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§2. Definicje"}),i.jsxs("ol",{className:"list-decimal space-y-2 pl-6 text-[15px] leading-relaxed text-foreground/90",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Klient / Serwisant"})," – przedsiębiorca korzystający z Serwisu w celu zarządzania zleceniami HVAC."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Konto"})," – indywidualny panel Klienta w Aplikacji, dostępny po rejestracji i logowaniu."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Plan Abonamentowy"})," – wybrany wariant usługi określający zakres funkcjonalności i limity (Plan Darmowy lub Plan Solo)."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Urządzenie"})," – rekord w bazie danych przypisany do Konta Klienta, identyfikowany unikalnym kodem QR."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Naklejka QR"})," – fizyczna etykieta z kodem, służąca do identyfikacji Urządzenia."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Okres Rozliczeniowy"})," – cykl (zazwyczaj miesięczny), za który pobierana jest opłata abonamentowa."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Operator Płatności"})," – zewnętrzny podmiot obsługujący płatności (Stripe Payments Europe, Ltd.)."]})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§3. Wymagania techniczne"}),i.jsx("p",{className:"mb-3 text-[15px] leading-relaxed text-foreground/90",children:"Do korzystania z Serwisu niezbędne są:"}),i.jsxs("ol",{className:"list-decimal space-y-2 pl-6 text-[15px] leading-relaxed text-foreground/90",children:[i.jsx("li",{children:"urządzenie z dostępem do Internetu (komputer, tablet, smartfon),"}),i.jsx("li",{children:"aktualna przeglądarka internetowa (zalecane: Chrome, Safari, Firefox),"}),i.jsx("li",{children:"włączona obsługa plików Cookies i JavaScript,"}),i.jsx("li",{children:"aktywne konto e‑mail."})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§4. Rodzaje i zakres usług"}),i.jsx("p",{className:"mb-3 text-[15px] leading-relaxed text-foreground/90",children:"Usługodawca udostępnia Aplikację umożliwiającą:"}),i.jsxs("ol",{className:"list-decimal space-y-2 pl-6 text-[15px] leading-relaxed text-foreground/90",children:[i.jsx("li",{children:"zarządzanie zleceniami serwisowymi HVAC,"}),i.jsx("li",{children:"generowanie i drukowanie kodów QR dla urządzeń,"}),i.jsx("li",{children:"przyjmowanie zgłoszeń od klientów końcowych,"}),i.jsx("li",{children:"tworzenie protokołów serwisowych z podpisem elektronicznym."})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§5. Płatności i Subskrypcja"}),i.jsxs("ol",{className:"list-decimal space-y-3 pl-6 text-[15px] leading-relaxed text-foreground/90",children:[i.jsx("li",{children:"Korzystanie z Planu Solo wymaga podpięcia karty płatniczej."}),i.jsx("li",{children:"Opłata wynosi 79 zł netto miesięcznie (plus należny podatek VAT)."}),i.jsx("li",{children:"Uczestnicy w ramach programu pilotażowego mogą skorzystać z kodu zapewniającego 100% zniżki na korzystanie z Planu Solo przez pierwsze 6 miesięcy."}),i.jsx("li",{children:"Płatności obsługiwane są przez Stripe. Usługodawca nie przechowuje danych kart płatniczych Klienta."}),i.jsx("li",{children:"Faktury VAT wystawiane są automatycznie przez system Stripe i przesyłane na adres e‑mail Klienta. Klient wyraża zgodę na otrzymywanie faktur drogą ele
850ktroniczną."}),i.jsx("li",{children:'Subskrypcja odnawia się automatycznie. Klient może zrezygnować z subskrypcji w dowolnym momencie poprzez panel klienta („Zarządzaj subskrypcją").'}),i.jsx("li",{children:'Skutki rezygnacji lub braku płatności: W przypadku wygaśnięcia Planu Solo, Konto zostaje zdegradowane do Planu Darmowego. Urządzenia powyżej limitu 10 sztuk (najnowsze dodane) zostaną dezaktywowane (tryb „tylko do odczytu") do momentu wznowienia płatności.'})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§6. Prawa i obowiązki Stron"}),i.jsxs("ol",{className:"list-decimal space-y-3 pl-6 text-[15px] leading-relaxed text-foreground/90",children:[i.jsx("li",{children:"Klient zobowiązuje się do korzystania z Serwisu zgodnie z prawem i dobrymi obyczajami."}),i.jsx("li",{children:"Zakazane jest dostarczanie treści o charakterze bezprawnym."}),i.jsx("li",{children:"Usługodawca gwarantuje dostępność Serwisu na poziomie 99% w skali roku, z wyłączeniem zapowiedzianych przerw technicznych."}),i.jsx("li",{children:"Klient jest administratorem danych osobowych swoich klientów końcowych wprowadzanych do Aplikacji. Usługodawca przetwarza te dane na polecenie Klienta (szczegóły w §8)."})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§7. Odpowiedzialność"}),i.jsxs("ol",{className:"list-decimal space-y-3 pl-6 text-[15px] leading-relaxed text-foreground/90",children:[i.jsx("li",{children:"Usługodawca ponosi odpowiedzialność względem Klienta (B2B) jedynie za szkodę wyrządzoną z winy umyślnej."}),i.jsx("li",{children:"Odpowiedzialność Usługodawcy z tytułu utraconych korzyści (lucrum cessans) jest wyłączona."}),i.jsx("li",{children:"Całkowita odpowiedzialność Usługodawcy ograniczona jest do kwoty ostatniej miesięcznej opłaty abonamentowej wniesionej przez Klienta."}),i.jsx("li",{children:"Usługodawca nie ponosi odpowiedzialności za błędy wynikające z niewłaściwego wprowadzania danych przez Klienta lub użytkowników końcowych skanujących kody QR."})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§8. Ochrona Danych Osobowych (RODO)"}),i.jsxs("ol",{className:"list-decimal space-y-3 pl-6 text-[15px] leading-relaxed text-foreground/90",children:[i.jsx("li",{children:"Administratorem danych osobowych Klienta (Serwisanta) w celach realizacji umowy i rozliczeń jest Usługodawca."}),i.jsx("li",{children:"W zakresie danych wprowadzanych przez Klienta do systemu (dane właścicieli urządzeń, adresy montażu), Klient jest Administratorem Danych, a Usługodawca jest Podmiotem Przetwarzającym (Procesorem)."}),i.jsx("li",{children:"Klient powierza Usługodawcy przetwarzanie danych osobowych w celu realizacji usługi SaaS. Usługodawca przetwarza dane wyłącznie w infrastrukturze zapewniającej bezpieczeństwo (Supabase, serwery w UE/USA zgodne z DPF)."}),i.jsxs("li",{children:["Szczegółowe zasady przetwarzania danych opisane są w"," ",i.jsx(ks,{to:"/polityka-prywatnosci",className:"text-primary hover:underline",children:"Polityce Prywatności"}),"."]})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§9. Reklamacje"}),i.jsxs("ol",{className:"list-decimal space-y-3 pl-6 text-[15px] leading-relaxed text-foreground/90",children:[i.jsxs("li",{children:["Reklamacje dotyczące działania Serwisu można zgłaszać na adres e‑mail:"," ",i.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"}),"."]}),i.jsx("li",{children:"Usługodawca rozpatrzy reklamację w terminie 14 dni."})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§10. Postanowienia końcowe"}),i.jsxs("ol",{className:"list-decimal space-y-3 pl-6 text-[15px] leading-relaxed text-foreground/90",children:[i.jsx("li",{children:"Usługodawca zastrzega sobie prawo do zmiany Regulaminu. O istotnych zmianach (np. zmiana Cennika) Klienci zostaną powiadomieni z 14‑dniowym wyprzedzeniem."}),i.jsx("li",{children:"W sprawach nieuregulowanych mają zastosowanie przepisy prawa polskiego."}),i.jsx("li",{children:"Wszelkie spory będą rozstrzygane przez sąd właściwy dla siedziby Usługodawcy."})]})]})]})}),i.jsx(xf,{})]})}function ZV(){return i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(wf,{}),i.jsx("main",{className:"container py-10 pt-24 md:py-14 md:pt-28",children:i.jsxs("article",{className:"legal-document mx-auto max-w-3xl",children:[i.jsxs("header",{className:"mb-10 border-b border-border pb-6 text-center",children:[i.jsx("h1",{className:"text-2xl font-bold uppercase tracking-wide md:text-3xl",children:"Polityka Prywatności"}),i.jsx("p",{className:"mt-2 text-muted-foreground",children:"Serwisu QRserwis.pl"})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§1. Postanowienia ogólne"}),i.jsxs("ol",{className:"list-decimal space-y-3 pl-6 text-[15px] leading-relaxed text-foreground
850/90",children:[i.jsx("li",{children:'Niniejsza Polityka Prywatności określa zasady przetwarzania i ochrony danych osobowych przekazywanych przez Użytkowników w związku z korzystaniem z serwisu qrserwis.pl (zwanego dalej „Serwisem").'}),i.jsx("li",{children:'Administratorem danych osobowych Użytkowników (Serwisantów/Przedsiębiorców) jest: PROCLEVER PATRYK OLEJNICZAK z siedzibą w Jasin, ul. Augusta 8A/2, 62-020, NIP: 7811859458, zwany dalej „Administratorem".'}),i.jsx("li",{children:"Serwis dba o bezpieczeństwo danych, stosując m.in. protokół szyfrowania komunikacji (SSL) oraz bezpieczną infrastrukturę chmurową."})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§2. Zakres zbieranych danych"}),i.jsx("p",{className:"mb-3 text-[15px] leading-relaxed text-foreground/90",children:"Administrator zbiera dane w następujących sytuacjach:"}),i.jsxs("ol",{className:"list-decimal space-y-4 pl-6 text-[15px] leading-relaxed text-foreground/90",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Rejestracja i Logowanie:"}),i.jsxs("ul",{className:"mt-2 list-[lower-alpha] space-y-1 pl-6",children:[i.jsx("li",{children:"adres e‑mail,"}),i.jsx("li",{children:"nazwa firmy (opcjonalnie)."})]})]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Opcjonalne uzupełnianie danych na koncie serwisanta:"}),i.jsxs("ul",{className:"mt-2 list-[lower-alpha] space-y-1 pl-6",children:[i.jsx("li",{children:"nazwa firmy,"}),i.jsx("li",{children:"imię i nazwisko."})]})]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Zakup Subskrypcji (Stripe):"}),i.jsxs("ul",{className:"mt-2 list-[lower-alpha] space-y-1 pl-6",children:[i.jsx("li",{children:"dane firmy (nazwa, adres, NIP),"}),i.jsx("li",{children:"dane rozliczeniowe."})]}),i.jsx("p",{className:"mt-2 text-sm italic text-muted-foreground",children:"Uwaga: Administrator nie przetwarza pełnych danych kart płatniczych. Są one przetwarzane bezpośrednio przez operatora płatności (Stripe)."})]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Realizacja wysyłki Pakietu Startowego (Naklejki):"}),i.jsxs("ul",{className:"mt-2 list-[lower-alpha] space-y-1 pl-6",children:[i.jsx("li",{children:"numer telefonu,"}),i.jsx("li",{children:"adres e‑mail,"}),i.jsx("li",{children:"kod i adres Paczkomatu InPost."})]})]})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§3. Cel i podstawa prawna przetwarzania"}),i.jsx("p",{className:"mb-3 text-[15px] leading-relaxed text-foreground/90",children:"Dane przetwarzane są w celu:"}),i.jsxs("ol",{className:"list-decimal space-y-2 pl-6 text-[15px] leading-relaxed text-foreground/90",children:[i.jsx("li",{children:"świadczenia usługi SaaS (utrzymanie konta, dostęp do funkcji) – art. 6 ust. 1 lit. b RODO (wykonanie umowy),"}),i.jsx("li",{children:"obsługi płatności i księgowości (wystawianie faktur) – art. 6 ust. 1 lit. c RODO (obowiązek prawny),"}),i.jsx("li",{children:"realizacji wysyłki towarów (pakietów naklejek) – art. 6 ust. 1 lit. b RODO,"}),i.jsx("li",{children:"analityki i bezpieczeństwa (wykrywanie nadużyć, statystyki) – art. 6 ust. 1 lit. f RODO (prawnie uzasadniony interes Administratora)."})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§4. Odbiorcy danych (Zaufani Partnerzy)"}),i.jsx("p",{className:"mb-3 text-[15px] leading-relaxed text-foreground/90",children:"Dla prawidłowego funkcjonowania Serwisu, Administrator powierza przetwarzanie danych następującym podmiotom zewnętrznym (Procesorom):"}),i.jsxs("ol",{className:"list-decimal space-y-2 pl-6 text-[15px] leading-relaxed text-foreground/90",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Supabase Inc. (USA/Singapur)"})," – dostawca infrastruktury bazodanowej i backendowej. Dane są przechowywane zgodnie ze standardami bezpieczeństwa (szyfrowanie w spoczynku)."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Stripe Payments Europe, Ltd. (Irlandia)"})," – operator płatności. Przetwarza dane karty i dane do faktury."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Google Ireland Ltd. (Irlandia)"})," – obsługa logowania (Google OAuth) oraz ewentualna analityka."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"InPost Sp. z o.o. (Polska)"})," – wyłącznie w celu dostarczenia pakietu naklejek (jeśli dotyczy)."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Biuro księgowe"})," – podmiot prowadzący księgowość Administratora (wyłącznie dane z faktur)."]})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§5. Relacja Powierzenia Danych (Klienci Końcowi)"}),i.jsxs("ol",{className:"list-decimal space-y-3 pl-6 text-[15px] leading-relaxed text-foreground
850/90",children:[i.jsx("li",{children:"W odniesieniu do danych osobowych klientów końcowych (właścicieli urządzeń), które Użytkownik (Serwisant) wprowadza do Serwisu (np. imię, nazwisko, adres montażu, telefon), Użytkownik jest Administratorem Danych, a Właściciel Serwisu qrserwis.pl jest jedynie Podmiotem Przetwarzającym (Procesorem)."}),i.jsx("li",{children:"Użytkownik oświadcza, że posiada podstawę prawną (np. zgodę lub umowę) do przetwarzania danych swoich klientów w systemie qrserwis.pl."}),i.jsx("li",{children:"Właściciel Serwisu nie wykorzystuje danych klientów końcowych do własnych celów marketingowych."})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§6. Pliki Cookies"}),i.jsxs("ol",{className:"list-decimal space-y-3 pl-6 text-[15px] leading-relaxed text-foreground/90",children:[i.jsxs("li",{children:["Serwis wykorzystuje pliki cookies (ciasteczka) w celu:",i.jsxs("ul",{className:"mt-2 list-[lower-alpha] space-y-1 pl-6",children:[i.jsx("li",{children:"utrzymania sesji użytkownika (aby nie trzeba było się logować przy każdym odświeżeniu),"}),i.jsx("li",{children:"zapamiętania preferencji."})]})]}),i.jsx("li",{children:"Są to głównie tzw. cookies techniczne, niezbędne do działania aplikacji."}),i.jsx("li",{children:"Użytkownik może w każdej chwili zmienić ustawienia przeglądarki dotyczące cookies, jednak może to uniemożliwić korzystanie z Serwisu."})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§7. Prawa Użytkownika"}),i.jsx("p",{className:"mb-3 text-[15px] leading-relaxed text-foreground/90",children:"Zgodnie z RODO, Użytkownikowi przysługuje prawo do:"}),i.jsxs("ol",{className:"list-decimal space-y-2 pl-6 text-[15px] leading-relaxed text-foreground/90",children:[i.jsx("li",{children:"dostępu do swoich danych oraz otrzymania ich kopii,"}),i.jsx("li",{children:"sprostowania (poprawiania) swoich danych,"}),i.jsx("li",{children:'usunięcia danych („prawo do bycia zapomnianym") – w przypadku rezygnacji z usługi,'}),i.jsx("li",{children:"ograniczenia przetwarzania,"}),i.jsx("li",{children:"przenoszenia danych,"}),i.jsx("li",{children:"wniesienia skargi do Prezesa Urzędu Ochrony Danych Osobowych (PUODO)."})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§8. Okres przechowywania danych"}),i.jsxs("ol",{className:"list-decimal space-y-3 pl-6 text-[15px] leading-relaxed text-foreground/90",children:[i.jsx("li",{children:"Dane związane z kontem Użytkownika przechowywane są przez okres świadczenia usługi."}),i.jsx("li",{children:"Dane rozliczeniowe (faktury) przechowywane są przez okres 5 lat (wymóg prawa podatkowego)."}),i.jsx("li",{children:"Po usunięciu konta, dane są trwale usuwane z bazy produkcyjnej w terminie do 30 dni (okres retencji backupów)."})]})]}),i.jsxs("section",{className:"mb-8",children:[i.jsx("h2",{className:"mb-4 text-lg font-bold",children:"§9. Kontakt"}),i.jsxs("p",{className:"text-[15px] leading-relaxed text-foreground/90",children:["W sprawach dotyczących ochrony danych osobowych można kontaktować się z Administratorem pod adresem e‑mail:"," ",i.jsx("a",{href:"mailto:[email protected]",className:"font-medium text-primary hover:underline",children:"[email protected]"}),"."]})]})]})}),i.jsx(xf,{})]})}function GV(){const e=Zt(),[t,r]=f.useState(null),[n,s]=f.useState(!1),[a,o]=f.useState("android");f.useEffect(()=>{window.matchMedia("(display-mode: standalone)").matches&&s(!0),/iPad|iPhone|iPod/.test(navigator.userAgent)&&o("ios");const d=u=>{u.preventDefault(),r(u)};return window.addEventListener("beforeinstallprompt",d),window.addEventListener("appinstalled",()=>{s(!0),r(null)}),()=>{window.removeEventListener("beforeinstallprompt",d)}},[]);const l=async()=>{if(!t)return;t.prompt();const{outcome:c}=await t.userChoice;c==="accepted"&&s(!0),r(null)};return i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx(wf,{}),i.jsx("div",{className:"gradient-primary pt-16",children:i.jsxs("div",{className:"container py-8",children:[i.jsx("h1",{className:"text-2xl font-bold text-primary-foreground",children:"Zainstaluj QRserwis"}
850),i.jsx("p",{className:"mt-2 text-primary-foreground/80",children:"Dodaj aplikację do ekranu głównego telefonu"})]})}),i.jsx("div",{className:"container py-8",children:n?i.jsxs(Fe,{className:"mx-auto max-w-md",children:[i.jsxs(lt,{className:"text-center",children:[i.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-green-100",children:i.jsx(Dt,{className:"h-8 w-8 text-green-600"})}),i.jsx(ut,{children:"Aplikacja zainstalowana!"}),i.jsx(xr,{children:"QRserwis jest już zainstalowany na Twoim urządzeniu"})]}),i.jsx(Me,{children:i.jsx(G,{className:"w-full",onClick:()=>e("/dashboard"),children:"Przejdź do aplikacji"})})]}):i.jsxs("div",{className:"mx-auto max-w-2xl space-y-6",children:[t&&i.jsxs(Fe,{className:"border-primary",children:[i.jsxs(lt,{children:[i.jsxs(ut,{className:"flex items-center gap-2",children:[i.jsx(Wx,{className:"h-5 w-5 text-primary"}),"Szybka instalacja"]}),i.jsx(xr,{children:"Twoja przeglądarka obsługuje bezpośrednią instalację"})]}),i.jsx(Me,{children:i.jsxs(G,{className:"w-full",size:"lg",onClick:l,children:[i.jsx(Wx,{className:"mr-2 h-5 w-5"}),"Zainstaluj QRserwis"]})})]}),i.jsxs(pl,{value:a,onValueChange:o,className:"w-full",children:[i.jsxs(Fi,{className:"grid w-full grid-cols-2",children:[i.jsxs(nn,{value:"ios",className:"flex items-center gap-2",children:[i.jsx(Lx,{className:"h-4 w-4"}),"iOS (iPhone/iPad)"]}),i.jsxs(nn,{value:"android",className:"flex items-center gap-2",children:[i.jsx(ng,{className:"h-4 w-4"}),"Android"]})]}),i.jsx(Kn,{value:"ios",children:i.jsxs(Fe,{children:[i.jsxs(lt,{children:[i.jsxs(ut,{className:"flex items-center gap-2",children:[i.jsx(Lx,{className:"h-5 w-5"}),"Instrukcja dla iPhone / iPad"]}),i.jsx(xr,{children:"Wykonaj te kroki, aby zainstalować aplikację"})]}),i.jsxs(Me,{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground",children:"1"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:"Otwórz w Safari"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Upewnij się, że korzystasz z przeglądarki Safari"})]})]}),i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground",children:"2"}),i.jsxs("div",{children:[i.jsxs("p",{className:"font-medium flex items-center gap-2",children:["Kliknij ikonę udostępniania",i.jsx(WO,{className:"h-4 w-4"})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Znajdziesz ją na dole ekranu (iPhone) lub na górze (iPad)"})]})]}),i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground",children:"3"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:'Wybierz "Dodaj do ekranu początkowego"'}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Przewiń w dół i znajdź tę opcję w menu"})]})]}),i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground",children:"4"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:'Potwierdź "Dodaj"'}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Aplikacja pojawi się na ekranie głównym"})]})]})]})]})}),i.jsx(Kn,{value:"android",children:i.jsxs(Fe,{children:[i.jsxs(lt,{children:[i.jsxs(ut,{className:"flex items-center gap-2",children:[i.jsx(ng,{className:"h-5 w-5"}),"Instrukcja dla Android"]}),i.jsx(xr,{children:"Wykonaj te kroki, aby zainstalować aplikację"})]}),i.jsxs(Me,{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground",children:"1"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:"Otwórz menu przeglądarki"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Kliknij trzy kropki w prawym górnym rogu"})]})]}),i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground",children:"2"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:'Wybierz "Zainstaluj aplikację"'}),i.jsx("p",{className:"text-sm text-muted-foreground",children:'Lub "Dodaj do ekranu głównego"'})]})]}),i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground",children:"3"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:"Potwierdź instalację"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Aplikacja pojawi się na ekranie głównym"})]})]})]})]})})]}),i.jsxs(Fe,{children:[i.jsx(lt,{children:i.jsx(ut,{children:"Dlaczego warto zainstalować?"})}),i.jsx(Me,{children:i.jsxs("ul",{className:"space-y-3",children:[i.jsxs("li",{className:"flex items-center gap-3",children:[i.jsx(Dt,{className:"h-5 w-5 text-green-600"}),i.jsx("span",{children:"Szybszy dostęp - jedna ikona na ekranie głównym"})]}),i.jsxs("li",{className:"flex items-center gap-3",children:[i.jsx(Dt,{className:"h-5 w-5 text-green-600"}),i.jsx("span",{children:"Działa jak natywna aplikacja"})]}),i.jsxs("li",{className:"flex items-center gap-3",children:[i.jsx(Dt,{className:"h-5 w-5 text-green-600"}),i.jsx("span",{children:"Podstawowe funkcje dostępne offline"})]}),i.jsxs("li",{className:"flex items-center gap-3",children:[i.jsx(Dt,{className:"h-5 w-5 text-green-600"}),i.jsx("span",{children:"Nie zajmuje miejsca jak tradycyjna aplikacja"})]})]})})]})]})}),i.jsx(xf,{})]})}const QV=[{value:"fault",label:"Awaria"},{value:"maintenance",label:"Przegląd"}];function YV(){const[e,t]=f.useState("fault"),[r,n]=f.useState("klimatyzacja"),s=xw(e,r),a=()=>{xk({title:"Tryb podglądu",description:"Zapis jest wyłączony w trybie podglądu."})};return i.jsx("div",{className:"min-h-screen bg-background",children:i.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-8 space-y-6",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Podgląd formularzy protokołów V2"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Tryb testowy — bez logowania, bez autouzupełniania, bez zapisu."})]}),i.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(ue,{children:"Typ zgłoszenia"}),i.jsxs(Ha,{value:e,onValueChange:o=>t(o),children:[i.jsx(Ys,{children:i.jsx(Ka,{})}),i.jsx(Js,{children:QV.map(o=>i.jsx(Xs,{value:o.value,children:o.label},o.value))})]})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx(ue,{children:"Kategoria urządzenia"}),i.jsxs(Ha,{value:r,onValueChange:n,children:[i.jsx(Ys,{children:i.jsx(Ka,{})}),i.jsx(Js,{children:Vf.map(o=>i.jsx(Xs,{value:o.value,children:o.label},o.value))})]})]})]}),s?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"text-sm font-medium text-primary",children:s.label}),i.jsx(D2,{profile:s,autoFillData:{},onSubmit:a,saving:!1},s.id)]}):i.jsx("p",{className:"text-muted-foreground text-sm",children:"Brak profilu dla wybranej kombinacji."})]})})}const JV=()=>{const e=rs();return f.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:i.jsxs("div",{className:"text-center",children:[i.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),i.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),i.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},XV=new g4;function Ts({children:e}){const{user:t,loading:r,isEmailConfirmed:n}=qr();return r?i.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:i.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):t?n?i.jsx(i.Fragment,{children:e}):i.jsx(gb,{to:"/auth?pending=true",replace:!0}):i.jsx(gb,{to:"/auth",replace:!0})}function e7(){return i.jsxs(iM,{children:[i.jsx(Ut,{path:"/",element:i.jsx(_$,{})}),i.jsx(Ut,{path:"/auth",element:i.jsx(_L,{})}),i.jsx(Ut,{path:"/regulamin",element:i.jsx(KV,{})}),i.jsx(Ut,{path:"/polityka-prywatnosci",element:i.jsx(ZV,{})}),i.jsx(Ut,{path:"/install",element:i.jsx(GV,{})}),i.jsx(Ut,{path:"/protokoly-podglad",element:i.jsx(YV,{})}),i.jsx(Ut,{path:"/urzadzenie/:qrUuid",element:i.jsx(BV,{})}),i.jsx(Ut,{path:"/protokol/:id/podglad",element:i.jsx(NV,{})}),i.jsx(Ut,{path:"/id",element:i.jsx(WV,{})}),i.jsx(Ut,{path:"/s/:shortId",element:i.jsx(VV,{})}),i.jsx(Ut,{path:"/dashboard",element:i.jsx(Ts,{children:i.jsx(S6,{})})}),i.jsx(Ut,{path:"/tickets",element:i.jsx(Ts,{children:i.jsx(b9,{})})}),i.jsx(Ut,{path:"/tickets/:id",element:i.jsx(Ts,{children:i.jsx(M9,{})})}),i.jsx(Ut,{path:"/tickets/:id/protocol",element:i.jsx(Ts,{children:i.jsx(_V,{})})}),i.jsx(Ut,{path:"/clients",element:i.jsx(Ts,{children:i.jsx(SV,{})})}),i.jsx(Ut,{path:"/clients/:id",element:i.jsx(Ts,{children:i.jsx(zV,{})})}),i.jsx(Ut,{path:"/devices",element:i.jsx(Ts,{children:i.jsx($V,{})})}),i.jsx(Ut,{path:"/devices/:id",element:i.jsx(Ts,{children:i.jsx(UV,{})})}),i.jsx(Ut,{path:"/account",element:i.jsx(Ts,{children:i.jsx(HV,{})})}),i.jsx(Ut,{path:"*",element:i.jsx(JV,{})})]})}const t7=()=>i.jsx(v4,{client:XV,children:i.jsx(QF,{children:i.jsxs(pv,{children:[i.jsx(_S,{}),i.jsx(PA,{}),i.jsx(lD,{}),i.jsxs(mM,{children:[i.jsx(e7,{}),i.jsx(YF,{})]})]})})}),r7=ER({onNeedRefresh(){confirm("Dostępna jest nowa wersja aplikacji. Odświeżyć?")&&r7(!0)},onOfflineReady(){console.log("Aplikacja gotowa do pracy offline")}});wk(document.getElementById("root")).render(i.jsx(t7,{}));

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.