@wfgraph/client 0.2.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,101 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,o)=>(o=n==null?{}:e(i(n)),l(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=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(){}},p=new class extends f{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},m={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},h=new class{#e=m;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function g(e){setTimeout(e,0)}var _=typeof window>`u`||`Deno`in globalThis;function v(){}function y(e,t){return typeof e==`function`?e(t):e}function b(e){return typeof e==`number`&&e>=0&&e!==1/0}function x(e,t){return Math.max(e+(t||0)-Date.now(),0)}function S(e,t){return typeof e==`function`?e(t):e}function C(e,t){return typeof e==`function`?e(t):e}function w(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==E(o,t.options))return!1}else if(!O(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function T(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(D(t.options.mutationKey)!==D(a))return!1}else if(!O(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function E(e,t){return(t?.queryKeyHashFn||D)(e)}function D(e){return JSON.stringify(e,(e,t)=>N(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function O(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!O(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!O(e[r],t[r]))return!1;return!0}return!1}var k=Object.prototype.hasOwnProperty;function A(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=M(e)&&M(t);if(!r&&!(N(e)&&N(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:k.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=A(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function j(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function M(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function N(e){if(!P(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!P(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function P(e){return Object.prototype.toString.call(e)===`[object Object]`}function F(e){return new Promise(t=>{h.setTimeout(t,e)})}function I(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:A(e,t)}function L(e){return e}function R(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function z(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var B=Symbol();function V(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===B?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function H(e,t){return typeof e==`function`?e(...t):!!e}function U(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var W=(()=>{let e=()=>_;return{isServer(){return e()},setIsServer(t){e=t}}})();function G(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var K=g;function q(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=K,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var J=q(),ee=new class extends f{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function te(e){return Math.min(1e3*2**e,3e4)}function ne(e){return(e??`online`)!==`online`||ee.isOnline()}var re=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ie(e){let t=!1,n=0,r,i=G(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new re(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>p.isFocused()&&(e.networkMode===`always`||ee.isOnline())&&e.canRun(),u=()=>ne(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(W.isServer()?0:3),o=e.retryDelay??te,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),F(s).then(()=>l()?void 0:m()).then(()=>{t?f(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?h():m().then(h),i)}}var ae=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),b(this.gcTime)&&(this.#e=h.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(W.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(h.clearTimeout(this.#e),this.#e=void 0)}};function oe(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{U(e,()=>t.signal,()=>n=!0)},u=V(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?z:R;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?ce:se,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:se(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function se(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ce(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function le(e,t){return t?se(e,t)!=null:!1}function ue(e,t){return!t||!e.getPreviousPageParam?!1:ce(e,t)!=null}var de=class extends ae{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=me(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=me(this.options);e.data!==void 0&&(this.setState(pe(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=I(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(v).catch(v):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>C(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===B||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>S(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!x(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=V(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?oe(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=ie({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof re&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof re){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...fe(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...pe(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),J.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function fe(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ne(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function pe(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function me(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var he=class extends f{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=G(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),_e(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ve(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ve(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof C(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!j(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&ye(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||C(this.options.enabled,this.#t)!==C(t.enabled,this.#t)||S(this.options.staleTime,this.#t)!==S(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||C(this.options.enabled,this.#t)!==C(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return xe(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(v)),t}#g(){this.#b();let e=S(this.options.staleTime,this.#t);if(W.isServer()||this.#r.isStale||!b(e))return;let t=x(this.#r.dataUpdatedAt,e)+1;this.#d=h.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(W.isServer()||C(this.options.enabled,this.#t)===!1||!b(this.#p)||this.#p===0)&&(this.#f=h.setInterval(()=>{(this.options.refetchIntervalInBackground||p.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(h.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(h.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&_e(e,t),o=i&&ye(e,n,t,r);(a||o)&&(l={...l,...fe(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=I(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=I(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:be(e,t),refetch:this.refetch,promise:this.#o,isEnabled:C(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=G();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a()}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!j(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){J.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function ge(e,t){return C(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||C(t.retryOnMount,e)!==!1)}function _e(e,t){return ge(e,t)||e.state.data!==void 0&&ve(e,t,t.refetchOnMount)}function ve(e,t,n){if(C(t.enabled,e)!==!1&&S(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&be(e,t)}return!1}function ye(e,t,n,r){return(e!==t||C(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&be(e,n)}function be(e,t){return C(t.enabled,e)!==!1&&e.isStaleByTime(S(t.staleTime,e))}function xe(e,t){return!j(e.getCurrentResult(),t)}var Se=class extends he{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:le(t,n.data),hasPreviousPage:ue(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Ce=class extends ae{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||we(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=ie({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),J.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function we(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Te=class extends f{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Ce({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Ee(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Ee(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Ee(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Ee(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){J.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>T(t,e))}findAll(e={}){return this.getAll().filter(t=>T(e,t))}notify(e){J.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return J.batch(()=>Promise.all(e.map(e=>e.continue().catch(v))))}};function Ee(e){return e.options.scope?.id}var De=class extends f{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),j(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&D(t.mutationKey)!==D(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??we();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){J.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Oe=class extends f{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??E(r,t),a=this.get(i);return a||(a=new de({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){J.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>w(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>w(e,t)):t}notify(e){J.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){J.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){J.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ke=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Oe,this.#t=e.mutationCache||new Te,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=p.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ee.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(S(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=y(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return J.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;J.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return J.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=J.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(v).catch(v)}invalidateQueries(e,t={}){return J.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=J.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(v)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(v)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(S(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(v).catch(v)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(v).catch(v)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ee.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(D(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{O(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(D(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{O(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=E(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===B&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ae=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),je=s(((e,t)=>{t.exports=Ae()})),Me=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Ne=s(((e,t)=>{t.exports=Me()})),Y=u(je(),1),X=Ne(),Pe=Y.createContext(void 0),Fe=e=>{let t=Y.useContext(Pe);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ie=({client:e,children:t})=>(Y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,X.jsx)(Pe.Provider,{value:e,children:t})),Le=Y.createContext(!1),Re=()=>Y.useContext(Le);Le.Provider;function ze(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Be=Y.createContext(ze()),Ve=()=>Y.useContext(Be),He=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?H(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ue=e=>{Y.useEffect(()=>{e.clearReset()},[e])},We=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||H(n,[e.error,r])),Ge=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Ke=(e,t)=>e.isLoading&&e.isFetching&&!t,qe=(e,t)=>e?.suspense&&t.isPending,Je=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ye(e,t,n){let r=Re(),i=Ve(),a=Fe(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Ge(o),He(o,i,s),Ue(i);let l=!a.getQueryCache().get(o.queryHash),[u]=Y.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(Y.useSyncExternalStore(Y.useCallback(e=>{let t=f?u.subscribe(J.batchCalls(e)):v;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),Y.useEffect(()=>{u.setOptions(o)},[o,u]),qe(o,d))throw Je(o,u,i);if(We({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!W.isServer()&&Ke(d,r)&&(l?Je(o,u,i):s?.promise)?.catch(v).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function Xe(e,t){return Ye(e,he,t)}function Ze(e,t){let n=Fe(t),[r]=Y.useState(()=>new De(n,e));Y.useEffect(()=>{r.setOptions(e)},[r,e]);let i=Y.useSyncExternalStore(Y.useCallback(e=>r.subscribe(J.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=Y.useCallback((e,t)=>{r.mutate(e,t).catch(v)},[r]);if(i.error&&H(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function Qe(e,t){return Ye(e,Se,t)}var $e=Y.useLayoutEffect;function et(e,t,n={},r){Y.useEffect(()=>{if(!e.current||r||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,r,n,e])}function tt(e){let t=Y.useRef(null);return Y.useImperativeHandle(e,()=>t.current,[]),t}function nt(e){return e[e.length-1]}function rt(e){return typeof e==`function`}function it(e,t){return rt(e)?e(t):e}var at=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable;function st(e){for(let t in e)if(at.call(e,t))return!0;return!1}var ct=()=>Object.create(null),lt=(e,t)=>ut(e,t,ct);function ut(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=mt(e)&&mt(i);if(!a&&!(ft(e)&&ft(i)))return i;let o=a?e:dt(e);if(!o)return i;let s=a?i:dt(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:at.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=ut(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function dt(e){let t=Object.keys(e);if(t.length!==Object.getOwnPropertyNames(e).length)return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;for(let r of n){if(!ot.call(e,r))return!1;t.push(r)}return t}function ft(e){if(!pt(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!pt(n)||!n.hasOwnProperty(`isPrototypeOf`))}function pt(e){return Object.prototype.toString.call(e)===`[object Object]`}function mt(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ht(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!ht(e[r],t[r],n))return!1;return!0}if(ft(e)&&ft(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!ht(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!ht(e[o],t[o],n)))return!1;return i===a}return!1}var gt=/[\x00-\x1f\x7f"<>`{}]/g;function _t(e){return e.replace(gt,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function vt(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return _t(t)}var yt=[`http:`,`https:`,`mailto:`,`tel:`];function bt(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function xt(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=vt(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=vt(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function St(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Ct(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function wt(){throw Error(`Invariant failed`)}function Tt(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var Et=4,Dt=5;function Ot(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function kt(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=Ot(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function At(e,t,n,r,i,a,o,s){s?.(n);let c=r;{let r=n.fullPath??n.from,s=n.options,l=r.length,u=s?.caseSensitive??e,d=s?.params?.parse??s?.parseParams;for(;c<l;){let e=kt(r,c,t),n,s=c,l=e[5];c=l+1,a++;let f=e[0];switch(f){case 0:{let t=r.substring(e[2],e[3]),o=t,s;u?s=i.static??=new Map:(o=t.toLowerCase(),s=i.staticInsensitive??=new Map);let c=s.get(o);if(c)n=c;else{let e=Mt(r);e.parent=i,e.depth=a,n=e,s.set(o,e)}break}case 1:case 3:case 2:{let t=r.substring(s,e[1]),c=r.substring(e[4],l),p=u&&!!(t||c),m=t?p?t:t.toLowerCase():void 0,h=c?p?c:c.toLowerCase():void 0,g=f===1?i.dynamic:f===3?i.optional:i.wildcard,_=f!==2&&!d&&g?.find(e=>!e.parse&&e.caseSensitive===p&&e.prefix===m&&e.suffix===h);if(_)n=_;else{let e=Nt(f,r,p,m,h);n=e,e.parent=i,e.depth=a;let t;t=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],t.push(e),t.length===2&&o?.push(t)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=Mt(r);e.kind=Dt,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=Mt(r);e.kind=Et,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)At(e,t,r,c,i,a,o,s)}function jt(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Mt(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function Nt(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function Pt(e,t){let n=Mt(`/`),r=new Uint16Array(6),i=[];for(let t of e)At(!1,r,t,1,n,0,i);for(let e of i)e.sort(jt);t.masksTree=n,t.flatCache=Tt(1e3)}function Ft(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Bt(e,t.masksTree);return t.flatCache.set(e,r),r}function It(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Mt(`/`),At(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Bt(r,o,n)}function Lt(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Bt(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Ht(a.route)),t.matchCache.set(r,a),a}function Rt(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function zt(e,t=!1,n){let r=Mt(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;At(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&&wt(),o[e.id]=e,c!==0&&e.path){let t=Rt(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(jt);return{processedTree:{segmentTree:r,singleCache:Tt(1e3),matchCache:Tt(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function Bt(e,t,n=!1){let r=e.split(`/`),i=Wt(e,r,t,n);if(!i)return null;let[a]=Vt(e,r,i);return{route:i.node.route,rawParams:a}}function Vt(e,t,n){let r=Ut(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===Et)break;if(u.kind===Dt){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Ht(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Ut(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Wt(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!nt(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!Jt(l,n))continue;if(i.parse){if(!qt(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==Et&&Jt(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===Et||i.kind===2)&&Jt(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(qt(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&Kt(f,o))return n;Jt(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(_||!(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)))){if(a){if(_)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+Gt(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+Gt(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+Gt(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+Gt(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function Gt(e,t){return 2**(e-t-1)}function Kt(e,t){return e===2**(t-1)-1}function qt(e,t,n){let r,i;try{[r,i]=Vt(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Jt(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Et)>(e.node.kind===Et)||t.node.kind===Et==(e.node.kind===Et)&&t.node.depth>e.node.depth)))}function Yt(e){return Xt(e.filter(e=>e!==void 0).join(`/`))}function Xt(e){return e.replace(/\/{2,}/g,`/`)}function Zt(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Qt(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function $t(e){return Qt(Zt(e))}function en(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function tn(e,t,n){return en(e,n)===en(t,n)}function nn({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t===`.`,a=t.startsWith(`/`),o;if(r){o=a?t:i?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(i)s=e.split(`/`);else if(a)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&nt(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.length>1?s.pop():s=[``]:r===`.`||s.push(r)}}s.length>1&&(nt(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=Xt(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function rn(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function an(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>sn(e,n)).join(`/`):sn(r,n):r}function on({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=kt(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=an(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=an(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=an(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function sn(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function cn(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function ln(e){return e?.isNotFound===!0}function un(){try{return sessionStorage}catch{return}}var dn=`tsr-scroll-restoration-v1_3`,fn=un();function pn(){try{return JSON.parse(fn?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function mn(){try{fn?.setItem(dn,JSON.stringify(hn))}catch{}}var hn=pn(),gn=`data-scroll-restoration-id`,_n=e=>e.state.__TSR_key||e.href;function vn(e){let t=e.getAttribute(gn);if(t)return`[${gn}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var yn=!1,bn=`window`;function xn(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Sn(e){let t=new Set;for(let n of e){if(n===bn)continue;let e=xn(n);e&&t.add(e)}return t}function Cn(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||_n,a=new Set,o=e=>{let t=hn[e]||={};for(let e of a)e===document?t[bn]={scrollX,scrollY}:e.isConnected&&(t[vn(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,yn=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{yn||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),mn()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=hn[d];if(e){let t=hn[u];for(let n in e){if(n===bn){if(s)continue}else{let e=xn(n);if(!e||s&&o&&(l??=Sn(o),l.has(e)))continue}t||=hn[u]={},t[n]??=e[n]}}}yn=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Sn(o));let t=e&&i&&c,s=r.restoring?hn[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===bn){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=xn(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{yn=!1}}))}function wn(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Tn(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function En(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Tn(r):Array.isArray(t)?t.push(Tn(r)):n[e]=[t,Tn(r)]}return n}var Dn=/^(?:\s|["[{\d-]|fa|nu|tr)/,On=An(JSON.parse),kn=jn(JSON.stringify,JSON.parse);function An(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=En(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function jn(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!Dn.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=wn(e,r);return t?`?${t}`:``}}var Mn=`__root__`;function Nn(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Pn(e){return e instanceof Response&&!!e.options}function Fn(e){return{input:({url:t})=>{for(let n of e)t=Ln(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Rn(e[n],t);return t}}}function In(e){let t=$t(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Yt([`/`,t,e.pathname]),e)}}function Ln(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Rn(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function zn(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{Ct(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var Bn=`__TSR_index`,Vn=`popstate`,Hn=`beforeunload`;function Un(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=qn(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[Bn];i=Wn(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[Bn];i=Wn(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Bn]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Wn(e,t){t||={};let n=Jn();return{...t,key:n,__TSR_key:n,[Bn]:e}}function Gn(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>qn(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Jn();t.history.replaceState({[Bn]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=qn(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(f){f=!1;return}let e=c(),n=e.state[Bn]-l.state[Bn],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=Un({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Hn,x,{capture:!0}),t.removeEventListener(Vn,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Hn,x,{capture:!0}),t.addEventListener(Vn,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function Kn(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function qn(e,t){let n=Kn(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Jn();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[Bn]:0,key:a,__TSR_key:a}}}function Jn(){return(Math.random()+1).toString(36).substring(7)}function Yn(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Xn(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Zn({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Qn(e,t,n,r){for(let i of t){if(r?.()===!1)return;n.some(e=>e.routeId===i.routeId)||e.routesById[i.routeId].options.onLeave?.(i)}for(let i of n){if(r?.()===!1)return;e.routesById[i.routeId].options[t.some(e=>e.routeId===i.routeId)?`onStay`:`onEnter`]?.(i)}}var $n=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=rn(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Gn()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Tt(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=zn(this.latestLocation,e),Cn(this)}let a=this.options.basepath??`/`,o=this.options.rewrite;if(r||n!==a||i!==o){this.basepath=a;let e=[],t=$t(a);t&&t!==`/`&&e.push(In({basepath:a})),o&&e.push(o),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Fn(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=zt(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Pt(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:xt(e).path,external:!1,searchStr:o,search:lt(t?.search,i),hash:xt(r.slice(1)).path,state:ut(t?.state,a)}}let o=new URL(i,this.origin),s=Ln(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:xt(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:lt(t?.search,c),hash:xt(s.hash.slice(1)).path,state:ut(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>nn({base:e,to:t.includes(`//`)?Xt(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Lt(Qt(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this._pendingLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r[1],a=t.to?`${t.to}`:void 0,o=r[2],s=Object.assign(Object.create(null),r[3]),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=ar(t.params,s),d=this.routesByPath[Qt(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let[e,t,n]=this.getMatchedRoutes(l);f=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&st(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:xt(on({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,nr(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=rr(m,t,f,e._includeValidateSearch),m=lt(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?it(t.hash,n.hash):void 0,_=g?`#${g}`:``,v=t.state===!0?n.state:t.state?it(t.state,n.state):{};v=ut(n.state,v);let y=`${p}${h}${_}`,b,x,S=!1;if(this.rewrite){let e=new URL(y,this.origin),t=Rn(this.rewrite,e);b=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,S=!0)}else b=St(y),x=b;return{publicHref:x,href:b,pathname:p,search:m,searchStr:h,state:v,hash:g??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=Ft(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=ar(s,n);r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=Qt(this.latestLocation.href)===Qt(n.href)&&ht(Zn(n.state),Zn(this.latestLocation.state)),a=this._commitPromise,o,s=new Promise(e=>{o=e});if(s.resolve=()=>{o(),a?.resolve()},this._commitPromise=s,i)this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:r}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,_redirects:a,href:o,...s}={})=>{if(o){let t=this.history.location.state.__TSR_index,n=qn(o,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);s.to=Ln(this.rewrite,r).pathname,s.search=this.options.parseSearch(n.search),s.hash=n.hash.slice(1)}let c=this.buildLocation({...s,_includeValidateSearch:!0});a&&(c._redirects=a),this._pendingLocation=c;let l=this.commitLocation({...c,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===c&&(this._pendingLocation=void 0)}),l},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(bt(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Zr(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Xn(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&Yn(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=(e.options._builtLocation??this.buildLocation(e.options)).publicHref||`/`;e.options.href=t,e.headers.set(`Location`,t)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&bt(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=lr,this.preloadRoute=e=>Qr(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=It(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!ht(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?ht(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??kn,parseSearch:e.parseSearch??On,protocolAllowlist:e.protocolAllowlist??yt}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Ht(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:Qt(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?ir(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=nr(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof er||(r=new er(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let{interpolatedPath:g,usedParams:_}=on({path:i.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),v=i.id+g+h,y=u(i,n),b=this._cache.get(v)??(y?.id===v?y:void 0);d=b?._strictParams??Object.assign(_,d);let x;if(!b)try{or(i,d)}catch(e){if(x=ln(e)||Pn(e)?e:new tr(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:lt(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=Yn(i)?`pending`:`success`;C={id:v,ssr:i.options.ssr,index:n,routeId:i.id,params:y?.params??d,_strictParams:d,pathname:g,updatedAt:Date.now(),search:y?lt(y.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:x,context:{},abortController:t?._controller??new AbortController,cause:S,loaderDeps:y?ut(y.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let w=s===i.id;C._notFound&&!w&&(C.error=void 0),C._notFound=w,c[n]=C}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?lt(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=nt(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=nt(a),c={...e.search};for(let e of a)try{Object.assign(c,nr(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=Object.assign(Object.create(null),o);for(let t of a)try{or(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}},er=class extends Error{},tr=class extends Error{};function nr(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new er(`Async validation not supported`);if(n.issues)throw new er(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function rr(e,t,n,r){let i=[];for(let e of n){let t=e.options;`search`in t?t.search?.middlewares&&i.push(...t.search.middlewares):(t.preSearchFilters||t.postSearchFilters)&&i.push(({search:e,next:n})=>{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;n&&i.push(({search:e,next:t,meta:i})=>{let a=t(e);if(r)try{let e=nr(n,a);if(i&&e)for(let t in e)t in a||(i.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=it(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function ir(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return Mn}function ar(e,t){return e===!1||e===null?Object.create(null):(e??!0)===!0?t:Object.assign(t,it(e,t))}function or(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function sr(e,t){return e.options[t]?.preload?.()}function cr(e,t){let n=sr(e,`component`),r=sr(e,`pendingComponent`),i=t&&r?r.then(t):r;return t&&!r&&t(),n&&i?Promise.all([n,i]).then(()=>{}):n??i}function lr(e,t,n){let r=()=>t===!1?void 0:t?sr(e,t):cr(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function ur(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var dr=0,fr=1,pr=2,mr=3,hr=4;function gr(e){return typeof e[0]==`number`}function _r(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).finally(()=>t.removeEventListener(`abort`,i))})}function vr(e,t){return e.routesById[t.routeId]}function yr(e,t,n){return Pn(e)?[mr,e]:ln(e)?(e.routeId||=n,[pr,e]):(t&&typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),t?[fr,e]:[dr,e])}function br(e,t){let n=yr(t,!0,e.id);if(n[0]!==fr)return n;try{e.options.onError?.(n[1])}catch(t){n=yr(t,!0,e.id)}return n}function xr(e,t,n){return n[0].signal.aborted||!n[2]()?(n[0].abort(),[hr]):br(e,t)}function Sr(e,t){return n=>e.navigate({...n,_fromLocation:t})}async function Cr(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[4];for(let t=n[7]??0;t<r;t++){let r=s[t],i=vr(e,r);r.abortController=n[0];let u=s[t-1]?.context??e.options.context??{},d={params:r.params,location:o,navigate:Sr(e,o),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:i.id},f=u;try{let e=r._ctx;!e&&i.options.context&&(e=r._ctx=i.options.context({...d,deps:r.loaderDeps,context:u})||{}),f={...u,...e},r.context=f}catch(a){return Tr(e,r),[t,xr(i,a,n)]}if(c.aborted||!n[2]())return n[0].abort(),[t,[hr]];let p=r.paramsError??r.searchError;if(p!==void 0)return Tr(e,r),[t,xr(i,p,n)];let m=i.options.beforeLoad;if(!m)continue;let h={...d,search:r.search,context:f,...e.options.additionalContext},g=r.status;g===`success`&&t>=a&&(r.status=`pending`),n[8]?.();try{Or(e,r,`beforeLoad`,n[0]);let a=await _r(m(h),c);if(!n[2]())return n[0].abort(),[t,[hr]];let o=yr(a,!1,i.id);if(o[0]!==dr)return Tr(e,r),[t,o];r.context={...f,...a}}catch(a){return Tr(e,r),[t,xr(i,a,n)]}finally{g===`success`&&r.status===`pending`&&(r.status=`success`),Or(e,r,!1,n[0])}}i()}function wr(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function Tr(e,t){let n=t._flight;t._flight=void 0,wr(e,t,n)?.abort()}function Er(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=wr(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Dr(e){for(let t of e){let e=t._flight;e&&e[2]++}}function Or(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function kr(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:Sr(e,s),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function Ar(e,t,n,r,i,a,o,s){let c=s.signal;if(c.aborted)return[hr];if(!i)return[dr,void 0];let l=n._flight;Or(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(kr(e,t,n,r,s,a,o))).then(e=>yr(e,!1,r.id),e=>yr(e,!0,r.id)).then(t=>(t[0]!==dr&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===fr&&l[2]?br(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],await _r(l[0],c)}catch(t){if(t!==c)throw t;return Tr(e,n),[hr]}finally{Or(e,n,!1,s)}}function jr(e,t,n){t[0]===dr?(e.loaderData=t[1],e.error=void 0,e.status=`success`,e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):t[0]!==mr&&(e.status=`success`,e.error=void 0,e.invalid=!0)}function Mr(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&Tr(e,r)}function Nr(e,t){return t[0]===fr||t[0]===pr?{...e,status:t[0]===fr?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Pr(e,t,n,r,i,a,o){let s=t[1][n],c=vr(e,s),l=!!a[4],u=l?e._cache.get(s.id):void 0,d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(kr(e,t,s,c,a[0],i,l))),a[2]()||(a[0].abort(),p=[hr])),!p){if(s.status!==`success`)f=!0;else{let t=a[4]||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[6]||s.cause===`enter`||a[3].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(t){s.invalid=!0,Tr(e,s),p=xr(c,t,a)}let m=c.options.loader,h=typeof m==`function`?m:m?.handler,g=(!l||c.options.preload!==!1)&&m?e._flights?.get(s.id):void 0;g===s._flight||p?g=void 0:g&&!f&&!l&&d===void 0?f=!0:f||(g=void 0);let _=!!(m&&f&&s.status===`success`&&!l&&!a[5]&&((typeof m==`function`?void 0:m?.staleReloadMode)??e.options.defaultStaleReloadMode)!==`blocking`),v=f&&(!l||c.options.preload!==!1),y=v&&!_&&(s.status!==`success`||!!m),b=c.lazyFn&&c._lazy!==!0?a[8]:void 0;if(v&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),g&&g[2]++,y){let t=s._flight;s._flight=g,wr(e,s,t)?.abort(),s.status===`success`&&n>=o&&(s.status=`pending`),a[8]?.()}v||(s.isFetching=!1);let x=(p?Promise.resolve(p):y?Ar(e,t,s,c,h,i,l,a[0]):Promise.resolve([dr,s.loaderData])).then(t=>(y&&(jr(s,t,l),t[0]===dr&&(l&&m&&!a[0].signal.aborted&&Mr(e,s,u),s.status=`pending`)),t)),S=_r(Promise.resolve().then(()=>lr(c,void 0,b)),a[0].signal).then(()=>void 0,e=>[n,xr(c,e,a)]).then(e=>x.then(t=>(y&&!e&&t[0]===dr&&s.status===`pending`&&a[2]()&&(s.status=`success`,a[8]?.()),e)));if(r.push([n,x,S]),!_)return x.then(e=>Nr(s,e));let C={...s,status:`pending`,preload:!1,_flight:g};s.invalid=!1,s.isFetching=`loader`;let w=Ar(e,t,C,c,h,i,!1,a[0]).then(e=>(s.isFetching=!1,jr(C,e,!1),e));return(t[2]??=[]).push([n,w,S,C]),w.then(e=>Nr(C,e))}async function Fr(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=vr(e,t[n]),a=lr(i,!1);if(a)try{await _r(a,r)}catch(e){if(e===r)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function Ir(e,t){t[2]&&=(Er(e,t[2].map(e=>e[3])),void 0)}async function Lr(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=mr)throw[a,t];!i&&t[0]!==dr&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===mr)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}async function Rr(e,t,n,r,i,a,o){let s=t[1],c=await a,l=!1,u=s.findIndex(e=>e._notFound),d=t=>t[1][0]===pr?Fr(e,s,t,r.signal):t[0],f=u<0?s.length:u;if((c?.[1][0]??0)>=mr)f=0;else if(c){f=c[2]??=await d(c);for(let e of n){if(e[0]>=f)break;let t=await e[1];if(t[0]!==dr&&t[0]<mr&&!(`loaderData`in s[e[0]])){c=[e[0],t],f=c[2]=await d(c);break}}}for(let e of n){if(e[0]>=f)break;let t=await e[2];if(t){c=t;break}}if((c?.[1][0]??0)>=mr){let n=c[1];if(n[0]!==mr||n[1].options.reloadDocument||i<20)return Ir(e,t),n;l=!0,c=[0,[fr,Error(`Too many redirects`)]]}let p=c?c[2]??await d(c):u;if(p>=0){let i=c?.[1],a=i?.[0],u=s[p],d=i?.[1],f=()=>{i&&(u._notFound=void 0,a===fr?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};f();let m=vr(e,u);try{await _r(i?Promise.resolve().then(()=>lr(m,a===fr?`errorComponent`:`notFoundComponent`)):Promise.all([lr(m),lr(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal)return Ir(e,t),[hr]}i?l&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),Ir(e,t),Er(e,s),f()):(u.status=`success`,o?.())}return t}async function zr(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=vr(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await _r(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Br(e,t,n,r){let i=[t,n],a=e.stores.matches.get(),o=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&o>=0){let t=await Fr(e,i[1],void 0,r[0].signal,o);t!==o&&(n[o]._notFound=void 0,n[t]._notFound=!0),o=t}let s=o<0?n.length:o+1,c=0;for(;c<s&&c!==o;){let e=n[c],t=r[3][c],i=a[c];if(t?.id!==e.id||t.status!==`success`||t._notFound||e.preload||i?.id!==e.id||i.status!==`success`||i._notFound)break;c++}let l=[],u=r[7]??0,d=u?Promise.resolve(i[1][u-1]):void 0,f=()=>{for(let t=u;t<s&&!r[0].signal.aborted;t++)d=Pr(e,i,t,l,d,r,c)},p=await Cr(e,i,r,s,f,c);if(p&&(r[5]=!0,s=p[0],p[1][0]===pr?(p[2]=await Fr(e,i[1],p,r[0].signal),s=Math.min(s,p[2]+1)):p[1][0]>=mr&&(s=0),f()),r[2]()&&!r[4]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let m;try{let t=Rr(e,i,l,r[0],r[1],Lr(l,p,i[2]),r[8]);i[2]?.length&&(i[3]=Lr(i[2],void 0,void 0,t.then(e=>gr(e)?0:ur(e[1]).length,()=>0))),m=await t}catch(t){throw Ir(e,i),t}return gr(m)?m:zr(e,m,r[0].signal,r[7]===m[1].length?r[7]:0)}function Vr(e,t){if(e._tx!==t)return;let n=e._pending,r=!1,i=n?.[0][3][n[1]]?.id;n?.[0]!==t&&(n&&t[3][n[1]]?.id===i?(n[0]=t,r=!0):(clearTimeout(n?.[3]),e._pending=n=void 0));let a=t[3],o=e.stores.matches.get(),s=-1,c,l,u,d=!1;for(let t=0;t<a.length;t++){let n=a[t],r=n.status===`success`;if(d=o[t]?.id===n.id&&o[t]?.status===`pending`,r&&!d)continue;let i=vr(e,n);if(c=r&&d||n.invalid?0:i.options.pendingMs??e.options.defaultPendingMs,u=i.options.pendingComponent??e.options.defaultPendingComponent,!u||typeof c!=`number`||c===1/0)return;s=t,l=i.options.pendingMinMs??e.options.defaultPendingMinMs??0;break}if(s<0)return;let f=a[s].id;if((!n||n[1]!==s||i!==f)&&(clearTimeout(n?.[3]),e._pending=n=[t,s,d?Date.now()+l:t[4]+c,void 0,d?Promise.resolve(!0):void 0,u]),n[4]&&!r&&n[5]===u)return;if(n[5]=u,!n[4]){clearTimeout(n[3]);let r=n[2]-Date.now();if(r>0){n[3]=setTimeout(()=>Vr(e,t),r);return}n[2]=0}let p=a.map(e=>({...e,_flight:void 0}));p[s].status=`pending`;let m=e.startTransition(()=>e.stores.setMatches(p),p).then(t=>(t&&e._pending===n&&n[4]===m&&!n[2]&&(n[2]=Date.now()+l),t));n[4]=m}function Hr(e,t){let n=e._pending;n?.[0]===t&&(clearTimeout(n[3]),e._pending=void 0)}function Ur(e,t){e._committed=t,e.stores.setMatches(t)}function Wr(e,t){Er(e,t[1]),Ir(e,t)}function Gr(e,t,n,r){let i=e._committed,a=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let o=ur(n).length,s=new Map,c=Date.now();for(let t of[...i,...a.values()]){if(t.status!==`success`||n.some((e,n)=>e.id===t.id&&(n<o||e.status===`success`)))continue;let r=vr(e,t);!r.options.loader||c-t.updatedAt>=(t.preload?r.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:r.options.gcTime??e.options.defaultGcTime??3e5)||s.set(t.id,a.get(t.id)===t?t:{...t,_flight:void 0,isFetching:!1,context:{}})}t[3]=[],e._cache=s,Ur(e,n),Er(e,[...a.values(),...i],[...n,...s.values()]),Qn(e,i,n,()=>e._tx===t)}async function Kr(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}async function qr(e,t,n){await e.navigate({...n.options,replace:!0,ignoreBlocker:!0,_redirects:t[1]+1})}function Jr(e,t){Hr(e,t),t[0].abort(),Er(e,t[3]),t[3]=[],e._tx===t&&(e.batch(()=>{e.stores.status.set(`idle`),e.stores.setMatches(e._committed)}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0))}async function Yr(e,t,n,r,i){let a=n.map(e=>({...e}));Dr(a);for(let t of r)Tr(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Rr(e,o,r,t[0],t[1],i)}catch(t){throw Er(e,a),t}if(gr(s)){Er(e,a),s[0]===mr&&e._tx===t&&e._committed===n&&await qr(e,t,s[1]);return}let c=await zr(e,s,t[0].signal);if(e._tx!==t||e._committed!==n){Er(e,c[1]);return}for(let t of c[1]){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),Tr(e,n))}Ur(e,c[1]),Er(e,n,c[1])}async function Xr(e,t,n,r,i,a){let o=[t[0],t[1],()=>e._tx===t&&!!t[3].length,e._committed,void 0,i,n,a,r],s=await Br(e,t[2],t[3],o);if(gr(s)){s[0]===mr&&e._tx===t?(Hr(e,t),Er(e,t[3]),t[3]=[],e._tx===t&&await qr(e,t,s[1])):Jr(e,t);return}let c=e._pending;if(c?.[0]===t&&(clearTimeout(c[3]),c[4])){let n=t[0].signal,r=!1;try{r=await _r(c[4],n)}catch(e){if(e!==n)throw e}if(r&&e._pending===c&&c[0]===t){let e=c[2]-Date.now();if(e>0){try{await _r(new Promise(t=>{c[3]=setTimeout(t,e)}),n)}catch{}clearTimeout(c[3])}}}if(e._tx!==t){Hr(e,t),Wr(e,s);return}let l=t[2],u=Xn(l,e.stores.resolvedLocation.get()),d=s[2];await e.startViewTransition(async()=>{if(e._tx!==t){Wr(e,s);return}let n=await e.startTransition(()=>{Hr(e,t),Gr(e,t,s[1],a),e._tx===t&&(e.emit({type:`onLoad`,...u}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...u}))},s[1]);if(e._tx!==t){Ir(e,s);return}d?.length&&Yr(e,t,s[1],d,s[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...u}),n&&e._tx===t&&e.emit({type:`onRendered`,...u})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function Zr(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),u.signal.aborted){await Kr(e,n);return}let f=Xn(a,r);if(e.emit({type:`onBeforeNavigate`,...f}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...f}),u.signal.aborted){await Kr(e,n);return}let p=i.href===a.href,m,h=u;try{m=e.matchRoutes(a,{_controller:u}),Dr(m)}catch(t){if(u.abort(),!Pn(t)){await Kr(e),e._commitPromise?.resolve(),e._commitPromise=void 0;return}await e.navigate({...t.options,replace:!0,ignoreBlocker:!0}),await Kr(e,n);return}let g=l?c[1](m):void 0;if(g?h=l:l?.abort(),u.signal.aborted){Er(e,m),await Kr(e,n);return}e._preflight=void 0;let _=[h,s,a,m,Date.now(),Promise.resolve().then(()=>Xr(e,_,p,()=>Vr(e,_),t?.sync,g)).catch(()=>{e._tx===_&&Jr(e,_)})];if(e._tx=_,n){for(let t of e.stores.matches.get()){if(e._tx!==_)break;t.isFetching&&Or(e,t,!1)}n[0].abort(),Er(e,n[3],_[3],!0)}if(e._tx!==_){Er(e,_[3]),_[3]=[],await Kr(e,_);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),!r&&!m.some(e=>e._notFound)&&Vr(e,_);try{await _[5]}finally{await Kr(e,_)}}async function Qr(e,t,n=0){if(n>20)return;let r=t._builtLocation??e.buildLocation(t),i=e._committed,a=new AbortController,o;try{o=e.matchRoutes(r,{_controller:a}),Dr(o)}catch(e){a.abort(),ln(e)||console.error(e);return}(e._preloads??=new Map).set(a,o);let s;try{let t;try{t=await Br(e,r,o,[a,n,()=>!0,i,!0])}finally{s=e._preloads.delete(a),Er(e,o),a.abort()}if(!gr(t))return t[1];if(s&&t[0]===mr&&!t[1].options.reloadDocument)return Qr(e,{...t[1].options,_fromLocation:r},n+1)}catch(e){ln(e)||console.error(e)}}var $r=`Error preloading route! ☝️`,ei=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Mn:this.parentRoute||wt();let r=n?Mn:t?.path;r&&r!==`/`&&(r=Zt(r));let i=t?.id||r,a=n?Mn:Yt([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Yt([`/`,a]));let o=a===`__root__`?`/`:Yt([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Qt(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Nn({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},ti=class{constructor({id:e}){this.notFound=e=>cn({routeId:this.id,...e}),this.redirect=e=>Nn({from:this.id,...e}),this.id=e}},ni=class extends ei{constructor(e){super(e)}};function ri(e){return(0,X.jsx)(ii,{...e})}var ii=class extends Y.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?Y.createElement(this.props.errorComponent??ai,{error:e,reset:this.reset}):this.props.children}};function ai({error:e}){let[t,n]=Y.useState(!1);return(0,X.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,X.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,X.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,X.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,X.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,X.jsx)(`div`,{children:(0,X.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,X.jsx)(`code`,{children:e.message}):null})}):null]})}function oi({children:e,fallback:t=null}){return(0,X.jsx)(Y.Fragment,{children:si()?e:t})}function si(){return Y.useSyncExternalStore(ci,()=>!0,()=>!1)}function ci(){return()=>{}}var li=Y.createContext(null);function ui(e){return Y.useContext(li)}var di=Y.createContext(void 0),fi=Y.createContext(void 0),pi=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(pi||{});function mi({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function hi(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var gi=[],_i=0,{link:vi,unlink:yi,propagate:bi,checkDirty:xi,shallowPropagate:Si}=mi({update(e){return e._update()},notify(e){gi[wi++]=e,e.flags&=~pi.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=pi.Mutable|pi.Dirty,Oi(e))}}),Ci=0,wi=0,Ti,Ei=0;function Di(e){try{++Ei,e()}finally{--Ei||ki()}}function Oi(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=yi(n,e)}function ki(){if(!(Ei>0)){for(;Ci<wi;){let e=gi[Ci];gi[Ci++]=void 0,e.notify()}Ci=0,wi=0}}function Ai(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?pi.None:pi.Mutable,get(){return Ti!==void 0&&vi(i,Ti,_i),i._snapshot},subscribe(e){let t=hi(e),n={current:!1},r=ji(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Ti,o=t?.compare??Object.is;if(n)Ti=i,++_i,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=pi.Mutable|pi.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Ti=a,n&&(i.flags&=~pi.RecursedCheck),Oi(i)}}};return n?(i.flags=pi.Mutable|pi.Dirty,i.get=function(){let e=i.flags;if(e&pi.Dirty||e&pi.Pending&&xi(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Si(e)}}else e&pi.Pending&&(i.flags=e&~pi.Pending);return Ti!==void 0&&vi(i,Ti,_i),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(bi(e),Si(e),ki())}},i}function ji(e){let t=()=>{let t=Ti;Ti=n,++_i,n.depsTail=void 0,n.flags=pi.Watching|pi.RecursedCheck;try{return e()}finally{Ti=t,n.flags&=~pi.RecursedCheck,Oi(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:pi.Watching|pi.RecursedCheck,notify(){let e=this.flags;e&pi.Dirty||e&pi.Pending&&xi(this.deps,this)?t():this.flags=pi.Watching},stop(){this.flags=pi.None,this.depsTail=void 0,Oi(this)}};return t(),n}var Mi=s((e=>{var t=je();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Ni=s(((e,t)=>{t.exports=Mi()})),Pi=s((e=>{var t=je(),n=Ni();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Fi=u(s(((e,t)=>{t.exports=Pi()}))(),1);function Ii(e,t){return e===t}function Li(e,t,n=Ii){let r=(0,Y.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,Y.useCallback)(()=>e?.get(),[e]);return(0,Fi.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Ri={};function zi(e,t){let n=Y.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=ut(n.current,i):i}}function Bi(e){let t=ui(),n=Y.useContext(e.from?fi:di),r=e.from??n,i=t.stores.getMatchStore(r),a=zi(e,t),o=Li(i,e=>e?a(e):Ri);if(o!==Ri)return o;(e.shouldThrow??!0)&&wt()}function Vi(e){return Bi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Hi(e){let{select:t,...n}=e;return Bi({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Ui(e){return Bi({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Wi(e){return Bi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Gi(e){let t=ui();return Y.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Ki(e){let t=ui(),n=Gi(),r=Y.useRef(null);return $e(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function qi(e){return Bi({...e,select:t=>e.select?e.select(t.context):t.context})}var Ji=s((e=>{var t=je();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}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.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),Yi=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ji()})),Xi=u(Yi(),1);function Zi(e){let t=Y.useRef(e);return ht(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function Qi(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function $i(e,t,n){if(e?.external)return bt(e.href,n)?void 0:e.href;if(!da(t)&&typeof t==`string`&&t.indexOf(`:`)!==-1)try{return new URL(t),bt(t,n)?void 0:t}catch{}}function ea(e,t,n,r,i,a){if(a)return!1;if(n?.exact){if(!tn(e.pathname,t.pathname,r))return!1}else{let n=en(e.pathname,r),i=en(t.pathname,r);if(!(n.startsWith(i)&&(n.length===i.length||n[i.length]===`/`)))return!1}return(n?.includeSearch??!0)&&!ht(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function ta(e,t){let n=ui(),r=tt(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:x,onBlur:S,onFocus:C,onMouseEnter:w,onMouseLeave:T,onTouchStart:E,ignoreBlocker:D,params:O,search:k,hash:A,state:j,mask:M,reloadDocument:N,unsafeRelative:P,from:F,_fromLocation:I,...L}=e,R=si(),z=Zi(e.search),B=Zi(e.params),V=Zi(o),H=Y.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,z,B,e.state,e.mask,e.unsafeRelative]),U=Y.useCallback(e=>{let t=n.buildLocation({_fromLocation:e,...H}),r=ua(t.maskedLocation?t.maskedLocation.publicHref:t.publicHref,t.maskedLocation?t.maskedLocation.external:t.external,n.history,v),i=$i(r,s,n.protocolAllowlist);return[r?.href,i,ea(e,t,V,n.basepath,R,i!==void 0)]},[V,v,R,H,n,s]),[W,G,K]=Li(n.stores.location,U,Qi),q=K?it(i,{})??ra:na,J=K?na:it(a,{})??na,ee=[b,q.className,J.className].filter(Boolean).join(` `),te=(y||q.style||J.style)&&{...y,...q.style,...J.style},[ne,re]=Y.useState(!1),ie=Y.useRef(!1),ae=e.reloadDocument||G?!1:c??n.options.defaultPreload,oe=l??n.options.defaultPreloadDelay??0,se=Y.useCallback(()=>{n.preloadRoute(H).catch(e=>{console.warn(e),console.warn($r)})},[n,H]);et(r,Y.useCallback(e=>{e?.isIntersecting&&se()},[se]),ca,!!v||ae!==`viewport`),Y.useEffect(()=>{ie.current||!v&&ae===`render`&&(se(),ie.current=!0)},[v,se,ae]);let ce=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;if(!v&&!pa(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,Xi.flushSync)(()=>{re(!0)});let t=n.subscribe(`onResolved`,()=>{t(),re(!1)});n.navigate({...H,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:D})}};if(G)return{...L,ref:r,href:G,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...x&&{onClick:x},...S&&{onBlur:S},...C&&{onFocus:C},...w&&{onMouseEnter:w},...T&&{onMouseLeave:T},...E&&{onTouchStart:E}};let le=e=>{if(v||ae!==`intent`)return;if(!oe){se();return}let t=e.currentTarget;if(sa.has(t))return;let n=setTimeout(()=>{sa.delete(t),se()},oe);sa.set(t,n)},ue=e=>{v||ae!==`intent`||se()},de=e=>{if(v||!ae||!oe)return;let t=e.currentTarget,n=sa.get(t);n&&(clearTimeout(n),sa.delete(t))};return{...L,...q,...J,href:W,ref:r,onClick:la([x,ce]),onBlur:la([S,de]),onFocus:la([C,le]),onMouseEnter:la([w,le]),onMouseLeave:la([T,de]),onTouchStart:la([E,ue]),disabled:!!v,target:_,...te&&{style:te},...ee&&{className:ee},...v&&ia,...K&&aa,...R&&ne&&oa}}var na={},ra={className:`active`},ia={role:`link`,"aria-disabled":!0},aa={"data-status":`active`,"aria-current":`page`},oa={"data-transitioning":`transitioning`},sa=new WeakMap,ca={rootMargin:`100px`},la=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function ua(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function da(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var fa=Y.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=ta(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return Y.createElement(`a`,t,o)}return Y.createElement(n,a,o)});function pa(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ma(e){return new ha({id:e})}var ha=class extends ti{constructor({id:e}){super({id:e}),this.useMatch=e=>Bi({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>qi({...e,from:this.id}),this.useSearch=e=>Wi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Ui({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Hi({...e,from:this.id,strict:!1}),this.useLoaderData=e=>Vi({...e,from:this.id,strict:!1}),this.useNavigate=()=>Gi({from:ui().routesById[this.id].fullPath}),this.notFound=e=>cn({routeId:this.id,...e}),this.Link=Y.forwardRef((e,t)=>{let n=ui().routesById[this.id].fullPath;return(0,X.jsx)(fa,{ref:t,from:n,...e})})}},ga=class extends ei{constructor(e){super(e),this.useMatch=e=>Bi({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>qi({...e,from:this.id}),this.useSearch=e=>Wi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Ui({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Hi({...e,from:this.id}),this.useLoaderData=e=>Vi({...e,from:this.id}),this.useNavigate=()=>Gi({from:this.fullPath}),this.Link=Y.forwardRef((e,t)=>(0,X.jsx)(fa,{ref:t,from:this.fullPath,...e}))}};function _a(e){return new ga(e)}var va=class extends ni{constructor(e){super(e),this.useMatch=e=>Bi({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>qi({...e,from:this.id}),this.useSearch=e=>Wi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Ui({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Hi({...e,from:this.id}),this.useLoaderData=e=>Vi({...e,from:this.id}),this.useNavigate=()=>Gi({from:this.fullPath}),this.Link=Y.forwardRef((e,t)=>(0,X.jsx)(fa,{ref:t,from:this.fullPath,...e}))}};function ya(e){return new va(e)}function ba(e){let t=ui(),n=`not-found-${Li(t.stores.location,e=>e.pathname)}-${Li(t.stores.status,e=>e)}`;return(0,X.jsx)(ri,{getResetKey:()=>n,onCatch:(t,n)=>{if(ln(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(ln(t))return e.fallback?.(t);throw t},children:e.children})}function xa(){return(0,X.jsx)(`p`,{children:`Not Found`})}function Sa(e){return(0,X.jsx)(X.Fragment,{children:e.children})}function Ca(e,t,n){return t.options.notFoundComponent?(0,X.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,X.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,X.jsx)(xa,{})}function wa(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,X.jsx)(n,{}):null}var Ta=(e,t)=>e[0]===t[0]&&e[1]===t[1],Ea=Y.memo(function({routeId:e}){let t=ui();return(0,X.jsx)(Da,{router:t,match:Li(t.stores.getMatchStore(e),e=>e)})});function Da({router:e,match:t}){let n=e.routesById[t.routeId],r=wa(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)?Y.Suspense:Sa,l=i?ri:Sa,u=o?ba:Sa;return(0,X.jsxs)(n.isRoot?n.options.shellComponent??Sa:Sa,{children:[(0,X.jsx)(di.Provider,{value:t.routeId,children:(0,X.jsx)(c,{fallback:r,children:(0,X.jsx)(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(ln(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:(0,X.jsx)(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return Y.createElement(o,e)},children:s?(0,X.jsx)(oi,{fallback:r,children:(0,X.jsx)(Oa,{match:t})}):(0,X.jsx)(Oa,{match:t})})})})}),null]})}var Oa=Y.memo(function({match:e}){let t=ui(),n=e.routeId,r=t.routesById[n],i=Y.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=Y.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,X.jsx)(e,{},i):(0,X.jsx)(ka,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t._tx)throw t._tx[5];return wa(t,r)}if(e.status===`notFound`)return Ca(t,r,e.error);if(e.status===`error`)throw e.error;return a}),ka=Y.memo(function(){let e=ui(),t=Y.useContext(di),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=Li(a,e=>[!!e._notFound,e.error],Ta),i=Li(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Ca(e,e.routesById[t],r);if(!i)return null;let a=(0,X.jsx)(Ea,{routeId:i});return t===`__root__`?(0,X.jsx)(Y.Suspense,{fallback:wa(e),children:a}):a});function Aa(e,t){let n=e[1];e.length=0,n?.(t)}function ja({t:e}){let t=ui(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise((a,o)=>{Aa(n,!1),n.push(i,a),e(t),Y.startTransition(()=>{try{r()}catch(e){n[1]===a&&(n.length=0),o(e)}})}),$e(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Qt(r.publicHref)!==Qt(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...Xn(a,a)})}):t._tx||t.load().catch(console.error),e},[t,t.history]),null}function Ma(){let e=ui(),t=e.routesById[Mn],n=wa(e,t),r=e.ssr?Sa:Y.Suspense,i=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ja,{t:Y.useState()[1]}),(0,X.jsx)(r,{fallback:n,children:(0,X.jsx)(Na,{})})]});return e.options.InnerWrap?(0,X.jsx)(e.options.InnerWrap,{children:i}):i}function Na(){let e=ui(),t=e._rendered,n=Li(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;$e(()=>{t[0]===n&&Aa(t,!0)},[t,n]);let a=i?(0,X.jsx)(Ea,{routeId:i}):null;return(0,X.jsx)(di.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:(0,X.jsx)(ri,{getResetKey:()=>r,onCatch:void 0,children:a})})}var Pa=e=>({createMutableStore:Ai,createReadonlyStore:Ai,batch:Di}),Fa=e=>new Ia(e),Ia=class extends $n{constructor(e){super(e,Pa)}};function La({router:e,children:t,...n}){st(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,X.jsx)(li.Provider,{value:e,children:t});return e.options.Wrap?(0,X.jsx)(e.options.Wrap,{children:r}):r}function Ra({router:e,...t}){return(0,X.jsx)(La,{router:e,...t,children:(0,X.jsx)(Ma,{})})}function za(e){let t=ui({warn:e?.router===void 0}),n=e?.router||t;return Li(n.stores.__store,zi(e,n))}var Ba=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Va=s(((e,t)=>{t.exports=Ba()})),Ha=s((e=>{var t=Va(),n=je(),r=Yi();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}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.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var M=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},I=[],L=-1;function R(e){return{current:e}}function z(e){0>L||(e.current=I[L],I[L]=null,L--)}function B(e,t){L++,I[L]=e.current,e.current=t}var V=R(null),H=R(null),U=R(null),W=R(null);function G(e,t){switch(B(U,t),B(H,e),B(V,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Wd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Wd(t),e=Gd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}z(V),B(V,e)}function K(){z(V),z(H),z(U)}function q(e){e.memoizedState!==null&&B(W,e);var t=V.current,n=Gd(t,e.type);t!==n&&(B(H,e),B(V,n))}function J(e){H.current===e&&(z(V),z(H)),W.current===e&&(z(W),tp._currentValue=F)}var ee,te;function ne(e){if(ee===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ee=t&&t[1]||``,te=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+ee+e+te}var re=!1;function ie(e,t){if(!e||re)return``;re=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{re=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ne(n):``}function ae(e,t){switch(e.tag){case 26:case 27:case 5:return ne(e.type);case 16:return ne(`Lazy`);case 13:return e.child!==t&&t!==null?ne(`Suspense Fallback`):ne(`Suspense`);case 19:return ne(`SuspenseList`);case 0:case 15:return ie(e.type,!1);case 11:return ie(e.type.render,!1);case 1:return ie(e.type,!0);case 31:return ne(`Activity`);default:return``}}function oe(e){try{var t=``,n=null;do t+=ae(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var se=Object.prototype.hasOwnProperty,ce=t.unstable_scheduleCallback,le=t.unstable_cancelCallback,ue=t.unstable_shouldYield,de=t.unstable_requestPaint,fe=t.unstable_now,pe=t.unstable_getCurrentPriorityLevel,me=t.unstable_ImmediatePriority,he=t.unstable_UserBlockingPriority,ge=t.unstable_NormalPriority,_e=t.unstable_LowPriority,ve=t.unstable_IdlePriority,ye=t.log,be=t.unstable_setDisableYieldValue,xe=null,Se=null;function Ce(e){if(typeof ye==`function`&&be(e),Se&&typeof Se.setStrictMode==`function`)try{Se.setStrictMode(xe,e)}catch{}}var we=Math.clz32?Math.clz32:De,Te=Math.log,Ee=Math.LN2;function De(e){return e>>>=0,e===0?32:31-(Te(e)/Ee|0)|0}var Oe=256,ke=262144,Ae=4194304;function Me(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ne(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Me(n))):i=Me(o):i=Me(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Me(n))):i=Me(o)):i=Me(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Y(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function X(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Pe(){var e=Ae;return Ae<<=1,!(Ae&62914560)&&(Ae=4194304),e}function Fe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ie(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Le(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-we(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Re(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Re(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-we(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ze(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-we(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Be(e,t){var n=t&-t;return n=n&42?1:Ve(n),(n&(e.suspendedLanes|t))===0?n:0}function Ve(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function He(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ue(){var e=P.p;return e===0?(e=window.event,e===void 0?32:_p(e.type)):e}function We(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var Ge=Math.random().toString(36).slice(2),Ke=`__reactFiber$`+Ge,qe=`__reactProps$`+Ge,Je=`__reactContainer$`+Ge,Ye=`__reactEvents$`+Ge,Xe=`__reactListeners$`+Ge,Ze=`__reactHandles$`+Ge,Qe=`__reactResources$`+Ge,$e=`__reactMarker$`+Ge;function et(e){delete e[Ke],delete e[qe],delete e[Ye],delete e[Xe],delete e[Ze]}function tt(e){var t=e[Ke];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Je]||n[Ke]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mf(e);e!==null;){if(n=e[Ke])return n;e=mf(e)}return t}e=n,n=e.parentNode}return null}function nt(e){if(e=e[Ke]||e[Je]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function rt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function it(e){var t=e[Qe];return t||=e[Qe]={hoistableStyles:new Map,hoistableScripts:new Map},t}function at(e){e[$e]=!0}var ot=new Set,st={};function ct(e,t){lt(e,t),lt(e+`Capture`,t)}function lt(e,t){for(st[e]=t,e=0;e<t.length;e++)ot.add(t[e])}var ut=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),dt={},ft={};function pt(e){return se.call(ft,e)?!0:se.call(dt,e)?!1:ut.test(e)?ft[e]=!0:(dt[e]=!0,!1)}function mt(e,t,n){if(pt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function ht(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function gt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function _t(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function vt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function yt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bt(e){if(!e._valueTracker){var t=vt(e)?`checked`:`value`;e._valueTracker=yt(e,t,``+e[t])}}function xt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=vt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function St(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Ct=/[\n"\\]/g;function wt(e){return e.replace(Ct,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Tt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+_t(t)):e.value!==``+_t(t)&&(e.value=``+_t(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Dt(e,o,_t(n)):Dt(e,o,_t(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+_t(s):e.removeAttribute(`name`)}function Et(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){bt(e);return}n=n==null?``:``+_t(n),t=t==null?n:``+_t(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),bt(e)}function Dt(e,t,n){t===`number`&&St(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ot(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+_t(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function kt(e,t,n){if(t!=null&&(t=``+_t(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+_t(n)}function At(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(M(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=_t(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),bt(e)}function jt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Mt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Nt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Mt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Pt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Nt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Nt(e,o,t[o])}function Ft(e){if(e.indexOf(`-`)===-1)return!1;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 It=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Lt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Rt(e){return Lt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function zt(){}var Bt=null;function Vt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ht=null,Ut=null;function Wt(e){var t=nt(e);if(t&&(e=t.stateNode)){var n=e[qe]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Tt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+wt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[qe]||null;if(!a)throw Error(i(90));Tt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&xt(r)}break a;case`textarea`:kt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ot(e,!!n.multiple,t,!1)}}}var Gt=!1;function Kt(e,t,n){if(Gt)return e(t,n);Gt=!0;try{return e(t)}finally{if(Gt=!1,(Ht!==null||Ut!==null)&&(bu(),Ht&&(t=Ht,e=Ut,Ut=Ht=null,Wt(t),e)))for(t=0;t<e.length;t++)Wt(e[t])}}function qt(e,t){var n=e.stateNode;if(n===null)return null;var r=n[qe]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Jt=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),Yt=!1;if(Jt)try{var Xt={};Object.defineProperty(Xt,"passive",{get:function(){Yt=!0}}),window.addEventListener(`test`,Xt,Xt),window.removeEventListener(`test`,Xt,Xt)}catch{Yt=!1}var Zt=null,Qt=null,$t=null;function en(){if($t)return $t;var e,t=Qt,n=t.length,r,i=`value`in Zt?Zt.value:Zt.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return $t=i.slice(e,1<r?1-r:void 0)}function tn(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 nn(){return!0}function rn(){return!1}function an(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?nn:rn,this.isPropagationStopped=rn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var on={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sn=an(on),cn=f({},on,{view:0,detail:0}),ln=an(cn),un,dn,fn,pn=f({},cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wn,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!==fn&&(fn&&e.type===`mousemove`?(un=e.screenX-fn.screenX,dn=e.screenY-fn.screenY):dn=un=0,fn=e),un)},movementY:function(e){return`movementY`in e?e.movementY:dn}}),mn=an(pn),hn=an(f({},pn,{dataTransfer:0})),gn=an(f({},cn,{relatedTarget:0})),_n=an(f({},on,{animationName:0,elapsedTime:0,pseudoElement:0})),vn=an(f({},on,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),yn=an(f({},on,{data:0})),bn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},xn={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`},Sn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Cn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Sn[e])?!!t[e]:!1}function wn(){return Cn}var Tn=an(f({},cn,{key:function(e){if(e.key){var t=bn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=tn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?xn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wn,charCode:function(e){return e.type===`keypress`?tn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?tn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),En=an(f({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Dn=an(f({},cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wn})),On=an(f({},on,{propertyName:0,elapsedTime:0,pseudoElement:0})),kn=an(f({},pn,{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})),An=an(f({},on,{newState:0,oldState:0})),jn=[9,13,27,32],Mn=Jt&&`CompositionEvent`in window,Nn=null;Jt&&`documentMode`in document&&(Nn=document.documentMode);var Pn=Jt&&`TextEvent`in window&&!Nn,Fn=Jt&&(!Mn||Nn&&8<Nn&&11>=Nn),In=` `,Ln=!1;function Rn(e,t){switch(e){case`keyup`:return jn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function zn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Bn=!1;function Vn(e,t){switch(e){case`compositionend`:return zn(t);case`keypress`:return t.which===32?(Ln=!0,In):null;case`textInput`:return e=t.data,e===In&&Ln?null:e;default:return null}}function Hn(e,t){if(Bn)return e===`compositionend`||!Mn&&Rn(e,t)?(e=en(),$t=Qt=Zt=null,Bn=!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 Fn&&t.locale!==`ko`?null:t.data;default:return null}}var Un={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 Wn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Un[e.type]:t===`textarea`}function Gn(e,t,n,r){Ht?Ut?Ut.push(r):Ut=[r]:Ht=r,t=Od(t,`onChange`),0<t.length&&(n=new sn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Kn=null,qn=null;function Jn(e){bd(e,0)}function Yn(e){if(xt(rt(e)))return e}function Xn(e,t){if(e===`change`)return t}var Zn=!1;if(Jt){var Qn;if(Jt){var $n=`oninput`in document;if(!$n){var er=document.createElement(`div`);er.setAttribute(`oninput`,`return;`),$n=typeof er.oninput==`function`}Qn=$n}else Qn=!1;Zn=Qn&&(!document.documentMode||9<document.documentMode)}function tr(){Kn&&(Kn.detachEvent(`onpropertychange`,nr),qn=Kn=null)}function nr(e){if(e.propertyName===`value`&&Yn(qn)){var t=[];Gn(t,qn,e,Vt(e)),Kt(Jn,t)}}function rr(e,t,n){e===`focusin`?(tr(),Kn=t,qn=n,Kn.attachEvent(`onpropertychange`,nr)):e===`focusout`&&tr()}function ir(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Yn(qn)}function ar(e,t){if(e===`click`)return Yn(t)}function or(e,t){if(e===`input`||e===`change`)return Yn(t)}function sr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var cr=typeof Object.is==`function`?Object.is:sr;function lr(e,t){if(cr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!se.call(t,i)||!cr(e[i],t[i]))return!1}return!0}function ur(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dr(e,t){var n=ur(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=ur(n)}}function fr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=St(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=St(e.document)}return t}function mr(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`)}var hr=Jt&&`documentMode`in document&&11>=document.documentMode,gr=null,_r=null,vr=null,yr=!1;function br(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;yr||gr==null||gr!==St(r)||(r=gr,`selectionStart`in r&&mr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),vr&&lr(vr,r)||(vr=r,r=Od(_r,`onSelect`),0<r.length&&(t=new sn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=gr)))}function xr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Sr={animationend:xr(`Animation`,`AnimationEnd`),animationiteration:xr(`Animation`,`AnimationIteration`),animationstart:xr(`Animation`,`AnimationStart`),transitionrun:xr(`Transition`,`TransitionRun`),transitionstart:xr(`Transition`,`TransitionStart`),transitioncancel:xr(`Transition`,`TransitionCancel`),transitionend:xr(`Transition`,`TransitionEnd`)},Cr={},wr={};Jt&&(wr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Sr.animationend.animation,delete Sr.animationiteration.animation,delete Sr.animationstart.animation),`TransitionEvent`in window||delete Sr.transitionend.transition);function Tr(e){if(Cr[e])return Cr[e];if(!Sr[e])return e;var t=Sr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in wr)return Cr[e]=t[n];return e}var Er=Tr(`animationend`),Dr=Tr(`animationiteration`),Or=Tr(`animationstart`),kr=Tr(`transitionrun`),Ar=Tr(`transitionstart`),jr=Tr(`transitioncancel`),Mr=Tr(`transitionend`),Nr=new Map,Pr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Pr.push(`scrollEnd`);function Fr(e,t){Nr.set(e,t),ct(t,[e])}var Ir=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Lr=[],Rr=0,zr=0;function Br(){for(var e=Rr,t=zr=Rr=0;t<e;){var n=Lr[t];Lr[t++]=null;var r=Lr[t];Lr[t++]=null;var i=Lr[t];Lr[t++]=null;var a=Lr[t];if(Lr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Wr(n,i,a)}}function Vr(e,t,n,r){Lr[Rr++]=e,Lr[Rr++]=t,Lr[Rr++]=n,Lr[Rr++]=r,zr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Hr(e,t,n,r){return Vr(e,t,n,r),Gr(e)}function Ur(e,t){return Vr(e,null,null,t),Gr(e)}function Wr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-we(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Gr(e){if(50<du)throw du=0,fu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Kr={};function qr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jr(e,t,n,r){return new qr(e,t,n,r)}function Yr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xr(e,t){var n=e.alternate;return n===null?(n=Jr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Zr(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Qr(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)Yr(e)&&(s=1);else if(typeof e==`string`)s=Kf(e,n,V.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=Jr(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return $r(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=Jr(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=Jr(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=Jr(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Jr(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function $r(e,t,n,r){return e=Jr(7,e,r,t),e.lanes=n,e}function ei(e,t,n){return e=Jr(6,e,null,t),e.lanes=n,e}function ti(e){var t=Jr(18,null,null,0);return t.stateNode=e,t}function ni(e,t,n){return t=Jr(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ri=new WeakMap;function ii(e,t){if(typeof e==`object`&&e){var n=ri.get(e);return n===void 0?(t={value:e,source:t,stack:oe(t)},ri.set(e,t),t):n}return{value:e,source:t,stack:oe(t)}}var ai=[],oi=0,si=null,ci=0,li=[],ui=0,di=null,fi=1,pi=``;function mi(e,t){ai[oi++]=ci,ai[oi++]=si,si=e,ci=t}function hi(e,t,n){li[ui++]=fi,li[ui++]=pi,li[ui++]=di,di=e;var r=fi;e=pi;var i=32-we(r)-1;r&=~(1<<i),n+=1;var a=32-we(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,fi=1<<32-we(t)+i|n<<i|r,pi=a+e}else fi=1<<a|n<<i|r,pi=e}function gi(e){e.return!==null&&(mi(e,1),hi(e,1,0))}function _i(e){for(;e===si;)si=ai[--oi],ai[oi]=null,ci=ai[--oi],ai[oi]=null;for(;e===di;)di=li[--ui],li[ui]=null,pi=li[--ui],li[ui]=null,fi=li[--ui],li[ui]=null}function vi(e,t){li[ui++]=fi,li[ui++]=pi,li[ui++]=di,fi=t.id,pi=t.overflow,di=e}var yi=null,bi=null,xi=!1,Si=null,Ci=!1,wi=Error(i(519));function Ti(e){throw ji(ii(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),wi}function Ei(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ke]=e,t[qe]=r,n){case`dialog`:xd(`cancel`,t),xd(`close`,t);break;case`iframe`:case`object`:case`embed`:xd(`load`,t);break;case`video`:case`audio`:for(n=0;n<vd.length;n++)xd(vd[n],t);break;case`source`:xd(`error`,t);break;case`img`:case`image`:case`link`:xd(`error`,t),xd(`load`,t);break;case`details`:xd(`toggle`,t);break;case`input`:xd(`invalid`,t),Et(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:xd(`invalid`,t);break;case`textarea`:xd(`invalid`,t),At(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Pd(t.textContent,n)?(r.popover!=null&&(xd(`beforetoggle`,t),xd(`toggle`,t)),r.onScroll!=null&&xd(`scroll`,t),r.onScrollEnd!=null&&xd(`scrollend`,t),r.onClick!=null&&(t.onclick=zt),t=!0):t=!1,t||Ti(e,!0)}function Di(e){for(yi=e.return;yi;)switch(yi.tag){case 5:case 31:case 13:Ci=!1;return;case 27:case 3:Ci=!0;return;default:yi=yi.return}}function Oi(e){if(e!==yi)return!1;if(!xi)return Di(e),xi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Kd(e.type,e.memoizedProps)),n=!n),n&&bi&&Ti(e),Di(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));bi=pf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));bi=pf(e)}else t===27?(t=bi,ef(e.type)?(e=ff,ff=null,bi=e):bi=t):bi=yi?df(e.stateNode.nextSibling):null;return!0}function ki(){bi=yi=null,xi=!1}function Ai(){var e=Si;return e!==null&&(Zl===null?Zl=e:Zl.push.apply(Zl,e),Si=null),e}function ji(e){Si===null?Si=[e]:Si.push(e)}var Mi=R(null),Ni=null,Pi=null;function Fi(e,t,n){B(Mi,t._currentValue),t._currentValue=n}function Ii(e){e._currentValue=Mi.current,z(Mi)}function Li(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ri(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Li(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Li(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function zi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;cr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===W.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[tp]:e.push(tp))}a=a.return}e!==null&&Ri(t,e,n,r),t.flags|=262144}function Bi(e){for(e=e.firstContext;e!==null;){if(!cr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Vi(e){Ni=e,Pi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Hi(e){return Wi(Ni,e)}function Ui(e,t){return Ni===null&&Vi(e),Wi(e,t)}function Wi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Pi===null){if(e===null)throw Error(i(308));Pi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Pi=Pi.next=t;return n}var Gi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ki=t.unstable_scheduleCallback,qi=t.unstable_NormalPriority,Ji={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xi(){return{controller:new Gi,data:new Map,refCount:0}}function Zi(e){e.refCount--,e.refCount===0&&Ki(qi,function(){e.controller.abort()})}var Qi=null,$i=0,ea=0,ta=null;function na(e,t){if(Qi===null){var n=Qi=[];$i=0,ea=fd(),ta={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return $i++,t.then(ra,ra),t}function ra(){if(--$i===0&&Qi!==null){ta!==null&&(ta.status=`fulfilled`);var e=Qi;Qi=null,ea=0,ta=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ia(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var aa=N.S;N.S=function(e,t){eu=fe(),typeof t==`object`&&t&&typeof t.then==`function`&&na(e,t),aa!==null&&aa(e,t)};var oa=R(null);function sa(){var e=oa.current;return e===null?Fl.pooledCache:e}function ca(e,t){t===null?B(oa,oa.current):B(oa,t.pool)}function la(){var e=sa();return e===null?null:{parent:Ji._currentValue,pool:e}}var ua=Error(i(460)),da=Error(i(474)),fa=Error(i(542)),pa={then:function(){}};function ma(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ha(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(zt,zt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ya(e),e;default:if(typeof t.status==`string`)t.then(zt,zt);else{if(e=Fl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ya(e),e}throw _a=t,ua}}function ga(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(_a=e,ua):e}}var _a=null;function va(){if(_a===null)throw Error(i(459));var e=_a;return _a=null,e}function ya(e){if(e===ua||e===fa)throw Error(i(483))}var ba=null,xa=0;function Sa(e){var t=xa;return xa+=1,ba===null&&(ba=[]),ha(ba,e,t)}function Ca(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function wa(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ta(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Xr(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ei(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&ga(i)===t.type)?(t=a(t,n.props),Ca(t,n),t.return=e,t):(t=Qr(n.type,n.key,n.props,null,e.mode,r),Ca(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ni(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=$r(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ei(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=Qr(t.type,t.key,t.props,null,e.mode,n),Ca(n,t),n.return=e,n;case h:return t=ni(t,e.mode,n),t.return=e,t;case T:return t=ga(t),f(e,t,n)}if(M(t)||k(t))return t=$r(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Sa(t),n);if(t.$$typeof===b)return f(e,Ui(e,t),n);wa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=ga(n),p(e,t,n,r)}if(M(n)||k(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Sa(n),r);if(n.$$typeof===b)return p(e,t,Ui(e,n),r);wa(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=ga(r),_(e,t,n,r,i)}if(M(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Sa(r),i);if(r.$$typeof===b)return _(e,t,n,Ui(t,r),i);wa(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),xi&&mi(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return xi&&mi(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),xi&&mi(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),xi&&mi(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return xi&&mi(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),xi&&mi(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&ga(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ca(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===g?(c=$r(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=Qr(o.type,o.key,o.props,null,e.mode,c),Ca(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=ni(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=ga(o),x(e,r,o,c)}if(M(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Sa(o),c);if(o.$$typeof===b)return x(e,r,Ui(e,o),c);wa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ei(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{xa=0;var i=x(e,t,n,r);return ba=null,i}catch(t){if(t===ua||t===fa)throw t;var a=Jr(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ea=Ta(!0),Da=Ta(!1),Oa=!1;function ka(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Aa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ma(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Pl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Gr(e),Wr(e,null,n),t}return Vr(e,r,t,n),Gr(e)}function Na(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ze(e,n)}}function Pa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Fa=!1;function Ia(){if(Fa){var e=ta;if(e!==null)throw e}}function La(e,t,n,r){Fa=!1;var i=e.updateQueue;Oa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Ll&p)===p:(r&p)===p){p!==0&&p===ea&&(Fa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Oa=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function Ra(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ra(n[e],t)}var Ba=R(null),Ha=R(0);function Ua(e,t){e=Ul,B(Ha,e),B(Ba,t),Ul=e|t.baseLanes}function Wa(){B(Ha,Ul),B(Ba,Ba.current)}function Ga(){Ul=Ha.current,z(Ba),z(Ha)}var Ka=R(null),qa=null;function Ja(e){var t=e.alternate;B($a,$a.current&1),B(Ka,e),qa===null&&(t===null||Ba.current!==null||t.memoizedState!==null)&&(qa=e)}function Ya(e){B($a,$a.current),B(Ka,e),qa===null&&(qa=e)}function Xa(e){e.tag===22?(B($a,$a.current),B(Ka,e),qa===null&&(qa=e)):Za(e)}function Za(){B($a,$a.current),B(Ka,Ka.current)}function Qa(e){z(Ka),qa===e&&(qa=null),z($a)}var $a=R(0);function eo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||cf(n)||lf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){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 to=0,no=null,ro=null,io=null,ao=!1,oo=!1,so=!1,co=0,lo=0,uo=null,fo=0;function po(){throw Error(i(321))}function mo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!cr(e[n],t[n]))return!1;return!0}function ho(e,t,n,r,i,a){return to=a,no=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Ms:Ns,so=!1,a=n(r,i),so=!1,oo&&(a=_o(t,n,r,i)),go(e),a}function go(e){N.H=js;var t=ro!==null&&ro.next!==null;if(to=0,io=ro=no=null,ao=!1,lo=0,uo=null,t)throw Error(i(300));e===null||Xs||(e=e.dependencies,e!==null&&Bi(e)&&(Xs=!0))}function _o(e,t,n,r){no=e;var a=0;do{if(oo&&(uo=null),lo=0,oo=!1,25<=a)throw Error(i(301));if(a+=1,io=ro=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Ps,o=t(n,r)}while(oo);return o}function vo(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?To(t):t,e=e.useState()[0],(ro===null?null:ro.memoizedState)!==e&&(no.flags|=1024),t}function yo(){var e=co!==0;return co=0,e}function bo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function xo(e){if(ao){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ao=!1}to=0,io=ro=no=null,oo=!1,lo=co=0,uo=null}function So(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return io===null?no.memoizedState=io=e:io=io.next=e,io}function Co(){if(ro===null){var e=no.alternate;e=e===null?null:e.memoizedState}else e=ro.next;var t=io===null?no.memoizedState:io.next;if(t!==null)io=t,ro=e;else{if(e===null)throw no.alternate===null?Error(i(467)):Error(i(310));ro=e,e={memoizedState:ro.memoizedState,baseState:ro.baseState,baseQueue:ro.baseQueue,queue:ro.queue,next:null},io===null?no.memoizedState=io=e:io=io.next=e}return io}function wo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function To(e){var t=lo;return lo+=1,uo===null&&(uo=[]),e=ha(uo,e,t),t=no,(io===null?t.memoizedState:io.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Ms:Ns),e}function Eo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return To(e);if(e.$$typeof===b)return Hi(e)}throw Error(i(438,String(e)))}function Do(e){var t=null,n=no.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=no.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=wo(),no.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=D;return t.index++,n}function Oo(e,t){return typeof t==`function`?t(e):t}function ko(e){return Ao(Co(),ro,e)}function Ao(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(to&f)===f:(Ll&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ea&&(d=!0);else if((to&p)===p){u=u.next,p===ea&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,no.lanes|=p,Gl|=p;f=u.action,so&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,no.lanes|=f,Gl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!cr(o,e.memoizedState)&&(Xs=!0,d&&(n=ta,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function jo(e){var t=Co(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);cr(o,t.memoizedState)||(Xs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Mo(e,t,n){var r=no,a=Co(),o=xi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!cr((ro||a).memoizedState,n);if(s&&(a.memoizedState=n,Xs=!0),a=a.queue,rs(Fo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||io!==null&&io.memoizedState.tag&1){if(r.flags|=2048,Qo(9,{destroy:void 0},Po.bind(null,r,a,n,t),null),Fl===null)throw Error(i(349));o||to&127||No(r,t,n)}return n}function No(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=no.updateQueue,t===null?(t=wo(),no.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Po(e,t,n,r){t.value=n,t.getSnapshot=r,Io(t)&&Lo(e)}function Fo(e,t,n){return n(function(){Io(t)&&Lo(e)})}function Io(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!cr(e,n)}catch{return!0}}function Lo(e){var t=Ur(e,2);t!==null&&hu(t,e,2)}function Ro(e){var t=So();if(typeof e==`function`){var n=e;if(e=n(),so){Ce(!0);try{n()}finally{Ce(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:e},t}function zo(e,t,n,r){return e.baseState=n,Ao(e,ro,typeof r==`function`?r:Oo)}function Bo(e,t,n,r,a){if(Os(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Vo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Vo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Ho(e,t,s)}catch(n){Wo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Ho(e,t,a)}catch(n){Wo(e,t,n)}}function Ho(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Uo(e,t,n)},function(n){return Wo(e,t,n)}):Uo(e,t,n)}function Uo(e,t,n){t.status=`fulfilled`,t.value=n,Go(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Vo(e,n)))}function Wo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Go(t),t=t.next;while(t!==r)}e.action=null}function Go(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ko(e,t){return t}function qo(e,t){if(xi){var n=Fl.formState;if(n!==null){a:{var r=no;if(xi){if(bi){b:{for(var i=bi,a=Ci;i.nodeType!==8;){if(!a){i=null;break b}if(i=df(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){bi=df(i.nextSibling),r=i.data===`F!`;break a}}Ti(r)}r=!1}r&&(t=n[0])}}return n=So(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:t},n.queue=r,n=Ts.bind(null,no,r),r.dispatch=n,r=Ro(!1),a=Ds.bind(null,no,!1,r.queue),r=So(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Bo.bind(null,no,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Jo(e){return Yo(Co(),ro,e)}function Yo(e,t,n){if(t=Ao(e,t,Ko)[0],e=ko(Oo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=To(t)}catch(e){throw e===ua?fa:e}else r=t;t=Co();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(no.flags|=2048,Qo(9,{destroy:void 0},Xo.bind(null,i,n),null)),[r,a,e]}function Xo(e,t){e.action=t}function Zo(e){var t=Co(),n=ro;if(n!==null)return Yo(t,n,e);Co(),t=t.memoizedState,n=Co();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Qo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=no.updateQueue,t===null&&(t=wo(),no.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function $o(){return Co().memoizedState}function es(e,t,n,r){var i=So();no.flags|=e,i.memoizedState=Qo(1|t,{destroy:void 0},n,r===void 0?null:r)}function ts(e,t,n,r){var i=Co();r=r===void 0?null:r;var a=i.memoizedState.inst;ro!==null&&r!==null&&mo(r,ro.memoizedState.deps)?i.memoizedState=Qo(t,a,n,r):(no.flags|=e,i.memoizedState=Qo(1|t,a,n,r))}function ns(e,t){es(8390656,8,e,t)}function rs(e,t){ts(2048,8,e,t)}function is(e){no.flags|=4;var t=no.updateQueue;if(t===null)t=wo(),no.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function as(e){var t=Co().memoizedState;return is({ref:t,nextImpl:e}),function(){if(Pl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function os(e,t){return ts(4,2,e,t)}function ss(e,t){return ts(4,4,e,t)}function cs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ls(e,t,n){n=n==null?null:n.concat([e]),ts(4,4,cs.bind(null,t,e),n)}function us(){}function ds(e,t){var n=Co();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&mo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function fs(e,t){var n=Co();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&mo(t,r[1]))return r[0];if(r=e(),so){Ce(!0);try{e()}finally{Ce(!1)}}return n.memoizedState=[r,t],r}function ps(e,t,n){return n===void 0||to&1073741824&&!(Ll&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),no.lanes|=e,Gl|=e,n)}function ms(e,t,n,r){return cr(n,t)?n:Ba.current===null?!(to&42)||to&1073741824&&!(Ll&261930)?(Xs=!0,e.memoizedState=n):(e=mu(),no.lanes|=e,Gl|=e,t):(e=ps(e,n,r),cr(e,t)||(Xs=!0),e)}function hs(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,Ds(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Es(e,t,ia(c,r),pu(e)):Es(e,t,r,pu(e))}catch(n){Es(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function gs(){}function _s(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=vs(e).queue;hs(e,a,t,F,n===null?gs:function(){return ys(e),n(r)})}function vs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ys(e){var t=vs(e);t.next===null&&(t=e.alternate.memoizedState),Es(e,t.next.queue,{},pu())}function bs(){return Hi(tp)}function xs(){return Co().memoizedState}function Ss(){return Co().memoizedState}function Cs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=ja(n);var r=Ma(t,e,n);r!==null&&(hu(r,t,n),Na(r,t,n)),t={cache:Xi()},e.payload=t;return}t=t.return}}function ws(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Os(e)?ks(t,n):(n=Hr(e,t,n,r),n!==null&&(hu(n,e,r),As(n,t,r)))}function Ts(e,t,n){Es(e,t,n,pu())}function Es(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Os(e))ks(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,cr(s,o))return Vr(e,t,i,0),Fl===null&&Br(),!1}catch{}if(n=Hr(e,t,i,r),n!==null)return hu(n,e,r),As(n,t,r),!0}return!1}function Ds(e,t,n,r){if(r={lane:2,revertLane:fd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Os(e)){if(t)throw Error(i(479))}else t=Hr(e,n,r,2),t!==null&&hu(t,e,2)}function Os(e){var t=e.alternate;return e===no||t!==null&&t===no}function ks(e,t){oo=ao=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function As(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ze(e,n)}}var js={readContext:Hi,use:Eo,useCallback:po,useContext:po,useEffect:po,useImperativeHandle:po,useLayoutEffect:po,useInsertionEffect:po,useMemo:po,useReducer:po,useRef:po,useState:po,useDebugValue:po,useDeferredValue:po,useTransition:po,useSyncExternalStore:po,useId:po,useHostTransitionStatus:po,useFormState:po,useActionState:po,useOptimistic:po,useMemoCache:po,useCacheRefresh:po};js.useEffectEvent=po;var Ms={readContext:Hi,use:Eo,useCallback:function(e,t){return So().memoizedState=[e,t===void 0?null:t],e},useContext:Hi,useEffect:ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),es(4194308,4,cs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return es(4194308,4,e,t)},useInsertionEffect:function(e,t){es(4,2,e,t)},useMemo:function(e,t){var n=So();t=t===void 0?null:t;var r=e();if(so){Ce(!0);try{e()}finally{Ce(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=So();if(n!==void 0){var i=n(t);if(so){Ce(!0);try{n(t)}finally{Ce(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ws.bind(null,no,e),[r.memoizedState,e]},useRef:function(e){var t=So();return e={current:e},t.memoizedState=e},useState:function(e){e=Ro(e);var t=e.queue,n=Ts.bind(null,no,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:us,useDeferredValue:function(e,t){return ps(So(),e,t)},useTransition:function(){var e=Ro(!1);return e=hs.bind(null,no,e.queue,!0,!1),So().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=no,a=So();if(xi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Fl===null)throw Error(i(349));Ll&127||No(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ns(Fo.bind(null,r,o,e),[e]),r.flags|=2048,Qo(9,{destroy:void 0},Po.bind(null,r,o,n,t),null),n},useId:function(){var e=So(),t=Fl.identifierPrefix;if(xi){var n=pi,r=fi;n=(r&~(1<<32-we(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=co++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=fo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:bs,useFormState:qo,useActionState:qo,useOptimistic:function(e){var t=So();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ds.bind(null,no,!0,n),n.dispatch=t,[e,t]},useMemoCache:Do,useCacheRefresh:function(){return So().memoizedState=Cs.bind(null,no)},useEffectEvent:function(e){var t=So(),n={impl:e};return t.memoizedState=n,function(){if(Pl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ns={readContext:Hi,use:Eo,useCallback:ds,useContext:Hi,useEffect:rs,useImperativeHandle:ls,useInsertionEffect:os,useLayoutEffect:ss,useMemo:fs,useReducer:ko,useRef:$o,useState:function(){return ko(Oo)},useDebugValue:us,useDeferredValue:function(e,t){return ms(Co(),ro.memoizedState,e,t)},useTransition:function(){var e=ko(Oo)[0],t=Co().memoizedState;return[typeof e==`boolean`?e:To(e),t]},useSyncExternalStore:Mo,useId:xs,useHostTransitionStatus:bs,useFormState:Jo,useActionState:Jo,useOptimistic:function(e,t){return zo(Co(),ro,e,t)},useMemoCache:Do,useCacheRefresh:Ss};Ns.useEffectEvent=as;var Ps={readContext:Hi,use:Eo,useCallback:ds,useContext:Hi,useEffect:rs,useImperativeHandle:ls,useInsertionEffect:os,useLayoutEffect:ss,useMemo:fs,useReducer:jo,useRef:$o,useState:function(){return jo(Oo)},useDebugValue:us,useDeferredValue:function(e,t){var n=Co();return ro===null?ps(n,e,t):ms(n,ro.memoizedState,e,t)},useTransition:function(){var e=jo(Oo)[0],t=Co().memoizedState;return[typeof e==`boolean`?e:To(e),t]},useSyncExternalStore:Mo,useId:xs,useHostTransitionStatus:bs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){var n=Co();return ro===null?(n.baseState=e,[e,n.queue.dispatch]):zo(n,ro,e,t)},useMemoCache:Do,useCacheRefresh:Ss};Ps.useEffectEvent=as;function Fs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Is={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=ja(r);i.payload=t,n!=null&&(i.callback=n),t=Ma(e,i,r),t!==null&&(hu(t,e,r),Na(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=ja(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ma(e,i,r),t!==null&&(hu(t,e,r),Na(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=ja(n);r.tag=2,t!=null&&(r.callback=t),t=Ma(e,r,n),t!==null&&(hu(t,e,n),Na(t,e,n))}};function Ls(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!lr(n,r)||!lr(i,a):!0}function Rs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Is.enqueueReplaceState(t,t.state,null)}function zs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Bs(e){Ir(e)}function Vs(e){console.error(e)}function Hs(e){Ir(e)}function Us(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ws(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Gs(e,t,n){return n=ja(n),n.tag=3,n.payload={element:null},n.callback=function(){Us(e,t)},n}function Ks(e){return e=ja(e),e.tag=3,e}function qs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ws(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ws(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Js(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&zi(t,n,a,!0),n=Ka.current,n!==null){switch(n.tag){case 31:case 13:return qa===null?Du():n.alternate===null&&Wl===0&&(Wl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===pa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Ku(e,r,a)),!1;case 22:return n.flags|=65536,r===pa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Ku(e,r,a)),!1}throw Error(i(435,n.tag))}return Ku(e,r,a),Du(),!1}if(xi)return t=Ka.current,t===null?(r!==wi&&(t=Error(i(423),{cause:r}),ji(ii(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=ii(r,n),a=Gs(e.stateNode,r,a),Pa(e,a),Wl!==4&&(Wl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==wi&&(e=Error(i(422),{cause:r}),ji(ii(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=ii(o,n),Xl===null?Xl=[o]:Xl.push(o),Wl!==4&&(Wl=2),t===null)return!0;r=ii(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Gs(n.stateNode,r,e),Pa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ru===null||!ru.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ks(a),qs(a,e,n,r),Pa(n,a),!1}n=n.return}while(n!==null);return!1}var Ys=Error(i(461)),Xs=!1;function Zs(e,t,n,r){t.child=e===null?Da(t,null,n,r):Ea(t,e.child,n,r)}function Qs(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Vi(t),r=ho(e,t,n,o,a,i),s=yo(),e!==null&&!Xs?(bo(e,t,i),Sc(e,t,i)):(xi&&s&&gi(t),t.flags|=1,Zs(e,t,r,i),t.child)}function $s(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Yr(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ec(e,t,a,r,i)):(e=Qr(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Cc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?lr:n,n(o,r)&&e.ref===t.ref)return Sc(e,t,i)}return t.flags|=1,e=Xr(a,r),e.ref=t.ref,e.return=t,t.child=e}function ec(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(lr(a,r)&&e.ref===t.ref){if(Xs=!1,t.pendingProps=r=a,Cc(e,i))e.flags&131072&&(Xs=!0);else return t.lanes=e.lanes,Sc(e,t,i)}}return cc(e,t,n,r,i)}function tc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return rc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ca(t,a===null?null:a.cachePool),a===null?Wa():Ua(t,a),Xa(t);else return r=t.lanes=536870912,rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ca(t,null),Wa(),Za(t)):(ca(t,a.cachePool),Ua(t,a),Za(t),t.memoizedState=null);return Zs(e,t,i,n),t.child}function nc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rc(e,t,n,r,i){var a=sa();return a=a===null?null:{parent:Ji._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ca(t,null),Wa(),Xa(t),e!==null&&zi(e,t,r,!0),t.childLanes=i,null}function ic(e,t){return t=_c({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ac(e,t,n){return Ea(t,e.child,null,n),e=ic(t,t.pendingProps),e.flags|=2,Qa(t),t.memoizedState=null,e}function oc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(xi){if(r.mode===`hidden`)return e=ic(t,r),t.lanes=536870912,nc(null,e);if(Ya(t),(e=bi)?(e=sf(e,Ci),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:di===null?null:{id:fi,overflow:pi},retryLane:536870912,hydrationErrors:null},n=ti(e),n.return=t,t.child=n,yi=t,bi=null)):e=null,e===null)throw Ti(t);return t.lanes=536870912,null}return ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ya(t),a){if(t.flags&256)t.flags&=-257,t=ac(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Xs||zi(e,t,n,!1),a=(n&e.childLanes)!==0,Xs||a){if(r=Fl,r!==null&&(s=Be(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ur(e,s),hu(r,e,s),Ys;Du(),t=ac(e,t,n)}else e=o.treeContext,bi=df(s.nextSibling),yi=t,xi=!0,Si=null,Ci=!1,e!==null&&vi(t,e),t=ic(t,r),t.flags|=4096;return t}return e=Xr(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function sc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function cc(e,t,n,r,i){return Vi(t),n=ho(e,t,n,r,void 0,i),r=yo(),e!==null&&!Xs?(bo(e,t,i),Sc(e,t,i)):(xi&&r&&gi(t),t.flags|=1,Zs(e,t,n,i),t.child)}function lc(e,t,n,r,i,a){return Vi(t),t.updateQueue=null,n=_o(t,r,n,i),go(e),r=yo(),e!==null&&!Xs?(bo(e,t,a),Sc(e,t,a)):(xi&&r&&gi(t),t.flags|=1,Zs(e,t,n,a),t.child)}function uc(e,t,n,r,i){if(Vi(t),t.stateNode===null){var a=Kr,o=n.contextType;typeof o==`object`&&o&&(a=Hi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Is,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ka(t),o=n.contextType,a.context=typeof o==`object`&&o?Hi(o):Kr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Fs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Is.enqueueReplaceState(a,a.state,null),La(t,r,a,i),Ia(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=Kr,typeof u==`object`&&u&&(o=Hi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Rs(t,a,r,o),Oa=!1;var f=t.memoizedState;a.state=f,La(t,r,a,i),Ia(),l=t.memoizedState,s||f!==l||Oa?(typeof d==`function`&&(Fs(t,n,d,r),l=t.memoizedState),(c=Oa||Ls(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Aa(e,t),o=t.memoizedProps,u=zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Kr,typeof l==`object`&&l&&(c=Hi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Rs(t,a,r,c),Oa=!1,f=t.memoizedState,a.state=f,La(t,r,a,i),Ia();var p=t.memoizedState;o!==d||f!==p||Oa||e!==null&&e.dependencies!==null&&Bi(e.dependencies)?(typeof s==`function`&&(Fs(t,n,s,r),p=t.memoizedState),(u=Oa||Ls(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Bi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,sc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ea(t,e.child,null,i),t.child=Ea(t,null,n,i)):Zs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Sc(e,t,i),e}function dc(e,t,n,r){return ki(),t.flags|=256,Zs(e,t,n,r),t.child}var fc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pc(e){return{baseLanes:e,cachePool:la()}}function mc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Jl),e}function hc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!($a.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(xi){if(a?Ja(t):Za(t),(e=bi)?(e=sf(e,Ci),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:di===null?null:{id:fi,overflow:pi},retryLane:536870912,hydrationErrors:null},n=ti(e),n.return=t,t.child=n,yi=t,bi=null)):e=null,e===null)throw Ti(t);return lf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(Za(t),a=t.mode,c=_c({mode:`hidden`,children:c},a),r=$r(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(null,r)):(Ja(t),gc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Ja(t),t.flags&=-257,t=vc(e,t,n)):t.memoizedState===null?(Za(t),c=r.fallback,a=t.mode,r=_c({mode:`visible`,children:r.children},a),c=$r(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ea(t,e.child,null,n),r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,t=nc(null,r)):(Za(t),t.child=e.child,t.flags|=128,t=null);else if(Ja(t),lf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,ji({value:r,source:null,stack:null}),t=vc(e,t,n)}else if(Xs||zi(e,t,n,!1),s=(n&e.childLanes)!==0,Xs||s){if(s=Fl,s!==null&&(r=Be(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Ur(e,r),hu(s,e,r),Ys;cf(c)||Du(),t=vc(e,t,n)}else cf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,bi=df(c.nextSibling),yi=t,xi=!0,Si=null,Ci=!1,e!==null&&vi(t,e),t=gc(t,r.children),t.flags|=4096);return t}return a?(Za(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=Xr(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=$r(c,a,n,null),c.flags|=2):c=Xr(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,nc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=pc(n):(a=c.cachePool,a===null?a=la():(l=Ji._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(e.child,r)):(Ja(t),n=e.child,e=n.sibling,n=Xr(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function gc(e,t){return t=_c({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function _c(e,t){return e=Jr(22,e,null,t),e.lanes=0,e}function vc(e,t,n){return Ea(t,e.child,null,n),e=gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Li(e.return,t,n)}function bc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function xc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=$a.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,B($a,o),Zs(e,t,r,n),r=xi?ci:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yc(e,n,t);else if(e.tag===19)yc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&eo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),bc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&eo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}bc(t,!0,n,null,a,r);break;case`together`:bc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Sc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gl|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(zi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Xr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Xr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Bi(e)))}function wc(e,t,n){switch(t.tag){case 3:G(t,t.stateNode.containerInfo),Fi(t,Ji,e.memoizedState.cache),ki();break;case 27:case 5:q(t);break;case 4:G(t,t.stateNode.containerInfo);break;case 10:Fi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ya(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ja(t),e=Sc(e,t,n),e===null?null:e.sibling):hc(e,t,n):(Ja(t),t.flags|=128,null);Ja(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(zi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return xc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),B($a,$a.current),r)break;return null;case 22:return t.lanes=0,tc(e,t,n,t.pendingProps);case 24:Fi(t,Ji,e.memoizedState.cache)}return Sc(e,t,n)}function Tc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Xs=!0;else{if(!Cc(e,n)&&!(t.flags&128))return Xs=!1,wc(e,t,n);Xs=!!(e.flags&131072)}}else Xs=!1,xi&&t.flags&1048576&&hi(t,ci,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ga(t.elementType),t.type=e,typeof e==`function`)Yr(e)?(r=zs(e,r),t.tag=1,t=uc(null,t,e,r,n)):(t.tag=0,t=cc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=Qs(null,t,e,r,n);break a}if(a===w){t.tag=14,t=$s(null,t,e,r,n);break a}}throw t=j(e)||e,Error(i(306,t,``))}}return t;case 0:return cc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=zs(r,t.pendingProps),uc(e,t,r,a,n);case 3:a:{if(G(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Aa(e,t),La(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Fi(t,Ji,r),r!==o.cache&&Ri(t,[Ji],n,!0),Ia(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=dc(e,t,r,n);break a}if(r!==a){a=ii(Error(i(424)),t),ji(a),t=dc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(bi=df(e.firstChild),yi=t,xi=!0,Si=null,Ci=!0,n=Da(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ki(),r===a){t=Sc(e,t,n);break a}Zs(e,t,r,n)}t=t.child}return t;case 26:return sc(e,t),e===null?(n=Mf(t.type,null,t.pendingProps,null))?t.memoizedState=n:xi||(n=t.type,e=t.pendingProps,r=Ud(U.current).createElement(n),r[Ke]=t,r[qe]=e,Ld(r,n,e),at(r),t.stateNode=r):t.memoizedState=Mf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return q(t),e===null&&xi&&(r=t.stateNode=hf(t.type,t.pendingProps,U.current),yi=t,Ci=!0,a=bi,ef(t.type)?(ff=a,bi=df(r.firstChild)):bi=a),Zs(e,t,t.pendingProps.children,n),sc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&xi&&((a=r=bi)&&(r=af(r,t.type,t.pendingProps,Ci),r===null?a=!1:(t.stateNode=r,yi=t,bi=df(r.firstChild),Ci=!1,a=!0)),a||Ti(t)),q(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Kd(a,o)?r=null:s!==null&&Kd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ho(e,t,vo,null,null,n),tp._currentValue=a),sc(e,t),Zs(e,t,r,n),t.child;case 6:return e===null&&xi&&((e=n=bi)&&(n=of(n,t.pendingProps,Ci),n===null?e=!1:(t.stateNode=n,yi=t,bi=null,e=!0)),e||Ti(t)),null;case 13:return hc(e,t,n);case 4:return G(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ea(t,null,r,n):Zs(e,t,r,n),t.child;case 11:return Qs(e,t,t.type,t.pendingProps,n);case 7:return Zs(e,t,t.pendingProps,n),t.child;case 8:return Zs(e,t,t.pendingProps.children,n),t.child;case 12:return Zs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Fi(t,t.type,r.value),Zs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Vi(t),a=Hi(a),r=r(a),t.flags|=1,Zs(e,t,r,n),t.child;case 14:return $s(e,t,t.type,t.pendingProps,n);case 15:return ec(e,t,t.type,t.pendingProps,n);case 19:return xc(e,t,n);case 31:return oc(e,t,n);case 22:return tc(e,t,n,t.pendingProps);case 24:return Vi(t),r=Hi(Ji),e===null?(a=sa(),a===null&&(a=Fl,o=Xi(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},ka(t),Fi(t,Ji,a)):((e.lanes&n)!==0&&(Aa(e,t),La(t,null,null,n),Ia()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Fi(t,Ji,r),r!==a.cache&&Ri(t,[Ji],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Fi(t,Ji,r))),Zs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ec(e){e.flags|=4}function Dc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(wu())e.flags|=8192;else throw _a=pa,da}}else e.flags&=-16777217}function Oc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!qf(t)){if(wu())e.flags|=8192;else throw _a=pa,da}}function kc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Pe(),e.lanes|=t,Yl|=t)}function Ac(e,t){if(!xi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function jc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Mc(e,t,n){var r=t.pendingProps;switch(_i(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jc(t),null;case 1:return jc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ii(Ji),K(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Oi(t)?Ec(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ai())),jc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ec(t),o===null?(jc(t),Dc(t,a,null,r,n)):(jc(t),Oc(t,o))):o?o===e.memoizedState?(jc(t),t.flags&=-16777217):(Ec(t),jc(t),Oc(t,o)):(e=e.memoizedProps,e!==r&&Ec(t),jc(t),Dc(t,a,e,r,n)),null;case 27:if(J(t),n=U.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}e=V.current,Oi(t)?Ei(t,e):(e=hf(a,r,n),t.stateNode=e,Ec(t))}return jc(t),null;case 5:if(J(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}if(o=V.current,Oi(t))Ei(t,o);else{var s=Ud(U.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[Ke]=t,o[qe]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Ld(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ec(t)}}return jc(t),Dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=U.current,Oi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=yi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Ke]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Pd(e.nodeValue,n)),e||Ti(t,!0)}else e=Ud(e).createTextNode(r),e[Ke]=t,t.stateNode=e}return jc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Oi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Ke]=t}else ki(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),e=!1}else n=Ai(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Qa(t),t):(Qa(t),null);if(t.flags&128)throw Error(i(558))}return jc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Oi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Ke]=t}else ki(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),a=!1}else a=Ai(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Qa(t),t):(Qa(t),null)}return Qa(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),kc(t,t.updateQueue),jc(t),null);case 4:return K(),e===null&&wd(t.stateNode.containerInfo),jc(t),null;case 10:return Ii(t.type),jc(t),null;case 19:if(z($a),r=t.memoizedState,r===null)return jc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Ac(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=eo(e),o!==null){for(t.flags|=128,Ac(r,!1),e=o.updateQueue,t.updateQueue=e,kc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Zr(n,e),n=n.sibling;return B($a,$a.current&1|2),xi&&mi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&fe()>tu&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304)}}else{if(!a){if(e=eo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,kc(t,e),Ac(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!xi)return jc(t),null}else 2*fe()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(jc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=fe(),e.sibling=null,n=$a.current,B($a,a?n&1|2:n&1),xi&&mi(t,r.treeForkCount),e);case 22:case 23:return Qa(t),Ga(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(jc(t),t.subtreeFlags&6&&(t.flags|=8192)):jc(t),n=t.updateQueue,n!==null&&kc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&z(oa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ii(Ji),jc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Nc(e,t){switch(_i(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ii(Ji),K(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return J(t),null;case 31:if(t.memoizedState!==null){if(Qa(t),t.alternate===null)throw Error(i(340));ki()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Qa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ki()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z($a),null;case 4:return K(),null;case 10:return Ii(t.type),null;case 22:case 23:return Qa(t),Ga(),e!==null&&z(oa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ii(Ji),null;case 25:return null;default:return null}}function Pc(e,t){switch(_i(t),t.tag){case 3:Ii(Ji),K();break;case 26:case 27:case 5:J(t);break;case 4:K();break;case 31:t.memoizedState!==null&&Qa(t);break;case 13:Qa(t);break;case 19:z($a);break;case 10:Ii(t.type);break;case 22:case 23:Qa(t),Ga(),e!==null&&z(oa);break;case 24:Ii(Ji)}}function Fc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Gu(t,t.return,e)}}function Ic(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Gu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Gu(t,t.return,e)}}function Lc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{za(t,n)}catch(t){Gu(e,e.return,t)}}}function Rc(e,t,n){n.props=zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Gu(e,t,n)}}function zc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Gu(e,t,n)}}function Bc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Gu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Gu(e,t,n)}else n.current=null}}function Vc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Gu(e,e.return,t)}}function Hc(e,t,n){try{var r=e.stateNode;Rd(r,e.type,n,t),r[qe]=t}catch(t){Gu(e,e.return,t)}}function Uc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ef(e.type)||e.tag===4}function Wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(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.tag===27&&ef(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=zt));else if(r!==4&&(r===27&&ef(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&ef(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ld(t,r,n),t[Ke]=e,t[qe]=n}catch(t){Gu(e,e.return,t)}}var Jc=!1,Yc=!1,Xc=!1,Zc=typeof WeakSet==`function`?WeakSet:Set,Qc=null;function $c(e,t){if(e=e.containerInfo,Vd=up,e=pr(e),mr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Hd={focusedElem:e,selectionRange:n},up=!1,Qc=t;Qc!==null;)if(t=Qc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Qc=e;else for(;Qc!==null;){switch(t=Qc,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=zs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Gu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)rf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:rf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Qc=e;break}Qc=t.return}}function el(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:hl(e,n),r&4&&Fc(5,n);break;case 1:if(hl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Gu(n,n.return,e)}else{var i=zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Gu(n,n.return,e)}}}r&64&&Lc(n),r&512&&zc(n,n.return);break;case 3:if(hl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{za(e,t)}catch(e){Gu(n,n.return,e)}}break;case 27:t===null&&r&4&&qc(n);case 26:case 5:hl(e,n),t===null&&r&4&&Vc(n),r&512&&zc(n,n.return);break;case 12:hl(e,n);break;case 31:hl(e,n),r&4&&ol(e,n);break;case 13:hl(e,n),r&4&&sl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Yu.bind(null,n),uf(e,n))));break;case 22:if(r=n.memoizedState!==null||Jc,!r){t=t!==null&&t.memoizedState!==null||Yc,i=Jc;var a=Yc;Jc=r,(Yc=t)&&!a?_l(e,n,!!(n.subtreeFlags&8772)):hl(e,n),Jc=i,Yc=a}break;case 30:break;default:hl(e,n)}}function tl(e){var t=e.alternate;t!==null&&(e.alternate=null,tl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&et(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var nl=null,rl=!1;function il(e,t,n){for(n=n.child;n!==null;)al(e,t,n),n=n.sibling}function al(e,t,n){if(Se&&typeof Se.onCommitFiberUnmount==`function`)try{Se.onCommitFiberUnmount(xe,n)}catch{}switch(n.tag){case 26:Yc||Bc(n,t),il(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Yc||Bc(n,t);var r=nl,i=rl;ef(n.type)&&(nl=n.stateNode,rl=!1),il(e,t,n),gf(n.stateNode),nl=r,rl=i;break;case 5:Yc||Bc(n,t);case 6:if(r=nl,i=rl,nl=null,il(e,t,n),nl=r,rl=i,nl!==null){if(rl)try{(nl.nodeType===9?nl.body:nl.nodeName===`HTML`?nl.ownerDocument.body:nl).removeChild(n.stateNode)}catch(e){Gu(n,t,e)}else try{nl.removeChild(n.stateNode)}catch(e){Gu(n,t,e)}}break;case 18:nl!==null&&(rl?(e=nl,tf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Ip(e)):tf(nl,n.stateNode));break;case 4:r=nl,i=rl,nl=n.stateNode.containerInfo,rl=!0,il(e,t,n),nl=r,rl=i;break;case 0:case 11:case 14:case 15:Ic(2,n,t),Yc||Ic(4,n,t),il(e,t,n);break;case 1:Yc||(Bc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Rc(n,t,r)),il(e,t,n);break;case 21:il(e,t,n);break;case 22:Yc=(r=Yc)||n.memoizedState!==null,il(e,t,n),Yc=r;break;default:il(e,t,n)}}function ol(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ip(e)}catch(e){Gu(t,t.return,e)}}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ip(e)}catch(e){Gu(t,t.return,e)}}function cl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zc),t;default:throw Error(i(435,e.tag))}}function ll(e,t){var n=cl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Xu.bind(null,e,t);t.then(r,r)}})}function ul(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(ef(c.type)){nl=c.stateNode,rl=!1;break a}break;case 5:nl=c.stateNode,rl=!1;break a;case 3:case 4:nl=c.stateNode.containerInfo,rl=!0;break a}c=c.return}if(nl===null)throw Error(i(160));al(o,s,a),nl=null,rl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fl(t,e),t=t.sibling}var dl=null;function fl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ul(t,e),pl(e),r&4&&(Ic(3,e,e.return),Fc(3,e),Ic(5,e,e.return));break;case 1:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),r&64&&Jc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=dl;if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[$e]||o[Ke]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Ld(o,r,n),o[Ke]=e,at(o),r=o;break a;case`link`:var s=Wf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Ld(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Wf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Ld(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[Ke]=e,at(o),r=o}e.stateNode=r}else Gf(a,e.type,e.stateNode)}else e.stateNode=zf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Hc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Gf(a,e.type,e.stateNode):zf(a,r,e.memoizedProps))}break;case 27:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),n!==null&&r&4&&Hc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),e.flags&32){a=e.stateNode;try{jt(a,``)}catch(t){Gu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Hc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Xc=!0);break;case 6:if(ul(t,e),pl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Gu(e,e.return,t)}}break;case 3:if(Uf=null,a=dl,dl=yf(t.containerInfo),ul(t,e),dl=a,pl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ip(t.containerInfo)}catch(t){Gu(e,e.return,t)}Xc&&(Xc=!1,ml(e));break;case 4:r=dl,dl=yf(e.stateNode.containerInfo),ul(t,e),pl(e),dl=r;break;case 12:ul(t,e),pl(e);break;case 31:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 13:ul(t,e),pl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=fe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Jc,d=Yc;if(Jc=u||a,Yc=d||l,ul(t,e),Yc=d,Jc=u,pl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Jc||Yc||gl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Gu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Gu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?nf(m,!0):nf(l.stateNode,!1)}catch(e){Gu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ll(e,n))));break;case 19:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 30:break;case 21:break;default:ul(t,e),pl(e)}}function pl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Uc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Kc(e,Wc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(jt(o,``),n.flags&=-33),Kc(e,Wc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Gc(e,Wc(e),s);break;default:throw Error(i(161))}}catch(t){Gu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ml(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ml(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function hl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)el(e,t.alternate,t),t=t.sibling}function gl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ic(4,t,t.return),gl(t);break;case 1:Bc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Rc(t,t.return,n),gl(t);break;case 27:gf(t.stateNode);case 26:case 5:Bc(t,t.return),gl(t);break;case 22:t.memoizedState===null&&gl(t);break;case 30:gl(t);break;default:gl(t)}e=e.sibling}}function _l(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:_l(i,a,n),Fc(4,a);break;case 1:if(_l(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Gu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ra(c[i],s)}catch(e){Gu(r,r.return,e)}}n&&o&64&&Lc(a),zc(a,a.return);break;case 27:qc(a);case 26:case 5:_l(i,a,n),n&&r===null&&o&4&&Vc(a),zc(a,a.return);break;case 12:_l(i,a,n);break;case 31:_l(i,a,n),n&&o&4&&ol(i,a);break;case 13:_l(i,a,n),n&&o&4&&sl(i,a);break;case 22:a.memoizedState===null&&_l(i,a,n),zc(a,a.return);break;case 30:break;default:_l(i,a,n)}t=t.sibling}}function vl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Zi(n))}function yl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Zi(e))}function bl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xl(e,t,n,r),t=t.sibling}function xl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:bl(e,t,n,r),i&2048&&Fc(9,t);break;case 1:bl(e,t,n,r);break;case 3:bl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Zi(e)));break;case 12:if(i&2048){bl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Gu(t,t.return,e)}}else bl(e,t,n,r);break;case 31:bl(e,t,n,r);break;case 13:bl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?bl(e,t,n,r):(a._visibility|=2,Sl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?bl(e,t,n,r):Cl(e,t),i&2048&&vl(o,t);break;case 24:bl(e,t,n,r),i&2048&&yl(t.alternate,t);break;default:bl(e,t,n,r)}}function Sl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Sl(a,o,s,c,i),Fc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Sl(a,o,s,c,i)):u._visibility&2?Sl(a,o,s,c,i):Cl(a,o),i&&l&2048&&vl(o.alternate,o);break;case 24:Sl(a,o,s,c,i),i&&l&2048&&yl(o.alternate,o);break;default:Sl(a,o,s,c,i)}t=t.sibling}}function Cl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Cl(n,r),i&2048&&vl(r.alternate,r);break;case 24:Cl(n,r),i&2048&&yl(r.alternate,r);break;default:Cl(n,r)}t=t.sibling}}var wl=8192;function Tl(e,t,n){if(e.subtreeFlags&wl)for(e=e.child;e!==null;)El(e,t,n),e=e.sibling}function El(e,t,n){switch(e.tag){case 26:Tl(e,t,n),e.flags&wl&&e.memoizedState!==null&&Jf(n,dl,e.memoizedState,e.memoizedProps);break;case 5:Tl(e,t,n);break;case 3:case 4:var r=dl;dl=yf(e.stateNode.containerInfo),Tl(e,t,n),dl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=wl,wl=16777216,Tl(e,t,n),wl=r):Tl(e,t,n));break;default:Tl(e,t,n)}}function Dl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ol(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)kl(e),e=e.sibling}function kl(e){switch(e.tag){case 0:case 11:case 15:Ol(e),e.flags&2048&&Ic(9,e,e.return);break;case 3:Ol(e);break;case 12:Ol(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Al(e)):Ol(e);break;default:Ol(e)}}function Al(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ic(8,t,t.return),Al(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Al(t));break;default:Al(t)}e=e.sibling}}function jl(e,t){for(;Qc!==null;){var n=Qc;switch(n.tag){case 0:case 11:case 15:Ic(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Zi(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Qc=r;else a:for(n=e;Qc!==null;){r=Qc;var i=r.sibling,a=r.return;if(tl(r),r===n){Qc=null;break a}if(i!==null){i.return=a,Qc=i;break a}Qc=a}}}var Ml={getCacheForType:function(e){var t=Hi(Ji),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Hi(Ji).controller.signal}},Nl=typeof WeakMap==`function`?WeakMap:Map,Pl=0,Fl=null,Il=null,Ll=0,Rl=0,zl=null,Bl=!1,Vl=!1,Hl=!1,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=null,Zl=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return Pl&2&&Ll!==0?Ll&-Ll:N.T===null?Ue():fd()}function mu(){if(Jl===0){if(!(Ll&536870912)||xi){var e=ke;ke<<=1,!(ke&3932160)&&(ke=262144),Jl=e}else Jl=536870912}return e=Ka.current,e!==null&&(e.flags|=32),Jl}function hu(e,t,n){(e===Fl&&(Rl===2||Rl===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,Ll,Jl,!1)),Ie(e,n),(!(Pl&2)||e!==Fl)&&(e===Fl&&(!(Pl&2)&&(Kl|=n),Wl===4&&yu(e,Ll,Jl,!1)),id(e))}function gu(e,t,n){if(Pl&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Y(e,t),a=r?Au(e,t):Ou(e,t,!0),o=r;do{if(a===0){Vl&&!r&&yu(e,t,0,!1);break}if(n=e.current.alternate,o&&!vu(n)){a=Ou(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Xl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Hl&&!l){c.errorRecoveryDisabledLanes|=o,Kl|=o,a=4;break a}o=Zl,Zl=a,o!==null&&(Zl===null?Zl=o:Zl.push.apply(Zl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Jl,!Bl);break a;case 2:Zl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=$l+300-fe(),10<a)){if(yu(r,t,Jl,!Bl),Ne(r,0,!0)!==0)break a;su=t,r.timeoutHandle=Yd(_u.bind(null,r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,`Throttled`,-0,0),a);break a}_u(r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,null,-0,0)}break}while(1);id(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:zt},El(t,a,d);var m=(a&62914560)===a?$l-fe():(a&4194048)===a?eu-fe():0;if(m=Xf(d,m),m!==null){su=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!cr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 yu(e,t,n,r){t&=~ql,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-we(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Re(e,n,t)}function bu(){return Pl&6?!0:(ad(0,!1),!1)}function xu(){if(Il!==null){if(Rl===0)var e=Il.return;else e=Il,Pi=Ni=null,xo(e),ba=null,xa=0,e=Il;for(;e!==null;)Pc(e.alternate,e),e=e.return;Il=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Xd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),Fl=e,Il=n=Xr(e.current,null),Ll=t,Rl=0,zl=null,Bl=!1,Vl=Y(e,t),Hl=!1,Yl=Jl=ql=Kl=Gl=Wl=0,Zl=Xl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-we(r),a=1<<i;t|=e[i],r&=~a}return Ul=t,Br(),n}function Cu(e,t){no=null,N.H=js,t===ua||t===fa?(t=va(),Rl=3):t===da?(t=va(),Rl=4):Rl=t===Ys?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,zl=t,Il===null&&(Wl=1,Us(e,ii(t,e.current)))}function wu(){var e=Ka.current;return e===null?!0:(Ll&4194048)===Ll?qa===null:(Ll&62914560)===Ll||Ll&536870912?e===qa:!1}function Tu(){var e=N.H;return N.H=js,e===null?js:e}function Eu(){var e=N.A;return N.A=Ml,e}function Du(){Wl=4,Bl||(Ll&4194048)!==Ll&&Ka.current!==null||(Vl=!0),!(Gl&134217727)&&!(Kl&134217727)||Fl===null||yu(Fl,Ll,Jl,!1)}function Ou(e,t,n){var r=Pl;Pl|=2;var i=Tu(),a=Eu();(Fl!==e||Ll!==t)&&(nu=null,Su(e,t)),t=!1;var o=Wl;a:do try{if(Rl!==0&&Il!==null){var s=Il,c=zl;switch(Rl){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:Ka.current===null&&(t=!0);var l=Rl;if(Rl=0,zl=null,Pu(e,s,c,l),n&&Vl){o=0;break a}break;default:l=Rl,Rl=0,zl=null,Pu(e,s,c,l)}}ku(),o=Wl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Pi=Ni=null,Pl=r,N.H=i,N.A=a,Il===null&&(Fl=null,Ll=0,Br()),o}function ku(){for(;Il!==null;)Mu(Il)}function Au(e,t){var n=Pl;Pl|=2;var r=Tu(),a=Eu();Fl!==e||Ll!==t?(nu=null,tu=fe()+500,Su(e,t)):Vl=Y(e,t);a:do try{if(Rl!==0&&Il!==null){t=Il;var o=zl;b:switch(Rl){case 1:Rl=0,zl=null,Pu(e,t,o,1);break;case 2:case 9:if(ma(o)){Rl=0,zl=null,Nu(t);break}t=function(){Rl!==2&&Rl!==9||Fl!==e||(Rl=7),id(e)},o.then(t,t);break a;case 3:Rl=7;break a;case 4:Rl=5;break a;case 7:ma(o)?(Rl=0,zl=null,Nu(t)):(Rl=0,zl=null,Pu(e,t,o,7));break;case 5:var s=null;switch(Il.tag){case 26:s=Il.memoizedState;case 5:case 27:var c=Il;if(s?qf(s):c.stateNode.complete){Rl=0,zl=null;var l=c.sibling;if(l!==null)Il=l;else{var u=c.return;u===null?Il=null:(Il=u,Fu(u))}break b}}Rl=0,zl=null,Pu(e,t,o,5);break;case 6:Rl=0,zl=null,Pu(e,t,o,6);break;case 8:xu(),Wl=6;break a;default:throw Error(i(462))}}ju();break}catch(t){Cu(e,t)}while(1);return Pi=Ni=null,N.H=r,N.A=a,Pl=n,Il===null?(Fl=null,Ll=0,Br(),Wl):0}function ju(){for(;Il!==null&&!ue();)Mu(Il)}function Mu(e){var t=Tc(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,t===null?Fu(e):Il=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=lc(n,t,t.pendingProps,t.type,void 0,Ll);break;case 11:t=lc(n,t,t.pendingProps,t.type.render,t.ref,Ll);break;case 5:xo(t);default:Pc(n,t),t=Il=Zr(t,Ul),t=Tc(n,t,Ul)}e.memoizedProps=e.pendingProps,t===null?Fu(e):Il=t}function Pu(e,t,n,r){Pi=Ni=null,xo(t),ba=null,xa=0;var i=t.return;try{if(Js(e,i,t,n,Ll)){Wl=1,Us(e,ii(n,e.current)),Il=null;return}}catch(t){if(i!==null)throw Il=i,t;Wl=1,Us(e,ii(n,e.current)),Il=null;return}t.flags&32768?(xi||r===1?e=!0:Vl||Ll&536870912?e=!1:(Bl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ka.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Bl);return}e=t.return;var n=Mc(t.alternate,t,Ul);if(n!==null){Il=n;return}if(t=t.sibling,t!==null){Il=t;return}Il=t=e}while(t!==null);Wl===0&&(Wl=5)}function Iu(e,t){do{var n=Nc(e.alternate,e);if(n!==null){n.flags&=32767,Il=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Il=e;return}Il=e=n}while(e!==null);Wl=6,Il=null}function Lu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(Pl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=zr,Le(e,n,o,s,c,l),e===Fl&&(Il=Fl=null,Ll=0),ou=t,au=e,su=n,cu=o,lu=a,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Zu(ge,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=Pl,Pl|=4;try{$c(e,t,n)}finally{Pl=s,P.p=a,N.T=r}}iu=1,Ru(),zu(),Bu()}}function Ru(){if(iu===1){iu=0;var e=au,t=ou,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Pl;Pl|=4;try{fl(t,e);var a=Hd,o=pr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&fr(s.ownerDocument.documentElement,s)){if(c!==null&&mr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=dr(s,h),v=dr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}up=!!Vd,Hd=Vd=null}finally{Pl=i,P.p=r,N.T=n}}e.current=t,iu=2}}function zu(){if(iu===2){iu=0;var e=au,t=ou,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Pl;Pl|=4;try{el(e,t.alternate,t)}finally{Pl=i,P.p=r,N.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,de();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),He(n),t=t.stateNode,Se&&typeof Se.onCommitFiberRoot==`function`)try{Se.onCommitFiberRoot(xe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}su&3&&Hu(),id(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,ad(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Zi(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=He(su),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,Pl&6)throw Error(i(331));var c=Pl;if(Pl|=4,kl(o.current),xl(o,o.current,s,n),Pl=c,ad(0,!1),Se&&typeof Se.onPostCommitFiberRoot==`function`)try{Se.onPostCommitFiberRoot(xe,o)}catch{}return!0}finally{P.p=a,N.T=r,Vu(e,t)}}function Wu(e,t,n){t=ii(n,t),t=Gs(e.stateNode,t,2),e=Ma(e,t,2),e!==null&&(Ie(e,2),id(e))}function Gu(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=ii(n,e),n=Ks(2),r=Ma(t,n,2),r!==null&&(qs(n,r,t,e),Ie(r,2),id(r));break}}t=t.return}}function Ku(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Nl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=qu.bind(null,e,t,n),t.then(e,e))}function qu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Fl===e&&(Ll&n)===n&&(Wl===4||Wl===3&&(Ll&62914560)===Ll&&300>fe()-$l?!(Pl&2)&&Su(e,0):ql|=n,Yl===Ll&&(Yl=0)),id(e)}function Ju(e,t){t===0&&(t=Pe()),e=Ur(e,t),e!==null&&(Ie(e,t),id(e))}function Yu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ju(e,n)}function Xu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ju(e,n)}function Zu(e,t){return ce(e,t)}var Qu=null,$u=null,ed=!1,td=!1,nd=!1,rd=0;function id(e){e!==$u&&e.next===null&&($u===null?Qu=$u=e:$u=$u.next=e),td=!0,ed||(ed=!0,dd())}function ad(e,t){if(!nd&&td){nd=!0;do for(var n=!1,r=Qu;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-we(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ud(r,a))}else a=Ll,a=Ne(r,r===Fl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Y(r,a)||(n=!0,ud(r,a))}r=r.next}while(n);nd=!1}}function od(){sd()}function sd(){td=ed=!1;var e=0;rd!==0&&Jd()&&(e=rd);for(var t=fe(),n=null,r=Qu;r!==null;){var i=r.next,a=cd(r,t);a===0?(r.next=null,n===null?Qu=i:n.next=i,i===null&&($u=n)):(n=r,(e!==0||a&3)&&(td=!0)),r=i}iu!==0&&iu!==5||ad(e,!1),rd!==0&&(rd=0)}function cd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-we(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=X(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Fl,n=Ll,n=Ne(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Rl===2||Rl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&le(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Y(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&le(r),He(n)){case 2:case 8:n=he;break;case 32:n=ge;break;case 268435456:n=ve;break;default:n=ge}return r=ld.bind(null,e),n=ce(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&le(r),e.callbackPriority=2,e.callbackNode=null,2}function ld(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=Ll;return r=Ne(e,e===Fl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),cd(e,fe()),e.callbackNode!=null&&e.callbackNode===n?ld.bind(null,e):null)}function ud(e,t){if(Hu())return null;gu(e,t,!0)}function dd(){Qd(function(){Pl&6?ce(me,od):sd()})}function fd(){if(rd===0){var e=ea;e===0&&(e=Oe,Oe<<=1,!(Oe&261888)&&(Oe=256)),rd=e}return rd}function pd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Rt(``+e)}function md(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function hd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=pd((i[qe]||null).action),o=r.submitter;o&&(t=(t=o[qe]||null)?pd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new sn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(rd!==0){var e=o?md(i,o):new FormData(i);_s(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?md(i,o):new FormData(i),_s(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var gd=0;gd<Pr.length;gd++){var _d=Pr[gd];Fr(_d.toLowerCase(),`on`+(_d[0].toUpperCase()+_d.slice(1)))}Fr(Er,`onAnimationEnd`),Fr(Dr,`onAnimationIteration`),Fr(Or,`onAnimationStart`),Fr(`dblclick`,`onDoubleClick`),Fr(`focusin`,`onFocus`),Fr(`focusout`,`onBlur`),Fr(kr,`onTransitionRun`),Fr(Ar,`onTransitionStart`),Fr(jr,`onTransitionCancel`),Fr(Mr,`onTransitionEnd`),lt(`onMouseEnter`,[`mouseout`,`mouseover`]),lt(`onMouseLeave`,[`mouseout`,`mouseover`]),lt(`onPointerEnter`,[`pointerout`,`pointerover`]),lt(`onPointerLeave`,[`pointerout`,`pointerover`]),ct(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),ct(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),ct(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),ct(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),ct(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),ct(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var vd=`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(` `),yd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(vd));function bd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Ir(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Ir(e)}i.currentTarget=null,a=c}}}}function xd(e,t){var n=t[Ye];n===void 0&&(n=t[Ye]=new Set);var r=e+`__bubble`;n.has(r)||(Td(t,e,2,!1),n.add(r))}function Sd(e,t,n){var r=0;t&&(r|=4),Td(n,e,r,t)}var Cd=`_reactListening`+Math.random().toString(36).slice(2);function wd(e){if(!e[Cd]){e[Cd]=!0,ot.forEach(function(t){t!==`selectionchange`&&(yd.has(t)||Sd(t,!1,e),Sd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Cd]||(t[Cd]=!0,Sd(`selectionchange`,!1,t))}}function Td(e,t,n,r){switch(_p(t)){case 2:var i=dp;break;case 8:i=fp;break;default:i=pp}n=i.bind(null,t,n,e),i=void 0,!Yt||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Ed(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=tt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Kt(function(){var r=a,i=Vt(n),s=[];a:{var c=Nr.get(e);if(c!==void 0){var l=sn,u=e;switch(e){case`keypress`:if(tn(n)===0)break a;case`keydown`:case`keyup`:l=Tn;break;case`focusin`:u=`focus`,l=gn;break;case`focusout`:u=`blur`,l=gn;break;case`beforeblur`:case`afterblur`:l=gn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=mn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=hn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Dn;break;case Er:case Dr:case Or:l=_n;break;case Mr:l=On;break;case`scroll`:case`scrollend`:l=ln;break;case`wheel`:l=kn;break;case`copy`:case`cut`:case`paste`:l=vn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=En;break;case`toggle`:case`beforetoggle`:l=An}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=qt(m,p),g!=null&&d.push(Dd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Bt&&(u=n.relatedTarget||n.fromElement)&&(tt(u)||u[Je]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?tt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=mn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=En,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:rt(l),h=u==null?c:rt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,tt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=kd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Ad(s,c,l,d,!1),u!==null&&f!==null&&Ad(s,f,u,d,!0)}}a:{if(c=r?rt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=Xn;else if(Wn(c)){if(Zn)v=or;else{v=ir;var y=rr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Ft(r.elementType)&&(v=Xn):v=ar;if(v&&=v(e,r)){Gn(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Dt(c,`number`,c.value)}switch(y=r?rt(r):window,e){case`focusin`:(Wn(y)||y.contentEditable===`true`)&&(gr=y,_r=r,vr=null);break;case`focusout`:vr=_r=gr=null;break;case`mousedown`:yr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:yr=!1,br(s,n,i);break;case`selectionchange`:if(hr)break;case`keydown`:case`keyup`:br(s,n,i)}var b;if(Mn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Bn?Rn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Fn&&n.locale!==`ko`&&(Bn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Bn&&(b=en()):(Zt=i,Qt=`value`in Zt?Zt.value:Zt.textContent,Bn=!0)),y=Od(r,x),0<y.length&&(x=new yn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=zn(n),b!==null&&(x.data=b)))),(b=Pn?Vn(e,n):Hn(e,n))&&(x=Od(r,`onBeforeInput`),0<x.length&&(y=new yn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),hd(s,e,r,n,i)}bd(s,t)})}function Dd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Od(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=qt(e,n),i!=null&&r.unshift(Dd(e,i,a)),i=qt(e,t),i!=null&&r.push(Dd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function kd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ad(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=qt(n,a),l!=null&&o.unshift(Dd(n,l,c))):i||(l=qt(n,a),l!=null&&o.push(Dd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var jd=/\r\n?/g,Md=/\u0000|\uFFFD/g;function Nd(e){return(typeof e==`string`?e:``+e).replace(jd,`
9
+ `).replace(Md,``)}function Pd(e,t){return t=Nd(t),Nd(e)===t}function Fd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&jt(e,``+r);break;case`className`:ht(e,`class`,r);break;case`tabIndex`:ht(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:ht(e,n,r);break;case`style`:Pt(e,r,o);break;case`data`:if(t!==`object`){ht(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Rt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Fd(e,t,`name`,a.name,a,null),Fd(e,t,`formEncType`,a.formEncType,a,null),Fd(e,t,`formMethod`,a.formMethod,a,null),Fd(e,t,`formTarget`,a.formTarget,a,null)):(Fd(e,t,`encType`,a.encType,a,null),Fd(e,t,`method`,a.method,a,null),Fd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Rt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=zt);break;case`onScroll`:r!=null&&xd(`scroll`,e);break;case`onScrollEnd`:r!=null&&xd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Rt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:xd(`beforetoggle`,e),xd(`toggle`,e),mt(e,`popover`,r);break;case`xlinkActuate`:gt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:gt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:gt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:gt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:gt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:gt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:mt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=It.get(n)||n,mt(e,n,r))}}function Id(e,t,n,r,a,o){switch(n){case`style`:Pt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&jt(e,``+r);break;case`onScroll`:r!=null&&xd(`scroll`,e);break;case`onScrollEnd`:r!=null&&xd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=zt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!st.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[qe]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):mt(e,n,r)}}}function Ld(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:xd(`error`,e),xd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Fd(e,t,o,s,n,null)}}a&&Fd(e,t,`srcSet`,n.srcSet,n,null),r&&Fd(e,t,`src`,n.src,n,null);return;case`input`:xd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Fd(e,t,r,d,n,null)}}Et(e,o,c,l,u,s,a,!1);return;case`select`:for(a in xd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Fd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ot(e,!!r,n,!0):Ot(e,!!r,t,!1);return;case`textarea`:for(s in xd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Fd(e,t,s,c,n,null)}At(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Fd(e,t,l,r,n,null)}return;case`dialog`:xd(`beforetoggle`,e),xd(`toggle`,e),xd(`cancel`,e),xd(`close`,e);break;case`iframe`:case`object`:xd(`load`,e);break;case`video`:case`audio`:for(r=0;r<vd.length;r++)xd(vd[r],e);break;case`image`:xd(`error`,e),xd(`load`,e);break;case`details`:xd(`toggle`,e);break;case`embed`:case`source`:case`link`:xd(`error`,e),xd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Fd(e,t,u,r,n,null)}return;default:if(Ft(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Id(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Fd(e,t,c,r,n,null))}function Rd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Fd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Fd(e,t,p,m,r,f)}}Tt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Fd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Fd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ot(e,!!n,n?[]:``,!1):Ot(e,!!n,t,!0)):Ot(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Fd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Fd(e,t,s,a,r,o)}kt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Fd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Fd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Fd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Fd(e,t,u,p,r,m)}return;default:if(Ft(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Id(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Id(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Fd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Fd(e,t,f,p,r,m)}function zd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Bd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&zd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&zd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Vd=null,Hd=null;function Ud(e){return e.nodeType===9?e:e.ownerDocument}function Wd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Gd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Kd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qd=null;function Jd(){var e=window.event;return e&&e.type===`popstate`?e!==qd&&(qd=e,!0):(qd=null,!1)}var Yd=typeof setTimeout==`function`?setTimeout:void 0,Xd=typeof clearTimeout==`function`?clearTimeout:void 0,Zd=typeof Promise==`function`?Promise:void 0,Qd=typeof queueMicrotask==`function`?queueMicrotask:Zd===void 0?Yd:function(e){return Zd.resolve(null).then(e).catch($d)};function $d(e){setTimeout(function(){throw e})}function ef(e){return e===`head`}function tf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Ip(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)gf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,gf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[$e]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&gf(e.ownerDocument.body)}n=i}while(n);Ip(t)}function nf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function rf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:rf(n),et(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function af(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[$e])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=df(e.nextSibling),e===null)break}return null}function of(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=df(e.nextSibling),e===null))return null;return e}function sf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=df(e.nextSibling),e===null))return null;return e}function cf(e){return e.data===`$?`||e.data===`$~`}function lf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function uf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function df(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var ff=null;function pf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return df(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function mf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function hf(e,t,n){switch(t=Ud(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);et(e)}var _f=new Map,vf=new Set;function yf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var bf=P.d;P.d={f:xf,r:Sf,D:Tf,C:Ef,L:Df,m:Of,X:Af,S:kf,M:jf};function xf(){var e=bf.f(),t=bu();return e||t}function Sf(e){var t=nt(e);t!==null&&t.tag===5&&t.type===`form`?ys(t):bf.r(e)}var Cf=typeof document>`u`?null:document;function wf(e,t,n){var r=Cf;if(r&&typeof t==`string`&&t){var i=wt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),vf.has(i)||(vf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Ld(t,`link`,e),at(t),r.head.appendChild(t)))}}function Tf(e){bf.D(e),wf(`dns-prefetch`,e,null)}function Ef(e,t){bf.C(e,t),wf(`preconnect`,e,t)}function Df(e,t,n){bf.L(e,t,n);var r=Cf;if(r&&e&&t){var i=`link[rel="preload"][as="`+wt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+wt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+wt(n.imageSizes)+`"]`)):i+=`[href="`+wt(e)+`"]`;var a=i;switch(t){case`style`:a=Nf(e);break;case`script`:a=Lf(e)}_f.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),_f.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Pf(a))||t===`script`&&r.querySelector(Rf(a))||(t=r.createElement(`link`),Ld(t,`link`,e),at(t),r.head.appendChild(t)))}}function Of(e,t){bf.m(e,t);var n=Cf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+wt(r)+`"][href="`+wt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Lf(e)}if(!_f.has(a)&&(e=f({rel:`modulepreload`,href:e},t),_f.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Rf(a)))return}r=n.createElement(`link`),Ld(r,`link`,e),at(r),n.head.appendChild(r)}}}function kf(e,t,n){bf.S(e,t,n);var r=Cf;if(r&&e){var i=it(r).hoistableStyles,a=Nf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Pf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=_f.get(a))&&Vf(e,n);var c=o=r.createElement(`link`);at(c),Ld(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Bf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Af(e,t){bf.X(e,t);var n=Cf;if(n&&e){var r=it(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=f({src:e,async:!0},t),(t=_f.get(i))&&Hf(e,t),a=n.createElement(`script`),at(a),Ld(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t){bf.M(e,t);var n=Cf;if(n&&e){var r=it(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=_f.get(i))&&Hf(e,t),a=n.createElement(`script`),at(a),Ld(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t,n,r){var a=(a=U.current)?yf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Nf(n.href),n=it(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Nf(n.href);var o=it(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Pf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),_f.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},_f.set(e,n),o||If(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Lf(n),n=it(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Nf(e){return`href="`+wt(e)+`"`}function Pf(e){return`link[rel="stylesheet"][`+e+`]`}function Ff(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function If(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Ld(t,`link`,n),at(t),e.head.appendChild(t))}function Lf(e){return`[src="`+wt(e)+`"]`}function Rf(e){return`script[async]`+e}function zf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+wt(n.href)+`"]`);if(r)return t.instance=r,at(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),at(r),Ld(r,`style`,a),Bf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Nf(n.href);var o=e.querySelector(Pf(a));if(o)return t.state.loading|=4,t.instance=o,at(o),o;r=Ff(n),(a=_f.get(a))&&Vf(r,a),o=(e.ownerDocument||e).createElement(`link`),at(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Ld(o,`link`,r),t.state.loading|=4,Bf(o,n.precedence,e),t.instance=o;case`script`:return o=Lf(n.src),(a=e.querySelector(Rf(o)))?(t.instance=a,at(a),a):(r=n,(a=_f.get(o))&&(r=f({},n),Hf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),at(a),Ld(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Bf(r,n.precedence,e));return t.instance}function Bf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Uf=null;function Wf(e,t,n){if(Uf===null){var r=new Map,i=Uf=new Map;i.set(n,r)}else i=Uf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[$e]||a[Ke]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Gf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Kf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function qf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Jf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Nf(r.href),a=t.querySelector(Pf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Zf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,at(a);return}a=t.ownerDocument||t,r=Ff(r),(i=_f.get(i))&&Vf(r,i),a=a.createElement(`link`),at(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Ld(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Zf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Yf=0;function Xf(e,t){return e.stylesheets&&e.count===0&&$f(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&$f(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Yf===0&&(Yf=62500*Bd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&$f(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Yf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Zf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$f(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qf=null;function $f(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qf=new Map,t.forEach(ep,e),Qf=null,Zf.call(e))}function ep(e,t){if(!(t.state.loading&4)){var n=Qf.get(e);if(n)var r=n.get(null);else{n=new Map,Qf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Zf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var tp={$$typeof:b,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function np(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Fe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fe(0),this.hiddenUpdates=Fe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function rp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new np(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Jr(3,null,null,t),e.current=a,a.stateNode=e,t=Xi(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ka(a),e}function ip(e){return e?(e=Kr,e):Kr}function ap(e,t,n,r,i,a){i=ip(i),r.context===null?r.context=i:r.pendingContext=i,r=ja(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ma(e,r,t),n!==null&&(hu(n,e,t),Na(n,e,t))}function op(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sp(e,t){op(e,t),(e=e.alternate)&&op(e,t)}function cp(e){if(e.tag===13||e.tag===31){var t=Ur(e,67108864);t!==null&&hu(t,e,67108864),sp(e,67108864)}}function lp(e){if(e.tag===13||e.tag===31){var t=pu();t=Ve(t);var n=Ur(e,t);n!==null&&hu(n,e,t),sp(e,t)}}var up=!0;function dp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,pp(e,t,n,r)}finally{P.p=a,N.T=i}}function fp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,pp(e,t,n,r)}finally{P.p=a,N.T=i}}function pp(e,t,n,r){if(up){var i=mp(r);if(i===null)Ed(e,t,r,hp,n),Ep(e,r);else if(Op(i,e,t,n,r))r.stopPropagation();else if(Ep(e,r),t&4&&-1<Tp.indexOf(e)){for(;i!==null;){var a=nt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Me(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-we(o);s.entanglements[1]|=c,o&=~c}id(a),!(Pl&6)&&(tu=fe()+500,ad(0,!1))}}break;case 31:case 13:s=Ur(a,2),s!==null&&hu(s,a,2),bu(),sp(a,2)}if(a=mp(r),a===null&&Ed(e,t,r,hp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ed(e,t,r,null,n)}}function mp(e){return e=Vt(e),gp(e)}var hp=null;function gp(e){if(hp=null,e=tt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return hp=e,null}function _p(e){switch(e){case`beforetoggle`: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`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(pe()){case me:return 2;case he:return 8;case ge:case _e:return 32;case ve:return 268435456;default:return 32}default:return 32}}var vp=!1,yp=null,bp=null,xp=null,Sp=new Map,Cp=new Map,wp=[],Tp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Ep(e,t){switch(e){case`focusin`:case`focusout`:yp=null;break;case`dragenter`:case`dragleave`:bp=null;break;case`mouseover`:case`mouseout`:xp=null;break;case`pointerover`:case`pointerout`:Sp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Cp.delete(t.pointerId)}}function Dp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=nt(t),t!==null&&cp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Op(e,t,n,r,i){switch(t){case`focusin`:return yp=Dp(yp,e,t,n,r,i),!0;case`dragenter`:return bp=Dp(bp,e,t,n,r,i),!0;case`mouseover`:return xp=Dp(xp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Sp.set(a,Dp(Sp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Cp.set(a,Dp(Cp.get(a)||null,e,t,n,r,i)),!0}return!1}function kp(e){var t=tt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,We(e.priority,function(){lp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,We(e.priority,function(){lp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ap(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=mp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Bt=r,n.target.dispatchEvent(r),Bt=null}else return t=nt(n),t!==null&&cp(t),e.blockedOn=n,!1;t.shift()}return!0}function jp(e,t,n){Ap(e)&&n.delete(t)}function Mp(){vp=!1,yp!==null&&Ap(yp)&&(yp=null),bp!==null&&Ap(bp)&&(bp=null),xp!==null&&Ap(xp)&&(xp=null),Sp.forEach(jp),Cp.forEach(jp)}function Np(e,n){e.blockedOn===n&&(e.blockedOn=null,vp||(vp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Mp)))}var Pp=null;function Fp(e){Pp!==e&&(Pp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Pp===e&&(Pp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(gp(r||n)===null)continue;break}var a=nt(n);a!==null&&(e.splice(t,3),t-=3,_s(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Ip(e){function t(t){return Np(t,e)}yp!==null&&Np(yp,e),bp!==null&&Np(bp,e),xp!==null&&Np(xp,e),Sp.forEach(t),Cp.forEach(t);for(var n=0;n<wp.length;n++){var r=wp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<wp.length&&(n=wp[0],n.blockedOn===null);)kp(n),n.blockedOn===null&&wp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[qe]||null;if(typeof a==`function`)o||Fp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[qe]||null)s=o.formAction;else if(gp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Fp(n)}}}function Lp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Rp(e){this._internalRoot=e}zp.prototype.render=Rp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ap(n,pu(),e,t,null,null)},zp.prototype.unmount=Rp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ap(e.current,2,null,e,null,null),bu(),t[Je]=null}};function zp(e){this._internalRoot=e}zp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ue();e={blockedOn:null,target:e,priority:t};for(var n=0;n<wp.length&&t!==0&&t<wp[n].priority;n++);wp.splice(n,0,e),n===0&&kp(e)}};var Bp=n.version;if(Bp!==`19.2.8`)throw Error(i(527,Bp,`19.2.8`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Vp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Hp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hp.isDisabled&&Hp.supportsFiber)try{xe=Hp.inject(Vp),Se=Hp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Bs,s=Vs,c=Hs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=rp(e,1,!1,null,null,n,r,null,o,s,c,Lp),e[Je]=t.current,wd(e),new Rp(t)}})),Ua=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ha()})),Wa=s((e=>{var t=je().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return t.H.useMemoCache(e)}})),Ga=s(((e,t)=>{t.exports=Wa()}));function Ka(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];r&&t.push(r)}return t}function qa(e,t){let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i];t(a,i,e)?n.push(a):r.push(a)}return[n,r]}function Ja(e){return[...new Set(e)]}var Ya=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},Xa={pipe(){return Ya(this,arguments)}},Za=function(){function e(){}return e.prototype=Xa,e}(),Qa=function(e,t){if(typeof e==`function`)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},$a=e=>e,eo=e=>()=>e,to=eo(null),no=eo(void 0),ro=no;function io(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function ao(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),t.set(i,i),i}}var oo=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(`stack`);let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let e=Reflect.ownKeys(r);for(let n=0;n<e.length;n++)t.add(e[n]);r=Object.getPrototypeOf(r)}return t.has(`constructor`)&&typeof e.constructor==`function`&&n===e.constructor.prototype&&t.delete(`constructor`),t},so=new WeakSet;function co(e){return typeof e==`string`}function lo(e){return typeof e==`number`}function uo(e){return typeof e==`boolean`}function fo(e){return typeof e==`symbol`}function po(e){return co(e)||lo(e)||fo(e)}function mo(e){return typeof e==`function`}function ho(e){return e!=null}function go(e){return!0}function _o(e){return typeof e==`object`&&!!e||mo(e)}var vo=Qa(2,(e,t)=>_o(e)&&t in e),yo=`~effect/interfaces/Hash`,bo=e=>{switch(typeof e){case`number`:return To(e);case`bigint`:return Eo(e.toString(10));case`boolean`:return Eo(String(e));case`symbol`:return Eo(String(e));case`string`:return Eo(e);case`undefined`:return Eo(`undefined`);case`function`:case`object`:if(e===null)return Eo(`null`);if(e instanceof Date)return Number.isNaN(e.getTime())?Eo(`Invalid Date`):Eo(e.toISOString());if(e instanceof RegExp)return Eo(e.toString());{if(so.has(e))return xo(e);if(Po.has(e))return Po.get(e);let t=Io(e,()=>wo(e)?e[yo]():typeof e==`function`?xo(e):e instanceof DataView?Ao(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):Array.isArray(e)||ArrayBuffer.isView(e)?Ao(e):e instanceof Map?jo(e):e instanceof Set?Mo(e):Oo(e));return Po.set(e,t),t}default:throw Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},xo=e=>(No.has(e)||No.set(e,To(Math.floor(Math.random()*(2**53-1)))),No.get(e)),So=Qa(2,(e,t)=>e*53^t),Co=e=>e&3221225471|e>>>1&1073741824,wo=e=>vo(e,yo),To=e=>{if(e!==e)return Eo(`NaN`);if(e===1/0)return Eo(`Infinity`);if(e===-1/0)return Eo(`-Infinity`);let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return Co(t)},Eo=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return Co(t)},Do=(e,t)=>{let n=12289;for(let r of t)n^=So(bo(r),bo(e[r]));return Co(n)},Oo=e=>Do(e,oo(e)),ko=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return Co(r)},Ao=ko(6151,bo),jo=ko(Eo(`Map`),([e,t])=>So(bo(e),bo(t))),Mo=ko(Eo(`Set`),bo),No=new WeakMap,Po=new WeakMap,Fo=new WeakSet;function Io(e,t){if(Fo.has(e))return Eo(`[Circular]`);Fo.add(e);let n=t();return Fo.delete(e),n}var Lo=`~effect/interfaces/Equal`;function Ro(){return arguments.length===1?e=>zo(e,arguments[0]):zo(arguments[0],arguments[1])}function zo(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n===typeof t?n===`number`&&e!==e&&t!==t?!0:n!==`object`&&n!==`function`||so.has(e)||so.has(t)?!1:Wo(e,t,Uo):!1}function Bo(e,t,n){let r=Vo.has(e),i=Ho.has(t);if(r&&i)return!0;if(r||i)return!1;Vo.add(e),Ho.add(t);let a=n();return Vo.delete(e),Ho.delete(t),a}var Vo=new WeakSet,Ho=new WeakSet;function Uo(e,t){if(bo(e)!==bo(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let n=$o(e),r=$o(t);if(n!==r)return!1;let i=n&&r;return typeof e==`function`&&!i?!1:Bo(e,t,()=>{if(i)return e[Lo](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:Ko(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;if(!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView)return!1;if(n){let n=t;return qo(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(n.buffer,n.byteOffset,n.byteLength))}return qo(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:Xo(e,t):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:Qo(e,t):Jo(e,t)})}function Wo(e,t,n){let r=Go.get(e);if(!r)r=new WeakMap,Go.set(e,r);else if(r.has(t))return r.get(t);let i=n(e,t);r.set(t,i);let a=Go.get(t);return a||(a=new WeakMap,Go.set(t,a)),a.set(e,i),i}var Go=new WeakMap;function Ko(e,t){for(let n=0;n<e.length;n++)if(!zo(e[n],t[n]))return!1;return!0}function qo(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Jo(e,t){let n=oo(e),r=oo(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!zo(e[i],t[i]))return!1;return!0}function Yo(e,t){return function(n,r){let i=Array.from(r);for(let[r,a]of n){let n=!1;for(let o=0;o<i.length;o++){let[s,c]=i[o];if(e(r,s)&&t(a,c)){i[o]=i[i.length-1],i.pop(),n=!0;break}}if(!n)return!1}return!0}}var Xo=Yo(zo,zo);function Zo(e){return function(t,n){let r=Array.from(n);for(let n of t){let t=!1;for(let i=0;i<r.length;i++){let a=r[i];if(e(n,a)){r[i]=r[r.length-1],r.pop(),t=!0;break}}if(!t)return!1}return!0}}var Qo=Zo(zo),$o=e=>vo(e,Lo),es=e=>(t,n)=>t===n||e(t,n),ts=e=>e.length>0;function ns(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function rs(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&ns(e,n,t[n])}var is=Symbol.for(`~effect/Redactable`),as=e=>vo(e,is);function os(e){return as(e)?ss(e):e}function ss(e){return e[is](globalThis[`~effect/Fiber/currentFiber`]?.context??us)}var cs=`~effect/Fiber/currentFiber`,ls=new Map,us={"~effect/Context":{},base:ls,depth:0,mapUnsafe:ls,pipe(){return Ya(this,arguments)}};function ds(e,t){let n=t?.space??0,r=new WeakSet,i=n?typeof n==`number`?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,n=0){if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||e==null||typeof e==`boolean`||typeof e==`symbol`)return String(e);if(typeof e==`bigint`)return String(e)+`n`;if(typeof e==`object`||typeof e==`function`){if(r.has(e))return fs;r.add(e);let l;if(is in e)l=c(ss(e),n);else if(Array.isArray(e))l=!i||e.length<=1?`[${e.map(e=>c(e,n)).join(`,`)}]`:`[\n${a(n+1)}${e.map(e=>c(e,n+1)).join(`,
10
+ `+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=hs(e);else if(!t?.ignoreToString&&vo(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=gs(e);l=e instanceof Error&&e.cause?`${t} (cause: ${c(e.cause,n)})`:t}else if(Symbol.iterator in e)l=`${e.constructor.name}(${c(Array.from(e),n)})`;else{let t=s(e);if(!i||t.length<=1){let r=`{${t.map(t=>`${ps(t)}:${c(e[t],n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${ps(t)}: ${c(e[t],n+1)}`).join(`,
11
+ `)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var fs=`[Circular]`;function ps(e){return typeof e==`string`?JSON.stringify(e):String(e)}function ms(e){return e.map(e=>`[${ps(e)}]`).join(``)}function hs(e){try{return e.toISOString()}catch{return`Invalid Date`}}function gs(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}var _s=Symbol.for(`nodejs.util.inspect.custom`),vs=e=>{try{return e=os(e),vo(e,`toJSON`)&&mo(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(vs):e}catch{return`[toJSON threw]`}},ys=class e{called=!1;self;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new e(this.self)}},bs=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})(),xs=`~effect/Effect`,Ss=`~effect/Exit`,Cs={_A:$a,_E:$a,_R:$a},ws=`${xs}/identifier`,Ts=`${xs}/args`,Es=`${xs}/evaluate`,Ds=`${xs}/successCont`,Os=`${xs}/failureCont`,ks=`${xs}/ensureCont`,As=Symbol.for(`effect/Effect/Yield`),js={pipe(){return Ya(this,arguments)},toJSON(){return{...this}},toString(){return ds(this.toJSON(),{ignoreToString:!0,space:2})},[_s](){return this.toJSON()}},Ms={[xs]:Cs,...js,[Symbol.iterator](){return new ys(this)},toJSON(){return{_id:`Effect`,op:this[ws],...Ts in this?{args:this[Ts]}:void 0}}},Ns=e=>vo(e,Ss),Ps=`~effect/Cause`,Fs=`~effect/Cause/Reason`,Is=e=>vo(e,Ps),Ls=class{[Ps];reasons;constructor(e){this[Ps]=Ps,this.reasons=e}pipe(){return Ya(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${ds(this.reasons)})`}[_s](){return this.toJSON()}[Lo](e){return Is(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>Ro(t,e.reasons[n]))}[yo](){return Ao(this.reasons)}},Rs=new WeakMap,zs=class{[Fs];annotations;_tag;constructor(e,t,n){if(this[Fs]=Fs,this._tag=e,t!==Bs&&typeof n==`object`&&n&&t.size>0){let e=Rs.get(n);e&&(t=new Map([...e,...t])),Rs.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return Ya(this,arguments)}toString(){return ds(this)}[_s](){return this.toString()}},Bs=new Map,Vs=class extends zs{error;constructor(e,t=Bs){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${ds(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[Lo](e){return qs(e)&&Ro(this.error,e.error)&&Ro(this.annotations,e.annotations)}[yo](){return So(Eo(this._tag))(So(bo(this.error))(bo(this.annotations)))}},Hs=e=>new Ls(e),Us=e=>new Ls([new Vs(e)]),Ws=class extends zs{defect;constructor(e,t=Bs){super(`Die`,t,e),this.defect=e}toString(){return`Die(${ds(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[Lo](e){return Js(e)&&Ro(this.defect,e.defect)&&Ro(this.annotations,e.annotations)}[yo](){return So(Eo(this._tag))(So(bo(this.defect))(bo(this.annotations)))}},Gs=e=>new Ls([new Ws(e)]),Ks=Qa(e=>Is(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new Ls(e.reasons.map(e=>e.annotate(t,n)))),qs=e=>e._tag===`Fail`,Js=e=>e._tag===`Die`,Ys=e=>e._tag===`Interrupt`;function Xs(e){return ac(`Effect.evaluate: Not implemented`)}var Zs=e=>({...Ms,[ws]:e.op,[Es]:e[Es]??Xs,[Ds]:e[Ds],[Os]:e[Os],[ks]:e[ks]}),Qs=e=>{let t=Zs(e);return function(){let n=Object.create(t);return n[Ts]=e.single===!1?arguments:arguments[0],n}},$s=e=>{let t={[Ss]:Ss,_tag:e.op,get[e.prop](){return this[Ts]},...Zs(e),toString(){return`${e.op}(${ds(this[Ts])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[Ts]}},[Lo](e){return Ns(e)&&e._tag===this._tag&&Ro(this[Ts],e[Ts])},[yo](){return So(Eo(e.op),bo(this[Ts]))}};return function(e){let n=Object.create(t);return n[Ts]=e,n}},ec=$s({op:`Success`,prop:`value`,[Es](e){let t=e.getCont(Ds);return t?t[Ds](this[Ts],e,this):e.yieldWith(this)}}),tc={key:`effect/Cause/StackTrace`},nc={key:`effect/Cause/InterruptorStackTrace`},rc=$s({op:`Failure`,prop:`cause`,[Es](e){let t=this[Ts],n=!1;e.currentStackFrame&&(t=Ks(t,{mapUnsafe:new Map([[tc.key,e.currentStackFrame]])}),n=!0);let r=e.getCont(Os);for(;e.interruptible&&e._interruptedCause&&r;)r=e.getCont(Os);return r?r[Os](t,e,n?void 0:this):e.yieldWith(n?rc(t):this)}}),ic=e=>rc(Us(e)),ac=e=>rc(Gs(e)),oc=Qs({op:`WithFiber`,[Es](e){return this[Ts](e)}}),sc=function(){class e extends globalThis.Error{}let t=Zs({op:`YieldableError`,[Es](){return ic(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),cc=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends sc{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(rs(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),lc=e=>{class t extends cc{_tag=e}return t.prototype.name=e,t};lc(`NoSuchElementError`);var uc=`~effect/data/Option`,dc={[uc]:{_A:e=>e},...js,[Symbol.iterator](){return new ys(this)}},fc=Object.defineProperty(Object.assign(Object.create(dc),{_tag:`Some`,_op:`Some`,[Lo](e){return hc(e)&&_c(e)&&Ro(this.value,e.value)},[yo](){return So(bo(this._tag))(bo(this.value))},toString(){return`some(${ds(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:vs(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),pc=bo(`None`),mc=Object.assign(Object.create(dc),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[Lo](e){return hc(e)&&gc(e)},[yo](){return pc},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),hc=e=>vo(e,uc),gc=e=>e._tag===`None`,_c=e=>e._tag===`Some`,vc=Object.create(mc),yc=e=>{let t=Object.create(fc);return t.value=e,t},bc=`~effect/data/Result`,xc={[bc]:{_A:e=>e,_E:e=>e},...js,[Symbol.iterator](){return new ys(this)}},Sc=Object.assign(Object.create(xc),{_tag:`Success`,_op:`Success`,[Lo](e){return wc(e)&&Ec(e)&&Ro(this.success,e.success)},[yo](){return So(bo(this._tag))(bo(this.success))},toString(){return`success(${ds(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:vs(this.success)}}}),Cc=Object.assign(Object.create(xc),{_tag:`Failure`,_op:`Failure`,[Lo](e){return wc(e)&&Tc(e)&&Ro(this.failure,e.failure)},[yo](){return So(bo(this._tag))(bo(this.failure))},toString(){return`failure(${ds(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:vs(this.failure)}}}),wc=e=>vo(e,bc),Tc=e=>e._tag===`Failure`,Ec=e=>e._tag===`Success`,Dc=e=>{let t=Object.create(Cc);return t.failure=e,t},Oc=e=>{let t=Object.create(Sc);return t.success=e,t};function kc(e){return(t,n)=>t===n?0:e(t,n)}var Ac=kc((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),jc=Qa(2,(e,t)=>kc((n,r)=>e(t(n),t(r))))(Ac,e=>e.getTime()),Mc=e=>Qa(2,(t,n)=>e(t,n)===1),Nc=()=>vc,Pc=yc,Fc=gc,Ic=Qa(2,(e,t)=>Fc(e)?t():e.value),Lc=Ic(to),Rc=Ic(no),zc=Qa(2,(e,t)=>Fc(e)?Nc():Pc(t(e.value))),Bc=Oc,Vc=Dc,Hc=Tc,Uc=Qa(2,(e,t)=>Hc(e)?Vc(t(e.failure)):e),Wc=globalThis.Array,Gc=e=>Wc.isArray(e)?e:Wc.from(e),Kc=Qa(2,(e,t)=>[...e,t]),qc=Qa(2,(e,t)=>Gc(e).concat(Gc(t)));Wc.isArray;var Jc=ts,Yc=ts,Xc=(e,t)=>{let n=bo(t),r=e.get(n);if(r===void 0)return e.set(n,[t]),!0;for(let e of r)if(Ro(e,t))return!1;return r.push(t),!0},Zc=Qa(2,(e,t)=>{let n=Gc(e),r=Gc(t);return Yc(n)?Yc(r)?el(qc(n,r)):n:r}),Qc=()=>[],$c=Qa(2,(e,t)=>e.map(t)),el=e=>{let t=Gc(e);if(t.length<2)return[...t];let n=new Map,r=[];for(let e of t)Xc(n,e)&&r.push(e);return r},tl=`~effect/BigDecimal`,nl={[tl]:tl,[yo](){let e=ll(this);return So(bo(e.value),To(e.scale))},[Lo](e){return rl(e)&&pl(this,e)},toString(){return`BigDecimal(${ml(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[_s](){return this.toJSON()},pipe(){return Ya(this,arguments)}},rl=e=>vo(e,tl),il=(e,t)=>{let n=Object.create(nl);return n.value=e,n.scale=t,n},al=(e,t)=>{if(e!==ol&&e%sl===ol)throw RangeError(`Value must be normalized`);let n=il(e,t);return n.normalized=n,n},ol=BigInt(0),sl=BigInt(10),cl=al(ol,0),ll=e=>{if(e.normalized===void 0){if(e.value===ol)e.normalized=cl;else{let t=`${e.value}`,n=0;for(let e=t.length-1;e>=0&&t[e]===`0`;e--)n++;n===0&&(e.normalized=e),e.normalized=al(BigInt(t.substring(0,t.length-n)),e.scale-n)}}return e.normalized},ul=Qa(2,(e,t)=>t>e.scale?il(e.value*sl**BigInt(t-e.scale),t):t<e.scale?il(e.value/sl**BigInt(e.scale-t),t):e),dl=e=>e.value<ol?il(-e.value,e.scale):e,fl=es((e,t)=>e.scale>t.scale?ul(t,e.scale).value===e.value:e.scale<t.scale?ul(e,t.scale).value===t.value:e.value===t.value),pl=Qa(2,(e,t)=>fl(e,t)),ml=e=>{let t=ll(e);if(Math.abs(t.scale)>=16)return hl(t);let n=t.value<ol,r=n?`${t.value}`.substring(1):`${t.value}`,i,a;if(t.scale>=r.length)i=`0`,a=`0`.repeat(t.scale-r.length)+r;else{let e=r.length-t.scale;if(e>r.length){let t=e-r.length;i=`${r}${`0`.repeat(t)}`,a=``}else a=r.slice(e),i=r.slice(0,e)}let o=a===``?i:`${i}.${a}`;return n?`-${o}`:o},hl=e=>{if(gl(e))return`0e+0`;let t=ll(e),n=`${dl(t).value}`,r=n.slice(0,1),i=n.slice(1),a=`${_l(t)?`-`:``}${r}`;i!==``&&(a+=`.${i}`);let o=i.length-t.scale;return`${a}e${o>=0?`+`:``}${o}`},gl=e=>e.value===ol,_l=e=>e.value<ol,vl=e=>Zs({op:e.label,[Es]:e.evaluate}),yl=`~effect/Context/Service`,bl=function(){function e(){}let t=e;Object.setPrototypeOf(t,xl);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[Cl]=Cl,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&Sl.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},xl={[yl]:yl,...vl({label:`Service`,evaluate(e){return ec(Hl(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return zl(this,e)},use(e){return oc(t=>e(Hl(t.context,this)))},useSync(e){return oc(t=>ec(e(Hl(t.context,this))))}},Sl=new Set,Cl=`~effect/Context/Reference`,wl=`~effect/Context`,Tl=8,El=8,Dl=(e,t,n,r)=>{let i=Object.create(Nl);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},Ol=(e,t)=>{t&&(Ol(e,t.parent),e.set(t.key,t.value))},kl=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return Ol(t,e.overlay),e._flat=t},Al=Symbol(),jl=(e,t)=>{let n=e;for(let e=n.overlay;e;e=e.parent)if(e.key===t)return e.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?Al:(n.overlay&&++n.baseHits>=El&&(n.base=kl(n),n.overlay=void 0,n.depth=0),r)},Ml=e=>Dl(void 0,e,void 0,0),Nl={...js,[wl]:{_Services:e=>e},get mapUnsafe(){return kl(this)},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[Lo](e){if(!Fl(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[e,r]of t)if(!n.has(e)||!Ro(r,n.get(e)))return!1;return!0},[yo](){return To(this.mapUnsafe.size)}},Pl=(e,t)=>e.cacheRoot===t.cacheRoot,Fl=e=>vo(e,wl),Il=e=>!!e[Cl],Ll=()=>Rl,Rl=Ml(new Map),zl=(e,t)=>Ml(new Map([[e.key,t]])),Bl=Qa(3,(e,t,n)=>{let r=e,i=Sl.has(t.key)?void 0:r.cacheRoot;if(r.depth>=Tl){let e=new Map(r.mapUnsafe);return e.set(t.key,n),Dl(i,e,void 0,0)}return Dl(i,r.base,{key:t.key,value:n,parent:r.overlay},r.depth+1)}),Vl=(e,t)=>{let n=jl(e,t);return n===Al?void 0:n},Hl=Qa(2,(e,t)=>{let n=jl(e,t.key);if(n===Al){if(Il(t))return Wl(t);throw Gl(t)}return n}),Ul=`~effect/Context/defaultValue`,Wl=e=>Ul in e?e[Ul]:e[Ul]=e.defaultValue(),Gl=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
12
+ `);e.splice(1,3),t.stack=e.join(`
13
+ `)}return t},Kl=bl,ql=Kl(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new Zl}),Jl=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},Yl=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},Xl=class{buckets=[];scheduleTask(e,t){let n=this.buckets,r=n.length,i,a=0;for(;a<r&&!(n[a][0]>t);a++)i=n[a];i&&i[0]===t?i[1].push(e):a===r?n.push([t,[e]]):n.splice(a,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}},Zl=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?Yl:Jl)}shouldYield(e){return e.currentOpCount>=e.maxOpsBeforeYield}makeDispatcher(){return new Ql(this.setImmediate)}},Ql=class{tasks=new Xl;running=void 0;setImmediate;constructor(e=Jl){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let n=e[t][1];for(let e=0;e<n.length;e++)n[e]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},$l=Kl(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),eu=Kl(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),tu=`effect/Tracer/ParentSpan`;bl()(tu,{fiberCached:!0});var nu=`effect/Tracer`,ru=`effect/observability/Metric/FiberRuntimeMetricsKey`,iu=Kl(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:no}),au=Kl(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),ou=Kl(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),su=class extends zs{fiberId;constructor(e,t=Bs){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[Lo](e){return Ys(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[yo](){return So(Eo(`${this._tag}:${this.fiberId}`))(xo(this.annotations))}},cu=e=>new Ls([new su(e)]),lu=e=>e.reasons.some(Ys),uu=Qa(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new Ls(Zc(e.reasons,t.reasons));return Ro(e,n)?e:n}),du=Qa(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>qs(e)?(n=!0,new Vs(t(e.error),e.annotations)):e);return n?Hs(r):e}),fu=`~effect/Fiber`,pu={_A:$a,_E:$a},mu={id:0},hu=()=>globalThis[cs],gu=class{constructor(e,t=!0){this[fu]=pu,this.setContext(e),this.id=++mu.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this.runtimeMetrics?.recordFiberStart(this.context)}[fu];id;interruptible;currentOpCount;_stack;_observers;_exit;_children;_interruptedCause;_yielded;_running;_deferredInterrupt;context;currentScheduler;currentTracerContext;currentSpan;currentLogLevel;minimumLogLevel;currentStackFrame;runtimeMetrics;maxOpsBeforeYield;currentPreventYield;_dispatcher=void 0;get currentDispatcher(){return this._dispatcher??=this.currentScheduler.makeDispatcher()}getRef(e){return Hl(this.context,e)}addObserver(e){return this._exit?(e(this._exit),ro):(this._observers.push(e),()=>{let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)})}interruptUnsafe(e,t){if(this._exit)return;let n=cu(e);this.currentStackFrame&&(n=Ks(n,zl(tc,this.currentStackFrame))),t&&(n=Ks(n,t)),this._interruptedCause=this._interruptedCause?uu(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(Cu(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===As)return;let n=vu.interruptChildren&&vu.interruptChildren(this);if(n!==void 0)return this.evaluate(zu(n,()=>t));this._exit=t,this.runtimeMetrics?.recordFiberEnd(this.context,this._exit);for(let e=0;e<this._observers.length;e++)this._observers[e](t);this._observers.length=0,this._stack.length=0,this._children=void 0,this.context=Ll()}runLoop(e){let t=globalThis[cs];globalThis[cs]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;){if(this._deferredInterrupt&&(this._deferredInterrupt=!1,i=Cu(this._interruptedCause)),this.currentOpCount++,!r&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){r=!0;let e=i;i=zu(Du,()=>e)}if(i=this.currentTracerContext?this.currentTracerContext(i,this):i[Es](this),i===As){let e=this._yielded;if(Ss in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return As}}}catch(e){return vo(i,Es)?this.runLoop(ac(e)):ac(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{this._running=n,globalThis[cs]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,_u;for(;;){let t=this._stack.pop();if(!t)return;let n=t[ks]&&t[ks](this);if(n)return n[e]=n,n;if(t[e])return t}}yieldWith(e){return this._yielded=e,As}children(){return this._children??=new Set}pipe(){return Ya(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&Pl(t,e))return;let n=this.getRef(ql);n!==this.currentScheduler&&(this.currentScheduler=n,this._dispatcher=void 0),this.currentSpan=Vl(e,tu),this.currentLogLevel=this.getRef(au),this.minimumLogLevel=this.getRef(ou),this.currentStackFrame=this.getRef(iu),this.maxOpsBeforeYield=this.getRef($l),this.currentPreventYield=this.getRef(eu),this.runtimeMetrics=Vl(e,ru);let r=Vl(e,nu);this.currentTracerContext=r?r.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag===`Span`?this.currentSpan:void 0}},_u={[Ds](e,t){return Cu(t._interruptedCause)},[Os](e,t){return Cu(t._interruptedCause)}},vu={interruptChildren:void 0},yu=e=>{if(!e.currentStackFrame)return;let t=new Map;return t.set(nc.key,e.currentStackFrame),Ml(t)},bu=e=>Nu(t=>{let n=e[Symbol.iterator](),r=[],i;function a(){let e=n.next();for(;!e.done;){if(e.value._exit){r.push(e.value._exit),e=n.next();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t(Su(r))}return a(),Tu(()=>i?.())}),xu=e=>oc(t=>{let n=yu(t),r=Qc();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return Ru(bu(r))}),Su=ec,Cu=rc,wu=ic,Tu=Qs({op:`Sync`,[Es](e){let t=this[Ts](),n=e.getCont(Ds);return n?n[Ds](t,e):e.yieldWith(ec(t))}}),Eu=Qs({op:`Suspend`,[Es](e){return this[Ts]()}}),Du=Qs({op:`Yield`,[Es](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(Ku)},this[Ts]??0),e.yieldWith(()=>{t=!0})}})(0),Ou=e=>Eu(()=>Cu(bs(e))),ku=e=>ac(e),Au=Su(void 0),ju=Qs({op:`Async`,single:!1,[Es](e){let t=bs(()=>this[Ts][0].bind(e.currentScheduler)),n=!1,r=!1,i=this[Ts][1]?new AbortController:void 0,a=t(t=>{n||(n=!0,r?e.evaluate(t):r=t)},i?.signal);return r===!1?(r=!0,e._yielded=()=>{n=!0},i===void 0&&a===void 0||e._stack.push(Mu(()=>(n=!0,i?.abort(),a??Ku))),As):r}}),Mu=Qs({op:`AsyncFinalizer`,[ks](e){e.interruptible&&(e.interruptible=!1,e._stack.push($u))},[Os](e,t){return lu(e)?zu(this[Ts](),()=>Cu(e)):Cu(e)}}),Nu=e=>ju(e,e.length>=2),Pu=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),Fu=(e,...t)=>Pu(e.length,t.length===0?function(){return Iu(()=>e.apply(this,arguments))}:function(){let n=Iu(()=>e.apply(this,arguments));for(let e of t)n=e(n);return n}),Iu=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return Su(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}if(i&&i._tag===`Failure`)return r.value;{let n=!0;return Eu(()=>n?(n=!1,zu(r.value,e=>Lu(t,e))):Eu(()=>Lu(e())))}}}catch(e){return ku(e)}},Lu=Qs({op:`Iterator`,single:!1,[Ds](e,t){let n=this[Ts][0];for(;;){let r=n.next(e);if(r.done)return Su(r.value);if(!Vu(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[Es](e){return this[Ds](this[Ts][1],e)}}),Ru=e=>zu(e,e=>Ku),zu=Qa(2,(e,t)=>{let n=Object.create(Bu);return n[Ts]=e,n[Ds]=t.length===1?t:e=>t(e),n}),Bu=Zs({op:`OnSuccess`,[Es](e){return e._stack.push(this),this[Ts]}}),Vu=e=>Ss in e,Hu=Qa(2,(e,t)=>Vu(e)?e._tag===`Success`?t(e.value):e:zu(e,t)),Uu=Qa(2,(e,t)=>zu(e,e=>Su(bs(()=>t(e))))),Wu=Qa(2,(e,t)=>Vu(e)?qu(e,t):Uu(e,t)),Gu=e=>e._tag===`Success`,Ku=ec(void 0),qu=Qa(2,(e,t)=>e._tag===`Success`?ec(t(e.value)):e),Ju=Qa(2,(e,t)=>{let n=Object.create(Yu);return n[Ts]=e,n[Os]=t.length===1?t:e=>t(e),n}),Yu=Zs({op:`OnFailure`,[Es](e){return e._stack.push(this),this[Ts]}}),Xu=e=>Vu(e)?ec(e):Zu(e),Zu=Qs({op:`Exit`,[Es](e){return e._stack.push(this),this[Ts]},[Ds](e,t,n){return Su(n??ec(e))},[Os](e,t,n){return Su(n??rc(e))}}),Qu=e=>oc(t=>t.interruptible?(t.interruptible=!1,t._stack.push($u),e):e),$u=Qs({op:`SetInterruptible`,[ks](e){if(e.interruptible=this[Ts],e._interruptedCause&&e.interruptible)return()=>Cu(e._interruptedCause)}})(!0),ed=e=>{let t=e.onItem,n=e.step,r=(e,i,a,o)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!Vu(c))return zu(Xu(c),t=>n(e,s,t,a)??r(e,i,a+1,o)??Au);let l=n(e,s,c,a);if(l)return l._tag===`Failure`?l:void 0}};return(e,i,a)=>{let o=0,s=a?.end??i.length,c=a?.concurrency??1;if(c===1)return r(e,i,0,s);let l=a?.orderedStep===!0&&c>1,u=!1,d,f,p,m=!1,h,g,_=o,v=l?Array(s):void 0,y=e=>{let t=ac(e);return h=t,u=!0,m=!0,f&&f.size>0?zu(Qu(xu(Array.from(f))),()=>t):t},b=(t,r,a)=>{if(!l)return n(e,t,r,a);if(h)return h;for(v[a]=r;_<s;){let t=v[_];if(t===void 0)return;v[_]=void 0;let r=_++,a=n(e,i[r],t,r);if(a)return a}},x=()=>{let n=!1;for(;!h&&o<s;o++){let r=i[o],a=g??t(e,r,o);if(Vu(a)){if(h=b(r,a,o),h)break}else if(d){g=void 0;let e=nd(d,a,!0,!0,`inherit`);if(e._exit){if(h=b(r,e._exit,o),h)break;continue}f.add(e);let t=o;if(e.addObserver(i=>{f.delete(e);try{if(h){if(!m&&i._tag===`Failure`)for(let e of i.cause.reasons)if(e._tag===`Interrupt`)continue;else h._tag===`Failure`?h.cause.reasons.push(e):h=rc(Hs([e]))}else{let e=b(r,i,t);e&&(h=e._tag===`Failure`?rc(Hs(e.cause.reasons.slice())):e,x())}if(n){let e=x();e&&p(e)}else u&&f.size===0&&p(h??Au)}catch(e){p(y(e))}}),f.size<c)continue;n=!0,o++;return}else return Nu(e=>{d=hu(),f=new Set,g=a,p=e;let t;try{t=x()}catch(t){return e(y(t))}return t?e(t):Eu(()=>(h=Ku,m=!0,f?xu(f):Au))})}if(u=!0,h){if(f&&f.size>0){let e=yu(d);f.forEach(t=>t.interruptUnsafe(d.id,e));return}if(p||h._tag===`Failure`)return h}else if(p){if(f)f.size===0&&p(Au);else return Ku}};return x()}},td=()=>ed,nd=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new gu(a.context,o);return n?s.evaluate(t):a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0),!r&&!s._exit&&(a.children().add(s),s.addObserver(()=>a._children.delete(s))),s},rd=e=>(t,n)=>{let r=new gu(n?.scheduler?Bl(e,ql,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal){if(n.signal.aborted)r.interruptUnsafe();else{let e=()=>r.interruptUnsafe();n.signal.addEventListener(`abort`,e,{once:!0}),r.addObserver(()=>n.signal.removeEventListener(`abort`,e))}}return n?.onFiberStart&&n.onFiberStart(r),r},id=(e=>{let t=rd(e);return e=>{if(Vu(e))return e;let n=new Zl(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??ac(new od(r))}})(Ll());lc(`TimeoutError`),lc(`IllegalArgumentError`),lc(`ExceededCapacityError`);var ad=`~effect/Cause/AsyncFiberError`,od=class extends lc(`AsyncFiberError`){[ad]=ad;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}};lc(`UnknownError`);var sd={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};sd.gray,sd.blue,sd.green,sd.yellow,sd.red,sd.bgBrightRed,sd.black;var cd=qs,ld=du;bl()(`effect/Cause/StackTrace`),bl()(`effect/Cause/InterruptorStackTrace`);var ud=ec,dd=rc,fd=ic,pd=Ku,md=Gu,hd=lc,gd=`~effect/time/DateTime`,_d=`~effect/time/DateTime/TimeZone`,vd={[gd]:gd,pipe(){return Ya(this,arguments)},[_s](){return this.toString()},toJSON(){return bd(this).toJSON()}};({...vd}),{...vd};var yd={[_d]:_d,[_s](){return this.toString()}};({...yd}),{...yd};var bd=e=>new Date(e.epochMilliseconds);globalThis.String;var xd=e=>e.trim(),Sd=Su,Cd=wu,wd=Ou,Td=zu,Ed=Xu,Dd=Ju,Od=id;bl()(`effect/Effect/Transaction`);var kd=Wu,Ad=Hu,jd=Fu;function Md(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}var Nd=`~structural`,Pd=`~sentinels`,Fd=`~constructor`,Id=io(e=>{let t=Md(e)?.identifier;return typeof t==`string`?t:e.getExpected(Id)}),Ld=Symbol(),Rd=ud,zd=Rd(Ld),Bd=Rd(Ld),Vd=e=>e===Ld?Nc():Pc(e),Hd=e=>e._tag===`None`?zd:Rd(e.value),Ud=`~effect/SchemaIssue/Issue`;function Wd(e){return vo(e,Ud)&&e[Ud]===Ud}function Gd(e){return Object.hasOwn(e,`input`)}var Kd=class{[Ud]=Ud;constructor(e,t){t?.reportInput===!0&&e!==Ld&&(this.input=e)}},qd=class extends Kd{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},Jd=class extends Kd{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},Yd=class extends Kd{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},Xd=class extends Kd{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},Zd=class extends Kd{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},Qd=class extends Kd{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},$d=class extends Kd{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},ef=class extends Kd{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},tf=class extends Kd{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},nf=class extends Kd{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function rf(e,t,n){if(Wd(e))return e;if(typeof e==`string`)return new ef({message:e},t,n);let r=typeof e.issue==`string`?new ef({message:e.issue},t,n):e.issue;return new Yd(e.path,r)}function af(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new ef(void 0,t,n):rf(e,t,n)}function of(e,t,n,r){return Array.isArray(t)?Yc(t)?t.length===1?rf(t[0],n,r):new Qd(e,$c(t,e=>rf(e,n,r)),n,r):void 0:af(t,n,r)}var sf=e=>{let t=vf(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return ff(Id(e.ast),e);case`InvalidValue`:{let t=df(e);if(t!==void 0)return ff(t,e);let n=uf(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=uf(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=uf(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},cf=e=>vf(e.issue)??vf(e);function lf(e){return t=>({issues:pf(t,[],e?.leafHook??sf,e?.checkHook??cf)})}function uf(e){return Gd(e)?ds(e.input):void 0}function df(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function ff(e,t){let n=uf(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function pf(e,t,n,r){switch(e._tag){case`Filter`:{let i=r(e);if(i!==void 0)return[{path:t,message:i}];if(e.issue._tag!==`InvalidValue`)return pf(e.issue,t,n,r);let a=df(e.issue);return[{path:t,message:a===void 0?ff(mf(e.filter),e):ff(a,e.issue)}]}case`Encoding`:return pf(e.issue,t,n,r);case`Pointer`:return pf(e.issue,[...t,...e.path],n,r);case`Composite`:return e.issues.flatMap(e=>pf(e,t,n,r));case`AnyOf`:return e.issues.length===0?[{path:t,message:vf(e)??ff(Id(e.ast),e)}]:e.issues.flatMap(e=>pf(e,t,n,r));default:return[{path:t,message:n(e)}]}}function mf(e){let t=e.annotations?.expected;if(typeof t==`string`)return t;switch(e._tag){case`Filter`:return`<filter>`;case`FilterGroup`:return e.checks.map(e=>mf(e)).join(` & `)}}function hf(){return e=>_f(e,``)}var gf=hf();function _f(e,t){let n;switch(e._tag){case`Filter`:{let r=cf(e);if(r!==void 0)n=r;else{if(e.issue._tag!==`InvalidValue`)return _f(e.issue,t);let r=df(e.issue);n=r===void 0?ff(mf(e.filter),e):ff(r,e.issue)}break}case`Encoding`:return _f(e.issue,t);case`Pointer`:return _f(e.issue,t+ms(e.path));case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>_f(e,t)).join(`
14
+ `);n=vf(e)??ff(Id(e.ast),e);break;default:n=sf(e)}return t?`${n}\n at ${t}`:n}function vf(e){if(e._tag===`Pointer`)return;if(e._tag===`Encoding`)return vf(e.issue);let t=(e._tag===`Filter`?e.filter.annotations:`annotations`in e?e.annotations:e.ast.annotations)?.[e._tag===`MissingKey`?`messageMissingKey`:e._tag===`UnexpectedKey`?`messageUnexpectedKey`:`message`];if(typeof t==`string`)return t}function yf(e){let t;for(let n of e.reasons){if(!cd(n)||!Wd(n.error))return;t??=n.error}return t}function bf(e,t){let n=yf(e);if(n===void 0)throw Error(t,{cause:e});return n}bl()(`effect/DateTime/CurrentTimeZone`),hd(`EncodingError`);var xf=class e extends Za{run;constructor(e){super(),this.run=e}map(t){return new e((e,n)=>this.run(e,n).pipe(kd(zc(t))))}compose(t){return Cf(this)?t:Cf(t)?this:new e((e,n)=>this.run(e,n).pipe(Ad(e=>t.run(e,n))))}},Sf=new xf(Sd);function Cf(e){return e.run===Sf.run}function wf(){return Sf}function Tf(e){return Ef(zc(e))}function Ef(e){return new xf(t=>Sd(e(t)))}function Df(){return Tf(globalThis.String)}function Of(){return Tf(globalThis.Number)}function kf(){return Tf(e=>new globalThis.Date(e))}function Af(){return Tf(xd)}var jf=`~effect/SchemaTransformation/Transformation`,Mf=class e{[jf]=jf;_tag=`Transformation`;decode;encode;constructor(e,t){this.decode=e,this.encode=t}flip(){return new e(this.encode,this.decode)}compose(t){return new e(this.decode.compose(t.decode),t.encode.compose(this.encode))}};function Nf(e){return vo(e,jf)&&e[jf]===jf}var Pf=e=>Nf(e)?e:new Mf(e.decode,e.encode);function Ff(){return new Mf(Af(),wf())}var If=new Mf(wf(),wf());function Lf(){return If}var Rf=new Mf(Of(),Df()),zf=new Mf(kf(),Tf(hs));function Bf(e){return t=>t._tag===e}var Vf=Bf(`Declaration`),Hf=Bf(`Never`),Uf=Bf(`Literal`),Wf=Bf(`UniqueSymbol`),Gf=Bf(`Arrays`),Kf=Bf(`Objects`),qf=Bf(`Suspend`),Jf=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},Yf={},Xf=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,n=void 0,r=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=n,this.annotations=r}},Zf=`~effect/Schema`,Qf=class{[Zf]=Zf;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,n=void 0,r=void 0){this.annotations=e,this.checks=t,this.encoding=n,this.context=r}toString(){return`<${this._tag}>`}},$f=class e extends Qf{_tag=`Declaration`;typeParameters;run;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.typeParameters=e,this.run=t,this.encodingChecks=o}getParser(){let e;return(t,n)=>t===Ld?zd:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(t,n,r){let i=nm(this.typeParameters,t);return i===this.typeParameters&&n===this.checks&&r===this.encodingChecks?this:new e(i,this.run,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){let e=this.annotations?.expected;return typeof e==`string`?e:`<Declaration>`}},ep=new class extends Qf{_tag=`Null`;getParser(){return hm(this,null)}getExpected(){return`null`}},tp=class extends Qf{_tag=`Undefined`;getParser(){return hm(this,void 0)}toCodecJson(){return Xp(this,[np])}getExpected(){return`undefined`}},np=new Jf(ep,new Mf(Tf(()=>void 0),Tf(()=>null))),rp=new tp,ip=new class extends Qf{_tag=`Unknown`;getParser(){return gm(this,go)}getExpected(){return`unknown`}},ap=class extends Qf{_tag=`Literal`;literal;constructor(e,t,n,r,i){if(super(t,n,r,i),typeof e==`number`&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${ds(e)}`);this.literal=e}getParser(){return hm(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?op(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:op(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function op(e){let t=globalThis.String(e.literal);return Xp(e,[new Jf(new ap(t),new Mf(Tf(()=>e.literal),Tf(()=>t)))])}var sp=new class extends Qf{_tag=`String`;getParser(){return gm(this,co)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&wm(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},cp=class extends Qf{_tag=`Number`;getParser(){return gm(this,lo)}matchKey(e,t){return this._match(ym,e,t)}matchPart(e,t){return this._match(vm,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:wm(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(lp(this.checks,`effect/schema/isFinite`)||lp(this.checks,`effect/schema/isInt`))?this:Xp(this,[up(this.checks)])}toCodecStringTree(){return this.toCodecJson()===this?Xp(this,[Sm]):Xp(this,[Cm])}getExpected(){return`number`}};function lp(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&lp(e.checks,t))}function up(e){return new Jf(new Rp([e?em(Kp,e):Kp,Vp],`anyOf`),new Mf(Of(),Tf(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))))}var dp=new cp,fp=new class extends Qf{_tag=`Boolean`;getParser(){return gm(this,uo)}getExpected(){return`boolean`}},pp=class e extends Qf{_tag=`Arrays`;isMutable;elements;rest;encodingChecks;constructor(e,t,n,r,i,a,o,s){super(r,i,a,o),this.isMutable=e,this.elements=t,this.rest=n,this.encodingChecks=s;let c=!1;for(let e=0;e<t.length;e++)if(lm(t[e]))c=!0;else if(c)throw Error(`A required element cannot follow an optional element. ts(1257)`);if(c&&n.length>1)throw Error(`A required element cannot follow an optional element. ts(1257)`);for(let e=1;e<n.length;e++)if(lm(n[e]))throw Error(`An optional element cannot follow a rest element. ts(1266)`)}getParser(e,t=e){let n=this,r,i,a=n.elements.length,o=Math.max(0,n.rest.length-1);function s(e,t){return t<a?r[t]:t>=e?i[t-e+1]:i[0]}return jd(function*(e,c){if(e===Ld)return Ld;if(!Array.isArray(e))return yield*Cd(new $d(n,e,c));r||(r=n.elements.map(e=>({ast:e,parser:t(e)})),i=n.rest.map(e=>({ast:e,parser:t(e)})));let l=e.length,u={ast:n,getParser:s,input:e,len:l,tailThreshold:Math.max(a,l-o),output:new globalThis.Array(l),issues:void 0,options:c},d=mp(u,e,{concurrency:hp(c?.concurrency)?.concurrency,end:n.rest.length===0?a:Math.max(l,a+o)});if(d&&(yield*d),n.rest.length===0&&l>a)for(let t=a;t<=l-1;t++){let r=new Zd(n,e[t],c),i=new Yd([t],r);if(c.errors===`all`)u.issues?u.issues.push(i):u.issues=[i];else return yield*Cd(new Qd(n,[i],e,c))}return u.issues?yield*Cd(new Qd(n,u.issues,e,c)):u.output})}_rebuild(t,n,r){let i=nm(this.elements,t),a=nm(this.rest,t);return i===this.elements&&a===this.rest&&n===this.checks&&r===this.encodingChecks?this:new e(this.isMutable,i,a,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return`array`}},mp=td()({onItem(e,t,n){let r=n<e.len?t:Ld;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step(e,t,n,r){if(n._tag===`Failure`)return gp(e,e.ast,r,n);let i=n===Bd?t:n[Ts];if(i!==Ld)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(lm(t.ast))return;let n=new Yd([r],new Xd(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return fd(new Qd(e.ast,[n],e.input,e.options))}}}),hp=e=>(e=e===`unbounded`?1/0:e??1,e>1?{concurrency:e}:void 0),gp=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=yf(r.cause);if(i===void 0)return dd(ld(r.cause,r=>new Qd(t,[new Yd([n],r)],e.input,e.options)));let a=new Yd([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return fd(new Qd(t,[a],e.input,e.options))},_p=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function vp(e,t,n=Yf){let r,i;function a(t){switch(t._tag){case`String`:case`TemplateLiteral`:return(r??=Object.keys(e)).filter(e=>t.matchPart(e,n)!==void 0);case`Number`:return(r??=Object.keys(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Symbol`:return(i??=Object.getOwnPropertySymbols(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Union`:return[...new Set(t.types.flatMap(a))];default:return[]}}return a(_m(fm(t)))}var yp=class{name;type;constructor(e,t){this.name=e,this.type=t}};function bp(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(bp);default:return!1}}function xp(e){return bp(e)&&bp(fm(e))}var Sp=class{parameter;type;constructor(e,t){if(!xp(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,lm(t)&&!mm(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},Cp=class e extends Qf{_tag=`Objects`;propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=o;let s=e.map(e=>e.name).filter((e,t,n)=>n.indexOf(e)!==t);if(s.length>0)throw Error(`Duplicate identifiers: ${JSON.stringify(s)}. ts(2300)`)}getParser(e,t=e){let n=this,r=[];for(let e of n.propertySignatures)r.push(e.name);let i=r.length,a=n.indexSignatures.length,o=i&&a?new Set(r):void 0;if(!i&&!a)return gm(n,ho);let s,c,l=(e,t,r,a,s)=>{if(s._tag===`Failure`)return gp(e,n,t,s)??pd;let c=s===Bd?a:s[Ts];if(r!==Ld&&c!==Ld){if(i&&(o.has(t)||o.has(r)))return pd;ns(e.out,r,c)}return pd},u=(e,t,r,i)=>{if(!i){let n=r.parserKey(t,e.options);if(!Vu(n))return Td(Ed(n),n=>u(e,t,r,n));i=n}if(i._tag===`Failure`)return gp(e,n,t,i)??pd;let a=i===Bd?t:i[Ts],o=e.input[t],s=r.parserValue(o,e.options);return Vu(s)?l(e,t,a,o,s):Td(Ed(s),n=>l(e,t,a,o,n))},d=(e,t,n)=>{let r=e.input[t],i=n.parserValue(r,e.options);return Vu(i)?l(e,t,t,r,i):Td(Ed(i),n=>l(e,t,t,r,n))},f=a?td()({onItem:(e,[t,n])=>u(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0;return jd(function*(l,p){if(l===Ld)return Ld;if(!(typeof l==`object`&&l&&!Array.isArray(l)))return yield*Cd(new $d(n,l,p));s||(s=n.propertySignatures.map(e=>({parser:t(e.type),name:e.name,type:e.type})),c=a?n.indexSignatures.map(n=>({is:n,parserKey:e(_m(n.parameter)),parserValue:t(n.type)})):void 0);let m=l,h={},g={ast:n,input:m,out:h,issues:void 0,options:p},_=p.errors===`all`,v=p.onExcessProperty===`error`,y=p.onExcessProperty===`preserve`,b;if(!a&&(v||y)){o??=new Set(r),b=Reflect.ownKeys(m);for(let e=0;e<b.length;e++){let t=b[e];if(!o.has(t)){if(v){let e=new Zd(n,m[t],p),r=new Yd([t],e);if(_){g.issues?g.issues.push(r):g.issues=[r];continue}return yield*Cd(new Qd(n,[r],l,p))}ns(h,t,m[t])}}}let x=hp(p?.concurrency);if(i){let e=wp(g,s,x);e&&(yield*e)}if(a&&!x)for(let e=0;e<a;e++){let t=c[e],n=t.is.parameter===sp?d:u,r=t.is.parameter===sp?Object.keys(m):vp(m,t.is.parameter,p);for(let e=0;e<r.length;e++){let i=n(g,r[e],t);if(!Vu(i))yield*i;else if(i._tag===`Failure`)return yield*i}}else if(f){let e=Qc();for(let t=0;t<a;t++){let n=c[t],r=vp(m,n.is.parameter,p);for(let t=0;t<r.length;t++)e.push([r[t],n])}let t=f(g,e,x);t&&(yield*t)}if(g.issues)return yield*Cd(new Qd(n,g.issues,l,p));if(p.propertyOrder===`original`){let e=(b??Reflect.ownKeys(m)).concat(r),t={};for(let n of e)Object.hasOwn(h,n)&&ns(t,n,h[n]);return t}return h})}_rebuild(t,n,r,i){let a=nm(this.propertySignatures,e=>{let n=t(e.type);return n===e.type?e:new yp(e.name,n)}),o=nm(this.indexSignatures,e=>{let r=n(e.parameter),i=t(e.type);return r===e.parameter&&i===e.type?e:new Sp(r,i)});return a===this.propertySignatures&&o===this.indexSignatures&&r===this.checks&&i===this.encodingChecks?this:new e(a,o,this.annotations,r,void 0,this.context,i)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?`object | array`:`object`}},wp=td()({onItem(e,t){if(!Object.hasOwn(e.input,t.name))return t.parser(Ld,e.options);let n=e.input[t.name];return ns(e.out,t.name,n),t.parser(n,e.options)},step(e,t,n){if(n._tag===`Failure`)return gp(e,e.ast,t.name,n);if(n===Bd)return;let r=n[Ts];if(r!==Ld){ns(e.out,t.name,r);return}if(delete e.out[t.name],!lm(t.type)){let n=new Yd([t.name],new Xd(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return fd(new Qd(e.ast,[n],e.input,e.options))}}});function Tp(e,t){return e?t?[...e,...t]:e:t}function Ep(e,t,n){return new Cp(Reflect.ownKeys(e).map(t=>new yp(t,e[t].ast)),[],n,t)}function Dp(e){return e.ast}function Op(e,t,n){return new Rp(e.map(Dp),t,void 0,n)}function kp(e,t){if(e.encoding||t.some(e=>e.encoding))throw Error(`StructWithRest does not support encodings`);let n=e.propertySignatures,r=e.indexSignatures,i=e.checks;for(let e of t)n=n.concat(e.propertySignatures),r=r.concat(e.indexSignatures),i=Tp(i,e.checks);return new Cp(n,r,void 0,i)}var Ap=ao(e=>{for(;;){if(qf(e))return ip;let t=e.encoding;if(!t)return e.recur?.(Ap,$a)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==$a))return ip;e=t[t.length-1].to}});function jp(e){switch(e._tag){case`Null`:return[`null`];case`Undefined`:return[`undefined`];case`String`:case`TemplateLiteral`:return[`string`];case`Number`:return[`number`];case`Boolean`:return[`boolean`];case`Symbol`:case`UniqueSymbol`:return[`symbol`];case`BigInt`:return[`bigint`];case`Arrays`:return[`array`];case`ObjectKeyword`:return[`object`,`array`,`function`];case`Objects`:return e.propertySignatures.length||e.indexSignatures.length?[`object`]:[`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`];case`Enum`:return Array.from(new Set(e.enums.map(([,e])=>typeof e)));case`Literal`:return[typeof e.literal];case`Union`:return Array.from(new Set(e.types.flatMap(jp)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function Mp(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[Pd];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!lm(t)){if(Uf(t))return[{key:e.name,literal:t.literal}];if(Wf(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!lm(e)){if(Uf(e))return[{key:t,literal:e.literal}];if(Wf(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>Mp(Ap(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return Mp(e.thunk())}}var Np=new WeakMap,Pp=Object.freeze([]);function Fp(e){let t=Np.get(e);if(t)return t;let n,r=0,i,a,o=!0;for(let t=0;t<e.length;t++){let s=e[t],c=Ap(s);if(Hf(c))continue;if(o){if(Uf(c)||Wf(c)){a??=new Map;let e=Uf(c)?c.literal:c.symbol,t=a.get(e);t||a.set(e,t=[]),t.push(s)}else o=!1}let l=Mp(c);if(l.length){n??=new Map,r++;for(let{key:e,literal:r}of l){let i=n.get(e);i||n.set(e,i=[new Map,new Set]),i[1].add(t);let a=i[0].get(r);a||i[0].set(r,a=new Set),a.add(t)}}else{i??={};let e=jp(c);for(let n of e)(i[n]??=[]).push(t)}}if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??Pp;else if(n?.size===1&&!i){let[r,[i]]=n.entries().next().value,a=i;for(let[t,n]of i)a.set(t,Object.freeze(Array.from(n,t=>e[t])));t=(t,n)=>{if(_o(t)){let i=Object.hasOwn(t,r)?t[r]:void 0;if(i!==void 0)return a.get(i)??Pp;if(n)return e}return Pp}}else if(n){let a;for(let e of n)(!a||e[1][0].size>a[1][0].size)&&e[1][1].size===r&&(a=e);t=(t,r)=>{let o=i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??Pp;if(!_o(t))return o.map(t=>e[t]);let s=new Set(o),c;if(a){let[n,[i]]=a,l=Object.hasOwn(t,n),u=l?t[n]:void 0;if(l&&(!r||u!==void 0)){let t=i.get(u);if(!t)return o.map(t=>e[t]);for(let e of t)s.add(e);c=n}}if(c===void 0)for(let[e,[i,a]]of n){let n=Object.hasOwn(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);if(e)for(let t of e)s.add(t)}else if(r)for(let e of a)s.add(e)}for(let[e,[i,a]]of n){if(e===c)continue;let n=Object.hasOwn(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);for(let t of s)a.has(t)&&!e?.has(t)&&s.delete(t)}}return Array.from(s).sort((e,t)=>e-t).map(t=>e[t])}}else t=t=>(i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??Pp).map(t=>e[t]).filter(Ip(t));return Np.set(e,t),t}function Ip(e){return t=>{let n=Ap(t);return n._tag===`Literal`?n.literal===e:n._tag!==`UniqueSymbol`||n.symbol===e}}function Lp(e,t,n=!1){return Fp(t)(e,n)}var Rp=class e extends Qf{_tag=`Union`;types;mode;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.types=e,this.mode=t,this.encodingChecks=o}getParser(e,t){let n=this;return(r,i)=>{if(r===Ld)return zd;let a=Lp(r,n.types,t!==void 0);if(a.length===1){let t=e(a[0])(r,i);return t._tag===`Success`?t:Vu(t)?zp(n,t.cause,r,i):Dd(t,e=>zp(n,e,r,i))}let o={ast:n,compile:e,input:r,out:void 0,successes:n.mode===`oneOf`?[]:void 0,issues:void 0,options:i},s=hp(i?.concurrency),c=Bp(o,a,s?{...s,orderedStep:!0}:void 0);return c?Ad(c,e=>o.out===Bd?Sd(r):o.out?o.out:Cd(new tf(n,o.issues??[],r,i))):o.out?o.out:Cd(new tf(n,o.issues??[],r,i))}}_rebuild(t,n,r){let i=nm(this.types,t);return i===this.types&&n===this.checks&&r===this.encodingChecks?this:new e(i,this.mode,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let n of this.types){let r=n.matchPart(e,t);if(r!==void 0)return r}}getExpected(e){let t=this.annotations?.expected;if(typeof t==`string`)return t;if(this.types.length===0)return`never`;let n=this.types.map(t=>{let n=fm(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(Uf);if(t.length>0)return`${Hp(n.isMutable)}[ ${t.map(t=>e(t)+Up(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>Uf(e.type));if(t.length>0)return`{ ${t.map(t=>`${Hp(t.type.context?.isMutable)}${ps(t.name)}${Up(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function zp(e,t,n,r){let i=yf(t);return i?fd(new tf(e,[i],n,r)):dd(t)}var Bp=td()({onItem(e,t){return e.compile(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=yf(n.cause);if(t===void 0)return n;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(t),fd(new nf(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(t);else return pd}}}),Vp=new Rp([new ap(`Infinity`),new ap(`-Infinity`),new ap(`NaN`)],`anyOf`);function Hp(e){return e?``:`readonly `}function Up(e){return e?`?`:``}var eee=class e extends Za{_tag=`Filter`;run;annotations;aborted;constructor(e,t=void 0,n=!1){super(),this.run=e,this.annotations=t,this.aborted=n}annotate(t){return new e(this.run,{...this.annotations,...t},this.aborted)}abort(){return new e(this.run,this.annotations,!0)}and(e,t){return new tee([this,e],t)}},tee=class e extends Za{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(t){return new e(this.checks,{...this.annotations,...t})}and(t,n){return new e([this,t],n)}};function Wp(e,t,n=!1){return new eee((t,n,r)=>of(n,e(t,n,r),t,r),t,n)}function Gp(e){return Wp(e=>globalThis.Number.isFinite(e),{expected:`a finite number`,representation:{id:`effect/schema/isFinite`,payload:null},toJsonSchema:()=>({type:`number`}),toCode:()=>({runtime:`Schema.isFinite()`}),arbitrary:{constraint:{noInfinity:!0,noNaN:!0}},...e})}var Kp=em(dp,[Gp()]);function qp(e,t){let n=e.source,r=new globalThis.RegExp(n,e.flags);return Wp(e=>(r.lastIndex=0,r.test(e)),{expected:`a string matching the RegExp ${n}`,representation:{id:`effect/schema/isPattern`,payload:{source:n,flags:e.flags}},toJsonSchema:()=>({pattern:n}),arbitrary:{constraint:{patterns:[e.source]}},...t})}function Jp(e,t){let n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}var Yp=new WeakMap;function nee(e){return Yp.get(e)??e}function Xp(e,t){return e.encoding===t?e:Jp(e,e=>{e.encoding.value=t})}function Zp(e,t){if(e.context===t)return e;let n=nee(e);if(n.context===t)return n;let r=Jp(e,e=>{e.context.value=t});return Yp.set(r,n),r}function Qp(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return $p(e,Kc(e.checks.slice(0,-1),n.annotate(t)))}return Jp(e,e=>{e.annotations.value={...e.annotations.value,...t}})}function $p(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:Jp(e,e=>{e.checks.value=t})}function em(e,t){return $p(e,Tp(e.checks,t))}function ree(e,t){let n=t(e.to);return n===e.to?e:new Jf(n,e.transformation)}function tm(e,t){let n=e,r=n[n.length-1],i=ree(r,t);return i===r?e:Kc(e.slice(0,e.length-1),i)}function iee(e){return t=>t.encoding?Xp(t,tm(t.encoding,e)):t}function aee(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:Xp(r,tm(r.encoding,n))}return e(r)}return ao(n)}function oee(e,t,n){let r=new Jf(e,t);return Xp(n,n.encoding?[...n.encoding,r]:[r])}function nm(e,t){let n=!1,r=Array(e.length);for(let i=0;i<e.length;i++){let a=e[i],o=t(a);o!==a&&(n=!0),r[i]=o}return n?r:e}function see(e,t){return Zp(e,e.context?new Xf(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new Xf(!1,!1,void 0,t))}var rm=ao(e=>im(Zp(e,e.context?e.context.isOptional===!1?new Xf(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new Xf(!0,!1)))),im=iee(rm),am=io(e=>rm(new Rp([e,rp],`anyOf`)));function om(e,t,n){return oee(e,n,t)}function sm(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:po(e.literal)&&t.push(e.literal);return;case`UniqueSymbol`:t.push(e.symbol);return;case`Never`:return;case`Union`:for(let t=0;t<e.types.length;t++)r(e.types[t]);return;default:n.push(e)}}return r(e),{literals:t,parameters:n}}function cm(e,t){let{literals:n,parameters:r}=sm(e);return new Cp(n.map(e=>new yp(e,t)),r.map(e=>new Sp(e,t)))}function lm(e){return e.context?.isOptional??!1}function um(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(um)}function cee(e){function t(e){return um(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return Jc(n)?n:void 0}var dm=ao(e=>{if(e.encoding)return dm(Xp(e,void 0));let t=e,n=t.recur?.(dm)??t,r=n.encodingChecks;if(r){let t=n===e?r:Gf(n)||Kf(n)||Vf(n)&&n.typeParameters.length>0?cee(r):void 0;return Jp(n,e=>{e.encodingChecks.value=void 0,e.checks.value=Tp(n.checks,t)})}return n}),fm=ao(e=>dm(pm(e)));function lee(e,t){let n=t,r=n.length,i=n[r-1],a=[new Jf(pm(Xp(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new Jf(pm(n[e-1].to),n[e].transformation.flip()));let o=pm(i.to);return o.encoding?Xp(o,[...o.encoding,...a]):Xp(o,a)}var pm=io(e=>{if(e.encoding)return lee(e,e.encoding);let t=e;return t.flip?.(pm)??t.recur?.(pm)??t});function mm(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(mm);default:return!1}}function hm(e,t){let n=Rd(t);return(r,i)=>r===Ld?zd:r===t?n:Cd(new $d(e,r,i))}function gm(e,t){return(n,r)=>n===Ld?zd:t(n)?Bd:Cd(new $d(e,n,r))}var _m=aee(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(_m)}}),vm=new globalThis.RegExp(`^${_p}$`),ym=new globalThis.RegExp(`^(?:${_p}|Infinity|-Infinity|NaN)$`);function bm(e){return qp(vm,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:vm.source}),...e})}var xm=em(sp,[bm()]),Sm=new Jf(xm,Rf),Cm=new Jf(new Rp([xm,Vp],`anyOf`),Rf);function wm(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=wm(o.checks,t,n,r,i),n&&(i.errors!==`all`||n[n.length-1].filter.aborted))return n}else{let e=o.run(t,r,i);if(e){let r=new qd(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function Tm(e){if(!Vf(e))return;let t=e.annotations?.[Fd];return mo(t)?t(e.typeParameters):void 0}function Em(e){return e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&globalThis.Number.isFinite(e)}function Dm(e){return e===void 0||typeof e==`string`}function Om(e,t){let n=new WeakMap,r=[];outer:for(;;){if(typeof e!=`object`||!e){if(!t(e))return!1}else{let t=e,i=n.get(t);if(i===!1)return!1;if(i===void 0){let e=Array.isArray(t);if(!e){let e=Object.getPrototypeOf(t);if(e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null)return!1}n.set(t,!1),r.push({value:t,keys:e?t.length:Object.keys(t),index:0})}}for(;r.length>0;){let t=r[r.length-1],i=t.keys;if(typeof i==`number`){if(t.index<i){e=t.value[t.index++];continue outer}}else if(t.index<i.length){e=t.value[i[t.index++]];continue outer}n.set(t.value,!0),r.pop()}return!0}}function km(e){return Om(e,Em)}var Am=Qp(new $f([],()=>(e,t,n)=>km(e)?Bd:Cd(new $d(t,e,n)),{representation:{id:`effect/schema/Json`,payload:null},expected:`JSON value`,toCodecJson:()=>void 0,toCodecStringTree:()=>Mm,toArbitrary:()=>e=>e.jsonValue()}),{representation:{id:`effect/schema/MutableJson`,payload:null}});function jm(e){return Om(e,Dm)}var Mm=new Jf(new $f([],()=>(e,t,n)=>jm(e)?Bd:Cd(new $d(t,e,n)),{expected:`StringTree`,toCodecStringTree:()=>void 0}),Lf());function Nm(e){let t=Vm(Wm,dm(e.ast));return(e,n)=>t(e,n?.disableChecks?n?.parseOptions?{...n.parseOptions,disableChecks:!0}:{disableChecks:!0}:n?.parseOptions)}function Pm(e){let t=Nm(e);return(e,n)=>{let r=Od(t(e,n));return md(r)?Pc(r.value):(bf(r.cause,`Option adapter can only return none for schema issues`),Nc())}}function Fm(e){let t=Nm(e);return(e,n)=>{let r=Od(t(e,n));if(md(r))return r.value;let i=bf(r.cause,`Constructor adapter can only throw schema issues`);throw Error(`Schema validation failed`,{cause:i})}}function Im(e,t){let n=Bm(e.ast);return t===void 0?n:(e,r)=>n(e,Rm(t,r))}function Lm(e,t){return pee(Im(e,t))}var uee=Lm;function dee(e,t){return mee(Im(e,t))}function fee(e,t){let n=Bm(pm(e.ast));return t===void 0?n:(e,r)=>n(e,Rm(t,r))}var Rm=(e,t)=>t?{...e,...t}:e,zm=e=>e===Ld?Cd(new ef):Sd(e);function Bm(e){return Vm(Um,e)}function Vm(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??Yf);return a===Bd?Sd(r):Vu(a)?a[Ts]===Ld?zm(Ld):a:Ad(a,zm)}}function Hm(e){return(t,n)=>Od(e(t,n))}function pee(e){let t=Hm(e);return(e,n)=>{let r=t(e,n);return md(r)?Pc(r.value):(bf(r.cause,`Option adapter can only return none for schema issues`),Nc())}}function mee(e){let t=Hm(e);return(e,n)=>{let r=t(e,n);return md(r)?Bc(r.value):Vc(bf(r.cause,`Result adapter can only return schema issues`))}}var Um=io(e=>qm(e,Um)),Wm=io(e=>qm(e,Wm,Gm)),hee=io(e=>qm(e,Wm,Gm,e.context?.constructorDefault));function Gm(e){return e.context?.constructorDefault?hee(e):Wm(e)}function Km(e,t,n,r){let i;if(Vu(e)&&e._tag===`Success`){let a=Vd(e===Bd?t:e[Ts]);i=n._tag===`Transformation`?n.decode.run(a,r):n.decode(Rd(a),r)}else i=n._tag===`Transformation`?Ad(e,e=>n.decode.run(Vd(e),r)):n.decode(kd(e,Vd),r);return Vu(i)&&i._tag===`Success`?Hd(i[Ts]):Ad(i,Hd)}function gee(e,t){let n;return(r,i)=>r===Ld?zd:e.isConstructed(r)?Bd:Km((n??=t(e.link.to))(r,i),r,e.link.transformation,i)}function qm(e,t,n,r){let i=n?Tm(e):void 0,a=i?gee(i,t):e.getParser(t,n),o=e.checks,s=r?e.encoding?[...e.encoding,r]:[r]:e.encoding,c=e.encodingChecks,l=(o?o[o.length-1].annotations:e.annotations)?.parseOptions;if(!s&&!o&&!c)return l?(e,t)=>a(e,Rm(t,l)):a;let u,d=(t,n)=>{let r=a(t,n);if(c&&!n.disableChecks){if(Vu(r)){if(r._tag===`Success`){let i=r===Bd?t:r[Ts];if(t!==Ld&&i!==Ld){let i=wm(c,t,void 0,e,n);i&&(r=Cd(new Qd(e,i,t,n)))}}}else r=Td(r,r=>{if(t!==Ld&&r!==Ld){let r=wm(c,t,void 0,e,n);if(r)return Cd(new Qd(e,r,t,n))}return Sd(r)})}if(o&&!n.disableChecks){if(Vu(r)){if(r._tag===`Success`){let i=r===Bd?t:r[Ts];if(i===Ld)return r;let a=wm(o,i,void 0,e,n);a&&(r=Cd(new Qd(e,a,i,n)))}}else r=Td(r,t=>{if(t!==Ld){let r=wm(o,t,void 0,e,n);if(r)return Cd(new Qd(e,r,t,n))}return Sd(t)})}return r};return s?(n,r)=>{l&&(r=Rm(r,l));let i=u??=s.map(e=>t(e.to)),a=n,o=i[i.length-1](n,r);for(let e=s.length-1;e>=0;e--)if(o=Km(o,a,s[e].transformation,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[Ts],o=t(a,r)):o=Ad(o,e=>{let n=t(e,r);return n===Bd?Rd(e):n})}if(o._tag===`Success`){let e=o[Ts],t=d(e,r);return t===Bd?o:t}return o=Dd(o,t=>wd(()=>ld(t,t=>new Jd(e,t,n,r)))),Ad(o,e=>{let t=d(e,r);return t===Bd?Rd(e):t})}:l?(e,t)=>d(e,Rm(t,l)):d}var Jm=`~effect/Schema/Schema`,Ym={[Jm]:Jm,pipe(){return Ya(this,arguments)},annotate(e){return this.rebuild(Qp(this.ast,e))},annotateKey(e){return this.rebuild(see(this.ast,e))},check(...e){return this.rebuild(em(this.ast,e))}};function Xm(e,t){function n(){}let r=Object.defineProperties(Object.setPrototypeOf(n,Ym),Object.getOwnPropertyDescriptors({...t}));return r.ast=e,r.rebuild=e=>Xm(e,t),r.makeEffect=Nm(r),r.make=Fm(r),r.makeOption=Pm(r),r}var Zm=e=>e;function Qm(){return(e,t,n)=>hh(new $f(e.map(Dp),e=>t(e.map(e=>hh(e))),n))}function $m(e,t){return Qm()([],()=>(t,n,r)=>e(t)?Sd(t):Cd(new $d(n,t,r)),t)}var eh=`~effect/SchemaError/SchemaError`,th=class extends hd(`SchemaError`){[eh]=eh;constructor(e){super({issue:e})}get message(){return gf(this.issue)}toString(){return`SchemaError(${this.message})`}};function nh(e){return vo(e,eh)&&e[eh]===eh}function rh(e,t){let n=Im(e,t);return(e,t)=>ih(n(e,t))}function ih(e){return Dd(e,e=>wd(()=>ld(e,e=>new th(e))))}function ah(e,t){let n;for(let r of e.reasons){if(!cd(r)||!nh(r.error))throw new globalThis.Error(t,{cause:e});n??=r.error}if(n===void 0)throw new globalThis.Error(t,{cause:e});return n}function oh(e){let t=Od(e);if(md(t))return t.value;throw ah(t.cause,`Sync adapter can only throw schema errors`)}var sh=Lm,ch=uee;function lh(e,t){let n=dee(e,t);return(e,t)=>Uc(n(e,t),e=>new th(e))}function uh(e,t){let n=rh(e,t);return(e,t)=>oh(n(e,t))}var dh=uh;function fh(e,t){let n=fee(e,t);return(e,t)=>ih(n(e,t))}function ph(e,t){let n=fh(e,t);return(e,t)=>oh(n(e,t))}var mh=ph,hh=Xm,gh=Zm(e=>hh(rm(e.ast),{schema:e})),_h=Zm(e=>{let t=_ee(e);return hh(am(e.ast),{schema:t})});function vh(e){let t=hh(new ap(e),{literal:e,transform(n){return t.pipe(Fh(vh(n),{decode:Tf(()=>n),encode:Tf(()=>e)}))}});return t}var yh=hh(ip),bh=hh(ep),xh=hh(rp),Sh=hh(sp),Ch=hh(dp),wh=hh(fp);function Th(e,t){return hh(e,{fields:t,mapFields(e,t){let n=e(this.fields);return Th(Ep(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function Eh(e){return Th(Ep(e,void 0),e)}function Dh(e,t){return hh(cm(e.ast,t.ast),{key:e,value:t})}function Oh(e,t){return hh(kp(e.ast,t.map(Dp)),{schema:e,records:t})}var kh=Zm(e=>hh(new pp(!1,[],[e.ast]),{value:e})),Ah=Zm(e=>hh(new pp(!0,e.ast.elements,e.ast.rest),{schema:e}));function jh(e,t){return hh(e,{members:t,mapMembers(e,t){let n=e(this.members);return jh(Op(n,this.ast.mode,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function Mh(e,t){return jh(Op(e,t?.mode??`anyOf`,void 0),e)}function Nh(e){let t=e.map(vh);return hh(Op(t,`anyOf`,void 0),{literals:e,members:t,mapMembers(e){return Mh(e(this.members))},pick(e){return Nh(e)},transform(e){return Mh(t.map((t,n)=>t.transform(e[n])))}})}var Ph=Zm(e=>Mh([e,bh])),_ee=Zm(e=>Mh([e,xh]));function Fh(e,t){return n=>hh(om(n.ast,e.ast,t?Pf(t):Lf()),{from:n,to:e})}function vee(){return(e,t)=>new Jf(e.ast,Pf(t))}var Ih=Wp,Lh=`^\\S[\\s\\S]*\\S$|^\\S$|^$`;function yee(e){let t=new globalThis.RegExp(Lh);return Ih(e=>e.trim()===e,{expected:`a string with no leading or trailing whitespace`,representation:{id:`effect/schema/isTrimmed`,payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:`Schema.isTrimmed()`}),arbitrary:{constraint:{patterns:[Lh]}},...e})}function bee(e,t){let n=e.source,r=e.flags,i=r===``?`new RegExp(${ds(n)})`:`new RegExp(${ds(n)}, ${ds(r)})`;return qp(e,{toCode:()=>({runtime:`Schema.isPattern(${i})`}),...t})}var Rh=hh(Kp),zh=Gp;function xee(e){let t=Mc(e.order),n=e.formatter??ds;return(r,i)=>Ih(e=>t(e,r),{expected:`a value greater than ${n(r)}`,arbitrary:{constraint:{ordered:{order:e.order,minimum:r,exclusiveMinimum:!0}}},...e.annotate?.(r),...i})}function See(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${ds(e)}`);return e}var Cee=xee({order:Ac,annotate:e=>({representation:{id:`effect/schema/isGreaterThan`,payload:{exclusiveMinimum:See(e)}},toJsonSchema:()=>({exclusiveMinimum:e}),toCode:()=>({runtime:`Schema.isGreaterThan(${ds(e)})`})})});function wee(e){return Ih(e=>globalThis.Number.isSafeInteger(e),{expected:`an integer`,representation:{id:`effect/schema/isInt`,payload:null},toJsonSchema:()=>({type:`integer`}),toCode:()=>({runtime:`Schema.isInt()`}),arbitrary:{constraint:{integer:!0}},...e})}function Bh(e,t){return e=Math.max(0,Math.floor(e)),Ih(t=>t.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:`effect/schema/isMinLength`,payload:{minLength:e}},toJsonSchema:({type:t})=>t===`array`?{minItems:e}:{minLength:e},toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[Nd]:!0,arbitrary:{constraint:{minLength:e}},...t})}globalThis.RegExp,globalThis.URL;function Tee(e,t,n){let r={...t};if(e?.minimum!==void 0){let t=n===void 0?e.minimum:n(e.minimum),i=e.exclusiveMinimum?new globalThis.Date(t.getTime()+1):t;(r.min===void 0||i.getTime()>r.min.getTime())&&(r.min=i)}if(e?.maximum!==void 0){let t=n===void 0?e.maximum:n(e.maximum),i=e.exclusiveMaximum?new globalThis.Date(t.getTime()-1):t;(r.max===void 0||i.getTime()<r.max.getTime())&&(r.max=i)}return r}var Eee=Sh.annotate({expected:`a string that will be decoded as a Date`}),Dee=$m(e=>e instanceof globalThis.Date&&!globalThis.Number.isNaN(e.getTime()),{representation:{id:`effect/schema/Date`,payload:null},toCode:()=>({runtime:`Schema.Date`,Type:`globalThis.Date`}),expected:`a valid Date`,toCodecJson:()=>vee()(Eee,zf),toArbitrary:()=>(e,t)=>e.date(Tee(t?.constraint?.ordered?.order===jc?t.constraint.ordered:void 0,{noInvalidDate:!0}))});globalThis.File,globalThis.FormData,globalThis.URLSearchParams;var Oee=Sh.check(yee()),Vh=Sh.annotate({expected:`a string that will be decoded as a trimmed string`}).pipe(Fh(Oee,Ff()));globalThis.Uint8Array;var Hh=hh(Qp(Am,{toCode:()=>({runtime:`Schema.MutableJson`,Type:`Schema.MutableJson`})})),Uh=Ua(),Z=Ga(),Wh=Sh.pipe(Fh(Sh,Ff())).check(Bh(1)),Gh={onExcessProperty:`error`},Kh=[Dh(Sh,yh)];function qh(e){return Ah(kh(e))}function Jh(e){let t=sh(e);return e=>Rc(t(e))}var Yh=Jh(Eh({id:Sh,firstName:Ph(Sh),lastName:Ph(Sh),primaryEmailAddress:Ph(Sh),createdAt:Rh}));function Xh(e){let t=(0,Z.c)(21),{output:n}=e,r,i,a,o,s;if(t[0]!==n){s=Symbol.for(`react.early_return_sentinel`);bb0:{if(r=Yh(n),!r){s=null;break bb0}a=Ka([r.firstName?.[0],r.lastName?.[0]]).join(``).toUpperCase(),i=Ka([r.firstName,r.lastName]).join(` `),o=new Date(r.createdAt).toLocaleDateString()}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s}else r=t[1],i=t[2],a=t[3],o=t[4],s=t[5];if(s!==Symbol.for(`react.early_return_sentinel`))return s;let c=o,l=a||`?`,u;t[6]===l?u=t[7]:(u=(0,X.jsx)(`div`,{className:`flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-violet-600 font-semibold text-lg text-white`,children:l}),t[6]=l,t[7]=u);let d=i||`Unknown User`,f;t[8]===d?f=t[9]:(f=(0,X.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:d}),t[8]=d,t[9]=f);let p;t[10]===r.primaryEmailAddress?p=t[11]:(p=r.primaryEmailAddress&&(0,X.jsx)(`div`,{className:`truncate text-muted-foreground text-sm`,children:r.primaryEmailAddress}),t[10]=r.primaryEmailAddress,t[11]=p);let m;t[12]===c?m=t[13]:(m=(0,X.jsxs)(`div`,{className:`mt-0.5 font-mono text-muted-foreground text-xs`,children:[`Created `,c]}),t[12]=c,t[13]=m);let h;t[14]!==f||t[15]!==p||t[16]!==m?(h=(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[f,p,m]}),t[14]=f,t[15]=p,t[16]=m,t[17]=h):h=t[17];let g;return t[18]!==u||t[19]!==h?(g=(0,X.jsxs)(`div`,{className:`flex items-center gap-4`,children:[u,h]}),t[18]=u,t[19]=h,t[20]=g):g=t[20],g}function Zh(e){let t=(0,Z.c)(5),{className:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(`circle`,{cx:`64`,cy:`64`,fill:`currentColor`,r:`20`}),i=(0,X.jsx)(`path`,{d:`M99.5716 10.788C101.571 12.1272 101.742 14.9444 100.04 16.646L85.4244 31.2618C84.1035 32.5828 82.0542 32.7914 80.3915 31.9397C75.4752 29.421 69.9035 28 64 28C44.1177 28 28 44.1177 28 64C28 69.9035 29.421 75.4752 31.9397 80.3915C32.7914 82.0542 32.5828 84.1035 31.2618 85.4244L16.646 100.04C14.9444 101.742 12.1272 101.571 10.788 99.5716C3.97411 89.3989 0 77.1635 0 64C0 28.6538 28.6538 0 64 0C77.1635 0 89.3989 3.97411 99.5716 10.788Z`,fill:`currentColor`,fillOpacity:`0.6`}),a=(0,X.jsx)(`path`,{d:`M100.04 111.354C101.742 113.056 101.571 115.873 99.5717 117.212C89.3989 124.026 77.1636 128 64 128C50.8364 128 38.6011 124.026 28.4283 117.212C26.4289 115.873 26.2581 113.056 27.9597 111.354L42.5755 96.7382C43.8965 95.4172 45.9457 95.2085 47.6084 96.0603C52.5248 98.579 58.0964 100 64 100C69.9036 100 75.4753 98.579 80.3916 96.0603C82.0543 95.2085 84.1036 95.4172 85.4245 96.7382L100.04 111.354Z`,fill:`currentColor`}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;return t[3]===n?o=t[4]:(o=(0,X.jsxs)(`svg`,{className:n,role:`img`,viewBox:`0 0 128 128`,xmlns:`http://www.w3.org/2000/svg`,children:[r,i,a]}),t[3]=n,t[4]=o),o}function Qh(e){let t=(0,Z.c)(4),{className:n}=e,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(`title`,{children:`Linear`}),i=(0,X.jsx)(`path`,{d:`M1.225 61.523c-.222-.949.908-1.546 1.597-.857l36.512 36.512c.69.69.092 1.82-.857 1.597-18.425-4.323-32.93-18.827-37.252-37.252ZM.002 46.889a.99.99 0 0 0 .29.76L52.35 99.71c.201.2.478.307.76.29 2.37-.149 4.695-.46 6.963-.927.765-.157 1.03-1.096.478-1.648L2.576 39.448c-.552-.551-1.491-.286-1.648.479a50.067 50.067 0 0 0-.926 6.962ZM4.21 29.705a.988.988 0 0 0 .208 1.1l64.776 64.776c.289.29.726.375 1.1.208a49.908 49.908 0 0 0 5.185-2.684.981.981 0 0 0 .183-1.54L8.436 24.336a.981.981 0 0 0-1.541.183 49.896 49.896 0 0 0-2.684 5.185Zm8.448-11.631a.986.986 0 0 1-.045-1.354C21.78 6.46 35.111 0 49.952 0 77.592 0 100 22.407 100 50.048c0 14.84-6.46 28.172-16.72 37.338a.986.986 0 0 1-1.354-.045L12.659 18.074Z`,fill:`#5E6AD2`}),t[0]=r,t[1]=i):(r=t[0],i=t[1]);let a;return t[2]===n?a=t[3]:(a=(0,X.jsxs)(`svg`,{"aria-label":`Linear`,className:n,fill:`none`,viewBox:`0 0 100 100`,xmlns:`http://www.w3.org/2000/svg`,children:[r,i]}),t[2]=n,t[3]=a),a}function $h(e){let t=(0,Z.c)(3),{className:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(`path`,{d:`M1000.46 450C1174.77 450 1278.43 553.669 1278.43 691.282C1278.43 828.896 1174.77 932.563 1000.46 932.563H912.382L1350 1350H1040.82L707.794 1033.48C683.944 1011.47 672.936 985.781 672.935 963.765C672.935 932.572 694.959 905.049 737.161 893.122L908.712 847.244C973.85 829.812 1018.81 779.353 1018.81 713.298C1018.8 632.567 952.745 585.78 871.095 585.78H450V450H1000.46Z`,fill:`currentColor`}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,X.jsx)(`svg`,{className:n,fill:`currentColor`,viewBox:`0 0 1800 1800`,xmlns:`http://www.w3.org/2000/svg`,children:r}),t[1]=n,t[2]=i),i}function eg(e){let t=(0,Z.c)(4),{className:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(`title`,{children:`Slack`}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsxs)(`g`,{clipRule:`evenodd`,fillRule:`evenodd`,children:[(0,X.jsx)(`path`,{d:`m897.4 0c-135.3.1-244.8 109.9-244.7 245.2-.1 135.3 109.5 245.1 244.8 245.2h244.8v-245.1c.1-135.3-109.5-245.1-244.9-245.3.1 0 .1 0 0 0m0 654h-652.6c-135.3.1-244.9 109.9-244.8 245.2-.2 135.3 109.4 245.1 244.7 245.3h652.7c135.3-.1 244.9-109.9 244.8-245.2.1-135.4-109.5-245.2-244.8-245.3z`,fill:`#36c5f0`}),(0,X.jsx)(`path`,{d:`m2447.6 899.2c.1-135.3-109.5-245.1-244.8-245.2-135.3.1-244.9 109.9-244.8 245.2v245.3h244.8c135.3-.1 244.9-109.9 244.8-245.3zm-652.7 0v-654c.1-135.2-109.4-245-244.7-245.2-135.3.1-244.9 109.9-244.8 245.2v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.3z`,fill:`#2eb67d`}),(0,X.jsx)(`path`,{d:`m1550.1 2452.5c135.3-.1 244.9-109.9 244.8-245.2.1-135.3-109.5-245.1-244.8-245.2h-244.8v245.2c-.1 135.2 109.5 245 244.8 245.2zm0-654.1h652.7c135.3-.1 244.9-109.9 244.8-245.2.2-135.3-109.4-245.1-244.7-245.3h-652.7c-135.3.1-244.9 109.9-244.8 245.2-.1 135.4 109.4 245.2 244.7 245.3z`,fill:`#ecb22e`}),(0,X.jsx)(`path`,{d:`m0 1553.2c-.1 135.3 109.5 245.1 244.8 245.2 135.3-.1 244.9-109.9 244.8-245.2v-245.2h-244.8c-135.3.1-244.9 109.9-244.8 245.2zm652.7 0v654c-.2 135.3 109.4 245.1 244.7 245.3 135.3-.1 244.9-109.9 244.8-245.2v-653.9c.2-135.3-109.4-245.1-244.7-245.3-135.4 0-244.9 109.8-244.8 245.1 0 0 0 .1 0 0`,fill:`#e01e5a`})]}),t[1]=i):i=t[1];let a;return t[2]===n?a=t[3]:(a=(0,X.jsxs)(`svg`,{"aria-label":`Slack`,className:n,viewBox:`0 0 2447.6 2452.5`,xmlns:`http://www.w3.org/2000/svg`,children:[r,i]}),t[2]=n,t[3]=a),a}function tg(e){let t=(0,Z.c)(8),{className:n}=e,r,i,a,o,s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(`title`,{children:`Twilio`}),i=(0,X.jsx)(`circle`,{cx:`12`,cy:`12`,fill:`currentColor`,r:`10`}),a=(0,X.jsx)(`circle`,{cx:`9`,cy:`9`,fill:`white`,r:`2`}),o=(0,X.jsx)(`circle`,{cx:`15`,cy:`9`,fill:`white`,r:`2`}),s=(0,X.jsx)(`circle`,{cx:`9`,cy:`15`,fill:`white`,r:`2`}),c=(0,X.jsx)(`circle`,{cx:`15`,cy:`15`,fill:`white`,r:`2`}),t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c):(r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5]);let l;return t[6]===n?l=t[7]:(l=(0,X.jsxs)(`svg`,{"aria-label":`Twilio`,className:n,fill:`none`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:[r,i,a,o,s,c]}),t[6]=n,t[7]=l),l}var ng={clerk:{icon:Zh,outputComponents:{"get-user":Xh,"create-user":Xh,"update-user":Xh}},linear:{icon:Qh},resend:{icon:$h},slack:{icon:eg},twilio:{icon:tg}};function rg(){return typeof window<`u`}function ig(e){return sg(e)?(e.nodeName||``).toLowerCase():`#document`}function ag(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function og(e){return((sg(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function sg(e){return rg()?e instanceof Node||e instanceof ag(e).Node:!1}function cg(e){return rg()?e instanceof Element||e instanceof ag(e).Element:!1}function lg(e){return rg()?e instanceof HTMLElement||e instanceof ag(e).HTMLElement:!1}function ug(e){return!rg()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ag(e).ShadowRoot}function dg(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Sg(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function fg(e){return/^(table|td|th)$/.test(ig(e))}function pg(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var mg=/transform|translate|scale|rotate|perspective|filter/,hg=/paint|layout|strict|content/,gg=e=>!!e&&e!==`none`,_g;function vg(e){let t=cg(e)?Sg(e):e;return gg(t.transform)||gg(t.translate)||gg(t.scale)||gg(t.rotate)||gg(t.perspective)||!bg()&&(gg(t.backdropFilter)||gg(t.filter))||mg.test(t.willChange||``)||hg.test(t.contain||``)}function yg(e){let t=wg(e);for(;lg(t)&&!xg(t);){if(vg(t))return t;if(pg(t))return null;t=wg(t)}return null}function bg(){return _g??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),_g}function xg(e){return/^(html|body|#document)$/.test(ig(e))}function Sg(e){return ag(e).getComputedStyle(e)}function Cg(e){return cg(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wg(e){if(ig(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ug(e)&&e.host||og(e);return ug(t)?t.host:t}function Tg(e){let t=wg(e);return xg(t)?(e.ownerDocument||e).body:lg(t)&&dg(t)?t:Tg(t)}function Eg(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Tg(e),i=r===e.ownerDocument?.body,a=ag(r);if(i){let e=Dg(a);return t.concat(a,a.visualViewport||[],dg(r)?r:[],e&&n?Eg(e):[])}return t.concat(r,Eg(r,[],n))}function Dg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Og={...Y},kg={};function Ag(e,t){let n=Y.useRef(kg);return n.current===kg&&(n.current=e(t)),n}var jg=Og.useInsertionEffect,Mg=jg&&jg!==Og.useLayoutEffect?jg:e=>e();function Ng(e){let t=Ag(Pg).current;return t.next=e,Mg(t.effect),t.trampoline}function Pg(){let e={next:void 0,callback:Fg,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Fg(){}var Q=typeof document<`u`?Y.useLayoutEffect:()=>{};function Ig(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var Lg={};function Rg(e,t,n,r,i){if(!n&&!r&&!i&&!e)return zg(t);let a=zg(e);return t&&(a=Bg(a,t)),n&&(a=Bg(a,n)),r&&(a=Bg(a,r)),i&&(a=Bg(a,i)),a}function kee(e){if(e.length===0)return Lg;if(e.length===1)return zg(e[0]);let t=zg(e[0]);for(let n=1;n<e.length;n+=1)t=Bg(t,e[n]);return t}function zg(e){return Hg(e)?{...Ug(e,Lg)}:Aee(e)}function Bg(e,t){return Hg(t)?Ug(t,e):jee(e,t)}function Aee(e){let t={...e};for(let e in t){let n=t[e];Vg(e,n)&&(t[e]=Wg(n))}return t}function jee(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Ig(e.style,r);break;case`className`:e[n]=Kg(e.className,r);break;default:e[n]=Vg(n,r)?Mee(e[n],r):r}}return e}function Vg(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Hg(e){return typeof e==`function`}function Ug(e,t){return Hg(e)?e(t):e??Lg}function Mee(e,t){return t?e?(...n)=>{let r=n[0];if(qg(r)){let i=r;Gg(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Wg(t):e}function Wg(e){return e&&((...t)=>{let n=t[0];return qg(n)&&Gg(n),e(...t)})}function Gg(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Kg(e,t){return t?e?t+` `+e:t:e}function qg(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Nee(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Jg=Nee(`https://base-ui.com/production-error`,`Base UI`),Yg=Y.createContext(void 0);function Xg(e=!1){let t=Y.useContext(Yg);if(t===void 0&&!e)throw Error(Jg(16));return t}function Pee(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:Y.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Zg(e){return e?.ownerDocument||document}function Qg(e,t,{detail:n=0}={}){e.dispatchEvent(new(ag(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function $g(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=Y.useRef(null),s=Xg(!0),c=a??s!==void 0,{props:l}=Pee({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=Y.useCallback(()=>{let e=o.current;e_(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Q(u,[u]),{getButtonProps:Y.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Rg({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Gg(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=e_(r),s=!i&&Fee(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Qg(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Qg(r,e)))},onKeyUp(e){if(!t){if(Gg(e),a?.(e),e.target===e.currentTarget&&i&&c&&e_(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Qg(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Ng(e=>{o.current=e,u()})}}function e_(e){return lg(e)&&e.tagName===`BUTTON`}function Fee(e){return lg(e)&&e.tagName===`A`&&!!e.href}function t_(e,t,n,r){let i=Ag(n_).current;return Lee(i,e,t,n,r)&&r_(i,[e,t,n,r]),i.callback}function Iee(e){let t=Ag(n_).current;return Ree(t,e)&&r_(t,e),t.callback}function n_(){return{callback:null,cleanup:null,refs:[]}}function Lee(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Ree(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function r_(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var zee=19;function i_(e){return zee>=e}function a_(e){if(!Y.isValidElement(e))return null;let t=e,n=t.props;return(i_(19)?n?.ref:t.ref)??null}function o_(){}var s_=Object.freeze([]),c_=Object.freeze({});function Bee(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Vee(e,t){return typeof e==`function`?e(t):e}function Hee(e,t){return typeof e==`function`?e(t):e}function l_(e,t,n={}){let r=t.render,i=Uee(t,n);return n.enabled===!1?null:u_(e,r,i,n.state??c_)}function Uee(e,t={}){let{className:n,style:r,render:i}=e,{state:a=c_,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Vee(n,a):void 0,d=l?Hee(r,a):void 0,f=l?Bee(a,c):c_,p=l&&s?Wee(s):void 0,m=l?Ig(f,p)??{}:c_;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Iee([m.ref,a_(i),...o]):t_(m.ref,a_(i),o):t_(null,null)),l?(u!==void 0&&(m.className=Kg(m.className,u)),d!==void 0&&(m.style=Ig(m.style,d)),m):c_}function Wee(e){return Array.isArray(e)?kee(e):Rg(void 0,e)}var Gee=Symbol.for(`react.lazy`);function u_(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Rg(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===Gee&&(i=Y.Children.toArray(t)[0]),Y.cloneElement(i,e)}if(e&&typeof e==`string`)return d_(e,n);throw Error(Jg(8))}function d_(e,t){return e===`button`?(0,Y.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,Y.createElement)(`img`,{alt:``,...t,key:t.key}):Y.createElement(e,t)}var f_=Y.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=$g({disabled:i,focusableWhenDisabled:a,native:o});return l_(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function p_(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=p_(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function m_(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=p_(e))&&(r&&(r+=` `),r+=t);return r}var h_=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,g_=m_,__=(e,t)=>n=>{if(t?.variants==null)return g_(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=h_(t)||h_(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return g_(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},v_=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},y_=(e,t)=>({classGroupId:e,validator:t}),b_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),x_=`-`,S_=[],C_=`arbitrary..`,w_=e=>{let t=D_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return E_(e);let n=e.split(x_);return T_(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?v_(i,t):t:i||S_}return n[e]||S_}}},T_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=T_(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(x_):e.slice(t).join(x_),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},E_=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?C_+r:void 0})(),D_=e=>{let{theme:t,classGroups:n}=e;return O_(n,t)},O_=(e,t)=>{let n=b_();for(let r in e){let i=e[r];k_(i,n,r,t)}return n},k_=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];A_(i,t,n,r)}},A_=(e,t,n,r)=>{if(typeof e==`string`){j_(e,t,n);return}if(typeof e==`function`){M_(e,t,n,r);return}N_(e,t,n,r)},j_=(e,t,n)=>{let r=e===``?t:P_(t,e);r.classGroupId=n},M_=(e,t,n,r)=>{if(F_(e)){k_(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(y_(n,e))},N_=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];k_(o,P_(t,a),n,r)}},P_=(e,t)=>{let n=e,r=t.split(x_),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=b_(),n.nextPart.set(t,i)),n=i}return n},F_=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,I_=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},L_=`!`,R_=`:`,z_=[],B_=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),V_=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===R_){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(L_)?(c=s.slice(0,-1),l=!0):s.startsWith(L_)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return B_(t,l,c,u)};if(t){let e=t+R_,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):B_(z_,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},H_=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},U_=e=>({cache:I_(e.cacheSize),parseClassName:V_(e),sortModifiers:H_(e),postfixLookupClassGroupIds:W_(e),...w_(e)}),W_=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},G_=/\s+/,K_=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(G_),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+L_:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},q_=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=J_(n))&&(i&&(i+=` `),i+=r);return i},J_=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=J_(e[r]))&&(n&&(n+=` `),n+=t);return n},Y_=(e,...t)=>{let n,r,i,a,o=o=>(n=U_(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=K_(e,n);return i(e,a),a};return a=o,(...e)=>a(q_(...e))},X_=[],Z_=e=>{let t=t=>t[e]||X_;return t.isThemeGetter=!0,t},Q_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ev=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,tv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nv=/\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$/,rv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,iv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,av=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ov=e=>ev.test(e),sv=e=>!!e&&!Number.isNaN(Number(e)),cv=e=>!!e&&Number.isInteger(Number(e)),lv=e=>e.endsWith(`%`)&&sv(e.slice(0,-1)),uv=e=>tv.test(e),dv=()=>!0,fv=e=>nv.test(e)&&!rv.test(e),pv=()=>!1,mv=e=>iv.test(e),hv=e=>av.test(e),gv=e=>!yv(e)&&!Dv(e),_v=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),vv=e=>Fv(e,zv,pv),yv=e=>Q_.test(e),bv=e=>Fv(e,Bv,fv),xv=e=>Fv(e,Vv,sv),Sv=e=>Fv(e,Uv,dv),Cv=e=>Fv(e,Hv,pv),wv=e=>Fv(e,Lv,pv),Tv=e=>Fv(e,Rv,hv),Ev=e=>Fv(e,Wv,mv),Dv=e=>$_.test(e),Ov=e=>Iv(e,Bv),kv=e=>Iv(e,Hv),Av=e=>Iv(e,Lv),jv=e=>Iv(e,zv),Mv=e=>Iv(e,Rv),Nv=e=>Iv(e,Wv,!0),Pv=e=>Iv(e,Uv,!0),Fv=(e,t,n)=>{let r=Q_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Iv=(e,t,n=!1)=>{let r=$_.exec(e);return r?r[1]?t(r[1]):n:!1},Lv=e=>e===`position`||e===`percentage`,Rv=e=>e===`image`||e===`url`,zv=e=>e===`length`||e===`size`||e===`bg-size`,Bv=e=>e===`length`,Vv=e=>e===`number`,Hv=e=>e===`family-name`,Uv=e=>e===`number`||e===`weight`,Wv=e=>e===`shadow`,Gv=Y_(()=>{let e=Z_(`color`),t=Z_(`font`),n=Z_(`text`),r=Z_(`font-weight`),i=Z_(`tracking`),a=Z_(`leading`),o=Z_(`breakpoint`),s=Z_(`container`),c=Z_(`spacing`),l=Z_(`radius`),u=Z_(`shadow`),d=Z_(`inset-shadow`),f=Z_(`text-shadow`),p=Z_(`drop-shadow`),m=Z_(`blur`),h=Z_(`perspective`),g=Z_(`aspect`),_=Z_(`ease`),v=Z_(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Dv,yv],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Dv,yv,c],T=()=>[ov,`full`,`auto`,...w()],E=()=>[cv,`none`,`subgrid`,Dv,yv],D=()=>[`auto`,{span:[`full`,cv,Dv,yv]},cv,Dv,yv],O=()=>[cv,`auto`,Dv,yv],k=()=>[`auto`,`min`,`max`,`fr`,Dv,yv],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[ov,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[ov,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[ov,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,Dv,yv],L=()=>[...b(),Av,wv,{position:[Dv,yv]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,jv,vv,{size:[Dv,yv]}],B=()=>[lv,Ov,bv],V=()=>[``,`none`,`full`,l,Dv,yv],H=()=>[``,sv,Ov,bv],U=()=>[`solid`,`dashed`,`dotted`,`double`],W=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],G=()=>[sv,lv,Av,wv],K=()=>[``,`none`,m,Dv,yv],q=()=>[`none`,sv,Dv,yv],J=()=>[`none`,sv,Dv,yv],ee=()=>[sv,Dv,yv],te=()=>[ov,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[uv],breakpoint:[uv],color:[dv],container:[uv],"drop-shadow":[uv],ease:[`in`,`out`,`in-out`],font:[gv],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[uv],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[uv],shadow:[uv],spacing:[`px`,sv],text:[uv],"text-shadow":[uv],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ov,yv,Dv,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Dv,yv]}],"container-named":[_v],columns:[{columns:[sv,yv,Dv,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[cv,`auto`,Dv,yv]}],basis:[{basis:[ov,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[sv,ov,`auto`,`initial`,`none`,yv]}],grow:[{grow:[``,sv,Dv,yv]}],shrink:[{shrink:[``,sv,Dv,yv]}],order:[{order:[cv,`first`,`last`,`none`,Dv,yv]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,Ov,bv]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Pv,Sv]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,lv,yv]}],"font-family":[{font:[kv,Cv,t]}],"font-features":[{"font-features":[yv]}],"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:[i,Dv,yv]}],"line-clamp":[{"line-clamp":[sv,`none`,Dv,xv]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Dv,yv]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Dv,yv]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...U(),`wavy`]}],"text-decoration-thickness":[{decoration:[sv,`from-font`,`auto`,Dv,bv]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[sv,`auto`,Dv,yv]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[cv,Dv,yv]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Dv,yv]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Dv,yv]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},cv,Dv,yv],radial:[``,Dv,yv],conic:[cv,Dv,yv]},Mv,Tv]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-bs":[{"border-bs":H()}],"border-w-be":[{"border-be":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":H()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...U(),`hidden`,`none`]}],"divide-style":[{divide:[...U(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...U(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[sv,Dv,yv]}],"outline-w":[{outline:[``,sv,Ov,bv]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,Nv,Ev]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Nv,Ev]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:H()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[sv,bv]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Nv,Ev]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[sv,Dv,yv]}],"mix-blend":[{"mix-blend":[...W(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":W()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[sv]}],"mask-image-linear-from-pos":[{"mask-linear-from":G()}],"mask-image-linear-to-pos":[{"mask-linear-to":G()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":G()}],"mask-image-t-to-pos":[{"mask-t-to":G()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":G()}],"mask-image-r-to-pos":[{"mask-r-to":G()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":G()}],"mask-image-b-to-pos":[{"mask-b-to":G()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":G()}],"mask-image-l-to-pos":[{"mask-l-to":G()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":G()}],"mask-image-x-to-pos":[{"mask-x-to":G()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":G()}],"mask-image-y-to-pos":[{"mask-y-to":G()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Dv,yv]}],"mask-image-radial-from-pos":[{"mask-radial-from":G()}],"mask-image-radial-to-pos":[{"mask-radial-to":G()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[sv]}],"mask-image-conic-from-pos":[{"mask-conic-from":G()}],"mask-image-conic-to-pos":[{"mask-conic-to":G()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Dv,yv]}],filter:[{filter:[``,`none`,Dv,yv]}],blur:[{blur:K()}],brightness:[{brightness:[sv,Dv,yv]}],contrast:[{contrast:[sv,Dv,yv]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Nv,Ev]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,sv,Dv,yv]}],"hue-rotate":[{"hue-rotate":[sv,Dv,yv]}],invert:[{invert:[``,sv,Dv,yv]}],saturate:[{saturate:[sv,Dv,yv]}],sepia:[{sepia:[``,sv,Dv,yv]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Dv,yv]}],"backdrop-blur":[{"backdrop-blur":K()}],"backdrop-brightness":[{"backdrop-brightness":[sv,Dv,yv]}],"backdrop-contrast":[{"backdrop-contrast":[sv,Dv,yv]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,sv,Dv,yv]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[sv,Dv,yv]}],"backdrop-invert":[{"backdrop-invert":[``,sv,Dv,yv]}],"backdrop-opacity":[{"backdrop-opacity":[sv,Dv,yv]}],"backdrop-saturate":[{"backdrop-saturate":[sv,Dv,yv]}],"backdrop-sepia":[{"backdrop-sepia":[``,sv,Dv,yv]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Dv,yv]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[sv,`initial`,Dv,yv]}],ease:[{ease:[`linear`,`initial`,_,Dv,yv]}],delay:[{delay:[sv,Dv,yv]}],animate:[{animate:[`none`,v,Dv,yv]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Dv,yv]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:q()}],"rotate-x":[{"rotate-x":q()}],"rotate-y":[{"rotate-y":q()}],"rotate-z":[{"rotate-z":q()}],scale:[{scale:J()}],"scale-x":[{"scale-x":J()}],"scale-y":[{"scale-y":J()}],"scale-z":[{"scale-z":J()}],"scale-3d":[`scale-3d`],skew:[{skew:ee()}],"skew-x":[{"skew-x":ee()}],"skew-y":[{"skew-y":ee()}],transform:[{transform:[Dv,yv,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:te()}],"translate-x":[{"translate-x":te()}],"translate-y":[{"translate-y":te()}],"translate-z":[{"translate-z":te()}],"translate-none":[`translate-none`],zoom:[{zoom:[cv,Dv,yv]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Dv,yv]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Dv,yv]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[sv,Ov,bv,xv]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Kv(...e){return Gv(m_(e))}Jh(Sh),Jh(Rh);var qv=__(`inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_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 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Jv(e){let t=(0,Z.c)(14),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:n,variant:o,size:a,render:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]!==n||t[7]!==a||t[8]!==o?(s=Kv(qv({variant:o,size:a,className:n})),t[6]=n,t[7]=a,t[8]=o,t[9]=s):s=t[9];let c;return t[10]!==r||t[11]!==i||t[12]!==s?(c=(0,X.jsx)(f_,{className:s,"data-slot":`button`,render:i,...r}),t[10]=r,t[11]=i,t[12]=s,t[13]=c):c=t[13],c}var Yv=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Xv=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Zv=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Qv=e=>{let t=Zv(e);return t.charAt(0).toUpperCase()+t.slice(1)},$v={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`},ey=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ty=(0,Y.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,Y.createElement)(`svg`,{ref:c,...$v,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Yv(`lucide`,i),...!a&&!ey(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,Y.createElement)(e,t)),...Array.isArray(a)?a:[a]])),ny=(e,t)=>{let n=(0,Y.forwardRef)(({className:n,...r},i)=>(0,Y.createElement)(ty,{ref:i,iconNode:t,className:Yv(`lucide-${Xv(Qv(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Qv(e),n},Kee=ny(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),ry=ny(`ban`,[[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),iy=ny(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ay=ny(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),oy=ny(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),sy=ny(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),qee=ny(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Jee=ny(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),cy=ny(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Yee=ny(`circle-x`,[[`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`}]]),ly=ny(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),uy=ny(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Xee=ny(`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`}]]),dy=ny(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),fy=ny(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),py=ny(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),my=ny(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Zee=ny(`git-branch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),Qee=ny(`grid-3x3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),$ee=ny(`hourglass`,[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]),ete=ny(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),hy=ny(`key`,[[`path`,{d:`m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4`,key:`g0fldk`}],[`path`,{d:`m21 2-9.6 9.6`,key:`1j0ho8`}],[`circle`,{cx:`7.5`,cy:`15.5`,r:`5.5`,key:`yqb3hr`}]]),tte=ny(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),nte=ny(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),gy=ny(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),rte=ny(`map-pin-x-inside`,[[`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`}],[`path`,{d:`m14.5 7.5-5 5`,key:`3lb6iw`}],[`path`,{d:`m9.5 7.5 5 5`,key:`ko136h`}]]),ite=ny(`map-pin`,[[`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`}]]),ate=ny(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ote=ny(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),ste=ny(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),_y=ny(`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`}]]),vy=ny(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),cte=ny(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),yy=ny(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),lte=ny(`redo-2`,[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]),ute=ny(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),dte=ny(`refresh-cw`,[[`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`}]]),fte=ny(`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`}]]),by=ny(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),xy=ny(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Sy=ny(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),pte=ny(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),mte=ny(`split`,[[`path`,{d:`M16 3h5v5`,key:`1806ms`}],[`path`,{d:`M8 3H3v5`,key:`15dfkv`}],[`path`,{d:`M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3`,key:`1qrqzj`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}]]),hte=ny(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Cy=ny(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),wy=ny(`triangle-alert`,[[`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`}]]),gte=ny(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),_te=ny(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Ty=ny(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ey=ny(`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`}]]),vte=ny(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),yte=ny(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]);function Dy(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`size-4 animate-spin`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(gy,{"aria-label":`Loading`,className:i,role:`status`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function bte(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(`div`,{className:`flex h-dvh items-center justify-center`,children:(0,X.jsx)(Dy,{className:`size-6 text-muted-foreground`})}),e[0]=t):t=e[0],t}var xte={unreachable:`The server did not answer. It may be down, or something between the browser and it is dropping the request.`,refused:`The server answered with an error. Check that Workflow Graph is mounted where this page expects it.`,mismatch:`The server answered with a document this editor cannot read. The two are most likely different builds of Workflow Graph.`};function Ste(e){let t=(0,Z.c)(9),{endpoint:n,reason:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(`h1`,{className:`font-medium text-base`,children:`The editor cannot start`}),t[0]=i):i=t[0];let a=xte[r],o;t[1]===a?o=t[2]:(o=(0,X.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:a}),t[1]=a,t[2]=o);let s;t[3]===n?s=t[4]:(s=(0,X.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[`It asks `,(0,X.jsxs)(`code`,{className:`font-mono text-xs`,children:[`GET `,n]}),` for the Events, actions and integrations this server carries.`]}),t[3]=n,t[4]=s);let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(Jv,{onClick:Cte,size:`sm`,type:`button`,variant:`outline`,children:`Try again`}),t[5]=c):c=t[5];let l;return t[6]!==o||t[7]!==s?(l=(0,X.jsx)(`div`,{className:`flex h-dvh items-center justify-center p-6`,children:(0,X.jsxs)(`div`,{className:`max-w-md space-y-3 rounded-lg border p-6`,children:[i,o,s,c]})}),t[6]=o,t[7]=s,t[8]=l):l=t[8],l}function Cte(){return window.location.reload()}var Oy=(0,Y.createContext)(null);function wte(e){let t=(0,Z.c)(3),{children:n,value:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,X.jsx)(Oy.Provider,{value:r,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function ky(){let e=(0,Y.useContext)(Oy);if(!e)throw Error(`useExtensionCatalog must be used within an ExtensionCatalogProvider`);return e}var Ay=(0,Y.createContext)(null);function Tte(e){let t=(0,Z.c)(3),{children:n,value:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,X.jsx)(Ay.Provider,{value:r,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function jy(){let e=(0,Y.useContext)(Ay);if(!e)throw Error(`useIntegrationUi must be used within an IntegrationUiProvider`);return e}var Ete=/\/$/;function My(){if(typeof document>`u`)return``;let e=document.querySelector(`base`)?.getAttribute(`href`);return e?e.replace(Ete,``):``}function Dte(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Ote=e=>{switch(e){case`success`:return jte;case`info`:return Nte;case`warning`:return Mte;case`error`:return Pte;default:return null}},kte=Array(12).fill(0),Ate=({visible:e,className:t})=>Y.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},Y.createElement(`div`,{className:`sonner-spinner`},kte.map((e,t)=>Y.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),jte=Y.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},Y.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`})),Mte=Y.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},Y.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`})),Nte=Y.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},Y.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`})),Pte=Y.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},Y.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`})),Fte=Y.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`,"aria-hidden":`true`},Y.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),Y.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Ite=()=>{let[e,t]=Y.useState(document.hidden);return Y.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},Lte=1,Rte=100,Ny=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:Lte++,Py=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Rte;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=Ny(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),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)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],Y.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Bte(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!Y.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!Y.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!Y.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!Y.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=Ny(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},zte=(e,t)=>Py.message(e,t),Bte=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Fy=Object.assign(zte,{success:Py.success,info:Py.info,warning:Py.warning,error:Py.error,custom:Py.custom,message:Py.message,promise:Py.promise,dismiss:Py.dismiss,loading:Py.loading},{getHistory:()=>Py.toasts,getToasts:()=>Py.getActiveToasts()});Dte(`[data-sonner-toaster][dir=ltr],html[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%)}[data-sonner-toaster][dir=rtl],html[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%)}[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:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[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);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[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 rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [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)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[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;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left: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(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);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-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[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}[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}[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,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;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{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{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{from{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-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--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-sonner-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-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-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, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-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-sonner-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]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[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]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[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]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[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]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[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:first-child{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)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{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%)}`);function Iy(e){return e.label!==void 0}var Vte=3,Hte=`24px`,Ute=`16px`,Ly=4e3,Wte=356,Gte=14,Kte=45,qte=200;function Ry(...e){return e.filter(Boolean).join(` `)}function Jte(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Yte=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=Y.useState(null),[O,k]=Y.useState(null),[A,j]=Y.useState(!1),[M,N]=Y.useState(!1),[P,F]=Y.useState(!1),[I,L]=Y.useState(!1),[R,z]=Y.useState(!1),[B,V]=Y.useState(0),[H,U]=Y.useState(0),W=Y.useRef(n.duration||y||Ly),G=Y.useRef(null),K=Y.useRef(null),q=c===0,J=c+1<=o,ee=n.type,te=ee??`default`,ne=n.dismissible!==!1,re=n.className||``,ie=n.descriptionClassName||``,ae=Y.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),oe=Y.useMemo(()=>n.closeButton??p,[n.closeButton,p]),se=Y.useMemo(()=>n.duration||y||Ly,[n.duration,y]),ce=Y.useRef(0),le=Y.useRef(0),ue=Y.useRef(0),de=Y.useRef(null),[fe,pe]=b.split(`-`),me=Y.useMemo(()=>s.reduce((e,t,n)=>n>=ae?e:e+t.height,0),[s,ae]),he=Ite(),ge=Y.useMemo(()=>e.swipeDirections??Jte(b),[e.swipeDirections,b]),_e=n.invert||t,ve=ee===`loading`;le.current=Y.useMemo(()=>ae*x+me,[ae,me]),Y.useEffect(()=>{W.current=se},[se]),Y.useEffect(()=>{j(!0)},[]),Y.useEffect(()=>{let e=K.current;if(e){let t=e.getBoundingClientRect().height;return U(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),Y.useLayoutEffect(()=>{if(!A)return;let e=K.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,U(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let ye=Y.useCallback(()=>{N(!0),V(le.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},qte)},[n,d,a,le]);Y.useEffect(()=>{if(n.promise&&ee===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||he?(()=>{if(ue.current<ce.current){let e=new Date().getTime()-ce.current;W.current-=e}ue.current=new Date().getTime()})():W.current!==1/0&&(ce.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),ye()},W.current)),()=>clearTimeout(e)},[u,i,n,ee,he,ye]),Y.useEffect(()=>{n.delete&&(ye(),n.onDismiss==null||n.onDismiss.call(n,n))},[ye,n.delete]);function be(){return w?.loading?Y.createElement(`div`,{className:Ry(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ee===`loading`},w.loading):Y.createElement(Ate,{className:Ry(C?.loader,n?.classNames?.loader),visible:ee===`loading`})}let xe=n.icon||w?.[ee]||Ote(ee);return Y.createElement(`li`,{tabIndex:0,ref:K,className:Ry(_,re,C?.toast,n?.classNames?.toast,C?.[te],n?.classNames?.[te]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":R,"data-removed":M,"data-visible":J,"data-y-position":fe,"data-x-position":pe,"data-index":c,"data-front":q,"data-swiping":P,"data-dismissible":ne,"data-type":ee,"data-invert":_e,"data-swipe-out":I,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?B:le.current}px`,"--initial-height":S?`auto`:`${H}px`,...m,...n.style},onDragEnd:()=>{F(!1),D(null),de.current=null},onPointerDown:e=>{e.button!==2&&(ve||!ne||(G.current=new Date,V(le.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(F(!0),de.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(I||!ne)return;de.current=null;let e=Number(K.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(K.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-G.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?ge.includes(e>0?`right`:`left`):ge.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=Kte||a>.11)){V(le.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),ye(),L(!0);return}var o,s;(o=K.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=K.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),z(!1),F(!1),D(null)},onPointerMove:e=>{var t,n;if(!de.current||!ne||window.getSelection()?.toString().length>0)return;let r=e.clientY-de.current.y,i=e.clientX-de.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(ge.includes(`top`)||ge.includes(`bottom`)){if(ge.includes(`top`)&&r<0||ge.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(ge.includes(`left`)||ge.includes(`right`))){if(ge.includes(`left`)&&i<0||ge.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&z(!0),(t=K.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=K.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},oe&&!n.jsx&&ee!==`loading`?Y.createElement(`button`,{"aria-label":T,"data-disabled":ve,"data-close-button":!0,onClick:ve||!ne?()=>{}:()=>{ye(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Ry(C?.closeButton,n?.classNames?.closeButton)},w?.close??Fte):null,(ee||n.icon||n.promise)&&n.icon!==null&&(w?.[ee]!==null||n.icon)?Y.createElement(`div`,{"data-icon":``,className:Ry(C?.icon,n?.classNames?.icon)},ee===`loading`?n.icon||be():n.promise?be():null,ee===`loading`?null:xe):null,Y.createElement(`div`,{"data-content":``,className:Ry(C?.content,n?.classNames?.content)},Y.createElement(`div`,{"data-title":``,className:Ry(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?Y.createElement(`div`,{"data-description":``,className:Ry(v,ie,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),Y.isValidElement(n.cancel)?n.cancel:n.cancel&&Iy(n.cancel)?Y.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Iy(n.cancel)&&ne&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),ye())},className:Ry(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,Y.isValidElement(n.action)?n.action:n.action&&Iy(n.action)?Y.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Iy(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&ye())},className:Ry(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function zy(){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 Xte(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Ute:Hte;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Zte=Y.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Vte,toastOptions:g,dir:_=zy(),gap:v=Gte,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=Y.useState([]),w=Y.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=Y.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=Y.useState([]),[O,k]=Y.useState(!1),[A,j]=Y.useState(!1),[M,N]=Y.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),P=Y.useRef(null),F=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),I=Y.useRef(null),L=Y.useRef(!1),R=Y.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||Py.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return Y.useEffect(()=>Py.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{Xi.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),Y.useEffect(()=>{if(d!==`system`){N(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?N(`dark`):N(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{N(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{N(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),Y.useEffect(()=>{S.length<=1&&k(!1)},[S]),Y.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),Y.useEffect(()=>{if(P.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,L.current=!1)}},[P.current]),Y.createElement(`section`,{ref:t,"aria-label":b??`${x} ${F}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?Y.createElement(`ol`,{key:t,dir:_===`auto`?zy():_,tabIndex:-1,ref:P,className:c,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${Wte}px`,"--gap":`${v}px`,...m,...Xte(l,u)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,I.current&&=(I.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||L.current||(L.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>Y.createElement(Yte,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:R,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),Qte=`wfgraph`;function By(){}function $te(e){let t=`[${[Qte,...e].join(`.`)}]`;return{debug:By,info:By,warn:(e,n)=>console.warn(t,e,n),error:(e,n)=>console.error(t,e,n)}}function Vy(...e){return $te(e)}function ene(e,t){return t?.errorShownByCaller?null:t?.errorMessage??(e instanceof Error?e.message:`Request failed`)}var tne=Vy(`query`),Hy=new ke({queryCache:new Oe({onError:(e,t)=>{let n=t.meta?.errorMessage;n?Fy.error(n):tne.error(`Background query failed`,{queryHash:t.queryHash,error:e})}}),mutationCache:new Te({onError:(e,t,n,r)=>{let i=ene(e,r.meta);i!==null&&Fy.error(i)}}),defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1,staleTime:3e4}}}),nne={events:[],actions:[],integrations:[]};function Uy(e,t){return e.events.find(e=>e.name===t)}function Wy(e,t){return e.actions.find(e=>e.id===t)}function Gy(e,t){return e.integrations.find(e=>e.type===t)}function rne(e){let t={};for(let n of e.actions){let e=t[n.category];e?e.push(n):t[n.category]=[n]}return t}var ine=Eh({value:Sh,label:Sh}),Ky=Eh({field:Sh,equals:Sh}),qy=Eh({key:Sh,label:Sh,type:Nh([`template-input`,`template-textarea`,`text`,`number`,`select`,`key-value`]),placeholder:gh(Sh),defaultValue:gh(Sh),example:gh(Sh),options:gh(Ah(kh(ine))),rows:gh(Rh),min:gh(Rh),required:gh(wh),literal:gh(vh(!0)),showWhen:gh(Ky)}),ane=Mh([Eh({label:Sh,type:vh(`group`),fields:Ah(kh(qy)),defaultExpanded:gh(wh)}),qy]),Jy=Eh({path:Sh,description:gh(Sh),type:gh(Nh([`string`,`number`,`boolean`,`timestamp`,`duration`,`array`,`object`])),nullable:gh(wh),enumValues:gh(Ah(kh(Sh))),showWhen:gh(Ky)}),Yy=Eh({name:Wh,label:Wh,description:gh(Sh),correlationPath:gh(Sh),payloadFields:kh(Jy)}),Xy=Eh({id:Wh,label:Wh,description:Sh,category:Sh,integration:gh(Sh),logoUrl:gh(Sh),configFields:kh(ane),outputFields:kh(Jy)}),Zy=Eh({type:Wh,label:Wh,description:Sh,credentialFields:Dh(Sh,Eh({label:Sh,type:Nh([`text`,`password`,`url`]),placeholder:gh(Sh),helpText:gh(Sh),helpLink:gh(Eh({text:Sh,url:Sh}))})),hasTest:wh}),Qy=Jh(Eh({events:kh(Yy),actions:kh(Xy),integrations:kh(Zy)})),$y=Jh(Eh({catalog:gh(yh)})),eb=Vy(`extensions`),tb=nne;function nb(){return tb}async function rb(){let e;try{let t=await fetch(`${My()}/api/extensions`,{method:`GET`,headers:{accept:`application/json`}});if(!t.ok)return{ok:!1,reason:`refused`};e=await t.json()}catch{return{ok:!1,reason:`unreachable`}}let t=Qy($y(e)?.catalog);return t?(tb=t,{ok:!0}):(eb.warn(`The extension catalog from /api/extensions did not fit the wire schema in @wfgraph/shared/extensions/catalog-wire, so the editor is drawing from the catalog it had. The server serving it is most likely a different build of Workflow Graph.`),{ok:!1,reason:`mismatch`})}function ib(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=ib(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var ab={value:()=>{}};function ob(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new sb(n)}function sb(e){this._=e}function cb(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}sb.prototype=ob.prototype={constructor:sb,on:function(e,t){var n=this._,r=cb(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=lb(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=ub(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ub(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new sb(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function lb(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ub(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=ab,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var db={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function fb(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),db.hasOwnProperty(t)?{space:db[t],local:e}:e}function pb(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function mb(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function hb(e){var t=fb(e);return(t.local?mb:pb)(t)}function gb(){}function _b(e){return e==null?gb:function(){return this.querySelector(e)}}function vb(e){typeof e!=`function`&&(e=_b(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new oS(r,this._parents)}function yb(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function bb(){return[]}function xb(e){return e==null?bb:function(){return this.querySelectorAll(e)}}function Sb(e){return function(){return yb(e.apply(this,arguments))}}function Cb(e){e=typeof e==`function`?Sb(e):xb(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new oS(r,i)}function wb(e){return function(){return this.matches(e)}}function Tb(e){return function(t){return t.matches(e)}}var Eb=Array.prototype.find;function Db(e){return function(){return Eb.call(this.children,e)}}function Ob(){return this.firstElementChild}function kb(e){return this.select(e==null?Ob:Db(typeof e==`function`?e:Tb(e)))}var Ab=Array.prototype.filter;function jb(){return Array.from(this.children)}function Mb(e){return function(){return Ab.call(this.children,e)}}function Nb(e){return this.selectAll(e==null?jb:Mb(typeof e==`function`?e:Tb(e)))}function Pb(e){typeof e!=`function`&&(e=wb(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new oS(r,this._parents)}function Fb(e){return Array(e.length)}function Ib(){return new oS(this._enter||this._groups.map(Fb),this._parents)}function Lb(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Lb.prototype={constructor:Lb,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Rb(e){return function(){return e}}function zb(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new Lb(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Bb(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new Lb(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function Vb(e){return e.__data__}function Hb(e,t){if(!arguments.length)return Array.from(this,Vb);var n=t?Bb:zb,r=this._parents,i=this._groups;typeof e!=`function`&&(e=Rb(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Ub(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new oS(o,r),o._enter=s,o._exit=c,o}function Ub(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Wb(){return new oS(this._exit||this._groups.map(Fb),this._parents)}function Gb(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Kb(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new oS(s,this._parents)}function qb(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Jb(e){e||=Yb;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new oS(i,this._parents).order()}function Yb(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Xb(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Zb(){return Array.from(this)}function Qb(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function $b(){let e=0;for(let t of this)++e;return e}function ex(){return!this.node()}function tx(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function nx(e){return function(){this.removeAttribute(e)}}function rx(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ix(e,t){return function(){this.setAttribute(e,t)}}function ax(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ox(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function sx(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function cx(e,t){var n=fb(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?rx:nx:typeof t==`function`?n.local?sx:ox:n.local?ax:ix)(n,t))}function lx(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ux(e){return function(){this.style.removeProperty(e)}}function dx(e,t,n){return function(){this.style.setProperty(e,t,n)}}function fx(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function px(e,t,n){return arguments.length>1?this.each((t==null?ux:typeof t==`function`?fx:dx)(e,t,n??``)):mx(this.node(),e)}function mx(e,t){return e.style.getPropertyValue(t)||lx(e).getComputedStyle(e,null).getPropertyValue(t)}function hx(e){return function(){delete this[e]}}function gx(e,t){return function(){this[e]=t}}function _x(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function vx(e,t){return arguments.length>1?this.each((t==null?hx:typeof t==`function`?_x:gx)(e,t)):this.node()[e]}function yx(e){return e.trim().split(/^|\s+/)}function bx(e){return e.classList||new xx(e)}function xx(e){this._node=e,this._names=yx(e.getAttribute(`class`)||``)}xx.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Sx(e,t){for(var n=bx(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Cx(e,t){for(var n=bx(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function wx(e){return function(){Sx(this,e)}}function Tx(e){return function(){Cx(this,e)}}function Ex(e,t){return function(){(t.apply(this,arguments)?Sx:Cx)(this,e)}}function Dx(e,t){var n=yx(e+``);if(arguments.length<2){for(var r=bx(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Ex:t?wx:Tx)(n,t))}function Ox(){this.textContent=``}function kx(e){return function(){this.textContent=e}}function Ax(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function jx(e){return arguments.length?this.each(e==null?Ox:(typeof e==`function`?Ax:kx)(e)):this.node().textContent}function Mx(){this.innerHTML=``}function Nx(e){return function(){this.innerHTML=e}}function Px(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function Fx(e){return arguments.length?this.each(e==null?Mx:(typeof e==`function`?Px:Nx)(e)):this.node().innerHTML}function Ix(){this.nextSibling&&this.parentNode.appendChild(this)}function Lx(){return this.each(Ix)}function Rx(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function zx(){return this.each(Rx)}function Bx(e){var t=typeof e==`function`?e:hb(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Vx(){return null}function Hx(e,t){var n=typeof e==`function`?e:hb(e),r=t==null?Vx:typeof t==`function`?t:_b(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ux(){var e=this.parentNode;e&&e.removeChild(this)}function Wx(){return this.each(Ux)}function Gx(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Kx(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qx(e){return this.select(e?Kx:Gx)}function Jx(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function Yx(e){return function(t){e.call(this,t,this.__data__)}}function Xx(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Zx(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Qx(e,t,n){return function(){var r=this.__on,i,a=Yx(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function $x(e,t,n){var r=Xx(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?Qx:Zx,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function eS(e,t,n){var r=lx(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function tS(e,t){return function(){return eS(this,e,t)}}function nS(e,t){return function(){return eS(this,e,t.apply(this,arguments))}}function rS(e,t){return this.each((typeof t==`function`?nS:tS)(e,t))}function*iS(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var aS=[null];function oS(e,t){this._groups=e,this._parents=t}function sS(){return new oS([[document.documentElement]],aS)}function cS(){return this}oS.prototype=sS.prototype={constructor:oS,select:vb,selectAll:Cb,selectChild:kb,selectChildren:Nb,filter:Pb,data:Hb,enter:Ib,exit:Wb,join:Gb,merge:Kb,selection:cS,order:qb,sort:Jb,call:Xb,nodes:Zb,node:Qb,size:$b,empty:ex,each:tx,attr:cx,style:px,property:vx,classed:Dx,text:jx,html:Fx,raise:Lx,lower:zx,append:Bx,insert:Hx,remove:Wx,clone:qx,datum:Jx,on:$x,dispatch:rS,[Symbol.iterator]:iS};function lS(e){return typeof e==`string`?new oS([[document.querySelector(e)]],[document.documentElement]):new oS([[e]],aS)}function uS(e){let t;for(;t=e.sourceEvent;)e=t;return e}function dS(e,t){if(e=uS(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var fS={passive:!1},pS={capture:!0,passive:!1};function mS(e){e.stopImmediatePropagation()}function hS(e){e.preventDefault(),e.stopImmediatePropagation()}function gS(e){var t=e.document.documentElement,n=lS(e).on(`dragstart.drag`,hS,pS);`onselectstart`in t?n.on(`selectstart.drag`,hS,pS):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function _S(e,t){var n=e.document.documentElement,r=lS(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,hS,pS),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var vS=e=>()=>e;function yS(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}yS.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function bS(e){return!e.ctrlKey&&!e.button}function xS(){return this.parentNode}function SS(e,t){return t??{x:e.x,y:e.y}}function CS(){return navigator.maxTouchPoints||`ontouchstart`in this}function wS(){var e=bS,t=xS,n=SS,r=CS,i={},a=ob(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,fS).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!(u||!e.call(this,n,r))){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(lS(n.view).on(`mousemove.drag`,m,pS).on(`mouseup.drag`,h,pS),gS(n.view),mS(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(hS(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){lS(e.view).on(`mousemove.drag mouseup.drag`,null),_S(e.view,l),hS(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r)){var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s,c;for(s=0;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(mS(n),c(`start`,n,i[s]))}}function _(e){var t=e.changedTouches,n=t.length,r,a;for(r=0;r<n;++r)(a=i[t[r].identifier])&&(hS(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(mS(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=dS(l||r,t),p,m,h;if((h=n.call(e,new yS(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=dS(l||a,t),_=o}u.call(r,e,new yS(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:vS(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:vS(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:vS(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:vS(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function TS(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ES(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function DS(){}var OS=.7,kS=1/OS,AS=`\\s*([+-]?\\d+)\\s*`,jS=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,MS=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,NS=/^#([0-9a-f]{3,8})$/,PS=RegExp(`^rgb\\(${AS},${AS},${AS}\\)$`),FS=RegExp(`^rgb\\(${MS},${MS},${MS}\\)$`),IS=RegExp(`^rgba\\(${AS},${AS},${AS},${jS}\\)$`),LS=RegExp(`^rgba\\(${MS},${MS},${MS},${jS}\\)$`),RS=RegExp(`^hsl\\(${jS},${MS},${MS}\\)$`),zS=RegExp(`^hsla\\(${jS},${MS},${MS},${jS}\\)$`),BS={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};TS(DS,GS,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:VS,formatHex:VS,formatHex8:HS,formatHsl:US,formatRgb:WS,toString:WS});function VS(){return this.rgb().formatHex()}function HS(){return this.rgb().formatHex8()}function US(){return iC(this).formatHsl()}function WS(){return this.rgb().formatRgb()}function GS(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=NS.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?KS(t):n===3?new XS(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?qS(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?qS(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=PS.exec(e))?new XS(t[1],t[2],t[3],1):(t=FS.exec(e))?new XS(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=IS.exec(e))?qS(t[1],t[2],t[3],t[4]):(t=LS.exec(e))?qS(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=RS.exec(e))?rC(t[1],t[2]/100,t[3]/100,1):(t=zS.exec(e))?rC(t[1],t[2]/100,t[3]/100,t[4]):BS.hasOwnProperty(e)?KS(BS[e]):e===`transparent`?new XS(NaN,NaN,NaN,0):null}function KS(e){return new XS(e>>16&255,e>>8&255,e&255,1)}function qS(e,t,n,r){return r<=0&&(e=t=n=NaN),new XS(e,t,n,r)}function JS(e){return e instanceof DS||(e=GS(e)),e?(e=e.rgb(),new XS(e.r,e.g,e.b,e.opacity)):new XS}function YS(e,t,n,r){return arguments.length===1?JS(e):new XS(e,t,n,r??1)}function XS(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}TS(XS,YS,ES(DS,{brighter(e){return e=e==null?kS:kS**+e,new XS(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?OS:OS**+e,new XS(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new XS(tC(this.r),tC(this.g),tC(this.b),eC(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ZS,formatHex:ZS,formatHex8:QS,formatRgb:$S,toString:$S}));function ZS(){return`#${nC(this.r)}${nC(this.g)}${nC(this.b)}`}function QS(){return`#${nC(this.r)}${nC(this.g)}${nC(this.b)}${nC((isNaN(this.opacity)?1:this.opacity)*255)}`}function $S(){let e=eC(this.opacity);return`${e===1?`rgb(`:`rgba(`}${tC(this.r)}, ${tC(this.g)}, ${tC(this.b)}${e===1?`)`:`, ${e})`}`}function eC(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function tC(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function nC(e){return e=tC(e),(e<16?`0`:``)+e.toString(16)}function rC(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new oC(e,t,n,r)}function iC(e){if(e instanceof oC)return new oC(e.h,e.s,e.l,e.opacity);if(e instanceof DS||(e=GS(e)),!e)return new oC;if(e instanceof oC)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new oC(o,s,c,e.opacity)}function aC(e,t,n,r){return arguments.length===1?iC(e):new oC(e,t,n,r??1)}function oC(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}TS(oC,aC,ES(DS,{brighter(e){return e=e==null?kS:kS**+e,new oC(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?OS:OS**+e,new oC(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new XS(lC(e>=240?e-240:e+120,i,r),lC(e,i,r),lC(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new oC(sC(this.h),cC(this.s),cC(this.l),eC(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=eC(this.opacity);return`${e===1?`hsl(`:`hsla(`}${sC(this.h)}, ${cC(this.s)*100}%, ${cC(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function sC(e){return e=(e||0)%360,e<0?e+360:e}function cC(e){return Math.max(0,Math.min(1,e||0))}function lC(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var uC=e=>()=>e;function dC(e,t){return function(n){return e+n*t}}function fC(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function pC(e){return(e=+e)==1?mC:function(t,n){return n-t?fC(t,n,e):uC(isNaN(t)?n:t)}}function mC(e,t){var n=t-e;return n?dC(e,n):uC(isNaN(e)?t:e)}var hC=(function e(t){var n=pC(t);function r(e,t){var r=n((e=YS(e)).r,(t=YS(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=mC(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function gC(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function _C(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function vC(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=DC(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function yC(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function bC(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function xC(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=DC(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var SC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,CC=new RegExp(SC.source,`g`);function wC(e){return function(){return e}}function TC(e){return function(t){return e(t)+``}}function EC(e,t){var n=SC.lastIndex=CC.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=SC.exec(e))&&(i=CC.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:bC(r,i)})),n=CC.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?TC(c[0].x):wC(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function DC(e,t){var n=typeof t,r;return t==null||n===`boolean`?uC(t):(n===`number`?bC:n===`string`?(r=GS(t))?(t=r,hC):EC:t instanceof GS?hC:t instanceof Date?yC:_C(t)?gC:Array.isArray(t)?vC:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?xC:bC)(e,t)}var OC=180/Math.PI,kC={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function AC(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*OC,skewX:Math.atan(c)*OC,scaleX:o,scaleY:s}}var jC;function MC(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?kC:AC(t.a,t.b,t.c,t.d,t.e,t.f)}function NC(e){return e==null||(jC||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),jC.setAttribute(`transform`,e),!(e=jC.transform.baseVal.consolidate()))?kC:(e=e.matrix,AC(e.a,e.b,e.c,e.d,e.e,e.f))}function PC(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:bC(e,i)},{i:c-2,x:bC(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:bC(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:bC(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:bC(e,n)},{i:s-2,x:bC(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var FC=PC(MC,`px, `,`px)`,`deg)`),IC=PC(NC,`, `,`)`,`)`),LC=1e-12;function RC(e){return((e=Math.exp(e))+1/e)/2}function zC(e){return((e=Math.exp(e))-1/e)/2}function BC(e){return((e=Math.exp(2*e))-1)/(e+1)}var VC=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<LC)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=RC(y),c=s/(n*g)*(i*BC(t*r+y)-zC(y));return[a+c*d,o+c*f,s*i/RC(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),HC=0,UC=0,WC=0,GC=1e3,KC,qC,JC=0,YC=0,XC=0,ZC=typeof performance==`object`&&performance.now?performance:Date,QC=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $C(){return YC||=(QC(ew),ZC.now()+XC)}function ew(){YC=0}function tw(){this._call=this._time=this._next=null}tw.prototype=nw.prototype={constructor:tw,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?$C():+n)+(t==null?0:+t),!this._next&&qC!==this&&(qC?qC._next=this:KC=this,qC=this),this._call=e,this._time=n,sw()},stop:function(){this._call&&(this._call=null,this._time=1/0,sw())}};function nw(e,t,n){var r=new tw;return r.restart(e,t,n),r}function rw(){$C(),++HC;for(var e=KC,t;e;)(t=YC-e._time)>=0&&e._call.call(void 0,t),e=e._next;--HC}function iw(){YC=(JC=ZC.now())+XC,HC=UC=0;try{rw()}finally{HC=0,ow(),YC=0}}function aw(){var e=ZC.now(),t=e-JC;t>GC&&(XC-=t,JC=e)}function ow(){for(var e,t=KC,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:KC=n);qC=e,sw(r)}function sw(e){HC||(UC&&=clearTimeout(UC),e-YC>24?(e<1/0&&(UC=setTimeout(iw,e-ZC.now()-XC)),WC&&=clearInterval(WC)):(WC||=(JC=ZC.now(),setInterval(aw,GC)),HC=1,QC(iw)))}function cw(e,t,n){var r=new tw;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var lw=ob(`start`,`end`,`cancel`,`interrupt`),uw=[];function dw(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;hw(e,n,{name:t,index:r,group:i,on:lw,tween:uw,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function fw(e,t){var n=mw(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function pw(e,t){var n=mw(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function mw(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function hw(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=nw(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return cw(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(cw(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function gw(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function one(e){return this.each(function(){gw(this,e)})}function sne(e,t){var n,r;return function(){var i=pw(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function cne(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=pw(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function lne(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=mw(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?sne:cne)(n,e,t))}function _w(e,t,n){var r=e._id;return e.each(function(){var e=pw(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return mw(e,r).value[t]}}function vw(e,t){var n;return(typeof t==`number`?bC:t instanceof GS?hC:(n=GS(t))?(t=n,hC):EC)(e,t)}function une(e){return function(){this.removeAttribute(e)}}function dne(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fne(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function pne(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function mne(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function hne(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function gne(e,t){var n=fb(e),r=n===`transform`?IC:vw;return this.attrTween(e,typeof t==`function`?(n.local?hne:mne)(n,r,_w(this,`attr.`+e,t)):t==null?(n.local?dne:une)(n):(n.local?pne:fne)(n,r,t))}function _ne(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function vne(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function yne(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&vne(e,i)),n}return i._value=t,i}function bne(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&_ne(e,i)),n}return i._value=t,i}function xne(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=fb(e);return this.tween(n,(r.local?yne:bne)(r,t))}function Sne(e,t){return function(){fw(this,e).delay=+t.apply(this,arguments)}}function Cne(e,t){return t=+t,function(){fw(this,e).delay=t}}function wne(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Sne:Cne)(t,e)):mw(this.node(),t).delay}function Tne(e,t){return function(){pw(this,e).duration=+t.apply(this,arguments)}}function Ene(e,t){return t=+t,function(){pw(this,e).duration=t}}function Dne(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Tne:Ene)(t,e)):mw(this.node(),t).duration}function One(e,t){if(typeof t!=`function`)throw Error();return function(){pw(this,e).ease=t}}function kne(e){var t=this._id;return arguments.length?this.each(One(t,e)):mw(this.node(),t).ease}function Ane(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();pw(this,e).ease=n}}function jne(e){if(typeof e!=`function`)throw Error();return this.each(Ane(this._id,e))}function Mne(e){typeof e!=`function`&&(e=wb(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new bw(r,this._parents,this._name,this._id)}function Nne(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new bw(o,this._parents,this._name,this._id)}function Pne(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Fne(e,t,n){var r,i,a=Pne(t)?fw:pw;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Ine(e,t){var n=this._id;return arguments.length<2?mw(this.node(),n).on.on(e):this.each(Fne(n,e,t))}function Lne(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Rne(){return this.on(`end.remove`,Lne(this._id))}function zne(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=_b(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,dw(l[f],t,n,f,l,mw(u,n)));return new bw(a,this._parents,t,n)}function Bne(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=xb(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=mw(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&dw(p,t,n,h,f,m);a.push(f),o.push(u)}return new bw(a,o,t,n)}var Vne=sS.prototype.constructor;function Hne(){return new Vne(this._groups,this._parents)}function Une(e,t){var n,r,i;return function(){var a=mx(this,e),o=(this.style.removeProperty(e),mx(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function yw(e){return function(){this.style.removeProperty(e)}}function Wne(e,t,n){var r,i=n+``,a;return function(){var o=mx(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Gne(e,t,n){var r,i,a;return function(){var o=mx(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),mx(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Kne(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=pw(this,e),l=c.on,u=c.value[a]==null?s||=yw(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function qne(e,t,n){var r=(e+=``)==`transform`?FC:vw;return t==null?this.styleTween(e,Une(e,r)).on(`end.style.`+e,yw(e)):typeof t==`function`?this.styleTween(e,Gne(e,r,_w(this,`style.`+e,t))).each(Kne(this._id,e)):this.styleTween(e,Wne(e,r,t),n).on(`end.style.`+e,null)}function Jne(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Yne(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Jne(e,a,n)),r}return a._value=t,a}function Xne(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Yne(e,t,n??``))}function Zne(e){return function(){this.textContent=e}}function Qne(e){return function(){var t=e(this);this.textContent=t??``}}function $ne(e){return this.tween(`text`,typeof e==`function`?Qne(_w(this,`text`,e)):Zne(e==null?``:e+``))}function ere(e){return function(t){this.textContent=e.call(this,t)}}function tre(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&ere(r)),t}return r._value=e,r}function nre(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,tre(e))}function rre(){for(var e=this._name,t=this._id,n=xw(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=mw(c,t);dw(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new bw(r,this._parents,e,n)}function ire(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=pw(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var are=0;function bw(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function xw(){return++are}var Sw=sS.prototype;bw.prototype={constructor:bw,select:zne,selectAll:Bne,selectChild:Sw.selectChild,selectChildren:Sw.selectChildren,filter:Mne,merge:Nne,selection:Hne,transition:rre,call:Sw.call,nodes:Sw.nodes,node:Sw.node,size:Sw.size,empty:Sw.empty,each:Sw.each,on:Ine,attr:gne,attrTween:xne,style:qne,styleTween:Xne,text:$ne,textTween:nre,remove:Rne,tween:lne,delay:wne,duration:Dne,ease:kne,easeVarying:jne,end:ire,[Symbol.iterator]:Sw[Symbol.iterator]};function ore(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var sre={time:null,delay:0,duration:250,ease:ore};function cre(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function lre(e){var t,n;e instanceof bw?(t=e._id,e=e._name):(t=xw(),(n=sre).time=$C(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&dw(c,e,t,l,o,n||cre(c,t));return new bw(r,this._parents,e,t)}sS.prototype.interrupt=one,sS.prototype.transition=lre;var Cw=e=>()=>e;function ure(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function ww(e,t,n){this.k=e,this.x=t,this.y=n}ww.prototype={constructor:ww,scale:function(e){return e===1?this:new ww(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ww(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var Tw=new ww(1,0,0);Ew.prototype=ww.prototype;function Ew(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Tw;return e.__zoom}function Dw(e){e.stopImmediatePropagation()}function Ow(e){e.preventDefault(),e.stopImmediatePropagation()}function dre(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function fre(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function kw(){return this.__zoom||Tw}function pre(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function mre(){return navigator.maxTouchPoints||`ontouchstart`in this}function hre(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Aw(){var e=dre,t=fre,n=hre,r=pre,i=mre,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=VC,l=ob(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,kw).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,kw),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(Tw.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new ww(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new ww(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new ww(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=lS(this.that).datum();l.call(e,this.that,new ure(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=dS(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],gw(this),s.start();Ow(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=lS(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=dS(t,i),l=t.clientX,u=t.clientY;gS(t.view),Dw(t),a.mouse=[c,this.__zoom.invert(c)],gw(this),a.start();function d(e){if(Ow(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=dS(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),_S(e.view,a.moved),Ow(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=dS(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);Ow(r),s>0?lS(this).transition().duration(s).call(x,d,c,r):lS(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(Dw(t),s=0;s<i;++s)c=r[s],l=dS(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),gw(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(Ow(e),s=0;s<a;++s)c=i[s],l=dS(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(Dw(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=dS(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=lS(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Cw(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Cw(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Cw(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Cw([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var jw={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Mw=[[-1/0,-1/0],[1/0,1/0]],Nw=[`Enter`,` `,`Escape`],Pw={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},Fw;(function(e){e.Strict=`strict`,e.Loose=`loose`})(Fw||={});var Iw;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(Iw||={});var Lw;(function(e){e.Partial=`partial`,e.Full=`full`})(Lw||={});var Rw={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},zw;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(zw||={});var Bw;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(Bw||={});var Vw;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(Vw||={});var Hw={[Vw.Left]:Vw.Right,[Vw.Right]:Vw.Left,[Vw.Top]:Vw.Bottom,[Vw.Bottom]:Vw.Top};function Uw(e){return e===null?null:e?`valid`:`invalid`}var Ww=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,gre=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),Gw=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),Kw=(e,t=[0,0])=>{let{width:n,height:r}=yT(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},_re=(e,t={nodeOrigin:[0,0]})=>e.length===0?{x:0,y:0,width:0,height:0}:rT(e.reduce((e,n)=>{let r=typeof n==`string`,i=!t.nodeLookup&&!r?n:void 0;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):Gw(n)?n:t.nodeLookup.get(n.id)),tT(e,i?aT(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),qw=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=tT(n,aT(e)),r=!0)}),r?rT(n):{x:0,y:0,width:0,height:0}},Jw=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=sT(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},vre=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function yre(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=yT(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function bre({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=gT(qw(yre(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function Yw({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,jw.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&vT(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=vT(d)?Zw(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,jw.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function xre({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=vre(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var Xw=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Zw=(e={x:0,y:0},t,n)=>({x:Xw(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Xw(e.y,t[0][1],t[1][1]-(n?.height??0))});function Qw(e,t,n){let{width:r,height:i}=yT(n),{x:a,y:o}=n.internals.positionAbsolute;return Zw(e,[[a,o],[a+r,o+i]],t)}var $w=(e,t,n)=>e<t?Xw(Math.abs(e-t),1,t)/t:e>n?-Xw(Math.abs(e-n),1,t)/t:0,eT=(e,t,n=15,r=40)=>[$w(e.x,r,t.width-r)*n,$w(e.y,r,t.height-r)*n],tT=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),nT=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),rT=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),iT=(e,t=[0,0])=>{let{x:n,y:r}=Gw(e)?e.internals.positionAbsolute:Kw(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},aT=(e,t=[0,0])=>{let{x:n,y:r}=Gw(e)?e.internals.positionAbsolute:Kw(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},oT=(e,t)=>rT(tT(nT(e),nT(t))),sT=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},cT=(e,t)=>sT(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),lT=e=>uT(e.width)&&uT(e.height)&&uT(e.x)&&uT(e.y),uT=e=>!isNaN(e)&&isFinite(e),dT=(e,t)=>(e,t)=>{},fT=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),pT=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?fT(s,o):s},mT=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function hT(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Sre(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=hT(e,n),i=hT(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=hT(e.top??e.y??0,n),i=hT(e.bottom??e.y??0,n),a=hT(e.left??e.x??0,t),o=hT(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Cre(e,t,n,r,i,a){let{x:o,y:s}=mT(e,[t,n,r]),{x:c,y:l}=mT({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var gT=(e,t,n,r,i,a)=>{let o=Sre(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=Xw(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=Cre(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},_T=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function vT(e){return e!=null&&e!==`parent`}function yT(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function bT(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function xT(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function ST(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function wre(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Tre(e){return{...Pw,...e||{}}}function CT(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=OT(e),s=pT({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?fT(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var wT=e=>({width:e.offsetWidth,height:e.offsetHeight}),TT=e=>e?.getRootNode?.()||window?.document,Ere=[`INPUT`,`SELECT`,`TEXTAREA`];function ET(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?Ere.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var DT=e=>`clientX`in e,OT=(e,t)=>{let n=DT(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},kT=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...wT(t)}})};function AT({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function jT(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function MT({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Vw.Left:return[t-jT(t-r,a),n];case Vw.Right:return[t+jT(r-t,a),n];case Vw.Top:return[t,n-jT(n-i,a)];case Vw.Bottom:return[t,n+jT(i-n,a)]}}function NT({sourceX:e,sourceY:t,sourcePosition:n=Vw.Bottom,targetX:r,targetY:i,targetPosition:a=Vw.Top,curvature:o=.25}){let[s,c]=MT({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=MT({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=AT({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function PT({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function Dre({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function Ore({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=tT(aT(e),aT(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),cT({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},rT(a))>0}var kre=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,Are=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),jre=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,jw.error006()),t;let r=n.getEdgeId||kre,i;return i=Ww(e)?{...e}:{...e,id:r(e)},Are(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function FT({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=PT({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var IT={[Vw.Left]:{x:-1,y:0},[Vw.Right]:{x:1,y:0},[Vw.Top]:{x:0,y:-1},[Vw.Bottom]:{x:0,y:1}},Mre=({source:e,sourcePosition:t=Vw.Bottom,target:n})=>t===Vw.Left||t===Vw.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},LT=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function Nre({source:e,sourcePosition:t=Vw.Bottom,target:n,targetPosition:r=Vw.Top,center:i,offset:a,stepPosition:o}){let s=IT[t],c=IT[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=Mre({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=PT({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function Pre(e,t,n,r){let i=Math.min(LT(e,t)/2,LT(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function RT({sourceX:e,sourceY:t,sourcePosition:n=Vw.Bottom,targetX:r,targetY:i,targetPosition:a=Vw.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=Nre({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=Pre(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function zT(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Fre(e){let{sourceNode:t,targetNode:n}=e;if(!zT(t)||!zT(n))return null;let r=t.internals.handleBounds||BT(t.handles),i=n.internals.handleBounds||BT(n.handles),a=HT(r?.source??[],e.sourceHandle),o=HT(e.connectionMode===Fw.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,jw.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||Vw.Bottom,c=o?.position||Vw.Top,l=VT(t,a,s),u=VT(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function BT(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function VT(e,t,n=Vw.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??yT(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case Vw.Top:return{x:i+o/2,y:a};case Vw.Right:return{x:i+o,y:a+s/2};case Vw.Bottom:return{x:i+o/2,y:a+s};case Vw.Left:return{x:i,y:a+s/2}}}function HT(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function UT(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function Ire(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=UT(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var WT=1e3,Lre=10,GT={nodeOrigin:[0,0],nodeExtent:Mw,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},Rre={...GT,checkEquality:!0};function KT(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function zre(e,t,n){let r=KT(GT,n);for(let n of e.values())if(n.parentId)YT(n,e,t,r);else{let e=Zw(Kw(n,r.nodeOrigin),vT(n.extent)?n.extent:r.nodeExtent,yT(n));n.internals.positionAbsolute=e}}function Bre(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function qT(e){return e===`manual`}function JT(e,t,n,r={}){let i=KT(Rre,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!qT(i.zIndexMode)?WT:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=Zw(Kw(u,i.nodeOrigin),vT(u.extent)?u.extent:i.nodeExtent,yT(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:Bre(u,e),z:XT(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&YT(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function Vre(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function YT(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=KT(GT,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Vre(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*Lre),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=Hre(e,u,o,s,a&&!qT(c)?WT:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function XT(e,t,n){let r=uT(e.zIndex)?e.zIndex:0;return qT(n)?r:r+(e.selected?t:0)}function Hre(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=yT(e),l=Kw(e,n),u=vT(e.extent)?Zw(l,e.extent,c):l,d=Zw({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=Qw(d,c,t));let f=XT(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function ZT(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=oT(a.get(n.parentId)?.expandedRect??iT(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=yT(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function Ure(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=wT(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=vT(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=Qw(h,s,n))}else m&&(h=Zw(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:kT(`source`,r.nodeElement,p,d,e.id),target:kT(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&YT(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:iT(g,i)}))}}if(f.length>0){let e=ZT(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function Wre({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function QT(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function $T(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;QT(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),QT(`target`,s,c,e,i,o),t.set(r.id,r)}}function eE(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:eE(n,t):!1}function tE(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function Gre(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!eE(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function nE({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function Kre({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=fT(a,t);return{x:o.x-a.x,y:o.y-a.y}}function qre({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=lS(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?nT(qw(s)):null,x=v&&l?Kre({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:fT(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=Yw({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=nE({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=eT(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=CT(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=Gre(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=nE({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=wS().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=CT(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=OT(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=CT(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=OT(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=OT(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=nE({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!tE(t,`.${g}`,v))&&(!_||tE(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function Jre(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())cT(i,iT(e))>0&&r.push(e);return r}var Yre=250;function Xre(e,t,n,r){let i=[],a=1/0,o=Jre(e,n,t+Yre);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=VT(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function rE(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...VT(o,c,c.position,!0)}:c}function iE(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Zre(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var aE=()=>!0;function Qre(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=aE,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=TT(e.target),E=0,D,{x:O,y:k}=OT(e),A=iE(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=rE(i,A,r,c,t);if(!N)return;let P=OT(e,j),F=!1,I=null,L=!1,R=null;function z(){if(!u||!j)return;let[e,t]=eT(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(z)}let B={...N,nodeId:i,type:A,position:N.position},V=c.get(i),H={inProgress:!0,isValid:null,from:VT(V,B,Vw.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:V,to:P,toHandle:null,toPosition:Hw[B.position],toNode:null,pointer:P};function U(){M=!0,y(H),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&U();function W(e){if(!M){let{x:t,y:n}=OT(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;U()}if(!x()||!B){G(e);return}let a=b();P=OT(e,j),D=Xre(pT(P,a,!1,[1,1]),n,c,B),F||=(z(),!0);let s=oE(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});R=s.handleDomNode,I=s.connection,L=Zre(!!D,s.isValid);let u=c.get(i),f=u?VT(u,B,Vw.Left,!0):H.from,p={...H,from:f,isValid:L,to:s.toHandle&&L?mT({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:L&&s.toHandle?s.toHandle.position:Hw[B.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),H=p}function G(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||R)&&I&&L&&h?.(I);let{inProgress:t,...n}=H,r={...n,toPosition:H.toHandle?H.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),F=!1,L=!1,I=null,R=null,T.removeEventListener(`mousemove`,W),T.removeEventListener(`mouseup`,G),T.removeEventListener(`touchmove`,W),T.removeEventListener(`touchend`,G)}}T.addEventListener(`mousemove`,W),T.addEventListener(`mouseup`,G),T.addEventListener(`touchmove`,W),T.addEventListener(`touchend`,G)}function oE(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=aE,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=OT(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=iE(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===Fw.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=rE(t,e,a,u,n,!0)}return _}var sE={onPointerDown:Qre,isValid:oE};function $re({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=lS(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&_T()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=Aw().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:dS}}var cE=e=>({x:e.x,y:e.y,zoom:e.k}),lE=({x:e,y:t,zoom:n})=>Tw.translate(e,t).scale(n),uE=(e,t)=>e.target.closest(`.${t}`),dE=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),eie=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,fE=(e,t=0,n=eie,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},pE=e=>{let t=e.ctrlKey&&_T()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function tie({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(uE(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=dS(u),t=d*2**pE(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===Iw.Vertical?0:u.deltaX*f,m=i===Iw.Horizontal?0:u.deltaY*f;!_T()&&u.shiftKey&&i!==Iw.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=cE(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function nie({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=uE(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function rie({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=cE(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function iie({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&dE(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,cE(a.transform))}}function aie({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&dE(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=cE(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function oie({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:c,lib:l,connectionInProgress:u}){return d=>{let f=e||t,p=n&&d.ctrlKey,m=d.type===`wheel`;if(d.button===1&&d.type===`mousedown`&&(uE(d,`${l}-flow__node`)||uE(d,`${l}-flow__edge`)))return!0;if(!r&&!f&&!i&&!a&&!n||o||u&&!m||uE(d,s)&&m||uE(d,c)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type===`touchstart`&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!i&&!p&&m||!r&&(d.type===`mousedown`||d.type===`touchstart`)||Array.isArray(r)&&!r.includes(d.button)&&d.type===`mousedown`)return!1;let h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&h}}function sie({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=Aw().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=lS(e).call(f);y({x:i.x,y:i.y,zoom:Xw(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(pE);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?DC:VC).transform(fE(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&v();let O=i&&!S&&!r;f.clickDistance(D?1/0:!uT(E)||E<0?0:E);let k=O?tie({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):nie({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,k,{passive:!1});let A=rie({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,A);let j=iie({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});f.on(`zoom`,j);let M=aie({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,M);let N=oie({zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});f.filter(N),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=lE(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=lE(e);return await g(n,t),n}function x(e){if(p){let t=lE(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?Ew(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?DC:VC).scaleTo(fE(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?DC:VC).scaleBy(fE(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!uT(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var mE;(function(e){e.Line=`line`,e.Handle=`handle`})(mE||={});function cie({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function hE(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function gE(e,t){return Math.max(0,t-e)}function _E(e,t){return Math.max(0,e-t)}function vE(e,t,n){return Math.max(0,t-e,e-n)}function yE(e,t){return e?!t:t}function lie(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=vE(E,h,g),j=vE(D,_,v);if(o){let e=0,t=0;c&&w<0?e=gE(y+w+O,o[0][0]):!c&&w>0&&(e=_E(y+E+O,o[1][0])),l&&T<0?t=gE(b+T+k,o[0][1]):!l&&T>0&&(t=_E(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=_E(y+w,s[0][0]):!c&&w<0&&(e=gE(y+E,s[1][0])),l&&T>0?t=_E(b+T,s[0][1]):!l&&T<0&&(t=gE(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=vE(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?_E(b+k+E/C,o[1][1])*C:gE(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?gE(b+E/C,s[1][1])*C:_E(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=vE(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?_E(y+D*C+O,o[1][0])/C:gE(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?gE(y+D*C,s[1][0])/C:_E(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(yE(c,l)?-w:w)/C:w=(yE(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var bE={width:0,height:0,x:0,y:0},uie={...bE,pointerX:0,pointerY:0,aspectRatio:1};function die(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function fie({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=lS(e),o={controlDirection:hE(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...bE},h={...uie};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:hE(e)};let g,_=null,v=[],y,b,x,S=!1,C=wS().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=CT(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=vT(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=die(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=CT(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:C,height:w}=m,T={},E=g.origin??s,{width:D,height:O,x:k,y:A}=lie(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,E,b,x),j=D!==C,M=O!==w,N=k!==u&&j,P=A!==f&&M;if(!N&&!P&&!j&&!M)return;if((N||P||E[0]===1||E[1]===1)&&(T.x=N?k:m.x,T.y=P?A:m.y,m.x=T.x,m.y=T.y,v.length>0)){let e=k-u,t=A-f;for(let n of v)n.position={x:n.position.x-e+E[0]*(D-C),y:n.position.y-t+E[1]*(O-w)},l.push(n)}if((j||M)&&(T.width=j&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?D:m.width,T.height=M&&(!o.resizeDirection||o.resizeDirection===`vertical`)?O:m.height,m.width=T.width,m.height=T.height),y&&g.expandParent){let e=E[0]*(T.width??0);T.x&&T.x<e&&(m.x=e,h.x-=T.x-e);let t=E[1]*(T.height??0);T.y&&T.y<t&&(m.y=t,h.y-=T.y-t)}let F=cie({width:m.width,prevWidth:C,height:m.height,prevHeight:w,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),I={...m,direction:F};p?.(e,I)!==!1&&(S=!0,d?.(e,I),r(T,l))}).on(`end`,e=>{S&&=(f?.(e,{...m}),i?.({...m}),!1)});a.call(C)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var xE=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},pie=e=>e?xE(e):xE,{useDebugValue:SE}=Y.default,{useSyncExternalStoreWithSelector:CE}=Fi.default,wE=e=>e;function TE(e,t=wE,n){let r=CE(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return SE(r),r}var EE=(e,t)=>{let n=pie(e),r=(e,r=t)=>TE(n,e,r);return Object.assign(r,n),r},DE=(e,t)=>e?EE(e,t):EE;function OE(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var kE=(0,Y.createContext)(null),AE=kE.Provider,jE=jw.error001(`react`);function ME(e,t){let n=(0,Y.useContext)(kE);if(n===null)throw Error(jE);return TE(n,e,t)}function NE(){let e=(0,Y.useContext)(kE);if(e===null)throw Error(jE);return(0,Y.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var PE={display:`none`},FE={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},IE=`react-flow__node-desc`,LE=`react-flow__edge-desc`,RE=`react-flow__aria-live`,zE=e=>e.ariaLiveMessage,BE=e=>e.ariaLabelConfig;function VE({rfId:e}){let t=ME(zE);return(0,X.jsx)(`div`,{id:`${RE}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:FE,children:t})}function HE({rfId:e,disableKeyboardA11y:t}){let n=ME(BE);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{id:`${IE}-${e}`,style:PE,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,X.jsx)(`div`,{id:`${LE}-${e}`,style:PE,children:n[`edge.a11yDescription.default`]}),!t&&(0,X.jsx)(VE,{rfId:e})]})}var UE=(0,Y.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return(0,X.jsx)(`div`,{className:ib([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});UE.displayName=`Panel`;var WE=`https://reactflow.dev?utm_source=attribution`;function GE({proOptions:e,position:t=`bottom-right`}){return e?.hideAttribution?null:(0,X.jsx)(UE,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${WE}`,children:(0,X.jsx)(`a`,{href:WE,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var KE=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},qE=e=>e.id;function JE(e,t){return OE(e.selectedNodes.map(qE),t.selectedNodes.map(qE))&&OE(e.selectedEdges.map(qE),t.selectedEdges.map(qE))}function YE({onSelectionChange:e}){let t=NE(),{selectedNodes:n,selectedEdges:r}=ME(KE,JE);return(0,Y.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var XE=e=>!!e.onSelectionChangeHandlers;function ZE({onSelectionChange:e}){let t=ME(XE);return e||t?(0,X.jsx)(YE,{onSelectionChange:e}):null}var QE=[0,0],$E={x:0,y:0,zoom:1},eD=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],tD=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),nD={translateExtent:Mw,nodeOrigin:QE,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function rD(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=ME(tD,OE),l=NE();(0,Y.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=nD,s()}),[]);let u=(0,Y.useRef)(nD);return(0,Y.useEffect)(()=>{for(let s of eD){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:Tre(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},eD.map(t=>e[t])),null}function iD(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function aD(e){let[t,n]=(0,Y.useState)(e===`system`?null:e);return(0,Y.useEffect)(()=>{if(e!==`system`){n(e);return}let t=iD(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?iD()?.matches?`dark`:`light`:t}var oD=typeof document<`u`?document:null;function sD(e=null,t={target:oD,actInsideInputWithModifier:!0}){let[n,r]=(0,Y.useState)(!1),i=(0,Y.useRef)(!1),a=(0,Y.useRef)(new Set([])),[o,s]=(0,Y.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(`+`,`
15
+ `).replace(`
16
+
17
+ `,`
18
+ +`).split(`
19
+ `));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,Y.useEffect)(()=>{let n=t?.target??oD,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&ET(e))return!1;let n=lD(e.code,s);if(a.current.add(e[n]),cD(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=lD(e.code,s);cD(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function cD(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function lD(e,t){return t.includes(e)?`code`:`key`}var uD=()=>{let e=NE();return(0,Y.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=gT(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return pT(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=mT(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function dD(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)fD(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function fD(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing)}}function pD(e,t){return dD(e,t)}function mD(e,t){return dD(e,t)}function hD(e,t){return{id:e,type:`select`,selected:t}}function gD(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);!(a.selected===void 0&&!e)&&a.selected!==e&&(n&&(a.selected=e),r.push(hD(a.id,e)))}return r}function _D({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function vD(e){return{id:e.id,type:`remove`}}var yD=dT(`React Flow`,`https://reactflow.dev/`);function bD(e,t,n={}){return jre(e,t,{...n,onError:n.onError??yD})}var xD=e=>gre(e),SD=e=>Ww(e);function CD(e){return(0,Y.forwardRef)(e)}var wD=typeof window<`u`?Y.useLayoutEffect:Y.useEffect;function TD(e){let[t,n]=(0,Y.useState)(BigInt(0)),[r]=(0,Y.useState)(()=>ED(()=>n(e=>e+BigInt(1))));return wD(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function ED(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var DD=(0,Y.createContext)(null);function OD({children:e}){let t=NE(),n=TD((0,Y.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=_D({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=TD((0,Y.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(_D({items:s,lookup:o}))},[])),i=(0,Y.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,X.jsx)(DD.Provider,{value:i,children:e})}function kD(){let e=(0,Y.useContext)(DD);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var AD=e=>!!e.panZoom;function jD(){let e=uD(),t=NE(),n=kD(),r=ME(AD),i=(0,Y.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=xD(e)?e:n.get(e.id),a=i.parentId?xT(i.position,i.measured,i.parentId,n,r):i.position;return iT({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&xD(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&SD(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await xre({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(vD);o?.(f),c(e)}if(m){let e=d.map(vD);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=lT(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=iT(s?r:a),l=cT(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=lT(e)?e:a(e);if(!r)return!1;let i=cT(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return _re(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??wre();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,Y.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var MD=e=>e.selected,ND=typeof window<`u`?window:void 0;function PD({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=NE(),{deleteElements:r}=jD(),i=sD(e,{actInsideInputWithModifier:!1}),a=sD(t,{target:ND});(0,Y.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(MD),edges:e.filter(MD)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,Y.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function FD(e){let t=NE();(0,Y.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=wT(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,jw.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var ID={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},LD=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function RD({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=Iw.Free,zoomOnDoubleClick:o=!0,panOnDrag:s=!0,defaultViewport:c,translateExtent:l,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:m,noWheelClassName:h,noPanClassName:g,onViewportChange:_,isControlledViewport:v,paneClickDistance:y,selectionOnDrag:b}){let x=NE(),S=(0,Y.useRef)(null),{userSelectionActive:C,lib:w,connectionInProgress:T}=ME(LD,OE),E=sD(f),D=(0,Y.useRef)();FD(S);let O=(0,Y.useCallback)(e=>{_?.({x:e[0],y:e[1],zoom:e[2]}),v||x.setState({transform:e})},[_,v]);return(0,Y.useEffect)(()=>{if(S.current){D.current=sie({domNode:S.current,minZoom:u,maxZoom:d,translateExtent:l,viewport:c,onDraggingChange:e=>x.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=x.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=x.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=x.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=D.current.getViewport();return x.setState({panZoom:D.current,transform:[e,t,n],domNode:S.current.closest(`.react-flow`)}),()=>{D.current?.destroy()}}},[]),(0,Y.useEffect)(()=>{D.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:s,zoomActivationKeyPressed:E,preventScrolling:p,noPanClassName:g,userSelectionActive:C,noWheelClassName:h,lib:w,onTransformChange:O,connectionInProgress:T,selectionOnDrag:b,paneClickDistance:y})},[e,t,n,r,i,a,o,s,E,p,g,C,h,w,O,T,b,y]),(0,X.jsx)(`div`,{className:`react-flow__renderer`,ref:S,style:ID,children:m})}var zD=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function BD(){let{userSelectionActive:e,userSelectionRect:t}=ME(zD,OE);return e&&t?(0,X.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var VD=(e,t)=>n=>{n.target===t.current&&e?.(n)},HD=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function UD({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Lw.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){let g=(0,Y.useRef)(0),_=NE(),{userSelectionActive:v,elementsSelectable:y,dragging:b,panBy:x,autoPanSpeed:S}=ME(HD,OE),C=y&&(e||v),w=(0,Y.useRef)(null),T=(0,Y.useRef)(),E=(0,Y.useRef)(new Set),D=(0,Y.useRef)(new Set),O=(0,Y.useRef)(!1),k=(0,Y.useRef)(!1),A=(0,Y.useRef)({x:0,y:0}),j=(0,Y.useRef)(!1),M=e=>{if(k.current||O.current||_.getState().connection.inProgress){k.current=!1,O.current=!1;return}l?.(e),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},N=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}u?.(e)},P=d?e=>d(e):void 0,F=e=>{k.current&&=(e.stopPropagation(),!1)},I=n=>{let{domNode:r,transform:i}=_.getState();if(T.current=r?.getBoundingClientRect(),!T.current)return;let a=n.target===w.current;if(!a&&n.target.closest(`.nokey`)||!e||!(o&&a||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),k.current=!1;let{x:s,y:c}=OT(n.nativeEvent,T.current),l=pT({x:s,y:c},i);_.setState({userSelectionRect:{width:0,height:0,startX:l.x,startY:l.y,x:s,y:c}}),a||(n.stopPropagation(),n.preventDefault())};function L(e,t){let{userSelectionRect:r}=_.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=_.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=mT(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=E.current,g=D.current;E.current=new Set(Jw(a,m,i,n===Lw.Partial,!0).map(e=>e.id)),D.current=new Set;let v=u?.selectable??!0;for(let e of E.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??v)&&D.current.add(e)}}ST(h,E.current)||c(gD(a,E.current,!0)),ST(g,D.current)||l(gD(o,D.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function R(){if(!i||!T.current)return;let[e,t]=eT(A.current,T.current,S);x({x:e,y:t}).then(e=>{if(!k.current||!e){g.current=requestAnimationFrame(R);return}let{x:t,y:n}=A.current;L(t,n),g.current=requestAnimationFrame(R)})}let z=()=>{cancelAnimationFrame(g.current),g.current=0,j.current=!1};(0,Y.useEffect)(()=>()=>z(),[]);let B=e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=_.getState();if(!T.current||!n)return;let{x:o,y:c}=OT(e.nativeEvent,T.current);A.current={x:o,y:c};let l=mT({x:n.startX,y:n.startY},r);if(!k.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}k.current=!0,j.current||=(R(),!0),L(o,c)},V=e=>{if(!C){e.target===w.current&&_.getState().connection.inProgress&&(O.current=!0);return}e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!v&&e.target===w.current&&_.getState().userSelectionRect&&M?.(e),_.setState({userSelectionActive:!1,userSelectionRect:null}),k.current&&(c?.(e),_.setState({nodesSelectionActive:E.current.size>0})),z())},H=e=>{e.target?.releasePointerCapture?.(e.pointerId),z()},U=r===!0||Array.isArray(r)&&r.includes(0);return(0,X.jsxs)(`div`,{className:ib([`react-flow__pane`,{draggable:U,dragging:b,selection:e}]),onClick:C?void 0:VD(M,w),onContextMenu:VD(N,w),onWheel:VD(P,w),onPointerEnter:C?void 0:f,onPointerMove:C?B:p,onPointerUp:V,onPointerCancel:C?H:void 0,onPointerDownCapture:C?I:void 0,onClickCapture:C?F:void 0,onPointerLeave:m,ref:w,style:ID,children:[h,(0,X.jsx)(BD,{})]})}function WD({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,jw.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function GD({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=NE(),[c,l]=(0,Y.useState)(!1),u=(0,Y.useRef)();return(0,Y.useEffect)(()=>{if(!t)return u.current=qre({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{WD({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),(0,Y.useEffect)(()=>{t||!e.current||!u.current||u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var KD=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function qD(){let e=NE();return(0,Y.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=KD(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=fT(t,i));let{position:a,positionAbsolute:s}=Yw({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var JD=(0,Y.createContext)(null),YD=JD.Provider;JD.Consumer;var XD=()=>(0,Y.useContext)(JD),ZD=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),QD=(0,Y.createContext)(null);function $D({children:e}){let t=ME(ZD,OE);return(0,X.jsx)(QD.Provider,{value:t,children:e})}function eO(){let e=(0,Y.useContext)(QD);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var tO={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},nO=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return tO;let u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===Fw.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function rO({type:e=`source`,position:t=Vw.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=NE(),_=XD(),{connectOnClick:v,noPanClassName:y,rfId:b}=eO(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=ME(nO(_,m,e),OE);_||g.getState().onError?.(`010`,jw.error010());let O=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(bD(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=DT(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();sE.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:O,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,X.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:ib([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:k,onTouchStart:k,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=TT(t.target),h=n||c,{connection:v,isValid:y}=sE.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&O(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var iO=(0,Y.memo)(CD(rO));function aO({data:e,isConnectable:t,sourcePosition:n=Vw.Bottom}){return(0,X.jsxs)(X.Fragment,{children:[e?.label,(0,X.jsx)(iO,{type:`source`,position:n,isConnectable:t})]})}function oO({data:e,isConnectable:t,targetPosition:n=Vw.Top,sourcePosition:r=Vw.Bottom}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(iO,{type:`target`,position:n,isConnectable:t}),e?.label,(0,X.jsx)(iO,{type:`source`,position:r,isConnectable:t})]})}function sO(){return null}function cO({data:e,isConnectable:t,targetPosition:n=Vw.Top}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(iO,{type:`target`,position:n,isConnectable:t}),e?.label]})}var lO={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},uO={input:aO,default:oO,output:cO,group:sO};function dO(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var fO=e=>{let{width:t,height:n,x:r,y:i}=qw(e.nodeLookup,{filter:e=>!!e.selected});return{width:uT(t)?t:null,height:uT(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function pO({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=NE(),{width:i,height:a,transformString:o,userSelectionActive:s}=ME(fO,OE),c=qD(),l=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(GD({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,X.jsx)(`div`,{className:ib([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,X.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(lO,e.key)&&(e.preventDefault(),c({direction:lO[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var mO=typeof window<`u`?window:void 0,hO=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function gO({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,autoPanOnSelection:T,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,preventScrolling:A,onSelectionContextMenu:j,noWheelClassName:M,noPanClassName:N,disableKeyboardA11y:P,onViewportChange:F,isControlledViewport:I}){let{nodesSelectionActive:L,userSelectionActive:R}=ME(hO,OE),z=sD(l,{target:mO}),B=sD(h,{target:mO}),V=B||w,H=B||b,U=u&&V!==!0,W=z||R||U;return PD({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,X.jsx)(RD,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:H,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!z&&V,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,zoomActivationKeyCode:g,preventScrolling:A,noWheelClassName:M,noPanClassName:N,onViewportChange:F,isControlledViewport:I,paneClickDistance:s,selectionOnDrag:U,children:(0,X.jsxs)(UD,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:V,autoPanOnSelection:T,isSelecting:!!W,selectionMode:d,selectionKeyPressed:z,paneClickDistance:s,selectionOnDrag:U,children:[e,L&&(0,X.jsx)(pO,{onSelectionContextMenu:j,noPanClassName:N,disableKeyboardA11y:P})]})})}gO.displayName=`FlowRenderer`;var _O=(0,Y.memo)(gO),vO=e=>t=>e?Jw(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function yO(e){return ME((0,Y.useCallback)(vO(e),[e]),OE)}var bO=e=>e.updateNodeInternals;function xO(){let e=ME(bO),[t]=(0,Y.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,Y.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function SO({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=NE(),a=(0,Y.useRef)(null),o=(0,Y.useRef)(null),s=(0,Y.useRef)(e.sourcePosition),c=(0,Y.useRef)(e.targetPosition),l=(0,Y.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,Y.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,Y.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,Y.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function CO({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=ME(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},OE),S=y.type||`default`,C=g?.[S]||uO[S];C===void 0&&(v?.(`003`,jw.error003(S)),S=`default`,C=g?.default||uO.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),O=NE(),k=bT(y),A=SO({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=GD({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=qD();if(y.hidden)return null;let N=yT(y),P=dO(y),F=T||w||t||n||r||i,I=n?e=>n(e,{...b.userNode}):void 0,L=r?e=>r(e,{...b.userNode}):void 0,R=i?e=>i(e,{...b.userNode}):void 0,z=a?e=>a(e,{...b.userNode}):void 0,B=o?e=>o(e,{...b.userNode}):void 0,V=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&WD({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},H=t=>{if(!(ET(t.nativeEvent)||m)){if(Nw.includes(t.key)&&T){let n=t.key===`Escape`;WD({id:e,store:O,unselect:n,nodeRef:A})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(lO,t.key)){t.preventDefault();let{ariaLabelConfig:e}=O.getState();O.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),M({direction:lO[t.key],factor:t.shiftKey?4:1})}}},U=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(Jw(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+N.width/2,y.position.y+N.height/2,{zoom:t[2]}))};return(0,X.jsx)(`div`,{className:ib([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:j}]),ref:A,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:F?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:L,onMouseLeave:R,onContextMenu:z,onClick:V,onDoubleClick:B,onKeyDown:D?H:void 0,tabIndex:D?0:void 0,onFocus:D?U:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${IE}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,X.jsx)(YD,{value:e,children:(0,X.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:j,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...N})})})}var wO=(0,Y.memo)(CO),TO=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function EO(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=ME(TO,OE),a=yO(e.onlyRenderVisibleElements),o=xO();return(0,X.jsx)(`div`,{className:`react-flow__nodes`,style:ID,children:a.map(a=>(0,X.jsx)(wO,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}EO.displayName=`NodeRenderer`;var DO=(0,Y.memo)(EO);function OO(e){return ME((0,Y.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&Ore({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),OE)}var kO=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,X.jsx)(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},AO=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,X.jsx)(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},jO={[Bw.Arrow]:kO,[Bw.ArrowClosed]:AO};function MO(e){let t=NE();return(0,Y.useMemo)(()=>Object.prototype.hasOwnProperty.call(jO,e)?jO[e]:(t.getState().onError?.(`009`,jw.error009(e)),null),[e])}var NO=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=MO(t);return c?(0,X.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,X.jsx)(c,{color:n,strokeWidth:o})}):null},PO=({defaultColor:e,rfId:t})=>{let n=ME(e=>e.edges),r=ME(e=>e.defaultEdgeOptions),i=(0,Y.useMemo)(()=>Ire(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,X.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,X.jsx)(`defs`,{children:i.map(e=>(0,X.jsx)(NO,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};PO.displayName=`MarkerDefinitions`;var FO=(0,Y.memo)(PO);function IO({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,Y.useState)({x:1,y:0,width:0,height:0}),p=ib([`react-flow__edge-textwrapper`,l]),m=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,X.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,X.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,X.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}IO.displayName=`EdgeText`;var LO=(0,Y.memo)(IO);function RO({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`path`,{...u,d:e,fill:`none`,className:ib([`react-flow__edge-path`,u.className])}),l?(0,X.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&uT(t)&&uT(n)?(0,X.jsx)(LO,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function zO({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Vw.Left||e===Vw.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function BO({sourceX:e,sourceY:t,sourcePosition:n=Vw.Bottom,targetX:r,targetY:i,targetPosition:a=Vw.Top}){let[o,s]=zO({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=zO({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=AT({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function VO(e){return(0,Y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=BO({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return(0,X.jsx)(RO,{id:x,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var HO=VO({isInternal:!1}),UO=VO({isInternal:!0});HO.displayName=`SimpleBezierEdge`,UO.displayName=`SimpleBezierEdgeInternal`;function WO(e){return(0,Y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=Vw.Bottom,targetPosition:m=Vw.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=RT({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),S=e.isInternal?void 0:t;return(0,X.jsx)(RO,{id:S,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var GO=WO({isInternal:!1}),KO=WO({isInternal:!0});GO.displayName=`SmoothStepEdge`,KO.displayName=`SmoothStepEdgeInternal`;function qO(e){return(0,Y.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,X.jsx)(GO,{...n,id:r,pathOptions:(0,Y.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var JO=qO({isInternal:!1}),YO=qO({isInternal:!0});JO.displayName=`StepEdge`,YO.displayName=`StepEdgeInternal`;function XO(e){return(0,Y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=FT({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return(0,X.jsx)(RO,{id:y,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var ZO=XO({isInternal:!1}),QO=XO({isInternal:!0});ZO.displayName=`StraightEdge`,QO.displayName=`StraightEdgeInternal`;function $O(e){return(0,Y.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Vw.Bottom,targetPosition:s=Vw.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=NT({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature}),S=e.isInternal?void 0:t;return(0,X.jsx)(RO,{id:S,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var ek=$O({isInternal:!1}),tk=$O({isInternal:!0});ek.displayName=`BezierEdge`,tk.displayName=`BezierEdgeInternal`;var nk={default:tk,straight:QO,step:YO,smoothstep:KO,simplebezier:UO},rk={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},ik=(e,t,n)=>n===Vw.Left?e-t:n===Vw.Right?e+t:e,ak=(e,t,n)=>n===Vw.Top?e-t:n===Vw.Bottom?e+t:e,ok=`react-flow__edgeupdater`;function sk({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,X.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:ib([ok,`${ok}-${s}`]),cx:ik(t,r,e),cy:ak(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function ck({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=NE(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;sE.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,X.jsxs)(X.Fragment,{children:[(e===!0||e===`source`)&&(0,X.jsx)(sk,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,X.jsx)(sk,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function lk({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:v}){let y=ME(t=>t.edgeLookup.get(e)),b=ME(e=>e.defaultEdgeOptions);y=b?{...b,...y}:y;let x=y.type||`default`,S=h?.[x]||nk[x];S===void 0&&(_?.(`011`,jw.error011(x)),x=`default`,S=h?.default||nk.default);let C=!!(y.focusable||t&&y.focusable===void 0),w=d!==void 0&&(y.reconnectable||n&&y.reconnectable===void 0),T=!!(y.selectable||r&&y.selectable===void 0),E=(0,Y.useRef)(null),[D,O]=(0,Y.useState)(!1),[k,A]=(0,Y.useState)(!1),j=NE(),{zIndex:M=y.zIndex,sourceX:N,sourceY:P,targetX:F,targetY:I,sourcePosition:L,targetPosition:R}=ME((0,Y.useCallback)(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return rk;let i=Fre({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_}),a=Dre({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||rk,zIndex:a}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),OE),z=(0,Y.useMemo)(()=>y.markerStart?`url('#${UT(y.markerStart,m)}')`:void 0,[y.markerStart,m]),B=(0,Y.useMemo)(()=>y.markerEnd?`url('#${UT(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||N===null||P===null||F===null||I===null)return null;let V=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=j.getState();T&&(j.setState({nodesSelectionActive:!1}),y.selected&&a?(r({nodes:[],edges:[y]}),E.current?.blur()):n([e])),i&&i(t,y)},H=a?e=>{a(e,{...y})}:void 0,U=o?e=>{o(e,{...y})}:void 0,W=s?e=>{s(e,{...y})}:void 0,G=c?e=>{c(e,{...y})}:void 0,K=l?e=>{l(e,{...y})}:void 0;return(0,X.jsx)(`svg`,{style:{zIndex:M},children:(0,X.jsxs)(`g`,{className:ib([`react-flow__edge`,`react-flow__edge-${x}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!T&&!i,updating:D,selectable:T}]),onClick:V,onDoubleClick:H,onContextMenu:U,onMouseEnter:W,onMouseMove:G,onMouseLeave:K,onKeyDown:C?t=>{if(!v&&Nw.includes(t.key)&&T){let{unselectNodesAndEdges:n,addSelectedEdges:r}=j.getState();t.key===`Escape`?(E.current?.blur(),n({edges:[y]})):r([e])}}:void 0,tabIndex:C?0:void 0,role:y.ariaRole??(C?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":C?`${LE}-${m}`:void 0,ref:E,...y.domAttributes,children:[!k&&(0,X.jsx)(S,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:T,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:N,sourceY:P,targetX:F,targetY:I,sourcePosition:L,targetPosition:R,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:z,markerEnd:B,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),w&&(0,X.jsx)(ck,{edge:y,isReconnectable:w,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:N,sourceY:P,targetX:F,targetY:I,sourcePosition:L,targetPosition:R,setUpdateHover:O,setReconnecting:A})]})})}var uk=(0,Y.memo)(lk),dk=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function fk({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=ME(dk,OE),b=OO(t);return(0,X.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,X.jsx)(FO,{defaultColor:e,rfId:n}),b.map(e=>(0,X.jsx)(uk,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}fk.displayName=`EdgeRenderer`;var pk=(0,Y.memo)(fk),mk=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function hk({children:e}){let t=NE(),n=(0,Y.useRef)(null),[r]=(0,Y.useState)(()=>t.getState().transform);return wD(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=mk(r)))};return r(),t.subscribe(r)},[t]),(0,X.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:mk(r)},children:e})}function gk(e){let t=jD(),n=(0,Y.useRef)(!1);(0,Y.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var _k=e=>e.panZoom?.syncViewport;function vk(e){let t=ME(_k),n=NE();return(0,Y.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function yk(e){return e.connection.inProgress?{...e.connection,to:pT(e.connection.to,e.transform)}:{...e.connection}}function bk(e){return e?t=>e(yk(t)):yk}function xk(e){return ME(bk(e),OE)}var Sk=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Ck({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=ME(Sk,OE);return a&&i&&c?(0,X.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,X.jsx)(`g`,{className:ib([`react-flow__connection`,Uw(s)]),children:(0,X.jsx)(wk,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var wk=({style:e,type:t=zw.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=xk();if(!i)return;if(n)return(0,X.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:Uw(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case zw.Bezier:[m]=NT(h);break;case zw.SimpleBezier:[m]=BO(h);break;case zw.Step:[m]=RT({...h,borderRadius:0});break;case zw.SmoothStep:[m]=RT(h);break;default:[m]=FT(h)}return(0,X.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};wk.displayName=`ConnectionLine`;var Tk={};function Ek(e=Tk){(0,Y.useRef)(e),NE(),(0,Y.useEffect)(()=>{},[e])}function Dk(){NE(),(0,Y.useRef)(!1),(0,Y.useEffect)(()=>{},[])}function Ok({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,defaultMarkerColor:M,zoomOnScroll:N,zoomOnPinch:P,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:L,zoomOnDoubleClick:R,panOnDrag:z,autoPanOnSelection:B,onPaneClick:V,onPaneMouseEnter:H,onPaneMouseMove:U,onPaneMouseLeave:W,onPaneScroll:G,onPaneContextMenu:K,paneClickDistance:q,nodeClickDistance:J,onEdgeContextMenu:ee,onEdgeMouseEnter:te,onEdgeMouseMove:ne,onEdgeMouseLeave:re,reconnectRadius:ie,onReconnect:ae,onReconnectStart:oe,onReconnectEnd:se,noDragClassName:ce,noWheelClassName:le,noPanClassName:ue,disableKeyboardA11y:de,nodeExtent:fe,rfId:pe,viewport:me,onViewportChange:he,nodesDraggable:ge}){return Ek(e),Ek(t),Dk(),gk(n),vk(me),(0,X.jsx)(_O,{onPaneClick:V,onPaneMouseEnter:H,onPaneMouseMove:U,onPaneMouseLeave:W,onPaneContextMenu:K,onPaneScroll:G,paneClickDistance:q,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:N,zoomOnPinch:P,zoomOnDoubleClick:R,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:L,panOnDrag:z,autoPanOnSelection:B,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:ce,noWheelClassName:le,noPanClassName:ue,disableKeyboardA11y:de,onViewportChange:he,isControlledViewport:!!me,children:(0,X.jsxs)(hk,{children:[(0,X.jsx)(pk,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:ae,onReconnectStart:oe,onReconnectEnd:se,onlyRenderVisibleElements:T,onEdgeContextMenu:ee,onEdgeMouseEnter:te,onEdgeMouseMove:ne,onEdgeMouseLeave:re,reconnectRadius:ie,defaultMarkerColor:M,noPanClassName:ue,disableKeyboardA11y:de,rfId:pe}),(0,X.jsx)(Ck,{style:h,type:m,component:g,containerStyle:_}),(0,X.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,X.jsx)(DO,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:J,onlyRenderVisibleElements:T,noPanClassName:ue,noDragClassName:ce,disableKeyboardA11y:de,nodeExtent:fe,rfId:pe,nodesDraggable:ge}),(0,X.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}Ok.displayName=`GraphView`;var kk=(0,Y.memo)(Ok),Ak=dT(`React Flow`,`https://reactflow.dev/`),jk=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??Mw;$T(h,g,_);let{nodesInitialized:x}=JT(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=gT(qw(p,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:Mw,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Fw.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...Rw},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Ak,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:Pw,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Mk=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>DE((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await bre({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...jk({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:i,fitViewQueued:a,zIndexMode:o,nodesSelectionActive:s}=m(),{nodesInitialized:c,hasSelectedNodes:l}=JT(e,t,n,{nodeOrigin:r,nodeExtent:d,elevateNodesOnSelect:i,checkEquality:!0,zIndexMode:o}),u=s&&l;a&&c?(h(),p({nodes:e,nodesInitialized:c,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:u})):p({nodes:e,nodesInitialized:c,nodesSelectionActive:u})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();$T(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=Ure(e,n,r,i,a,o,l);d&&(zre(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=VT(e,o.fromHandle,Vw.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=ZT(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(pD(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(mD(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>hD(e,!0)));return}i(gD(r,new Set([...e]),!0)),a(gD(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>hD(e,!0)));return}a(gD(n,new Set([...e]))),i(gD(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(hD(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(hD(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,hD(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,hD(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();(e[0][0]!==o[0][0]||e[0][1]!==o[0][1]||e[1][0]!==o[1][0]||e[1][1]!==o[1][1])&&(JT(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return Wre({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...Rw}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...jk()})}},Object.is);function Nk({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,Y.useState)(()=>Mk({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,X.jsx)(AE,{value:m,children:(0,X.jsx)(OD,{children:(0,X.jsx)($D,{children:p})})})}function Pk({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,Y.useContext)(kE)?(0,X.jsx)(X.Fragment,{children:e}):(0,X.jsx)(Nk,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var Fk={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function Ik({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onNodesDelete:E,onEdgesDelete:D,onDelete:O,onSelectionChange:k,onSelectionDragStart:A,onSelectionDrag:j,onSelectionDragStop:M,onSelectionContextMenu:N,onSelectionStart:P,onSelectionEnd:F,onBeforeDelete:I,connectionMode:L,connectionLineType:R=zw.Bezier,connectionLineStyle:z,connectionLineComponent:B,connectionLineContainerStyle:V,deleteKeyCode:H=`Backspace`,selectionKeyCode:U=`Shift`,selectionOnDrag:W=!1,selectionMode:G=Lw.Full,panActivationKeyCode:K=`Space`,multiSelectionKeyCode:q=_T()?`Meta`:`Control`,zoomActivationKeyCode:J=_T()?`Meta`:`Control`,snapToGrid:ee,snapGrid:te,onlyRenderVisibleElements:ne=!1,selectNodesOnDrag:re,nodesDraggable:ie,autoPanOnNodeFocus:ae,nodesConnectable:oe,nodesFocusable:se,nodeOrigin:ce=QE,edgesFocusable:le,edgesReconnectable:ue,elementsSelectable:de=!0,defaultViewport:fe=$E,minZoom:pe=.5,maxZoom:me=2,translateExtent:he=Mw,preventScrolling:ge=!0,nodeExtent:_e,defaultMarkerColor:ve=`#b1b1b7`,zoomOnScroll:ye=!0,zoomOnPinch:be=!0,panOnScroll:xe=!1,panOnScrollSpeed:Se=.5,panOnScrollMode:Ce=Iw.Free,zoomOnDoubleClick:we=!0,panOnDrag:Te=!0,onPaneClick:Ee,onPaneMouseEnter:De,onPaneMouseMove:Oe,onPaneMouseLeave:ke,onPaneScroll:Ae,onPaneContextMenu:je,paneClickDistance:Me=1,nodeClickDistance:Ne=0,children:Pe,onReconnect:Fe,onReconnectStart:Ie,onReconnectEnd:Le,onEdgeContextMenu:Re,onEdgeDoubleClick:ze,onEdgeMouseEnter:Be,onEdgeMouseMove:Ve,onEdgeMouseLeave:He,reconnectRadius:Ue=10,onNodesChange:We,onEdgesChange:Ge,noDragClassName:Ke=`nodrag`,noWheelClassName:qe=`nowheel`,noPanClassName:Je=`nopan`,fitView:Ye,fitViewOptions:Xe,connectOnClick:Ze,attributionPosition:Qe,proOptions:$e,defaultEdgeOptions:et,elevateNodesOnSelect:tt=!0,elevateEdgesOnSelect:nt=!1,disableKeyboardA11y:rt=!1,autoPanOnConnect:it,autoPanOnNodeDrag:at,autoPanOnSelection:ot=!0,autoPanSpeed:st,connectionRadius:ct,isValidConnection:lt,onError:ut,style:dt,id:ft,nodeDragThreshold:pt,connectionDragThreshold:mt,viewport:ht,onViewportChange:gt,width:_t,height:vt,colorMode:yt=`light`,debug:bt,onScroll:xt,ariaLabelConfig:St,zIndexMode:Ct=`basic`,...wt},Tt){let Et=ft||`1`,Dt=aD(yt),Ot=(0,Y.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),xt?.(e)},[xt]);return(0,X.jsx)(`div`,{"data-testid":`rf__wrapper`,...wt,onScroll:Ot,style:{...dt,...Fk},ref:Tt,className:ib([`react-flow`,i,Dt]),id:ft,role:`application`,children:(0,X.jsxs)(Pk,{nodes:e,edges:t,width:_t,height:vt,fitView:Ye,fitViewOptions:Xe,minZoom:pe,maxZoom:me,nodeOrigin:ce,nodeExtent:_e,zIndexMode:Ct,children:[(0,X.jsx)(rD,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:ie,autoPanOnNodeFocus:ae,nodesConnectable:oe,nodesFocusable:se,edgesFocusable:le,edgesReconnectable:ue,elementsSelectable:de,elevateNodesOnSelect:tt,elevateEdgesOnSelect:nt,minZoom:pe,maxZoom:me,nodeExtent:_e,onNodesChange:We,onEdgesChange:Ge,snapToGrid:ee,snapGrid:te,connectionMode:L,translateExtent:he,connectOnClick:Ze,defaultEdgeOptions:et,fitView:Ye,fitViewOptions:Xe,onNodesDelete:E,onEdgesDelete:D,onDelete:O,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onSelectionDrag:j,onSelectionDragStart:A,onSelectionDragStop:M,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:Je,nodeOrigin:ce,rfId:Et,autoPanOnConnect:it,autoPanOnNodeDrag:at,autoPanSpeed:st,onError:ut,connectionRadius:ct,isValidConnection:lt,selectNodesOnDrag:re,nodeDragThreshold:pt,connectionDragThreshold:mt,onBeforeDelete:I,debug:bt,ariaLabelConfig:St,zIndexMode:Ct}),(0,X.jsx)(kk,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:R,connectionLineStyle:z,connectionLineComponent:B,connectionLineContainerStyle:V,selectionKeyCode:U,selectionOnDrag:W,selectionMode:G,deleteKeyCode:H,multiSelectionKeyCode:q,panActivationKeyCode:K,zoomActivationKeyCode:J,onlyRenderVisibleElements:ne,defaultViewport:fe,translateExtent:he,minZoom:pe,maxZoom:me,preventScrolling:ge,zoomOnScroll:ye,zoomOnPinch:be,zoomOnDoubleClick:we,panOnScroll:xe,panOnScrollSpeed:Se,panOnScrollMode:Ce,panOnDrag:Te,autoPanOnSelection:ot,onPaneClick:Ee,onPaneMouseEnter:De,onPaneMouseMove:Oe,onPaneMouseLeave:ke,onPaneScroll:Ae,onPaneContextMenu:je,paneClickDistance:Me,nodeClickDistance:Ne,onSelectionContextMenu:N,onSelectionStart:P,onSelectionEnd:F,onReconnect:Fe,onReconnectStart:Ie,onReconnectEnd:Le,onEdgeContextMenu:Re,onEdgeDoubleClick:ze,onEdgeMouseEnter:Be,onEdgeMouseMove:Ve,onEdgeMouseLeave:He,reconnectRadius:Ue,defaultMarkerColor:ve,noDragClassName:Ke,noWheelClassName:qe,noPanClassName:Je,rfId:Et,disableKeyboardA11y:rt,nodeExtent:_e,viewport:ht,onViewportChange:gt,nodesDraggable:ie}),(0,X.jsx)(ZE,{onSelectionChange:k}),Pe,(0,X.jsx)(GE,{proOptions:$e,position:Qe}),(0,X.jsx)(HE,{rfId:Et,disableKeyboardA11y:rt})]})})}var Lk=CD(Ik),Rk=e=>e.domNode?.querySelector(`.react-flow__edgelabel-renderer`);function zk({children:e}){let t=ME(Rk);return t?(0,Xi.createPortal)(e,t):null}function Bk(){let e=NE();return(0,Y.useCallback)(t=>{let{domNode:n,updateNodeInternals:r}=e.getState(),i=Array.isArray(t)?t:[t],a=new Map;i.forEach(e=>{let t=n?.querySelector(`.react-flow__node[data-id="${e}"]`);t&&a.set(e,{id:e,nodeElement:t,force:!0})}),requestAnimationFrame(()=>r(a,{triggerFitView:!1}))},[])}jw.error014();function Vk(e){return ME((0,Y.useCallback)(t=>t.nodeLookup.get(e),[e]),OE)}function Hk({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,X.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ib([`react-flow__background-pattern`,n,r])})}function Uk({radius:e,className:t}){return(0,X.jsx)(`circle`,{cx:e,cy:e,r:e,className:ib([`react-flow__background-pattern`,`dots`,t])})}var Wk;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(Wk||={});var Gk={[Wk.Dots]:1,[Wk.Lines]:1,[Wk.Cross]:6},Kk=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function qk({id:e,variant:t=Wk.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,Y.useRef)(null),{transform:f,patternId:p}=ME(Kk,OE),m=r||Gk[t],h=t===Wk.Dots,g=t===Wk.Cross,_=Array.isArray(n)?n:[n,n],v=[_[0]*f[2]||1,_[1]*f[2]||1],y=m*f[2],b=Array.isArray(a)?a:[a,a],x=g?[y,y]:v,S=[b[0]*f[2]||1+x[0]/2,b[1]*f[2]||1+x[1]/2],C=`${p}${e||``}`;return(0,X.jsxs)(`svg`,{className:ib([`react-flow__background`,l]),style:{...c,...ID,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,X.jsx)(`pattern`,{id:C,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${S[0]},-${S[1]})`,children:h?(0,X.jsx)(Uk,{radius:y/2,className:u}):(0,X.jsx)(Hk,{dimensions:x,lineWidth:i,variant:t,className:u})}),(0,X.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${C})`})]})}qk.displayName=`Background`;var Jk=(0,Y.memo)(qk);function Yk(){return(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,X.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function Xk(){return(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,X.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function Zk(){return(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,X.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function Qk(){return(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,X.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function $k(){return(0,X.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,X.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function eA({children:e,className:t,...n}){return(0,X.jsx)(`button`,{type:`button`,className:ib([`react-flow__controls-button`,t]),...n,children:e})}var tA=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function nA({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=NE(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=ME(tA,OE),{zoomIn:y,zoomOut:b,fitView:x}=jD();return(0,X.jsxs)(UE,{className:ib([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(eA,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,X.jsx)(Yk,{})}),(0,X.jsx)(eA,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,X.jsx)(Xk,{})})]}),n&&(0,X.jsx)(eA,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,X.jsx)(Zk,{})}),r&&(0,X.jsx)(eA,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,X.jsx)($k,{}):(0,X.jsx)(Qk,{})}),u]})}nA.displayName=`Controls`,(0,Y.memo)(nA);function rA({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,X.jsx)(`rect`,{className:ib([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var iA=(0,Y.memo)(rA),aA=e=>e.nodes.map(e=>e.id),oA=e=>e instanceof Function?e:()=>e;function sA({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=iA,onClick:o}){let s=ME(aA,OE),c=oA(t),l=oA(e),u=oA(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,X.jsx)(X.Fragment,{children:s.map(e=>(0,X.jsx)(lA,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function cA({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=ME(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=yT(r);return{node:r,x:i,y:a,width:o,height:s}},OE);return!l||l.hidden||!bT(l)?null:(0,X.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var lA=(0,Y.memo)(cA),uA=(0,Y.memo)(sA),dA=200,fA=150,pA=e=>!e.hidden,mA=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?oT(qw(e.nodeLookup,{filter:pA}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},hA=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,gA=(e,t)=>hA(e.viewBB,t.viewBB)&&hA(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,_A=`react-flow__minimap-desc`;function vA({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_,inversePan:v,zoomStep:y=1,offsetScale:b=5}){let x=NE(),S=(0,Y.useRef)(null),{boundingRect:C,viewBB:w,rfId:T,panZoom:E,translateExtent:D,flowWidth:O,flowHeight:k,ariaLabelConfig:A}=ME(mA,gA),j=e?.width??dA,M=e?.height??fA,N=C.width/j,P=C.height/M,F=Math.max(N,P),I=F*j,L=F*M,R=b*F,z=C.x-(I-C.width)/2-R,B=C.y-(L-C.height)/2-R,V=I+R*2,H=L+R*2,U=`${_A}-${T}`,W=(0,Y.useRef)(0),G=(0,Y.useRef)();W.current=F,(0,Y.useEffect)(()=>{if(S.current&&E)return G.current=$re({domNode:S.current,panZoom:E,getTransform:()=>x.getState().transform,getViewScale:()=>W.current}),()=>{G.current?.destroy()}},[E]),(0,Y.useEffect)(()=>{G.current?.update({translateExtent:D,width:O,height:k,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,D,O,k]);let K=p?e=>{let[t,n]=G.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,q=m?(0,Y.useCallback)((e,t)=>{let n=x.getState().nodeLookup.get(t).internals.userNode;m(e,n)},[]):void 0,J=_??A[`minimap.ariaLabel`];return(0,X.jsx)(UE,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*F:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:ib([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,X.jsxs)(`svg`,{width:j,height:M,viewBox:`${z} ${B} ${V} ${H}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":U,ref:S,onClick:K,children:[J&&(0,X.jsx)(`title`,{id:U,children:J}),(0,X.jsx)(uA,{onClick:q,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,X.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${z-R},${B-R}h${V+R*2}v${H+R*2}h${-V-R*2}z
20
+ M${w.x},${w.y}h${w.width}v${w.height}h${-w.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}vA.displayName=`MiniMap`;var yA=(0,Y.memo)(vA),bA=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,xA={[mE.Line]:`right`,[mE.Handle]:`bottom-right`};function SA({nodeId:e,position:t,variant:n=mE.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let v=XD(),y=typeof e==`string`?e:v,b=NE(),x=(0,Y.useRef)(null),S=n===mE.Handle,C=ME((0,Y.useCallback)(bA(S&&p),[S,p]),OE),w=(0,Y.useRef)(null),T=t??xA[n];(0,Y.useEffect)(()=>{if(!(!x.current||!y))return w.current||=fie({domNode:x.current,nodeId:y,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=b.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=b.getState(),o=[],s={x:e.x,y:e.y},c=r.get(y);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=ZT([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...xT({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:y,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:y,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:y,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};b.getState().triggerNodeChanges([n])}}),w.current.update({controlPosition:T,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{w.current?.destroy()}},[T,s,c,l,u,d,h,g,_,m]);let E=T.split(`-`);return(0,X.jsx)(`div`,{className:ib([`react-flow__resize-control`,`nodrag`,...E,n,r]),ref:x,style:{...i,scale:C,...o&&{[S?`backgroundColor`:`borderColor`]:o}},children:a})}(0,Y.memo)(SA);function CA(e){return`init`in e}function wA(e){return typeof e.write==`function`}function TA(e){return!!e.onMount}function EA(e){return`v`in e||`e`in e}function DA(e){if(`e`in e)throw e.e;return e.v}function OA(e){return typeof e?.then==`function`}function kA(e){if(!(e instanceof Error))return!1;let t=e.name,n=e.message.toLowerCase();return(t===`RangeError`||t===`InternalError`)&&(n.includes(`call stack`)||n.includes(`too much recursion`)||n.includes(`stack overflow`))}function AA(e,t,n){if(!n.p.has(e)){n.p.add(e);let r=()=>n.p.delete(e);t.then(r,r)}}function jA(e,t,n){let r=n.get(e)?.t,i=t.p;if(!r?.size)return i;if(!i.size)return r;let a=new Set(r);for(let e of i)a.add(e);return a}function MA(e){return!!e.INTERNAL_onInit}var NA=(e,t,n,...r)=>n.read(...r),PA=(e,t,n,...r)=>n.write(...r),FA=(e,t,n)=>n.INTERNAL_onInit(t),IA=(e,t,n,r)=>n.onMount?.call(n,r),LA=(e,t,n)=>{var r;let i=e[0],a=i.get(n);if(!a){let o=e[6],s=e[9];a={d:new Map,p:new Set,n:0},i.set(n,a),(r=o.i)==null||r.call(o,n),MA(n)&&s(e,t,n)}return a},RA=(e,t)=>{let n=e[1],r=e[3],i=e[4],a=e[5],o=e[6],s=e[13];if(!o.f&&!r.size&&!i.size&&!a.size)return;let c=[],l=e=>{try{e()}catch(e){c.push(e)}};do{o.f&&l(o.f);let c=new Set;for(let e of r){let t=n.get(e)?.l;if(t)for(let e of t)c.add(e)}r.clear();for(let e of a)c.add(e);a.clear();for(let e of i)c.add(e);i.clear();for(let e of c)l(e);r.size&&s(e,t)}while(r.size||a.size||i.size);if(c.length)throw AggregateError(c)},zA=(e,t)=>{let n=e[1],r=e[2],i=e[3],a=e[11],o=e[14],s=e[17];if(!i.size)return;let c=[],l=[],u=new WeakSet,d=new WeakSet,f=[],p=[];for(let n of i)f.push(n),p.push(a(e,t,n));for(;f.length;){let i=f.length-1,o=f[i],s=p[i];if(d.has(o)){f.pop(),p.pop();continue}if(u.has(o)){r.get(o)===s.n&&(c.push(o),l.push(s)),d.add(o),f.pop(),p.pop();continue}u.add(o);for(let r of jA(o,s,n))u.has(r)||(f.push(r),p.push(a(e,t,r)))}for(let n=c.length-1;n>=0;--n){let a=c[n],u=l[n],d=!1;for(let e of u.d.keys())if(e!==a&&i.has(e)){d=!0;break}d&&(r.set(a,u.n),o(e,t,a),s(e,t,a)),r.delete(a)}},BA=(e,t,n)=>{var r,i;let a=e[1],o=e[2],s=e[3],c=e[6],l=e[7],u=e[11],d=e[12],f=e[13],p=e[14],m=e[16],h=e[17],g=e[20],_=e[26],v=e[28],y=u(e,t,n),b=v[0];if(EA(y)){if(a.has(n)&&o.get(n)!==y.n||y.m===b)return y.m=b,y;let r=!1;for(let[n,i]of y.d)if(p(e,t,n).n!==i){r=!0;break}if(!r)return y.m=b,y}let x=!0,S=new Set(y.d.keys()),C=()=>{for(let e of S)y.d.delete(e)},w=()=>{if(a.has(n)){let r=!s.size;h(e,t,n),r&&(f(e,t),d(e,t))}},T=r=>{var i;if(r===n){let n=u(e,t,r);if(!EA(n)){if(CA(r))g(e,t,r,r.init);else throw Error(`no atom init`)}return DA(n)}let o=p(e,t,r);try{return DA(o)}finally{S.delete(r),y.d.set(r,o.n),OA(y.v)&&AA(n,y.v,o),a.has(n)&&((i=a.get(r))==null||i.t.add(n)),x||w()}},E,D,O={get signal(){return E||=new AbortController,E.signal},get setSelf(){return!D&&wA(n)&&(D=(...r)=>{if(!x)try{return m(e,t,n,r)}finally{f(e,t),d(e,t)}}),D}},k=y.n,A=o.get(n)===k;try{let i=l(e,t,n,T,O);if(g(e,t,n,i),OA(i)){_(e,t,i,()=>E?.abort());let n=()=>{C(),w()};i.then(n,n)}else C();return(r=c.r)==null||r.call(c,n),y.m=b,y}catch(e){if(kA(e))throw e;return delete y.v,y.e=e,++y.n,y.m=b,y}finally{x=!1,y.n!==k&&A&&(o.set(n,y.n),s.add(n),(i=c.c)==null||i.call(c,n))}},VA=(e,t,n)=>{let r=e[1],i=e[2],a=e[11],o=[n];for(;o.length;){let n=o.pop(),s=a(e,t,n);for(let c of jA(n,s,r)){let n=a(e,t,c);i.get(c)!==n.n&&(i.set(c,n.n),o.push(c))}}},HA=(e,t,n,r)=>{let i=e[3],a=e[6],o=e[8],s=e[11],c=e[12],l=e[13],u=e[14],d=e[15],f=e[16],p=e[17],m=e[20],h=e[28],g=!0,_=n=>DA(u(e,t,n)),v=(r,...o)=>{var u;let _=s(e,t,r);try{if(r===n){if(!CA(r))throw Error(`atom not writable`);let n=_.n,s=o[0];m(e,t,r,s),p(e,t,r),n!==_.n&&(++h[0],i.add(r),d(e,t,r),(u=a.c)==null||u.call(a,r));return}return f(e,t,r,o)}finally{g||(l(e,t),c(e,t))}};try{return o(e,t,n,_,v,...r)}finally{g=!1}},UA=(e,t,n)=>{var r;let i=e[1],a=e[3],o=e[6],s=e[11],c=e[15],l=e[18],u=e[19],d=s(e,t,n),f=i.get(n);if(f&&d.d.size>0){for(let[i,u]of d.d)if(!f.d.has(i)){let d=s(e,t,i);l(e,t,i).t.add(n),f.d.add(i),u!==d.n&&(a.add(i),c(e,t,i),(r=o.c)==null||r.call(o,i))}for(let r of f.d)d.d.has(r)||(f.d.delete(r),u(e,t,r)?.t.delete(n))}},WA=(e,t,n)=>{var r;let i=e[1],a=e[4],o=e[6],s=e[10],c=e[11],l=e[12],u=e[13],d=e[14],f=e[16],p=e[18],m=c(e,t,n),h=i.get(n);if(!h){d(e,t,n);for(let r of m.d.keys())p(e,t,r).t.add(n);h={l:new Set,d:new Set(m.d.keys()),t:new Set},i.set(n,h),wA(n)&&TA(n)&&a.add(()=>{let r=!0,i=(...i)=>{try{return f(e,t,n,i)}finally{r||(u(e,t),l(e,t))}};try{let a=s(e,t,n,i);a&&(h.u=()=>{r=!0;try{a()}finally{r=!1}})}finally{r=!1}}),(r=o.m)==null||r.call(o,n)}return h},GA=(e,t,n)=>{var r;let i=e[1],a=e[5],o=e[6],s=e[11],c=e[19],l=s(e,t,n),u=i.get(n);if(!u||u.l.size)return u;let d=!1;for(let e of u.t)if(i.get(e)?.d.has(n)){d=!0;break}if(!d){u.u&&a.add(u.u),u=void 0,i.delete(n);for(let r of l.d.keys())c(e,t,r)?.t.delete(n);(r=o.u)==null||r.call(o,n);return}return u},KA=(e,t,n,r)=>{let i=e[11],a=e[27],o=i(e,t,n),s=`v`in o,c=o.v;if(OA(r))for(let a of o.d.keys())AA(n,r,i(e,t,a));o.v=r,delete o.e,(!s||!Object.is(c,o.v))&&(++o.n,OA(c)&&a(e,t,c))},qA=(e,t,n)=>{let r=e[14];return DA(r(e,t,n))},JA=(e,t,n,...r)=>{let i=e[3],a=e[12],o=e[13],s=e[16],c=i.size;try{return s(e,t,n,r)}finally{i.size!==c&&(o(e,t),a(e,t))}},YA=(e,t,n,r)=>{let i=e[12],a=e[13],o=e[18],s=e[19],c=o(e,t,n).l;return c.add(r),a(e,t),i(e,t),()=>{c.delete(r),s(e,t,n),a(e,t),i(e,t)}},XA=(e,t,n,r)=>{let i=e[25],a=i.get(n);if(!a){a=new Set,i.set(n,a);let e=()=>i.delete(n);n.then(e,e)}a.add(r)},ZA=(e,t,n)=>{e[25].get(n)?.forEach(e=>e())},QA=new WeakMap;function $A(e){let t=QA.get(e),n=t[24];return n?n(t,e):t}function ej(...e){let t={get(e){return r(n,t,e)},set(e,...r){return i(n,t,e,...r)},sub(e,r){return a(n,t,e,r)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},NA,PA,FA,IA,LA,RA,zA,BA,VA,HA,UA,WA,GA,KA,qA,JA,YA,void 0,new WeakMap,XA,ZA,[0]].map((t,n)=>e[n]||t);QA.set(t,Object.freeze(n));let r=n[21],i=n[22],a=n[23];return t}var tj=0;function nj(e,t){let n=`atom${++tj}`,r={toString(){return n}};return typeof e==`function`?r.read=e:(r.init=e,r.read=rj,r.write=ij),t&&(r.write=t),r}function rj(e){return e(this)}function ij(e,t,n){return t(this,typeof n==`function`?n(e(this)):n)}var aj;function oj(){return aj?aj():ej()}var sj;function cj(){return sj||=oj(),sj}var lj=(0,Y.createContext)(void 0);function uj(e){let t=(0,Y.useContext)(lj);return e?.store||t||cj()}function dj({children:e,store:t}){let n=(0,Y.useRef)(null);return t?(0,Y.createElement)(lj.Provider,{value:t},e):(n.current===null&&(n.current=oj()),(0,Y.createElement)(lj.Provider,{value:n.current},e))}var fj=e=>typeof e?.then==`function`,pj=e=>{e.status||(e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}))},mj=Y.use||(e=>{if(e.status===`pending`)throw e;if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:(pj(e),e)}),hj=new WeakMap,gj=(e,t,n)=>{let r=$A(e),i=r[26],a=hj.get(t);return a||(a=new Promise((o,s)=>{let c=t,l=e=>t=>{c===e&&o(t)},u=e=>t=>{c===e&&s(t)},d=()=>{try{let t=n();fj(t)?(hj.set(t,a),c=t,t.then(l(t),u(t)),i(r,e,t,d)):o(t)}catch(e){s(e)}};t.then(l(t),u(t)),i(r,e,t,d)}),hj.set(t,a)),a};function _j(e,t){let{delay:n,unstable_promiseStatus:r=!Y.use}=t||{},i=uj(t),[[a,o,s],c]=(0,Y.useReducer)(t=>{let n=i.get(e);return Object.is(t[0],n)&&t[1]===i&&t[2]===e?t:[n,i,e]},void 0,()=>[i.get(e),i,e]),l=a;if((o!==i||s!==e)&&(c(),l=i.get(e)),(0,Y.useEffect)(()=>{let t=i.sub(e,()=>{if(r)try{let t=i.get(e);fj(t)&&pj(gj(i,t,()=>i.get(e)))}catch{}if(typeof n==`number`){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
21
+
22
+ Migration guide:
23
+
24
+ Create a custom hook like the following.
25
+
26
+ function useAtomValueWithDelay<Value>(
27
+ atom: Atom<Value>,
28
+ options: { delay: number },
29
+ ): Value {
30
+ const { delay } = options
31
+ const store = useStore(options)
32
+ const [value, setValue] = useState(() => store.get(atom))
33
+ useEffect(() => {
34
+ const unsub = store.sub(atom, () => {
35
+ setTimeout(() => setValue(store.get(atom)), delay)
36
+ })
37
+ return unsub
38
+ }, [store, atom, delay])
39
+ return value
40
+ }
41
+ `),setTimeout(c,n);return}c()});return c(),t},[i,e,n,r]),(0,Y.useDebugValue)(l),fj(l)){let t=gj(i,l,()=>i.get(e));return r&&pj(t),mj(t)}return l}function vj(e,t){let n=uj(t);return(0,Y.useCallback)((...t)=>n.set(e,...t),[n,e])}function yj(e,t){return[_j(e,t),vj(e,t)]}var bj=(0,Y.createContext)({});function xj(e){let t=(0,Y.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Sj=typeof window<`u`?Y.useLayoutEffect:Y.useEffect,Cj=(0,Y.createContext)(null);function wj(e,t){e.indexOf(t)===-1&&e.push(t)}function Tj(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var Ej=(e,t,n)=>n>t?t:n<e?e:n,Dj={},Oj=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),kj=e=>typeof e==`object`&&!!e,Aj=e=>/^0[^.\s]+$/u.test(e);function jj(e){let t;return()=>(t===void 0&&(t=e()),t)}var Mj=e=>e,Nj=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Pj=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},Fj=class{constructor(){this.subscriptions=[]}add(e){return wj(this.subscriptions,e),()=>Tj(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},Ij=e=>e*1e3,Lj=e=>e/1e3,Rj=(e,t)=>t?1e3/t*e:0,zj=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Bj=1e-7,Vj=12;function Hj(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=zj(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Bj&&++s<Vj);return o}function Uj(e,t,n,r){if(e===t&&n===r)return Mj;let i=t=>Hj(t,0,1,e,n);return e=>e===0||e===1?e:zj(i(e),t,r)}var Wj=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Gj=e=>t=>1-e(1-t),Kj=Uj(.33,1.53,.69,.99),qj=Gj(Kj),Jj=Wj(qj),Yj=e=>e>=1?1:(e*=2)<1?.5*qj(e):.5*(2-2**(-10*(e-1))),Xj=e=>1-Math.sin(Math.acos(e)),Zj=Gj(Xj),Qj=Wj(Xj),$j=Uj(.42,0,1,1),eM=Uj(0,0,.58,1),tM=Uj(.42,0,.58,1),nM=e=>Array.isArray(e)&&typeof e[0]!=`number`,rM=e=>Array.isArray(e)&&typeof e[0]==`number`,iM={linear:Mj,easeIn:$j,easeInOut:tM,easeOut:eM,circIn:Xj,circInOut:Qj,circOut:Zj,backIn:qj,backInOut:Jj,backOut:Kj,anticipate:Yj},aM=e=>typeof e==`string`,oM=e=>{if(rM(e)){e.length;let[t,n,r,i]=e;return Uj(t,n,r,i)}return aM(e)?(iM[e],`${e}`,iM[e]):e},sM=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function cM(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var lM=40;function uM(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=sM.reduce((e,t)=>(e[t]=cM(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=Dj.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,lM),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:sM.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<sM.length;t++)o[sM[t]].cancel(e)},state:i,steps:o}}var{schedule:dM,cancel:fM,state:pM,steps:mM}=uM(typeof requestAnimationFrame<`u`?requestAnimationFrame:Mj,!0),hM;function gM(){hM=void 0}var _M={now:()=>(hM===void 0&&_M.set(pM.isProcessing||Dj.useManualTiming?pM.timestamp:performance.now()),hM),set:e=>{hM=e,queueMicrotask(gM)}},vM=e=>t=>typeof t==`string`&&t.startsWith(e),yM=vM(`--`),bM=vM(`var(--`),xM=e=>bM(e)?SM.test(e.split(`/*`)[0].trim()):!1,SM=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function CM(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var wM={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},TM={...wM,transform:e=>Ej(0,1,e)},EM={...wM,default:1},DM=e=>Math.round(e*1e5)/1e5,OM=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function kM(e){return e==null}var AM=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,jM=(e,t)=>n=>!!(typeof n==`string`&&AM.test(n)&&n.startsWith(e)||t&&!kM(n)&&Object.prototype.hasOwnProperty.call(n,t)),MM=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(OM);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},NM=e=>Ej(0,255,e),PM={...wM,transform:e=>Math.round(NM(e))},FM={test:jM(`rgb`,`red`),parse:MM(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+PM.transform(e)+`, `+PM.transform(t)+`, `+PM.transform(n)+`, `+DM(TM.transform(r))+`)`};function IM(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var LM={test:jM(`#`),parse:IM,transform:FM.transform},RM=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),zM=RM(`deg`),BM=RM(`%`),VM=RM(`px`),HM=RM(`vh`),UM=RM(`vw`),WM={...BM,parse:e=>BM.parse(e)/100,transform:e=>BM.transform(e*100)},GM={test:jM(`hsl`,`hue`),parse:MM(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+BM.transform(DM(t))+`, `+BM.transform(DM(n))+`, `+DM(TM.transform(r))+`)`},KM={test:e=>FM.test(e)||LM.test(e)||GM.test(e),parse:e=>FM.test(e)?FM.parse(e):GM.test(e)?GM.parse(e):LM.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?FM.transform(e):GM.transform(e),getAnimatableNone:e=>{let t=KM.parse(e);return t.alpha=0,KM.transform(t)}},qM=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function JM(e){return isNaN(e)&&typeof e==`string`&&(e.match(OM)?.length||0)+(e.match(qM)?.length||0)>0}var YM=`number`,XM=`color`,ZM=`var`,QM=`var(`,$M="${}",eN=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function tN(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(eN,e=>(KM.test(e)?(r.color.push(a),i.push(XM),n.push(KM.parse(e))):e.startsWith(QM)?(r.var.push(a),i.push(ZM),n.push(e)):(r.number.push(a),i.push(YM),n.push(parseFloat(e))),++a,$M)).split($M),indexes:r,types:i}}function nN(e){return tN(e).values}function rN({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===YM?DM(r[a]):e===XM?KM.transform(r[a]):r[a]}return i}}function iN(e){return rN(tN(e))}var aN=e=>typeof e==`number`?0:KM.test(e)?KM.getAnimatableNone(e):e,oN=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:aN(e);function sN(e){let t=tN(e);return rN(t)(t.values.map((e,n)=>oN(e,t.split[n])))}var cN={test:JM,parse:nN,createTransformer:iN,getAnimatableNone:sN};function lN(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function uN({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=lN(s,r,e+1/3),a=lN(s,r,e),o=lN(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function dN(e,t){return n=>n>0?t:e}var fN=(e,t,n)=>e+(t-e)*n,pN=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},mN=[LM,FM,GM],hN=e=>mN.find(t=>t.test(e));function gN(e){let t=hN(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===GM&&(n=uN(n)),n}var _N=(e,t)=>{let n=gN(e),r=gN(t);if(!n||!r)return dN(e,t);let i={...n};return e=>(i.red=pN(n.red,r.red,e),i.green=pN(n.green,r.green,e),i.blue=pN(n.blue,r.blue,e),i.alpha=fN(n.alpha,r.alpha,e),FM.transform(i))},vN=new Set([`none`,`hidden`]);function yN(e,t){return vN.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function bN(e,t){return n=>fN(e,t,n)}function xN(e){return typeof e==`number`?bN:typeof e==`string`?xM(e)?dN:KM.test(e)?_N:TN:Array.isArray(e)?SN:typeof e==`object`?KM.test(e)?_N:CN:dN}function SN(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>xN(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function CN(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=xN(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function wN(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var TN=(e,t)=>{let n=cN.createTransformer(t),r=tN(e),i=tN(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?vN.has(e)&&!i.values.length||vN.has(t)&&!r.values.length?yN(e,t):Nj(SN(wN(r,i),i.values),n):(`${e}${t}`,dN(e,t))};function EN(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?fN(e,t,n):xN(e)(e,t)}var DN=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>dM.update(t,e),stop:()=>fM(t),now:()=>pM.isProcessing?pM.timestamp:_M.now()}},ON=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},kN=2e4;function AN(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function jN(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(AN(r),kN);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Lj(i)}}var MN={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function NN(e,t){return e*Math.sqrt(1-t*t)}var PN=12;function FN(e,t,n){let r=n;for(let n=1;n<PN;n++)r-=e(r)/t(r);return r}var IN=.001;function LN({duration:e=MN.duration,bounce:t=MN.bounce,velocity:n=MN.velocity,mass:r=MN.mass}){let i,a;MN.maxDuration;let o=1-t;o=Ej(MN.minDamping,MN.maxDamping,o),e=Ej(MN.minDuration,MN.maxDuration,Lj(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=NN(t,o),c=Math.exp(-i);return IN-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=NN(t**2,o);return(-i(t)+IN>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=FN(i,a,s);if(e=Ij(e),isNaN(c))return{stiffness:MN.stiffness,damping:MN.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var RN=[`duration`,`bounce`],zN=[`stiffness`,`damping`,`mass`];function BN(e,t){return t.some(t=>e[t]!==void 0)}function VN(e){let t={velocity:MN.velocity,stiffness:MN.stiffness,damping:MN.damping,mass:MN.mass,isResolvedFromDuration:!1,...e};if(!BN(e,zN)&&BN(e,RN)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*Ej(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:MN.mass,stiffness:i,damping:a}}else{let n=LN({...e,velocity:0});t={...t,...n,mass:MN.mass},t.isResolvedFromDuration=!0}}return t}function HN(e=MN.visualDuration,t=MN.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=VN({...n,velocity:-Lj(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=Lj(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?MN.restSpeed.granular:MN.restSpeed.default,i||=v?MN.restDelta.granular:MN.restDelta.default;let y,b,x,S,C,w;if(h<1)x=NN(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>Ij(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=Ij(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=Ij(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(AN(T),kN),t=ON(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}HN.applyToOptions=e=>{let t=jN(e,100,HN);return e.ease=t.ease,e.duration=Ij(t.duration),e.type=`keyframes`,e};var UN=5;function WN(e,t,n){let r=Math.max(t-UN,0);return Rj(n-e(r),t-r)}function GN({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=HN({keyframes:[f.value,m(f.value)],velocity:WN(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function KN(e,t,n){let r=[],i=n||Dj.mix||EN,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Nj(Array.isArray(t)?t[n]||Mj:t,a)),r.push(a)}return r}function qN(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=KN(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Pj(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Ej(e[0],e[a-1],t)):l}function JN(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Pj(0,t,r);e.push(fN(n,1,i))}}function YN(e){let t=[0];return JN(t,e.length-1),t}function XN(e,t){return e.map(e=>e*t)}function ZN(e,t){return e.map(()=>t||tM).splice(0,e.length-1)}function QN({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=nM(r)?r.map(oM):oM(r),a={done:!1,value:t[0]},o=qN(XN(n&&n.length===t.length?n:YN(t),e),t,{ease:Array.isArray(i)?i:ZN(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var $N=e=>e!==null;function eP(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter($N),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var tP={decay:GN,inertia:GN,tween:QN,keyframes:QN,spring:HN};function nP(e){typeof e.type==`string`&&(e.type=tP[e.type])}var rP=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},iP=e=>e/100,aP=class extends rP{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==_M.now()&&this.tick(_M.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;nP(e);let{type:t=QN,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||QN;s!==QN&&typeof o[0]!=`number`&&(this.mixKeyframes=Nj(iP,EN(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=AN(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=Ej(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==GN&&(b.value=eP(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return Lj(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Lj(e)}get time(){return Lj(this.currentTime)}set time(e){e=Ij(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return WN(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(_M.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Lj(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=DN,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(_M.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function oP(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var sP=e=>e*180/Math.PI,cP=e=>uP(sP(Math.atan2(e[1],e[0]))),lP={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:cP,rotateZ:cP,skewX:e=>sP(Math.atan(e[1])),skewY:e=>sP(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},uP=e=>(e%=360,e<0&&(e+=360),e),dP=cP,fP=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),pP=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),mP={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:fP,scaleY:pP,scale:e=>(fP(e)+pP(e))/2,rotateX:e=>uP(sP(Math.atan2(e[6],e[5]))),rotateY:e=>uP(sP(Math.atan2(-e[2],e[0]))),rotateZ:dP,rotate:dP,skewX:e=>sP(Math.atan(e[4])),skewY:e=>sP(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function hP(e){return+!!e.includes(`scale`)}function gP(e,t){if(!e||e===`none`)return hP(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=mP,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=lP,i=t}if(!i)return hP(t);let a=r[t],o=i[1].split(`,`).map(vP);return typeof a==`function`?a(o):o[a]}var _P=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return gP(n,t)};function vP(e){return parseFloat(e.trim())}var yP=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],bP=new Set([...yP,`pathRotation`]),xP=e=>e===wM||e===VM,SP=new Set([`x`,`y`,`z`]),CP=yP.filter(e=>!SP.has(e));function wP(e){let t=[];return CP.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var TP={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>gP(t,`x`),y:(e,{transform:t})=>gP(t,`y`)};TP.translateX=TP.x,TP.translateY=TP.y;var EP=new Set,DP=!1,OP=!1,kP=!1;function AP(){if(OP){let e=Array.from(EP).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=wP(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}OP=!1,DP=!1,EP.forEach(e=>e.complete(kP)),EP.clear()}function jP(){EP.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(OP=!0)})}function MP(){kP=!0,jP(),AP(),kP=!1}var NP=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(EP.add(this),DP||(DP=!0,dM.read(jP),dM.resolveKeyframes(AP))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}oP(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),EP.delete(this)}cancel(){this.state===`scheduled`&&(EP.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},PP=e=>e.startsWith(`--`);function FP(e,t,n){PP(t)?e.style.setProperty(t,n):e.style[t]=n}var IP={};function LP(e,t){let n=jj(e);return()=>IP[t]??n()}var RP=LP(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),zP=LP(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),BP=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,VP={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:BP([0,.65,.55,1]),circOut:BP([.55,0,1,.45]),backIn:BP([.31,.01,.66,-.59]),backOut:BP([.33,1.53,.69,.99])};function HP(e,t){if(e)return typeof e==`function`?zP()?ON(e,t):`ease-out`:rM(e)?BP(e):Array.isArray(e)?e.map(e=>HP(e,t)||VP.easeOut):VP[e]}function UP(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=HP(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function WP(e){return typeof e==`function`&&`applyToOptions`in e}function GP({type:e,...t}){return WP(e)&&zP()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var KP=class extends rP{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=GP(e);this.animation=UP(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=eP(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),FP(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Lj(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Lj(e)}get time(){return Lj(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ij(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&RP()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Mj):r(this)}},qP={anticipate:Yj,backInOut:Jj,circInOut:Qj};function JP(e){return e in qP}function YP(e){typeof e.ease==`string`&&JP(e.ease)&&(e.ease=qP[e.ease])}var XP=10,ZP=class extends KP{constructor(e){YP(e),nP(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new aP({...a,autoplay:!1}),s=Math.max(XP,_M.now()-this.startTime),c=Ej(0,XP,s-XP),l=o.sample(s).value,{name:u}=this.options;i&&u&&FP(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},QP=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(cN.test(e)||e===`0`)&&!e.startsWith(`url(`));function $P(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function eF(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=QP(i,t),s=QP(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:$P(e)||(n===`spring`||WP(n))&&r}function tF(e){e.duration=0,e.type=`keyframes`}var nF=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),rF=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function iF(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&rF.test(e[t]))return!0;return!1}var aF=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),oF=jj(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function sF(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return oF()&&n&&(nF.has(n)||aF.has(n)&&iF(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var cF=40,lF=class extends rP{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=_M.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||NP;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=_M.now();let u=!0;eF(e,i,a,o)||(u=!1,(Dj.instantAnimations||!s)&&l?.(eP(e,n,t)),e[0]=e[e.length-1],tF(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>cF?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&sF(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new ZP({...d,element:p})}catch{m=new aP(d)}else m=new aP(d);m.finished.then(()=>{this.notifyFinished()}).catch(Mj),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),MP()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function uF(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var dF=30,fF=e=>!isNaN(parseFloat(e)),pF={current:void 0},mF=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=_M.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=_M.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=fF(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new Fj);let n=this.events[e].add(t);return e===`change`?()=>{n(),dM.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return pF.current&&pF.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=_M.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>dF)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,dF);return Rj(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function hF(e,t){return new mF(e,t)}function gF(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function _F(e,t){let n=e?.[t]??e?.default??e;return n===e?n:gF(n,e)}var mie={type:`spring`,stiffness:500,damping:25,restSpeed:10},hie=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),gie={type:`keyframes`,duration:.8},_ie={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},vie=(e,{keyframes:t})=>t.length>2?gie:bP.has(e)?e.startsWith(`scale`)?hie(t[1]):mie:_ie,yie=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function bie(e){for(let t in e)if(!yie.has(t))return!0;return!1}var vF=(e,t,n,r={},i,a)=>o=>{let s=_F(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Ij(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};bie(s)||Object.assign(u,vie(e,u)),u.duration&&=Ij(u.duration),u.repeatDelay&&=Ij(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(tF(u),u.delay===0&&(d=!0)),(Dj.instantAnimations||Dj.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,tF(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=eP(u.keyframes,s);if(e!==void 0){dM.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new aP(u):new lF(u)},xie=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Sie(e){let t=xie.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function yF(e,t,n=1){`${e}`;let[r,i]=Sie(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Oj(e)?parseFloat(e):e}return xM(i)?yF(i,t,n+1):i}function bF(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function xF(e,t,n,r){if(typeof t==`function`){let[i,a]=bF(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=bF(r);t=t(n===void 0?e.custom:n,i,a)}return t}function SF(e,t,n){let r=e.getProps();return xF(r,t,n===void 0?r.custom:n,e)}var CF=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...yP]),wF=e=>Array.isArray(e);function Cie(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,hF(n))}function wie(e){return wF(e)?e[e.length-1]||0:e}function Tie(e,t){let{transitionEnd:n={},transition:r={},...i}=SF(e,t)||{};i={...i,...n};for(let t in i)Cie(e,t,wie(i[t]))}var TF=e=>!!(e&&e.getVelocity);function Eie(e){return!!(TF(e)&&e.add)}function EF(e,t){let n=e.getValue(`willChange`);if(Eie(n))return n.add(t);if(!n&&Dj.WillChange){let n=new Dj.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function DF(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var OF=`data-`+DF(`framerAppearId`);function kF(e){return e.props[OF]}function Die({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function AF(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?gF(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Die(f,t))continue;let o={delay:n,..._F(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){dM.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=kF(e);if(n){let e=window.MotionHandoffAnimation(n,t,dM);e!==null&&(o.startTime=e,p=!0)}}EF(e,t);let m=l??e.shouldReduceMotion;r.start(vF(t,r,i,m&&CF.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>dM.update(()=>{o&&Tie(e,o)});d.length?Promise.all(d).then(t):t()}return d}function jF(e,t,n={}){let r=SF(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(AF(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Oie(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function Oie(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(jF(c,t,{...o,delay:n+(typeof r==`function`?0:r)+uF(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function kie(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>jF(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=jF(e,t,n);else{let i=typeof t==`function`?SF(e,t,n.custom):t;r=Promise.all(AF(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Aie={test:e=>e===`auto`,parse:e=>e},MF=e=>t=>t.test(e),NF=[wM,VM,BM,zM,UM,HM,Aie],PF=e=>NF.find(MF(e));function jie(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Aj(e)}var Mie=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Nie(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(OM)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Mie.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Pie=/\b([a-z-]*)\(.*?\)/gu,FF={...cN,getAnimatableNone:e=>{let t=e.match(Pie);return t?t.map(Nie).join(` `):e}},IF={...cN,getAnimatableNone:e=>{let t=cN.parse(e);return cN.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},LF={...wM,transform:Math.round},RF={borderWidth:VM,borderTopWidth:VM,borderRightWidth:VM,borderBottomWidth:VM,borderLeftWidth:VM,borderRadius:VM,borderTopLeftRadius:VM,borderTopRightRadius:VM,borderBottomRightRadius:VM,borderBottomLeftRadius:VM,width:VM,maxWidth:VM,height:VM,maxHeight:VM,top:VM,right:VM,bottom:VM,left:VM,inset:VM,insetBlock:VM,insetBlockStart:VM,insetBlockEnd:VM,insetInline:VM,insetInlineStart:VM,insetInlineEnd:VM,padding:VM,paddingTop:VM,paddingRight:VM,paddingBottom:VM,paddingLeft:VM,paddingBlock:VM,paddingBlockStart:VM,paddingBlockEnd:VM,paddingInline:VM,paddingInlineStart:VM,paddingInlineEnd:VM,margin:VM,marginTop:VM,marginRight:VM,marginBottom:VM,marginLeft:VM,marginBlock:VM,marginBlockStart:VM,marginBlockEnd:VM,marginInline:VM,marginInlineStart:VM,marginInlineEnd:VM,fontSize:VM,backgroundPositionX:VM,backgroundPositionY:VM,rotate:zM,pathRotation:zM,rotateX:zM,rotateY:zM,rotateZ:zM,scale:EM,scaleX:EM,scaleY:EM,scaleZ:EM,skew:zM,skewX:zM,skewY:zM,distance:VM,translateX:VM,translateY:VM,translateZ:VM,x:VM,y:VM,z:VM,perspective:VM,transformPerspective:VM,opacity:TM,originX:WM,originY:WM,originZ:VM,zIndex:LF,fillOpacity:TM,strokeOpacity:TM,numOctaves:LF},Fie={...RF,color:KM,backgroundColor:KM,outlineColor:KM,fill:KM,stroke:KM,borderColor:KM,borderTopColor:KM,borderRightColor:KM,borderBottomColor:KM,borderLeftColor:KM,filter:FF,WebkitFilter:FF,mask:IF,WebkitMask:IF},zF=e=>Fie[e],Iie=new Set([FF,IF]);function BF(e,t){let n=zF(e);return Iie.has(n)||(n=cN),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var Lie=new Set([`auto`,`none`,`0`]);function Rie(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Lie.has(t)&&tN(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=BF(n,i)}var zie=class extends NP{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),xM(r))){let i=yF(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!CF.has(n)||e.length!==2)return;let[r,i]=e,a=PF(r),o=PF(i);if(CM(r)!==CM(i)&&TP[n]){this.needsMeasurement=!0;return}if(a!==o){if(xP(a)&&xP(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else TP[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||jie(e[t]))&&n.push(t);n.length&&Rie(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=TP[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=TP[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},VF=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function HF(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var UF=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function WF(e){return kj(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:GF,cancel:Bie}=uM(queueMicrotask,!1),KF={x:!1,y:!1};function qF(){return KF.x||KF.y}function Vie(e){return e===`x`||e===`y`?KF[e]?null:(KF[e]=!0,()=>{KF[e]=!1}):KF.x||KF.y?null:(KF.x=KF.y=!0,()=>{KF.x=KF.y=!1})}function JF(e,t){let n=HF(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Hie(e){return!(e.pointerType===`touch`||qF())}function Uie(e,t,n={}){let[r,i,a]=JF(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!Hie(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var YF=(e,t)=>t?e===t||YF(e,t.parentElement):!1,XF=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Wie=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Gie(e){return Wie.has(e.tagName)||e.isContentEditable===!0}var Kie=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function qie(e){return Kie.has(e.tagName)||e.isContentEditable===!0}var ZF=new WeakSet;function QF(e){return t=>{t.key===`Enter`&&e(t)}}function $F(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Jie=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=QF(()=>{if(ZF.has(n))return;$F(n,`down`);let e=QF(()=>{$F(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>$F(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function eI(e){return XF(e)&&!qF()}var tI=new WeakSet;function Yie(e,t,n={}){let[r,i,a]=JF(e,n),o=e=>{let r=e.currentTarget;if(!eI(e)||tI.has(e))return;ZF.add(r),n.stopPropagation&&tI.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),ZF.has(r)&&ZF.delete(r),eI(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||YF(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),WF(e)&&(e.addEventListener(`focus`,e=>Jie(e,i)),!Gie(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function nI(e){return kj(e)&&`ownerSVGElement`in e}var rI=new WeakMap,iI,aI=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:nI(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Xie=aI(`inline`,`width`,`offsetWidth`),Zie=aI(`block`,`height`,`offsetHeight`);function Qie({target:e,borderBoxSize:t}){rI.get(e)?.forEach(n=>{n(e,{get width(){return Xie(e,t)},get height(){return Zie(e,t)}})})}function $ie(e){e.forEach(Qie)}function eae(){typeof ResizeObserver>`u`||(iI=new ResizeObserver($ie))}function tae(e,t){iI||eae();let n=HF(e);return n.forEach(e=>{let n=rI.get(e);n||(n=new Set,rI.set(e,n)),n.add(t),iI?.observe(e)}),()=>{n.forEach(e=>{let n=rI.get(e);n?.delete(t),n?.size||iI?.unobserve(e)})}}var oI=new Set,sI;function nae(){sI=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};oI.forEach(t=>t(e))},window.addEventListener(`resize`,sI)}function rae(e){return oI.add(e),sI||nae(),()=>{oI.delete(e),!oI.size&&typeof sI==`function`&&(window.removeEventListener(`resize`,sI),sI=void 0)}}function cI(e,t){return typeof e==`function`?rae(e):tae(e,t)}var lI={value:null,addProjectionMetrics:null};function iae(e){return nI(e)&&e.tagName===`svg`}var aae=[...NF,KM,cN],oae=e=>aae.find(MF(e)),uI=()=>({translate:0,scale:1,origin:0,originPoint:0}),dI=()=>({x:uI(),y:uI()}),fI=()=>({min:0,max:0}),pI=()=>({x:fI(),y:fI()}),sae=new WeakMap;function mI(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function hI(e){return typeof e==`string`||Array.isArray(e)}var gI=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],_I=[`initial`,...gI];function vI(e){return mI(e.animate)||_I.some(t=>hI(e[t]))}function yI(e){return!!(vI(e)||e.variants)}function cae(e,t,n){for(let r in t){let i=t[r],a=n[r];if(TF(i))e.addValue(r,i);else if(TF(a))e.addValue(r,hF(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,hF(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var bI={current:null},xI={current:!1},lae=typeof window<`u`;function SI(){if(xI.current=!0,lae){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>bI.current=e.matches;e.addEventListener(`change`,t),t()}else bI.current=!1}}var CI=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],wI={};function TI(e){wI=e}function uae(){return wI}var dae=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=NP,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=_M.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,dM.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=vI(t),this.isVariantNode=yI(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&TF(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,sae.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(xI.current||SI(),this.shouldReduceMotion=bI.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),fM(this.notifyUpdate),fM(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&nF.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new KP({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Ij(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=bP.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&dM.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in wI){let t=wI[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):pI()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<CI.length;t++){let n=CI[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=cae(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=hF(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Oj(n)||Aj(n))?n=parseFloat(n):!oae(n)&&cN.test(t)&&(n=BF(e,t)),this.setBaseTarget(e,TF(n)?n.get():n)),TF(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=xF(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!TF(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Fj),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){GF.render(this.render)}},EI=class extends dae{constructor(){super(...arguments),this.KeyframeResolver=zie}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;TF(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},DI=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function OI({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function fae({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function pae(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function kI(e){return e===void 0||e===1}function AI({scale:e,scaleX:t,scaleY:n}){return!kI(e)||!kI(t)||!kI(n)}function jI(e){return AI(e)||MI(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function MI(e){return NI(e.x)||NI(e.y)}function NI(e){return e&&e!==`0%`}function PI(e,t,n){return n+t*(e-n)}function FI(e,t,n,r,i){return i!==void 0&&(e=PI(e,i,r)),PI(e,n,r)+t}function II(e,t=0,n=1,r,i){e.min=FI(e.min,t,n,r,i),e.max=FI(e.max,t,n,r,i)}function LI(e,{x:t,y:n}){II(e.x,t.translate,t.scale,t.originPoint),II(e.y,n.translate,n.scale,n.originPoint)}var RI=.999999999999,zI=1.0000000000001;function mae(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(BI(e.x,-a.scroll.offset.x),BI(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,LI(e,o)),r&&jI(a.latestValues)&&UI(e,a.latestValues,a.layout?.layoutBox))}t.x<zI&&t.x>RI&&(t.x=1),t.y<zI&&t.y>RI&&(t.y=1)}function BI(e,t){e.min+=t,e.max+=t}function VI(e,t,n,r,i=.5){II(e,t,n,fN(e.min,e.max,i),r)}function HI(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function UI(e,t,n){let r=n??e;VI(e.x,HI(t.x,r.x),t.scaleX,t.scale,t.originX),VI(e.y,HI(t.y,r.y),t.scaleY,t.scale,t.originY)}function WI(e,t){return OI(pae(e.getBoundingClientRect(),t))}function hae(e,t,n){let r=WI(e,n),{scroll:i}=t;return i&&(BI(r.x,i.offset.x),BI(r.y,i.offset.y)),r}var gae={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},_ae=yP.length;function vae(e,t,n){let r=``,i=!0;for(let a=0;a<_ae;a++){let o=yP[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=UF(s,RF[o]);if(!c){i=!1;let t=gae[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${UF(a,RF.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function GI(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(bP.has(e)){o=!0;continue}if(yM(e)){i[e]=n;continue}{let t=UF(n,RF[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=vae(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function KI(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function qI(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var JI={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(VM.test(e))e=parseFloat(e);else return e}return`${qI(e,t.target.x)}% ${qI(e,t.target.y)}%`}},yae={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=cN.parse(e);if(i.length>5)return r;let a=cN.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=fN(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},YI={borderRadius:{...JI,applyTo:[...VF]},borderTopLeftRadius:JI,borderTopRightRadius:JI,borderBottomLeftRadius:JI,borderBottomRightRadius:JI,boxShadow:yae};function XI(e,{layout:t,layoutId:n}){return bP.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!YI[e]||e===`opacity`)}function ZI(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(TF(r[t])||i&&TF(i[t])||XI(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function bae(e){return window.getComputedStyle(e)}var xae=class extends EI{constructor(){super(...arguments),this.type=`html`,this.renderInstance=KI}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(bP.has(t))return this.projection?.isProjecting?hP(t):_P(e,t);{let n=bae(e),r=(yM(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return WI(e,t)}build(e,t,n){GI(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return ZI(e,t,n)}},Sae={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Cae={offset:`strokeDashoffset`,array:`strokeDasharray`};function wae(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Sae:Cae;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Tae=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function QI(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(GI(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Tae)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&wae(d,i,a,o,!1)}var $I=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),eL=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Eae(e,t,n,r){KI(e,t,void 0,r);for(let n in t.attrs)e.setAttribute($I.has(n)?n:DF(n),t.attrs[n])}function tL(e,t,n){let r=ZI(e,t,n);for(let n in e)if(TF(e[n])||TF(t[n])){let t=yP.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Dae=class extends EI{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=pI}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(bP.has(t)){let e=zF(t);return e&&e.default||0}return t=$I.has(t)?t:DF(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return tL(e,t,n)}build(e,t,n){QI(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Eae(e,t,n,r)}mount(e){this.isSVGTag=eL(e.tagName),super.mount(e)}},Oae=_I.length;function nL(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&nL(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<Oae;n++){let r=_I[n],i=e.props[r];(hI(i)||i===!1)&&(t[r]=i)}return t}function rL(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var kae=[...gI].reverse(),Aae=gI.length;function jae(e){return t=>Promise.all(t.map(({animation:t,options:n})=>kie(e,t,n)))}function Mae(e){let t=jae(e),n=aL(),r=!0,i=!1,a=t=>(n,r)=>{let i=SF(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=nL(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Aae;t++){let p=kae[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=hI(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||mI(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Nae(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=wF(t)&&wF(n)?!rL(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=SF(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=uF(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=SF(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=aL(),i=!0}}}function Nae(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!rL(t,e):!1}function iL(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function aL(){return{animate:iL(!0),whileInView:iL(),whileHover:iL(),whileTap:iL(),whileDrag:iL(),whileFocus:iL(),exit:iL()}}function oL(e,t){e.min=t.min,e.max=t.max}function sL(e,t){oL(e.x,t.x),oL(e.y,t.y)}function cL(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Pae=.9999,Fae=1.0001,Iae=-.01,Lae=.01;function lL(e){return e.max-e.min}function Rae(e,t,n){return Math.abs(e-t)<=n}function uL(e,t,n,r=.5){e.origin=r,e.originPoint=fN(t.min,t.max,e.origin),e.scale=lL(n)/lL(t),e.translate=fN(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Pae&&e.scale<=Fae||isNaN(e.scale))&&(e.scale=1),(e.translate>=Iae&&e.translate<=Lae||isNaN(e.translate))&&(e.translate=0)}function dL(e,t,n,r){uL(e.x,t.x,n.x,r?r.originX:void 0),uL(e.y,t.y,n.y,r?r.originY:void 0)}function fL(e,t,n,r=0){e.min=(r?fN(n.min,n.max,r):n.min)+t.min,e.max=e.min+lL(t)}function zae(e,t,n,r){fL(e.x,t.x,n.x,r?.x),fL(e.y,t.y,n.y,r?.y)}function pL(e,t,n,r=0){let i=r?fN(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+lL(t)}function mL(e,t,n,r){pL(e.x,t.x,n.x,r?.x),pL(e.y,t.y,n.y,r?.y)}function hL(e,t,n,r,i){return e-=t,e=PI(e,1/n,r),i!==void 0&&(e=PI(e,1/i,r)),e}function Bae(e,t=0,n=1,r=.5,i,a=e,o=e){if(BM.test(t)&&(t=parseFloat(t),t=fN(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=fN(a.min,a.max,r);e===a&&(s-=t),e.min=hL(e.min,t,n,s,i),e.max=hL(e.max,t,n,s,i)}function gL(e,t,[n,r,i],a,o){Bae(e,t[n],t[r],t[i],t.scale,a,o)}var Vae=[`x`,`scaleX`,`originX`],Hae=[`y`,`scaleY`,`originY`];function _L(e,t,n,r){gL(e.x,t,Vae,n?n.x:void 0,r?r.x:void 0),gL(e.y,t,Hae,n?n.y:void 0,r?r.y:void 0)}function vL(e){return e.translate===0&&e.scale===1}function yL(e){return vL(e.x)&&vL(e.y)}function bL(e,t){return e.min===t.min&&e.max===t.max}function Uae(e,t){return bL(e.x,t.x)&&bL(e.y,t.y)}function xL(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function SL(e,t){return xL(e.x,t.x)&&xL(e.y,t.y)}function CL(e){return lL(e.x)/lL(e.y)}function wL(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function TL(e){return[e(`x`),e(`y`)]}function Wae(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Gae=VF.length,EL=e=>typeof e==`string`?parseFloat(e):e,DL=e=>typeof e==`number`||VM.test(e);function Kae(e,t,n,r,i,a){i?(e.opacity=fN(0,n.opacity??1,qae(r)),e.opacityExit=fN(t.opacity??1,0,Jae(r))):a&&(e.opacity=fN(t.opacity??1,n.opacity??1,r));for(let i=0;i<Gae;i++){let a=VF[i],o=OL(t,a),s=OL(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||DL(o)===DL(s)?(e[a]=Math.max(fN(EL(o),EL(s),r),0),(BM.test(s)||BM.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=fN(t.rotate||0,n.rotate||0,r))}function OL(e,t){return e[t]===void 0?e.borderRadius:e[t]}var qae=kL(0,.5,Zj),Jae=kL(.5,.95,Mj);function kL(e,t,n){return r=>r<e?0:r>t?1:n(Pj(e,t,r))}function Yae(e,t,n){let r=TF(e)?e:hF(e);return r.start(vF(``,r,t,n)),r.animation}function AL(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Xae=(e,t)=>e.depth-t.depth,Zae=class{constructor(){this.children=[],this.isDirty=!1}add(e){wj(this.children,e),this.isDirty=!0}remove(e){Tj(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Xae),this.isDirty=!1,this.children.forEach(e)}};function Qae(e,t){let n=_M.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(fM(r),e(a-t))};return dM.setup(r,!0),()=>fM(r)}function jL(e){return TF(e)?e.get():e}var $ae=class{constructor(){this.members=[]}add(e){wj(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(Tj(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Tj(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},ML={hasAnimatedSinceResize:!0,hasEverUpdated:!1},NL={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},PL=[``,`X`,`Y`,`Z`],eoe=1e3,toe=0;function FL(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function IL(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=kF(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,dM,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&IL(r)}function LL({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=toe++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,lI.value&&(NL.nodes=NL.calculatedTargetDeltas=NL.calculatedProjections=0),this.nodes.forEach(ioe),this.nodes.forEach(uoe),this.nodes.forEach(doe),this.nodes.forEach(aoe),lI.addProjectionMetrics&&lI.addProjectionMetrics(NL)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Zae)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Fj),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=nI(t)&&!iae(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;dM.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=Qae(i,250),ML.hasAnimatedSinceResize&&(ML.hasAnimatedSinceResize=!1,this.nodes.forEach(BL)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||goe,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!SL(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={..._F(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||BL(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),fM(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(foe),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&IL(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(soe),this.nodes.forEach(RL);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(zL);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(coe),this.nodes.forEach(loe),this.nodes.forEach(noe),this.nodes.forEach(roe)):this.nodes.forEach(zL),this.clearAllSnapshots();let e=_M.now();pM.delta=Ej(0,1e3/60,e-pM.timestamp),pM.timestamp=e,pM.isProcessing=!0,mM.update.process(pM),mM.preRender.process(pM),mM.render.process(pM),pM.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,GF.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ooe),this.sharedNodes.forEach(poe)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,dM.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){dM.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!lL(this.snapshot.measuredBox.x)&&!lL(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=pI(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!yL(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||jI(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),_oe(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return pI();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(voe))){let{scroll:e}=this.root;e&&(BI(t.x,e.offset.x),BI(t.y,e.offset.y))}return t}removeElementScroll(e){let t=pI();if(sL(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&sL(t,e),BI(t.x,i.offset.x),BI(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||pI();sL(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(BI(r.x,-n.scroll.offset.x),BI(r.y,-n.scroll.offset.y)),jI(n.latestValues)&&UI(r,n.latestValues,n.layout?.layoutBox)}return jI(this.latestValues)&&UI(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=pI();sL(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!jI(n.latestValues))continue;let r;n.instance&&(AI(n.latestValues)&&n.updateSnapshot(),r=pI(),sL(r,n.measurePageBox())),_L(t,n.latestValues,n.snapshot?.layoutBox,r)}return jI(this.latestValues)&&_L(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==pM.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=pM.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=pI(),this.targetWithTransforms=pI()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zae(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):sL(this.target,this.layout.layoutBox),LI(this.target,this.targetDelta)):sL(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),lI.value&&NL.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||AI(this.parent.latestValues)||MI(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=pI(),this.relativeTargetOrigin=pI(),mL(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),sL(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===pM.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;sL(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;mae(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=pI());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(cL(this.prevProjectionDelta.x,this.projectionDelta.x),cL(this.prevProjectionDelta.y,this.projectionDelta.y)),dL(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!wL(this.projectionDelta.x,this.prevProjectionDelta.x)||!wL(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),lI.value&&NL.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=dI(),this.projectionDelta=dI(),this.projectionDeltaWithTransform=dI()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=dI();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=pI(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(hoe));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=fN(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=fN(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(VL(o.x,e.x,n),VL(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(mL(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),moe(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Uae(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=pI(),sL(f,this.relativeTarget)),c&&(this.animationValues=a,Kae(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(fM(this.pendingAnimation),void 0),this.pendingAnimation=dM.update(()=>{ML.hasAnimatedSinceResize=!0,this.motionValue||=hF(0),this.motionValue.jump(0,!1),this.currentAnimation=Yae(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(eoe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&KL(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||pI();let t=lL(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=lL(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}sL(t,n),UI(t,i),dL(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new $ae),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&FL(`z`,e,r,this.animationValues);for(let t=0;t<PL.length;t++)FL(`rotate${PL[t]}`,e,r,this.animationValues),FL(`skew${PL[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=jL(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=jL(t?.pointerEvents)||``),this.hasProjected&&!jI(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Wae(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in YI){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=YI[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?jL(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(RL),this.root.sharedNodes.clear()}}}function noe(e){e.updateLayout()}function roe(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)TL(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=lL(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;oL(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else KL(i,t.layoutBox,n)&&TL(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=lL(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=dI();dL(o,n,t.layoutBox);let s=dI();a?dL(s,e.applyTransform(r,!0),t.measuredBox):dL(s,n,t.layoutBox);let c=!yL(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=pI();mL(s,t.layoutBox,i.layoutBox,o);let c=pI();mL(c,n,a.layoutBox,o),SL(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function ioe(e){lI.value&&NL.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function aoe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ooe(e){e.clearSnapshot()}function RL(e){e.clearMeasurements()}function soe(e){e.isLayoutDirty=!0,e.updateLayout()}function zL(e){e.isLayoutDirty=!1}function coe(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function loe(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function BL(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function uoe(e){e.resolveTargetDelta()}function doe(e){e.calcProjection()}function foe(e){e.resetSkewAndRotation()}function poe(e){e.removeLeadSnapshot()}function VL(e,t,n){e.translate=fN(t.translate,0,n),e.scale=fN(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function HL(e,t,n,r){e.min=fN(t.min,n.min,r),e.max=fN(t.max,n.max,r)}function moe(e,t,n,r){HL(e.x,t.x,n.x,r),HL(e.y,t.y,n.y,r)}function hoe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var goe={duration:.45,ease:[.4,0,.1,1]},UL=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),WL=UL(`applewebkit/`)&&!UL(`chrome/`)?Math.round:Mj;function GL(e){e.min=WL(e.min),e.max=WL(e.max)}function _oe(e){GL(e.x),GL(e.y)}function KL(e,t,n){return e===`position`||e===`preserve-aspect`&&!Rae(CL(t),CL(n),.2)}function voe(e){return e!==e.root&&e.scroll?.wasRoot}var yoe=LL({attachResizeListener:(e,t)=>AL(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),boe=e=>!e.isLayoutDirty&&e.willUpdate(!1);function xoe(){let e=new Set,t=new WeakMap,n=()=>e.forEach(boe);return{add:r=>{e.add(r),t.set(r,r.addEventListener(`willUpdate`,n))},remove:r=>{e.delete(r);let i=t.get(r);i&&(i(),t.delete(r)),n()},dirty:n}}var qL={current:void 0},JL=LL({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!qL.current){let e=new yoe({});e.mount(window),e.setOptions({layoutScroll:!0}),qL.current=e}return qL.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),YL=(0,Y.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function XL(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Soe(...e){return t=>{let n=!1,r=e.map(e=>{let r=XL(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():XL(e[t],null)}}}}function Coe(...e){return Y.useCallback(Soe(...e),e)}var woe=class extends Y.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(WF(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=WF(e)&&e.offsetWidth||0,r=WF(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function Toe({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,Y.useId)(),s=(0,Y.useRef)(null),c=(0,Y.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,Y.useContext)(YL),u=Coe(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,Y.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
42
+ [data-motion-pop-id="${o}"] {
43
+ position: absolute !important;
44
+ width: ${e}px !important;
45
+ height: ${u}px !important;
46
+ ${_}px !important;
47
+ ${v}px !important;
48
+ }
49
+ `),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,X.jsx)(woe,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:Y.cloneElement(e,{ref:u})})}var Eoe=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=xj(Doe),d=(0,Y.useId)(),f=(0,Y.useRef)(n),p=(0,Y.useRef)(r);Sj(()=>{f.current=n,p.current=r});let m=!0,h=(0,Y.useMemo)(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,Y.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),Y.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,X.jsx)(Toe,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,X.jsx)(Cj.Provider,{value:h,children:e})};function Doe(){return new Map}function ZL(e=!0){let t=(0,Y.useContext)(Cj);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,Y.useId)();(0,Y.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,Y.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var QL=e=>e.key||``;function $L(e){let t=[];return Y.Children.forEach(e,e=>{(0,Y.isValidElement)(e)&&t.push(e)}),t}var Ooe=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=ZL(o),f=(0,Y.useMemo)(()=>$L(e),[e]),p=o&&!u?[]:f.map(QL),m=(0,Y.useRef)(!0),h=(0,Y.useRef)(f),g=xj(()=>new Map),_=(0,Y.useRef)(new Set),[v,y]=(0,Y.useState)(f),[b,x]=(0,Y.useState)(f);Sj(()=>{m.current=!1,h.current=f;for(let e=0;e<b.length;e++){let t=QL(b[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[b,p.length,p.join(`-`)]);let S=[];if(f!==v){let e=[...f];for(let t=0;t<b.length;t++){let n=b[t],r=QL(n);p.includes(r)||(e.splice(t,0,n),S.push(n))}return a===`wait`&&S.length&&(e=S),x($L(e)),y(f),null}let{forceRender:C}=(0,Y.useContext)(bj);return(0,X.jsx)(X.Fragment,{children:b.map(e=>{let v=QL(e),y=o&&!u?!1:f===b||p.includes(v);return(0,X.jsx)(Eoe,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(_.current.has(v))return;if(g.has(v))_.current.add(v),g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(C?.(),x(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})},koe=(0,Y.createContext)(null);function Aoe(){let e=(0,Y.useRef)(!1);return Sj(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function joe(){let e=Aoe(),[t,n]=(0,Y.useState)(0),r=(0,Y.useCallback)(()=>{e.current&&n(t+1)},[t]);return[(0,Y.useCallback)(()=>dM.postRender(r),[r]),t]}var eR=e=>e===!0,Moe=e=>eR(e===!0)||e===`id`,tR=({children:e,id:t,inherit:n=!0})=>{let r=(0,Y.useContext)(bj),i=(0,Y.useContext)(koe),[a,o]=joe(),s=(0,Y.useRef)(null),c=r.id||i;s.current===null&&(Moe(n)&&c&&(t=t?c+`-`+t:c),s.current={id:t,group:eR(n)&&r.group||xoe()});let l=(0,Y.useMemo)(()=>({...s.current,forceRender:a}),[o]);return(0,X.jsx)(bj.Provider,{value:l,children:e})},nR=(0,Y.createContext)({strict:!1}),rR={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},iR=!1;function Noe(){if(iR)return;let e={};for(let t in rR)e[t]={isEnabled:e=>rR[t].some(t=>!!e[t])};TI(e),iR=!0}function aR(){return Noe(),uae()}function Poe(e){let t=aR();for(let n in e)t[n]={...t[n],...e[n]};TI(t)}var Foe=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function oR(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Foe.has(e)}var Ioe=c({default:()=>sR}),sR,Loe=o((()=>{throw sR={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),cR=e=>!oR(e);function Roe(e){typeof e==`function`&&(cR=t=>t.startsWith(`on`)?!oR(t):e(t))}try{Roe((Loe(),d(Ioe)).default)}catch{}function zoe(e,t,n){let r={};for(let i in e)(i!==`values`||typeof e.values!=`object`)&&(TF(e[i])||(cR(i)||n===!0&&oR(i)||!t&&!oR(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]));return r}var lR=(0,Y.createContext)({});function Boe(e,t){if(vI(e)){let{initial:t,animate:n}=e;return{initial:t===!1||hI(t)?t:void 0,animate:hI(n)?n:void 0}}return e.inherit===!1?{}:t}function Voe(e){let{initial:t,animate:n}=Boe(e,(0,Y.useContext)(lR));return(0,Y.useMemo)(()=>({initial:t,animate:n}),[uR(t),uR(n)])}function uR(e){return Array.isArray(e)?e.join(` `):e}var dR=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function fR(e,t,n){for(let r in t)!TF(t[r])&&!XI(r,n)&&(e[r]=t[r])}function Hoe({transformTemplate:e},t){return(0,Y.useMemo)(()=>{let n=dR();return GI(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Uoe(e,t){let n=e.style||{},r={};return fR(r,n,e),Object.assign(r,Hoe(e,t)),r}function Woe(e,t){let n={},r=Uoe(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var pR=()=>({...dR(),attrs:{}});function Goe(e,t,n,r){let i=(0,Y.useMemo)(()=>{let n=pR();return QI(n,t,eL(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};fR(t,e.style,e),i.style={...t,...i.style}}return i}var Koe=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function mR(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Koe.indexOf(e)>-1||/[A-Z]/u.test(e))}function qoe(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??mR(e)?Goe:Woe)(t,r,i,e),c=zoe(t,typeof e==`string`,a),l=e===Y.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,Y.useMemo)(()=>TF(u)?u.get():u,[u]);return(0,Y.createElement)(e,{...l,children:d})}function Joe({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Yoe(n,r,i,e),renderState:t()}}function Yoe(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=jL(a[e]);let{initial:o,animate:s}=e,c=vI(e),l=yI(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!mI(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=xF(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var hR=e=>(t,n)=>{let r=(0,Y.useContext)(lR),i=(0,Y.useContext)(Cj),a=()=>Joe(e,t,r,i);return n?a():xj(a)},Xoe=hR({scrapeMotionValuesFromProps:ZI,createRenderState:dR}),Zoe=hR({scrapeMotionValuesFromProps:tL,createRenderState:pR}),Qoe=Symbol.for(`motionComponentSymbol`);function $oe(e,t,n){let r=(0,Y.useRef)(n);(0,Y.useInsertionEffect)(()=>{r.current=n});let i=(0,Y.useRef)(null);return(0,Y.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var gR=(0,Y.createContext)({});function _R(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function ese(e,t,n,r,i,a){let{visualElement:o}=(0,Y.useContext)(lR),s=(0,Y.useContext)(nR),c=(0,Y.useContext)(Cj),l=(0,Y.useContext)(YL),u=l.reducedMotion,d=l.skipAnimations,f=(0,Y.useRef)(null),p=(0,Y.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,Y.useContext)(gR);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&tse(f.current,n,i,h);let g=(0,Y.useRef)(!1);(0,Y.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[OF],v=(0,Y.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return Sj(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,Y.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function tse(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:vR(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&_R(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function vR(e){if(e)return e.options.allowProjection===!1?vR(e.parent):e.projection}function yR(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Poe(r);let a=n?n===`svg`:mR(e),o=a?Zoe:Xoe;function s(n,s){let c,l={...(0,Y.useContext)(YL),...n,layoutId:nse(n)},{isStatic:u}=l,d=Voe(n),f=o(n,u);if(!u&&typeof window<`u`){rse(l,r);let t=ise(l);c=t.MeasureLayout,d.visualElement=ese(e,f,l,i,t.ProjectionNode,a)}return(0,X.jsxs)(lR.Provider,{value:d,children:[c&&d.visualElement?(0,X.jsx)(c,{visualElement:d.visualElement,...l}):null,qoe(e,n,$oe(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,Y.forwardRef)(s);return c[Qoe]=e,c}function nse({layoutId:e}){let t=(0,Y.useContext)(bj).id;return t&&e!==void 0?t+`-`+e:e}function rse(e,t){(0,Y.useContext)(nR).strict}function ise(e){let{drag:t,layout:n}=aR();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function ase(e,t){if(typeof Proxy>`u`)return yR;let n=new Map,r=(n,r)=>yR(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,yR(a,void 0,e,t)),n.get(a))})}var ose=(e,t)=>t.isSVG??mR(e)?new Dae(t):new xae(t,{allowProjection:e!==Y.Fragment}),sse=class extends DI{constructor(e){super(e),e.animationState||=Mae(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();mI(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},cse=0,lse={animation:{Feature:sse},exit:{Feature:class extends DI{constructor(){super(...arguments),this.id=cse++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=SF(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function bR(e){return{point:{x:e.pageX,y:e.pageY}}}var use=e=>t=>XF(t)&&e(t,bR(t));function xR(e,t,n,r){return AL(e,t,use(n),r)}var SR=({current:e})=>e?e.ownerDocument.defaultView:null,CR=(e,t)=>Math.abs(e-t);function dse(e,t){let n=CR(e.x,t.x),r=CR(e.y,t.y);return Math.sqrt(n**2+r**2)}var wR=new Set([`auto`,`scroll`]),TR=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ER(this.lastRawMoveEventInfo,this.transformPagePoint));let e=OR(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=dse(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=pM;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=ER(t,this.transformPagePoint),dM.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=OR(e.type===`pointercancel`?this.lastMoveEventInfo:ER(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!XF(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=ER(bR(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=pM;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,OR(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Nj(xR(this.contextWindow,`pointermove`,this.handlePointerMove,d),xR(this.contextWindow,`pointerup`,this.handlePointerUp,d),xR(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(wR.has(e.overflowX)||wR.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),dM.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),fM(this.updatePoint)}};function ER(e,t){return t?{point:t(e.point)}:e}function DR(e,t){return{x:e.x-t.x,y:e.y-t.y}}function OR({point:e},t){return{point:e,delta:DR(e,kR(t)),offset:DR(e,fse(t)),velocity:pse(t,.1)}}function fse(e){return e[0]}function kR(e){return e[e.length-1]}function pse(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=kR(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Ij(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Ij(t)*2&&(r=e[1]);let a=Lj(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function mse(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?fN(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?fN(n,e,r.max):Math.min(e,n)),e}function AR(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function hse(e,{top:t,left:n,bottom:r,right:i}){return{x:AR(e.x,n,i),y:AR(e.y,t,r)}}function jR(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function gse(e,t){return{x:jR(e.x,t.x),y:jR(e.y,t.y)}}function _se(e,t){let n=.5,r=lL(e),i=lL(t);return i>r?n=Pj(t.min,t.max-r,e.min):r>i&&(n=Pj(e.min,e.max-i,t.min)),Ej(0,1,n)}function vse(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var MR=.35;function yse(e=MR){return e===!1?e=0:e===!0&&(e=MR),{x:NR(e,`left`,`right`),y:NR(e,`top`,`bottom`)}}function NR(e,t,n){return{min:PR(e,t),max:PR(e,n)}}function PR(e,t){return typeof e==`number`?e:e[t]||0}var bse=new WeakMap,xse=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=pI(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(bR(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Vie(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),TL(e=>{let t=this.getAxisMotionValue(e).get()||0;if(BM.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=lL(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&dM.update(()=>i(e,t),!1,!0),EF(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Cse(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&dM.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new TR(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:SR(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&dM.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!IR(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=mse(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&_R(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?hse(n.layoutBox,e):!1,this.elastic=yse(t),r!==this.constraints&&!_R(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&TL(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=vse(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!_R(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=hae(n,r.root,this.visualElement.getTransformPagePoint()),a=gse(r.layout.layoutBox,i);if(t){let e=t(fae(a));this.hasMutatedConstraints=!!e,e&&(a=OI(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=TL(o=>{if(!IR(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return EF(this.visualElement,e),n.start(vF(e,n,0,t,this.visualElement,!1))}stopAnimation(){TL(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){TL(t=>{let{drag:n}=this.getProps();if(!IR(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-fN(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!_R(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};TL(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=_se({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),TL(t=>{if(!IR(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(fN(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;bse.set(this.visualElement,this);let e=this.visualElement.current,t=xR(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&qie(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();_R(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Sse(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),dM.read(r);let o=AL(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(TL(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=MR,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function FR(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Sse(e,t,n){let r=cI(e,FR(n)),i=cI(t,FR(n));return()=>{r(),i()}}function IR(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Cse(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var wse=class extends DI{constructor(e){super(e),this.removeGroupControls=Mj,this.removeListeners=Mj,this.controls=new xse(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Mj}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},LR=e=>(t,n)=>{e&&dM.update(()=>e(t,n),!1,!0)},Tse=class extends DI{constructor(){super(...arguments),this.removePointerDownListener=Mj}onPointerDown(e){this.session=new TR(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:SR(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:LR(e),onStart:LR(t),onMove:LR(n),onEnd:(e,t)=>{delete this.session,r&&dM.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=xR(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},RR=!1,Ese=class extends Y.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),RR&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ML.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),RR=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||dM.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),GF.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;RR=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function zR(e){let[t,n]=ZL(),r=(0,Y.useContext)(bj);return(0,X.jsx)(Ese,{...e,layoutGroup:r,switchLayoutGroup:(0,Y.useContext)(gR),isPresent:t,safeToRemove:n})}var Dse={pan:{Feature:Tse},drag:{Feature:wse,ProjectionNode:JL,MeasureLayout:zR}};function BR(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&dM.postRender(()=>i(t,bR(t)))}var Ose=class extends DI{mount(){let{current:e}=this.node;e&&(this.unmount=Uie(e,(e,t)=>(BR(this.node,t,`Start`),e=>BR(this.node,e,`End`))))}unmount(){}},kse=class extends DI{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Nj(AL(this.node.current,`focus`,()=>this.onFocus()),AL(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function VR(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&dM.postRender(()=>i(t,bR(t)))}var Ase=class extends DI{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Yie(e,(e,t)=>(VR(this.node,t,`Start`),(e,{success:t})=>VR(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},HR=new WeakMap,UR=new WeakMap,jse=e=>{let t=HR.get(e.target);t&&t(e)},Mse=e=>{e.forEach(jse)};function Nse({root:e,...t}){let n=e||document;UR.has(n)||UR.set(n,{});let r=UR.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Mse,{root:e,...t})),r[i]}function Pse(e,t,n){let r=Nse(t);return HR.set(e,n),r.observe(e),()=>{HR.delete(e),r.unobserve(e)}}var Fse={some:0,all:1},Ise=class extends DI{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Fse[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Pse(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Lse(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Lse({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Rse={inView:{Feature:Ise},tap:{Feature:Ase},focus:{Feature:kse},hover:{Feature:Ose}},zse={layout:{ProjectionNode:JL,MeasureLayout:zR}},Bse=ase({...lse,...Rse,...Dse,...zse},ose);function WR(){!xI.current&&SI();let[e]=(0,Y.useState)(bI.current);return e}var GR=Bse,Vse=Object.defineProperty,KR=(e,t)=>Vse(e,`name`,{value:t,configurable:!0}),qR=!!(typeof window<`u`&&window.document&&window.document.createElement);function JR(e,t,{checkForDefaultPrevented:n=!0}={}){return KR(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}KR(JR,`composeEventHandlers`);function Hse(e){if(!qR)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}KR(Hse,`getOwnerWindow`);function YR(e){if(!qR)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}KR(YR,`getOwnerDocument`);function XR(e,t=!1){let{activeElement:n}=YR(e);if(!n?.nodeName)return null;if(ZR(n)&&n.contentDocument)return XR(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=YR(n).getElementById(e);if(t)return t}}return n}KR(XR,`getActiveElement`);function ZR(e){return e.tagName===`IFRAME`}KR(ZR,`isFrame`);var Use=Object.defineProperty,QR=(e,t)=>Use(e,`name`,{value:t,configurable:!0});function $R(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}QR($R,`setRef`);function ez(...e){return t=>{let n=!1,r=e.map(e=>{let r=$R(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():$R(e[t],null)}}}}QR(ez,`composeRefs`);function tz(...e){return Y.useCallback(ez(...e),e)}QR(tz,`useComposedRefs`);var Wse=Object.defineProperty,nz=(e,t)=>Wse(e,`name`,{value:t,configurable:!0});function Gse(e,t){let n=Y.createContext(t);n.displayName=e+`Context`;let r=nz(e=>{let{children:t,...r}=e,i=Y.useMemo(()=>r,Object.values(r));return(0,X.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=Y.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return nz(i,`useContext`),[r,i]}nz(Gse,`createContext`);function rz(e,t=[]){let n=[];function r(t,r){let i=Y.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=nz(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=Y.useMemo(()=>o,Object.values(o));return(0,X.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=Y.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return nz(s,`useContext`),[o,s]}nz(r,`createContext`);let i=nz(()=>{let t=n.map(e=>Y.createContext(e));return nz(function(n){let r=n?.[e]||t;return Y.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,iz(i,...t)]}nz(rz,`createContextScope`);function iz(...e){let t=e[0];if(e.length===1)return t;let n=nz(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return nz(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return Y.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}nz(iz,`composeContextScopes`);var az=globalThis?.document?Y.useLayoutEffect:()=>{},Kse=Object.defineProperty,qse=(e,t)=>Kse(e,`name`,{value:t,configurable:!0}),Jse=Y.useId||(()=>void 0),Yse=0;function oz(e){let[t,n]=Y.useState(Jse());return az(()=>{e||n(e=>e??String(Yse++))},[e]),e||(t?`radix-${t}`:``)}qse(oz,`useId`);var Xse=Object.defineProperty,Zse=(e,t)=>Xse(e,`name`,{value:t,configurable:!0}),sz=Y.useEffectEvent,cz=Y.useInsertionEffect;function lz(e){if(typeof sz==`function`)return sz(e);let t=Y.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof cz==`function`?cz(()=>{t.current=e}):az(()=>{t.current=e}),Y.useMemo(()=>((...e)=>t.current?.(...e)),[])}Zse(lz,`useEffectEvent`);var Qse=Object.defineProperty,uz=(e,t)=>Qse(e,`name`,{value:t,configurable:!0}),$se=Y.useInsertionEffect||az;function dz({prop:e,defaultProp:t,onChange:n=uz(()=>{},`onChange`),caller:r}){let[i,a,o]=fz({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,Y.useCallback(t=>{if(s){let n=pz(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}uz(dz,`useControllableState`);function fz({defaultProp:e,onChange:t}){let[n,r]=Y.useState(e),i=Y.useRef(n),a=Y.useRef(t);return $se(()=>{a.current=t},[t]),Y.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}uz(fz,`useUncontrolledState`);function pz(e){return typeof e==`function`}uz(pz,`isFunction`);var mz=Symbol(`RADIX:SYNC_STATE`);function ece(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=lz(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=Y.useReducer((t,n)=>{if(n.type===mz)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=Y.useRef(p);Y.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=Y.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return Y.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:mz,state:i})},[i,d.state,c]),[h,f]}uz(ece,`useControllableStateReducer`);var tce=Object.defineProperty,hz=(e,t)=>tce(e,`name`,{value:t,configurable:!0});function gz(e){let t=Y.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];xz(r)&&typeof Cz==`function`&&(r=Cz(r._payload)),Y.Children.forEach(r,e=>{if(bz(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;xz(n)&&typeof Cz==`function`&&(n=Cz(n._payload)),a=rce(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=Y.cloneElement(a,void 0,s):!o&&Y.Children.count(r)===1&&Y.isValidElement(r)&&(a=r);let c=a?yz(a):void 0,l=tz(n,c);if(!a){if(r||r===0)throw Error(o?oce(e):ace(e));return r}let u=vz(i,a.props??{});return a.type!==Y.Fragment&&(u.ref=n?l:c),Y.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}hz(gz,`createSlot`);var _z=Symbol.for(`radix.slottable`);function nce(e){let t=hz(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=_z,t}hz(nce,`createSlottable`);var rce=hz((e,t)=>{if(`child`in e.props){let t=e.props.child;return Y.isValidElement(t)?Y.cloneElement(t,void 0,e.props.children(t.props.children)):null}return Y.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function vz(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}hz(vz,`mergeProps`);function yz(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}hz(yz,`getElementRef`);function bz(e){return Y.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===_z}hz(bz,`isSlottable`);var ice=Symbol.for(`react.lazy`);function xz(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ice&&`_payload`in e&&Sz(e._payload)}hz(xz,`isLazyComponent`);function Sz(e){return typeof e==`object`&&!!e&&`then`in e}hz(Sz,`isPromiseLike`);var ace=hz(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),oce=hz(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Cz=Y.use,sce=Object.defineProperty,cce=(e,t)=>sce(e,`name`,{value:t,configurable:!0}),wz=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=gz(`Primitive.${t}`),r=Y.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,X.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Tz(e,t){e&&Xi.flushSync(()=>e.dispatchEvent(t))}cce(Tz,`dispatchDiscreteCustomEvent`);var lce=Object.defineProperty,uce=(e,t)=>lce(e,`name`,{value:t,configurable:!0});function Ez(e){let t=Y.useRef(e);return Y.useEffect(()=>{t.current=e}),Y.useMemo(()=>((...e)=>t.current?.(...e)),[])}uce(Ez,`useCallbackRef`);var dce=Object.defineProperty,Dz=(e,t)=>dce(e,`name`,{value:t,configurable:!0}),Oz=`dismissableLayer.update`,fce=`dismissableLayer.pointerDownOutside`,pce=`dismissableLayer.focusOutside`,kz,Az=Y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),mce=Y.forwardRef(Dz(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=Y.useContext(Az),[d,f]=Y.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=Y.useState({}),h=tz(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=Y.useRef(!1),C=Nz(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:Y.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=Pz(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,E=Ez(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return Y.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),Y.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(kz=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Fz(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=kz))}},[d,p,n,u]),Y.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Fz())},[d,u]),Y.useEffect(()=>{let e=Dz(()=>m({}),`handleUpdate`);return document.addEventListener(Oz,e),()=>document.removeEventListener(Oz,e)},[]),(0,X.jsx)(wz.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:JR(e.onFocusCapture,w.onFocusCapture),onBlurCapture:JR(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:JR(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function jz(){let e=Y.useContext(Az),[t,n]=Y.useState(null);return Y.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Dz(jz,`useDismissableLayerSurface`);var Mz=Dz(()=>!0,`IS_TRUE`);function Nz(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Mz}=t,s=Ez(e),c=Y.useRef(!1),l=Y.useRef(!1),u=Y.useRef(new Map),d=Y.useRef(()=>{});return Y.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Dz(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Dz(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Dz(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Dz(p,`handleInteractionBubble`);let m=Dz(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Iz(fce,s,p,{discrete:!0})};if(Dz(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Dz(()=>c.current=!0,`onPointerDownCapture`)}}Dz(Nz,`usePointerDownOutside`);function Pz(e,t=globalThis?.document){let n=Ez(e),r=Y.useRef(!1);return Y.useEffect(()=>{let e=Dz(e=>{e.target&&!r.current&&Iz(pce,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Dz(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Dz(()=>r.current=!1,`onBlurCapture`)}}Dz(Pz,`useFocusOutside`);function Fz(){let e=new CustomEvent(Oz);document.dispatchEvent(e)}Dz(Fz,`dispatchUpdate`);function Iz(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Tz(i,a):i.dispatchEvent(a)}Dz(Iz,`handleAndDispatchCustomEvent`);var Lz=Object.defineProperty,Rz=(e,t)=>Lz(e,`name`,{value:t,configurable:!0}),zz=`focusScope.autoFocusOnMount`,Bz=`focusScope.autoFocusOnUnmount`,Vz={bubbles:!1,cancelable:!0},Hz=Y.forwardRef(Rz(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=Y.useState(null),l=Ez(i),u=Ez(a),d=Y.useRef(null),f=tz(t,c),p=Y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Y.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Yz(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Yz(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Yz(s)};Rz(e,`handleFocusIn`),Rz(t,`handleFocusOut`),Rz(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),Y.useEffect(()=>{if(s){Xz.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(zz,Vz);s.addEventListener(zz,l),s.dispatchEvent(t),t.defaultPrevented||(Uz($z(Gz(s)),{select:!0}),document.activeElement===e&&Yz(s))}return()=>{s.removeEventListener(zz,l),setTimeout(()=>{let t=new CustomEvent(Bz,Vz);s.addEventListener(Bz,u),s.dispatchEvent(t),t.defaultPrevented||Yz(e??document.body,{select:!0}),s.removeEventListener(Bz,u),Xz.remove(p)},0)}}},[s,l,u,p]);let m=Y.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Wz(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Yz(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Yz(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,X.jsx)(wz.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function Uz(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Yz(r,{select:t}),document.activeElement!==n)return}Rz(Uz,`focusFirst`);function Wz(e){let t=Gz(e);return[Kz(t,e),Kz(t.reverse(),e)]}Rz(Wz,`getTabbableEdges`);function Gz(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Rz(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Rz(Gz,`getTabbableCandidates`);function Kz(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):qz(r,{upTo:t})))return r}Rz(Kz,`findVisible`);function qz(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}Rz(qz,`isHidden`);function Jz(e){return e instanceof HTMLInputElement&&`select`in e}Rz(Jz,`isSelectableInput`);function Yz(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Jz(e)&&t&&e.select()}}Rz(Yz,`focus`);var Xz=Zz();function Zz(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Qz(e,t),e.unshift(t)},remove(t){e=Qz(e,t),e[0]?.resume()}}}Rz(Zz,`createFocusScopesStack`);function Qz(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Rz(Qz,`arrayRemove`);function $z(e){return e.filter(e=>e.tagName!==`A`)}Rz($z,`removeLinks`);var eB=Object.defineProperty,tB=Y.forwardRef(((e,t)=>eB(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=Y.useState(!1);az(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Xi.createPortal((0,X.jsx)(wz.div,{...r,ref:t}),o):null},`Portal`)),nB=Object.defineProperty,rB=(e,t)=>nB(e,`name`,{value:t,configurable:!0});function iB(e,t){return Y.useReducer((e,n)=>t[e][n]??e,e)}rB(iB,`useStateMachine`);var aB=rB(e=>{let{present:t,children:n}=e,r=oB(t),i=typeof n==`function`?n({present:r.isPresent}):Y.Children.only(n),a=cB(r.ref,uB(i));return typeof n==`function`||r.isPresent?Y.cloneElement(i,{ref:a}):null},`Presence`);function oB(e){let[t,n]=Y.useState(),r=Y.useRef(null),i=Y.useRef(e),a=Y.useRef(`none`),o=Y.useRef(void 0),[s,c]=iB(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return Y.useEffect(()=>{s===`mounted`?(a.current=o.current??lB(r.current),o.current=void 0):a.current=`none`},[s]),az(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=lB(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),az(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=rB(a=>{let o=lB(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=rB(e=>{e.target===t&&(a.current=lB(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:Y.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=lB(t)}else r.current=null;n(e)},[])}}rB(oB,`usePresence`);function sB(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}rB(sB,`setRef`);function cB(...e){let t=Y.useRef(e);return t.current=e,Y.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=sB(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():sB(n[e],null)}}},[])}rB(cB,`useStableComposedRefs`);function lB(e){return e?.animationName||`none`}rB(lB,`getAnimationName`);function uB(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}rB(uB,`getElementRef`);var dB=Object.defineProperty,fB=(e,t)=>dB(e,`name`,{value:t,configurable:!0}),pB=0,mB=null;function hB(e){return gB(),e.children}fB(hB,`FocusGuards`);function gB(){Y.useEffect(()=>{mB||={start:_B(),end:_B()};let{start:e,end:t}=mB;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),pB++,()=>{pB===1&&(mB?.start.remove(),mB?.end.remove(),mB=null),pB=Math.max(0,pB-1)}},[])}fB(gB,`useFocusGuards`);function _B(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}fB(_B,`createFocusGuard`);var vB=function(){return vB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},vB.apply(this,arguments)};function yB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function bB(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var xB=`right-scroll-bar-position`,SB=`width-before-scroll-bar`,CB=`with-scroll-bars-hidden`,wB=`--removed-body-scroll-bar-size`;function TB(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function EB(e,t){var n=(0,Y.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var DB=typeof window<`u`?Y.useLayoutEffect:Y.useEffect,OB=new WeakMap;function kB(e,t){var n=EB(t||null,function(t){return e.forEach(function(e){return TB(e,t)})});return DB(function(){var t=OB.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||TB(e,null)}),i.forEach(function(e){r.has(e)||TB(e,a)})}OB.set(n,e)},[e]),n}function AB(e){return e}function jB(e,t){t===void 0&&(t=AB);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function MB(e){e===void 0&&(e={});var t=jB(null);return t.options=vB({async:!0,ssr:!1},e),t}var NB=function(e){var t=e.sideCar,n=yB(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return Y.createElement(r,vB({},n))};NB.isSideCarExport=!0;function PB(e,t){return e.useMedium(t),NB}var FB=MB(),IB=function(){},LB=Y.forwardRef(function(e,t){var n=Y.useRef(null),r=Y.useState({onScrollCapture:IB,onWheelCapture:IB,onTouchMoveCapture:IB}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=yB(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=kB([n,t]),C=vB(vB({},b),i);return Y.createElement(Y.Fragment,null,u&&Y.createElement(x,{sideCar:FB,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?Y.cloneElement(Y.Children.only(s),vB(vB({},C),{ref:S})):Y.createElement(v,vB({},C,{className:c,ref:S}),s))});LB.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},LB.classNames={fullWidth:SB,zeroRight:xB};var RB,zB=function(){if(RB)return RB;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function BB(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=zB();return t&&e.setAttribute(`nonce`,t),e}function VB(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function HB(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var UB=function(){var e=0,t=null;return{add:function(n){e==0&&(t=BB())&&(VB(t,n),HB(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},WB=function(){var e=UB();return function(t,n){Y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},GB=function(){var e=WB();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},KB={left:0,top:0,right:0,gap:0},qB=function(e){return parseInt(e||``,10)||0},JB=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[qB(n),qB(r),qB(i)]},YB=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return KB;var t=JB(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},XB=GB(),ZB=`data-scroll-locked`,QB=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
50
+ .${CB} {
51
+ overflow: hidden ${r};
52
+ padding-right: ${s}px ${r};
53
+ }
54
+ body[${ZB}] {
55
+ overflow: hidden ${r};
56
+ overscroll-behavior: contain;
57
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
58
+ padding-left: ${i}px;
59
+ padding-top: ${a}px;
60
+ padding-right: ${o}px;
61
+ margin-left:0;
62
+ margin-top:0;
63
+ margin-right: ${s}px ${r};
64
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
65
+ }
66
+
67
+ .${xB} {
68
+ right: ${s}px ${r};
69
+ }
70
+
71
+ .${SB} {
72
+ margin-right: ${s}px ${r};
73
+ }
74
+
75
+ .${xB} .${xB} {
76
+ right: 0 ${r};
77
+ }
78
+
79
+ .${SB} .${SB} {
80
+ margin-right: 0 ${r};
81
+ }
82
+
83
+ body[${ZB}] {
84
+ ${wB}: ${s}px;
85
+ }
86
+ `},$B=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},eV=function(){Y.useEffect(function(){return document.body.setAttribute(ZB,($B()+1).toString()),function(){var e=$B()-1;e<=0?document.body.removeAttribute(ZB):document.body.setAttribute(ZB,e.toString())}},[])},tV=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;eV();var a=Y.useMemo(function(){return YB(i)},[i]);return Y.createElement(XB,{styles:QB(a,!t,i,n?``:`!important`)})},nV=!1;if(typeof window<`u`)try{var rV=Object.defineProperty({},"passive",{get:function(){return nV=!0,!0}});window.addEventListener(`test`,rV,rV),window.removeEventListener(`test`,rV,rV)}catch{nV=!1}var iV=nV?{passive:!1}:!1,aV=function(e){return e.tagName===`TEXTAREA`},oV=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!aV(e)&&n[t]===`visible`)},sV=function(e){return oV(e,`overflowY`)},cV=function(e){return oV(e,`overflowX`)},lV=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),fV(e,r)){var i=pV(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},uV=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},dV=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},fV=function(e,t){return e===`v`?sV(t):cV(t)},pV=function(e,t){return e===`v`?uV(t):dV(t)},mV=function(e,t){return e===`h`&&t===`rtl`?-1:1},hV=function(e,t,n,r,i){var a=mV(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=pV(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&fV(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},gV=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_V=function(e){return[e.deltaX,e.deltaY]},vV=function(e){return e&&`current`in e?e.current:e},yV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bV=function(e){return`
87
+ .block-interactivity-${e} {pointer-events: none;}
88
+ .allow-interactivity-${e} {pointer-events: all;}
89
+ `},xV=0,SV=[];function CV(e){var t=Y.useRef([]),n=Y.useRef([0,0]),r=Y.useRef(),i=Y.useState(xV++)[0],a=Y.useState(GB)[0],o=Y.useRef(e);Y.useEffect(function(){o.current=e},[e]),Y.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=bB([e.lockRef.current],(e.shards||[]).map(vV),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=Y.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=gV(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=lV(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=lV(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return hV(h,t,e,h===`h`?s:c,!0)},[]),c=Y.useCallback(function(e){var n=e;if(!(!SV.length||SV[SV.length-1]!==a)){var r=`deltaY`in n?_V(n):gV(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&yV(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(vV).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=Y.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:wV(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=Y.useCallback(function(e){n.current=gV(e),r.current=void 0},[]),d=Y.useCallback(function(t){l(t.type,_V(t),t.target,s(t,e.lockRef.current))},[]),f=Y.useCallback(function(t){l(t.type,gV(t),t.target,s(t,e.lockRef.current))},[]);Y.useEffect(function(){return SV.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,iV),document.addEventListener(`touchmove`,c,iV),document.addEventListener(`touchstart`,u,iV),function(){SV=SV.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,iV),document.removeEventListener(`touchmove`,c,iV),document.removeEventListener(`touchstart`,u,iV)}},[]);var p=e.removeScrollBar,m=e.inert;return Y.createElement(Y.Fragment,null,m?Y.createElement(a,{styles:bV(i)}):null,p?Y.createElement(tV,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function wV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var TV=PB(FB,CV),EV=Y.forwardRef(function(e,t){return Y.createElement(LB,vB({},e,{ref:t,sideCar:TV}))});EV.classNames=LB.classNames;var DV=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},OV=new WeakMap,kV=new WeakMap,AV={},jV=0,MV=function(e){return e&&(e.host||MV(e.parentNode))},NV=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=MV(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},PV=function(e,t,n,r){var i=NV(t,Array.isArray(e)?e:[e]);AV[n]||(AV[n]=new WeakMap);var a=AV[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(OV.get(e)||0)+1,l=(a.get(e)||0)+1;OV.set(e,c),a.set(e,l),o.push(e),c===1&&i&&kV.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),jV++,function(){o.forEach(function(e){var t=OV.get(e)-1,i=a.get(e)-1;OV.set(e,t),a.set(e,i),t||(kV.has(e)||e.removeAttribute(r),kV.delete(e)),i||e.removeAttribute(n)}),jV--,jV||(OV=new WeakMap,OV=new WeakMap,kV=new WeakMap,AV={})}},FV=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||DV(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),PV(r,i,n,`aria-hidden`)):function(){return null}},IV=Object.defineProperty,LV=(e,t)=>IV(e,`name`,{value:t,configurable:!0}),RV=`Dialog`,[zV,hce]=rz(RV),[BV,VV]=zV(RV),HV=LV(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=Y.useRef(null),c=Y.useRef(null),[l,u]=dz({prop:r,defaultProp:i??!1,onChange:a,caller:RV}),[d,f]=Y.useState(0),[p,m]=Y.useState(0);return(0,X.jsx)(BV,{scope:t,triggerRef:s,contentRef:c,contentId:oz(),titleId:oz(),descriptionId:oz(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:Y.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),UV=`DialogTrigger`,WV=Y.forwardRef(LV(function(e,t){let{__scopeDialog:n,...r}=e,i=VV(UV,n),a=tz(t,i.triggerRef);return(0,X.jsx)(wz.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":uH(i.open),...r,ref:a,onClick:JR(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),GV=`DialogPortal`,[KV,qV]=zV(GV,{forceMount:void 0}),JV=LV(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=VV(GV,t);return(0,X.jsx)(KV,{scope:t,forceMount:n,children:Y.Children.map(r,e=>(0,X.jsx)(aB,{present:n||a.open,children:(0,X.jsx)(tB,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),YV=`DialogOverlay`,XV=Y.forwardRef(LV(function(e,t){let n=qV(YV,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=VV(YV,e.__scopeDialog);return a.modal?(0,X.jsx)(aB,{present:r||a.open,children:(0,X.jsx)(QV,{...i,ref:t})}):null},`DialogOverlay`)),ZV=gz(`DialogOverlay.RemoveScroll`),QV=Y.forwardRef(LV(function(e,t){let{__scopeDialog:n,...r}=e,i=VV(YV,n),a=tz(t,jz());return(0,X.jsx)(EV,{as:ZV,allowPinchZoom:!0,shards:[i.contentRef],children:(0,X.jsx)(wz.div,{"data-state":uH(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),$V=`DialogContent`,eH=Y.forwardRef(LV(function(e,t){let n=qV($V,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=VV($V,e.__scopeDialog);return(0,X.jsx)(aB,{present:r||a.open,children:a.modal?(0,X.jsx)(tH,{...i,ref:t}):(0,X.jsx)(nH,{...i,ref:t})})},`DialogContent`)),tH=Y.forwardRef(LV(function(e,t){let n=VV($V,e.__scopeDialog),r=Y.useRef(null),i=tz(t,n.contentRef,r);return Y.useEffect(()=>{let e=r.current;if(e)return FV(e)},[]),(0,X.jsx)(rH,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:JR(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:JR(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:JR(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),nH=Y.forwardRef(LV(function(e,t){let n=VV($V,e.__scopeDialog),r=Y.useRef(!1),i=Y.useRef(!1);return(0,X.jsx)(rH,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),rH=Y.forwardRef(LV(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=VV($V,n);return gB(),(0,X.jsx)(X.Fragment,{children:(0,X.jsx)(Hz,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,X.jsx)(mce,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":uH(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),iH=`DialogTitle`,aH=Y.forwardRef(LV(function(e,t){let{__scopeDialog:n,...r}=e,i=VV(iH,n),{setTitleCount:a}=i;return az(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,X.jsx)(wz.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),oH=`DialogDescription`,sH=Y.forwardRef(LV(function(e,t){let{__scopeDialog:n,...r}=e,i=VV(oH,n),{setDescriptionCount:a}=i;return az(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,X.jsx)(wz.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),cH=`DialogClose`,lH=Y.forwardRef(LV(function(e,t){let{__scopeDialog:n,...r}=e,i=VV(cH,n);return(0,X.jsx)(wz.button,{type:`button`,...r,ref:t,onClick:JR(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function uH(e){return e?`open`:`closed`}LV(uH,`getState`);function dH(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var fH=Y.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:`bottom`,shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),pH=()=>{let e=Y.useContext(fH);if(!e)throw Error(`useDrawerContext must be used within a Drawer.Root`);return e};dH(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
90
+ [data-state=closed]
91
+ ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function mH(){let e=navigator.userAgent;return typeof window<`u`&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function hH(){return bH(/^Mac/)}function gH(){return bH(/^iPhone/)}function _H(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function vH(){return bH(/^iPad/)||hH()&&navigator.maxTouchPoints>1}function yH(){return gH()||vH()}function bH(e){return typeof window<`u`&&window.navigator!=null?e.test(window.navigator.platform):void 0}var xH=24,SH=typeof window<`u`?Y.useLayoutEffect:Y.useEffect;function CH(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}var wH=typeof document<`u`&&window.visualViewport;function TH(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function EH(e){for(TH(e)&&(e=e.parentElement);e&&!TH(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}var DH=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]),OH=0,kH;function AH(e={}){let{isDisabled:t}=e;SH(()=>{if(!t)return OH++,OH===1&&yH()&&(kH=jH()),()=>{OH--,OH===0&&kH?.()}},[t])}function jH(){let e,t=0,n=n=>{e=EH(n.target),(e!==document.documentElement||e!==document.body)&&(t=n.changedTouches[0].pageY)},r=n=>{if(!e||e===document.documentElement||e===document.body){n.preventDefault();return}let r=n.changedTouches[0].pageY,i=e.scrollTop,a=e.scrollHeight-e.clientHeight;a!==0&&((i<=0&&r>t||i>=a&&r<t)&&n.preventDefault(),t=r)},i=e=>{let t=e.target;FH(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform=`translateY(-2000px)`,t.focus(),requestAnimationFrame(()=>{t.style.transform=``}))},a=e=>{let t=e.target;FH(t)&&(t.style.transform=`translateY(-2000px)`,requestAnimationFrame(()=>{t.style.transform=``,wH&&(wH.height<window.innerHeight?requestAnimationFrame(()=>{PH(t)}):wH.addEventListener(`resize`,()=>PH(t),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},s=window.pageXOffset,c=window.pageYOffset,l=CH(MH(document.documentElement,`paddingRight`,`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=CH(NH(document,`touchstart`,n,{passive:!1,capture:!0}),NH(document,`touchmove`,r,{passive:!1,capture:!0}),NH(document,`touchend`,i,{passive:!1,capture:!0}),NH(document,`focus`,a,!0),NH(window,`scroll`,o));return()=>{l(),u(),window.scrollTo(s,c)}}function MH(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function NH(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function PH(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=EH(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+xH&&(t.scrollTop+=r-n)}e=t.parentElement}}function FH(e){return e instanceof HTMLInputElement&&!DH.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function IH(e,t){typeof e==`function`?e(t):e!=null&&(e.current=t)}function LH(...e){return t=>e.forEach(e=>IH(e,t))}function RH(...e){return Y.useCallback(LH(...e),e)}var zH=new WeakMap;function BH(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{if(t.startsWith(`--`)){e.style.setProperty(t,n);return}r[t]=e.style[t],e.style[t]=n}),!n&&zH.set(e,r)}function VH(e,t){if(!e||!(e instanceof HTMLElement))return;let n=zH.get(e);n&&(e.style[t]=n[t])}var HH=e=>{switch(e){case`top`:case`bottom`:return!0;case`left`:case`right`:return!1;default:return e}};function UH(e,t){if(!e)return null;let n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform,i=r.match(/^matrix3d\((.+)\)$/);return i?parseFloat(i[1].split(`, `)[HH(t)?13:12]):(i=r.match(/^matrix\((.+)\)$/),i?parseFloat(i[1].split(`, `)[HH(t)?5:4]):null)}function WH(e){return 8*(Math.log(e+1)-2)}function GH(e,t){if(!e)return()=>{};let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}var KH={DURATION:.5,EASE:[.32,.72,0,1]},qH=.4,JH=.25,YH=100,XH=8,ZH=16,QH=26,$H=`vaul-dragging`;function eU(e){let t=Y.useRef(e);return Y.useEffect(()=>{t.current=e}),Y.useMemo(()=>(...e)=>t.current==null?void 0:t.current.call(t,...e),[])}function tU({defaultProp:e,onChange:t}){let n=Y.useState(e),[r]=n,i=Y.useRef(r),a=eU(t);return Y.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}function nU({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,i]=tU({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=eU(n);return[o,Y.useCallback(t=>{if(a){let n=typeof t==`function`?t(e):t;n!==e&&s(n)}else i(t)},[a,e,i,s])]}function rU({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:i,fadeFromIndex:a,onSnapPointChange:o,direction:s=`bottom`,container:c,snapToSequentialPoint:l}){let[u,d]=nU({prop:e,defaultProp:n?.[0],onChange:t}),[f,p]=Y.useState(typeof window<`u`?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);Y.useEffect(()=>{function e(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let m=Y.useMemo(()=>u===n?.[n.length-1]||null,[n,u]),h=Y.useMemo(()=>n?.findIndex(e=>e===u)??null,[n,u]),g=n&&n.length>0&&(a||a===0)&&!Number.isNaN(a)&&n[a]===u||!n,_=Y.useMemo(()=>{let e=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};return n?.map(t=>{let n=typeof t==`string`,r=0;if(n&&(r=parseInt(t,10)),HH(s)){let i=n?r:f?t*e.height:0;return f?s===`bottom`?e.height-i:-e.height+i:i}let i=n?r:f?t*e.width:0;return f?s===`right`?e.width-i:-e.width+i:i})??[]},[n,f,c]),v=Y.useMemo(()=>h===null?null:_?.[h],[_,h]),y=Y.useCallback(e=>{let t=_?.findIndex(t=>t===e)??null;o(t),BH(r.current,{transition:`transform ${KH.DURATION}s cubic-bezier(${KH.EASE.join(`,`)})`,transform:HH(s)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),_&&t!==_.length-1&&a!==void 0&&t!==a&&t<a?BH(i.current,{transition:`opacity ${KH.DURATION}s cubic-bezier(${KH.EASE.join(`,`)})`,opacity:`0`}):BH(i.current,{transition:`opacity ${KH.DURATION}s cubic-bezier(${KH.EASE.join(`,`)})`,opacity:`1`}),d(n?.[Math.max(t,0)])},[r.current,n,_,a,i,d]);Y.useEffect(()=>{if(u||e){let t=n?.findIndex(t=>t===e||t===u)??-1;_&&t!==-1&&typeof _[t]==`number`&&y(_[t])}},[u,e,n,_,y]);function b({draggedDistance:e,closeDrawer:t,velocity:r,dismissible:o}){if(a===void 0)return;let c=s===`bottom`||s===`right`?(v??0)-e:(v??0)+e,u=h===a-1,d=h===0,f=e>0;if(u&&BH(i.current,{transition:`opacity ${KH.DURATION}s cubic-bezier(${KH.EASE.join(`,`)})`}),!l&&r>2&&!f){o?t():y(_[0]);return}if(!l&&r>2&&f&&_&&n){y(_[n.length-1]);return}let p=_?.reduce((e,t)=>typeof e!=`number`||typeof t!=`number`?e:Math.abs(t-c)<Math.abs(e-c)?t:e),g=HH(s)?window.innerHeight:window.innerWidth;if(r>qH&&Math.abs(e)<g*.4){let e=f?1:-1;if(e>0&&m&&n){y(_[n.length-1]);return}if(d&&e<0&&o&&t(),h===null)return;y(_[h+e]);return}y(p)}function x({draggedDistance:e}){if(v===null)return;let t=s===`bottom`||s===`right`?v-e:v+e;(s===`bottom`||s===`right`)&&t<_[_.length-1]||(s===`top`||s===`left`)&&t>_[_.length-1]||BH(r.current,{transform:HH(s)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})}function S(e,t){if(!n||typeof h!=`number`||!_||a===void 0)return null;let r=h===a-1;if(h>=a&&t)return 0;if(r&&!t)return 1;if(!g&&!r)return null;let i=r?h+1:h-1,o=r?_[i]-_[i-1]:_[i+1]-_[i],s=e/Math.abs(o);return r?1-s:s}return{isLastSnapPoint:m,activeSnapPoint:u,shouldFade:g,getPercentageDragged:S,setActiveSnapPoint:d,activeSnapPointIndex:h,onRelease:b,onDrag:x,snapPointsOffset:_}}function iU(){let{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:i}=pH(),a=Y.useRef(null),o=(0,Y.useMemo)(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-QH)/window.innerWidth}Y.useEffect(()=>{if(t&&n){a.current&&clearTimeout(a.current);let t=document.querySelector(`[data-vaul-drawer-wrapper]`)||document.querySelector(`[vaul-drawer-wrapper]`);if(!t)return;r&&!i&&GH(document.body,{background:`black`}),GH(t,{transformOrigin:HH(e)?`top`:`left`,transitionProperty:`transform, border-radius`,transitionDuration:`${KH.DURATION}s`,transitionTimingFunction:`cubic-bezier(${KH.EASE.join(`,`)})`});let n=GH(t,{borderRadius:`${XH}px`,overflow:`hidden`,...HH(e)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),a.current=window.setTimeout(()=>{o?document.body.style.background=o:document.body.style.removeProperty(`background`)},KH.DURATION*1e3)}}},[t,n,o])}var aU=null;function oU({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:i,noBodyStyles:a}){let[o,s]=Y.useState(()=>typeof window<`u`?window.location.href:``),c=Y.useRef(0),l=Y.useCallback(()=>{if(_H()&&aU===null&&e&&!a){aU={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:`unset`};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty(`position`,`fixed`,`important`),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-e}px`,right:`0px`,height:`auto`}),window.setTimeout(()=>window.requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&c.current>=t&&(document.body.style.top=`${-(c.current+e)}px`)}),300)}},[e]),u=Y.useCallback(()=>{if(_H()&&aU!==null&&!a){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,aU),window.requestAnimationFrame(()=>{if(i&&o!==window.location.href){s(window.location.href);return}window.scrollTo(t,e)}),aU=null}},[o]);return Y.useEffect(()=>{function e(){c.current=window.scrollY}return e(),window.addEventListener(`scroll`,e),()=>{window.removeEventListener(`scroll`,e)}},[]),Y.useEffect(()=>{if(t)return()=>{typeof document>`u`||document.querySelector(`[data-vaul-drawer]`)||u()}},[t,u]),Y.useEffect(()=>{n||!r||(e?(!window.matchMedia(`(display-mode: standalone)`).matches&&l(),t||window.setTimeout(()=>{u()},500)):u())},[e,r,o,t,n,l,u]),{restorePositionSetting:u}}function sU({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:i,snapPoints:a,shouldScaleBackground:o=!1,setBackgroundColorOnScale:s=!0,closeThreshold:c=JH,scrollLockTimeout:l=YH,dismissible:u=!0,handleOnly:d=!1,fadeFromIndex:f=a&&a.length-1,activeSnapPoint:p,setActiveSnapPoint:m,fixed:h,modal:g=!0,onClose:_,nested:v,noBodyStyles:y=!1,direction:b=`bottom`,defaultOpen:x=!1,disablePreventScroll:S=!0,snapToSequentialPoint:C=!1,preventScrollRestoration:w=!1,repositionInputs:T=!0,onAnimationEnd:E,container:D,autoFocus:O=!1}){let[k=!1,A]=nU({defaultProp:x,prop:e,onChange:e=>{t?.(e),!e&&!v&&de(),setTimeout(()=>{E?.(e)},KH.DURATION*1e3),e&&!g&&typeof window<`u`&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents=`auto`}),e||(document.body.style.pointerEvents=`auto`)}}),[j,M]=Y.useState(!1),[N,P]=Y.useState(!1),[F,I]=Y.useState(!1),L=Y.useRef(null),R=Y.useRef(null),z=Y.useRef(null),B=Y.useRef(null),V=Y.useRef(null),H=Y.useRef(!1),U=Y.useRef(null),W=Y.useRef(0),G=Y.useRef(!1),K=Y.useRef(!x),q=Y.useRef(0),J=Y.useRef(null),ee=Y.useRef(J.current?.getBoundingClientRect().height||0),te=Y.useRef(J.current?.getBoundingClientRect().width||0),ne=Y.useRef(0),{activeSnapPoint:re,activeSnapPointIndex:ie,setActiveSnapPoint:ae,onRelease:oe,snapPointsOffset:se,onDrag:ce,shouldFade:le,getPercentageDragged:ue}=rU({snapPoints:a,activeSnapPointProp:p,setActiveSnapPointProp:m,drawerRef:J,fadeFromIndex:f,overlayRef:L,onSnapPointChange:Y.useCallback(e=>{a&&e===se.length-1&&(R.current=new Date)},[]),direction:b,container:D,snapToSequentialPoint:C});AH({isDisabled:!k||N||!g||F||!j||!T||!S});let{restorePositionSetting:de}=oU({isOpen:k,modal:g,nested:v??!1,hasBeenOpened:j,preventScrollRestoration:w,noBodyStyles:y});function fe(){return(window.innerWidth-QH)/window.innerWidth}function pe(e){!u&&!a||J.current&&!J.current.contains(e.target)||(ee.current=J.current?.getBoundingClientRect().height||0,te.current=J.current?.getBoundingClientRect().width||0,P(!0),z.current=new Date,yH()&&window.addEventListener(`touchend`,()=>H.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),W.current=HH(b)?e.pageY:e.pageX)}function me(e,t){let n=e,r=window.getSelection()?.toString(),i=J.current?UH(J.current,b):null,a=new Date;if(n.tagName===`SELECT`||n.hasAttribute(`data-vaul-no-drag`)||n.closest(`[data-vaul-no-drag]`))return!1;if(b===`right`||b===`left`)return!0;if(R.current&&a.getTime()-R.current.getTime()<500)return!1;if(i!==null&&(b===`bottom`?i>0:i<0))return!0;if(r&&r.length>0)return!1;if(V.current&&a.getTime()-V.current.getTime()<l&&i===0||t)return V.current=a,!1;for(;n;){if(n.scrollHeight>n.clientHeight){if(n.scrollTop!==0)return V.current=new Date,!1;if(n.getAttribute(`role`)===`dialog`)return!0}n=n.parentNode}return!0}function he(e){if(J.current&&N){let t=b===`bottom`||b===`right`?1:-1,n=(W.current-(HH(b)?e.pageY:e.pageX))*t,i=n>0,s=a&&!u&&!i;if(s&&ie===0)return;let c=Math.abs(n),l=document.querySelector(`[data-vaul-drawer-wrapper]`),d=c/(b===`bottom`||b===`top`?ee.current:te.current),p=ue(c,i);if(p!==null&&(d=p),s&&d>=1||!H.current&&!me(e.target,i))return;if(J.current.classList.add($H),H.current=!0,BH(J.current,{transition:`none`}),BH(L.current,{transition:`none`}),a&&ce({draggedDistance:n}),i&&!a){let e=WH(n),r=Math.min(e*-1,0)*t;BH(J.current,{transform:HH(b)?`translate3d(0, ${r}px, 0)`:`translate3d(${r}px, 0, 0)`});return}let m=1-d;if((le||f&&ie===f-1)&&(r?.(e,d),BH(L.current,{opacity:`${m}`,transition:`none`},!0)),l&&L.current&&o){let e=Math.min(fe()+d*(1-fe()),1),t=8-d*8,n=Math.max(0,14-d*14);BH(l,{borderRadius:`${t}px`,transform:HH(b)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:`none`},!0)}if(!a){let e=c*t;BH(J.current,{transform:HH(b)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}}Y.useEffect(()=>{window.requestAnimationFrame(()=>{K.current=!0})},[]),Y.useEffect(()=>{var e;function t(){if(!J.current||!T)return;let e=document.activeElement;if(FH(e)||G.current){let e=window.visualViewport?.height||0,t=window.innerHeight,n=t-e,r=J.current.getBoundingClientRect().height||0,i=r>t*.8;ne.current||=r;let o=J.current.getBoundingClientRect().top;if(Math.abs(q.current-n)>60&&(G.current=!G.current),a&&a.length>0&&se&&ie){let e=se[ie]||0;n+=e}if(q.current=n,r>e||G.current){let t=J.current.getBoundingClientRect().height,r=t;t>e&&(r=e-(i?o:QH)),h?J.current.style.height=`${t-Math.max(n,0)}px`:J.current.style.height=`${Math.max(r,e-o)}px`}else mH()||(J.current.style.height=`${ne.current}px`);a&&a.length>0&&!G.current?J.current.style.bottom=`0px`:J.current.style.bottom=`${Math.max(n,0)}px`}}return(e=window.visualViewport)==null||e.addEventListener(`resize`,t),()=>window.visualViewport?.removeEventListener(`resize`,t)},[ie,a,se]);function ge(e){ve(),_?.(),e||A(!1),setTimeout(()=>{a&&ae(a[0])},KH.DURATION*1e3)}function _e(){if(!J.current)return;let e=document.querySelector(`[data-vaul-drawer-wrapper]`),t=UH(J.current,b);BH(J.current,{transform:`translate3d(0, 0, 0)`,transition:`transform ${KH.DURATION}s cubic-bezier(${KH.EASE.join(`,`)})`}),BH(L.current,{transition:`opacity ${KH.DURATION}s cubic-bezier(${KH.EASE.join(`,`)})`,opacity:`1`}),o&&t&&t>0&&k&&BH(e,{borderRadius:`${XH}px`,overflow:`hidden`,...HH(b)?{transform:`scale(${fe()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:`top`}:{transform:`scale(${fe()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:`left`},transitionProperty:`transform, border-radius`,transitionDuration:`${KH.DURATION}s`,transitionTimingFunction:`cubic-bezier(${KH.EASE.join(`,`)})`},!0)}function ve(){!N||!J.current||(J.current.classList.remove($H),H.current=!1,P(!1),B.current=new Date)}function ye(e){if(!N||!J.current)return;J.current.classList.remove($H),H.current=!1,P(!1),B.current=new Date;let t=UH(J.current,b);if(!e||!me(e.target,!1)||!t||Number.isNaN(t)||z.current===null)return;let n=B.current.getTime()-z.current.getTime(),r=W.current-(HH(b)?e.pageY:e.pageX),o=Math.abs(r)/n;if(o>.05&&(I(!0),setTimeout(()=>{I(!1)},200)),a){oe({draggedDistance:r*(b===`bottom`||b===`right`?1:-1),closeDrawer:ge,velocity:o,dismissible:u}),i?.(e,!0);return}if(b===`bottom`||b===`right`?r>0:r<0){_e(),i?.(e,!0);return}if(o>qH){ge(),i?.(e,!1);return}let s=Math.min(J.current.getBoundingClientRect().height??0,window.innerHeight),l=Math.min(J.current.getBoundingClientRect().width??0,window.innerWidth);if(Math.abs(t)>=(b===`left`||b===`right`?l:s)*c){ge(),i?.(e,!1);return}i?.(e,!0),_e()}Y.useEffect(()=>(k&&(BH(document.documentElement,{scrollBehavior:`auto`}),R.current=new Date),()=>{VH(document.documentElement,`scrollBehavior`)}),[k]);function be(e){let t=e?(window.innerWidth-ZH)/window.innerWidth:1,n=e?-16:0;U.current&&window.clearTimeout(U.current),BH(J.current,{transition:`transform ${KH.DURATION}s cubic-bezier(${KH.EASE.join(`,`)})`,transform:HH(b)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&J.current&&(U.current=setTimeout(()=>{let e=UH(J.current,b);BH(J.current,{transition:`none`,transform:HH(b)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))}function xe(e,t){if(t<0)return;let n=(window.innerWidth-ZH)/window.innerWidth,r=n+t*(1-n),i=-16+t*ZH;BH(J.current,{transform:HH(b)?`scale(${r}) translate3d(0, ${i}px, 0)`:`scale(${r}) translate3d(${i}px, 0, 0)`,transition:`none`})}function Se(e,t){let n=HH(b)?window.innerHeight:window.innerWidth,r=t?(n-ZH)/n:1,i=t?-16:0;t&&BH(J.current,{transition:`transform ${KH.DURATION}s cubic-bezier(${KH.EASE.join(`,`)})`,transform:HH(b)?`scale(${r}) translate3d(0, ${i}px, 0)`:`scale(${r}) translate3d(${i}px, 0, 0)`})}return Y.useEffect(()=>{g||window.requestAnimationFrame(()=>{document.body.style.pointerEvents=`auto`})},[g]),Y.createElement(HV,{defaultOpen:x,onOpenChange:e=>{!u&&!e||(e?M(!0):ge(!0),A(e))},open:k},Y.createElement(fH.Provider,{value:{activeSnapPoint:re,snapPoints:a,setActiveSnapPoint:ae,drawerRef:J,overlayRef:L,onOpenChange:t,onPress:pe,onRelease:ye,onDrag:he,dismissible:u,shouldAnimate:K,handleOnly:d,isOpen:k,isDragging:N,shouldFade:le,closeDrawer:ge,onNestedDrag:xe,onNestedOpenChange:be,onNestedRelease:Se,keyboardIsOpen:G,modal:g,snapPointsOffset:se,activeSnapPointIndex:ie,direction:b,shouldScaleBackground:o,setBackgroundColorOnScale:s,noBodyStyles:y,container:D,autoFocus:O}},n))}var cU=Y.forwardRef(function({...e},t){let{overlayRef:n,snapPoints:r,onRelease:i,shouldFade:a,isOpen:o,modal:s,shouldAnimate:c}=pH(),l=RH(t,n),u=r&&r.length>0;if(!s)return null;let d=Y.useCallback(e=>i(e),[i]);return Y.createElement(XV,{onMouseUp:d,ref:l,"data-vaul-overlay":``,"data-vaul-snap-points":o&&u?`true`:`false`,"data-vaul-snap-points-overlay":o&&a?`true`:`false`,"data-vaul-animate":c?.current?`true`:`false`,...e})});cU.displayName=`Drawer.Overlay`;var lU=Y.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},i){let{drawerRef:a,onPress:o,onRelease:s,onDrag:c,keyboardIsOpen:l,snapPointsOffset:u,activeSnapPointIndex:d,modal:f,isOpen:p,direction:m,snapPoints:h,container:g,handleOnly:_,shouldAnimate:v,autoFocus:y}=pH(),[b,x]=Y.useState(!1),S=RH(i,a),C=Y.useRef(null),w=Y.useRef(null),T=Y.useRef(!1),E=h&&h.length>0;iU();let D=(e,t,n=0)=>{if(T.current)return!0;let r=Math.abs(e.y),i=Math.abs(e.x),a=i>r,o=[`bottom`,`right`].includes(t)?1:-1;if(t===`left`||t===`right`){if(!(e.x*o<0)&&i>=0&&i<=n)return a}else if(!(e.y*o<0)&&r>=0&&r<=n)return!a;return T.current=!0,!0};Y.useEffect(()=>{E&&window.requestAnimationFrame(()=>{x(!0)})},[]);function O(e){C.current=null,T.current=!1,s(e)}return Y.createElement(eH,{"data-vaul-drawer-direction":m,"data-vaul-drawer":``,"data-vaul-delayed-snap-points":b?`true`:`false`,"data-vaul-snap-points":p&&E?`true`:`false`,"data-vaul-custom-container":g?`true`:`false`,"data-vaul-animate":v?.current?`true`:`false`,...r,ref:S,style:u&&u.length>0?{"--snap-point-height":`${u[d??0]}px`,...t}:t,onPointerDown:e=>{_||(r.onPointerDown==null||r.onPointerDown.call(r,e),C.current={x:e.pageX,y:e.pageY},o(e))},onOpenAutoFocus:e=>{n?.(e),y||e.preventDefault()},onPointerDownOutside:t=>{if(e?.(t),!f||t.defaultPrevented){t.preventDefault();return}l.current&&=!1},onFocusOutside:e=>{if(!f){e.preventDefault();return}},onPointerMove:e=>{if(w.current=e,_||(r.onPointerMove==null||r.onPointerMove.call(r,e),!C.current))return;let t=e.pageY-C.current.y,n=e.pageX-C.current.x,i=e.pointerType===`touch`?10:2;D({x:n,y:t},m,i)?c(e):(Math.abs(n)>i||Math.abs(t)>i)&&(C.current=null)},onPointerUp:e=>{r.onPointerUp==null||r.onPointerUp.call(r,e),C.current=null,T.current=!1,s(e)},onPointerOut:e=>{r.onPointerOut==null||r.onPointerOut.call(r,e),O(w.current)},onContextMenu:e=>{r.onContextMenu==null||r.onContextMenu.call(r,e),w.current&&O(w.current)}})});lU.displayName=`Drawer.Content`;var uU=250,dU=120,fU=Y.forwardRef(function({preventCycle:e=!1,children:t,...n},r){let{closeDrawer:i,isDragging:a,snapPoints:o,activeSnapPoint:s,setActiveSnapPoint:c,dismissible:l,handleOnly:u,isOpen:d,onPress:f,onDrag:p}=pH(),m=Y.useRef(null),h=Y.useRef(!1);function g(){if(h.current){y();return}window.setTimeout(()=>{_()},dU)}function _(){if(a||e||h.current){y();return}if(y(),!o||o.length===0){l||i();return}if(s===o[o.length-1]&&l){i();return}let t=o.findIndex(e=>e===s);if(t===-1)return;let n=o[t+1];c(n)}function v(){m.current=window.setTimeout(()=>{h.current=!0},uU)}function y(){m.current&&window.clearTimeout(m.current),h.current=!1}return Y.createElement(`div`,{onClick:g,onPointerCancel:y,onPointerDown:e=>{u&&f(e),v()},onPointerMove:e=>{u&&p(e)},ref:r,"data-vaul-drawer-visible":d?`true`:`false`,"data-vaul-handle":``,"aria-hidden":`true`,...n},Y.createElement(`span`,{"data-vaul-handle-hitarea":``,"aria-hidden":`true`},t))});fU.displayName=`Drawer.Handle`;function pU({onDrag:e,onOpenChange:t,open:n,...r}){let{onNestedDrag:i,onNestedOpenChange:a,onNestedRelease:o}=pH();if(!i)throw Error(`Drawer.NestedRoot must be placed in another drawer`);return Y.createElement(sU,{nested:!0,open:n,onClose:()=>{a(!1)},onDrag:(t,n)=>{i(t,n),e?.(t,n)},onOpenChange:e=>{e&&a(e),t?.(e)},onRelease:o,...r})}function mU(e){let t=pH(),{container:n=t.container,...r}=e;return Y.createElement(JV,{container:n,...r})}var hU={Root:sU,NestedRoot:pU,Content:lU,Overlay:cU,Trigger:WV,Portal:mU,Handle:fU,Close:lH,Title:aH,Description:sH},gU=Y.createContext(void 0);function _U(e){let t=Y.useContext(gU);if(!e&&t===void 0)throw Error(Jg(27));return t}var vU=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),yU={"data-starting-style":``},bU={"data-ending-style":``},xU={transitionStatus(e){return e===`starting`?yU:e===`ending`?bU:null}};(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=vU.startingStyle]=`startingStyle`,e[e.endingStyle=vU.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({});var SU={"data-popup-open":``},CU={"data-popup-open":``,"data-pressed":``},wU={"data-open":``},TU={"data-closed":``},EU={"data-anchor-hidden":``},DU={open(e){return e?SU:null}},OU={open(e){return e?CU:null}},kU={open(e){return e?wU:TU},anchorHidden(e){return e?EU:null}},AU={...kU,...xU},jU=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=_U(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return l_(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:AU,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),MU=`none`,NU=`trigger-press`,PU=`trigger-hover`,FU=`trigger-focus`,IU=`outside-press`,LU=`item-press`,RU=`close-press`,zU=`input-change`,BU=`input-clear`,VU=`input-press`,HU=`focus-out`,UU=`escape-key`,WU=`list-navigation`,GU=`keyboard`,KU=`pointer`,qU=`cancel-open`,JU=`sibling-open`,YU=`disabled`,XU=`imperative-action`,ZU=`window-resize`;function QU(e,t,n,r){let i=!1,a=!1,o=r??c_;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function $U(e,t,n){let r=n??c_;return{reason:e,event:t??new Event(`base-ui`),...r}}var eW=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=_U(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=$g({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,QU(RU,e.nativeEvent))}return l_(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),tW=0;function nW(e,t=`mui`){let[n,r]=Y.useState(e),i=e||n;return Y.useEffect(()=>{n??(tW+=1,r(`${t}-${tW}`))},[n,t]),i}var rW=Og.useId;function iW(e,t){if(rW!==void 0){let n=rW();return e??(t?`${t}-${n}`:n)}return nW(e,t)}function aW(e){return iW(e,`base-ui`)}var oW=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=_U(),c=aW(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),l_(`p`,e,{ref:t,props:[{id:c},o]})});function sW(e){Y.useEffect(e,s_)}var cW=0,lW=class e{static create(){return new e}currentId=cW;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=cW,t()},e)}isStarted(){return this.currentId!==cW}clear=()=>{this.currentId!==cW&&(clearTimeout(this.currentId),this.currentId=cW)};disposeEffect=()=>this.clear};function uW(){let e=Ag(lW.create).current;return sW(e.disposeEffect),e}function dW(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:fW,platform:pW,maxTouchPoints:mW}=dW(),hW=fW.toLowerCase(),gW=pW.toLowerCase(),_W=/^i(os$|p)/.test(gW)||gW===`macintel`&&mW>1,vW=`android`,yW=gW===vW||hW.includes(vW),bW=!_W&&gW.startsWith(`mac`);gW.startsWith(`win`),!yW&&/^(linux|chrome os)/.test(gW);var xW=bW||_W,SW=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),CW=!SW&&hW.includes(`firefox`);!SW&&hW.includes(`chrom`);var wW=xW,TW=/jsdom|happydom/.test(hW);function EW(e){e.preventDefault(),e.stopPropagation()}function DW(e){return`nativeEvent`in e}function OW(e){return e.pointerType===``&&e.isTrusted?!0:yW&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function kW(e){return TW?!1:!yW&&e.width===0&&e.height===0||yW&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function AW(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function jW(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var MW=`data-base-ui-focusable`,NW=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,PW=`ArrowLeft`,FW=`ArrowRight`,IW=`ArrowUp`,LW=`ArrowDown`;function RW(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function zW(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ug(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function BW(e){return`composedPath`in e?e.composedPath()[0]:e.target}function VW(e,t){if(!cg(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(zW(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function HW(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function UW(e){return e.matches(`html,body`)}function WW(e){return lg(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function GW(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${NW}`)!=null}function KW(e){return e?e.getAttribute(`role`)===`combobox`&&WW(e):!1}function qW(e){if(!e||TW)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function JW(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function YW(e,t){return t!=null&&!AW(t)?0:typeof e==`function`?e():e}function XW(e,t,n){let r=YW(e,n);return typeof r==`number`?r:r?.[t]}function ZW(e){return typeof e==`function`?e():e}function QW(e,t){return t||e===`click`||e===`mousedown`}function $W(e){return e?.includes(`mouse`)&&e!==`mousedown`}var eG=Y.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new lW,currentIdRef:{current:null},currentContextRef:{current:null}});function tG(e,t){e.current=t.current}function nG(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=Y.useRef(n),a=Y.useRef(n),o=Y.useRef(null),s=Y.useRef(null),c=uW();return Q(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:XW(i.current,`open`),close:XW(n,`close`)}},[n,o,i,a]),(0,X.jsx)(eG.Provider,{value:Y.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function rG(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=Y.useContext(eG),[f,p]=Y.useState(!1),m=Y.useRef(n);return Q(()=>{m.current=n},[n]),Q(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),Q(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:XW(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,QU(MU))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),Q(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,tG(o,c),d.clear()}},[l,a,o,i,c,d]),Y.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function iG(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function aG(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function oG(e){let t=Ag(sG,e).current;return t.next=e,Q(t.effect),t}function sG(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var cG=null;globalThis.requestAnimationFrame;var lG=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},uG=class e{static create(){return new e}static request(e){return lG.request(e)}static cancel(e){return lG.cancel(e)}currentId=cG;request(e){this.cancel(),this.currentId=lG.request(()=>{this.currentId=cG,e()})}cancel=()=>{this.currentId!==cG&&(lG.cancel(this.currentId),this.currentId=cG)};disposeEffect=()=>this.cancel};function dG(){let e=Ag(uG.create).current;return sW(e.disposeEffect),e}var fG={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},pG={...fG,position:`fixed`,top:0,left:0},mG={...fG,position:`absolute`},hG=Y.forwardRef(function(e,t){let[n,r]=Y.useState();Q(()=>{wW&&SW&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,X.jsx)(`span`,{...e,ref:t,style:pG,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),gG=Math.min,_G=Math.max,vG=Math.round,yG=Math.floor,bG=e=>({x:e,y:e}),xG={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function SG(e,t,n){return _G(e,gG(t,n))}function CG(e,t){return typeof e==`function`?e(t):e}function wG(e){return e.split(`-`)[0]}function TG(e){return e.split(`-`)[1]}function EG(e){return e===`x`?`y`:`x`}function DG(e){return e===`y`?`height`:`width`}function OG(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function kG(e){return EG(OG(e))}function AG(e,t,n){n===void 0&&(n=!1);let r=TG(e),i=kG(e),a=DG(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=zG(o)),[o,zG(o)]}function jG(e){let t=zG(e);return[MG(e),t,MG(t)]}function MG(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var NG=[`left`,`right`],PG=[`right`,`left`],FG=[`top`,`bottom`],IG=[`bottom`,`top`];function LG(e,t,n){switch(e){case`top`:case`bottom`:return n?t?PG:NG:t?NG:PG;case`left`:case`right`:return t?FG:IG;default:return[]}}function RG(e,t,n,r){let i=TG(e),a=LG(wG(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(MG)))),a}function zG(e){let t=wG(e);return xG[t]+e.slice(t.length)}function BG(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function VG(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:BG(e)}function HG(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function UG(e,t,n){return Math.floor(e/t)!==n}function WG(e,t){return t<0||t>=e.length}function GG(e,t){return qG(e.current,{disabledIndices:t})}function KG(e,t){return qG(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function qG(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&YG(e,a,r));return a}function JG(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!YG(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=yG(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!YG(e,r,s))return r}};d&&EW(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=qG(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=qG(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}WG(e,f)&&(f=u)}if(n===`both`){let n=yG(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&EW(t),u%o===o-1?r&&(f=qG(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=qG(e,{startingIndex:u,disabledIndices:s}),r&&UG(f,o,n)&&(f=qG(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),UG(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&EW(t),u%o===0?r&&(f=qG(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=qG(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&UG(f,o,n)&&(f=qG(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),UG(f,o,n)&&(f=u));let c=yG(l/o)===n;WG(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:qG(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function YG(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!ZG(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function XG(e){return e.visibility===`hidden`||e.visibility===`collapse`}function ZG(e,t=e?Sg(e):null){return!e||!e.isConnected||!t||XG(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var QG=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function $G(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return ug(n)?n.host:null}function eK(e){for(let t of Array.from(e.children))if(ig(t)===`summary`)return t;return null}function tK(e,t){let n=eK(t);return!!n&&(e===n||zW(n,e))}function nK(e){let t=e?ig(e):``;return e!=null&&e.matches(QG)&&(t!==`summary`||e.parentElement!=null&&ig(e.parentElement)===`details`&&eK(e.parentElement)===e)&&(t!==`details`||eK(e)==null)&&(t!==`input`||e.type!==`hidden`)}function rK(e){if(!nK(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=$G(t)){let n=t!==e,r=ig(t)===`slot`;if(t.hasAttribute(`inert`)||n&&ig(t)===`details`&&!t.open&&!tK(e,t)||t.hasAttribute(`hidden`)||!r&&!iK(t,n))return!1}return!0}function iK(e,t){let n=Sg(e);return t?n.display!==`none`:ZG(e,n)}function aK(e){let t=e.tabIndex;if(t<0){let t=ig(e);if(t===`details`||t===`audio`||t===`video`||lg(e)&&e.isContentEditable)return 0}return t}function oK(e){if(ig(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function sK(e,t){let n=oK(e);if(!n)return!0;let r=t.find(e=>{let t=oK(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=oK(e);return t?.name===n.name&&t.form===n.form})===n}function cK(e){if(lg(e)&&ig(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return lg(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function lK(e,t){cK(e).forEach(e=>{nK(e)&&t.push(e),lK(e,t)})}function uK(e,t,n){cK(e).forEach(e=>{lg(e)&&e.matches(t)&&n.push(e),uK(e,t,n)})}function dK(e){return rK(e)&&aK(e)>=0}function fK(e){let t=[];return lK(e,t),t.filter(rK)}function pK(e){let t=fK(e);return t.filter(e=>aK(e)>=0&&sK(e,t))}function mK(e,t){let n=pK(e),r=n.length;if(r===0)return;let i=RW(Zg(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function hK(e){return mK(Zg(e).body,1)||e}function gK(e){return mK(Zg(e).body,-1)||e}function _K(e,t){if(!e)return null;let n=pK(Zg(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function vK(e){return _K(e,1)}function yK(e){return _K(e,-1)}function bK(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!zW(n,r)}function xK(e){pK(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function SK(e){let t=[];uK(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function CK(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...CK(e,t.id,n)])}function wK(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function TK(e){return`data-base-ui-${e}`}var EK=0;function DK(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(EK);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),o_;let o=requestAnimationFrame(a);return EK=o,()=>{EK===o&&(cancelAnimationFrame(o),EK=0)}}var OK={inert:new WeakMap,"aria-hidden":new WeakMap},kK=`data-base-ui-inert`,AK={inert:new WeakSet,"aria-hidden":new WeakSet},jK=new WeakMap,MK=0;function NK(e){return AK[e]}function PK(e){return e?ug(e)?e.host:PK(e.parentNode):null}var FK=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=PK(t);return e.contains(n)?n:null}).filter(e=>e!=null),IK=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},LK=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{ig(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function RK(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=FK(t,e),l=i?LK(t,IK(c),new Set(c)):[],u=[],d=[];if(a){let e=OK[a],n=NK(a);s=n,o=e;let r=FK(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);LK(t,IK(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(jK.get(e)||0)+1;jK.set(e,t),d.push(e),t===1&&e.setAttribute(kK,``)}),MK+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(jK.get(e)||0)-1;jK.set(e,t),t||e.removeAttribute(kK)}),--MK,MK||(OK.inert=new WeakMap,OK[`aria-hidden`]=new WeakMap,AK.inert=new WeakSet,AK[`aria-hidden`]=new WeakSet,jK=new WeakMap)}}function zK(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=Zg(e[0]).body;return RK(e,a,n,r,{mark:i})}var BK={style:{transition:`none`}},VK={fallbackAxisSide:`none`},HK={fallbackAxisSide:`end`},UK={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},WK=Y.createContext(null),GK=()=>Y.useContext(WK),KK=TK(`portal`);function qK(e={}){let{ref:t,container:n,componentProps:r=c_,elementProps:i}=e,a=iW(),o=GK()?.portalNode,[s,c]=Y.useState(null),[l,u]=Y.useState(null),d=Ng(e=>{e!==null&&u(e)}),f=Y.useRef(null);Q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(sg(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=l_(`div`,r,{ref:[t,d],props:[{id:a,[KK]:``},i]}),m=s&&p?Xi.createPortal(p,s):null;return{node:l,nodeId:Y.isValidElement(p)?p.props.id:void 0,subtree:m}}var JK=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=qK({container:o,ref:t,componentProps:e,elementProps:s}),d=Y.useRef(null),f=Y.useRef(null),p=Y.useRef(null),m=Y.useRef(null),[h,g]=Y.useState(null),_=Y.useRef(!1),v=h?.modal,y=h?.open,b=!!h&&!h.modal&&h.open&&!!c;Y.useEffect(()=>{if(!c||v)return;function e(e){c&&e.relatedTarget&&bK(e)&&(e.type===`focusin`?_.current&&=(SK(c),!1):(xK(c),_.current=!0))}return aG(iG(c,`focusin`,e,!0),iG(c,`focusout`,e,!0))},[c,v]),Q(()=>{!c||y!==!0||!_.current||(SK(c),_.current=!1)},[y,c]);let x=Y.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:g}),[c]);return(0,X.jsxs)(Y.Fragment,{children:[u,(0,X.jsxs)(WK.Provider,{value:x,children:[b&&c&&(0,X.jsx)(hG,{"data-type":`outside`,ref:d,onFocus:e=>{bK(e,c)?p.current?.focus():gK(h?h.domReference:null)?.focus()}}),b&&c&&(0,X.jsx)(`span`,{"aria-owns":l,style:UK}),c&&Xi.createPortal(a,c),b&&c&&(0,X.jsx)(hG,{"data-type":`outside`,ref:f,onFocus:e=>{bK(e,c)?m.current?.focus():(hK(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,QU(`focus-out`,e.nativeEvent)))}})]})]})});function YK(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var XK=class{nodesRef={current:[]};events=YK();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},ZK=Y.createContext(null),QK=Y.createContext(null),$K=()=>Y.useContext(ZK)?.id||null,eq=e=>{let t=Y.useContext(QK);return e??t};function tq(e){let t=iW(),n=eq(e),r=$K();return Q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function nq(e){let{children:t,id:n}=e,r=$K();return(0,X.jsx)(ZK.Provider,{value:Y.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function rq(e){let{children:t,externalTree:n}=e,r=Ag(()=>n??new XK).current;return(0,X.jsx)(QK.Provider,{value:r,children:t})}function iq(e){return e==null?e:`current`in e?e.current:e}function aq(e,t){let n=ag(BW(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var oq=20,sq=[];function cq(){sq=sq.filter(e=>e.deref()?.isConnected)}function lq(e){cq(),e&&ig(e)!==`body`&&(sq.push(new WeakRef(e)),sq.length>oq&&(sq=sq.slice(-20)))}function uq(){return cq(),sq[sq.length-1]?.deref()}function dq(e){return e?dK(e)?e:pK(e)[0]||e:null}function fq(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=fK(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return dK(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function pq(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=Ng(()=>b.current.floatingContext?.nodeId),S=i===!1,C=KW(_)&&S,w=oG(i),T=oG(a),E=oG(l),D=oG(g),O=eq(p),k=GK(),A=Y.useRef(!1),j=Y.useRef(!1),M=Y.useRef(!1),N=Y.useRef(null),P=Y.useRef(``),F=Y.useRef(``),I=Y.useRef(null),L=Y.useRef(null),R=t_(I,f,k?.beforeInsideRef),z=t_(L,k?.afterInsideRef),B=uW(),V=uW(),H=dG(),U=k!=null,W=JW(v),G=Ng((e=W)=>e?pK(e):[]),K=Ng(()=>m?.().filter(e=>e!=null)??[]);Y.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&zW(W,RW(Zg(W)))&&G().length===0&&!C&&EW(e)}return iG(Zg(W),`keydown`,e)},[r,W,s,C,G]),Y.useEffect(()=>{if(r||!g)return;let e=Zg(W);function t(){M.current=!1}function n(e){let t=BW(e),n=K(),r=zW(v,t)||zW(_,t)||zW(k?.portalNode,t)||n.some(e=>e===t||zW(e,t));M.current=!r,F.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(j.current=!0,V.start(0,()=>{j.current=!1}))}function i(){F.current=`keyboard`}return aG(iG(e,`pointerdown`,n,!0),iG(e,`pointerup`,t,!0),iG(e,`pointercancel`,t,!0),iG(e,`keydown`,i,!0),t)},[r,v,_,W,g,k,V,K]),Y.useEffect(()=>{if(r||!c)return;let e=Zg(W);function t(){j.current=!0,V.start(0,()=>{j.current=!1})}function n(e){let t=BW(e);dK(t)&&(N.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=BW(t);s&&n==null&&i!=null&&zW(v,i)&&lq(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=K(),f=n?.hasAttribute(TK(`focus-guard`))&&[I.current,L.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,iq(d),iq(u)].includes(n),p=!(zW(_,n)||zW(v,n)||zW(n,v)||zW(k?.portalNode,n)||l.some(e=>e===n||zW(e,n))||c.hasMatchingElement(e=>zW(e,n))||f||O&&(CK(O.nodesRef.current,a).find(e=>zW(e.context?.elements.floating,n)||zW(e.context?.elements.domReference,n))||wK(O.nodesRef.current,a).find(e=>[e.context?.elements.floating,JW(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&W&&fq(W),o&&r!==_&&!ZG(i)&&RW(e)===e.body){if(lg(W)&&(W.focus(),o===`popup`)){H.request(()=>{W.focus()});return}let e=G(),t=N.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;lg(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!j.current&&(C||n!==uq())&&(A.current=!0,h.setOpen(!1,QU(HU,t)))})}function a(){M.current||(b.current.insideReactTree=!0,B.start(0,()=>{b.current.insideReactTree=!1}))}let l=lg(_)?_:null;if(!(!v&&!l))return aG(l&&iG(l,`focusout`,i),l&&iG(l,`pointerdown`,t),v&&iG(v,`focusin`,n),v&&iG(v,`focusout`,i),v&&k&&iG(v,`focusout`,a,!0))},[r,_,v,W,s,O,k,h,c,o,G,C,x,b,B,V,H,u,d,K]),Y.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(k?.portalNode?.querySelectorAll(`[${TK(`portal`)}]`)||[]),t=(O?wK(O.nodesRef.current,x()):[]).find(e=>KW(e.context?.elements.domReference||null))?.context?.elements.domReference,n=zK([v,...e,I.current,L.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...K(),t,iq(d),iq(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=zK([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,k,C,O,x,u,d,K]),Q(()=>{if(!g||r||!lg(W))return;P.current=``,F.current=``;let e=Zg(W),t=RW(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(E.current||``):n;if(r===void 0||r===!1||zW(W,t))return;let i=null,a=()=>(i??=G(W),i[0]||W),o;o=r===!0||r===null?a():iq(r),o||=a();let s=zW(W,RW(e));DK(o,{preventScroll:o===W,shouldFocus(){if(!D.current)return!1;if(s)return!0;let t=RW(e);return!(t!==o&&zW(W,t))}})})},[r,g,W,G,w,E,D]),Q(()=>{if(r||!W)return;let e=Zg(W),t=RW(e),n=E.current==null;lq(t);function i(e){if(e.open||(P.current=aq(e.nativeEvent,F.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(A.current=!0),e.reason===`outside-press`){if(e.nested)A.current=!1;else if(OW(e.nativeEvent)||kW(e.nativeEvent))A.current=!1;else{let e=!1;Zg(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?A.current=!1:A.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&ig(t)!==`body`?t:null,s=n?o||a:a||o;return s||=uq()||null,typeof i==`boolean`?s:iq(i)||s||null}return()=>{y.off(`openchange`,i);let t=RW(e),n=K(),r=zW(v,t)||n.some(e=>e===t||zW(e,t))||O&&CK(O.nodesRef.current,x(),!1).some(e=>zW(e.context?.elements.floating,t)),o=T.current,s=P.current,c=a(s);queueMicrotask(()=>{let n=dq(c),i=typeof o!=`boolean`;if(o&&!A.current&&lg(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}A.current=!1})}},[r,v,W,T,E,y,O,_,x,K]),Q(()=>{if(!SW||g||!v)return;let e=RW(Zg(v));!lg(e)||!WW(e)||zW(v,e)&&e.blur()},[g,v]),Q(()=>{if(!(r||!k))return k.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{k.setFocusManagerState(null)}},[r,k,s,g,h,c,_]),Q(()=>{if(!(r||!W))return fq(W),()=>{queueMicrotask(cq)}},[r,W]);let q=!r&&(!s||!C)&&(U||s);return(0,X.jsxs)(Y.Fragment,{children:[q&&(0,X.jsx)(hG,{"data-type":`inside`,ref:R,onFocus:e=>{if(s){let e=G();DK(e[e.length-1])}else k?.portalNode&&(A.current=!1,bK(e,k.portalNode)?hK(_)?.focus():iq(d??k.beforeOutsideRef)?.focus())}}),n,q&&(0,X.jsx)(hG,{"data-type":`inside`,ref:z,onFocus:e=>{s?DK(G()[0]):k?.portalNode&&(c&&(A.current=!0),bK(e,k.portalNode)?gK(_)?.focus():iq(u??k.afterOutsideRef)?.focus())}})]})}function mq(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=NU}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=Y.useRef(void 0),f=dG(),p=uW(),m=Y.useMemo(()=>{function e(e,t,n,r){let i=QU(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=AW(e.pointerType,!0)&&kW(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||AW(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=BW(o);if(WW(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}AW(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return Y.useMemo(()=>n?{reference:m}:c_,[n,m])}function hq(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function gq(e){return e!=null&&e.clientX!=null}function _q(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=Y.useRef(!1),u=Y.useRef(null),[d,f]=Y.useState(),[p,m]=Y.useState([]),h=Ng(e=>{i.set(`positionReference`,e)}),g=Ng((e,t,n)=>{l.current||c.current.openEvent&&!gq(c.current.openEvent)||i.set(`positionReference`,hq(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=Ng(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=AW(d)?o:a;Y.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=ag(o);function r(t){let n=BW(t);zW(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||gq(c.current.openEvent)?u.current=iG(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),Y.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),Y.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),Y.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=Y.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return Y.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function vq(){return!1}function yq(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function bq(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=vq,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f}=l.context,p=eq(c),m=Ng(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=Ng(()=>a),{escapeKey:v,outsidePress:y}=yq(s),b=Y.useRef(!1),x=Y.useRef(!1),S=Y.useRef(!1),C=Y.useRef(!1),w=Y.useRef(``),T=Y.useRef(null),E=uW(),D=uW(),O=Ng(()=>{D.clear(),f.current.insideReactTree=!1}),k=Ng(e=>{let t=f.current.floatingContext?.nodeId;return(p?CK(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),A=Ng(e=>HW(e,l.select(`floatingElement`))||HW(e,l.select(`domReferenceElement`))),j=Ng(e=>{o()&&l.setOpen(!1,QU(NU,e.nativeEvent))}),M=Ng(e=>{if(!u||!n||!r||e.key!==`Escape`||C.current||!v&&k(`__escapeKeyBubbles`))return;let t=QU(UU,DW(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!v&&!t.isPropagationAllowed&&e.stopPropagation()}),N=Ng(()=>{f.current.insideReactTree=!0,D.start(0,O)}),P=Ng(e=>{if(!u||!n||e.button!==0)return;let t=BW(e.nativeEvent);zW(l.select(`floatingElement`),t)&&(b.current||(b.current=!0,x.current=!1))}),F=Ng(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});Y.useEffect(()=>{if(!u||!n)return O;f.current.__escapeKeyBubbles=v,f.current.__outsidePressBubbles=y;let e=new lW,t=new lW;function i(){e.clear(),C.current=!0}function a(){e.start(SW?5:0,()=>{C.current=!1})}function o(){S.current=!0,t.start(0,()=>{S.current=!1})}function s(){b.current=!1,x.current=!1}function c(){let e=w.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function D(e){let t=f.current.floatingContext?.nodeId,n=p&&CK(p.nodesRef.current,t).some(t=>HW(e,t.context?.elements.floating));return A(e)||n}function j(e){if(m(e)){e.type!==`click`&&!A(e)&&(t.clear(),S.current=!1),O();return}if(f.current.insideReactTree){O();return}let n=BW(e),r=`[${TK(`inert`)}]`,i=cg(n)?n.getRootNode():null,a=Array.from((ug(i)?i:Zg(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>zW(e,n))))return;let s=cg(n)?n:null;for(;s&&!xg(s);){let e=wg(s);if(xg(e)||!cg(e))break;s=e}if(!(a.length&&cg(n)&&!UW(n)&&!zW(n,l.select(`floatingElement`))&&a.every(e=>!zW(s,e)))){if(lg(n)&&!(`touches`in e)){let t=xg(n),r=Sg(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!D(e)){if(c()===`intentional`&&S.current){t.clear(),S.current=!1;return}typeof h==`function`&&!h(e)||k(`__outsidePressBubbles`)||(l.setOpen(!1,QU(IU,e)),O())}}}function N(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||A(e)||j(e)}function P(e){if(c()!==`sloppy`||!l.select(`open`)||!n||A(e))return;let t=e.touches[0];t&&(T.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}function F(e,t){let n=BW(e);if(!n)return;let r=iG(n,e.type,()=>{t(e),r()})}function I(e){w.current=`touch`,F(e,P)}function L(e){E.clear(),e.type===`pointerdown`&&(w.current=e.pointerType),!(e.type===`mousedown`&&T.current&&!T.current.dismissOnMouseDown)&&F(e,e=>{e.type===`pointerdown`?N(e):j(e)})}function R(e){if(!b.current)return;let n=x.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!D(e)){if(n){o();return}typeof h==`function`&&!h(e)||(t.clear(),S.current=!0,O())}}}function z(e){if(c()!==`sloppy`||!T.current||A(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-T.current.startX),r=Math.abs(t.clientY-T.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(T.current.dismissOnTouchEnd=!0),i>10&&(j(e),E.clear(),T.current=null)}function B(e){F(e,z)}function V(e){c()!==`sloppy`||!T.current||A(e)||(T.current.dismissOnTouchEnd&&j(e),E.clear(),T.current=null)}function H(e){F(e,V)}let U=Zg(d),W=aG(r&&aG(iG(U,`keydown`,M),iG(U,`compositionstart`,i),iG(U,`compositionend`,a)),g&&aG(iG(U,`click`,L,!0),iG(U,`pointerdown`,L,!0),iG(U,`pointerup`,R,!0),iG(U,`pointercancel`,R,!0),iG(U,`mousedown`,L,!0),iG(U,`mouseup`,R,!0),iG(U,`touchstart`,I,!0),iG(U,`touchmove`,B,!0),iG(U,`touchend`,H,!0)));return()=>{W(),e.clear(),t.clear(),s(),S.current=!1,O()}},[f,d,r,g,h,u,n,v,y,M,O,_,k,A,p,l,E]);let I=Y.useMemo(()=>({onKeyDown:M,onPointerDown:j,onClick:j}),[M,j]),L=Y.useMemo(()=>({onKeyDown:M,onPointerDown:F,onMouseDown:F,onClickCapture:N,onMouseDownCapture(e){N(),P(e)},onPointerDownCapture(e){N(),P(e)},onMouseUpCapture:N,onTouchEndCapture:N,onTouchMoveCapture:N}),[M,N,P,F]);return Y.useMemo(()=>n?{reference:I,floating:L,trigger:I}:{},[n,I,L])}function xq(e,t,n){let{reference:r,floating:i}=e,a=OG(t),o=kG(t),s=DG(o),c=wG(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=TG(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Sq(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=CG(t,e),p=VG(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=HG(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=HG(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Cq=50,wq=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Sq},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=xq(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Cq&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=xq(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Tq=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=CG(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=wG(r),_=OG(o),v=wG(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[zG(o)]:jG(o)),x=p!==`none`;!d&&x&&b.push(...RG(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=AG(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===OG(t)||T.every(e=>OG(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=OG(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Eq=new Set([`left`,`top`]);async function Dq(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=wG(n),s=TG(n),c=OG(n)===`y`,l=Eq.has(o)?-1:1,u=a&&c?-1:1,d=CG(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Oq=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Dq(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},kq=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=CG(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=OG(i),p=EG(f),m=u[p],h=u[f],g=(e,t)=>SG(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Aq=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=CG(e,t),u={x:n,y:r},d=OG(i),f=EG(d),p=u[f],m=u[d],h=CG(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Eq.has(wG(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},jq=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=CG(e,t),c=await i.detectOverflow(t,s),l=wG(n),u=TG(n),d=OG(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=gG(p-c[m],g),y=gG(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*_G(c.left,c.right):S=p-2*_G(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Mq(e){let t=Sg(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=lg(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=vG(n)!==a||vG(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Nq(e){return cg(e)?e:e.contextElement}function Pq(e){let t=Nq(e);if(!lg(t))return bG(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Mq(t),o=(a?vG(n.width):n.width)/r,s=(a?vG(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Fq=bG(0);function Iq(e){let t=ag(e);return!bg()||!t.visualViewport?Fq:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Lq(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ag(e)}function Rq(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Nq(e),o=bG(1);t&&(r?cg(r)&&(o=Pq(r)):o=Pq(e));let s=Lq(a,n,r)?Iq(a):bG(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=ag(a),t=cg(r)?ag(r):r,n=e,i=Dg(n);for(;i&&t!==n;){let e=Pq(i),t=i.getBoundingClientRect(),r=Sg(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ag(i),i=Dg(n)}}return HG({width:u,height:d,x:c,y:l})}function zq(e,t){let n=Cg(e).scrollLeft;return t?t.left+n:Rq(og(e)).left+n}function Bq(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-zq(e,n),y:n.top+t.scrollTop}}function Vq(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=og(r),s=t?pg(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=bG(1),u=bG(0),d=lg(r);if((d||!a)&&((ig(r)!==`body`||dg(o))&&(c=Cg(r)),d)){let e=Rq(r);l=Pq(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Bq(o,c):bG(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Hq(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Uq(e){let t=Cg(e),n=e.ownerDocument.body,r=_G(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=_G(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+zq(e),o=-t.scrollTop;return Sg(n).direction===`rtl`&&(a+=_G(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Wq=25;function Gq(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ag(e),a=og(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!bg()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(zq(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Wq&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Kq(e,t){let n=Rq(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Pq(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function qq(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Gq(e,n,t);else if(t===`document`)r=Uq(og(e));else if(cg(t))r=Kq(t,n);else{let n=Iq(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return HG(r)}function Jq(e,t){let n=t.get(e);if(n)return n;let r=Eg(e,[],!1).filter(e=>cg(e)&&ig(e)!==`body`),i=null,a=Sg(e).position===`fixed`,o=a?wg(e):e;for(;cg(o)&&!xg(o);){let e=Sg(o),t=vg(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=wg(o)}return t.set(e,r),r}function Yq(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?pg(t)?[]:Jq(t,this._c):[].concat(n),r],o=qq(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=qq(t,a[e],i);s=_G(n.top,s),c=gG(n.right,c),l=gG(n.bottom,l),u=_G(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Xq(e){let{width:t,height:n}=Mq(e);return{width:t,height:n}}function Zq(e,t,n){let r=lg(t),i=og(t),a=n===`fixed`,o=Rq(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=bG(0);if((r||!a)&&((ig(t)!==`body`||dg(i))&&(s=Cg(t)),r)){let e=Rq(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=zq(i));let l=i&&!r&&!a?Bq(i,s):bG(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Qq(e){return Sg(e).position===`static`}function $q(e,t){if(!lg(e)||Sg(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return og(e)===n&&(n=n.ownerDocument.body),n}function eJ(e,t){let n=ag(e);if(pg(e))return n;if(!lg(e)){let t=wg(e);for(;t&&!xg(t);){if(cg(t)&&!Qq(t))return t;t=wg(t)}return n}let r=$q(e,t);for(;r&&fg(r)&&Qq(r);)r=$q(r,t);return r&&xg(r)&&Qq(r)&&!vg(r)?n:r||yg(e)||n}var tJ=async function(e){let t=this.getOffsetParent||eJ,n=this.getDimensions,r=await n(e.floating);return{reference:Zq(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function nJ(e){return Sg(e).direction===`rtl`}var rJ={convertOffsetParentRelativeRectToViewportRelativeRect:Vq,getDocumentElement:og,getClippingRect:Yq,getOffsetParent:eJ,getElementRects:tJ,getClientRects:Hq,getDimensions:Xq,getScale:Pq,isElement:cg,isRTL:nJ};function iJ(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function aJ(e,t,n){let r=null,i,a=og(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=yG(d),h=yG(a.clientWidth-(u+f)),g=yG(a.clientHeight-(d+p)),_=yG(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:_G(0,gG(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!iJ(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=ag(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function oJ(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Nq(e),u=i||a?[...l?Eg(l):[],...t?Eg(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?aJ(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Rq(e):null;c&&g();function g(){let t=Rq(e);h&&!iJ(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var sJ=Oq,cJ=kq,lJ=Tq,uJ=jq,dJ=Aq,fJ=(e,t,n)=>{let r=new Map,i=n??{},a={...rJ,...i.platform,_c:r};return wq(e,t,{...i,platform:a})},pJ=typeof document<`u`?Y.useLayoutEffect:function(){};function mJ(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!mJ(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!mJ(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function hJ(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gJ(e,t){let n=hJ(e);return Math.round(t*n)/n}function _J(e){let t=Y.useRef(e);return pJ(()=>{t.current=e}),t}function vJ(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=Y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=Y.useState(r);mJ(f,r)||p(r);let[m,h]=Y.useState(null),[g,_]=Y.useState(null),v=Y.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=Y.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=Y.useRef(null),C=Y.useRef(null),w=Y.useRef(u),T=c!=null,E=_J(c),D=_J(i),O=_J(l),k=Y.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),fJ(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!mJ(w.current,t)&&(w.current=t,Xi.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);pJ(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=Y.useRef(!1);pJ(()=>(A.current=!0,()=>{A.current=!1}),[]),pJ(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=Y.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=Y.useMemo(()=>({reference:b,floating:x}),[b,x]),N=Y.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=gJ(M.floating,u.x),r=gJ(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...hJ(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return Y.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var yJ=(e,t)=>{let n=sJ(e);return{name:n.name,fn:n.fn,options:[e,t]}},bJ=(e,t)=>{let n=cJ(e);return{name:n.name,fn:n.fn,options:[e,t]}},xJ=(e,t)=>({fn:dJ(e).fn,options:[e,t]}),SJ=(e,t)=>{let n=lJ(e);return{name:n.name,fn:n.fn,options:[e,t]}},CJ=(e,t)=>{let n=uJ(e);return{name:n.name,fn:n.fn,options:[e,t]}},wJ=[],TJ=void 0;function EJ(){return TJ}function DJ(e){wJ.push(e)}function OJ(e){let t=(t,n)=>{let r=Ag(AJ).current,i;try{TJ=r;for(let e of wJ)e.before(r);i=e(t,n);for(let e of wJ)e.after(r);r.didInitialize=!0}finally{TJ=void 0}return i};return t.displayName=e.displayName||e.name,t}function kJ(e){return Y.forwardRef(OJ(e))}function AJ(){return{didInitialize:!1}}var jJ=Ni(),MJ=i_(19)?PJ:FJ;function $(e,t,n,r,i){return MJ(e,t,n,r,i)}function NJ(e,t,n,r,i){let a=Y.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,jJ.useSyncExternalStore)(e.subscribe,a,a)}DJ({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,jJ.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function PJ(e,t,n,r,i){let a=EJ();if(!a)return NJ(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function FJ(e,t,n,r,i){return(0,Fi.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var IJ=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return $(this,e,t,n,r)}},LJ=class extends IJ{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){Y.useDebugValue(e);let n=this;Q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){Y.useDebugValue(e);let n=this,r=t!==void 0;Q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return Y.useDebugValue(e),$(this,this.selectors[e],t,n,r)}useContextCallback(e,t){Y.useDebugValue(e);let n=Ng(t??o_);this.context[e]=n}useStateSetter(e){let t=Y.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},RJ={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},zJ=class extends LJ{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:YK(),nested:n,triggerElements:i},RJ),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&jW(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function BJ(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=Y.useRef(null);r===void 0&&f.current===null&&(f.current=new zJ({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),Q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};cg(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function VJ(e,t=!1,n=!1){let[r,i]=Y.useState(e&&t?`idle`:void 0),[a,o]=Y.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),Q(()=>{if(!e&&a&&r!==`ending`&&n){let e=uG.request(()=>{i(`ending`)});return()=>{uG.cancel(e)}}},[e,a,r,n]),Q(()=>{if(!e||t)return;let n=uG.request(()=>{i(void 0)});return()=>{uG.cancel(n)}},[t,e]),Q(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=uG.request(()=>{i(`idle`)});return()=>{uG.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function HJ(e,t=!1){let n=dG();return Ng((r,i=null)=>{n.cancel();let a=iq(e);if(a==null)return;let o=a,s=()=>{Xi.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||s()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){c();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(c);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),c())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(c)})}function UJ(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=Ng(i),o=HJ(r,n);Y.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var WJ={tabIndex:-1,[MW]:``};function GJ(e){return t=>t!==`touch`||e.current}function KJ(e,t=!1){let n=iW(),r=$K()!=null,i=Ag(()=>e(n,r)).current;return BJ({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function qJ({handle:e,store:t}){return Q(()=>e.attachStore(t),[e,t]),null}function JJ(e,t){let n=Y.useRef(null),r=Y.useRef(null);return Y.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function YJ(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function XJ(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function ZJ(e,t,n,r={}){let i=n.reason,a=i===PU,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=XJ(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i={...r.extraState,open:t};o?i.instantType=`focus`:s?i.instantType=`dismiss`:a&&(i.instantType=void 0),YJ(i,t,n.trigger,c()),e.update(i)};a?Xi.flushSync(l):l()}function QJ(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=JJ(e,n),o=Ng(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=Y.useCallback(e=>{a(e),e&&o(e)},[a,o]);return Q(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function $J(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=Y.useRef(null),i=e.useState(`open`);Q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=QU(MU);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function eY(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=VJ(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=Ng(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return UJ({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function tY(e,t){e.useSyncedValues(t),Q(()=>()=>{e.update({activeTriggerProps:c_,inactiveTriggerProps:c_,popupProps:c_})},[e])}function nY(e,t){Q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var rY=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function iY(){return new zJ({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new rY,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function aY(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:iY(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:c_,inactiveTriggerProps:c_,popupProps:c_}}function oY(e,t,n=!1){return new zJ({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var sY=e=>e.triggerIdProp??e.activeTriggerId,cY=e=>e.openProp??e.open,lY=e=>(e.popupElement?.id??e.floatingId)||void 0;function uY(e,t){return t!==void 0&&cY(e)&&sY(e)===t}function dY(e,t){return uY(e,t)?!0:t!==void 0&&cY(e)&&sY(e)==null&&e.triggerCount===1}var fY={open:cY,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:sY,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:lY,isTriggerActive:(e,t)=>t!==void 0&&sY(e)===t,isOpenedByTrigger:(e,t)=>uY(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&sY(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>dY(e,t)?lY(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function pY(e){let t=Y.useCallback(t=>e===void 0?o_:e.subscribeStore(t),[e]),n=Y.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,jJ.useSyncExternalStore)(t,n,()=>e?.serverStore)}function mY(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=iW(),a=$K()!=null,o=Ag(()=>new zJ({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new rY,floatingId:i,syncOnly:!1,nested:a})).current;return Q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=cg(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function hY(e){return gY(e,e.rootContext)}function gY(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=Y.useState(null),[d,f]=Y.useState(void 0),[p,m]=Y.useState(void 0),h=Y.useRef(null),g=eq(r),_=Y.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=vJ({...e,elements:{..._,...l&&{reference:l}}}),y=cg(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let x=Y.useCallback(e=>{let t=cg(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),S=Y.useCallback(e=>{(cg(e)||e===null)&&(h.current=e,f(e)),(cg(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!cg(e))&&v.refs.setReference(e)},[v.refs,f]),C=Y.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),w=Y.useMemo(()=>({...v.refs,setReference:S,setFloating:C,setPositionReference:x,domReference:h}),[v.refs,S,C,x]),T=Y.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),E=Y.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:w,elements:T,nodeId:n,rootStore:t}),[v,w,T,n,t,s,c]);return Q(()=>{o&&(h.current=o)},[o]),Q(()=>{t.context.dataRef.current.floatingContext=E;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=E)}),Y.useMemo(()=>({...v,context:E,refs:w,elements:T,rootStore:t}),[v,w,T,E,t])}var _Y=bW&&SW;function vY(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=Y.useRef(!1),c=Y.useRef(null),l=Y.useRef(!0),u=uW();Y.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=ag(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&lg(e)&&e===RW(Zg(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return aG(iG(t,`blur`,r),_Y&&iG(t,`keydown`,a,!0),_Y&&iG(t,`pointerdown`,o,!0))},[i,n]),Y.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);cg(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=Y.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=BW(t.nativeEvent);if(cg(a)){if(_Y&&!t.relatedTarget){if(!l.current&&!WW(a))return}else if(!qW(a))return}let o=VW(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,QU(FU,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,QU(FU,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=cg(n)&&n.hasAttribute(TK(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=RW(Zg(e));!n&&t===e||zW(o.current.floatingContext?.refs.floating.current,t)||zW(e,t)||a||VW(n??t,i.context.triggerElements)||i.setOpen(!1,QU(FU,r))})}}},[o,r,i,u]);return Y.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var yY=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new lW,this.restTimeout=new lW,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},bY=new WeakMap;function xY(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&bY.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),bY.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function SY(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=bY.get(n);a&&a!==e&&xY(a),xY(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,bY.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function CY(e){let t=e.context.dataRef.current,n=Ag(()=>t.hoverInteractionState??yY.create()).current;return t.hoverInteractionState||=n,sW(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function wY(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=eq(),d=$K(),f=CY(a),p=uW(),m=Ng(()=>QW(l.current.openEvent?.type,f.interactedInside)),h=Ng(()=>$W(l.current.openEvent?.type)),g=Ng(()=>{xY(f)});Q(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),Y.useEffect(()=>g,[g]),Q(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&cg(c)&&s){let e=c,t=s,n=Zg(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return SY(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),Y.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&CK(u.nodesRef.current,d).length>0)}function t(e){let t=XW(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,QU(PU,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=BW(e);if(!GW(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(VW(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&cg(o)&&CK(u.nodesRef.current,r,!1).some(e=>zW(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,QU(PU,t)),u.events.emit(`floating.closed`,t)})}let y=s;return aG(y&&iG(y,`mouseenter`,c),y&&iG(y,`mouseleave`,_),y&&iG(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var TY={current:null};function EY(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=TY,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=eq(l),y=CY(h),b=Y.useRef(!1),x=oG(i),S=oG(r),C=oG(o),w=oG(n),T=oG(p),E=oG(f),D=Ng(()=>QW(g.current.openEvent?.type,y.interactedInside)),O=Ng(()=>T.current?.()!==!1),k=Ng((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!zW(e,t);if(!cg(n))return!1;let i=n;return r.hasMatchingElement(e=>zW(e,i))&&(!e||!zW(e,i))}),A=Ng(()=>{y.handler&&=(Zg(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=Ng(()=>{xY(y)});return u&&(y.handleCloseOptions=x.current?.__options),Y.useEffect(()=>A,[A]),Y.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===PU,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,A]),Y.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=XW(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,QU(PU,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,QU(PU,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!cg(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!AW(y.pointerType))return;let t=ZW(C.current),n=XW(S.current,`open`,y.pointerType),r=BW(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(cg(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(zW(e,r)){s=e;break}}cg(i)&&cg(o)&&!h.context.triggerElements.hasElement(i)&&zW(i,o)&&(s=o);let c=s!=null&&k(o,s,r),l=h.select(`open`),u=E.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&cg(s)&&cg(o)&&zW(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){O()&&h.setOpen(!0,QU(PU,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&O()&&h.setOpen(!0,QU(PU,e,s))}):g&&O()&&h.setOpen(!0,QU(PU,e,s)))}function i(t){if(D()){j();return}A();let n=Zg(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!VW(t.relatedTarget,h.context.triggerElements)){if(x.current&&r){h.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=x.current({...r,tree:v,x:t.clientX,y:t.clientY,onClose(){j(),A(),w.current&&!D()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!zW(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){zW(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?iG(t,`mouseout`,o):void 0;return s?aG(iG(t,`mousemove`,r,{once:!0}),iG(t,`mouseenter`,r),iG(t,`mouseleave`,i),l):aG(iG(t,`mouseenter`,r),iG(t,`mouseleave`,i),l)},[A,j,g,S,h,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,m]),Y.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=k(r,n,e.target);if(a&&!AW(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;SY(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=ZW(C.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,D())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&O()&&h.setOpen(!0,QU(PU,t,n))}y.pointerType===`touch`?Xi.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,D,k,a,h,C,O])}var DY=`Escape`;function OY(e){return SW&&e.movementX===0&&e.movementY===0}function kY(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function AY(e,t){return kY(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function jY(e,t,n){return kY(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function MY(e,t,n){return kY(t,n?e===PW:e===FW,e===LW)}function NY(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===DY:kY(t,n?e===FW:e===PW,e===IW)}function PY(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:b,grid:x}=t,S=x!=null,C=`rootStore`in e?e.rootStore:e,w=C.useState(`open`),T=C.useState(`floatingElement`),E=C.useState(`domReferenceElement`),D=C.context.dataRef,O=JW(T),k=KW(E),A=oG(O),j=$K(),M=eq(b),N=Y.useRef(f),P=Y.useRef(o??-1),F=Y.useRef(null),I=Y.useRef(!0),L=Ng(e=>{i(P.current===-1?null:P.current,e)}),R=Y.useRef(!!T),z=Y.useRef(w),B=Y.useRef(!1),V=Y.useRef(!1),H=Y.useRef(null),U=oG(h),W=oG(w),G=oG(o),K=oG(y),q=dG(),J=dG(),ee=Ng(()=>{function e(e){d?M?.events.emit(`virtualfocus`,e):H.current=DK(e,{sync:B.current,preventScroll:!0})}let t=n.current[P.current],r=V.current;t&&e(t),(B.current?e=>e():e=>q.request(e))(()=>{let i=n.current[P.current]||t;i&&(t||e(i),oe&&(r||!I.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Q(()=>{D.current.orientation=g},[D,g]),Q(()=>{a&&(w&&T?(P.current=o??-1,N.current&&o!=null&&(V.current=!0,L())):R.current&&(P.current=-1,L()))},[a,w,T,o,L]),Q(()=>{if(a){if(!w){B.current=!1;return}if(T){if(r==null){if(B.current=!1,G.current!=null)return;if(R.current&&(P.current=-1,ee()),(!z.current||!R.current)&&N.current&&(F.current!=null||N.current===!0&&F.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>J.request(e):queueMicrotask)(t),e+=1):(P.current=F.current==null||jY(F.current,g,u)||l?GG(n):KG(n),F.current=null,L())};t()}}else WG(n.current,r)||(P.current=r,ee(),V.current=!1)}}},[a,w,T,r,G,l,n,g,u,L,ee,J]),Q(()=>{if(!a||T||!M||d||!R.current)return;let e=M.nodesRef.current,t=e.find(e=>e.id===j)?.context?.elements.floating,n=RW(Zg(E??t??null)),r=e.some(e=>e.context&&zW(e.context.elements.floating,n));t&&!r&&I.current&&t.focus({preventScroll:!0})},[a,T,E,M,j,d]),Q(()=>{z.current=w,R.current=!!T}),Q(()=>{w||(F.current=null,N.current=f)},[w,f]);let te=r!=null,ne=Ng(e=>{if(!W.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(P.current!==t||r!==t)&&(P.current=t,L(e))}),re=Ng(()=>_??M?.nodesRef.current.find(e=>e.id===j)?.context?.dataRef?.current.orientation),ie=Ng(()=>GG(n,U.current)),ae=Ng(e=>{if(I.current=!1,B.current=!0,e.which===229||!W.current&&e.currentTarget===A.current)return;if(l&&NY(e.key,g,u,S)){AY(e.key,re())||EW(e),C.setOpen(!1,QU(WU,e.nativeEvent)),lg(E)&&(d?M?.events.emit(`virtualfocus`,E):E.focus());return}let t=P.current,r=GG(n,h),i=KG(n,h);if(k||(e.key===`Home`&&(EW(e),P.current=r,L(e)),e.key===`End`&&(EW(e),P.current=i,L(e))),x!=null){let t=x(e,P.current,n,g,c,u,h,r,i);if(t!=null&&(P.current=t,L(e)),g===`both`)return}if(AY(e.key,g)){if(EW(e),w&&!d&&RW(e.currentTarget.ownerDocument)===e.currentTarget){P.current=jY(e.key,g,u)?r:i,L(e);return}jY(e.key,g,u)?c?t>=i?s&&t!==n.current.length?P.current=-1:(B.current=!1,P.current=r):P.current=qG(n.current,{startingIndex:t,disabledIndices:h}):P.current=Math.min(i,qG(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?P.current=n.current.length:(B.current=!1,P.current=i):P.current=qG(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):P.current=Math.max(r,qG(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),WG(n.current,P.current)&&(P.current=-1),L(e)}}),oe=Y.useMemo(()=>({onFocus(e){B.current=!0,ne(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){OY(e)||(B.current=!0,V.current=!1,p&&ne(e))},onPointerLeave(e){if(!W.current||!I.current||e.pointerType===`touch`)return;B.current=!0;let t=e.relatedTarget;if(!(!p||n.current.includes(t))&&K.current&&(H.current?.(),H.current=null,P.current=-1,L(e),!d)){let e=A.current,t=RW(Zg(e));e&&zW(e,t)&&e.focus({preventScroll:!0})}}}),[ne,W,A,p,n,L,K,d]),se=Y.useMemo(()=>d&&w&&te&&{"aria-activedescendant":`${v}-${r}`},[d,w,te,v,r]),ce=Y.useMemo(()=>({"aria-orientation":g===`both`?void 0:g,...k?{}:se,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&w&&!d){let t=BW(e.nativeEvent);if(t&&!zW(A.current,t))return;EW(e),C.setOpen(!1,QU(HU,e.nativeEvent)),lg(E)&&E.focus();return}ae(e)},onPointerMove(e){OY(e)||(I.current=!0)}}),[se,ae,A,g,k,C,w,d,E]),le=Y.useMemo(()=>{function e(e){C.setOpen(!0,QU(WU,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&OW(e.nativeEvent)&&(N.current=!d)}function n(e){N.current=f,f===`auto`&&kW(e.nativeEvent)&&(N.current=!0)}return{onKeyDown(t){let n=C.select(`open`);I.current=!1;let r=t.key.startsWith(`Arrow`),i=MY(t.key,re(),u),a=AY(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return ae(t);if(!(!n&&!m&&r)){if(o){let e=AY(t.key,re());F.current=l&&e?null:t.key}if(l){i&&(EW(t),n?(P.current=ie(),L(t)):e(t));return}a&&(G.current!=null&&(P.current=G.current),EW(t),!n&&m?e(t):ae(t),n&&L(t))}},onFocus(e){C.select(`open`)&&!d&&(P.current=-1,L(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[ae,f,ie,l,L,C,m,g,re,u,G,d]),ue=Y.useMemo(()=>({...se,...le}),[se,le]);return Y.useMemo(()=>a?{reference:ue,floating:ce,item:oe,trigger:le}:{},[a,ue,ce,le,oe])}function FY(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=uW(),m=Y.useRef(``),h=Y.useRef(u??i??-1),g=Y.useRef(null),_=Ng(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!ZG(n)||n?.matches(`:disabled`)?!1:o==null||!YG(s_,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!c(n)))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(EW(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(EW(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),v=Ng(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);zW(n,t)||zW(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});Q(()=>{!f&&u!==null||(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let y=Y.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return Y.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var IY=.1,LY=IY*IY,RY=.5;function zY(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function BY(e,t,n,r,i,a,o,s,c,l){let u=!1;return zY(e,t,n,r,i,a)&&(u=!u),zY(e,t,i,a,o,s)&&(u=!u),zY(e,t,o,s,c,l)&&(u=!u),zY(e,t,c,l,n,r)&&(u=!u),u}function VY(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function HY(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function UY(e={}){let{blockPointerEvents:t=!1}=e,n=new lW,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*LY;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=BW(r),g=r.type===`mouseleave`,_=zW(u,h),v=zW(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&cg(r.relatedTarget)&&zW(u,r.relatedTarget))return;function y(){return!!(s&&CK(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=HY(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=HY(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=HY(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=HY(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!VY(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?RY/2:RY*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+RY+1,o=C||T?S.bottom-RY:S.top,s=C?T?S.bottom-RY:S.top:S.bottom-RY;M=BY(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?RY/2:RY*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-RY,o=C||T?S.top+RY:S.bottom,s=C?T?S.top+RY:S.bottom:S.top+RY;M=BY(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?RY/2:RY*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+RY+1,o=w||E?S.right-RY:S.left,s=w?E?S.right-RY:S.left:S.right-RY;M=BY(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?RY/2:RY*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-RY,o=w||E?S.left+RY:S.right,s=w?E?S.left+RY:S.right:S.left+RY;M=BY(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var WY=Y.createContext(void 0);function GY(){let e=Y.useContext(WY);if(e===void 0)throw Error(Jg(26));return e}var KY=`ArrowUp`,qY=`ArrowDown`,JY=`ArrowLeft`,YY=`ArrowRight`,XY=new Set([KY,qY,JY,YY,`Home`,`End`]),ZY=`Shift`,QY=[ZY,`Control`,`Alt`,`Meta`];function $Y(e){return lg(e)&&e.tagName===`INPUT`}function eX(e){return!!($Y(e)&&e.selectionStart!=null||lg(e)&&e.tagName===`TEXTAREA`)}function tX(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=nX(e,t,`left`),a=rX(e),o=rX(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=nX(e,t,`top`),r=rX(e),i=rX(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function nX(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function rX(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var iX={...kU,...xU,nestedDialogOpen(e){return e?{"data-nested-dialog-open":``}:null}},aX=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=_U(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);GY(),UJ({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?GJ(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=l_(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...WJ,hidden:!m,onKeyDown(e){XY.has(e.key)&&e.stopPropagation()},style:{"--nested-dialogs":g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:iX});return(0,X.jsx)(pq,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})});function oX(e){return i_(19)?e:e?`true`:void 0}var sX=Y.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,X.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),cX=Y.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=_U(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,X.jsx)(WY.Provider,{value:n,children:(0,X.jsxs)(JK,{ref:t,...r,children:[a&&o===!0&&(0,X.jsx)(sX,{ref:i.context.internalBackdropRef,inert:oX(!s)}),e.children]})}):null}),lX={},uX={},dX=``;function fX(e,t){return dg(e)?e:t}function pX(e,t,n){return/hidden|clip/.test(e.getComputedStyle(fX(t,n)).overflowY)}function mX(e){if(typeof document>`u`)return!1;let t=Zg(e);return ag(t).innerWidth-t.documentElement.clientWidth>0}function hX(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Zg(e),n=t.documentElement,r=t.body,i=fX(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function gX(e){let t=Zg(e),n=t.documentElement,r=t.body,i=fX(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function _X(e){let t=Zg(e),n=t.documentElement,r=t.body,i=ag(n),a=0,o=0,s=!1,c=uG.create();if(SW&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,lX={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},dX=n.style.scrollBehavior,uX={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=fX(n,r);if(s=hX(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,lX),Object.assign(r.style,uX),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=dX)}function d(){u(),c.request(l)}l();let f=iG(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var vX=new class{lockCount=0;restore=null;timeoutLock=lW.create();timeoutUnlock=lW.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Zg(e),n=t.documentElement,r=t.body,i=ag(n);if(pX(i,n,r)){let t=new i.MutationObserver(()=>{pX(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=_W||!mX(e);this.restore=a?gX(e):_X(e)}};function yX(e=!0,t=null){Q(()=>{if(e)return vX.acquire(t)},[e,t])}function bX({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=Y.useState(0),[u,d]=Y.useState(0),f=c===0,p=bq(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=BW(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||zW(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return yX(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),Q(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),tY(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var xX={...fY,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},SX=class extends LJ{constructor(e,t,n){let r=new rY,i=CX(e,r,t,n);super(i,wX(r),xX)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};YJ(n,e,t.trigger),this.update(n)}};function CX(e,t,n,r=!1){let i={...aY(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e};return i.floatingRootContext=oY(t,n,r),i}function wX(e){return{popupRef:Y.createRef(),backdropRef:Y.createRef(),internalBackdropRef:Y.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function TX(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=_U(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=KJ((e,t)=>new SX({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);nY(b,x),$J(b);let{forceUnmount:w}=eY(x,b);Y.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,QU(XU))}),[w,b]);let T=x||S;return(0,X.jsxs)(gU.Provider,{value:b,children:[u&&(0,X.jsx)(qJ,{handle:u,store:b}),T&&(0,X.jsx)(bX,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}function EX(e){return TX(`dialog`,e)}var DX=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=GY(),c=_U(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`transitionStatus`),f=c.useState(`nestedOpenDialogCount`),p=c.useState(`mounted`),m=c.useStateSetter(`viewportElement`);return l_(`div`,e,{enabled:s||p,state:{open:l,nested:u,transitionStatus:d,nestedDialogOpen:f>0},ref:[t,m],stateAttributesMapping:iX,props:[{role:`presentation`,hidden:!p,style:{pointerEvents:l?void 0:`none`},children:a},o]})}),OX=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=_U(),c=aW(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),l_(`h2`,e,{ref:t,props:[{id:c},o]})});function kX(e){let t=Y.useRef(``),n=Y.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:Y.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function AX(e,t){let n=Y.useRef(e),r=Ng(t);Q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function jX(e,t){let{onClick:n,onPointerDown:r}=kX(Ng((n,r)=>{(typeof e==`function`?e():e)||t(r||(_W?`touch`:``))}));return Y.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function MX(e){let[t,n]=Y.useState(null),r=jX(e,n);return AX(e,t=>{t&&!e&&n(null)}),Y.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function NX(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(EX,{"data-slot":`dialog`,...n}),t[2]=n,t[3]=r),r}function PX(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(cX,{"data-slot":`dialog-portal`,...n}),t[2]=n,t[3]=r),r}function FX(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`data-[starting-style]:fade-in-0 data-[ending-style]:fade-out-0 fixed inset-0 z-50 bg-foreground/50 data-[closed]:animate-out data-[open]:animate-in`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(jU,{className:i,"data-slot":`dialog-overlay`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function IX(e){let t=(0,Z.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,showCloseButton:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0||a,s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(FX,{}),t[5]=s):s=t[5];let c;t[6]===r?c=t[7]:(c=Kv(`data-[starting-style]:fade-in-0 data-[starting-style]:zoom-in-95 data-[ending-style]:fade-out-0 data-[ending-style]:zoom-out-95 grid w-full max-w-lg gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[closed]:animate-out data-[open]:animate-in`,r),t[6]=r,t[7]=c);let l;t[8]===o?l=t[9]:(l=o&&(0,X.jsxs)(eW,{className:`absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,"data-slot":`dialog-close`,children:[(0,X.jsx)(Ty,{}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),t[8]=o,t[9]=l);let u;return t[10]!==n||t[11]!==i||t[12]!==c||t[13]!==l?(u=(0,X.jsxs)(PX,{"data-slot":`dialog-portal`,children:[s,(0,X.jsx)(DX,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,children:(0,X.jsxs)(aX,{className:c,"data-slot":`dialog-content`,...i,children:[n,l]})})]}),t[10]=n,t[11]=i,t[12]=c,t[13]=l,t[14]=u):u=t[14],u}function LX(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`flex flex-col gap-2 text-center sm:text-left`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{className:i,"data-slot":`dialog-header`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function RX(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{className:i,"data-slot":`dialog-footer`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function zX(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`font-semibold text-lg leading-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(OX,{className:i,"data-slot":`dialog-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function BX(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`text-muted-foreground text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(oW,{className:i,"data-slot":`dialog-description`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function VX(e){let t=(0,Z.c)(3),n=(0,Y.useRef)(e),r;t[0]===e?r=t[1]:(r=()=>{n.current=e},t[0]=e,t[1]=r),(0,Y.useInsertionEffect)(r);let i;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(...e)=>{let t=e;return n.current(...t)},t[2]=i):i=t[2],i}function HX(e,t,n,r){let i=(0,Z.c)(10),a=r?.enabled??!0,o=r?.capture??!1,s=r?.deferAttach??!1,c;i[0]===n?c=i[1]:(c=e=>n(e),i[0]=n,i[1]=c);let l=VX(c),u,d;i[2]!==o||i[3]!==s||i[4]!==a||i[5]!==l||i[6]!==e||i[7]!==t?(u=()=>{if(!a)return;let n=e=>l(e);if(!s)return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o);let r=setTimeout(()=>{e.addEventListener(t,n,o)},0);return()=>{clearTimeout(r),e.removeEventListener(t,n,o)}},d=[e,t,a,o,s,l],i[2]=o,i[3]=s,i[4]=a,i[5]=l,i[6]=e,i[7]=t,i[8]=u,i[9]=d):(u=i[8],d=i[9]),(0,Y.useEffect)(u,d)}function UX(e,t){let n=(0,Z.c)(7),r;n[0]===t?r=n[1]:(r=()=>t(),n[0]=t,n[1]=r);let i=VX(r),a;n[2]===i?a=n[3]:(a=()=>{i()},n[2]=i,n[3]=a);let o;n[4]!==e||n[5]!==i?(o=[e,i],n[4]=e,n[5]=i,n[6]=o):o=n[6],(0,Y.useEffect)(a,o)}function WX(e,t){let n=(0,Z.c)(7),r;n[0]===t?r=n[1]:(r=()=>t(),n[0]=t,n[1]=r);let i=VX(r),a;n[2]===i?a=n[3]:(a=()=>{let e=setTimeout(()=>i(),0);return()=>clearTimeout(e)},n[2]=i,n[3]=a);let o;n[4]!==e||n[5]!==i?(o=[e,i],n[4]=e,n[5]=i,n[6]=o):o=n[6],(0,Y.useEffect)(a,o)}function GX(e,t){let n=(0,Z.c)(6),r;n[0]===e?r=n[1]:(r=()=>e(),n[0]=e,n[1]=r);let i=VX(r),a,o;n[2]!==t||n[3]!==i?(a=()=>{if(t===null)return;let e=setInterval(()=>i(),t);return()=>clearInterval(e)},o=[t,i],n[2]=t,n[3]=i,n[4]=a,n[5]=o):(a=n[4],o=n[5]),(0,Y.useEffect)(a,o)}function KX(e){let t=(0,Z.c)(1),{intervalMs:n,enabled:r}=e,[i,a]=(0,Y.useState)(qX),o;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>a(Date.now()),t[0]=o):o=t[0],GX(o,r?n:null),i}function qX(){return Date.now()}function JX(e,t){let n=(0,Z.c)(4),[r,i]=(0,Y.useState)(0),a,o;return n[0]!==t||n[1]!==e?(a=()=>{if(!t){i(0);return}let n=e.current?.offsetHeight??0;n>0&&i(n)},o=[e,t],n[0]=t,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,Y.useLayoutEffect)(a,o),r}var YX=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"]),[contenteditable="true"]`;function XX(e){return Array.from(e.querySelectorAll(YX)).filter(e=>e.offsetWidth>0||e.offsetHeight>0||e===document.activeElement)}function ZX(e,t){let n=(0,Z.c)(8),r=(0,Y.useRef)(null),i,a;n[0]!==t||n[1]!==e?(i=()=>{let n=t?e.current:null;return n&&(r.current=document.activeElement instanceof HTMLElement?document.activeElement:null,n.contains(document.activeElement)||(XX(n)[0]??n).focus()),()=>{r.current?.focus(),r.current=null}},a=[e,t],n[0]=t,n[1]=e,n[2]=i,n[3]=a):(i=n[2],a=n[3]),(0,Y.useEffect)(i,a);let o;n[4]===e?o=n[5]:(o=t=>{let n=e.current;if(t.key!==`Tab`||!n)return;let r=XX(n);if(r.length===0){t.preventDefault();return}let i=r[0],a=r.at(-1),o=document.activeElement;n.contains(o)?t.shiftKey&&o===i?(t.preventDefault(),a?.focus()):!t.shiftKey&&o===a&&(t.preventDefault(),i.focus()):(t.preventDefault(),(t.shiftKey?a:i)?.focus())},n[4]=e,n[5]=o);let s=VX(o),c;n[6]===t?c=n[7]:(c={enabled:t},n[6]=t,n[7]=c),HX(document,`keydown`,s,c)}var QX=768;function $X(e){let t=window.matchMedia(`(max-width: 767px)`);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function eZ(){return window.innerWidth<QX}function tZ(){return(0,Y.useSyncExternalStore)($X,eZ)}var nZ=(0,Y.createContext)(null);function rZ(){return`overlay-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function iZ(e,t,n){return{id:rZ(),component:e,props:t??{},options:n??{}}}function aZ(e){let t=(0,Z.c)(13),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let[i,a]=(0,Y.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(e,t,n)=>{let r=iZ(e,t,n);return a([r]),r.id},t[1]=o):o=t[1];let s=o,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(e,t,n)=>{let r=iZ(e,t,n);return a(e=>[...e,r]),r.id},t[2]=c):c=t[2];let l=c,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{a(sZ)},t[3]=u):u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(e,t,n)=>{let r=iZ(e,t,n);return a(e=>e.length===0?[r]:(e.at(-1)?.options.onClose?.(),[...e.slice(0,-1),r])),r.id},t[4]=f):f=t[4];let p=f,m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>{a(oZ)},t[5]=m):m=t[5];let h=m,g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>{a(t=>{let n=t.findIndex(t=>t.id===e);if(n===-1)return t;for(let e=n;e<t.length;e++)t[e].options.onClose?.();return t.slice(0,n)})},t[6]=g):g=t[6];let _=g,v=i.length>0,y;t[7]!==i||t[8]!==v?(y={stack:i,open:s,push:l,pop:d,replace:p,closeAll:h,close:_,hasOverlays:v,depth:i.length},t[7]=i,t[8]=v,t[9]=y):y=t[9];let b=y,x;return t[10]!==n||t[11]!==b?(x=(0,X.jsx)(nZ.Provider,{value:b,children:n}),t[10]=n,t[11]=b,t[12]=x):x=t[12],x}function oZ(e){for(let t of e)t.options.onClose?.();return[]}function sZ(e){return e.length<=1?(e[0]?.options.onClose?.(),[]):(e.at(-1)?.options.onClose?.(),e.slice(0,-1))}function cZ(){let e=(0,Y.useContext)(nZ);if(!e)throw Error(`useOverlay must be used within an OverlayProvider`);return e}function lZ(e){let t=(0,Z.c)(8),{stack:n}=cZ(),r;t[0]===e?r=t[1]:(r=t=>t.id===e,t[0]=e,t[1]=r);let i=n.findIndex(r),a=i===0,o=i===n.length-1,s=i>0,c;return t[2]!==i||t[3]!==n.length||t[4]!==a||t[5]!==o||t[6]!==s?(c={index:i,isFirst:a,isLast:o,depth:n.length,showBackButton:s},t[2]=i,t[3]=n.length,t[4]=a,t[5]=o,t[6]=s,t[7]=c):c=t[7],c}var uZ={type:`spring`,stiffness:400,damping:35,mass:.8},dZ={type:`spring`,stiffness:350,damping:30,mass:.8},fZ={hidden:{opacity:0,scale:.95},visible:{opacity:1,scale:1,transition:{type:`spring`,stiffness:400,damping:30}},exit:{opacity:0,scale:.95,transition:{duration:.15,ease:[.4,0,1,1]}}};function pZ(e,t){return e?`0%`:t?`-35%`:`100%`}function mZ(){let e=(0,Z.c)(22),{stack:t,closeAll:n,pop:r}=cZ(),i=WR(),a=(0,Y.useRef)(null),o=(0,Y.useRef)(null),s=t.length>0,c=t,l=c.length-1,u=JX(a,s),d;e[0]===t?d=e[1]:(d=t.at(-1),e[0]=t,e[1]=d);let f=d,p;e[2]===i?p=e[3]:(p=i?{duration:.01}:uZ,e[2]=i,e[3]=p);let m=p,h;e[4]!==n||e[5]!==f?.options.closeOnBackdropClick?(h=()=>{f?.options.closeOnBackdropClick!==!1&&n()},e[4]=n,e[5]=f?.options.closeOnBackdropClick,e[6]=h):h=e[6],f?.options.closeOnBackdropClick;let g=h,_;e[7]!==f?.options.closeOnEscape||e[8]!==r?(_=e=>{e.key===`Escape`&&f?.options.closeOnEscape!==!1&&r()},e[7]=f?.options.closeOnEscape,e[8]=r,e[9]=_):_=e[9],f?.options.closeOnEscape;let v=_,y;if(e[10]===s?y=e[11]:(y={enabled:s},e[10]=s,e[11]=y),HX(document,`keydown`,v,y),ZX(o,s),!s)return null;let b;e[12]!==l||e[13]!==f||e[14]!==g||e[15]!==s||e[16]!==u||e[17]!==c||e[18]!==m?(b=s&&(0,X.jsx)(NX,{modal:!1,open:!0,children:(0,X.jsxs)(PX,{keepMounted:!0,children:[(0,X.jsx)(GR.div,{animate:{opacity:1},className:`fixed inset-0 z-50 bg-foreground/60`,exit:{opacity:0},initial:{opacity:0},onClick:g,transition:{duration:.2}}),(0,X.jsx)(GR.div,{animate:`visible`,"aria-labelledby":f?`overlay-title-${f.id}`:void 0,"aria-modal":`true`,className:`fixed top-1/2 left-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 px-4`,exit:`exit`,initial:`hidden`,ref:o,role:`dialog`,variants:fZ,children:(0,X.jsx)(tR,{children:(0,X.jsx)(GR.div,{className:`relative flex max-h-[calc(100dvh-2rem)] flex-col overflow-hidden rounded-xl border bg-card shadow-lg ring-1 ring-border`,layout:`position`,style:{minHeight:u>0?u:`auto`},transition:uZ,children:(0,X.jsx)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,ref:a,children:c.map((e,t)=>{let n=t===l,r=t<l,i=n&&c.length>1?{x:`100%`,scale:1,opacity:1}:!1;return(0,X.jsx)(GR.div,{animate:{x:pZ(n,r),scale:n?1:.94,opacity:+!!n},"aria-hidden":!n,className:Kv(`w-full`,n?`relative flex min-h-0 flex-col`:`pointer-events-none absolute inset-0`),initial:i,transition:m,children:(0,X.jsx)(e.component,{overlayId:e.id,...e.props})},e.id)})})})})})]})}),e[12]=l,e[13]=f,e[14]=g,e[15]=s,e[16]=u,e[17]=c,e[18]=m,e[19]=b):b=e[19];let x;return e[20]===b?x=e[21]:(x=(0,X.jsx)(Ooe,{children:b}),e[20]=b,e[21]=x),x}function hZ(){let e=(0,Z.c)(40),{stack:t,closeAll:n,pop:r}=cZ(),i=WR(),a=(0,Y.useRef)(null),o=t.length>0,s=t,c=s.length-1,l=JX(a,o),u;e[0]===t?u=e[1]:(u=t.at(-1),e[0]=t,e[1]=u);let d=u,f;e[2]===i?f=e[3]:(f=i?{duration:.01}:uZ,e[2]=i,e[3]=f);let p=f,m;e[4]!==d?.options.closeOnEscape||e[5]!==r?(m=e=>{e.key===`Escape`&&d?.options.closeOnEscape!==!1&&r()},e[4]=d?.options.closeOnEscape,e[5]=r,e[6]=m):m=e[6],d?.options.closeOnEscape;let h=m,g;e[7]===o?g=e[8]:(g={enabled:o},e[7]=o,e[8]=g),HX(document,`keydown`,h,g);let _;e[9]===n?_=e[10]:(_=e=>{e||n()},e[9]=n,e[10]=_);let v;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,X.jsx)(hU.Overlay,{className:`fixed inset-0 z-50 bg-black/60`}),e[11]=v):v=e[11];let y=d?`overlay-title-${d.id}`:void 0,b;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(b=Kv(`fixed inset-x-0 bottom-0 z-50 flex max-h-[90vh] flex-col`,`rounded-t-xl border-t bg-card shadow-lg`),e[12]=b):b=e[12];let x=d?.options.title||`Overlay`,S;e[13]===x?S=e[14]:(S=(0,X.jsx)(hU.Title,{className:`sr-only`,children:x}),e[13]=x,e[14]=S);let C;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,X.jsx)(`div`,{className:`mx-auto mt-3 h-1.5 w-12 shrink-0 rounded-full bg-muted-foreground/20`}),e[15]=C):C=e[15];let w=l>0?l:`auto`,T;e[16]===w?T=e[17]:(T={minHeight:w},e[16]=w,e[17]=T);let E;if(e[18]!==c||e[19]!==s||e[20]!==p){let t;e[22]!==c||e[23]!==s.length||e[24]!==p?(t=(e,t)=>{let n=t===c,r=t<c,i=n&&s.length>1?{x:`100%`,scale:1,opacity:1}:!1;return(0,X.jsx)(GR.div,{animate:{x:pZ(n,r),scale:n?1:.94,opacity:+!!n},"aria-hidden":!n,className:Kv(`w-full`,n?`relative`:`pointer-events-none absolute inset-0`),initial:i,transition:p,children:(0,X.jsx)(e.component,{overlayId:e.id,...e.props})},e.id)},e[22]=c,e[23]=s.length,e[24]=p,e[25]=t):t=e[25],E=s.map(t),e[18]=c,e[19]=s,e[20]=p,e[21]=E}else E=e[21];let D;e[26]===E?D=e[27]:(D=(0,X.jsx)(`div`,{className:`relative`,ref:a,children:E}),e[26]=E,e[27]=D);let O;e[28]!==T||e[29]!==D?(O=(0,X.jsx)(tR,{children:(0,X.jsx)(GR.div,{className:`relative flex-1 overflow-hidden`,layout:`position`,style:T,transition:dZ,children:D})}),e[28]=T,e[29]=D,e[30]=O):O=e[30];let k;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,X.jsx)(`div`,{className:`h-safe-area-inset-bottom`}),e[31]=k):k=e[31];let A;e[32]!==O||e[33]!==y||e[34]!==S?(A=(0,X.jsxs)(hU.Portal,{children:[v,(0,X.jsxs)(hU.Content,{"aria-labelledby":y,className:b,children:[S,C,O,k]})]}),e[32]=O,e[33]=y,e[34]=S,e[35]=A):A=e[35];let j;return e[36]!==o||e[37]!==A||e[38]!==_?(j=(0,X.jsx)(hU.Root,{onOpenChange:_,open:o,children:A}),e[36]=o,e[37]=A,e[38]=_,e[39]=j):j=e[39],j}function gZ(){let e=(0,Z.c)(2);if(tZ()){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(hZ,{}),e[0]=t):t=e[0],t}let t;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(mZ,{}),e[1]=t):t=e[1],t}function _Z(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(gZ,{}),e[0]=t):t=e[0],t}var vZ=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},yZ=[`light`,`dark`],bZ=`(prefers-color-scheme: dark)`,xZ=typeof window>`u`,SZ=Y.createContext(void 0),CZ={setTheme:e=>{},themes:[]},wZ=()=>Y.useContext(SZ)??CZ,TZ=e=>Y.useContext(SZ)?Y.createElement(Y.Fragment,null,e.children):Y.createElement(DZ,{...e}),EZ=[`light`,`dark`],DZ=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i=`theme`,themes:a=EZ,defaultTheme:o=n?`system`:`light`,attribute:s=`data-theme`,value:c,children:l,nonce:u,scriptProps:d})=>{let[f,p]=Y.useState(()=>kZ(i,o)),[m,h]=Y.useState(()=>f===`system`?jZ():f),g=c?Object.values(c):a,_=Y.useCallback(e=>{let i=e;if(!i)return;e===`system`&&n&&(i=jZ());let a=c?c[i]:i,l=t?AZ(u):null,d=document.documentElement,f=e=>{e===`class`?(d.classList.remove(...g),a&&d.classList.add(a)):e.startsWith(`data-`)&&(a?d.setAttribute(e,a):d.removeAttribute(e))};if(Array.isArray(s)?s.forEach(f):f(s),r){let e=yZ.includes(o)?o:null,t=yZ.includes(i)?i:e;d.style.colorScheme=t}l?.()},[u]),v=Y.useCallback(e=>{let t=typeof e==`function`?e(f):e;p(t);try{localStorage.setItem(i,t)}catch{}},[f]),y=Y.useCallback(t=>{let r=jZ(t);h(r),f===`system`&&n&&!e&&_(`system`)},[f,e]);Y.useEffect(()=>{let e=window.matchMedia(bZ);return e.addListener(y),y(e),()=>e.removeListener(y)},[y]),Y.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?p(e.newValue):v(o))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[v]),Y.useEffect(()=>{_(e??f)},[e,f]);let b=Y.useMemo(()=>({theme:f,setTheme:v,forcedTheme:e,resolvedTheme:f===`system`?m:f,themes:n?[...a,`system`]:a,systemTheme:n?m:void 0}),[f,v,e,m,n,a]);return Y.createElement(SZ.Provider,{value:b},Y.createElement(OZ,{forcedTheme:e,storageKey:i,attribute:s,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:u,scriptProps:d}),l)},OZ=Y.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:l})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return Y.createElement(`script`,{...l,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${vZ.toString()})(${u})`}})}),kZ=(e,t)=>{if(xZ)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},AZ=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},jZ=e=>(e||=window.matchMedia(bZ),e.matches?`dark`:`light`);function MZ(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,X.jsx)(TZ,{...r,children:n}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var NZ={"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},PZ=e=>e===`light`||e===`dark`||e===`system`?e:`system`,FZ=e=>{let t=(0,Z.c)(8),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let{theme:r}=wZ(),i=r===void 0?`system`:r,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={success:(0,X.jsx)(Jee,{className:`size-4`}),info:(0,X.jsx)(ete,{className:`size-4`}),warning:(0,X.jsx)(wy,{className:`size-4`}),error:(0,X.jsx)(ste,{className:`size-4`}),loading:(0,X.jsx)(gy,{className:`size-4 animate-spin`})},t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=PZ(i),t[3]=i,t[4]=o);let s;return t[5]!==n||t[6]!==o?(s=(0,X.jsx)(Zte,{className:`toaster group`,icons:a,style:NZ,theme:o,...n}),t[5]=n,t[6]=o,t[7]=s):s=t[7],s};function IZ(e){let t=(0,Z.c)(8),{action:n}=e,r=n.disabled||n.loading,i=n.variant??`default`,a;t[0]===n.loading?a=t[1]:(a=n.loading&&(0,X.jsx)(gy,{className:`mr-2 size-4 animate-spin`}),t[0]=n.loading,t[1]=a);let o;return t[2]!==n.label||t[3]!==n.onClick||t[4]!==r||t[5]!==i||t[6]!==a?(o=(0,X.jsxs)(Jv,{disabled:r,onClick:n.onClick,variant:i,children:[a,n.label]}),t[2]=n.label,t[3]=n.onClick,t[4]=r,t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function LZ(e){let t=(0,Z.c)(17),{actions:n,className:r,children:i}=e;if(i){let e;t[0]===r?e=t[1]:(e=Kv(`flex flex-col-reverse gap-2 p-6 pt-4 sm:flex-row sm:justify-end`,r),t[0]=r,t[1]=e);let n;return t[2]!==i||t[3]!==e?(n=(0,X.jsx)(`div`,{className:e,children:i}),t[2]=i,t[3]=e,t[4]=n):n=t[4],n}if(!n||n.length===0)return null;let a,o,s;if(t[5]!==n||t[6]!==r){let e=n.filter(UZ),i=n.filter(HZ),c=n.filter(VZ),l=e.length>0,u=i.length>0||c.length>0,d=l&&u?`sm:justify-between`:`sm:justify-end`;t[10]!==r||t[11]!==d?(a=Kv(`flex flex-col-reverse gap-2 p-6 pt-4 sm:flex-row`,d,r),t[10]=r,t[11]=d,t[12]=a):a=t[12],o=l&&(0,X.jsx)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row`,children:e.map(BZ)}),s=u&&(0,X.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row`,children:[i.map(zZ),c.map(RZ)]}),t[5]=n,t[6]=r,t[7]=a,t[8]=o,t[9]=s}else a=t[7],o=t[8],s=t[9];let c;return t[13]!==a||t[14]!==o||t[15]!==s?(c=(0,X.jsxs)(`div`,{className:a,children:[o,s]}),t[13]=a,t[14]=o,t[15]=s,t[16]=c):c=t[16],c}function RZ(e){return(0,X.jsx)(IZ,{action:e},e.label)}function zZ(e){return(0,X.jsx)(IZ,{action:e},e.label)}function BZ(e){return(0,X.jsx)(IZ,{action:e},e.label)}function VZ(e){return!e.variant||e.variant==="default"||e.variant===`destructive`}function HZ(e){return e.variant===`outline`||e.variant===`secondary`}function UZ(e){return e.variant===`ghost`}function WZ(e){let t=(0,Z.c)(27),{title:n,description:r,showBackButton:i,showCloseButton:a,onBack:o,onClose:s,className:c,overlayId:l}=e,u=a===void 0||a,{pop:d,closeAll:f}=cZ(),p=i??!1,m;t[0]!==o||t[1]!==d?(m=()=>{o?o():d()},t[0]=o,t[1]=d,t[2]=m):m=t[2];let h=m,g;t[3]!==f||t[4]!==s?(g=()=>{s?s():f()},t[3]=f,t[4]=s,t[5]=g):g=t[5];let _=g,v;t[6]===c?v=t[7]:(v=Kv(`relative flex flex-col gap-1.5 p-6 pb-0`,c),t[6]=c,t[7]=v);let y;t[8]!==h||t[9]!==p?(y=p&&(0,X.jsx)(Jv,{"aria-label":`Go back`,className:`ml-[-8px] size-8 shrink-0`,onClick:h,size:`icon`,variant:`ghost`,children:(0,X.jsx)(oy,{className:`size-5`})}),t[8]=h,t[9]=p,t[10]=y):y=t[10];let b;t[11]!==l||t[12]!==n?(b=n&&(0,X.jsx)(`h2`,{className:`flex-1 font-semibold text-base leading-none`,id:l?`overlay-title-${l}`:void 0,children:n}),t[11]=l,t[12]=n,t[13]=b):b=t[13];let x;t[14]!==_||t[15]!==u?(x=u&&(0,X.jsx)(Jv,{"aria-label":`Close`,className:`absolute top-4 right-4 size-8 shrink-0 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`,onClick:_,size:`icon`,variant:`ghost`,children:(0,X.jsx)(Ty,{className:`size-4`})}),t[14]=_,t[15]=u,t[16]=x):x=t[16];let S;t[17]!==y||t[18]!==b||t[19]!==x?(S=(0,X.jsxs)(`div`,{className:`flex min-h-8 items-center gap-2`,children:[y,b,x]}),t[17]=y,t[18]=b,t[19]=x,t[20]=S):S=t[20];let C;t[21]===r?C=t[22]:(C=r&&(0,X.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:r}),t[21]=r,t[22]=C);let w;return t[23]!==v||t[24]!==S||t[25]!==C?(w=(0,X.jsxs)(`div`,{className:v,children:[S,C]}),t[23]=v,t[24]=S,t[25]=C,t[26]=w):w=t[26],w}function GZ(e){let t=(0,Z.c)(8),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({overlayId:n,showBackButton:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{showBackButton:a}=lZ(n),o=i??a,s;return t[4]!==n||t[5]!==r||t[6]!==o?(s=(0,X.jsx)(WZ,{...r,overlayId:n,showBackButton:o}),t[4]=n,t[5]=r,t[6]=o,t[7]=s):s=t[7],s}function KZ(e){let t=(0,Z.c)(15),{overlayId:n,title:r,description:i,actions:a,children:o,className:s}=e,c;t[0]===s?c=t[1]:(c=Kv(`flex min-h-0 flex-col`,s),t[0]=s,t[1]=c);let l;t[2]!==i||t[3]!==n||t[4]!==r?(l=(r||i)&&(0,X.jsx)(GZ,{description:i,overlayId:n,title:r}),t[2]=i,t[3]=n,t[4]=r,t[5]=l):l=t[5];let u;t[6]===o?u=t[7]:(u=o&&(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:o}),t[6]=o,t[7]=u);let d;t[8]===a?d=t[9]:(d=(0,X.jsx)(LZ,{actions:a}),t[8]=a,t[9]=d);let f;return t[10]!==c||t[11]!==l||t[12]!==u||t[13]!==d?(f=(0,X.jsxs)(`div`,{className:c,children:[l,u,d]}),t[10]=c,t[11]=l,t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function qZ(e){let t=(0,Z.c)(31),{overlayId:n,title:r,message:i,confirmLabel:a,cancelLabel:o,confirmVariant:s,destructive:c,onConfirm:l,onCancel:u}=e,d=r===void 0?`Confirm`:r,f=a===void 0?`Confirm`:a,p=o===void 0?`Cancel`:o,m=s===void 0?`default`:s,h=c!==void 0&&c,{pop:g}=cZ(),_;t[0]!==u||t[1]!==g?(_=()=>{u?.(),g()},t[0]=u,t[1]=g,t[2]=_):_=t[2];let v=_,y;t[3]!==l||t[4]!==g?(y=async()=>{await l(),g()},t[3]=l,t[4]=g,t[5]=y):y=t[5];let b=y,x;t[6]!==p||t[7]!==v?(x={label:p,variant:`outline`,onClick:v},t[6]=p,t[7]=v,t[8]=x):x=t[8];let S=h?`destructive`:m,C;t[9]!==f||t[10]!==b||t[11]!==S?(C={label:f,variant:S,onClick:b},t[9]=f,t[10]=b,t[11]=S,t[12]=C):C=t[12];let w;t[13]!==C||t[14]!==x?(w=[x,C],t[13]=C,t[14]=x,t[15]=w):w=t[15];let T=w,E;t[16]===h?E=t[17]:(E=h&&(0,X.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-full bg-destructive/10`,children:(0,X.jsx)(wy,{className:`size-5 text-destructive`})}),t[16]=h,t[17]=E);let D=h&&`pt-2`,O;t[18]===D?O=t[19]:(O=Kv(`text-muted-foreground text-sm`,D),t[18]=D,t[19]=O);let k;t[20]!==i||t[21]!==O?(k=(0,X.jsx)(`p`,{className:O,children:i}),t[20]=i,t[21]=O,t[22]=k):k=t[22];let A;t[23]!==E||t[24]!==k?(A=(0,X.jsxs)(`div`,{className:`flex gap-4`,children:[E,k]}),t[23]=E,t[24]=k,t[25]=A):A=t[25];let j;return t[26]!==T||t[27]!==n||t[28]!==A||t[29]!==d?(j=(0,X.jsx)(KZ,{actions:T,overlayId:n,title:d,children:A}),t[26]=T,t[27]=n,t[28]=A,t[29]=d,t[30]=j):j=t[30],j}function JZ(e){let t=(0,Z.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,type:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=Kv(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs outline-none transition-[color,box-shadow] selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-sm placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 lg:text-sm`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a||t[8]!==i?(o=(0,X.jsx)(`input`,{className:a,"data-slot":`input`,type:i,...r}),t[6]=r,t[7]=a,t[8]=i,t[9]=o):o=t[9],o}function YZ(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`flex select-none items-center gap-2 font-medium text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50 group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`label`,{className:i,"data-slot":`label`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function XZ(e){return Array.isArray(e)?e:e==null?[]:[e]}var ZZ=class extends Error{constructor(...e){super(...e),this.name=`AbortError`}};function QZ(e){let t=Promise.resolve();return(...n)=>t=t.catch(()=>{}).then(()=>e(...n))}function $Z(e){return!e||typeof e!=`object`?!1:`next`in e&&typeof e.next==`function`&&Symbol.asyncIterator in e&&typeof e[Symbol.asyncIterator]==`function`}var eQ=Symbol.asyncDispose??Symbol.for(`asyncDispose`),tQ=class{isDone=!1;isExecuteComplete=!1;cleanup;next;constructor(e,t){this.cleanup=t,this.next=QZ(async()=>{if(this.isDone)return{done:!0,value:void 0};let t;try{let t=await e();return t.done&&(this.isDone=!0),t}catch(e){throw t={value:e},this.isDone=!0,e}finally{this.isDone&&!this.isExecuteComplete&&(this.isExecuteComplete=!0,await this.cleanup(t?{kind:`error`,error:t.value}:{kind:`success`}))}})}async return(e){return this.isDone=!0,this.isExecuteComplete||(this.isExecuteComplete=!0,await this.cleanup({kind:`cancelled`})),{done:!0,value:e}}async throw(e){throw this.isDone=!0,this.isExecuteComplete||(this.isExecuteComplete=!0,await this.cleanup({kind:`cancelled`,error:e})),e}async[eQ](){this.isDone=!0,this.isExecuteComplete||(this.isExecuteComplete=!0,await this.cleanup({kind:`cancelled`}))}[Symbol.asyncIterator](){return this}};function nQ(e){if(e)return JSON.parse(e)}function rQ(e){return JSON.stringify(e)}function iQ(e){if(!e)return!1;let t=typeof e;return t===`object`||t===`function`}var aQ=new WeakMap;function oQ(e,t,{bind:n=!0}={}){let r=Reflect.get(e,t);if(!n||typeof r!=`function`)return r;let i=aQ.get(r);i||aQ.set(r,i=new WeakMap);let a=i.get(e);return a||i.set(e,a=r.bind(e)),a}function sQ(e){try{return decodeURIComponent(e)}catch{return e}}function cQ(e){return e[0]??{}}var lQ=`orpc`;function uQ(e){return e instanceof Error&&e.name.includes(`Abort`)}function dQ(e){let t;return()=>{if(t)return t.result;let n=e();return t={result:n},n}}function fQ(e){return`/${e.map(encodeURIComponent).join(`/`)}`}var pQ=2,mQ=Symbol.for(`ORPC_OPENTELEMETRY_CONFIG`);function hQ(){return globalThis[mQ]}function gQ(e){let t=hQ()?.tracer;if(!t)return;let{name:n,context:r,...i}=typeof e==`string`?{name:e}:e;return t.startSpan(n,i,r)}function _Q(e,t){if(!e)return;let n=vQ(t);e.recordException(n),uQ(t)||e.setStatus({code:pQ,message:n.message})}function vQ(e){if(e instanceof Error){let t={message:e.message,name:e.name,stack:e.stack};return`code`in e&&(typeof e.code==`string`||typeof e.code==`number`)&&(t.code=e.code),t}return{message:String(e)}}async function yQ(e,t){let n=hQ()?.tracer;if(!n)return t();typeof e==`string`&&(e={name:e});let r=async e=>{try{return await t(e)}catch(t){throw _Q(e,t),t}finally{e.end()}};return e.context?n.startActiveSpan(e.name,e,e.context,r):n.startActiveSpan(e.name,e,r)}async function bQ(e,t){let n=hQ();if(!e||!n)return t();let r=n.trace.setSpan(n.context.active(),e);return n.context.with(r,t)}function xQ(e,{runWith:t,mapResult:n,mapError:r,onError:i,onFinish:a}){t??=e=>e();let o;return new tQ(async()=>{try{let r;try{r=await t(()=>e.next()),o=r.done}catch(e){throw o=!0,e}return n?await n(r):r}catch(e){throw await i?.(e),r?await r(e):e}},async n=>{try{if(!o)try{await t(async()=>e.return?.())}catch(e){throw await i?.(e),e}}finally{await a?.()}})}function SQ(e,t){let n=dQ(()=>gQ(e));return xQ(t,{runWith:e=>bQ(n(),e),mapResult(e){return n()?.addEvent(e.done?`completed`:`yielded`),e},onError(e){_Q(n(),e)},onFinish(){n()?.end()}})}function CQ(e,...t){return typeof e==`function`?e(...t):e}function wQ(e,t){return new Proxy(typeof e==`function`?t:e,{get(n,r){return oQ(r in t?t:CQ(e),r)},has(n,r){return Reflect.has(t,r)||Reflect.has(CQ(e),r)}})}function TQ(e){return iQ(e)?Object.getPrototypeOf(e)?.constructor:null}function EQ(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||!t||!t.constructor}function DQ(e,t){let n=e;for(let e of t){if(!iQ(n)||!Object.hasOwn(n,e))return;n=n[e]}return n}var OQ=(()=>{let e=function(){};return e.prototype=Object.create(null),Object.freeze(e.prototype),e})();function kQ(e){let t=new OQ,n=e;for(;n&&n!==Object.prototype;){for(let r of Object.getOwnPropertyNames(n)){if(r===`constructor`||r in t)continue;let n=e[r];typeof n==`function`&&(t[r]=n.bind(e))}for(let r of Object.getOwnPropertySymbols(n)){if(r in t)continue;let n=e[r];typeof n==`function`&&(t[r]=n.bind(e))}n=Object.getPrototypeOf(n)}return t}function AQ(e,t,n){if(!e?.length)return n(t);let r=(t,i)=>{let a=e[i];return a?a({...t,next:(e=t)=>r(e,i+1)}):n(t)};return r(t,0)}function jQ(e){let t=e.length,n=new Map;for(let r=0;r<t;r++){let t=e[r],i=n.get(t.name);i===void 0?n.set(t.name,[r]):i.push(r)}let r=Array.from({length:t},()=>new Set);for(let i=0;i<t;i++){let t=e[i],a=t.before;if(a!==void 0)for(let e of a){let t=n.get(e);if(t!==void 0)for(let e of t){let t=r[e];t!==void 0&&t.add(i)}}let o=t.after;if(o!==void 0){let e=r[i];if(e!==void 0)for(let t of o){let r=n.get(t);if(r!==void 0)for(let t of r)e.add(t)}}}let i=[],a=new Set,o=new Set;function s(t){if(o.has(t))return;if(a.has(t)){let n=e[t],r=n===void 0?`unknown`:n.name;throw Error(`Circular dependency detected involving plugin "${r}"`)}a.add(t);let n=r[t];if(n!==void 0)for(let e of n)s(e);a.delete(t),o.add(t);let c=e[t];c!==void 0&&i.push(c)}for(let e=0;e<t;e++)s(e);return i}var MQ=class extends TypeError{},NQ=class extends TypeError{},PQ=class extends Error{constructor(e,t={}){super(t?.message??`Error Event`,t),this.data=e}},FQ=/\r\n|[\n\r]/,IQ=/(?:\r\n|\r(?!\n)|\n)(?:\r\n|\r(?!\n)|\n)/,LQ=/^\s/;function RQ(e){let t=e.split(FQ),n={};for(let e of t){let t=e.indexOf(`:`),r=t===-1?e:e.slice(0,t),i=t===-1?``:e.slice(t+1).replace(LQ,``);if(t===0)n.comments??=[],n.comments.push(i);else if(r===`data`)n.data===void 0?n.data=i:n.data+=`
92
+ ${i}`;else if(r===`event`)n.event=i;else if(r===`id`)n.id=i;else if(r===`retry`){let e=Number.parseInt(i);Number.isInteger(e)&&e>=0&&e.toString()===i&&(n.retry=e)}}return n}var zQ=class{constructor(e){this.onEvent=e}incomplete=``;trailingCR=!1;feed(e){this.trailingCR&&e.startsWith(`
93
+ `)&&(e=e.slice(1)),this.trailingCR=e.endsWith(`\r`),this.incomplete+=e;let t=this.incomplete.split(IQ);this.incomplete=t.pop();for(let e of t){let t=RQ(e);this.onEvent(t)}}end(){if(this.incomplete)throw new NQ(`Event Stream ended before complete`)}},BQ=class extends TransformStream{constructor(){let e;super({start(t){e=new zQ(e=>{t.enqueue(e)})},transform(t){e.feed(t)},flush(){e.end()}})}},VQ=/\r\n|[\n\r]/;function HQ(e){return VQ.test(e)}function UQ(e){if(HQ(e))throw new MQ(`Event's id must not contain a carriage return or newline character`)}function WQ(e){if(HQ(e))throw new MQ(`Event's event must not contain a carriage return or newline character`)}function GQ(e){if(!Number.isInteger(e)||e<0)throw new MQ(`Event's retry must be a integer and >= 0`)}function KQ(e){if(HQ(e))throw new MQ(`Event's comment must not contain a carriage return or newline character`)}function qQ(e){let t=``;if(e!==void 0){let n=e.split(VQ);for(let e of n)t+=`data: ${e}
94
+ `}return t}function JQ(e){let t=``;for(let n of e??[])KQ(n),t+=`: ${n}
95
+ `;return t}function YQ(e){let t=``;return t+=JQ(e.comments),e.event!==void 0&&(WQ(e.event),t+=`event: ${e.event}
96
+ `),e.retry!==void 0&&(GQ(e.retry),t+=`retry: ${e.retry}
97
+ `),e.id!==void 0&&(UQ(e.id),t+=`id: ${e.id}
98
+ `),t+=qQ(e.data),t+=`
99
+ `,t}var XQ=Symbol.for(`STANDARDSERVER_EVENT_META`),ZQ=Symbol.for(`STANDARDSERVER_EVENT_SOURCE`);function QQ(e,t){let n;if(t.id!==void 0&&(UQ(t.id),n??={},n.id=t.id),t.retry!==void 0&&(GQ(t.retry),n??={},n.retry=t.retry),t.comments!==void 0){for(let e of t.comments)KQ(e);n??={},n.comments=t.comments}return n?new Proxy(e,{get(e,t,r){return t===ZQ?e:t===XQ?n:oQ(e,t)}}):e}function $Q(e){if(!iQ(e))return[e,void 0];let t=e[XQ];return[e[ZQ]??e,t]}function e$(e){if(iQ(e))return e[XQ]}function t$(e){return`inline; filename="${e.replace(/[^\x20-\x7E]/g,`_`).replace(/"/g,`\\"`)}"; filename*=utf-8''${encodeURIComponent(e).replace(/['()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`).replace(/%(7C|60|5E)/g,(e,t)=>String.fromCharCode(Number.parseInt(t,16)))}`}function n$(e){let t=e.match(/filename\*=(UTF-8'')?([^;]*)/i);if(t&&typeof t[2]==`string`)return sQ(t[2]);let n=e.match(/filename="((?:\\"|[^"])*)"/i);if(n&&typeof n[1]==`string`)return n[1].replace(/\\"/g,`"`)}function r$(e,t){let n={...e};for(let e in t)Array.isArray(t[e])?n[e]=[...XZ(n[e]),...t[e]]:t[e]!==void 0&&(n[e]=Array.isArray(n[e])?[...n[e],t[e]]:n[e]===void 0?t[e]:[n[e],t[e]]);return n}function i$(e){let t=e.indexOf(`#`),n=e.indexOf(`?`),r=n!==-1&&(t===-1||n<t),i=r?n:t===-1?e.length:t,a=t===-1?e.length:t;return[e.slice(0,i),r?e.slice(n,a):void 0,t===-1?void 0:e.slice(t)]}var a$={BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_SUPPORTED:405,NOT_ACCEPTABLE:406,TIMEOUT:408,CONFLICT:409,GONE:410,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,UNSUPPORTED_MEDIA_TYPE:415,UNPROCESSABLE_CONTENT:422,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,CLIENT_CLOSED_REQUEST:499,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504},o$,s$=class e extends Error{static{let t=Symbol.for(`ORPC_ERROR_CONSTRUCTORS`);globalThis[t]??=new WeakSet,o$=globalThis[t],o$.add(e)}name=`ORPCError`;defined=!1;inferable=!1;code;data;constructor(e,...t){let n=cQ(t),r=n.message??e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `);super(r,n),this.code=e,this.data=n.data}toJSON(){return{defined:this.defined,inferable:this.inferable,code:this.code,message:this.message,data:this.data}}static[Symbol.hasInstance](e){if(!o$.has(this))return super[Symbol.hasInstance](e);let t=TQ(e);return t&&o$.has(t)?!0:super[Symbol.hasInstance](e)}};function c$(e){return e instanceof s$?e:new s$(`INTERNAL_SERVER_ERROR`,{cause:e})}function l$(e){if(!EQ(e))return!1;let t=[`defined`,`inferable`,`code`,`message`,`data`];return!Object.keys(e).some(e=>!t.includes(e))&&`defined`in e&&typeof e.defined==`boolean`&&`inferable`in e&&typeof e.inferable==`boolean`&&`code`in e&&typeof e.code==`string`&&`message`in e&&typeof e.message==`string`}function u$(e,t={}){let n=new s$(e.code,{...e,...t});return n.defined=e.defined,n.inferable=e.inferable,n}function d$(e,{mapResult:t,mapError:n,...r}){return xQ(e,{...r,mapResult:t&&(async e=>{let n=await t(e);if(n.value!==e.value){let t=e$(e.value);if(t&&iQ(n.value))return{done:n.done,value:QQ(n.value,t)}}return n}),mapError:n&&(async e=>{let t=await n(e);if(t!==e){let n=e$(e);if(n&&iQ(t))return QQ(t,n)}return t})})}var f$=/^\/(.*)\/([a-z]*)$/,p$={undefined:{condition(e){return e===void 0},serialize(){return null},deserialize(){},isTerminal:!0},bigint:{condition(e){return typeof e==`bigint`},serialize(e){return e.toString()},deserialize(e){return BigInt(e)},isTerminal:!0},date:{condition(e){return e instanceof Date},serialize(e){return Number.isNaN(e.getTime())?null:e.toISOString()},deserialize(e){return new Date(e??`Invalid Date`)},isTerminal:!0},nan:{condition(e){return typeof e==`number`&&Number.isNaN(e)},serialize(){return null},deserialize(){return NaN},isTerminal:!0},url:{condition(e){return e instanceof URL},serialize(e){return e.toString()},deserialize(e){return new URL(e)},isTerminal:!0},regexp:{condition(e){return e instanceof RegExp},serialize(e){return e.toString()},deserialize(e){let[,t,n]=e.match(f$);return new RegExp(t,n)},isTerminal:!0},set:{condition(e){return e instanceof Set},serialize(e){return Array.from(e)},deserialize(e){return new Set(e)}},map:{condition(e){return e instanceof Map},serialize(e){return Array.from(e.entries())},deserialize(e){return new Map(e)}}},m$=class{handlers;omitUndefinedProperties;constructor(e={}){this.handlers={...p$,...e.handlers},this.omitUndefinedProperties=e.omitUndefinedProperties!==!1}serialize(e){let[t,n,r,i]=this.serializeValue(e,[],[],[],[]),a=n.length===0?void 0:n;return r.length===0?{json:t,meta:a}:{json:t,meta:a,maps:r,blobs:i}}serializeValue(e,t,n,r,i){for(let a in this.handlers){let o=this.handlers[a];if(o&&o.condition(e)){let s=o.serialize(e);if(o.isTerminal)return n.push([a,...t]),[s,n,r,i];let c=this.serializeValue(s,t,n,r,i);return n.push([a,...t]),c}}if(e instanceof Blob)return r.push(t),i.push(e),[e,n,r,i];if(Array.isArray(e))return[e.map((e,a)=>this.serializeValue(e,[...t,a],n,r,i)[0]),n,r,i];if(EQ(e)){let a={};for(let o in e){let s=e[o];(o!==`toJSON`||typeof s!=`function`)&&(s===void 0&&this.omitUndefinedProperties||(a[o]=this.serializeValue(s,[...t,o],n,r,i)[0]))}return[a,n,r,i]}return[e,n,r,i]}deserialize(e){let t={data:e.json};return e.blobs?.length&&e.maps.forEach((n,r)=>{let i=t,a=`data`;n.forEach(e=>{if(i=i[a],a=e,!Object.hasOwn(i,a))throw Error(`Security error: Invalid serialized data. Segment "${a}" does not exist.`)}),i[a]=e.blobs[r]}),e.meta?.forEach(e=>{let n=e[0],r=t,i=`data`;for(let t=1;t<e.length;t++)if(r=r[i],i=e[t],!Object.hasOwn(r,i))throw Error(`Security error: Invalid serialized data. Segment "${i}" does not exist.`);r[i]=this.handlers[n].deserialize(r[i])}),t.data}},h$=class{jsonSerializer;defaultSerializeOptions;constructor(e={}){this.jsonSerializer=new m$(e),this.defaultSerializeOptions=e.serialize}serialize(e,t={}){return e===void 0||e instanceof ReadableStream||e instanceof Blob?e:$Z(e)?d$(e,{mapResult:e=>e.value===void 0?e:{done:e.done,value:this.serializeValue(e.value,t)},mapError:e=>new PQ(this.serializeValue(c$(e).toJSON(),{...t,useFormDataForBlobFields:!1}),{cause:e})}):this.serializeValue(e,t)}serializeValue(e,t){let n=t.useFormDataForBlobFields??this.defaultSerializeOptions?.useFormDataForBlobFields??!0,{json:r,meta:i,maps:a,blobs:o}=this.jsonSerializer.serialize(e);if(!n||!o?.length)return{json:r,meta:i};let s=new FormData;return s.set(`data`,rQ({json:r,meta:i,maps:a})),o.forEach((e,t)=>{s.set(t.toString(),e)}),s}deserialize(e){return e===void 0||e instanceof ReadableStream||e instanceof Blob?e:$Z(e)?d$(e,{mapResult:e=>e.value===void 0?e:{done:e.done,value:this.deserializeValue(e.value)},mapError:e=>{if(!(e instanceof PQ))return e;let t=this.deserializeValue(e.data);return l$(t)?u$(t,{cause:e}):new PQ(t,{cause:e})}}):this.deserializeValue(e)}deserializeValue(e){if(!(e instanceof FormData))return this.jsonSerializer.deserialize(e);let t=JSON.parse(e.get(`data`)),n=[];for(let[t,r]of e)r instanceof Blob&&(n[Number(t)]=r);return this.jsonSerializer.deserialize({...t,blobs:n})}},g$=new Set([`then`,`bind`,`valueOf`,`toString`,`toJSON`]);function _$(e){return{...e,context:e.context??{}}}function v$(e){return[e[0],_$(e[1]??{})]}function y$(e,{path:t=[],...n}={}){return new Proxy((...r)=>{let[i,a]=v$(r);return AQ([...XZ(n.interceptors),...XZ(n.scoped?.interceptors)],{...a,input:i,path:t},({path:t,input:n,...r})=>e.call(t,n,r))},{get(r,i){if(typeof i!=`string`||g$.has(i))return oQ(r,i);let a=n.scoped===void 0?void 0:n.scoped[i];return y$(e,{...n,path:[...t,i],scoped:a})}})}var b$=class{constructor(e=[]){this.plugins=e,this.plugins=jQ(e)}name=`~composite`;init(e){for(let t of this.plugins)t.init&&(e=t.init(e));return e}initProcedureOptions(e,t){for(let n of this.plugins)n.initProcedureOptions&&(t=n.initProcedureOptions(e,t));return t}};function x$(e,t={}){return[...t.prefix===void 0?[]:[t.prefix],e,{...t.input===void 0?{}:{input:t.input},...t.type===void 0?{}:{type:t.type},...t.fnOptions===void 0?{}:{fnOptions:t.fnOptions}}]}function S$(e){return async t=>{let n=await e(t),r;for await(let e of n)t.signal?.throwIfAborted(),r={chunk:e},t.client.setQueryData(t.queryKey,e);if(!r)throw TypeError(`Live query for ${rQ(t.queryKey)} did not yield any data. Ensure the query function returns an AsyncIterable with at least one chunk.`);return r.chunk}}var C$=class{constructor(e,t){this.path=e,this.options=t}key(e={}){return x$(this.path,{...e,prefix:this.options.prefix})}};function w$(e,{refetchMode:t=`reset`,maxChunks:n=1/0}={}){return async r=>{let i=r.client.getQueryCache().find({queryKey:r.queryKey,exact:!0}),a=!!i&&i.state.data!==void 0;a&&(t===`reset`?i.setState({status:`pending`,data:void 0,error:null,fetchStatus:`fetching`}):r.client.setQueryData(r.queryKey,(e=[])=>T$(e,n)));let o=[],s=await e(r),c=!a||t!==`replace`;r.client.setQueryData(r.queryKey,(e=[])=>T$(e,n));for await(let e of s){if(r.signal.aborted)throw r.signal.reason;o.push(e),o=T$(o,n),c&&r.client.setQueryData(r.queryKey,(t=[])=>T$([...t,e],n))}c||r.client.setQueryData(r.queryKey,o);let l=r.client.getQueryData(r.queryKey);return l?T$(l,n):o}}function T$(e,t){return e.length<=t?e:e.slice(e.length-t)}var E$=Symbol.for(`ORPC_TANSTACK_QUERY_OPERATION_CONTEXT`),D$=[`queryInterceptors`,`streamedInterceptors`,`liveInterceptors`,`infiniteInterceptors`,`mutationInterceptors`],O$=[`queryKey`,`queryOptions`,`streamedKey`,`streamedOptions`,`liveKey`,`liveOptions`,`infiniteKey`,`infiniteOptions`,`mutationKey`,`mutationOptions`];function k$(e){if(!iQ(e))return!1;for(let t in e)if(e[t]!==void 0){if(t===`prefix`){if(typeof e[t]!=`string`)return!1}else if(D$.includes(t)){if(!Array.isArray(e[t])||e[t].some(e=>typeof e!=`function`))return!1}else if(O$.includes(t)&&!iQ(e[t]))return!1}return!0}function A$(e,t){if(typeof e!=`function`&&typeof t!=`function`)return{...e,...t};let n=typeof e==`function`?e:t=>({...e,...t}),r=typeof t==`function`?t:e=>({...t,...e});return e=>r(n(e))}function j$(e,t){let n={...e,...t};for(let r of D$){let i=e[r],a=t[r];i&&a&&(n[r]=[...i,...a])}for(let r of O$){let i=e[r],a=t[r];i&&a&&(n[r]=A$(i,a))}return n}var M$=class extends C${call;constructor(e,t,n={}){super(e,n),this.call=t}queryKey(...e){let t=cQ(e);return typeof this.options.queryKey==`function`?t=this.options.queryKey(t):this.options.queryKey&&(t={...this.options.queryKey,...t}),t.queryKey??x$(this.path,{prefix:this.options.prefix,type:`query`,input:t.input})}queryOptions(...e){let t=cQ(e);typeof this.options.queryOptions==`function`?t=this.options.queryOptions(t):this.options.queryOptions&&(t={...this.options.queryOptions,...t});let n=this.queryKey(t);return{...t,queryKey:n,queryFn:e=>AQ(this.options.queryInterceptors,{path:this.path,context:{[E$]:{key:n,type:`query`},...t.context},input:t.input,fnContext:e},({context:e,input:n,fnContext:r})=>{if(n===B||t.queryFn===B)throw Error(`queryFn should not be called when skipToken used for skipping`);return t.queryFn?t.queryFn(r):this.call(n,{signal:r.signal,context:e})}),...t.input===B||t.queryFn===B?{enabled:!1}:{}}}streamedKey(...e){let t=cQ(e);return typeof this.options.streamedKey==`function`?t=this.options.streamedKey(t):this.options.streamedKey&&(t={...this.options.streamedKey,...t}),t.queryKey??x$(this.path,{prefix:this.options.prefix,type:`streamed`,input:t.input,fnOptions:t.queryFnOptions})}streamedOptions(...e){let t=cQ(e);typeof this.options.streamedOptions==`function`?t=this.options.streamedOptions(t):this.options.streamedOptions&&(t={...this.options.streamedOptions,...t});let n=this.streamedKey(t);return{...t,queryKey:n,queryFn:e=>AQ(XZ(this.options.streamedInterceptors),{path:this.path,context:{[E$]:{key:n,type:`streamed`},...t.context},input:t.input,fnContext:e},({context:e,fnContext:n,input:r})=>{if(r===B||t.queryFn===B)throw Error(`queryFn should not be called when skipToken used for skipping`);return t.queryFn?t.queryFn(n):w$(async t=>{let n=await this.call(r,{signal:t.signal,context:e});if(!$Z(n))throw Error(`streamedQuery requires an AsyncIteratorObject output`);return n},t.queryFnOptions)(n)}),...t.input===B||t.queryFn===B?{enabled:!1}:{}}}liveKey(...e){let t=cQ(e);return typeof this.options.liveKey==`function`?t=this.options.liveKey(t):this.options.liveKey&&(t={...this.options.liveKey,...t}),t.queryKey??x$(this.path,{prefix:this.options.prefix,type:`live`,input:t.input})}liveOptions(...e){let t=cQ(e);typeof this.options.liveOptions==`function`?t=this.options.liveOptions(t):this.options.liveOptions&&(t={...this.options.liveOptions,...t});let n=this.liveKey(t);return{...t,queryKey:n,queryFn:e=>AQ(XZ(this.options.liveInterceptors),{path:this.path,context:{[E$]:{key:n,type:`live`},...t.context},input:t.input,fnContext:e},({fnContext:e,input:n,context:r})=>{if(n===B||t.queryFn===B)throw Error(`queryFn should not be called when skipToken used for skipping`);return t.queryFn?t.queryFn(e):S$(async e=>{let t=await this.call(n,{signal:e.signal,context:r});if(!$Z(t))throw Error(`liveQuery requires an AsyncIteratorObject output`);return t})(e)}),...t.input===B||t.queryFn===B?{enabled:!1}:{}}}infiniteKey(e){return typeof this.options.infiniteKey==`function`?e=this.options.infiniteKey(e):this.options.infiniteKey&&(e={...this.options.infiniteKey,...e}),e.queryKey??x$(this.path,{prefix:this.options.prefix,type:`infinite`,input:e.input===B?B:e.input(e.initialPageParam)})}infiniteOptions(e){typeof this.options.infiniteOptions==`function`?e=this.options.infiniteOptions(e):this.options.infiniteOptions&&(e={...this.options.infiniteOptions,...e});let t=this.infiniteKey(e);return{...e,queryKey:t,queryFn:n=>AQ(XZ(this.options.infiniteInterceptors),{path:this.path,context:{[E$]:{key:t,type:`infinite`},...e.context},input:e.input===B?B:e.input(n.pageParam),fnContext:n},({context:t,input:n,fnContext:r})=>{if(n===B||e.queryFn===B)throw Error(`queryFn should not be called when skipToken used for skipping`);return e.queryFn?e.queryFn(r):this.call(n,{signal:r.signal,context:t})}),...e.input===B||e.queryFn===B?{enabled:!1}:{}}}mutationKey(e={}){return typeof this.options.mutationKey==`function`?e=this.options.mutationKey(e):this.options.mutationKey&&(e={...this.options.mutationKey,...e}),e.mutationKey??x$(this.path,{prefix:this.options.prefix,type:`mutation`})}mutationOptions(...e){let t=cQ(e);typeof this.options.mutationOptions==`function`?t=this.options.mutationOptions(t):this.options.mutationOptions&&(t={...this.options.mutationOptions,...t});let n=this.mutationKey(t);return{...t,mutationKey:n,mutationFn:(e,r)=>AQ(XZ(this.options.mutationInterceptors),{path:this.path,context:{[E$]:{key:n,type:`mutation`},...t.context},fnContext:r,input:e},({input:e,fnContext:n,context:r})=>t.mutationFn?t.mutationFn(e,n):this.call(e,{context:r}))}}};function N$(e,t={}){let n=new b$(t.plugins);return t=n.init(t),P$(e,t,n)}function P$(e,t,n){let r=XZ(t.path),i=typeof e==`function`&&(t.scoped===void 0||k$(t.scoped))?kQ(new M$(r,e,n.initProcedureOptions(r,j$({prefix:t.prefix,queryInterceptors:t.queryInterceptors,streamedInterceptors:t.streamedInterceptors,liveInterceptors:t.liveInterceptors,infiniteInterceptors:t.infiniteInterceptors,mutationInterceptors:t.mutationInterceptors},t.scoped??{})))):kQ(new C$(r,t));return new Proxy(i,{get(i,a){let o=oQ(i,a),s=e[a];if(typeof a!=`string`||g$.has(a)||!iQ(s))return o;let c=P$(s,{...t,path:[...r,a],scoped:DQ(t.scoped,[a])},n);return typeof o==`function`?new Proxy(o,{get(e,t){return typeof t!=`string`||g$.has(t)?oQ(e,t):oQ(c,t)}}):c}})}function F$(e){let t=(e?.pipeThrough(new TextDecoderStream).pipeThrough(new BQ))?.getReader(),n=!1;return new tQ(async()=>{for(;;){if(t===void 0)return{done:!0,value:void 0};let{done:e,value:r}=await t.read();if(e){if(n)throw new ZZ(`Stream was cancelled`);return{done:!0,value:void 0}}switch(r.event){case`message`:{let e=nQ(r.data);return iQ(e)&&(e=QQ(e,r)),{done:!1,value:e}}case`error`:{let e=new PQ(nQ(r.data));throw e=QQ(e,r),e}case`close`:{let e=nQ(r.data);return iQ(e)&&(e=QQ(e,r)),{done:!0,value:e}}}}},async e=>{e.kind===`cancelled`&&(n=!0),await t?.cancel()})}function I$(e,t={}){let n=t.keepAlive?.enabled??!0,r=t.keepAlive?.interval??15e3,i=t.keepAlive?.comment??``,a=t.initialComment?.enabled??!0,o=t.initialComment?.comment??``,s=t.emptyCloseEventEnabled??!0,c=!1,l;return new ReadableStream({start(e){a&&e.enqueue(YQ({comments:[o]}))},async pull(t){try{n&&(l=setInterval(()=>{t.enqueue(YQ({comments:[i]}))},r));let a=await e.next();if(clearInterval(l),c)return;let[o,u]=$Q(a.value);if(!a.done||o!==void 0||u!==void 0||s){let e=a.done?`close`:`message`;t.enqueue(YQ({...u,event:e,data:rQ(o)}))}a.done&&t.close()}catch(e){if(clearInterval(l),c)return;e instanceof PQ?(t.enqueue(YQ({...e$(e),event:`error`,data:rQ(e.data)})),t.close()):t.error(e)}},async cancel(){c=!0,clearInterval(l),await e.return?.()}}).pipeThrough(new TextEncoderStream)}async function L$(e,t){let n=t?.hint??e.headers.get(`standard-server`),r=e.headers.get(`content-type`)?.split(`;`)[0]?.trim(),i=e.headers.get(`content-length`);if(n!==`none`&&(n!==null||r!==void 0||i!==`0`&&i!==null)&&(n!==null||e.body!==null)){if(e.bodyUsed)throw TypeError(`Failed to read body: body stream already read`);if(n===`json`||n===null&&r===`application/json`)return nQ(await e.text());if(n===`form-data`||n===null&&r===`multipart/form-data`)return await e.formData();if(n===`url-search-params`||n===null&&r===`application/x-www-form-urlencoded`){let t=await e.text();return new URLSearchParams(t)}if(n===`event-stream`||n===null&&r===`text/event-stream`)return F$(e.body);if(n===`file`||n===null&&i!==null){let t=e.headers.get(`content-disposition`),n=t===null?void 0:n$(t),r=await e.blob();return new File([r],n??`blob`,{type:r.type})}return e.body??new ReadableStream({start(e){e.close()}})}}function R$(e,t,n={}){return t={...t},e instanceof ReadableStream?(t[`standard-server`]??=`octet-stream`,t[`content-type`]??=`application/octet-stream`,[e,t]):e instanceof Blob?(t[`standard-server`]??=`file`,t[`content-type`]=e.type,t[`content-disposition`]??=t$(e instanceof File?e.name:`blob`),Number.isFinite(e.size)?(t[`content-length`]=e.size.toString(),[e,t]):[e.stream(),t]):(t[`standard-server`]=void 0,t[`content-length`]=void 0,e===void 0?(t[`content-type`]=void 0,[void 0,t]):e instanceof FormData||e instanceof URLSearchParams?(t[`content-type`]=void 0,[e,t]):$Z(e)?(t[`content-type`]=`text/event-stream`,[I$(e,n.eventStream),t]):(t[`content-type`]=`application/json`,[rQ(e),t]))}function z$(e){let t={};return e.forEach((e,n)=>{Array.isArray(t[n])?t[n].push(e):t[n]===void 0?t[n]=e:t[n]=[t[n],e]}),t}function B$(e){let t=new Headers;for(let[n,r]of Object.entries(e))if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.append(n,r);return t}function V$(e){return{resolveBody:t=>L$(e,{hint:t}),status:e.status,get headers(){let t=z$(e.headers);return Object.defineProperty(this,"headers",{value:t,writable:!0}),t},set headers(e){Object.defineProperty(this,"headers",{value:e,writable:!0})}}}var H$=class{name=`~composite`;plugins;constructor(e=[]){this.plugins=jQ(e)}init(e){for(let t of this.plugins)t.init&&(e=t.init(e));return e}},U$=class{constructor(e,t,n={}){this.codec=e,this.transport=t,n=new H$(n.plugins).init(n),this.interceptors=n.interceptors,this.transportInterceptors=n.transportInterceptors}interceptors;transportInterceptors;call(e,t,n){return yQ(`${lQ}.${e.join(`/`)}`,r=>(r?.setAttribute(`rpc.system`,lQ),r?.setAttribute(`rpc.method`,e.join(`.`)),$Z(t)&&(t=wQ(t,SQ(`consume_async_iterator_object_input`,t))),AQ(this.interceptors,{...n,path:e,input:t},async({path:e,input:t,...n})=>{let i=hQ(),a,o=i?.trace.getActiveSpan()??r;o&&i&&(a=i.trace.setSpan(i.context.active(),o));let s=await yQ({name:`encode_input`,context:a},()=>this.codec.encodeInput(t,e,n));if(a&&i?.propagation){let e={...s.headers};i.propagation.inject(a,e),s={...s,headers:e}}let c=await AQ(this.transportInterceptors,{...n,path:e,request:s},({path:e,request:t,...n})=>{let r,a=i?.trace.getActiveSpan()??o;return a&&i&&(r=i.trace.setSpan(i.context.active(),a)),yQ({name:`send_request`,context:r},()=>this.transport.send(t,e,n))}),l=await yQ({name:`decode_response`,context:a},()=>this.codec.decodeResponse(c,e,n));if(l.kind===`error`)throw l.error;let u=l.output;return $Z(u)?wQ(u,SQ(`consume_async_iterator_object_output`,u)):u})))}},W$=/\/$/,G$=class{baseUrl;maxUrlLength;fallbackMethod;expectedMethod;headers;serializer;constructor(e){this.baseUrl=e.url??`/`,this.maxUrlLength=e.maxUrlLength??2083,this.fallbackMethod=e.fallbackMethod??`POST`,this.expectedMethod=e.method??this.fallbackMethod,this.headers=e.headers??{},this.serializer=e.serializer??new h$}async encodeInput(e,t,n){let r=K$(await CQ(this.headers,n,t,e));n.lastEventId!==void 0&&(r=r$(r,{"last-event-id":n.lastEventId}));let i=await CQ(this.expectedMethod,n,t,e),[a,o,s]=i$(await CQ(this.baseUrl,n,t,e)),c=`${a.replace(W$,``)}${fQ(t)}`,l=this.serializer.serialize(e);if(i===`GET`&&!(l instanceof Blob)&&!(l instanceof ReadableStream)&&!(l instanceof FormData)&&!$Z(l)){let a=await CQ(this.maxUrlLength,n,t,e),u=new URLSearchParams(o);u.append(`data`,rQ(l)??``);let d=`${c}?${u}${s??``}`;if(d.length<=a)return{body:void 0,method:i,headers:r,url:d,signal:n.signal}}return{url:`${c}${o??``}${s??``}`,method:i===`GET`?this.fallbackMethod:i,headers:r,body:l,signal:n.signal}}async decodeResponse(e){let t=e.status<400,n=await e.resolveBody(),r=await(async()=>{try{return this.serializer.deserialize(n)}catch(e){throw Error(`Invalid RPC response format.`,{cause:e})}})();return t?{kind:`output`,output:r}:l$(r)?{kind:`error`,error:u$(r)}:{kind:`error`,error:new s$(`MALFORMED_ORPC_ERROR_RESPONSE`,{data:{headers:e.headers,status:e.status,body:r}})}}};function K$(e){return typeof e.forEach==`function`?z$(e):e}var q$=class{constructor(e=[]){this.plugins=e,this.plugins=jQ(e)}name=`~composite/fetch-link-transport`;initFetchLinkTransportOptions(e){for(let t of this.plugins)t.initFetchLinkTransportOptions&&(e=t.initFetchLinkTransportOptions(e));return e}},J$=dQ(()=>{try{let e;return new Request(`https://example.com`,{method:`POST`,body:new ReadableStream,get duplex(){return e=`half`,`half`}}),e}catch{return}}),Y$=class{origin;fetch;toFetchRequestOptions;fetchInterceptors;constructor(e){e=new q$(e.plugins).initFetchLinkTransportOptions(e),this.origin=e.origin,this.fetch=e.fetch??globalThis.fetch.bind(globalThis),this.toFetchRequestOptions=e.toFetchRequest,this.fetchInterceptors=e.fetchInterceptors}async send(e,t,n){let r=await CQ(this.origin,n,t);r?.endsWith(`/`)&&(r=r.slice(0,-1));let i=`${r??``}${e.url}`,[a,o]=R$(e.body,e.headers,this.toFetchRequestOptions),s={body:a,headers:B$(o),method:e.method,signal:n.signal,redirect:`manual`};if(a instanceof ReadableStream){let e=J$();e!==void 0&&(s.duplex=e)}return V$(await AQ(this.fetchInterceptors,{...n,url:i,path:t,init:s},({url:e,path:t,init:n,...r})=>this.fetch(e,n,r,t)))}},X$=class extends U${constructor(e){let t=new G$(e),n=new Y$(e);super(t,n,e)}};function Z$(e){return e==null}function Q$(e,t){let n={},r=Object.keys(e);for(let i=0;i<r.length;i++){let a=r[i],o=e[a];t(o,a)||(n[a]=o)}return n}function $$(e){if(typeof e==`string`)return e.trim()||void 0}function e1(e){return Array.isArray(e)?e.flatMap(e=>{let t=$$(e);return t?[t]:[]}):[]}function t1(e,t=`Request failed`){let n=$$(e);if(n)return n;if(typeof e!=`object`||!e)return t;let r=e,i=$$(r.error)??$$(r.message)??$$(r.details)??t;if(r.code===`integration_validation_failed`){let e=e1(r.invalidIntegrationIds);if(e.length>0)return`${i} (invalid integration IDs: ${e.join(`, `)})`}return i}var n1=s(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}}))();function r1(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++)if(arguments[t])for(let n in arguments[t])e[n]=arguments[t][n];return e}var i1=r1;typeof Object.assign==`function`&&(i1=Object.assign);function a1(e,t,n,r){let i=e._nodes.get(t),a=null;return i&&(a=r===`mixed`?i.out&&i.out[n]||i.undirected&&i.undirected[n]:r===`directed`?i.out&&i.out[n]:i.undirected&&i.undirected[n]),a}function o1(e){return typeof e==`object`&&!!e}function s1(e){let t;for(t in e)return!1;return!0}function c1(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function l1(e,t,n){let r={enumerable:!0,configurable:!0};typeof n==`function`?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function u1(e){return!(!o1(e)||e.attributes&&!Array.isArray(e.attributes))}function d1(){let e=Math.floor(Math.random()*256)&255;return()=>e++}function f1(){let e=arguments,t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function p1(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}var m1=class extends Error{constructor(e){super(),this.name=`GraphError`,this.message=e}},h1=class e extends m1{constructor(t){super(t),this.name=`InvalidArgumentsGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},g1=class e extends m1{constructor(t){super(t),this.name=`NotFoundGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},_1=class e extends m1{constructor(t){super(t),this.name=`UsageGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}};function v1(e,t){this.key=e,this.attributes=t,this.clear()}v1.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function y1(e,t){this.key=e,this.attributes=t,this.clear()}y1.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function b1(e,t){this.key=e,this.attributes=t,this.clear()}b1.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function x1(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}x1.prototype.attach=function(){let e=`out`,t=`in`;this.undirected&&(e=t=`undirected`);let n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)},x1.prototype.attachMulti=function(){let e=`out`,t=`in`,n=this.source.key,r=this.target.key;this.undirected&&(e=t=`undirected`);let i=this.source[e],a=i[r];if(a===void 0){i[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}a.previous=this,this.next=a,i[r]=this,this.target[t][n]=this},x1.prototype.detach=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),delete this.source[n][t],delete this.target[r][e]},x1.prototype.detachMulti=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};var S1=0,C1=1,w1=2,T1=3;function E1(e,t,n,r,i,a,o){let s,c,l,u;if(r=``+r,n===S1){if(s=e._nodes.get(r),!s)throw new g1(`Graph.${t}: could not find the "${r}" node in the graph.`);l=i,u=a}else if(n===T1){if(i=``+i,c=e._edges.get(i),!c)throw new g1(`Graph.${t}: could not find the "${i}" edge in the graph.`);let n=c.source.key,d=c.target.key;if(r===n)s=c.target;else if(r===d)s=c.source;else throw new g1(`Graph.${t}: the "${r}" node is not attached to the "${i}" edge (${n}, ${d}).`);l=a,u=o}else{if(c=e._edges.get(r),!c)throw new g1(`Graph.${t}: could not find the "${r}" edge in the graph.`);s=n===C1?c.source:c.target,l=i,u=a}return[s,l,u]}function D1(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=E1(this,t,n,e,r,i);return a.attributes[o]}}function O1(e,t,n){e.prototype[t]=function(e,r){let[i]=E1(this,t,n,e,r);return i.attributes}}function k1(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=E1(this,t,n,e,r,i);return a.attributes.hasOwnProperty(o)}}function A1(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=E1(this,t,n,e,r,i,a);return o.attributes[s]=c,this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function j1(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=E1(this,t,n,e,r,i,a);if(typeof c!=`function`)throw new h1(`Graph.${t}: updater should be a function.`);let l=o.attributes;return l[s]=c(l[s]),this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function M1(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=E1(this,t,n,e,r,i);return delete a.attributes[o],this.emit(`nodeAttributesUpdated`,{key:a.key,type:`remove`,attributes:a.attributes,name:o}),this}}function N1(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=E1(this,t,n,e,r,i);if(!o1(o))throw new h1(`Graph.${t}: provided attributes are not a plain object.`);return a.attributes=o,this.emit(`nodeAttributesUpdated`,{key:a.key,type:`replace`,attributes:a.attributes}),this}}function P1(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=E1(this,t,n,e,r,i);if(!o1(o))throw new h1(`Graph.${t}: provided attributes are not a plain object.`);return i1(a.attributes,o),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`merge`,attributes:a.attributes,data:o}),this}}function F1(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=E1(this,t,n,e,r,i);if(typeof o!=`function`)throw new h1(`Graph.${t}: provided updater is not a function.`);return a.attributes=o(a.attributes),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`update`,attributes:a.attributes}),this}}var I1=[{name:e=>`get${e}Attribute`,attacher:D1},{name:e=>`get${e}Attributes`,attacher:O1},{name:e=>`has${e}Attribute`,attacher:k1},{name:e=>`set${e}Attribute`,attacher:A1},{name:e=>`update${e}Attribute`,attacher:j1},{name:e=>`remove${e}Attribute`,attacher:M1},{name:e=>`replace${e}Attributes`,attacher:N1},{name:e=>`merge${e}Attributes`,attacher:P1},{name:e=>`update${e}Attributes`,attacher:F1}];function L1(e){I1.forEach(function({name:t,attacher:n}){n(e,t(`Node`),S1),n(e,t(`Source`),C1),n(e,t(`Target`),w1),n(e,t(`Opposite`),T1)})}function R1(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new _1(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new _1(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=a1(this,a,o,n),!i)throw new g1(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new _1(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new g1(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes[r]}}function z1(e,t,n){e.prototype[t]=function(e){let r;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new _1(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new _1(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let i=``+e,a=``+arguments[1];if(r=a1(this,i,a,n),!r)throw new g1(`Graph.${t}: could not find an edge for the given path ("${i}" - "${a}").`)}else{if(n!==`mixed`)throw new _1(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,r=this._edges.get(e),!r)throw new g1(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return r.attributes}}function B1(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new _1(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new _1(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=a1(this,a,o,n),!i)throw new g1(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new _1(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new g1(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes.hasOwnProperty(r)}}function V1(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new _1(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new _1(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=a1(this,o,s,n),!a)throw new g1(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new _1(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new g1(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return a.attributes[r]=i,this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function H1(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new _1(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new _1(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=a1(this,o,s,n),!a)throw new g1(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new _1(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new g1(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof i!=`function`)throw new h1(`Graph.${t}: updater should be a function.`);return a.attributes[r]=i(a.attributes[r]),this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function U1(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new _1(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new _1(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=a1(this,a,o,n),!i)throw new g1(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new _1(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new g1(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return delete i.attributes[r],this.emit(`edgeAttributesUpdated`,{key:i.key,type:`remove`,attributes:i.attributes,name:r}),this}}function W1(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new _1(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new _1(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=a1(this,a,o,n),!i)throw new g1(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new _1(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new g1(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!o1(r))throw new h1(`Graph.${t}: provided attributes are not a plain object.`);return i.attributes=r,this.emit(`edgeAttributesUpdated`,{key:i.key,type:`replace`,attributes:i.attributes}),this}}function G1(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new _1(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new _1(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=a1(this,a,o,n),!i)throw new g1(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new _1(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new g1(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!o1(r))throw new h1(`Graph.${t}: provided attributes are not a plain object.`);return i1(i.attributes,r),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`merge`,attributes:i.attributes,data:r}),this}}function K1(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new _1(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new _1(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=a1(this,a,o,n),!i)throw new g1(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new _1(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new g1(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof r!=`function`)throw new h1(`Graph.${t}: provided updater is not a function.`);return i.attributes=r(i.attributes),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`update`,attributes:i.attributes}),this}}var q1=[{name:e=>`get${e}Attribute`,attacher:R1},{name:e=>`get${e}Attributes`,attacher:z1},{name:e=>`has${e}Attribute`,attacher:B1},{name:e=>`set${e}Attribute`,attacher:V1},{name:e=>`update${e}Attribute`,attacher:H1},{name:e=>`remove${e}Attribute`,attacher:U1},{name:e=>`replace${e}Attributes`,attacher:W1},{name:e=>`merge${e}Attributes`,attacher:G1},{name:e=>`update${e}Attributes`,attacher:K1}];function J1(e){q1.forEach(function({name:t,attacher:n}){n(e,t(`Edge`),`mixed`),n(e,t(`DirectedEdge`),`directed`),n(e,t(`UndirectedEdge`),`undirected`)})}var Y1=[{name:`edges`,type:`mixed`},{name:`inEdges`,type:`directed`,direction:`in`},{name:`outEdges`,type:`directed`,direction:`out`},{name:`inboundEdges`,type:`mixed`,direction:`in`},{name:`outboundEdges`,type:`mixed`,direction:`out`},{name:`directedEdges`,type:`directed`},{name:`undirectedEdges`,type:`undirected`}];function X1(e,t,n,r){let i=!1;for(let a in t){if(a===r)continue;let o=t[a];if(i=n(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&i)return o.key}}function Z1(e,t,n,r){let i,a,o,s=!1;for(let c in t)if(c!==r){i=t[c];do{if(a=i.source,o=i.target,s=n(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected),e&&s)return i.key;i=i.next}while(i!==void 0)}}function Q1(e,t){let n=Object.keys(e),r=n.length,i,a=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(a>=r)return{done:!0};let o=n[a++];if(o===t){i=void 0;continue}i=e[o]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}function $1(e,t,n,r){let i=t[n];if(!i)return;let a=i.source,o=i.target;if(r(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected)&&e)return i.key}function e0(e,t,n,r){let i=t[n];if(!i)return;let a=!1;do{if(a=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&a)return i.key;i=i.next}while(i!==void 0)}function t0(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};let e={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:e}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function n0(e,t){if(e.size===0)return[];if(t===`mixed`||t===e.type)return Array.from(e._edges.keys());let n=t===`undirected`?e.undirectedSize:e.directedSize,r=Array(n),i=t===`undirected`,a=e._edges.values(),o=0,s,c;for(;s=a.next(),s.done!==!0;)c=s.value,c.undirected===i&&(r[o++]=c.key);return r}function r0(e,t,n,r){if(t.size===0)return;let i=n!==`mixed`&&n!==t.type,a=n===`undirected`,o,s,c=!1,l=t._edges.values();for(;o=l.next(),o.done!==!0;){if(s=o.value,i&&s.undirected!==a)continue;let{key:t,attributes:n,source:l,target:u}=s;if(c=r(t,n,l.key,u.key,l.attributes,u.attributes,s.undirected),e&&c)return t}}function i0(e,t){if(e.size===0)return p1();let n=t!==`mixed`&&t!==e.type,r=t===`undirected`,i=e._edges.values();return{[Symbol.iterator](){return this},next(){let e,t;for(;;){if(e=i.next(),e.done)return e;if(t=e.value,!(n&&t.undirected!==r))break}return{value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected},done:!1}}}}function a0(e,t,n,r,i,a){let o=t?Z1:X1,s;if(n!==`undirected`&&(r!==`out`&&(s=o(e,i.in,a),e&&s)||r!==`in`&&(s=o(e,i.out,a,r?void 0:i.key),e&&s))||n!==`directed`&&(s=o(e,i.undirected,a),e&&s))return s}function o0(e,t,n,r){let i=[];return a0(!1,e,t,n,r,function(e){i.push(e)}),i}function s0(e,t,n){let r=p1();return e!==`undirected`&&(t!==`out`&&n.in!==void 0&&(r=f1(r,Q1(n.in))),t!==`in`&&n.out!==void 0&&(r=f1(r,Q1(n.out,t?void 0:n.key)))),e!==`directed`&&n.undirected!==void 0&&(r=f1(r,Q1(n.undirected))),r}function c0(e,t,n,r,i,a,o){let s=n?e0:$1,c;if(t!==`undirected`&&(i.in!==void 0&&r!==`out`&&(c=s(e,i.in,a,o),e&&c)||i.out!==void 0&&r!==`in`&&(r||i.key!==a)&&(c=s(e,i.out,a,o),e&&c))||t!==`directed`&&i.undirected!==void 0&&(c=s(e,i.undirected,a,o),e&&c))return c}function l0(e,t,n,r,i){let a=[];return c0(!1,e,t,n,r,i,function(e){a.push(e)}),a}function u0(e,t,n,r){let i=p1();return e!==`undirected`&&(n.in!==void 0&&t!==`out`&&r in n.in&&(i=f1(i,t0(n.in,r))),n.out!==void 0&&t!==`in`&&r in n.out&&(t||n.key!==r)&&(i=f1(i,t0(n.out,r)))),e!==`directed`&&n.undirected!==void 0&&r in n.undirected&&(i=f1(i,t0(n.undirected,r))),i}function d0(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];if(!arguments.length)return n0(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new g1(`Graph.${n}: could not find the "${e}" node in the graph.`);return o0(this.multi,r===`mixed`?this.type:r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let a=this._nodes.get(e);if(!a)throw new g1(`Graph.${n}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new g1(`Graph.${n}: could not find the "${t}" target node in the graph.`);return l0(r,this.multi,i,a,t)}throw new h1(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function f0(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(r===`mixed`||this.type===`mixed`||r===this.type){if(arguments.length===1)return n=e,r0(!1,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new g1(`Graph.${a}: could not find the "${e}" node in the graph.`);return a0(!1,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new g1(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new g1(`Graph.${a}: could not find the "${t}" target node in the graph.`);return c0(!1,r,this.multi,i,o,t,n)}throw new h1(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n;if(e.length===0){let i=0;r!==`directed`&&(i+=this.undirectedSize),r!==`undirected`&&(i+=this.directedSize),n=Array(i);let a=0;e.push((e,r,i,o,s,c,l)=>{n[a++]=t(e,r,i,o,s,c,l)})}else n=[],e.push((e,r,i,a,o,s,c)=>{n.push(t(e,r,i,a,o,s,c))});return this[a].apply(this,e),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n=[];return e.push((e,r,i,a,o,s,c)=>{t(e,r,i,a,o,s,c)&&n.push(e)}),this[a].apply(this,e),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let e=Array.prototype.slice.call(arguments);if(e.length<2||e.length>4)throw new h1(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${e.length}).`);if(typeof e[e.length-1]==`function`&&typeof e[e.length-2]!=`function`)throw new h1(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let t,n;e.length===2?(t=e[0],n=e[1],e=[]):e.length===3?(t=e[1],n=e[2],e=[e[0]]):e.length===4&&(t=e[2],n=e[3],e=[e[0],e[1]]);let r=n;return e.push((e,n,i,a,o,s,c)=>{r=t(r,e,n,i,a,o,s,c)}),this[a].apply(this,e),r}}function p0(e,t){let{name:n,type:r,direction:i}=t,a=`find`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return!1;if(arguments.length===1)return n=e,r0(!0,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new g1(`Graph.${a}: could not find the "${e}" node in the graph.`);return a0(!0,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new g1(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new g1(`Graph.${a}: could not find the "${t}" target node in the graph.`);return c0(!0,r,this.multi,i,o,t,n)}throw new h1(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};let o=`some`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>t(e,n,r,i,a,o,s)),!!this[a].apply(this,e)};let s=`every`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>!t(e,n,r,i,a,o,s)),!this[a].apply(this,e)}}function m0(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return p1();if(!arguments.length)return i0(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(!t)throw new g1(`Graph.${a}: could not find the "${e}" node in the graph.`);return s0(r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new g1(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new g1(`Graph.${a}: could not find the "${t}" target node in the graph.`);return u0(r,i,n,t)}throw new h1(`Graph.${a}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function h0(e){Y1.forEach(t=>{d0(e,t),f0(e,t),p0(e,t),m0(e,t)})}var g0=[{name:`neighbors`,type:`mixed`},{name:`inNeighbors`,type:`directed`,direction:`in`},{name:`outNeighbors`,type:`directed`,direction:`out`},{name:`inboundNeighbors`,type:`mixed`,direction:`in`},{name:`outboundNeighbors`,type:`mixed`,direction:`out`},{name:`directedNeighbors`,type:`directed`},{name:`undirectedNeighbors`,type:`undirected`}];function _0(){this.A=null,this.B=null}_0.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)},_0.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function v0(e,t,n,r,i){for(let a in r){let o=r[a],s=o.source,c=o.target,l=s===n?c:s;if(t&&t.has(l.key))continue;let u=i(l.key,l.attributes);if(e&&u)return l.key}}function y0(e,t,n,r,i){if(t!==`mixed`){if(t===`undirected`)return v0(e,null,r,r.undirected,i);if(typeof n==`string`)return v0(e,null,r,r[n],i)}let a=new _0,o;if(t!==`undirected`){if(n!==`out`){if(o=v0(e,null,r,r.in,i),e&&o)return o;a.wrap(r.in)}if(n!==`in`){if(o=v0(e,a,r,r.out,i),e&&o)return o;a.wrap(r.out)}}if(t!==`directed`&&(o=v0(e,a,r,r.undirected,i),e&&o))return o}function b0(e,t,n){if(e!==`mixed`){if(e===`undirected`)return Object.keys(n.undirected);if(typeof t==`string`)return Object.keys(n[t])}let r=[];return y0(!1,e,t,n,function(e){r.push(e)}),r}function x0(e,t,n){let r=Object.keys(n),i=r.length,a=0;return{[Symbol.iterator](){return this},next(){let o=null;do{if(a>=i)return e&&e.wrap(n),{done:!0};let s=n[r[a++]],c=s.source,l=s.target;if(o=c===t?l:c,e&&e.has(o.key)){o=null;continue}}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}}}}function S0(e,t,n){if(e!==`mixed`){if(e===`undirected`)return x0(null,n,n.undirected);if(typeof t==`string`)return x0(null,n,n[t])}let r=p1(),i=new _0;return e!==`undirected`&&(t!==`out`&&(r=f1(r,x0(i,n,n.in))),t!==`in`&&(r=f1(r,x0(i,n,n.out)))),e!==`directed`&&(r=f1(r,x0(i,n,n.undirected))),r}function C0(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new g1(`Graph.${n}: could not find the "${e}" node in the graph.`);return b0(r===`mixed`?this.type:r,i,t)}}function w0(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new g1(`Graph.${a}: could not find the "${e}" node in the graph.`);y0(!1,r===`mixed`?this.type:r,i,n,t)};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(e,t){let n=[];return this[a](e,(e,r)=>{n.push(t(e,r))}),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(e,t){let n=[];return this[a](e,(e,r)=>{t(e,r)&&n.push(e)}),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(e,t,n){if(arguments.length<3)throw new h1(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let r=n;return this[a](e,(e,n)=>{r=t(r,e,n)}),r}}function T0(e,t){let{name:n,type:r,direction:i}=t,a=n[0].toUpperCase()+n.slice(1,-1),o=`find`+a;e.prototype[o]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new g1(`Graph.${o}: could not find the "${e}" node in the graph.`);return y0(!0,r===`mixed`?this.type:r,i,n,t)};let s=`some`+a;e.prototype[s]=function(e,t){return!!this[o](e,t)};let c=`every`+a;e.prototype[c]=function(e,t){return!this[o](e,(e,n)=>!t(e,n))}}function E0(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return p1();e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new g1(`Graph.${a}: could not find the "${e}" node in the graph.`);return S0(r===`mixed`?this.type:r,i,t)}}function D0(e){g0.forEach(t=>{C0(e,t),w0(e,t),T0(e,t),E0(e,t)})}function O0(e,t,n,r,i){let a=r._nodes.values(),o=r.type,s,c,l,u,d,f,p;for(;s=a.next(),s.done!==!0;){let r=!1;if(c=s.value,o!==`undirected`)for(l in u=c.out,u){d=u[l];do{if(f=d.target,r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}if(o!==`directed`){for(l in u=c.undirected,u)if(!(t&&c.key>l)){d=u[l];do{if(f=d.target,f.key!==l&&(f=d.source),r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}}if(n&&!r&&(p=i(c.key,null,c.attributes,null,null,null,null),e&&p))return null}}function k0(e,t){let n={key:e};return s1(t.attributes)||(n.attributes=i1({},t.attributes)),n}function A0(e,t,n){let r={key:t,source:n.source.key,target:n.target.key};return s1(n.attributes)||(r.attributes=i1({},n.attributes)),e===`mixed`&&n.undirected&&(r.undirected=!0),r}function j0(e){if(!o1(e))throw new h1(`Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.`);if(!(`key`in e))throw new h1(`Graph.import: serialized node is missing its key.`);if(`attributes`in e&&(!o1(e.attributes)||e.attributes===null))throw new h1(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`)}function M0(e){if(!o1(e))throw new h1(`Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.`);if(!(`source`in e))throw new h1(`Graph.import: serialized edge is missing its source.`);if(!(`target`in e))throw new h1(`Graph.import: serialized edge is missing its target.`);if(`attributes`in e&&(!o1(e.attributes)||e.attributes===null))throw new h1(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`);if(`undirected`in e&&typeof e.undirected!=`boolean`)throw new h1(`Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.`)}var N0=d1(),P0=new Set([`directed`,`undirected`,`mixed`]),F0=new Set([`domain`,`_events`,`_eventsCount`,`_maxListeners`]),I0=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:`directed`},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:`undirected`},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:`directed`},{name:e=>`${e}UndirectedEdgeWithKey`,type:`undirected`}],L0={allowSelfLoops:!0,multi:!1,type:`mixed`};function R0(e,t,n){if(n&&!o1(n))throw new h1(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=``+t,n||={},e._nodes.has(t))throw new _1(`Graph.addNode: the "${t}" node already exist in the graph.`);let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function z0(e,t,n){let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function B0(e,t,n,r,i,a,o,s){if(!r&&e.type===`undirected`)throw new _1(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new _1(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!o1(s))throw new h1(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`);if(a=``+a,o=``+o,s||={},!e.allowSelfLoops&&a===o)throw new _1(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let c=e._nodes.get(a),l=e._nodes.get(o);if(!c)throw new g1(`Graph.${t}: source node "${a}" not found.`);if(!l)throw new g1(`Graph.${t}: target node "${o}" not found.`);let u={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new _1(`Graph.${t}: the "${i}" edge already exists in the graph.`);if(!e.multi&&(r?c.undirected[o]!==void 0:c.out[o]!==void 0))throw new _1(`Graph.${t}: an edge linking "${a}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);let d=new x1(r,i,c,l,s);e._edges.set(i,d);let f=a===o;return r?(c.undirectedDegree++,l.undirectedDegree++,f&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,l.inDegree++,f&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?d.attachMulti():d.attach(),r?e._undirectedSize++:e._directedSize++,u.key=i,e.emit(`edgeAdded`,u),i}function gce(e,t,n,r,i,a,o,s,c){if(!r&&e.type===`undirected`)throw new _1(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new _1(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(s){if(c){if(typeof s!=`function`)throw new h1(`Graph.${t}: invalid updater function. Expecting a function but got "${s}"`)}else if(!o1(s))throw new h1(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`)}a=``+a,o=``+o;let l;if(c&&(l=s,s=void 0),!e.allowSelfLoops&&a===o)throw new _1(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let u=e._nodes.get(a),d=e._nodes.get(o),f,p;if(!n&&(f=e._edges.get(i),f)){if((f.source.key!==a||f.target.key!==o)&&(!r||f.source.key!==o||f.target.key!==a))throw new _1(`Graph.${t}: inconsistency detected when attempting to merge the "${i}" edge with "${a}" source & "${o}" target vs. ("${f.source.key}", "${f.target.key}").`);p=f}if(!p&&!e.multi&&u&&(p=r?u.undirected[o]:u.out[o]),p){let t=[p.key,!1,!1,!1];if(c?!l:!s)return t;if(c){let t=p.attributes;p.attributes=l(t),e.emit(`edgeAttributesUpdated`,{type:`replace`,key:p.key,attributes:p.attributes})}else i1(p.attributes,s),e.emit(`edgeAttributesUpdated`,{type:`merge`,key:p.key,attributes:p.attributes,data:s});return t}s||={},c&&l&&(s=l(s));let m={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new _1(`Graph.${t}: the "${i}" edge already exists in the graph.`);let h=!1,g=!1;u||(u=z0(e,a,{}),h=!0,a===o&&(d=u,g=!0)),d||(d=z0(e,o,{}),g=!0),f=new x1(r,i,u,d,s),e._edges.set(i,f);let _=a===o;return r?(u.undirectedDegree++,d.undirectedDegree++,_&&(u.undirectedLoops++,e._undirectedSelfLoopCount++)):(u.outDegree++,d.inDegree++,_&&(u.directedLoops++,e._directedSelfLoopCount++)),e.multi?f.attachMulti():f.attach(),r?e._undirectedSize++:e._directedSize++,m.key=i,e.emit(`edgeAdded`,m),[i,!0,h,g]}function V0(e,t){e._edges.delete(t.key);let{source:n,target:r,attributes:i}=t,a=t.undirected,o=n===r;a?(n.undirectedDegree--,r.undirectedDegree--,o&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,o&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),a?e._undirectedSize--:e._directedSize--,e.emit(`edgeDropped`,{key:t.key,attributes:i,source:n.key,target:r.key,undirected:a})}var H0=class e extends n1.EventEmitter{constructor(e){if(super(),e=i1({},L0,e),typeof e.multi!=`boolean`)throw new h1(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!P0.has(e.type))throw new h1(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!=`boolean`)throw new h1(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);let t=e.type===`mixed`?v1:e.type===`directed`?y1:b1;c1(this,`NodeDataClass`,t);let n=`geid_`+N0()+`_`,r=0;c1(this,`_attributes`,{}),c1(this,`_nodes`,new Map),c1(this,`_edges`,new Map),c1(this,`_directedSize`,0),c1(this,`_undirectedSize`,0),c1(this,`_directedSelfLoopCount`,0),c1(this,`_undirectedSelfLoopCount`,0),c1(this,`_edgeKeyGenerator`,()=>{let e;do e=n+r++;while(this._edges.has(e));return e}),c1(this,`_options`,e),F0.forEach(e=>c1(this,e,this[e])),l1(this,`order`,()=>this._nodes.size),l1(this,`size`,()=>this._edges.size),l1(this,`directedSize`,()=>this._directedSize),l1(this,`undirectedSize`,()=>this._undirectedSize),l1(this,`selfLoopCount`,()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),l1(this,`directedSelfLoopCount`,()=>this._directedSelfLoopCount),l1(this,`undirectedSelfLoopCount`,()=>this._undirectedSelfLoopCount),l1(this,`multi`,this._options.multi),l1(this,`type`,this._options.type),l1(this,`allowSelfLoops`,this._options.allowSelfLoops),l1(this,`implementation`,()=>`graphology`)}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(``+e)}hasDirectedEdge(e,t){if(this.type===`undirected`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&!n.undirected}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new h1(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type===`directed`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&n.undirected}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new h1(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){let t=``+e;return this._edges.has(t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out!==void 0&&n.out.hasOwnProperty(t)||n.undirected!==void 0&&n.undirected.hasOwnProperty(t):!1}throw new h1(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type===`undirected`)return;if(e=``+e,t=``+t,this.multi)throw new _1(`Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new g1(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new g1(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||void 0;if(r)return r.key}undirectedEdge(e,t){if(this.type===`directed`)return;if(e=``+e,t=``+t,this.multi)throw new _1(`Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new g1(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new g1(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);let r=n.undirected&&n.undirected[t]||void 0;if(r)return r.key}edge(e,t){if(this.multi)throw new _1(`Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.`);e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new g1(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new g1(`Graph.edge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new g1(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new g1(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.out}areInNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new g1(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.in}areUndirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new g1(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`directed`&&t in n.undirected}areNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new g1(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&(t in n.in||t in n.out)||this.type!==`directed`&&t in n.undirected}areInboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new g1(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.in||this.type!==`directed`&&t in n.undirected}areOutboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new g1(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.out||this.type!==`directed`&&t in n.undirected}inDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new g1(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree}outDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new g1(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree}directedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new g1(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree}undirectedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new g1(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree}inboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new g1(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree),n}outboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new g1(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.outDegree),n}degree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new g1(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new g1(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new g1(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new g1(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new g1(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new g1(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree,r+=t.directedLoops),n-r}outboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new g1(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.outDegree,r+=t.directedLoops),n-r}degreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new g1(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree,r+=t.directedLoops*2),n-r}source(e){e=``+e;let t=this._edges.get(e);if(!t)throw new g1(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=``+e;let t=this._edges.get(e);if(!t)throw new g1(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=``+e;let t=this._edges.get(e);if(!t)throw new g1(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=``+e,t=``+t;let n=this._edges.get(t);if(!n)throw new g1(`Graph.opposite: could not find the "${t}" edge in the graph.`);let r=n.source.key,i=n.target.key;if(e===r)return i;if(e===i)return r;throw new g1(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${r}, ${i}).`)}hasExtremity(e,t){e=``+e,t=``+t;let n=this._edges.get(e);if(!n)throw new g1(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new g1(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new g1(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=``+e;let t=this._edges.get(e);if(!t)throw new g1(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return R0(this,e,t).key}mergeNode(e,t){if(t&&!o1(t))throw new h1(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=``+e,t||={};let n=this._nodes.get(e);return n?(t&&(i1(n.attributes,t),this.emit(`nodeAttributesUpdated`,{type:`merge`,key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!=`function`)throw new h1(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=``+e;let n=this._nodes.get(e);if(n){if(t){let r=n.attributes;n.attributes=t(r),this.emit(`nodeAttributesUpdated`,{type:`replace`,key:e,attributes:n.attributes})}return[e,!1]}let r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:r}),[e,!0]}dropNode(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new g1(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!==`undirected`){for(let e in t.out){n=t.out[e];do V0(this,n),n=n.next;while(n)}for(let e in t.in){n=t.in[e];do V0(this,n),n=n.next;while(n)}}if(this.type!==`directed`)for(let e in t.undirected){n=t.undirected[e];do V0(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit(`nodeDropped`,{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){let e=``+arguments[0],n=``+arguments[1];if(t=a1(this,e,n,this.type),!t)throw new g1(`Graph.dropEdge: could not find the "${e}" -> "${n}" edge in the graph.`)}else if(e=``+e,t=this._edges.get(e),!t)throw new g1(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return V0(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new _1(`Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new _1(`Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);e=``+e,t=``+t;let n=a1(this,e,t,`directed`);if(!n)throw new g1(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return V0(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new _1(`Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new _1(`Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);let n=a1(this,e,t,`undirected`);if(!n)throw new g1(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return V0(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit(`cleared`)}clearEdges(){let e=this._nodes.values(),t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit(`edgesCleared`)}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!=`function`)throw new h1(`Graph.updateAttribute: updater should be a function.`);let n=this._attributes[e];return this._attributes[e]=t(n),this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit(`attributesUpdated`,{type:`remove`,attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!o1(e))throw new h1(`Graph.replaceAttributes: provided attributes are not a plain object.`);return this._attributes=e,this.emit(`attributesUpdated`,{type:`replace`,attributes:this._attributes}),this}mergeAttributes(e){if(!o1(e))throw new h1(`Graph.mergeAttributes: provided attributes are not a plain object.`);return i1(this._attributes,e),this.emit(`attributesUpdated`,{type:`merge`,attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!=`function`)throw new h1(`Graph.updateAttributes: provided updater is not a function.`);return this._attributes=e(this._attributes),this.emit(`attributesUpdated`,{type:`update`,attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!=`function`)throw new h1(`Graph.updateEachNodeAttributes: expecting an updater function.`);if(t&&!u1(t))throw new h1(`Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,i.attributes=e(i.key,i.attributes);this.emit(`eachNodeAttributesUpdated`,{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!=`function`)throw new h1(`Graph.updateEachEdgeAttributes: expecting an updater function.`);if(t&&!u1(t))throw new h1(`Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._edges.values(),r,i,a,o;for(;r=n.next(),r.done!==!0;)i=r.value,a=i.source,o=i.target,i.attributes=e(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected);this.emit(`eachEdgeAttributesUpdated`,{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!=`function`)throw new h1(`Graph.forEachAdjacencyEntry: expecting a callback.`);O0(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new h1(`Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.`);O0(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!=`function`)throw new h1(`Graph.forEachAssymetricAdjacencyEntry: expecting a callback.`);O0(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new h1(`Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.`);O0(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!=`function`)throw new h1(`Graph.forEachNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)}findNode(e){if(typeof e!=`function`)throw new h1(`Graph.findNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return r.key}mapNodes(e){if(typeof e!=`function`)throw new h1(`Graph.mapNode: expecting a callback.`);let t=this._nodes.values(),n,r,i=Array(this.order),a=0;for(;n=t.next(),n.done!==!0;)r=n.value,i[a++]=e(r.key,r.attributes);return i}someNode(e){if(typeof e!=`function`)throw new h1(`Graph.someNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return!0;return!1}everyNode(e){if(typeof e!=`function`)throw new h1(`Graph.everyNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,!e(r.key,r.attributes))return!1;return!0}filterNodes(e){if(typeof e!=`function`)throw new h1(`Graph.filterNodes: expecting a callback.`);let t=this._nodes.values(),n,r,i=[];for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)&&i.push(r.key);return i}reduceNodes(e,t){if(typeof e!=`function`)throw new h1(`Graph.reduceNodes: expecting a callback.`);if(arguments.length<2)throw new h1(`Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let n=t,r=this._nodes.values(),i,a;for(;i=r.next(),i.done!==!0;)a=i.value,n=e(n,a.key,a.attributes);return n}nodeEntries(){let e=this._nodes.values();return{[Symbol.iterator](){return this},next(){let t=e.next();if(t.done)return t;let n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){let e=Array(this._nodes.size),t=0;this._nodes.forEach((n,r)=>{e[t++]=k0(r,n)});let n=Array(this._edges.size);return t=0,this._edges.forEach((e,r)=>{n[t++]=A0(this.type,r,e)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(t,n=!1){if(t instanceof e)return t.forEachNode((e,t)=>{n?this.mergeNode(e,t):this.addNode(e,t)}),t.forEachEdge((e,t,r,i,a,o,s)=>{n?s?this.mergeUndirectedEdgeWithKey(e,r,i,t):this.mergeDirectedEdgeWithKey(e,r,i,t):s?this.addUndirectedEdgeWithKey(e,r,i,t):this.addDirectedEdgeWithKey(e,r,i,t)}),this;if(!o1(t))throw new h1(`Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.`);if(t.attributes){if(!o1(t.attributes))throw new h1(`Graph.import: invalid attributes. Expecting a plain object.`);n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,i,a,o,s;if(t.nodes){if(a=t.nodes,!Array.isArray(a))throw new h1(`Graph.import: invalid nodes. Expecting an array.`);for(r=0,i=a.length;r<i;r++){o=a[r],j0(o);let{key:e,attributes:t}=o;n?this.mergeNode(e,t):this.addNode(e,t)}}if(t.edges){let e=!1;if(this.type===`undirected`&&(e=!0),a=t.edges,!Array.isArray(a))throw new h1(`Graph.import: invalid edges. Expecting an array.`);for(r=0,i=a.length;r<i;r++){s=a[r],M0(s);let{source:t,target:i,attributes:o,undirected:c=e}=s,l;`key`in s?(l=n?c?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:c?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,l.call(this,s.key,t,i,o)):(l=n?c?this.mergeUndirectedEdge:this.mergeDirectedEdge:c?this.addUndirectedEdge:this.addDirectedEdge,l.call(this,t,i,o))}}return this}nullCopy(t){let n=new e(i1({},this._options,t));return n.replaceAttributes(i1({},this.getAttributes())),n}emptyCopy(e){let t=this.nullCopy(e);return this._nodes.forEach((e,n)=>{let r=i1({},e.attributes);e=new t.NodeDataClass(n,r),t._nodes.set(n,e)}),t}copy(e){if(e||={},typeof e.type==`string`&&e.type!==this.type&&e.type!==`mixed`)throw new _1(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi==`boolean`&&e.multi!==this.multi&&e.multi!==!0)throw new _1(`Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.`);if(typeof e.allowSelfLoops==`boolean`&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new _1(`Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.`);let t=this.emptyCopy(e),n=this._edges.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,B0(t,`copy`,!1,i.undirected,i.key,i.source.key,i.target.key,i1({},i.attributes));return t}toJSON(){return this.export()}toString(){return`[object Graph]`}inspect(){let e={};this._nodes.forEach((t,n)=>{e[n]=t.attributes});let t={},n={};this._edges.forEach((e,r)=>{let i=e.undirected?`--`:`->`,a=``,o=e.source.key,s=e.target.key,c;e.undirected&&o>s&&(c=o,o=s,s=c);let l=`(${o})${i}(${s})`;r.startsWith(`geid_`)?this.multi&&(n[l]===void 0?n[l]=0:n[l]++,a+=`${n[l]}. `):a+=`[${r}]: `,a+=l,t[a]=e.attributes});let r={};for(let e in this)this.hasOwnProperty(e)&&!F0.has(e)&&typeof this[e]!=`function`&&typeof e!=`symbol`&&(r[e]=this[e]);return r.attributes=this._attributes,r.nodes=e,r.edges=t,c1(r,`constructor`,this.constructor),r}};typeof Symbol<`u`&&(H0.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=H0.prototype.inspect),I0.forEach(e=>{[`add`,`merge`,`update`].forEach(t=>{let n=e.name(t),r=t===`add`?B0:gce;e.generateKey?H0.prototype[n]=function(i,a,o){return r(this,n,!0,(e.type||this.type)===`undirected`,null,i,a,o,t===`update`)}:H0.prototype[n]=function(i,a,o,s){return r(this,n,!1,(e.type||this.type)===`undirected`,i,a,o,s,t===`update`)}})}),L1(H0),J1(H0),h0(H0),D0(H0);var U0=class extends H0{constructor(e){let t=i1({type:`directed`},e);if(`multi`in t&&t.multi!==!1)throw new h1(`DirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`directed`)throw new h1(`DirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},W0=class extends H0{constructor(e){let t=i1({type:`undirected`},e);if(`multi`in t&&t.multi!==!1)throw new h1(`UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`undirected`)throw new h1(`UndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},G0=class extends H0{constructor(e){let t=i1({multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new h1(`MultiGraph.from: inconsistent indication that the graph should be simple in given options!`);super(t)}},K0=class extends H0{constructor(e){let t=i1({type:`directed`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new h1(`MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`directed`)throw new h1(`MultiDirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},q0=class extends H0{constructor(e){let t=i1({type:`undirected`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new h1(`MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`undirected`)throw new h1(`MultiUndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}};function J0(e){e.from=function(t,n){let r=new e(i1({},t.options,n));return r.import(t),r}}J0(H0),J0(U0),J0(W0),J0(G0),J0(K0),J0(q0),H0.Graph=H0,H0.DirectedGraph=U0,H0.UndirectedGraph=W0,H0.MultiGraph=G0,H0.MultiDirectedGraph=K0,H0.MultiUndirectedGraph=q0,H0.InvalidArgumentsGraphError=h1,H0.NotFoundGraphError=g1,H0.UsageGraphError=_1;var Y0={condition:`Condition`,wait:`Wait`,eventSplit:`Event Split`},_ce=Nh([`newest-wins`,`first-wins`,`unlimited`]),X0=Eh({startEvents:kh(Wh),cancelEvents:kh(Wh),concurrency:_ce,allowManualStart:_h(wh),correlationPaths:_h(Dh(Sh,Wh))}),Z0={startEvents:[],cancelEvents:[],concurrency:`unlimited`,allowManualStart:!0},vce=Jh(X0);function Q0(e){return vce(e?.lifecycleRules)}function $0(e){return(Q0(e)?.cancelEvents.length??0)>0}function e2(e){return e.rules.correlationPaths?.[e.eventName]??e.declaredPath}function yce(e){return e.startEvents.length>0||e.allowManualStart===!0}function t2(e){return e===void 0||e.allowManualStart===!0}var bce={valid:!0},n2=e=>({valid:!1,error:e});function xce(e){return`No Event named "${e}" is defined. Choose an Event this app declares, or ask whoever defines them to add it.`}function r2(e){return e.concurrency!==`unlimited`||e.cancelEvents.length>0}function i2(e){let{rules:t,catalog:n,eventName:r,role:i}=e;if(!(i===`start`&&!r2(t)))return{eventName:r,role:i,declaredPath:Uy(n,r)?.correlationPath,suppliedPath:t.correlationPaths?.[r]}}function Sce(e){let{rules:t,catalog:n}=e,r=t.startEvents.map(e=>i2({rules:t,catalog:n,eventName:e,role:`start`})),i=t.cancelEvents.map(e=>i2({rules:t,catalog:n,eventName:e,role:`cancel`}));return Ka([...r,...i])}function a2(e){if(!e.correlationPaths)return e;let t=new Set(e.cancelEvents);if(r2(e))for(let n of e.startEvents)t.add(n);let n=Object.fromEntries(Object.entries(e.correlationPaths).filter(([e])=>t.has(e)));return{...e,correlationPaths:Object.keys(n).length>0?n:void 0}}function Cce(e){let{rules:t,catalog:n}=e,r=t.startEvents.find(e=>t.cancelEvents.includes(e));if(r)return n2(`Event "${r}" cannot both start and cancel runs of this workflow. Give it one role, or start on one Event and cancel on another.`);let i=[...t.startEvents,...t.cancelEvents];for(let e of i)if(!Uy(n,e))return n2(xce(e));let a=Sce({rules:t,catalog:n}).find(e=>!e2({rules:t,eventName:e.eventName,declaredPath:e.declaredPath}));return a?n2(wce(a.eventName)):yce(t)?bce:n2(`Nothing can start this workflow. Add a Start Event, or allow manual starts.`)}function wce(e){return`Event "${e}" declares no Correlation Path. Enter the payload path holding the value that identifies the entity, or ask whoever defined the Event to declare it.`}var Tce=Jh(Hh);function Ece(e){return Tce(e)??null}function Dce(e){let t=Ece(e);return typeof t==`object`&&t&&!Array.isArray(t)?t:null}var o2=Dh(Sh,Hh),s2=Eh({byEvent:_h(Dh(Sh,o2)),manual:_h(o2)}),Oce=Jh(s2);function kce(e){return Oce(e?.testPayloads)}function c2(e,t){return t?e?.byEvent?.[t]:e?.manual}var Ace=Eh({lifecycleRules:_h(X0),testPayloads:_h(s2)}).annotate({message:`Lifecycle config must be an object`}),l2={label:Sh,description:_h(Sh),enabled:_h(wh)},jce=Oh(Eh({...l2,type:vh(`lifecycle`),config:_h(Ace)}),Kh),Mce=Mh([Eh({actionType:vh(Y0.condition),condition:_h(Mh([Sh,wh])),conditionModel:_h(Sh),integrationId:_h(Sh)}).annotate({message:`Condition config must be an object`}),Oh(Eh({actionType:vh(Y0.wait),integrationId:_h(Sh),waitDelayTimingMode:_h(Sh),waitMode:_h(Nh([`delay`,`event`])),waitFor:_h(yh),waitTimeout:_h(Sh),waitTimeoutBehavior:_h(Sh),waitDuration:_h(Sh),waitUntil:_h(Sh),waitOffset:_h(Sh),waitGateMode:_h(Sh),waitAllowedHoursMode:_h(Sh),waitAllowedStartTime:_h(Sh),waitAllowedEndTime:_h(Sh),waitTimezone:_h(Sh)}),Kh).annotate({message:`Wait config must be an object`}),Eh({actionType:vh(Y0.eventSplit),integrationId:_h(Sh)}).annotate({message:`Event Split config must be an object`}),Oh(Eh({actionType:_h(Wh.check(Ih(e=>e===Y0.condition||e===Y0.wait||e===Y0.eventSplit?`Built-in action configs use their own schema arm`:!0))),integrationId:_h(Sh)}),Kh)]).annotate({message:`Action config must be an object`}),Nce=Mh([jce,Oh(Eh({...l2,type:vh(`action`),config:_h(Mce)}),Kh),Oh(Eh({...l2,type:vh(`add`),config:_h(Dh(Sh,yh))}),Kh)]).annotate({message:`Node data needs a type of "lifecycle", "action", or "add"`}),u2=Oh(Eh({id:Wh,type:_h(Nh([`lifecycle`,`action`,`add`])),position:_h(Eh({x:Rh,y:Rh})),data:Nce}),Kh),d2=Oh(Eh({id:Wh,source:Wh,target:Wh,sourceHandle:_h(Ph(Wh)),targetHandle:_h(Ph(Wh)),data:_h(Dh(Sh,yh))}),Kh),Pce=Eh({key:Wh,attributes:u2}),Fce=Eh({key:Wh,source:Wh,target:Wh,attributes:d2,undirected:_h(vh(!1))}),f2=Eh({attributes:_h(Dh(Sh,yh)),options:_h(Eh({allowSelfLoops:_h(wh),multi:_h(wh),type:_h(Nh([`directed`,`undirected`,`mixed`]))})),nodes:qh(Pce),edges:qh(Fce)}),p2={allowSelfLoops:!1,multi:!1,type:`directed`},Ice=uh(f2,Gh);lh(f2,{...Gh,errors:`all`});var Lce=uh(u2,Gh);lh(u2,Gh);var Rce=uh(d2,Gh);function m2(e){let t={label:e.label,type:e.type};return e.description!==void 0&&(t.description=e.description),typeof e.config==`object`&&e.config!==null&&!Array.isArray(e.config)&&(t.config={...e.config}),e.enabled!==void 0&&(t.enabled=e.enabled),t}function zce(e,t){let n=e[t];return typeof n==`boolean`?n:void 0}function Bce(e){let t=Lce(e);return{id:t.id,type:t.type,position:t.position??{x:0,y:0},data:m2(t.data),selected:zce(t,`selected`)}}function Vce(e){let t=Rce(e);return{id:t.id,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle,data:t.data}}function Hce(e){let t=Bce(e.attributes);if(e.key!==t.id)throw Error(`Node key '${e.key}' must match node attribute id '${t.id}'`);return t}function Uce(e){let t=Vce(e.attributes);if(e.key!==t.id)throw Error(`Edge key '${e.key}' must match edge attribute id '${t.id}'`);if(e.source!==t.source||e.target!==t.target)throw Error(`Edge '${e.key}' source/target must match edge attributes`);return t}function h2(e){let t=new U0({allowSelfLoops:p2.allowSelfLoops,multi:p2.multi});e.attributes&&t.replaceAttributes(e.attributes);for(let n of e.nodes)t.mergeNode(n.id,{...n,data:m2(n.data)});for(let n of e.edges)t.mergeEdgeWithKey(n.id,n.source,n.target,n);return g2(t.export())}function g2(e){return Ice(e)}function _2(e){let t=g2(e);return{nodes:t.nodes.map(Hce),edges:t.edges.map(Uce)}}function Wce(e){let{status:t,...n}=e.data,r={id:e.id,position:e.position,data:n,type:e.type,selected:e.selected,dragging:e.dragging};return typeof e.width==`number`&&(r.width=e.width),typeof e.height==`number`&&(r.height=e.height),e.measured&&typeof e.measured.width==`number`&&typeof e.measured.height==`number`&&(r.measured={width:e.measured.width,height:e.measured.height}),r}function Gce(e){let{displayLabel:t,...n}=e.data??{};return{id:e.id,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle,data:Object.keys(n).length>0?n:void 0,type:e.type,selected:e.selected}}function v2(e){return{id:e.id,position:e.position,type:e.type,selected:e.selected,dragging:e.dragging,width:e.width,height:e.height,measured:e.measured,data:{...e.data}}}function y2(e){return{id:e.id,source:e.source,target:e.target,sourceHandle:e.sourceHandle??void 0,targetHandle:e.targetHandle??void 0,data:e.data,type:e.type,selected:e.selected}}function b2(e){return h2({nodes:e.nodes.filter(e=>e.type!==`add`).map(Wce),edges:e.edges.map(Gce)})}var x2=class extends Error{constructor(e,t){super(t),this.status=e,this.name=`ApiError`}};function Kce(e){return e instanceof x2&&e.status===400}var qce=`/api/rpc`,S2=`http://localhost:3000`;function C2(){let e=typeof globalThis.location?.origin==`string`?globalThis.location.origin.trim():``;if(!(!e||e===`null`))return e}function Jce(){let e={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1}.VITE_RPC_URL;return typeof e==`string`?e:void 0}function Yce(e={}){let t=e.rpcUrl??Jce();if(t){let n=t.trim();if(n.length>0)try{return new URL(n).toString()}catch{let t=e.origin?.trim()||C2()||S2;try{return new URL(n,t).toString()}catch{return new URL(n,S2).toString()}}}let n=`${My()}${qce}`,r=e.origin?.trim()||C2()||S2;try{return new URL(n,r).toString()}catch{return new URL(n,S2).toString()}}function Xce(e){let t=new URL(e);return{origin:t.origin,pathWithQuery:`/${t.pathname.slice(1)}${t.search}`}}var Zce=a$,w2=Xce(Yce()),T2=y$(new X$({origin:w2.origin,url:w2.pathWithQuery,fetch:(e,t)=>globalThis.fetch(e,t),interceptors:[async e=>{try{return await e.next()}catch(e){throw e instanceof x2?e:e instanceof s$?new x2(Zce[e.code]??500,t1(e.data??e.message)):e instanceof Error?new x2(500,e.message||`Request failed`):new x2(500,`Request failed`)}}]}));function E2(e){let t=_2(e.graph);return{...e,nodes:t.nodes.map(v2),edges:t.edges.map(y2)}}function D2(e){return e.graph?e.graph:b2({nodes:e.nodes??[],edges:e.edges??[]})}var Qce={create:e=>T2.workflow.create({name:e.name,graph:D2(e),...Q$({description:e.description},Z$)}).then(E2),update:(e,t)=>{let n=t.graph!==void 0||t.nodes!==void 0&&t.edges!==void 0?D2({graph:t.graph,nodes:t.nodes,edges:t.edges}):void 0;return T2.workflow.update({workflowId:e,...Q$({name:t.name,description:t.description,graph:n,mode:t.mode},Z$)}).then(E2)}},O2=N$(T2),k2=()=>O2.integration.getAll.queryOptions({input:{}});function $ce(e){return new Set(e.map(e=>e.id))}var ele=new Set,tle=()=>O2.integration.getAll.queryOptions({input:{},select:$ce}),nle=()=>O2.workflow.getAll.queryOptions({input:{}});function rle(e){return e.hasUnpublishedChanges}function ile(e){return O2.workflow.getById.queryOptions({input:{workflowId:e},select:rle,staleTime:1/0})}function A2(e){return e.invalidateQueries({queryKey:O2.workflow.getAll.key()})}function j2(e,t){e.setQueryData(O2.workflow.getById.queryKey({input:{workflowId:t.id}}),e=>e&&{...e,hasUnpublishedChanges:t.hasUnpublishedChanges,updatedAt:t.updatedAt??e.updatedAt,...t.publishedVersionId===void 0?{}:{publishedVersionId:t.publishedVersionId}})}function M2(e){return Promise.all([e.invalidateQueries({queryKey:O2.workflow.getExecutions.key()}),e.invalidateQueries({queryKey:O2.workflow.getExecutionsGlobal.key()})])}function N2(e){return e.invalidateQueries({queryKey:O2.integration.getAll.key()})}function P2(){let e=(0,Z.c)(3),t=Fe(),n=Gi(),r;return e[0]!==n||e[1]!==t?(r=O2.workflow.delete.mutationOptions({onSuccess:async()=>{Fy.success(`Workflow deleted successfully`),await Promise.all([A2(t),M2(t)]),await n({to:`/`,replace:!0})},meta:{errorMessage:`Failed to delete workflow. Please try again.`}}),e[0]=n,e[1]=t,e[2]=r):r=e[2],Ze(r)}function F2(e,t){let n=e?.[t];return typeof n==`string`?n:void 0}function I2(e,t,n){return F2(e,t)??n}function L2(e,t){let n=F2(e,t)?.trim();return n&&n.length>0?n:void 0}function R2(e){if(!(!e||e.data.type!==`action`))return F2(e.data.config,`actionType`)}function ale(e){return!e||e.data.type!==`action`?!1:R2(e)===Y0.condition}function ole(e){return!e||e.data.type!==`action`?!1:R2(e)===Y0.eventSplit}function sle(e,t){return Wy(e,t)?.integration}function z2(e,t,n){let r=F2(t.data.config,`actionType`);if(!r)return t;let i=sle(e,r);if(!i)return t;let a=F2(t.data.config,`integrationId`);if(a&&n.some(e=>e.id===a))return t;let o=n.filter(e=>e.type===i);return o.length===1?V2(t,o[0].id):o.length===0&&a?V2(t,void 0):t}function B2(e,t,n){let r=!1,i=t.map(t=>{let i=z2(e,t,n);return i!==t&&(r=!0),i});return r?i:t}function V2(e,t){return{...e,data:{...e.data,config:{...e.data.config,integrationId:t}}}}var H2=Vy(`workflow`,`save`),U2=nj(null),W2=nj(``),cle=nj(`private`),G2=nj(`live`),K2=nj(!0),q2=nj(null),J2=nj(!1),Y2=nj(null),X2=nj(!1),Z2=nj(!1),Q2=nj(null),$2=nj(Qce);function e4(){Hy.invalidateQueries({queryKey:O2.workflow.getAll.key(),refetchType:`none`})}var lle=nj(1e3),ule=nj(()=>({timeoutId:null,pending:[],failedPatches:new Map,isFlushing:!1}));function t4(e){return e instanceof Error?e:Error(`Failed to save workflow`,{cause:e})}function dle(e){let{nodes:t,edges:n,...r}=e;return t&&n?{...r,nodes:t.filter(e=>e.type!==`add`),edges:n}:r}var n4=nj(null,async(e,t,n,r)=>{t(Z2,!0);let i=e(U2);if(!i)return null;let a=e(ule),o=async()=>{if(!a.isFlushing){a.isFlushing=!0,t(X2,!0);try{for(;a.pending.length>0;){let n=a.pending.shift();if(!n)break;let r;try{let i=await e($2).update(n.workflowId,dle(n.patch));r={ok:!0,workflow:i},t(Q2,null),e4(),j2(Hy,i),!a.pending.some(e=>e.workflowId===n.workflowId)&&!a.failedPatches.has(n.workflowId)&&e(U2)===n.workflowId&&t(Z2,!1)}catch(e){let i=t4(e);r={ok:!1,error:i},t(Q2,i);let o=a.pending.find(e=>e.workflowId===n.workflowId);o?o.patch={...n.patch,...o.patch}:a.failedPatches.set(n.workflowId,{...a.failedPatches.get(n.workflowId),...n.patch}),H2.error(`Save failed`,{workflowId:n.workflowId,error:e})}for(let e of n.waiters)e(r)}}finally{a.isFlushing=!1,t(X2,!1)}}},s=new Promise(e=>{let t=a.failedPatches.get(i),r=t?{...t,...n}:n;a.failedPatches.delete(i);let o=a.pending.at(-1);if(o?.workflowId===i){o.patch={...o.patch,...r},o.waiters.push(e);return}a.pending.push({workflowId:i,patch:r,waiters:[e]})});return a.timeoutId&&=(clearTimeout(a.timeoutId),null),r?.immediate?(await o(),await s):(a.timeoutId=setTimeout(()=>{a.timeoutId=null,o().catch(e=>{H2.error(`Save flush failed`,{error:e})})},e(lle)),await s)}),fle=nj(null,async(e,t,n)=>{t(W2,n),t(q2,null);let r=await t(n4,{name:n});return r?.ok===!1?r.error:null}),ple=nj(null,async(e,t,n)=>await t(n4,{mode:n},{immediate:!0})),mle=nj(null,async(e,t,n)=>{try{let r=await e($2).create({name:n.name,description:n.description??``,nodes:n.nodes.filter(e=>e.type!==`add`),edges:n.edges});return t(U2,r.id),t(W2,r.name),t(q2,null),t(Z2,!1),t(Q2,null),e4(),j2(Hy,r),{ok:!0,workflow:r}}catch(e){let n=t4(e);return t(Q2,n),{ok:!1,error:n}}}),r4=`sidebar-width`,i4=`sidebar-collapsed`,hle=31536e3,gle=20,_le=50,vle=30;function a4(e){if(!(typeof document>`u`))return document.cookie.split(`; `).find(t=>t.startsWith(`${e}=`))?.split(`=`)[1]}function o4(e,t){document.cookie=`${e}=${t}; path=/; max-age=${hle}`}function yle(){let e=Number.parseFloat(a4(r4)??``);return e>=gle&&e<=_le?e:vle}var s4=nj(`properties`),c4=nj(!1),l4=nj(!1),u4=nj(a4(i4)===`true`),d4=nj(e=>e(u4),(e,t,n)=>{let r=typeof n==`function`?n(e(u4)):n;t(u4,r),o4(i4,String(r))}),f4=nj(yle()),p4=nj(e=>e(f4),(e,t,n)=>{t(f4,n),o4(r4,String(n))});function m4(e){return`min(max(${e}%, 320px), 460px)`}var ble=nj(e=>e(d4)?null:m4(e(p4))),h4=nj(!1),g4=nj(!1),_4=nj(e=>e(s4)===`runs`&&e(K2)?`runs`:`properties`),v4=nj(null),y4=nj(e=>e(_4)===`runs`?e(v4):null,(e,t,n)=>{t(v4,n)});function b4(e,t){return!t||e?.[t.field]===t.equals}function x4(e,t){return t.filter(t=>b4(e,t.showWhen))}var xle=/\{\{@([^:{}]+):([^{}]+)\}\}/g;function Sle(e){let[t,n,r]=e,i=r.indexOf(`.`);return{raw:t,nodeId:n,nodeLabel:i===-1?r:r.slice(0,i),fieldPath:i===-1?``:r.slice(i+1),start:e.index,end:e.index+t.length}}function S4(e){let t=new RegExp(xle.source,`g`),n=[],r=t.exec(e);for(;r!==null;)n.push(Sle(r)),r=t.exec(e);return n}function C4(e){let t=[],n=0;for(let r of S4(e))r.start>n&&t.push({kind:`literal`,text:e.slice(n,r.start)}),t.push({kind:`token`,token:r}),n=r.end;return n<e.length&&t.push({kind:`literal`,text:e.slice(n)}),t}function w4(e){let t=e.fieldPath?`.${e.fieldPath}`:``;return`{{@${e.nodeId}:${e.nodeLabel}${t}}}`}var Cle=/\[(\d+)\]/g,wle=/^([^[]*)((?:\[\d+\])*)$/;function Tle(e){let t=[];for(let n of e.split(`.`)){let e=n.trim();if(!e)return null;let r=wle.exec(e);if(!r)return null;let i=r[1];if(i.includes(`]`))return null;i&&t.push({kind:`key`,key:i});for(let n of e.matchAll(Cle)){let e=Number(n[1]);if(!Number.isSafeInteger(e))return null;t.push({kind:`index`,index:e})}}return t.length>0?t:null}var T4=`started`,E4=`canceled`;function Ele(e){return e===`started`||e===`canceled`}function Dle(e){let{entryNodeIds:t,outlet:n,edges:r}=e,i=new Map,a=[];for(let e of r){let r=i.get(e.source);r?r.push(e.target):i.set(e.source,[e.target]),t.has(e.source)&&e.sourceHandle===n&&a.push(e.target)}let o=new Set;for(;a.length>0;){let e=a.pop();!e||o.has(e)||(o.add(e),a.push(...i.get(e)??[]))}return o}var D4={nodeIds:new Set,edgeIds:new Set,outletEdgeIds:new Set};function Ole(e){let t=e.nodes.filter(e=>e.data.type===`lifecycle`);if(t.length===0||t.some(e=>$0(e.data.config)))return D4;let n=new Set(t.map(e=>e.id)),r=Dle({entryNodeIds:n,outlet:E4,edges:e.edges});if(r.size===0)return D4;let i=new Set,a=new Set;for(let t of e.edges){if(n.has(t.source)&&t.sourceHandle===`canceled`){a.add(t.id),i.add(t.id);continue}r.has(t.source)&&i.add(t.id)}return{nodeIds:r,edgeIds:i,outletEdgeIds:a}}var O4=nj([]),k4=nj([]),A4=nj(null),j4=nj(e=>e(O4)),M4=nj(e=>e(k4)),N4=nj(new Map),P4=nj(e=>e(A4)!==null),F4=nj(e=>e(g4)||e(P4)),I4=nj(e=>Ole({nodes:e(A4)?.nodes??e(O4),edges:e(A4)?.edges??e(k4)})),kle={opacity:.5},Ale={opacity:.4},jle=nj(e=>{let t=e(A4)?.nodes??e(O4),n=e(N4),{nodeIds:r}=e(I4);return n.size===0&&r.size===0?t:t.map(e=>{let t={...e,data:{...e.data,status:n.get(e.id)??`idle`}};return r.has(e.id)?{...t,style:{...t.style,...kle}}:t})}),Mle=nj(e=>{let t=e(A4)?.edges??e(k4),{edgeIds:n,outletEdgeIds:r}=e(I4);return n.size===0?t:t.map(e=>n.has(e.id)?{...e,style:{...e.style,...Ale},...r.has(e.id)?{data:{...e.data,displayLabel:`No Cancel Event`}}:{}}:e)});function L4(e){return e(A4)===null}var R4=nj(null),z4=nj(null),B4=nj(null),V4=nj([]),H4=nj([]),U4=nj(!1);function W4(e,t){let n={nodes:e(O4),edges:e(k4)};t(V4,[...e(V4),n].slice(-50)),t(H4,[])}function G4(e,t,n){t(n4,{nodes:e(O4),edges:e(k4)},n)}var Nle=nj(null,(e,t,n)=>{t(O4,n.nodes),t(k4,n.edges),t(V4,[]),t(H4,[]),t(R4,null),t(z4,null),t(B4,null),t(Z2,!1)}),Ple=nj(null,(e,t,n)=>{t(Nle,{nodes:n.nodes.map(e=>({...e,selected:!1})),edges:n.edges}),t(N4,new Map),t(A4,null),t(y4,null),t(U2,n.id),t(W2,n.name),t(cle,n.visibility??`private`),t(G2,n.mode??`live`),t(K2,n.isOwner!==!1),t(J2,!1),t(Y2,null)}),Fle=nj(null,(e,t,n)=>{if(!L4(e))return;let r=e(O4),i=B2(n.catalog,r,n.integrations);i!==r&&(t(O4,i),G4(e,t))}),Ile=nj(null,(e,t)=>{L4(e)&&W4(e,t)}),Lle=nj(null,(e,t)=>{L4(e)&&(t(O4,e(O4).map(e=>({...e,selected:!1}))),t(k4,e(k4).map(e=>({...e,selected:!1}))),t(R4,null),t(z4,null))}),Rle=nj(null,(e,t,n)=>{L4(e)&&(t(O4,e(O4).map(e=>({...e,selected:e.id===n}))),t(R4,n),t(z4,null))}),zle=nj(null,(e,t,n)=>{if(!L4(e))return;let r=e(O4),i=n.filter(e=>e.type!==`remove`||r.find(t=>t.id===e.id)?.data.type!==`lifecycle`),a=i.some(e=>e.type===`remove`),o=i.some(e=>e.type===`position`&&e.dragging===!0),s=i.some(e=>e.type===`position`&&e.dragging===!1);o&&!e(U4)&&(W4(e,t),t(U4,!0)),s&&t(U4,!1);let c=pD(i,r);t(O4,c);let l=c.find(e=>e.selected);if(l){t(R4,l.id),t(z4,null);let n=e(B4);n&&n!==l.id&&t(B4,null)}else if(e(R4)){let n=e(R4);c.find(e=>e.id===n)||t(R4,null),t(B4,null)}a?G4(e,t,{immediate:!0}):s&&G4(e,t)}),Ble=nj(null,(e,t,n)=>{if(!L4(e))return;let r=n.some(e=>e.type===`remove`),i=mD(n,e(k4));t(k4,i);let a=i.find(e=>e.selected);if(a)t(z4,a.id),t(R4,null);else if(e(z4)){let n=e(z4);i.find(e=>e.id===n)||t(z4,null)}r&&G4(e,t,{immediate:!0})}),K4=nj(null,(e,t,n)=>{L4(e)&&(W4(e,t),t(O4,[...e(O4).map(e=>({...e,selected:!1})),{...n,selected:!0}]),t(R4,n.id),n.data.type===`action`&&!n.data.config?.actionType&&t(B4,n.id),G4(e,t,{immediate:!0}))}),Vle=nj(null,(e,t,n)=>{L4(e)&&(W4(e,t),t(k4,[...e(k4),n]),G4(e,t,{immediate:!0}))}),Hle=nj(null,(e,t,n)=>{L4(e)&&(W4(e,t),t(O4,n),G4(e,t,{immediate:!0}))}),q4=nj(null,(e,t,{id:n,data:r})=>{if(!L4(e))return;let i=e(O4);W4(e,t);let a=i.find(e=>e.id===n)?.data.label,o=r.label,s=o!==void 0&&a!==o;t(O4,i.map(e=>{if(e.id===n)return{...e,data:{...e.data,...r}};if(s&&a){let t=J4(e.data.config||{},n,a,o);if(t!==e.data.config)return{...e,data:{...e.data,config:t}}}return e})),G4(e,t)});function J4(e,t,n,r){let i=!1,a={};for(let[o,s]of Object.entries(e))if(typeof s==`string`)a[o]=C4(s).map(e=>{if(e.kind===`literal`)return e.text;let{token:a}=e;return a.nodeId!==t||a.nodeLabel!==n?a.raw:(i=!0,w4({nodeId:t,nodeLabel:r,fieldPath:a.fieldPath}))}).join(``);else if(typeof s==`object`&&s&&!Array.isArray(s)){let e={...s},c=J4(e,t,n,r);c!==e&&(i=!0),a[o]=c}else a[o]=s;return i?a:e}var Y4=nj(null,(e,t,n)=>{if(!L4(e))return;let r=e(O4);r.find(e=>e.id===n)?.data.type!==`lifecycle`&&(W4(e,t),t(O4,r.filter(e=>e.id!==n)),t(k4,e(k4).filter(e=>e.source!==n&&e.target!==n)),e(R4)===n&&t(R4,null),G4(e,t,{immediate:!0}))}),X4=nj(null,(e,t,n)=>{if(!L4(e))return;let r=e(k4),i=r.filter(e=>e.id!==n);i.length!==r.length&&(W4(e,t),t(k4,i),e(z4)===n&&t(z4,null),G4(e,t,{immediate:!0}))}),Ule=nj(null,(e,t)=>{if(!L4(e))return;let n=e(O4),r=e(k4),i=new Set(n.filter(e=>e.selected&&e.data.type!==`lifecycle`).map(e=>e.id)),a=n.filter(e=>e.data.type===`lifecycle`||!e.selected),o=r.filter(e=>!(e.selected||i.has(e.source)||i.has(e.target)));(a.length!==n.length||o.length!==r.length)&&(W4(e,t),t(O4,a),t(k4,o),t(R4,null),t(z4,null),G4(e,t,{immediate:!0}))}),Z4=nj(null,(e,t)=>{if(!L4(e))return;let n=e(O4),r=n.filter(e=>e.data.type===`lifecycle`);(r.length!==n.length||e(k4).length!==0)&&(W4(e,t),t(O4,r),t(k4,[]),t(R4,null),t(z4,null),G4(e,t,{immediate:!0}))}),Q4=nj(null,(e,t)=>{if(!L4(e))return;let n=e(V4),r=n.at(-1);r&&(t(H4,[...e(H4),{nodes:e(O4),edges:e(k4)}]),t(V4,n.slice(0,-1)),t(O4,r.nodes),t(k4,r.edges),G4(e,t,{immediate:!0}))}),$4=nj(null,(e,t)=>{if(!L4(e))return;let n=e(H4),r=n.at(-1);r&&(t(V4,[...e(V4),{nodes:e(O4),edges:e(k4)}]),t(H4,n.slice(0,-1)),t(O4,r.nodes),t(k4,r.edges),G4(e,t,{immediate:!0}))}),Wle=nj(e=>e(V4).length>0),Gle=nj(e=>e(H4).length>0),Kle=nj(null,(e,t)=>{t(A4,null),t(N4,new Map)}),qle=nj(null,(e,t)=>{t(N4,new Map)}),e3=nj(null,(e,t,n)=>{if(n.length===0)return;let r=e(N4),i=new Map(r),a=!1;for(let{nodeId:e,status:t}of n)r.get(e)!==t&&(i.set(e,t),a=!0);a&&t(N4,i)}),Jle={database:Xee};function t3(e){let t=(0,Z.c)(14),{integration:n,className:r}=e,i=r===void 0?`h-3 w-3`:r,a=jy(),o=Jle[n];if(o){let e;t[0]===i?e=t[1]:(e=Kv(`text-foreground`,i),t[0]=i,t[1]=e);let n;return t[2]!==o||t[3]!==e?(n=(0,X.jsx)(o,{className:e}),t[2]=o,t[3]=e,t[4]=n):n=t[4],n}let s=a[n];if(s){let e=s.icon,n;t[5]===i?n=t[6]:(n=Kv(`text-foreground`,i),t[5]=i,t[6]=n);let r;return t[7]!==e||t[8]!==n?(r=(0,X.jsx)(e,{className:n}),t[7]=e,t[8]=n,t[9]=r):r=t[9],r}let c;t[10]===i?c=t[11]:(c=Kv(`text-foreground`,i),t[10]=i,t[11]=c);let l;return t[12]===c?l=t[13]:(l=(0,X.jsx)(cy,{className:c}),t[12]=c,t[13]=l),l}function n3(e){return Object.keys(Q$(e,e=>!e||e.length===0)).length>0}function r3(e){e.status===`success`?Fy.success(e.message||`Connection successful`):Fy.error(e.message||`Connection failed`)}function Yle(e){return e.integrations.toSorted((e,t)=>e.label.localeCompare(t.label))}var Xle=(e,t)=>Gy(e,t)?.label??t;function Zle(e){let t=(0,Z.c)(36),{overlayId:n,onSuccess:r}=e,i=ky(),{push:a}=cZ(),[o,s]=(0,Y.useState)(``),c=tZ(),l,u,d,f,p,m,h,g;if(t[0]!==i||t[1]!==c||t[2]!==r||t[3]!==n||t[4]!==a||t[5]!==o){let e=o.trim().toLowerCase(),_=Yle(i).filter(t=>!e||t.label.toLowerCase().includes(e)),v;t[14]!==r||t[15]!==a?(v=e=>{a(i3,{type:e,onSuccess:r})},t[14]=r,t[15]=a,t[16]=v):v=t[16];let y=v;l=KZ,m=n,h=`Add Connection`,t[17]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,X.jsx)(`p`,{className:`-mt-2 mb-4 text-muted-foreground text-sm`,children:`Select a service to connect`}),t[17]=g):g=t[17],f=`space-y-3`;let b;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,X.jsx)(by,{className:`absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),t[18]=b):b=t[18];let x=!c,S;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>s(e.target.value),t[19]=S):S=t[19],t[20]!==o||t[21]!==x?(p=(0,X.jsxs)(`div`,{className:`relative`,children:[b,(0,X.jsx)(JZ,{autoFocus:x,className:`pl-9`,onChange:S,placeholder:`Search services...`,value:o})]}),t[20]=o,t[21]=x,t[22]=p):p=t[22],u=`max-h-[300px] space-y-1 overflow-y-auto`,d=_.length===0?(0,X.jsx)(`p`,{className:`py-4 text-center text-muted-foreground text-sm`,children:`No services found`}):_.map(e=>(0,X.jsxs)(`button`,{className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors hover:bg-muted/50`,onClick:()=>y(e.type),type:`button`,children:[(0,X.jsx)(t3,{className:`size-5 shrink-0`,integration:e.type}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:e.label}),e.description&&(0,X.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[` `,`- `,e.description]})]})]},e.type)),t[0]=i,t[1]=c,t[2]=r,t[3]=n,t[4]=a,t[5]=o,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g}else l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13];let _;t[23]!==u||t[24]!==d?(_=(0,X.jsx)(`div`,{className:u,children:d}),t[23]=u,t[24]=d,t[25]=_):_=t[25];let v;t[26]!==f||t[27]!==p||t[28]!==_?(v=(0,X.jsxs)(`div`,{className:f,children:[p,_]}),t[26]=f,t[27]=p,t[28]=_,t[29]=v):v=t[29];let y;return t[30]!==l||t[31]!==m||t[32]!==h||t[33]!==g||t[34]!==v?(y=(0,X.jsxs)(l,{overlayId:m,title:h,children:[g,v]}),t[30]=l,t[31]=m,t[32]=h,t[33]=g,t[34]=v,t[35]=y):y=t[35],y}function Qle(e){let t=(0,Z.c)(18),{fieldId:n,label:r,configKey:i,placeholder:a,helpText:o,helpLink:s,value:c,onChange:l}=e,u;t[0]!==n||t[1]!==r?(u=(0,X.jsx)(YZ,{htmlFor:n,children:r}),t[0]=n,t[1]=r,t[2]=u):u=t[2];let d;t[3]!==i||t[4]!==l?(d=e=>l(i,e.target.value),t[3]=i,t[4]=l,t[5]=d):d=t[5];let f;t[6]!==n||t[7]!==a||t[8]!==d||t[9]!==c?(f=(0,X.jsx)(JZ,{className:`flex-1`,id:n,onChange:d,placeholder:a,type:`password`,value:c}),t[6]=n,t[7]=a,t[8]=d,t[9]=c,t[10]=f):f=t[10];let p;t[11]!==s||t[12]!==o?(p=(o||s)&&(0,X.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[o,s&&(0,X.jsx)(`a`,{className:`underline hover:text-foreground`,href:s.url,rel:`noopener noreferrer`,target:`_blank`,children:s.text})]}),t[11]=s,t[12]=o,t[13]=p):p=t[13];let m;return t[14]!==u||t[15]!==f||t[16]!==p?(m=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[u,f,p]}),t[14]=u,t[15]=f,t[16]=p,t[17]=m):m=t[17],m}function i3(e){let t=(0,Z.c)(62),{overlayId:n,type:r,onSuccess:i}=e,a=ky(),{push:o,closeAll:s}=cZ(),c=Fe(),[l,u]=(0,Y.useState)(``),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d={},t[0]=d):d=t[0];let[f,p]=(0,Y.useState)(d),m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=(e,t)=>{p(n=>({...n,[e]:t}))},t[1]=m):m=t[1];let h=m,g;t[2]!==s||t[3]!==i||t[4]!==c?(g=O2.integration.create.mutationOptions({onSuccess:async e=>{Fy.success(`Connection created`),await N2(c),i?.(e.id),s()},meta:{errorMessage:`Failed to save connection`}}),t[2]=s,t[3]=i,t[4]=c,t[5]=g):g=t[5];let _=Ze(g),v;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(v=O2.integration.testCredentials.mutationOptions({meta:{errorShownByCaller:!0}}),t[6]=v):v=t[6];let y=Ze(v),b;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=O2.integration.testCredentials.mutationOptions({onSuccess:r3}),t[7]=b):b=t[7];let x=Ze(b),S;t[8]!==a||t[9]!==r?(S=Gy(a,r),t[8]=a,t[9]=r,t[10]=S):S=t[10];let C=S,w=C?.credentialFields,T=C?.hasTest===!0,E=_.isPending||y.isPending,D;t[11]!==f||t[12]!==_||t[13]!==l||t[14]!==r?(D=()=>{_.mutate({name:l.trim(),type:r,config:f})},t[11]=f,t[12]=_,t[13]=l,t[14]=r,t[15]=D):D=t[15];let O=D,k;t[16]!==o||t[17]!==O?(k=e=>{o(qZ,{title:`Connection Test Failed`,message:`${e}\n\nDo you want to save anyway?`,confirmLabel:`Save Anyway`,onConfirm:O})},t[16]=o,t[17]=O,t[18]=k):k=t[18];let A=k,j;t[19]!==f||t[20]!==T||t[21]!==A||t[22]!==O||t[23]!==y||t[24]!==r?(j=async()=>{if(!n3(f)){Fy.error(`Please enter credentials`);return}if(!T){O();return}try{let e=await y.mutateAsync({type:r,config:f});if(e.status===`error`){A(`The test failed: ${e.message}`);return}}catch(e){let t=e;A(t instanceof Error?t.message:`Failed to test connection`);return}O()},t[19]=f,t[20]=T,t[21]=A,t[22]=O,t[23]=y,t[24]=r,t[25]=j):j=t[25];let M=j,N;t[26]!==f||t[27]!==x||t[28]!==r?(N=()=>{if(!n3(f)){Fy.error(`Please enter credentials first`);return}x.mutate({type:r,config:f})},t[26]=f,t[27]=x,t[28]=r,t[29]=N):N=t[29];let P=N,F;t[30]!==f||t[31]!==w?(F=()=>w?Object.entries(w).map(e=>{let[t,n]=e;return n.type===`password`?(0,X.jsx)(Qle,{configKey:t,fieldId:t,helpLink:n.helpLink,helpText:n.helpText,label:n.label,onChange:h,placeholder:n.placeholder,value:f[t]||``},t):(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(YZ,{htmlFor:t,children:n.label}),(0,X.jsx)(JZ,{id:t,onChange:e=>h(t,e.target.value),placeholder:n.placeholder,type:n.type,value:f[t]||``}),(n.helpText||n.helpLink)&&(0,X.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[n.helpText,n.helpLink&&(0,X.jsx)(`a`,{className:`underline hover:text-foreground`,href:n.helpLink.url,rel:`noopener noreferrer`,target:`_blank`,children:n.helpLink.text})]})]},t)}):null,t[30]=f,t[31]=w,t[32]=F):F=t[32];let I=F,L;t[33]!==P||t[34]!==T||t[35]!==E||t[36]!==x?(L=T?[{label:`Test`,variant:`outline`,onClick:P,loading:x.isPending,disabled:E}]:[],t[33]=P,t[34]=T,t[35]=E,t[36]=x,t[37]=L):L=t[37];let R;t[38]!==M||t[39]!==E?(R={label:`Create`,onClick:M,loading:E},t[38]=M,t[39]=E,t[40]=R):R=t[40];let z;t[41]!==L||t[42]!==R?(z=[...L,R],t[41]=L,t[42]=R,t[43]=z):z=t[43];let B;t[44]!==a||t[45]!==r?(B=Xle(a,r),t[44]=a,t[45]=r,t[46]=B):B=t[46];let V=`Add ${B}`,H;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,X.jsx)(`p`,{className:`-mt-2 mb-4 text-muted-foreground text-sm`,children:`Enter your credentials`}),t[47]=H):H=t[47];let U;t[48]===I?U=t[49]:(U=I(),t[48]=I,t[49]=U);let W;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,X.jsx)(YZ,{htmlFor:`name`,children:`Label (Optional)`}),t[50]=W):W=t[50];let G;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(G=e=>u(e.target.value),t[51]=G):G=t[51];let K;t[52]===l?K=t[53]:(K=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[W,(0,X.jsx)(JZ,{id:`name`,onChange:G,placeholder:`e.g. Production, Personal, Work`,value:l})]}),t[52]=l,t[53]=K);let q;t[54]!==U||t[55]!==K?(q=(0,X.jsxs)(`div`,{className:`space-y-4`,children:[U,K]}),t[54]=U,t[55]=K,t[56]=q):q=t[56];let J;return t[57]!==n||t[58]!==z||t[59]!==V||t[60]!==q?(J=(0,X.jsxs)(KZ,{actions:z,overlayId:n,title:V,children:[H,q]}),t[57]=n,t[58]=z,t[59]=V,t[60]=q,t[61]=J):J=t[61],J}var $le=(e,t)=>e?.label??t;function eue(e){let t=(0,Z.c)(35),{fieldId:n,label:r,configKey:i,placeholder:a,helpText:o,helpLink:s,value:c,onChange:l}=e,[u,d]=(0,Y.useState)(!1),f=tZ(),p=c.length>0;if(!(u||p)){let e;t[0]!==n||t[1]!==r?(e=(0,X.jsx)(YZ,{htmlFor:n,children:r}),t[0]=n,t[1]=r,t[2]=e):e=t[2];let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsxs)(`div`,{className:`flex h-9 flex-1 items-center gap-2 rounded-md border bg-muted/30 px-3`,children:[(0,X.jsx)(iy,{className:`size-4 text-success`}),(0,X.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:`Configured`})]}),t[3]=i):i=t[3];let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>d(!0),t[4]=a):a=t[4];let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i,(0,X.jsxs)(Jv,{onClick:a,type:`button`,variant:`outline`,children:[(0,X.jsx)(_y,{className:`mr-1.5 size-3`}),`Change`]})]}),t[5]=o):o=t[5];let s;return t[6]===e?s=t[7]:(s=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[e,o]}),t[6]=e,t[7]=s),s}let m;t[8]!==n||t[9]!==r?(m=(0,X.jsx)(YZ,{htmlFor:n,children:r}),t[8]=n,t[9]=r,t[10]=m):m=t[10];let h=u&&!f,g;t[11]!==i||t[12]!==l?(g=e=>l(i,e.target.value),t[11]=i,t[12]=l,t[13]=g):g=t[13];let _;t[14]!==n||t[15]!==a||t[16]!==h||t[17]!==g||t[18]!==c?(_=(0,X.jsx)(JZ,{autoFocus:h,className:`flex-1`,id:n,onChange:g,placeholder:a,type:`password`,value:c}),t[14]=n,t[15]=a,t[16]=h,t[17]=g,t[18]=c,t[19]=_):_=t[19];let v;t[20]!==i||t[21]!==p||t[22]!==u||t[23]!==l?(v=(u||p)&&(0,X.jsx)(Jv,{onClick:()=>{l(i,``),d(!1)},size:`icon`,type:`button`,variant:`ghost`,children:(0,X.jsx)(Ty,{className:`size-4`})}),t[20]=i,t[21]=p,t[22]=u,t[23]=l,t[24]=v):v=t[24];let y;t[25]!==_||t[26]!==v?(y=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,v]}),t[25]=_,t[26]=v,t[27]=y):y=t[27];let b;t[28]!==s||t[29]!==o?(b=(o||s)&&(0,X.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[o,s&&(0,X.jsx)(`a`,{className:`underline hover:text-foreground`,href:s.url,rel:`noopener noreferrer`,target:`_blank`,children:s.text})]}),t[28]=s,t[29]=o,t[30]=b):b=t[30];let x;return t[31]!==m||t[32]!==y||t[33]!==b?(x=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[m,y,b]}),t[31]=m,t[32]=y,t[33]=b,t[34]=x):x=t[34],x}function a3(e){let t=(0,Z.c)(83),{overlayId:n,integration:r,onSuccess:i,onDelete:a}=e,{push:o,closeAll:s}=cZ(),c=Fe(),[l,u]=(0,Y.useState)(r.name),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d={},t[0]=d):d=t[0];let[f,p]=(0,Y.useState)(d),m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=(e,t)=>{p(n=>({...n,[e]:t}))},t[1]=m):m=t[1];let h=m,g;t[2]!==s||t[3]!==i||t[4]!==c?(g=O2.integration.update.mutationOptions({onSuccess:async()=>{Fy.success(`Connection updated`),await N2(c),i?.(),s()},meta:{errorMessage:`Failed to update connection`}}),t[2]=s,t[3]=i,t[4]=c,t[5]=g):g=t[5];let _=Ze(g),v;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(v=O2.integration.testCredentials.mutationOptions({meta:{errorShownByCaller:!0}}),t[6]=v):v=t[6];let y=Ze(v),b;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=O2.integration.testCredentials.mutationOptions({onSuccess:r3}),t[7]=b):b=t[7];let x=Ze(b),S;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=O2.integration.testConnection.mutationOptions({onSuccess:r3}),t[8]=S):S=t[8];let C=Ze(S),w=ky(),T,E,D,O,k;if(t[9]!==w||t[10]!==s||t[11]!==f||t[12]!==r||t[13]!==l||t[14]!==a||t[15]!==n||t[16]!==o||t[17]!==y||t[18]!==x||t[19]!==C||t[20]!==_){let e=Gy(w,r.type),i=e?.credentialFields,c=e?.hasTest===!0,u=_.isPending||y.isPending,d=x.isPending||C.isPending,p;t[26]!==f||t[27]!==r.id||t[28]!==l||t[29]!==_?(p=()=>{_.mutate({integrationId:r.id,name:l.trim(),config:n3(f)?f:void 0})},t[26]=f,t[27]=r.id,t[28]=l,t[29]=_,t[30]=p):p=t[30];let m=p,g;t[31]!==o||t[32]!==m?(g=e=>{o(qZ,{title:`Connection Test Failed`,message:`${e}\n\nDo you want to save anyway?`,confirmLabel:`Save Anyway`,onConfirm:m})},t[31]=o,t[32]=m,t[33]=g):g=t[33];let v=g,b;t[34]!==f||t[35]!==c||t[36]!==r.type||t[37]!==v||t[38]!==m||t[39]!==y?(b=async()=>{if(!(n3(f)&&c)){m();return}try{let e=await y.mutateAsync({type:r.type,config:f});if(e.status===`error`){v(`The test failed: ${e.message}`);return}}catch(e){let t=e;v(t instanceof Error?t.message:`Failed to test connection`);return}m()},t[34]=f,t[35]=c,t[36]=r.type,t[37]=v,t[38]=m,t[39]=y,t[40]=b):b=t[40];let S=b,A;t[41]!==f||t[42]!==r.id||t[43]!==r.type||t[44]!==x||t[45]!==C?(A=()=>{if(n3(f)){x.mutate({type:r.type,config:f});return}C.mutate({integrationId:r.id})},t[41]=f,t[42]=r.id,t[43]=r.type,t[44]=x,t[45]=C,t[46]=A):A=t[46];let j=A,M;t[47]!==s||t[48]!==r||t[49]!==a||t[50]!==o?(M=()=>{o(o3,{integration:r,onDismiss:s,onSuccess:a})},t[47]=s,t[48]=r,t[49]=a,t[50]=o,t[51]=M):M=t[51];let N=M;E=()=>i?Object.entries(i).map(e=>{let[t,n]=e;return n.type===`password`?(0,X.jsx)(eue,{configKey:t,fieldId:t,helpLink:n.helpLink,helpText:n.helpText,label:n.label,onChange:h,placeholder:n.placeholder,value:f[t]||``},t):(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(YZ,{htmlFor:t,children:n.label}),(0,X.jsx)(JZ,{id:t,onChange:e=>h(t,e.target.value),placeholder:n.placeholder,type:n.type,value:f[t]||``}),(n.helpText||n.helpLink)&&(0,X.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[n.helpText,n.helpLink&&(0,X.jsx)(`a`,{className:`underline hover:text-foreground`,href:n.helpLink.url,rel:`noopener noreferrer`,target:`_blank`,children:n.helpLink.text})]})]},t)}):null,T=KZ;let P=u||d,F;t[52]!==N||t[53]!==P?(F={label:`Delete`,variant:`ghost`,onClick:N,disabled:P},t[52]=N,t[53]=P,t[54]=F):F=t[54];let I;t[55]!==j||t[56]!==c||t[57]!==u||t[58]!==d?(I=c?[{label:`Test`,variant:`outline`,onClick:j,loading:d,disabled:u}]:[],t[55]=j,t[56]=c,t[57]=u,t[58]=d,t[59]=I):I=t[59];let L;t[60]!==S||t[61]!==u?(L={label:`Update`,onClick:S,loading:u},t[60]=S,t[61]=u,t[62]=L):L=t[62],t[63]!==F||t[64]!==I||t[65]!==L?(O=[F,...I,L],t[63]=F,t[64]=I,t[65]=L,t[66]=O):O=t[66],k=n,D=$le(e,r.type),t[9]=w,t[10]=s,t[11]=f,t[12]=r,t[13]=l,t[14]=a,t[15]=n,t[16]=o,t[17]=y,t[18]=x,t[19]=C,t[20]=_,t[21]=T,t[22]=E,t[23]=D,t[24]=O,t[25]=k}else T=t[21],E=t[22],D=t[23],O=t[24],k=t[25];let A=`Edit ${D}`,j;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,X.jsx)(`p`,{className:`-mt-2 mb-4 text-muted-foreground text-sm`,children:`Update your connection credentials`}),t[67]=j):j=t[67];let M;t[68]===E?M=t[69]:(M=E(),t[68]=E,t[69]=M);let N;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,X.jsx)(YZ,{htmlFor:`name`,children:`Label (Optional)`}),t[70]=N):N=t[70];let P;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>u(e.target.value),t[71]=P):P=t[71];let F;t[72]===l?F=t[73]:(F=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[N,(0,X.jsx)(JZ,{id:`name`,onChange:P,placeholder:`e.g. Production, Personal, Work`,value:l})]}),t[72]=l,t[73]=F);let I;t[74]!==M||t[75]!==F?(I=(0,X.jsxs)(`div`,{className:`space-y-4`,children:[M,F]}),t[74]=M,t[75]=F,t[76]=I):I=t[76];let L;return t[77]!==T||t[78]!==A||t[79]!==I||t[80]!==O||t[81]!==k?(L=(0,X.jsxs)(T,{actions:O,overlayId:k,title:A,children:[j,I]}),t[77]=T,t[78]=A,t[79]=I,t[80]=O,t[81]=k,t[82]=L):L=t[82],L}function o3(e){let t=(0,Z.c)(19),{overlayId:n,integration:r,onDismiss:i,onSuccess:a}=e,{pop:o}=cZ(),s=i??o,c=Fe(),l;t[0]!==s||t[1]!==a||t[2]!==c?(l=O2.integration.delete.mutationOptions({onSuccess:async()=>{Fy.success(`Connection deleted`),s(),await N2(c),a?.()},meta:{errorMessage:`Failed to delete connection`}}),t[0]=s,t[1]=a,t[2]=c,t[3]=l):l=t[3];let u=Ze(l),d;t[4]===o?d=t[5]:(d={label:`Cancel`,variant:`outline`,onClick:o},t[4]=o,t[5]=d);let f;t[6]!==u||t[7]!==r?(f=()=>u.mutate({integrationId:r.id}),t[6]=u,t[7]=r,t[8]=f):f=t[8];let p;t[9]!==u.isPending||t[10]!==f?(p={label:`Delete`,variant:`destructive`,onClick:f,loading:u.isPending},t[9]=u.isPending,t[10]=f,t[11]=p):p=t[11];let m;t[12]!==d||t[13]!==p?(m=[d,p],t[12]=d,t[13]=p,t[14]=m):m=t[14];let h;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,X.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Are you sure you want to delete this connection? Workflows using it will fail until a new one is configured.`}),t[15]=h):h=t[15];let g;return t[16]!==n||t[17]!==m?(g=(0,X.jsx)(KZ,{actions:m,overlayId:n,title:`Delete Connection`,children:h}),t[16]=n,t[17]=m,t[18]=g):g=t[18],g}function s3(){let e=(0,Z.c)(4),t=Fe(),n=ky(),r=vj(Fle),i;return e[0]!==n||e[1]!==t||e[2]!==r?(i=async()=>{r({integrations:await t.fetchQuery(k2()),catalog:n})},e[0]=n,e[1]=t,e[2]=r,e[3]=i):i=e[3],i}function c3(e){let t=(0,Z.c)(23),{displayName:n,selected:r,className:i,disabled:a,onSelect:o,onEdit:s}=e,c=a&&`cursor-not-allowed opacity-50`,l;t[0]!==i||t[1]!==c?(l=Kv(i,c),t[0]=i,t[1]=c,t[2]=l):l=t[2];let u;t[3]===r?u=t[4]:(u=r?(0,X.jsx)(iy,{className:`size-4 shrink-0 text-success`}):(0,X.jsx)(ly,{className:`size-4 shrink-0 text-muted-foreground`}),t[3]=r,t[4]=u);let d;t[5]===n?d=t[6]:(d=(0,X.jsx)(`span`,{className:`truncate`,children:n}),t[5]=n,t[6]=d);let f;t[7]!==a||t[8]!==o||t[9]!==r||t[10]!==u||t[11]!==d?(f=(0,X.jsxs)(`button`,{"aria-checked":r,className:`flex min-w-0 flex-1 items-center gap-2 text-left`,disabled:a,onClick:o,role:`radio`,type:`button`,children:[u,d]}),t[7]=a,t[8]=o,t[9]=r,t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;t[13]===s?p=t[14]:(p=e=>{e.stopPropagation(),s()},t[13]=s,t[14]=p);let m;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,X.jsx)(_y,{className:`size-3`}),t[15]=m):m=t[15];let h;t[16]!==a||t[17]!==p?(h=(0,X.jsx)(Jv,{className:`size-6 shrink-0`,disabled:a,onClick:p,size:`icon`,variant:`ghost`,children:m}),t[16]=a,t[17]=p,t[18]=h):h=t[18];let g;return t[19]!==l||t[20]!==f||t[21]!==h?(g=(0,X.jsxs)(`div`,{className:l,children:[f,h]}),t[19]=l,t[20]=f,t[21]=h,t[22]=g):g=t[22],g}function tue(e){let t=(0,Z.c)(68),{integrationType:n,value:r,onChange:i,onOpenSettings:a,disabled:o,onAddConnection:s}=e,c=ky(),{push:l}=cZ(),u=s3(),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=k2(),t[0]=d):d=t[0];let{data:f,isPending:p}=Xe(d),m;t[1]===f?m=t[2]:(m=f===void 0?[]:f,t[1]=f,t[2]=m);let h=m,g;if(t[3]!==h||t[4]!==n){let e;t[6]===n?e=t[7]:(e=e=>e.type===n,t[6]=n,t[7]=e),g=h.filter(e),t[3]=h,t[4]=n,t[5]=g}else g=t[5];let _=g,v;t[8]!==i||t[9]!==u?(v=async e=>{await u(),i(e)},t[8]=i,t[9]=u,t[10]=v):v=t[10];let y=v,b;t[11]!==y||t[12]!==n||t[13]!==l?(b=()=>{l(i3,{type:n,onSuccess:y})},t[11]=y,t[12]=n,t[13]=l,t[14]=b):b=t[14];let x=b,S;t[15]!==l||t[16]!==u?(S=e=>{l(a3,{integration:e,onSuccess:u,onDelete:u})},t[15]=l,t[16]=u,t[17]=S):S=t[17];let C=S,w;t[18]!==s||t[19]!==x?(w=()=>{s?s():x()},t[18]=s,t[19]=x,t[20]=w):w=t[20];let T=w;if(p){let e;return t[21]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`div`,{className:`flex flex-col gap-1`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md px-2 py-1.5`,children:[(0,X.jsx)(`div`,{className:`size-4 shrink-0 animate-pulse rounded-full bg-muted`}),(0,X.jsx)(`div`,{className:`h-4 flex-1 animate-pulse rounded bg-muted`}),(0,X.jsx)(`div`,{className:`size-6 shrink-0 animate-pulse rounded bg-muted`})]})}),t[21]=e):e=t[21],e}let E;t[22]!==c||t[23]!==n?(E=Gy(c,n),t[22]=c,t[23]=n,t[24]=E):E=t[24];let D=E?.label||n,O;t[25]===D?O=t[26]:(O=e=>e.name||`${D} API Key`,t[25]=D,t[26]=O);let k=O;if(_.length===0){let e;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(wy,{className:`size-4`}),t[27]=e):e=t[27];let n;t[28]===D?n=t[29]:(n=(0,X.jsxs)(`span`,{className:`flex-1 text-left`,children:[`Add `,D,` connection`]}),t[28]=D,t[29]=n);let r;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(yy,{className:`size-4`}),t[30]=r):r=t[30];let i;return t[31]!==o||t[32]!==T||t[33]!==n?(i=(0,X.jsxs)(Jv,{className:`w-full justify-start gap-2 border-warning/50 bg-warning/10 text-warning hover:bg-warning/20`,disabled:o,onClick:T,variant:`outline`,children:[e,n,r]}),t[31]=o,t[32]=T,t[33]=n,t[34]=i):i=t[34],i}if(_.length===1){let e=_[0],n;t[35]!==e||t[36]!==k?(n=k(e),t[35]=e,t[36]=k,t[37]=n):n=t[37];let a;t[38]!==e||t[39]!==C?(a=()=>C(e),t[38]=e,t[39]=C,t[40]=a):a=t[40];let s;t[41]!==e.id||t[42]!==i?(s=()=>i(e.id),t[41]=e.id,t[42]=i,t[43]=s):s=t[43];let c=r===e.id,l;return t[44]!==o||t[45]!==e||t[46]!==n||t[47]!==a||t[48]!==s||t[49]!==c?(l=(0,X.jsx)(`div`,{role:`radiogroup`,children:(0,X.jsx)(c3,{className:`flex h-9 w-full items-center gap-2 rounded-md border px-3 text-sm`,disabled:o,displayName:n,integration:e,onEdit:a,onSelect:s,selected:c})}),t[44]=o,t[45]=e,t[46]=n,t[47]=a,t[48]=s,t[49]=c,t[50]=l):l=t[50],l}let A,j,M;if(t[51]!==o||t[52]!==_||t[53]!==k||t[54]!==i||t[55]!==C||t[56]!==r){let[e,n]=qa(_,nue);A=`flex flex-col gap-1`,j=`radiogroup`,M=[...e,...n].map(e=>{let t=r===e.id;return(0,X.jsx)(c3,{className:Kv(`flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors`,t?`bg-primary/10 text-primary`:`hover:bg-muted/50`),disabled:o,displayName:k(e),integration:e,onEdit:()=>C(e),onSelect:()=>i(e.id),selected:t},e.id)}),t[51]=o,t[52]=_,t[53]=k,t[54]=i,t[55]=C,t[56]=r,t[57]=A,t[58]=j,t[59]=M}else A=t[57],j=t[58],M=t[59];let N;t[60]!==o||t[61]!==a?(N=a&&(0,X.jsxs)(`button`,{className:`flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-muted-foreground text-sm transition-colors hover:bg-muted/50 hover:text-foreground`,disabled:o,onClick:a,type:`button`,children:[(0,X.jsx)(Sy,{className:`size-4 shrink-0`}),(0,X.jsx)(`span`,{children:`Manage all connections`})]}),t[60]=o,t[61]=a,t[62]=N):N=t[62];let P;return t[63]!==A||t[64]!==j||t[65]!==M||t[66]!==N?(P=(0,X.jsxs)(`div`,{className:A,role:j,children:[M,N]}),t[63]=A,t[64]=j,t[65]=M,t[66]=N,t[67]=P):P=t[67],P}function nue(e){return!!e.isManaged}function l3(e){let t=Y.useRef(!0);t.current&&(t.current=!1,e())}function rue(e){let[t,n]=Y.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function u3(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function d3({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=Y.useRef(e!==void 0),[a,o]=Y.useState(t);return[i?e:a,Y.useCallback(e=>{i||o(e)},[])]}var f3=Y.createContext(null);function p3(){let e=Y.useContext(f3);if(e===null)throw Error(Jg(60));return e}var m3={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},h3={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},iue={disabled:!1,...h3},g3={valid(e){return e===null?null:e?{"data-valid":``}:{"data-invalid":``}}},_3={invalid:void 0,name:void 0,validityData:{state:m3,errors:[],error:``,value:``,initialValue:null},setValidityData:o_,disabled:void 0,setTouched:o_,setDirty:o_,setFilled:o_,setFocused:o_,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:iue,registerFieldControl:o_,validation:{getValidationProps:(e,t=c_)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:o_,getInputControl:()=>null,commit:async()=>{},change:o_}},v3=Y.createContext(_3);function y3(e=!0){let t=Y.useContext(v3);if(t.setValidityData===o_&&!e)throw Error(Jg(28));return t}function b3(e,t,n,r,i=!0,a){let{registerFieldControl:o}=y3(),s=Ag(()=>Symbol());Q(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),Q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var aue=Y.createContext({controlId:void 0,registerControlId:o_,labelId:void 0,setLabelId:o_,messageIds:[],setMessageIds:o_,getDescriptionProps:e=>e});function x3(){return Y.useContext(aue)}function S3(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=x3(),o=aW(t),s=n?i:void 0,c=Ag(()=>Symbol()),l=Y.useRef(!1),u=Y.useRef(t!=null),d=Ng(()=>{!l.current||a===o_||(l.current=!1,a(c.current,void 0))});return Q(()=>{if(a===o_)return;let e;if(n){let n=r?.current;e=cg(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),Y.useEffect(()=>d,[d]),i??o}var C3=(e,t)=>Object.is(e,t);function w3(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function oue(e,t,n){return!e||e.length===0?!1:e.some(e=>e!==void 0&&w3(t,e,n))}function T3(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e!==void 0&&w3(e,t,n))}function E3(e,t,n,r){let i=T3(e,r&&Array.isArray(t)?t[t.length-1]:t,n);return i===-1?null:i}function D3(e,t,n){return e.filter(e=>!w3(t,e,n))}function O3(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function k3(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function A3(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(k3(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function j3(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return O3(e)}function M3(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?O3(e.value):O3(e)}function N3(e,t,n){function r(){return j3(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){let n=t,i=k3(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function sue(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,X.jsx)(Y.Fragment,{children:N3(r,t,n)},i)),e),[])}var P3={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:M3(t,r)!==``},hasNullItemLabel:(e,t)=>t?A3(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>w3(t,e,n)):w3(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows},cue=Y.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:o_,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function F3(){return Y.useContext(cue)}function I3(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function L3(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function R3(e,t){return Math.max(0,e-t)}function z3(e,t){if(t<=0)return 0;let n=L3(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function lue(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S=C3,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:T}=F3(),{setDirty:E,setTouched:D,setFocused:O,validityData:k,setFilled:A,name:j,disabled:M,validation:N,validationMode:P}=y3(),F=S3({id:t}),I=M||d,L=j??c,[R,z]=d3({controlled:n,default:y?r??s_:r,name:`Select`,state:`value`}),[B,V]=d3({controlled:a,default:o,name:`Select`,state:`open`}),H=Y.useRef([]),U=Y.useRef([]),W=Y.useRef(null),G=Y.useRef(null),K=Y.useRef(0),q=Y.useRef(null),J=Y.useRef([]),ee=Y.useRef(!1),te=Y.useRef(null),ne=Y.useRef(null),re=Y.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ie=Y.useRef(!1),{mounted:ae,setMounted:oe,transitionStatus:se}=VJ(B),{openMethod:ce,triggerProps:le}=MX(B),ue=Ag(()=>new LJ({id:F,labelId:void 0,modal:m,multiple:y,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,value:R,open:B,mounted:ae,transitionStatus:se,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,de=$(ue,P3.activeIndex),fe=$(ue,P3.selectedIndex),pe=$(ue,P3.triggerElement),me=$(ue,P3.positionerElement),he=rue(ce),ge=ce??he,_e=Y.useMemo(()=>y?``:M3(R,x),[y,R,x]),ve=Y.useMemo(()=>y&&Array.isArray(R)?R.map(e=>M3(e,x)):M3(R,x),[y,R,x]);b3(oG(pe),F,R,Ng(()=>ve),!I,c);let ye=Y.useRef(R),be=y?Array.isArray(R)&&R.length>0:R!=null&&_e!==``;Q(()=>{A(be)},[be,A]),Q(function(){let e=R,t=!1;if(y){let n=Array.isArray(R)?R:[];t=n.length===0,e=n[n.length-1]}let n=t?-1:T3(J.current,e,S),r=n===-1?null:n;r===null&&(ne.current=null),!B&&ue.set(`selectedIndex`,r)},[y,B,R,S,ue]);function xe(e){let t=k.initialValue;return Array.isArray(e)&&Array.isArray(t)?!I3(e,t,(e,t)=>w3(e,t,S)):e!==t}AX(R,()=>{T(L),E(xe(R)),N.change(R)});let Se=Ng((e,t)=>{s?.(e,t),!t.isCanceled&&(V(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(D(!0),O(!1),P===`onBlur`&&N.commit(R)))}),Ce=Ng(()=>{oe(!1),ue.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)});UJ({enabled:!h,open:B,ref:W,onComplete(){B||Ce()}}),Y.useImperativeHandle(h,()=>({unmount:Ce}),[Ce]);let we=Ng((e,t)=>{i?.(e,t),!t.isCanceled&&z(e)}),Te=Ng(e=>{let t=R3(e.scrollHeight,e.clientHeight),n=z3(e.scrollTop,t),r=n>0,i=n<t;ue.set(`scrollUpArrowVisible`,r),ue.set(`scrollDownArrowVisible`,i)}),Ee=mY({open:B,onOpenChange:Se,elements:{reference:pe,floating:me}}),De=mq(Ee,{enabled:!f&&!I,event:`mousedown`}),Oe=bq(Ee),ke=PY(Ee,{enabled:!f&&!I,listRef:H,activeIndex:de,selectedIndex:fe,disabledIndices:s_,onNavigate(e){e===null&&!B||ue.set(`activeIndex`,e)},focusItemOnHover:C}),Ae=FY(Ee,{enabled:!f&&!I&&(B||!y),listRef:U,activeIndex:de,selectedIndex:fe,disabledIndices:e=>u3(H.current[e]),onMatch(e){B?ue.set(`activeIndex`,e):we(J.current[e],QU(MU))},onTyping(e){ee.current=e}}),je=Y.useMemo(()=>Rg(Ae.reference,ke.reference,Oe.reference,De.reference,le),[De.reference,Ae.reference,ke.reference,Oe.reference,le]),Me=Y.useMemo(()=>Rg(WJ,Ae.floating,ke.floating,Oe.floating),[Ae.floating,ke.floating,Oe.floating]),Ne=ke.item??c_;l3(()=>{ue.update({popupProps:Me,triggerProps:je})}),ue.useSyncedValues({id:F,modal:m,multiple:y,value:R,open:B,mounted:ae,transitionStatus:se,popupProps:Me,triggerProps:je,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,openMethod:ge});let Pe=Y.useMemo(()=>({store:ue,floatingContext:Ee,required:p,disabled:I,readOnly:f,multiple:y,highlightItemOnHover:C,setValue:we,setOpen:Se,listRef:H,popupRef:W,scrollHandlerRef:G,handleScrollArrowVisibility:Te,scrollArrowsMountedCountRef:K,itemProps:Ne,valueRef:q,valuesRef:J,labelsRef:U,typingRef:ee,selectionRef:re,firstItemTextRef:te,selectedItemTextRef:ne,validation:N,onOpenChangeComplete:_,alignItemWithTriggerActiveRef:ie,initialValueRef:ye}),[ue,Ee,p,I,f,y,C,we,Se,Ne,N,_,Te]),Fe=t_(g,N.inputRef),Ie=y?void 0:L,Le=Y.useMemo(()=>!y||!Array.isArray(R)||!L?null:R.map(e=>{let t=M3(e,x);return(0,X.jsx)(`input`,{type:`hidden`,form:l,name:L,value:t,disabled:I},t)}),[y,R,l,L,x,I]);return(0,X.jsxs)(f3.Provider,{value:Pe,children:[w,(0,X.jsx)(`input`,{...N.getValidationProps(I,{onFocus(){ue.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||I||f)return;let t=e.currentTarget.value,n=QU(MU,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=J.current.findIndex(t=>M3(t,x).toLowerCase()===e||j3(t,b).toLowerCase()===e);r===-1&&(r=J.current.findIndex((t,n)=>{let r=U.current[n];return r!=null&&r.toLowerCase()===e}));let i=J.current[r];i!=null&&we(i,n)}ue.set(`forceMount`,!0),queueMicrotask(r)}}),id:F&&Ie==null?`${F}-hidden-input`:void 0,form:l,name:Ie,autoComplete:u,value:_e,disabled:I,required:p&&!(y&&be),readOnly:f,ref:Fe,style:L?mG:pG,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Le]})}function B3(e,t){return e??t}var V3=5;function H3(e,t){let n=uue(t);return e.clientX>=n.left-V3&&e.clientX<=n.right+V3&&e.clientY>=n.top-V3&&e.clientY<=n.bottom+V3}function uue(e){let t=e.getBoundingClientRect(),n=ag(e);if(TW)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var due=400,fue={...OU,...g3,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},pue=Y.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:u,validationMode:d,state:f,disabled:p}=y3(),{labelId:m}=x3(),{store:h,setOpen:g,selectionRef:_,validation:v,readOnly:y,required:b,alignItemWithTriggerActiveRef:x,disabled:S}=p3(),C=p||S||a,w=$(h,P3.open),T=$(h,P3.mounted),E=$(h,P3.value),D=$(h,P3.triggerProps),O=$(h,P3.positionerElement),k=$(h,P3.listElement),A=$(h,P3.popupSide),j=$(h,P3.id),M=$(h,P3.labelId),N=$(h,P3.hasSelectedValue),P=T&&O?A:null,F=i??j,I=B3(m,M);S3({id:F});let L=oG(O),R=Y.useRef(null),{getButtonProps:z,buttonRef:B}=$g({disabled:C,native:o}),V=h.useStateSetter(`triggerElement`),H=uW(),U=uW(),W=uW();Y.useEffect(()=>{if(w)return W.start(due,()=>{_.current.allowUnselectedMouseUp=!0,_.current.allowSelectedMouseUp=!0}),()=>{W.clear()};_.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},U.clear()},[w,_,U,W]);let G=Rg(D,{id:F,role:`combobox`,"aria-expanded":w,"aria-haspopup":`listbox`,"aria-controls":w?k?.id??JW(O)?.id:void 0,"aria-labelledby":I,"aria-readonly":y||void 0,"aria-required":b||void 0,tabIndex:C?-1:0,onFocus(e){u(!0),w&&x.current&&g(!1,QU(MU,e.nativeEvent)),H.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){zW(O,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&v.commit(E))},onMouseDown(e){if(w)return;let t=Zg(e.currentTarget);function n(e){if(!R.current)return;let t=e.target;zW(R.current,t)||zW(L.current,t)||H3(e,R.current)||g(!1,QU(qU,e))}U.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,z),K=v.getValidationProps(C,G);K.role=`combobox`;let q={...f,open:w,disabled:C,value:E,readOnly:y,popupSide:P,placeholder:!N};return l_(`button`,e,{ref:[t,R,B,V],state:q,stateAttributesMapping:fue,props:K})}),mue={value:()=>null},hue=Y.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,{store:c,valueRef:l}=p3(),u=$(c,P3.value),d=$(c,P3.items),f=$(c,P3.itemToStringLabel),p=$(c,P3.hasSelectedValue),m=!p&&a!=null&&i==null,h=$(c,P3.hasNullItemLabel,m),g={value:u,placeholder:!p},_=null;return _=typeof i==`function`?i(u):i??(m&&!h?a:Array.isArray(u)?sue(u,d,f):N3(u,d,f)),l_(`span`,e,{state:g,ref:[t,l],props:[{children:_},s],stateAttributesMapping:mue})}),gue=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o}=p3();return l_(`span`,e,{state:{open:$(o,P3.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:DU})}),_ue=Y.forwardRef(function(e,t){let{store:n}=p3(),r=$(n,P3.mounted),i=$(n,P3.forceMount);return r||i?(0,X.jsx)(JK,{ref:t,...e}):null}),U3=Y.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function vue(){return Y.useContext(U3)}function W3(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Ng(i),[,o]=Y.useState(!1),s=Ag(bue).current,c=Ag(yue).current,l=Y.useRef(0),u=Y.useRef(!0),d=Y.useRef([]),f=Y.useRef(null),p=Ng(()=>{u.current||(u.current=!0,o(e=>!e))}),m=Ng((e,t)=>{c.set(e,t),p()}),h=Ng(e=>{c.delete(e),p()}),g=Ng(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!Cue(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&G3(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Sue(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=Ng(()=>{let[e,t]=xue(c),n=g(e);_(t),d.current=e,u.current=!1,s.forEach(e=>e(n)),a(n)});Q(()=>(u.current||g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Q(()=>{u.current&&v()}),Q(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=Ng(e=>(s.add(e),()=>{s.delete(e)})),b=Y.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,X.jsx)(U3.Provider,{value:b,children:t})}function yue(){return new Map}function bue(){return new Set}function xue(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>G3(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Sue(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Cue(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function G3(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var wue=Y.createContext(void 0);function K3(){return Y.useContext(wue)?.direction??`ltr`}var Tue=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=CG(e,t)||{};if(l==null)return{};let f=VG(u),p={x:n,y:r},m=kG(i),h=DG(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=SG(k,j,A),N=!c.arrow&&TG(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Eue=(e,t)=>({...Tue(e),options:[e,t]}),Due={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Oue={sideX:`left`,sideY:`top`},q3=`--available-width`,J3=`--available-height`;function Y3(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function X3(e,t,n){let{rects:r,placement:i}=e;return{side:Y3(t,wG(i),n),align:TG(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Z3(e){return kue(e,hY)}function kue(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=Y.useState(null);!g&&C!==null&&w(null);let T=_.side||`flip`,E=_.align||`flip`,D=_.fallbackAxisSide||`end`,O=v?.crossAxis??!1,k=v?.rootBoundary,A=typeof n==`function`?n:void 0,j=Ng(A),M=A?j:n,N=oG(n),P=oG(g),F=K3()===`rtl`,I=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":F?`left`:`right`,"inline-start":F?`right`:`left`}[i],L=o===`center`?I:`${I}-${o}`,R=l;typeof R==`number`?R={top:R,right:R,bottom:R,left:R}:R&&={top:R.top||0,right:R.right||0,bottom:R.bottom||0,left:R.left||0};let z=+(i===`bottom`),B=+(i===`top`),V=+(i===`right`),H=+(i===`left`),U={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:R},W=Y.useRef(null),G=oG(a),K=oG(s),q=typeof a==`function`?0:a,J=typeof s==`function`?0:s,ee=[];p&&ee.push(p),ee.push(yJ(e=>{let t=X3(e,i,F),n=typeof G.current==`function`?G.current(t):G.current,r=typeof K.current==`function`?K.current(t):K.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[q,J,F,i]));let te=E===`none`&&T!==`shift`,ne=!te&&(u||O||T===`shift`),re=T===`none`?null:SJ({...U,padding:{top:R.top+1+z,right:R.right+1+H,bottom:R.bottom+1+B,left:R.left+1+V},mainAxis:!O&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),ie=te?null:bJ({...U,rootBoundary:k,mainAxis:E!==`none`,crossAxis:ne,limiter:u||O?void 0:xJ(e=>{if(!W.current)return{};let{width:t,height:n}=W.current.getBoundingClientRect(),r=OG(wG(e.placement)),i=r===`y`?t:n,a=r===`y`?R.left+R.right:R.top+R.bottom;return{offset:i/2+a/2}})},[U,u,O,k,R,E]);T===`shift`||E===`shift`||o===`center`?ee.push(ie,re):ee.push(re,ie),ee.push(CJ({...U,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!P.current)return;let i=e.style;i.setProperty(q3,`${t}px`),i.setProperty(J3,`${n}px`);let a=ag(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),Eue(e=>({element:W.current||Zg(e.elements.floating).createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=wG(r),l=OG(c),u=W.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(X3(e,i,F)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,ne&&l===`y`&&b?S:x),{}}},Due,b),Q(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let ae=Y.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:oe,elements:se,x:ce,y:le,middlewareData:ue,update:de,placement:fe,context:pe,isPositioned:me,floatingStyles:he}=t({rootContext:h,open:m?g:void 0,placement:L,middleware:ee,strategy:r,whileElementsMounted:m?void 0:(...e)=>oJ(...e,ae),nodeId:y,externalTree:S}),{sideX:ge,sideY:_e}=ue.adaptiveOrigin||Oue,ve=me?r:`fixed`,ye=Y.useMemo(()=>{let e;return e=me?b?{position:ve,[ge]:ce,[_e]:le}:{...he,position:ve}:{position:ve,top:0,left:0},e[q3]=`100vw`,e[J3]=`100vh`,me||(e.opacity=0),e},[b,ve,ge,ce,_e,le,he,me]),be=Y.useRef(null);Q(()=>{if(!g)return;let e=N.current,t=typeof e==`function`?e():e,n=(Q3(t)?t.current:t)||null;n!==be.current&&(oe.setPositionReference(n),be.current=n)},[g,oe,M,N]),Y.useEffect(()=>{if(!g)return;let e=N.current;typeof e!=`function`&&Q3(e)&&e.current!==be.current&&(oe.setPositionReference(e.current),be.current=e.current)},[g,oe,M,N]),Y.useEffect(()=>{if(m&&g&&se.reference&&se.floating)return oJ(se.reference,se.floating,de,ae)},[m,g,se,de,ae]);let xe=wG(fe),Se=Y3(i,xe,F),Ce=TG(fe)||`center`,we=!!ue.hide?.referenceHidden;Q(()=>{x&&g&&me&&xe!==I&&w(xe)},[x,g,me,xe,I]);let Te=Y.useMemo(()=>({position:`absolute`,top:ue.arrow?.y,left:ue.arrow?.x}),[ue.arrow]),Ee=ue.arrow?.centerOffset!==0;return Y.useMemo(()=>({positionerStyles:ye,arrowStyles:Te,arrowRef:W,arrowUncentered:Ee,side:Se,align:Ce,physicalSide:xe,anchorHidden:we,refs:oe,context:pe,isPositioned:me,update:de}),[ye,Te,W,Ee,Se,Ce,xe,we,oe,pe,me,de])}function Q3(e){return e!=null&&`current`in e}var $3=Y.createContext(void 0);function e6(){let e=Y.useContext($3);if(!e)throw Error(Jg(59));return e}function t6(e,t){e&&Object.assign(e.style,t)}var n6={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`};function r6(e){return e===`starting`?BK:c_}function i6(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),l_(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},r6(r),i],stateAttributesMapping:kU})}var Aue=20;function a6(e,t,n,r){let[i,a]=Y.useState(!1);Q(()=>{if(!e||!t||n==null){a(!1);return}let r=Zg(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Aue)},[e,t,n]),yX(e&&(!t||i),r)}var jue={position:`fixed`},Mue=Y.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=VK,style:_,...v}=e,{store:y,listRef:b,labelsRef:x,alignItemWithTriggerActiveRef:S,selectedItemTextRef:C,valuesRef:w,initialValueRef:T,popupRef:E,setValue:D,floatingContext:O}=p3(),k=$(y,P3.open),A=$(y,P3.mounted),j=$(y,P3.modal),M=$(y,P3.value),N=$(y,P3.openMethod),P=$(y,P3.positionerElement),F=$(y,P3.triggerElement),I=$(y,P3.isItemEqualToValue),L=$(y,P3.transitionStatus),R=Y.useRef(null),z=Y.useRef(null),[B,V]=Y.useState(h),H=A&&B&&N!==`touch`;!A&&B!==h&&V(h),Y.useImperativeHandle(S,()=>H),a6((H||j)&&k,N===`touch`,P,F);let U=Z3({anchor:n,floatingRootContext:O,positionMethod:a,mounted:A,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??H,collisionAvoidance:g,keepMounted:!0}),W=H?`none`:U.side,G=H?jue:U.positionerStyles,K={open:k,side:W,align:U.align,anchorHidden:U.anchorHidden};Q(()=>{y.set(`popupSide`,U.side)},[y,U.side]);let q=i6(e,K,{styles:G,transitionStatus:L,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!A,inert:!k}),J=Y.useRef(0),ee=Ng(e=>{if(w.current.length===0)return;let t=J.current;if(J.current=e.size,e.size===t)return;let n=QU(MU);if(t!==0&&!y.state.multiple&&M!==null&&T3(w.current,M,I)===-1){let e=T.current,t=e!=null&&T3(w.current,e,I)!==-1?e:null;D(t,n),t===null&&(y.set(`selectedIndex`,null),C.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(M)){let e=M.filter(e=>T3(w.current,e,I)!==-1);e.length!==M.length&&(D(e,n),e.length===0&&(y.set(`selectedIndex`,null),C.current=null))}if(k&&H){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};t6(P,e),t6(E.current,e)}}),te=Y.useMemo(()=>({...U,side:W,alignItemWithTriggerActive:H,setControlledAlignItemWithTrigger:V,scrollUpArrowRef:R,scrollDownArrowRef:z}),[U,W,H,V]);return(0,X.jsx)(W3,{elementsRef:b,labelsRef:x,onMapChange:ee,children:(0,X.jsxs)($3.Provider,{value:te,children:[A&&j&&(0,X.jsx)(sX,{inert:oX(!k),cutout:F}),q]})})}),o6=`base-ui-disable-scrollbar`,s6={className:o6,getElement(e){return(0,X.jsx)(`style`,{nonce:e,href:o6,precedence:`base-ui:low`,children:`.${o6}{scrollbar-width:none}.${o6}::-webkit-scrollbar{display:none}`})}},Nue=Y.createContext(void 0);function c6(e){let t=Y.useContext(Nue);if(t===void 0&&!e)throw Error(Jg(69));return t}var Pue=Y.createContext(void 0),Fue={disableStyleElements:!1};function Iue(){return Y.useContext(Pue)??Fue}var Lue={...kU,...xU},Rue=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s,popupRef:c,onOpenChangeComplete:l,setOpen:u,valueRef:d,firstItemTextRef:f,selectedItemTextRef:p,multiple:m,handleScrollArrowVisibility:h,scrollHandlerRef:g,listRef:_,highlightItemOnHover:v,floatingContext:y}=p3(),{side:b,align:x,alignItemWithTriggerActive:S,isPositioned:C,setControlledAlignItemWithTrigger:w}=e6(),T=c6(!0)!=null,E=K3(),{nonce:D,disableStyleElements:O}=Iue(),k=$(s,P3.id),A=$(s,P3.open),j=$(s,P3.openMethod),M=$(s,P3.mounted),N=$(s,P3.popupProps),P=$(s,P3.transitionStatus),F=$(s,P3.triggerElement),I=$(s,P3.positionerElement),L=$(s,P3.listElement),R=Y.useRef(!1),z=Y.useRef(!1),B=Y.useRef({}),V=dG(),H=Ng(e=>{if(!I||!c.current||!z.current)return;let t=I.style.top===`0px`,n=I.style.bottom===`0px`;if(R.current||!S||!t&&!n){h(e);return}let r=d6(I),i=f6(I.getBoundingClientRect().height,`y`,r),a=Zg(I),o=ag(I),s=o.getComputedStyle(I),l=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),d=l6(o.getComputedStyle(c.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,m=u6(e),g=null,_=e=>{I.style.height=`${e}px`},v=t?m-p:p,y=Math.min(i+v,f);if(v<=1){let n=L3(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?m:0,f-(i+n)<=1&&(R.current=!0),h(e);return}f-y>1?g=t?1/0:0:n&&p<m&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=L3(g,0,u6(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(R.current=!0),h(e)});Y.useImperativeHandle(g,()=>H,[H]),UJ({open:A,ref:c,onComplete(){A&&l?.(!0)}});let U={open:A,transitionStatus:P,side:b,align:x};Q(()=>{!I||!c.current||Object.keys(B.current).length||(B.current={top:I.style.top||`0`,left:I.style.left||`0`,right:I.style.right,height:I.style.height,bottom:I.style.bottom,minHeight:I.style.minHeight,maxHeight:I.style.maxHeight,marginTop:I.style.marginTop,marginBottom:I.style.marginBottom})},[c,I]),Q(()=>{A||S||(z.current=!1,R.current=!1,t6(I,B.current))},[A,S,I,c]),Q(()=>{let e=c.current;if(!A||!F||!I||!e||S&&!C||s.state.transitionStatus===`ending`)return;if(z.current=!0,e.style.removeProperty(`--transform-origin`),!S){V.request(()=>h(L||e));return}let t=zue(e);try{let t=p.current;t?.isConnected||(t=!P3.hasSelectedValue(s.state)&&f.current?.isConnected?f.current:null);let n=d.current,r=ag(I),i=r.getComputedStyle(I),a=r.getComputedStyle(e),o=Zg(F),c=d6(F),l=p6(F.getBoundingClientRect(),c),u=p6(I.getBoundingClientRect(),c),m=l.height,g=L||e,y=g.scrollHeight,b=parseFloat(a.borderBottomWidth),x=parseFloat(i.marginTop)||10,S=parseFloat(i.marginBottom)||10,C=parseFloat(i.minHeight)||100,T=l6(a),D=o.documentElement.clientHeight-x-S,O=o.documentElement.clientWidth,k=D-l.bottom+m,A,j=E===`rtl`?l.right-u.width:l.left,M=0;if(t&&n){let e=p6(n.getBoundingClientRect(),c);A=p6(t.getBoundingClientRect(),c),j=u.left+(E===`rtl`?e.right-A.right:e.left-A.left);let r=e.top-l.top+e.height/2;M=A.top-u.top+A.height/2-r}let N=k+M+S+b,P=Math.min(D,N),z=D-x-S,V=N-P,H=O-5;I.style.left=`${L3(j,5,H-u.width)}px`,I.style.height=`${P}px`,I.style.maxHeight=`none`,I.style.marginTop=`${x}px`,I.style.marginBottom=`${S}px`,e.style.height=`100%`;let U=u6(g),W=V>=U-1;W&&(P=Math.min(D,u.height)-(V-U));let G=l.top<20||l.bottom>D-20||Math.ceil(P)+1<Math.min(y,C),K=(r.visualViewport?.scale??1)!==1&&SW;if(G||K){t6(I,B.current),w(!1);return}let q=Math.max(C,P);if(W){let e=Math.max(0,D-N);I.style.top=u.height>=z?`0`:`${e}px`,I.style.height=`${P}px`,g.scrollTop=u6(g)}else I.style.bottom=`0`,g.scrollTop=V;if(A){let t=u.top,n=u.height,r=A.top+A.height/2,i=L3(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(q===D||P>=T)&&(R.current=!0),h(g),v&&s.state.selectedIndex===null&&s.state.activeIndex===null&&_.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,A,I,F,d,f,p,c,h,S,w,V,L,_,v,E,C]),Y.useEffect(()=>{if(!S||!I||!A)return;let e=ag(I);function t(e){u(!1,QU(ZU,e))}return iG(e,`resize`,t)},[u,S,I,A]);let W={...L?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":m||void 0,id:`${k}-list`},onKeyDown(e){T&&XY.has(e.key)&&e.stopPropagation()},onScroll(e){L||H(e.currentTarget)},...S&&{style:L?{height:`100%`}:n6},className:!L&&S?s6.className:void 0},G=l_(`div`,e,{ref:[t,c],state:U,stateAttributesMapping:Lue,props:[N,W,r6(P),o]});return(0,X.jsxs)(Y.Fragment,{children:[!O&&s6.getElement(D),(0,X.jsx)(pq,{context:y,modal:!1,disabled:!M,openInteractionType:j,returnFocus:a,restoreFocus:!0,children:G})]})});function l6(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function u6(e){return R3(e.scrollHeight,e.clientHeight)}function d6(e){return rJ.getScale(e)}function f6(e,t,n){return e/n[t]}function p6(e,t){return HG({x:f6(e.x,`x`,t),y:f6(e.y,`y`,t),width:f6(e.width,`x`,t),height:f6(e.height,`y`,t)})}var m6=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function zue(e){let{style:t}=e,n={};for(let[e,r]of m6)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of m6){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var Bue=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o,scrollHandlerRef:s,multiple:c}=p3(),{alignItemWithTriggerActive:l}=e6(),u=$(o,P3.hasScrollArrows),d=$(o,P3.openMethod),f={id:`${$(o,P3.id)}-list`,role:`listbox`,"aria-multiselectable":c||void 0,onScroll(e){s.current?.(e.currentTarget)},...l&&{style:n6},className:u&&d!==`touch`?s6.className:void 0};return l_(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})});function h6(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=vue(),u=Y.useRef(-1),[d,f]=Y.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=Y.useRef(null),h=Y.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Q(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var g6=Y.createContext(void 0);function _6(){let e=Y.useContext(g6);if(!e)throw Error(Jg(57));return e}var Vue=Y.memo(Y.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=Y.useRef(null),d=h6({guess:!0,label:o,textRef:u}),{store:f,itemProps:p,setOpen:m,setValue:h,selectionRef:g,typingRef:_,valuesRef:v,multiple:y,selectedItemTextRef:b,disabled:x,readOnly:S}=p3(),C=x||s,w=$(f,P3.isActive,d.index),T=$(f,P3.open),E=$(f,P3.isSelected,a),D=$(f,P3.isSelectedByFocus,d.index),O=$(f,P3.isItemEqualToValue),k=d.index,A=Y.useRef(null);Q(()=>{let e=v.current;return e[k]=a,()=>{delete e[k]}},[k,a,v]),Q(()=>{let e=f.state.value,t=e;y&&Array.isArray(e)&&(t=e.length>0?e[e.length-1]:void 0),t!==void 0&&w3(a,t,O)&&(f.set(`selectedIndex`,k),u.current&&(b.current=u.current))},[k,y,O,f,a,b]);let j=Y.useRef(`mouse`),M=Y.useRef(!1),{getButtonProps:N,buttonRef:P}=$g({disabled:C,focusableWhenDisabled:!0,native:c,composite:!0}),F={disabled:C,selected:E,highlighted:w};function I(e){if(x||S)return;let t=f.state.value;if(y){let n=Array.isArray(t)?t:[],r=E?D3(n,a,O):[...n,a];h(r,QU(LU,e))}else h(a,QU(LU,e)),m(!1,QU(LU,e))}function L(){g.current.dragY=0}let R={role:`option`,"aria-selected":E,tabIndex:T&&w?0:-1,onKeyDown(e){f.set(`activeIndex`,k),e.key===` `&&_.current&&e.preventDefault()},onClick(e){let t=j.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&OW(e.nativeEvent)&&(n!==void 0||w),i=t&&!r&&!M.current;M.current=!1,!(C||i)&&I(e.nativeEvent)},onPointerEnter(e){j.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=g.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){j.current=e.pointerType,M.current=!0,L()},onMouseUp(){if(L(),C||j.current===`touch`||M.current)return;let e=!g.current.allowSelectedMouseUp&&E,t=!g.current.allowUnselectedMouseUp&&!E;e||t||(M.current=!0,A.current?.click(),M.current=!1)}},z=l_(`div`,e,{ref:[P,t,d.ref,A],state:F,props:[p,R,l,N]}),B=Y.useMemo(()=>({selected:E,index:k,textRef:u,selectedByFocus:D}),[E,k,u,D]);return(0,X.jsx)(g6.Provider,{value:B,children:z})})),Hue=Y.forwardRef(function(e,t){let{selected:n}=_6();return e.keepMounted||n?(0,X.jsx)(Uue,{...e,ref:t}):null}),Uue=Y.memo(Y.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=_6(),c=Y.useRef(null),{transitionStatus:l,setMounted:u}=VJ(s),d=l_(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:xU});return UJ({open:s,ref:c,onComplete(){s||u(!1)}}),d})),Wue=Y.memo(Y.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=_6(),{firstItemTextRef:a,selectedItemTextRef:o}=p3(),{render:s,className:c,style:l,...u}=e;return l_(`div`,e,{ref:[Y.useCallback(e=>{e&&(n===0&&(a.current=e),i&&(o.current=e))},[a,o,n,i]),t,r],props:u})})),v6=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,{store:l,popupRef:u,listRef:d,handleScrollArrowVisibility:f,scrollArrowsMountedCountRef:p}=p3(),{side:m,scrollDownArrowRef:h,scrollUpArrowRef:g}=e6(),_=$(l,c?P3.scrollUpArrowVisible:P3.scrollDownArrowVisible),v=$(l,P3.openMethod),y=_&&v!==`touch`,b=uW(),x=c?g:h,{mounted:S,transitionStatus:C,setMounted:w}=VJ(y);Q(()=>(p.current+=1,l.set(`hasScrollArrows`,!0),()=>{p.current=Math.max(0,p.current-1),p.current===0&&l.set(`hasScrollArrows`,!1)}),[l,p]),UJ({open:y,ref:x,onComplete(){y||w(!1)}});let T=l_(`div`,e,{ref:[t,x],state:{direction:a,visible:y,side:m,transitionStatus:C},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||b.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??u.current;if(!e)return;l.set(`activeIndex`,null),f(e);let n=R3(e.scrollHeight,e.clientHeight),r=z3(e.scrollTop,n),i=r===(c?0:n),a=d.current;if(r!==e.scrollTop&&(e.scrollTop=r),i){b.clear();return}if(a.length>0){let t=x.current?.offsetHeight||0;e.scrollTop=Gue(a,c,r,e.clientHeight,t,n)}b.start(40,t)}b.start(40,t)},onMouseLeave(){b.clear()}},s],stateAttributesMapping:xU});return S||o?T:null});function Gue(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?z3(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?z3(l.offsetTop+l.offsetHeight-r+i,a):a}var Kue=Y.forwardRef(function(e,t){return(0,X.jsx)(v6,{...e,ref:t,direction:`down`})}),que=Y.forwardRef(function(e,t){return(0,X.jsx)(v6,{...e,ref:t,direction:`up`})}),y6=Y.createContext(void 0);function Jue(){let e=Y.useContext(y6);if(e===void 0)throw Error(Jg(56));return e}var Yue=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=Y.useState(),c=Y.useMemo(()=>({labelId:o,setLabelId:s}),[o,s]),l=l_(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":o},a]});return(0,X.jsx)(y6.Provider,{value:c,children:l})}),Xue=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{setLabelId:s}=Jue(),c=aW(a);return Q(()=>(s(c),()=>{s(e=>e===c?void 0:e)}),[c,s]),l_(`div`,e,{ref:t,props:[{id:c},o]})}),Zue=Y.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return l_(`div`,e,{state:{orientation:i},ref:t,props:[{role:`presentation`},o]})}),b6=(0,Y.createContext)(new Map);function x6(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(x6).join(` `):(0,Y.isValidElement)(e)?x6(e.props.children):``}function Que(e){let t=[],n=e=>{Y.Children.forEach(e,e=>{if((0,Y.isValidElement)(e)){if(typeof e.props.value==`string`||e.props.value===null){let n=typeof e.props.label==`string`?e.props.label:x6(e.props.children).trim();n&&t.push({value:e.props.value,label:n})}e.props.children&&n(e.props.children)}})};return n(e),t}function S6(e){let t=(0,Z.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({onValueChange:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;if(t[4]!==n){a=new Map;for(let e of Que(n))a.set(e.value,e.label);t[4]=n,t[5]=a}else a=t[5];let o=a,s;t[6]===r?s=t[7]:(s=e=>r?.(e),t[6]=r,t[7]=s);let c;t[8]!==n||t[9]!==i||t[10]!==s?(c=(0,X.jsx)(lue,{"data-slot":`select`,multiple:!1,onValueChange:s,...i,children:n}),t[8]=n,t[9]=i,t[10]=s,t[11]=c):c=t[11];let l;return t[12]!==o||t[13]!==c?(l=(0,X.jsx)(b6.Provider,{value:o,children:c}),t[12]=o,t[13]=c,t[14]=l):l=t[14],l}function C6(e){return t=>{t!==null&&e(t)}}function w6(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(Yue,{"data-slot":`select-group`,...n}),t[2]=n,t[3]=r),r}function T6(e){let t=(0,Z.c)(10),n,r;t[0]===e?(n=t[1],r=t[2]):({placeholder:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i=(0,Y.useContext)(b6),a;t[3]!==i||t[4]!==n?(a=e=>i.get(e)??(e||n),t[3]=i,t[4]=n,t[5]=a):a=t[5];let o;return t[6]!==n||t[7]!==r||t[8]!==a?(o=(0,X.jsx)(hue,{"data-slot":`select-value`,placeholder:n,...r,children:a}),t[6]=n,t[7]=r,t[8]=a,t[9]=o):o=t[9],o}function E6(e){let t=(0,Z.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,size:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===r?s=t[6]:(s=Kv(`flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition-[color,box-shadow] hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 data-[size=default]:h-9 data-[size=sm]:h-8 data-[disabled]:cursor-not-allowed data-[invalid]:border-destructive data-[placeholder]:text-muted-foreground data-[disabled]:opacity-50 data-[invalid]:ring-destructive/20 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:data-[invalid]:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(gue,{children:(0,X.jsx)(ay,{className:`size-4 opacity-50`})}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,X.jsxs)(pue,{className:s,"data-size":o,"data-slot":`select-trigger`,...i,children:[n,c]}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}function D6(e){let t=(0,Z.c)(27),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({className:r,children:n,side:a,sideOffset:o,align:s,alignOffset:c,alignItemWithTrigger:l,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u=a===void 0?`bottom`:a,d=o===void 0?4:o,f=s===void 0?`center`:s,p=c===void 0?0:c,m=l!==void 0&&l,h;t[9]===r?h=t[10]:(h=Kv(`data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 relative isolate z-50 max-h-(--available-height) w-max min-w-(--anchor-width) origin-(--transform-origin) overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-closed:animate-out data-open:animate-in`,r),t[9]=r,t[10]=h);let g;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,X.jsx)(ede,{}),t[11]=g):g=t[11];let _;t[12]===n?_=t[13]:(_=(0,X.jsx)(Bue,{className:`max-h-[inherit] w-max min-w-full overflow-y-auto p-1`,children:n}),t[12]=n,t[13]=_);let v;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,X.jsx)(tde,{}),t[14]=v):v=t[14];let y;t[15]!==m||t[16]!==i||t[17]!==h||t[18]!==_?(y=(0,X.jsxs)(Rue,{className:h,"data-align-trigger":m,"data-slot":`select-content`,...i,children:[g,_,v]}),t[15]=m,t[16]=i,t[17]=h,t[18]=_,t[19]=y):y=t[19];let b;return t[20]!==f||t[21]!==m||t[22]!==p||t[23]!==u||t[24]!==d||t[25]!==y?(b=(0,X.jsx)(_ue,{children:(0,X.jsx)(Mue,{align:f,alignItemWithTrigger:m,alignOffset:p,className:`isolate z-50`,side:u,sideOffset:d,children:y})}),t[20]=f,t[21]=m,t[22]=p,t[23]=u,t[24]=d,t[25]=y,t[26]=b):b=t[26],b}function O6(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`px-2 py-1.5 text-muted-foreground text-xs`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Xue,{className:i,"data-slot":`select-label`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function k6(e){let t=(0,Z.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=Kv(`relative flex w-full cursor-default select-none items-center gap-2 whitespace-nowrap rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,X.jsx)(Hue,{children:(0,X.jsx)(iy,{className:`size-4`})})}),t[6]=o):o=t[6];let s;t[7]===n?s=t[8]:(s=(0,X.jsx)(Wue,{children:n}),t[7]=n,t[8]=s);let c;return t[9]!==i||t[10]!==a||t[11]!==s?(c=(0,X.jsxs)(Vue,{className:a,"data-slot":`select-item`,...i,children:[o,s]}),t[9]=i,t[10]=a,t[11]=s,t[12]=c):c=t[12],c}function $ue(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`pointer-events-none -mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Zue,{className:i,"data-slot":`select-separator`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ede(e){let t=(0,Z.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`flex cursor-default items-center justify-center py-1 data-[visible=false]:hidden`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(qee,{className:`size-4`}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,X.jsx)(que,{className:i,"data-slot":`select-scroll-up-button`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function tde(e){let t=(0,Z.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`flex cursor-default items-center justify-center py-1 data-[visible=false]:hidden`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(ay,{className:`size-4`}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,X.jsx)(Kue,{className:i,"data-slot":`select-scroll-down-button`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}var A6=`payload`,nde=`event`,rde=`$event.name`;function ide(e){return e===`within_next`||e===`more_than_from_now`||e===`less_than_ago`||e===`more_than_ago`}function ade(e){return e===`before`||e===`after`}function j6(e){return ide(e.operator)}function M6(e){return ade(e.operator)}function ode(e){return e===`is_set`||e===`is_not_set`}function N6(e){return ode(e.operator)}function P6(e,t=`rule`){return e.type===`timestamp`?{id:t,field:e.path,fieldType:`timestamp`,operator:`within_next`,amount:1,unit:`days`}:e.type===`number`?{id:t,field:e.path,fieldType:`number`,operator:`equals`,value:0}:e.type===`boolean`?{id:t,field:e.path,fieldType:`boolean`,operator:`is_true`}:{id:t,field:e.path,fieldType:`string`,operator:`equals`,value:``}}function sde(e,t){let n=!1,r=e.groups.map(e=>({...e,conditions:e.conditions.map(e=>{let r=t.get(e.field);return!r||r.type===e.fieldType?e:(n=!0,P6(r,e.id))})}));return n?{...e,groups:r}:e}function F6(e,t){return{version:2,groupLogic:`and`,groups:[{id:t?.groupId??`group`,logic:`and`,conditions:[P6(e,t?.conditionId??`rule`)]}]}}var cde=[{value:`and`,label:`AND`},{value:`or`,label:`OR`}],lde=[{value:`within_next`,label:`is within the next`},{value:`more_than_from_now`,label:`is more than from now`},{value:`less_than_ago`,label:`is less than ago`},{value:`more_than_ago`,label:`is more than ago`},{value:`before`,label:`is before`},{value:`after`,label:`is after`}],I6=[{value:`minutes`,label:`minutes`},{value:`hours`,label:`hours`},{value:`days`,label:`days`},{value:`weeks`,label:`weeks`}],ude=[{value:`equals`,label:`equals`},{value:`not_equals`,label:`does not equal`},{value:`contains`,label:`contains`}],dde=[{value:`equals`,label:`equals`},{value:`not_equals`,label:`does not equal`},{value:`greater_than`,label:`is greater than`},{value:`greater_or_equal`,label:`is greater than or equal`},{value:`less_than`,label:`is less than`},{value:`less_or_equal`,label:`is less than or equal`}],fde=[{value:`is_true`,label:`is true`},{value:`is_false`,label:`is false`}],pde=[{value:`is_set`,label:`is set`},{value:`is_not_set`,label:`is not set`}],mde=RegExp(`^(?:(?:\\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])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|(?:[+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$`),L6=Sh.check(bee(mde)).pipe(Fh(Dee,zf)),hde=ch(L6);dh(L6);var gde=mh(L6);function R6(e){return Lc(hde(e.trim()))}function _de(e){return gde(e)}function z6(e){return Sh.annotate({message:e}).pipe(Fh(Sh,Ff())).check(Bh(1).annotate({message:e})).annotateKey({messageMissingKey:e})}function B6(e,t){return e.annotate({message:t}).annotateKey({messageMissingKey:t})}function V6(e){return{id:z6(`Condition id is required`),field:z6(`Condition field is required`),fieldType:vh(e)}}function H6(e,t){return Eh({...V6(e),operator:B6(Nh([`is_set`,`is_not_set`]),t)})}var U6=`Timestamp operator is invalid`,W6=`Timestamp amount must be a positive integer`,G6=`Timestamp absolute operators require a valid date-time`,K6=`String operator is invalid`,q6=`Number operator is invalid`,J6=`Number conditions require a finite numeric value`,Y6=`Boolean operator is invalid`;function vde(e){return R6(e)!==null}var yde=[Eh({...V6(`timestamp`),operator:B6(Nh([`within_next`,`more_than_from_now`,`less_than_ago`,`more_than_ago`]),U6),amount:B6(Ch,W6).check(zh().annotate({message:W6}),wee().annotate({message:W6}),Cee(0).annotate({message:W6})),unit:B6(Nh([`minutes`,`hours`,`days`,`weeks`]),`Timestamp unit is invalid`)}),Eh({...V6(`timestamp`),operator:B6(Nh([`before`,`after`]),U6),dateTime:Sh.annotate({message:G6}).pipe(Fh(Sh,Ff())).check(Ih(e=>vde(e)?void 0:G6)).annotateKey({messageMissingKey:G6})}),H6(`timestamp`,U6),Eh({...V6(`string`),operator:B6(Nh([`equals`,`not_equals`,`contains`]),K6),value:B6(Sh,`String conditions require a text value`)}),H6(`string`,K6),Eh({...V6(`number`),operator:B6(Nh([`equals`,`not_equals`,`greater_than`,`greater_or_equal`,`less_than`,`less_or_equal`]),q6),value:B6(Ch,J6).check(zh().annotate({message:J6}))}),H6(`number`,q6),Eh({...V6(`boolean`),operator:B6(Nh([`is_true`,`is_false`]),Y6)}),H6(`boolean`,Y6)],bde=Dh(Sh,yh).annotate({message:`Condition must be an object`}).pipe(Fh(Mh(yde).annotate({message:`Condition field type is invalid`}))),X6=`Each group must contain at least one condition`,xde=Eh({id:z6(`Group id is required`),logic:B6(Nh([`and`,`or`]),`Group logic is invalid`),conditions:B6(Ah(kh(bde)),X6).check(Bh(1).annotate({message:X6}))}).annotate({message:`Group must be an object`}),Z6=`Condition model must contain at least one group`,Sde=lh(Eh({version:B6(vh(2),`Condition model version must be 2`),groupLogic:B6(Nh([`and`,`or`]),`Condition model group logic is invalid`),groups:B6(Ah(kh(xde)),Z6).check(Bh(1).annotate({message:Z6}))}).annotate({message:`Condition model must be an object`})),Cde=lf();function wde(e){let t=e.path?.at(-1);if(t!=null)return typeof t==`object`?t.key:t}function Tde(e){return(e.find(e=>wde(e)!==`operator`)??e[0])?.message}function Q6(e){let t=e;if(typeof e==`string`){let n=e.trim();if(!n)return{valid:!1,error:`Condition model is empty`};try{t=JSON.parse(n)}catch{return{valid:!1,error:`Condition model must be valid JSON`}}}let n=Sde(t);if(Hc(n)){let{issues:e}=Cde(n.failure.issue);return{valid:!1,error:Tde(e)??`Condition model is invalid`}}return{valid:!0,model:n.success}}function $6(e){return JSON.stringify(e)}function e8(e){return JSON.stringify(e)}function t8(e){return e===`and`||e===`or`}function Ede(e){return typeof e==`number`&&Number.isFinite(e)&&Number.isInteger(e)&&e>0}function Dde(e){return e===`minutes`||e===`hours`||e===`days`||e===`weeks`}function Ode(e){return R6(e)!==null}function kde(e){switch(e){case`equals`:return`==`;case`not_equals`:return`!=`;case`greater_than`:return`>`;case`greater_or_equal`:return`>=`;case`less_than`:return`<`;case`less_or_equal`:return`<=`;default:return`==`}}function Ade(e,t){if(j6(e)){let n=e.amount;if(!Ede(n))return{valid:!1,error:`Timestamp amount must be a positive integer`,incomplete:!0};if(!Dde(e.unit))return{valid:!1,error:`Timestamp unit is invalid`};let r=e.unit;return e.operator===`within_next`?{valid:!0,expression:`${t} > now && ${t} < now + ${r}(${n})`}:e.operator===`more_than_from_now`?{valid:!0,expression:`${t} > now + ${r}(${n})`}:e.operator===`less_than_ago`?{valid:!0,expression:`${t} > now - ${r}(${n})`}:{valid:!0,expression:`${t} < now - ${r}(${n})`}}if(!Ode(e.dateTime))return{valid:!1,error:`Timestamp absolute operators require a valid date-time`,incomplete:!0};let n=e8(e.dateTime.trim());return e.operator===`before`?{valid:!0,expression:`${t} < date(${n})`}:{valid:!0,expression:`${t} > date(${n})`}}function jde(e,t){if(!e.value.trim())return{valid:!1,error:`Text conditions require a value`,incomplete:!0};let n=e8(e.value);return e.operator===`equals`?{valid:!0,expression:`${t} == ${n}`}:e.operator===`not_equals`?{valid:!0,expression:`${t} != ${n}`}:{valid:!0,expression:`${t}.contains(${n})`}}function Mde(e,t){return Number.isFinite(e.value)?{valid:!0,expression:`${t} ${kde(e.operator)} ${e.value}`}:{valid:!1,error:`Number conditions require a finite numeric value`,incomplete:!0}}function Nde(e,t){return e.operator===`is_true`?{valid:!0,expression:`${t} == true`}:{valid:!0,expression:`${t} == false`}}function Pde(e){return/^[A-Za-z_][A-Za-z0-9_]*$/.test(e)}function Fde(e){let t=Tle(e);if(!t)return null;if(t.every(e=>e.kind===`key`&&Pde(e.key))){let e=t.map(e=>e.key);return{field:`${A6}.${e.join(`.`)}`,presence:e.map((t,n)=>`has(${A6}.${e.slice(0,n+1).join(`.`)})`).join(` && `)}}let n=A6,r=[];for(let e of t)if(e.kind===`key`){let t=e8(e.key);r.push(`${t} in ${n}`),n=`${n}[${t}]`}else r.push(`size(${n}) > ${e.index}`),n=`${n}[${e.index}]`;return{field:n,presence:r.join(` && `)}}function Ide(e,t){return e.operator===`is_set`?{valid:!0,expression:t}:{valid:!0,expression:`!(${t})`}}function n8(e,t){return e.fieldType===`timestamp`?Ade(e,t):e.fieldType===`string`?jde(e,t):e.fieldType===`number`?Mde(e,t):Nde(e,t)}function Lde(e){let t=`${nde}.name`;return N6(e)?{valid:!0,expression:e.operator===`is_set`?`${t} != null`:`${t} == null`}:n8(e,t)}function Rde(e){let t=e.field.trim();if(!t)return{valid:!1,error:`Condition field is required`};if(t===`$event.name`)return Lde(e);let n=Fde(t);if(!n)return{valid:!1,error:`Condition field path is invalid`};let{field:r,presence:i}=n;if(N6(e))return Ide(e,i);let a=n8(e,r);return a.valid?{valid:!0,expression:`${i} && (${a.expression})`}:a}function zde(e){if(e.conditions.length===0)return{valid:!1,error:`Each group must contain at least one condition`};let t=[];for(let n of e.conditions){let e=Rde(n);if(!e.valid)return e;t.push(`(${e.expression})`)}let n=e.logic===`and`?` && `:` || `;return{valid:!0,expression:t.join(n)}}function r8(e){if(!t8(e.groupLogic))return{valid:!1,error:`Condition model group logic is invalid`};if(e.groups.length===0)return{valid:!1,error:`Condition model must contain at least one group`};let t=[];for(let n of e.groups){if(!t8(n.logic))return{valid:!1,error:`Group logic is invalid`};let e=zde(n);if(!e.valid)return e;t.push(`(${e.expression})`)}let n=e.groupLogic===`and`?` && `:` || `;return{valid:!0,expression:t.join(n)}}function Bde(e){let t=Q6(e);return t.valid?r8(t.model):{valid:!1,error:t.error}}function i8(e){return e===`true`||e===`false`?e:null}function Vde(e){let t=i8(e);return t===`true`?`True`:t===`false`?`False`:null}function Hde(e){return e===Y0.condition}function a8(e){return ale(e)}var o8=`event:`;function s8(e){return`${o8}${e}`}function c8(e){if(typeof e!=`string`||!e.startsWith(o8))return null;let t=e.slice(6).trim();return t.length>0?t:null}function Ude(e){return e===Y0.eventSplit}function l8(e){return ole(e)}function u8(e){let{rule:t,event:n}=e,r=t.field.trim();return r===`$event.name`?N6(t)?!0:t.operator===`equals`?t.value===n.name:t.operator!==`not_equals`||t.value!==n.name:N6(t)||e.declaredElsewhere.has(r)?!0:n.payloadFields.some(e=>e.path===r)}function d8(e){let{rule:t,event:n}=e;return t.field.trim()!==`$event.name`||N6(t)?!0:t.operator===`equals`?t.value!==n.name:t.operator!==`not_equals`||t.value===n.name}function Wde(e){let t=(t,n)=>n?t.every(t=>u8({...e,rule:t})):t.some(t=>u8({...e,rule:t})),n=e.model.groups.map(e=>t(e.conditions,e.logic===`and`));return e.model.groupLogic===`and`?n.every(Boolean):n.some(Boolean)}function Gde(e){let t=(t,n)=>n?t.some(t=>d8({...e,rule:t})):t.every(t=>d8({...e,rule:t})),n=e.model.groups.map(e=>t(e.conditions,e.logic===`and`));return e.model.groupLogic===`and`?n.some(Boolean):n.every(Boolean)}function Kde(e){let{events:t,branch:n}=e;if(!n)return[...t];let r=Q6(e.node.data.config?.conditionModel);return r.valid?t.filter(t=>{let i={model:r.model,event:t,declaredElsewhere:e.declaredElsewhere};return n===`true`?Wde(i):Gde(i)}):[...t]}function qde(e){let t=Q0(e.entryNode.data.config);return t?Ka((e.handle===`started`?t.startEvents:e.handle===`canceled`?t.cancelEvents:[]).map(t=>Uy(e.catalog,t))):[]}function Jde(e,t){let n=e.data.config?.actionType;if(typeof n!=`string`)return[];let r=Wy(t,n);return r?x4(e.data.config,r.outputFields).map(e=>e.path):[]}function Yde(e){let{catalog:t}=e,n=new Map(e.nodes.map(e=>[e.id,e])),r=new Map;for(let t of e.edges)r.has(t.target)||r.set(t.target,t);let i=[],a=new Set([e.targetNodeId]),o=e.targetNodeId;for(;;){let e=r.get(o),t=e&&n.get(e.source);if(!(e&&t)||a.has(t.id))return[];if(i.push({parent:t,handle:e.sourceHandle}),t.data.type===`lifecycle`)break;a.add(t.id),o=t.id}let s=i.at(-1);if(!s)return[];let c=qde({entryNode:s.parent,handle:s.handle,catalog:t}),l=new Set;for(let e of i.toReversed()){for(let n of Jde(e.parent,t))l.add(n);if(l8(e.parent)){let t=c8(e.handle);c=c.filter(e=>e.name===t);continue}c.length>0&&a8(e.parent)&&(c=Kde({events:c,node:e.parent,branch:i8(e.handle),declaredElsewhere:l}))}return c}function Xde(e){let t=Ja(Ka(e.map(e=>e.field.type)));return t.length<2?t[0]?{type:t[0]}:{}:{typeClash:{types:t,events:e.filter(e=>e.field.type).map(e=>e.event.name)}}}function Zde(e){return e.find(e=>e.field.description)?.field.description}function Qde(e){return Ja(e.map(e=>(e.field.enumValues??[]).toSorted().join(` `))).length===1&&e[0]?.field.enumValues?[...e[0].field.enumValues]:void 0}function $de(e){let t=new Map;for(let n of e)for(let e of n.payloadFields){let r=t.get(e.path);r?r.push({event:n,field:e}):t.set(e.path,[{event:n,field:e}])}return Array.from(t.entries()).map(([t,n])=>{let{type:r,typeClash:i}=Xde(n),a=Zde(n),o=Qde(n);return{path:t,...a?{description:a}:{},...r?{type:r}:{},...o?{enumValues:o}:{},...i?{typeClash:i}:{},...n.length<e.length||n.some(e=>e.field.nullable)?{nullable:!0}:{},declaredBy:n.map(e=>e.event.name)}})}function efe(e,t){let n=new Map;for(let e of t){let t=n.get(e.target);t?t.push(e.source):n.set(e.target,[e.source])}let r=new Set,i=new Set([e]),a=[e];for(;a.length>0;){let e=a.pop();if(e)for(let t of n.get(e)??[])r.add(t),i.has(t)||(i.add(t),a.push(t))}return r}var f8=`Carried by every Event`,tfe=`Event name`;function nfe(e){return $de(e).map(({declaredBy:t,...n})=>{let[r,i]=qa(e,e=>t.includes(e.name));return{...n,...i.length>0?{absentOn:i.map(e=>e.label)}:{},...e.length<2?{}:{sourceLabel:i.length===0?f8:r.map(e=>e.label).join(`, `)}}})}function p8(e){return Yde({targetNodeId:e.targetNodeId,nodes:e.nodes,edges:e.edges,catalog:e.catalog})}function rfe(e,t){let n=Wy(e,t);return n?[...n.outputFields]:[]}function m8(e,t){if(t.data.label)return t.data.label;if(t.data.type===`action`){let n=F2(t.data.config,`actionType`);if(n){let t=Wy(e,n);if(t?.label)return t.label}return n||`Action`}return t.data.type===`lifecycle`?`Lifecycle`:`Node`}function h8(e,t){let n=F2(e.data.config,`actionType`);if(n){let r=rfe(t.catalog,n);if(r.length>0)return[...x4(e.data.config,r)]}return e.data.type===`lifecycle`?nfe(p8(t)):[]}function g8(e){let{currentNodeId:t,nodes:n,edges:r}=e;if(!t)return[];let i=efe(t,r);return n.filter(e=>i.has(e.id))}function ife(e){let{currentNodeId:t,nodes:n,edges:r,catalog:i}=e;return t?g8(e).flatMap(e=>{let a=m8(i,e);return h8(e,{targetNodeId:t,nodes:n,edges:r,catalog:i}).map(({sourceLabel:t,...n})=>({...n,sourceNodeId:e.id,sourceNodeName:t??a}))}):[]}function _8(e){return e.type===`timestamp`?`timestamp`:e.type===`string`||e.type===`number`||e.type===`boolean`?e.type:e.type===`duration`||e.type===void 0?`string`:null}function afe(e,t){let n=Uy(e,t);return n?Ka(n.payloadFields.map(e=>{let r=e.path.trim(),i=_8({...e,sourceNodeId:t,sourceNodeName:n.label});return r&&i?{path:r,label:r,type:i,sourceNodeId:t,sourceNodeLabel:n.label,sourceNodeLabels:[n.label],...e.nullable?{nullable:!0}:{},...e.enumValues?{enumValues:e.enumValues}:{}}:null})).toSorted((e,t)=>e.path.localeCompare(t.path)):[]}function ofe(e){let{currentNodeId:t,nodes:n,edges:r,catalog:i}=e,a=g8(e).find(e=>e.data.type===`lifecycle`);if(!(a&&t))return[];let o=p8({targetNodeId:t,nodes:n,edges:r,catalog:i});return o.length<2?[]:[{path:rde,label:tfe,type:`string`,sourceNodeId:a.id,sourceNodeLabel:f8,sourceNodeLabels:[f8],enumValues:o.map(e=>e.name)}]}function v8(e){let t=new Map(ofe(e).map(e=>[e.path,e]));for(let n of ife(e)){let e=n.path.trim();if(!e||n.typeClash)continue;let r=_8(n);if(!r)continue;let i=t.get(e);if(i){i.sourceNodeLabels.includes(n.sourceNodeName)||(i.sourceNodeLabels.push(n.sourceNodeName),i.sourceNodeLabels.sort((e,t)=>e.localeCompare(t)));continue}t.set(e,{path:e,label:e,type:r,sourceNodeId:n.sourceNodeId,sourceNodeLabel:n.sourceNodeName,sourceNodeLabels:[n.sourceNodeName],...n.nullable?{nullable:!0}:{},...n.enumValues?{enumValues:n.enumValues}:{}})}return Array.from(t.values()).toSorted((e,t)=>e.path.localeCompare(t.path))}function sfe(e,t,n){return!(t&&e.type)||n.allowNumber&&e.type===`number`?!0:e.type===t}function y8(e,t){return sfe(e,t,{allowNumber:!1})}function cfe(e,t,n){return n?2:t&&!e.type?1:0}function lfe(e,t){let n=e.typeClash;if(n&&!(t&&!n.types.some(e=>y8({type:e},t))))return`${n.events.join(` and `)} type this differently. Add an Event Split above this node to use it.`}function b8(e){let t=(0,Z.c)(45),{isOpen:n,position:r,onSelect:i,onClose:a,currentNodeId:o,filter:s,fieldType:c}=e,l=s===void 0?``:s,u=ky(),[d]=yj(j4),[f]=yj(M4),[p,m]=(0,Y.useState)(0),h=(0,Y.useRef)(null),g;t[0]!==o||t[1]!==f||t[2]!==d?(g=g8({currentNodeId:o,nodes:d,edges:f}),t[0]=o,t[1]=f,t[2]=d,t[3]=g):g=t[3];let _=g,v;bb0:{if(!o){let e;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[4]=e):e=t[4],v=e;break bb0}let e;if(t[5]!==u||t[6]!==o||t[7]!==f||t[8]!==c||t[9]!==d||t[10]!==_){let n=[];for(let e of _){let t=m8(u,e),r=h8(e,{targetNodeId:o,nodes:d,edges:f,catalog:u});!c&&e.data.type!==`lifecycle`&&r.length&&n.push({type:`node`,rank:0,nodeId:e.id,nodeName:t,template:w4({nodeId:e.id,nodeLabel:t})});for(let i of r){let r=lfe(i,c);(r||y8(i,c))&&n.push({type:`field`,rank:cfe(i,c,r),nodeId:e.id,nodeName:t,field:i.path,description:i.description,template:w4({nodeId:e.id,nodeLabel:t,fieldPath:i.path}),...r?{unusable:r}:{},...i.absentOn?.length?{absentOn:i.absentOn}:{}})}}e=n.toSorted(dfe),t[5]=u,t[6]=o,t[7]=f,t[8]=c,t[9]=d,t[10]=_,t[11]=e}else e=t[11];v=e}let y=v,b;if(t[12]!==l||t[13]!==y){bb1:{let e=l.trim().toLowerCase();if(!e){b=y;break bb1}b=y.filter(t=>t.nodeName.toLowerCase().includes(e)||t.field&&t.field.toLowerCase().includes(e))}t[12]=l,t[13]=y,t[14]=b}else b=t[14];let x=b,S=x.length===0?0:Math.min(p,x.length-1),C=c&&y.length===0?c===`duration`?`No field upstream is a duration. Type a value like 24h.`:`No field upstream is a date and time. Type one, like 2026-03-10T09:00:00Z.`:null,w=x.length>0||C!==null,T;t[15]!==x||t[16]!==a||t[17]!==i||t[18]!==S?(T=e=>{bb87:switch(e.key){case`ArrowDown`:e.preventDefault(),m(e=>e<x.length-1?e+1:e);break bb87;case`ArrowUp`:e.preventDefault(),m(ufe);break bb87;case`Enter`:{e.preventDefault();let t=x[S];t&&!t.unusable&&i(t.template);break bb87}case`Escape`:e.preventDefault(),a()}},t[15]=x,t[16]=a,t[17]=i,t[18]=S,t[19]=T):T=t[19];let E=T,D=n&&w,O;t[20]===D?O=t[21]:(O={enabled:D},t[20]=D,t[21]=O),HX(window,`keydown`,E,O);let k;if(t[22]===S?k=t[23]:(k=()=>{let e=h.current?.children.item(S);e instanceof HTMLElement&&e.scrollIntoView({block:`nearest`})},t[22]=S,t[23]=k),UX(S,k),!(n&&w)||typeof document>`u`)return null;let A=Math.min(r.top,window.innerHeight-300),j=Math.min(r.left,window.innerWidth-320),M;t[24]!==j||t[25]!==A?(M={top:A,left:j},t[24]=j,t[25]=A,t[26]=M):M=t[26];let N=M,P=`${N.top}px`,F=`${N.left}px`,I;t[27]!==P||t[28]!==F?(I={top:P,left:F},t[27]=P,t[28]=F,t[29]=I):I=t[29];let L;t[30]===C?L=t[31]:(L=C&&(0,X.jsx)(`div`,{className:`px-2 py-1.5 text-muted-foreground text-sm`,children:C}),t[30]=C,t[31]=L);let R;if(t[32]!==x||t[33]!==i||t[34]!==S){let e;t[36]!==i||t[37]!==S?(e=(e,t)=>(0,X.jsxs)(`div`,{className:Kv(`flex items-center justify-between rounded px-2 py-1.5 text-sm transition-colors`,e.unusable?`cursor-not-allowed opacity-60`:`cursor-pointer`,t===S?`bg-accent text-accent-foreground`:!e.unusable&&`hover:bg-accent/50`),onMouseDown:t=>{t.preventDefault(),e.unusable||i(e.template)},onMouseEnter:()=>m(t),children:[(0,X.jsxs)(`div`,{className:`flex-1`,children:[(0,X.jsx)(`div`,{className:`font-medium`,children:e.type===`node`?e.nodeName:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.nodeName,`.`]}),e.field]})}),e.description&&(0,X.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:e.description}),e.absentOn&&(0,X.jsxs)(`div`,{className:`text-warning text-xs dark:text-warning`,children:[`Absent on `,e.absentOn.join(`, `)]}),e.unusable&&(0,X.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:e.unusable})]}),t===S&&!e.unusable&&(0,X.jsx)(iy,{className:`size-4`})]},`${e.nodeId}-${e.field||`root`}`),t[36]=i,t[37]=S,t[38]=e):e=t[38],R=x.map(e),t[32]=x,t[33]=i,t[34]=S,t[35]=R}else R=t[35];let z;t[39]!==L||t[40]!==R?(z=(0,X.jsxs)(`div`,{className:`max-h-60 overflow-y-auto`,ref:h,children:[L,R]}),t[39]=L,t[40]=R,t[41]=z):z=t[41];let B;return t[42]!==I||t[43]!==z?(B=(0,Xi.createPortal)((0,X.jsx)(`div`,{className:`fixed z-50 w-80 rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,style:I,children:z}),document.body),t[42]=I,t[43]=z,t[44]=B):B=t[44],B}function ufe(e){return e>0?e-1:e}function dfe(e,t){return e.rank-t.rank}var x8=`data-placeholder`,S8=`data-filler`,ffe=`inline-flex items-center gap-1 rounded bg-info/10 px-1.5 py-0.5 text-info font-mono text-xs border border-info/20 mx-0.5`,pfe=`inline-flex items-center gap-1 rounded bg-destructive/10 px-1.5 py-0.5 text-destructive font-mono text-xs border border-destructive/20 mx-0.5`;function mfe(e,t,n){let r=e.fieldPath?`${e.nodeLabel}.${e.fieldPath}`:e.nodeLabel,i=t.find(t=>t.id===e.nodeId);if(!i)return r;let a=i.data.label;if(!a&&i.data.type===`action`){let e=F2(i.data.config,`actionType`);e&&(a=Wy(n,e)?.label)}return a?e.fieldPath?`${a}.${e.fieldPath}`:a:r}function hfe(e){return e instanceof HTMLElement?e.getAttribute(`data-template`):null}function C8(e){return e.start+e.text.length}function w8(e,t){let n=[],r=0;function i(e){n.push(e),r+=e.text.length}function a(e){if(e instanceof Text){i({kind:`text`,node:e,start:r,text:e.data});return}if(!(e instanceof HTMLElement))return;let n=hfe(e);if(n!==null){i({kind:`badge`,node:e,start:r,text:n});return}if(!(e.hasAttribute(x8)||e.hasAttribute(S8))){if(e.tagName===`BR`){i({kind:`break`,node:e,start:r,text:t?`
100
+ `:``});return}for(let t of Array.from(e.childNodes))a(t)}}for(let t of Array.from(e.childNodes))a(t);return n}function T8(e,t){return w8(e,t).map(e=>e.text).join(``)}function gfe(e,t){let{catalog:n}=t,r=t.multiline??!1,i={focused:!1,nodes:[]};function a(e){let t=e.at(-1);return t?C8(t):0}function o(e,t,n){let r=e.find(e=>e.kind===`text`&&e.node===t);if(r)return r.start+Math.min(n,r.text.length);let i=e.find(e=>e.kind!==`text`&&e.node.contains(t));if(i)return n===0?i.start:C8(i);if(t instanceof HTMLElement){let r=Array.from(t.childNodes);for(let t of r.slice(n)){let n=e.find(e=>e.node===t||t.contains(e.node));if(n)return n.start}let i=e.findLast(e=>t.contains(e.node));return i?C8(i):a(e)}return a(e)}function s(e,t,n){let r=e.find(e=>e.kind===`badge`&&(t===`start`?e.start:C8(e))===n);return r?{end:C8(r),start:r.start}:null}function c(){let t=window.getSelection();if(!t||t.rangeCount===0)return null;let n=t.getRangeAt(0);if(!e.contains(n.endContainer))return null;let i=w8(e,r),a=o(i,n.endContainer,n.endOffset);return{badgeAfter:s(i,`start`,a),badgeBefore:s(i,`end`,a),collapsed:n.collapsed,offset:a}}function l(){document.activeElement!==e&&e.focus()}function u(e,t){let n=e.find(e=>e.kind===`badge`&&t>e.start&&t<C8(e));if(n)return u(e,n.start);let r=e.findLast(e=>e.kind===`text`&&e.start<=t&&t<=C8(e));return r?.kind===`text`?{node:r.node,offset:t-r.start}:null}function d(t){let n=w8(e,r),i=u(n,Math.max(0,Math.min(t,a(n))));if(!i){l();return}let o=document.createRange(),s=window.getSelection();try{o.setStart(i.node,i.offset),o.collapse(!0),s?.removeAllRanges(),s?.addRange(o),l()}catch{l()}}function f(){e.appendChild(document.createTextNode(``))}function p(t){if(!r){e.appendChild(document.createTextNode(t));return}let n=t.split(`
101
+ `);n.forEach((t,r)=>{t&&e.appendChild(document.createTextNode(t)),r<n.length-1&&(f(),e.appendChild(document.createElement(`br`)),f())})}function m(t,r){i=r;let a=r.focused?r.caretOffset??c()?.offset??null:null;if(e.innerHTML=``,!(t||r.focused)){let t=document.createElement(`span`);t.setAttribute(x8,``),t.className=`text-muted-foreground pointer-events-none`,t.textContent=r.placeholder??``,e.appendChild(t);return}for(let i of C4(t)){if(i.kind===`literal`){p(i.text);continue}let t=document.createElement(`span`);t.className=r.nodes.some(e=>e.id===i.token.nodeId)?ffe:pfe,t.contentEditable=`false`,t.setAttribute(`data-template`,i.token.raw),t.textContent=mfe(i.token,r.nodes,n),f(),e.appendChild(t),f()}if(!t){let t=document.createElement(`br`);t.setAttribute(S8,``),f(),e.appendChild(t)}r.focused&&a!==null&&d(a)}return{render:m,rerender(t){m(T8(e,r),{...i,nodes:t,caretOffset:void 0})},readText:()=>T8(e,r),readCaret:c,setCaretOffset:d,insertText(e){let t=window.getSelection();if(!t||t.rangeCount===0)return!1;let n=t.getRangeAt(0);n.deleteContents();let r=document.createTextNode(e);return n.insertNode(r),n.setStartAfter(r),n.collapse(!0),t.removeAllRanges(),t.addRange(n),!0},insertLineBreak(){let e=window.getSelection();if(!e||e.rangeCount===0)return!1;let t=e.getRangeAt(0);t.deleteContents();let n=document.createElement(`br`),r=document.createTextNode(``);return t.insertNode(n),n.parentNode?.insertBefore(r,n.nextSibling),n.parentNode?.insertBefore(document.createTextNode(``),n),t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!0}}}function E8(e){let t=(0,Z.c)(52),{value:n,onChange:r,placeholder:i,multiline:a}=e,o=ky(),s=_j(j4),c=(0,Y.useRef)(null),l=(0,Y.useRef)(null),u=(0,Y.useRef)(n),[d,f]=(0,Y.useState)(!1),[p,m]=(0,Y.useState)(!1),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h={top:0,left:0},t[0]=h):h=t[0];let[g,_]=(0,Y.useState)(h),[v,y]=(0,Y.useState)(``),[b,x]=(0,Y.useState)(null),S;t[1]!==o||t[2]!==a?(S=e=>{if(c.current=e,!e){l.current=null;return}l.current=gfe(e,{multiline:a,catalog:o})},t[1]=o,t[2]=a,t[3]=S):S=t[3];let C=S,w;t[4]!==d||t[5]!==s||t[6]!==i||t[7]!==n?(w=()=>{d||l.current?.render(n,{focused:!1,nodes:s,placeholder:i})},t[4]=d,t[5]=s,t[6]=i,t[7]=n,t[8]=w):w=t[8],UX(d?D8:n,w);let T;t[9]!==d||t[10]!==s?(T=()=>{d||l.current?.rerender(s)},t[9]=d,t[10]=s,t[11]=T):T=t[11],UX(d?D8:s,T);let E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(e,t)=>{let n=e.slice(0,t),r=n.lastIndexOf(`@`),i=r===-1?null:n.slice(r+1),a=S4(e).some(e=>r>=e.start&&r<e.end);if(i===null||a||i.includes(` `)){m(!1);return}y(i),x(r);let o=c.current?.getBoundingClientRect();o&&_({top:o.bottom+window.scrollY+4,left:o.left+window.scrollX}),m(!0)},t[12]=E):E=t[12];let D=E,O;t[13]!==s||t[14]!==r||t[15]!==i?(O=()=>{let e=l.current;if(!e)return;let t=e.readText();if(t===u.current)return;let n=S4(u.current).length,a=S4(t).length;if(u.current=t,r?.(t),n===a){D(t,e.readCaret()?.offset??t.length);return}m(!1),e.render(t,{focused:!0,nodes:s,placeholder:i})},t[13]=s,t[14]=r,t[15]=i,t[16]=O):O=t[16];let k=O,A;t[17]!==b||t[18]!==v||t[19]!==s||t[20]!==r||t[21]!==i?(A=e=>{let t=l.current;if(!t||b===null)return;let n=t.readText(),a=n.slice(0,b),o=n.slice(b+1+v.length),c=a+e+o;u.current=c,r?.(c),m(!1),x(null),f(!0),t.render(c,{caretOffset:a.length+e.length,focused:!0,nodes:s,placeholder:i})},t[17]=b,t[18]=v,t[19]=s,t[20]=r,t[21]=i,t[22]=A):A=t[22];let j=A,M;t[23]!==s||t[24]!==i||t[25]!==n?(M=()=>{f(!0);let e=l.current?.readText()??n;u.current=e,e||l.current?.render(``,{focused:!0,nodes:s,placeholder:i})},t[23]=s,t[24]=i,t[25]=n,t[26]=M):M=t[26];let N=M,P;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{setTimeout(()=>{document.activeElement!==c.current&&(f(!1),m(!1))},_fe)},t[27]=P):P=t[27];let F=P,I;t[28]===k?I=t[29]:(I=e=>{e.preventDefault(),l.current?.insertText(e.clipboardData.getData(`text/plain`))&&k()},t[28]=k,t[29]=I);let L=I,R;t[30]===k?R=t[31]:(R=()=>{l.current?.insertLineBreak()&&k()},t[30]=k,t[31]=R);let z=R,B;t[32]!==s||t[33]!==r||t[34]!==i?(B=e=>{let t=l.current;if(!t)return;let n=t.readText(),a=n.slice(0,e.start)+n.slice(e.end);u.current=a,r?.(a),m(!1),t.render(a,{caretOffset:e.start,focused:!0,nodes:s,placeholder:i})},t[32]=s,t[33]=r,t[34]=i,t[35]=B):B=t[35];let V=B,H;t[36]!==z||t[37]!==a||t[38]!==V?(H=e=>{let t=l.current;if(!t)return;if(a&&e.key===`Enter`){e.preventDefault(),z();return}if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let n=e.key===`Backspace`||e.key===`ArrowLeft`,r=e.key===`Delete`||e.key===`ArrowRight`;if(!(n||r))return;let i=t.readCaret();if(!i?.collapsed)return;let o=n?i.badgeBefore:i.badgeAfter;o&&(e.preventDefault(),e.key===`ArrowLeft`?t.setCaretOffset(o.start):e.key===`ArrowRight`?t.setCaretOffset(o.end):V(o))},t[36]=z,t[37]=a,t[38]=V,t[39]=H):H=t[39];let U=H,W;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(W=()=>m(!1),t[40]=W):W=t[40];let G;return t[41]!==C||t[42]!==v||t[43]!==g||t[44]!==j||t[45]!==N||t[46]!==k||t[47]!==U||t[48]!==L||t[49]!==s||t[50]!==p?(G={attachEditor:C,autocompleteFilter:v,autocompletePosition:g,handleBlur:F,handleFocus:N,handleInput:k,handleAutocompleteSelect:j,handleKeyDown:U,handlePaste:L,closeAutocomplete:W,nodes:s,showAutocomplete:p},t[41]=C,t[42]=v,t[43]=g,t[44]=j,t[45]=N,t[46]=k,t[47]=U,t[48]=L,t[49]=s,t[50]=p,t[51]=G):G=t[51],G}var D8=Symbol(`focused`),_fe=200;function O8(e){let t=(0,Z.c)(38),{value:n,onChange:r,placeholder:i,disabled:a,className:o,id:s,fieldType:c,currentNodeId:l,labelledBy:u,ariaLabel:d,required:f,invalid:p}=e,m=n===void 0?``:n,h;t[0]!==r||t[1]!==i||t[2]!==m?(h={value:m,onChange:r,placeholder:i},t[0]=r,t[1]=i,t[2]=m,t[3]=h):h=t[3];let{attachEditor:g,autocompleteFilter:_,autocompletePosition:v,closeAutocomplete:y,handleAutocompleteSelect:b,handleBlur:x,handleFocus:S,handleInput:C,handleKeyDown:w,handlePaste:T,nodes:E,showAutocomplete:D}=E8(h),O;t[4]===E?O=t[5]:(O=E.find(vfe)?.id,t[4]=E,t[5]=O);let k=O,A=p&&`border-destructive focus-within:border-destructive focus-within:ring-destructive/20`,j=a&&`cursor-not-allowed opacity-50`,M;t[6]!==o||t[7]!==A||t[8]!==j?(M=Kv(`flex min-h-9 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-colors focus-within:border-ring focus-within:outline-none focus-within:ring-[3px] focus-within:ring-ring/50 lg:text-sm`,A,j,o),t[6]=o,t[7]=A,t[8]=j,t[9]=M):M=t[9];let N=p||void 0,P=p||void 0,F=f||void 0,I=!a,L;t[10]!==d||t[11]!==g||t[12]!==x||t[13]!==S||t[14]!==C||t[15]!==w||t[16]!==T||t[17]!==s||t[18]!==u||t[19]!==I||t[20]!==P||t[21]!==F?(L=(0,X.jsx)(`div`,{"aria-invalid":P,"aria-label":d,"aria-labelledby":u,"aria-required":F,className:`w-full outline-none`,contentEditable:I,id:s,onBlur:x,onFocus:S,onInput:C,onKeyDown:w,onPaste:T,ref:g,role:`textbox`,suppressContentEditableWarning:!0}),t[10]=d,t[11]=g,t[12]=x,t[13]=S,t[14]=C,t[15]=w,t[16]=T,t[17]=s,t[18]=u,t[19]=I,t[20]=P,t[21]=F,t[22]=L):L=t[22];let R;t[23]!==L||t[24]!==M||t[25]!==N?(R=(0,X.jsx)(`div`,{className:M,"data-invalid":N,children:L}),t[23]=L,t[24]=M,t[25]=N,t[26]=R):R=t[26];let z=l??k??void 0,B;t[27]!==_||t[28]!==v||t[29]!==y||t[30]!==c||t[31]!==b||t[32]!==D||t[33]!==z?(B=(0,X.jsx)(b8,{currentNodeId:z,fieldType:c,filter:_,isOpen:D,onClose:y,onSelect:b,position:v}),t[27]=_,t[28]=v,t[29]=y,t[30]=c,t[31]=b,t[32]=D,t[33]=z,t[34]=B):B=t[34];let V;return t[35]!==R||t[36]!==B?(V=(0,X.jsxs)(X.Fragment,{children:[R,B]}),t[35]=R,t[36]=B,t[37]=V):V=t[37],V}function vfe(e){return e.selected}var yfe=[{label:`North America`,zones:[{value:`America/New_York`,label:`Eastern Time (ET)`},{value:`America/Chicago`,label:`Central Time (CT)`},{value:`America/Denver`,label:`Mountain Time (MT)`},{value:`America/Phoenix`,label:`Arizona Time (MST)`},{value:`America/Los_Angeles`,label:`Pacific Time (PT)`},{value:`America/Anchorage`,label:`Alaska Time (AKT)`},{value:`Pacific/Honolulu`,label:`Hawaii Time (HST)`},{value:`America/Toronto`,label:`Toronto`},{value:`America/Vancouver`,label:`Vancouver`}]},{label:`Europe`,zones:[{value:`Europe/London`,label:`London (GMT/BST)`},{value:`Europe/Paris`,label:`Paris (CET/CEST)`},{value:`Europe/Berlin`,label:`Berlin (CET/CEST)`},{value:`Europe/Rome`,label:`Rome (CET/CEST)`},{value:`Europe/Madrid`,label:`Madrid (CET/CEST)`},{value:`Europe/Amsterdam`,label:`Amsterdam (CET/CEST)`},{value:`Europe/Brussels`,label:`Brussels (CET/CEST)`},{value:`Europe/Stockholm`,label:`Stockholm (CET/CEST)`},{value:`Europe/Warsaw`,label:`Warsaw (CET/CEST)`},{value:`Europe/Athens`,label:`Athens (EET/EEST)`},{value:`Europe/Moscow`,label:`Moscow (MSK)`}]},{label:`Asia`,zones:[{value:`Asia/Dubai`,label:`Dubai (GST)`},{value:`Asia/Kolkata`,label:`India (IST)`},{value:`Asia/Shanghai`,label:`China (CST)`},{value:`Asia/Hong_Kong`,label:`Hong Kong (HKT)`},{value:`Asia/Tokyo`,label:`Tokyo (JST)`},{value:`Asia/Seoul`,label:`Seoul (KST)`},{value:`Asia/Singapore`,label:`Singapore (SGT)`},{value:`Asia/Bangkok`,label:`Bangkok (ICT)`},{value:`Asia/Jakarta`,label:`Jakarta (WIB)`}]},{label:`Australia & Pacific`,zones:[{value:`Australia/Sydney`,label:`Sydney (AEDT/AEST)`},{value:`Australia/Melbourne`,label:`Melbourne (AEDT/AEST)`},{value:`Australia/Brisbane`,label:`Brisbane (AEST)`},{value:`Australia/Perth`,label:`Perth (AWST)`},{value:`Pacific/Auckland`,label:`Auckland (NZDT/NZST)`}]},{label:`South America`,zones:[{value:`America/Sao_Paulo`,label:`São Paulo (BRT)`},{value:`America/Argentina/Buenos_Aires`,label:`Buenos Aires (ART)`},{value:`America/Santiago`,label:`Santiago (CLT)`},{value:`America/Bogota`,label:`Bogotá (COT)`},{value:`America/Lima`,label:`Lima (PET)`}]},{label:`Africa & Middle East`,zones:[{value:`Africa/Cairo`,label:`Cairo (EET)`},{value:`Africa/Johannesburg`,label:`Johannesburg (SAST)`},{value:`Africa/Lagos`,label:`Lagos (WAT)`},{value:`Africa/Nairobi`,label:`Nairobi (EAT)`},{value:`Asia/Jerusalem`,label:`Jerusalem (IST)`}]},{label:`Other`,zones:[{value:`UTC`,label:`UTC (Coordinated Universal Time)`}]}];function bfe(e){let t=(0,Z.c)(11),{value:n,onValueChange:r,disabled:i,id:a}=e,o;t[0]===r?o=t[1]:(o=C6(r),t[0]=r,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(T6,{placeholder:`Select timezone`}),t[2]=s):s=t[2];let c;t[3]===a?c=t[4]:(c=(0,X.jsx)(E6,{className:`w-full`,id:a,children:s}),t[3]=a,t[4]=c);let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,X.jsx)(D6,{children:yfe.map(xfe)}),t[5]=l):l=t[5];let u;return t[6]!==i||t[7]!==o||t[8]!==c||t[9]!==n?(u=(0,X.jsxs)(S6,{disabled:i,onValueChange:o,value:n,children:[c,l]}),t[6]=i,t[7]=o,t[8]=c,t[9]=n,t[10]=u):u=t[10],u}function xfe(e){return(0,X.jsxs)(w6,{children:[(0,X.jsx)(O6,{children:e.label}),e.zones.map(Sfe)]},e.label)}function Sfe(e){return(0,X.jsx)(k6,{value:e.value,children:e.label},e.value)}var k8=Y.createContext(void 0);function A8(e){let t=Y.useContext(k8);if(t===void 0&&!e)throw Error(Jg(72));return t}var Cfe={...fY,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},wfe=class extends LJ{constructor(e,t,n){let r=new rY;super(Tfe(e,r,t,n),Efe(r),Cfe)}setOpen=(e,t)=>{ZJ(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,QU(NU,e))}};function Tfe(e,t,n,r=!1){let i={...aY(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e};return i.floatingRootContext=oY(t,n,r),i}function Efe(e){return{popupRef:Y.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var Dfe=OJ(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=KJ((e,t)=>new wfe({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),$J(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=eY(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=Y.useRef(null);Q(()=>{m&&t&&p.setOpen(!1,QU(YU))},[m,t,p]),Q(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),Q(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),Y.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,QU(XU))}),[y,p]);let T=h||_||!t&&a!==`none`;return(0,X.jsxs)(k8.Provider,{value:p,children:[l&&(0,X.jsx)(qJ,{handle:l,store:p}),T&&(0,X.jsx)(Ofe,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function Ofe({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=bq(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=_q(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=Y.useMemo(()=>Rg(a.reference,i.reference),[a.reference,i.reference]);return tY(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??c_}),null}var j8=Y.createContext(void 0);function kfe(){return Y.useContext(j8)}var M8=`data-base-ui-tooltip-trigger`;function N8(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(cg(n))return n}}let t=e.target;return cg(t)?t:null}function Afe(e){let t=e;for(;t;){let e=t.closest(`[${M8}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&cg(n.host)?n.host:null}return null}var jfe=kJ(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=A8(!0),m=pY(a)??p;if(!m)throw Error(Jg(82));let h=aW(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=Y.useRef(null),b=c??600,x=u??0,{registerTrigger:S,isMountedByThisTrigger:C}=QJ(h,y,m,{payload:o,closeOnClick:l,closeDelay:x}),w=kfe(),{delayRef:T,isInstantPhase:E,hasProvider:D}=rG(v,{open:_}),O=CY(v);m.useSyncedValue(`isInstantPhase`,E);let k=m.useState(`disabled`),A=s??k,j=oG(A),M=m.useState(`trackCursorAxis`),N=m.useState(`disableHoverablePopup`),P=Y.useRef(!1),F=uW(),I=Y.useRef(void 0);function L(){return D?XW(T.current,`open`)===0?0:c??w??600:b}function R(e){let t=y.current;if(!t||!e)return!1;let n=Afe(e);return n!==null&&n!==t&&zW(t,n)}function z(e){let t=R(e);return P.current=t,t&&(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,F.clear()),t}let B=EY(v,{enabled:!A,mouseOnly:!0,move:!1,handleClose:!N&&M!==`both`?UY():null,restMs:L,delay(){return u==null&&D?{close:XW(T.current,`close`)}:{close:x}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!P.current}}),V=vY(v,{enabled:!A}).reference,H=e=>{let t=P.current,n=N8(e),r=z(n),i=y.current,a=i&&n&&zW(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,QU(PU,e));return}if(t&&!r&&a&&!j.current&&!m.select(`open`)&&i&&AW(I.current)){let t=()=>{!P.current&&!j.current&&!m.select(`open`)&&m.setOpen(!0,QU(PU,e,i))},n=L();n===0?(F.clear(),t()):F.start(n,t)}},U=m.useState(`triggerProps`,C);return l_(`button`,e,{state:{open:_},ref:[t,S,y],props:[B,V,C||M!==`none`?U:void 0,{onMouseOver(e){H(e.nativeEvent)},onFocus(e){R(N8(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){P.current=!1,F.clear(),I.current=void 0},onPointerEnter(e){I.current=e.pointerType},onPointerDown(e){I.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,"data-trigger-disabled":A?``:void 0,[M8]:A?void 0:``},f],stateAttributesMapping:DU})}),P8=Y.createContext(void 0);function Mfe(){let e=Y.useContext(P8);if(e===void 0)throw Error(Jg(70));return e}var Nfe=Y.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=qK({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,X.jsxs)(Y.Fragment,{children:[l,c&&Xi.createPortal(n,c)]})}),Pfe=Y.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return A8().useState(`mounted`)||n?(0,X.jsx)(P8.Provider,{value:n,children:(0,X.jsx)(Nfe,{ref:t,...r})}):null}),F8=Y.createContext(void 0);function I8(){let e=Y.useContext(F8);if(e===void 0)throw Error(Jg(71));return e}var Ffe=Y.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=HK,style:g,..._}=e,v=A8(),y=Mfe(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=Z3({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),O=i6(e,Y.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,X.jsx)(F8.Provider,{value:D,children:O})}),Ife=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=A8(),{side:s,align:c}=I8(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);UJ({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),wY(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return l_(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[WJ,f,r6(d),a],stateAttributesMapping:AU})}),Lfe=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=A8(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=I8();return l_(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:kU})}),Rfe=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=Y.useMemo(()=>({open:t,close:n}),[t,n]);return(0,X.jsx)(j8.Provider,{value:t,children:(0,X.jsx)(nG,{delay:i,timeoutMs:r,children:e.children})})};function L8(e){let t=(0,Z.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delayDuration:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,X.jsx)(Rfe,{closeDelay:0,"data-slot":`tooltip-provider`,delay:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function R8(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(L8,{children:(0,X.jsx)(Dfe,{"data-slot":`tooltip`,...n})}),t[2]=n,t[3]=r),r}function z8(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(jfe,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function B8(e){let t=(0,Z.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,sideOffset:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?0:a,s;t[5]===r?s=t[6]:(s=Kv(`data-[starting-style]:fade-in-0 data-[starting-style]:zoom-in-95 data-[ending-style]:fade-out-0 data-[ending-style]: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 z-50 w-fit origin-(--transform-origin) text-balance rounded-md bg-foreground px-3 py-1.5 text-background text-xs data-[closed]:animate-out data-[open]:animate-in`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(Lfe,{className:`z-50 size-2.5 rotate-45 rounded-[2px] bg-foreground`}),t[7]=c):c=t[7];let l;t[8]!==n||t[9]!==s?(l=(0,X.jsxs)(Ife,{className:s,"data-slot":`tooltip-content`,children:[n,c]}),t[8]=n,t[9]=s,t[10]=l):l=t[10];let u;return t[11]!==i||t[12]!==o||t[13]!==l?(u=(0,X.jsx)(Pfe,{children:(0,X.jsx)(Ffe,{sideOffset:o,...i,children:l})}),t[11]=i,t[12]=o,t[13]=l,t[14]=u):u=t[14],u}var zfe=[];function V8(e){let t=(0,Z.c)(5),n=ky(),r=_j(j4),i=_j(M4),a;return t[0]!==n||t[1]!==i||t[2]!==e||t[3]!==r?(a=e?p8({targetNodeId:e,nodes:r,edges:i,catalog:n}):zfe,t[0]=n,t[1]=i,t[2]=e,t[3]=r,t[4]=a):a=t[4],a}var H8=Eh({event:Wh,match:_h(Sh)}),Bfe=Ah(kh(H8)).check(Bh(1)),Vfe=Eh({waitMode:_h(Nh([`delay`,`event`])),waitFor:_h(Bfe),waitTimeout:_h(Sh),waitTimeoutBehavior:_h(Nh([`continue`,`skip`])),waitDuration:_h(Sh),waitUntil:_h(Sh),waitOffset:_h(Sh),waitGateMode:_h(Nh([`off`,`require_actual_wait`])),waitAllowedHoursMode:_h(Sh),waitAllowedStartTime:_h(Sh),waitAllowedEndTime:_h(Sh),waitTimezone:_h(Sh)}),U8={waitDuration:{type:`duration`,required:!0,owner:{mode:`delay`,timing:`duration`}},waitUntil:{type:`timestamp`,required:!0,owner:{mode:`delay`,timing:`until`}},waitOffset:{type:`duration`,required:!1,owner:{mode:`delay`,timing:`until`}},waitTimeout:{type:`duration`,required:!0,owner:{mode:`event`}}},W8=[`waitDuration`,`waitUntil`,`waitOffset`,`waitTimeout`];function G8(e){let t=e.waitDelayTimingMode;return t===`until`||t===`duration`?t:typeof e.waitUntil==`string`&&e.waitUntil.trim()?`until`:`duration`}function Hfe(e){let t=e.waitMode===`event`?`event`:`delay`,n=G8(e);return W8.filter(e=>{let{owner:r}=U8[e];return r.mode===`event`?t===`event`:t===`delay`&&r.timing===n})}function K8(e){let t=new Set(Hfe(e));return W8.filter(e=>!t.has(e))}lh(Vfe);var Ufe=Jh(Ah(kh(H8)));function q8(e){return Ufe(e?.waitFor)??[]}function Wfe(e){let t=(0,Z.c)(40),{value:n,onChange:r,placeholder:i,disabled:a,className:o,id:s,rows:c,fieldType:l,labelledBy:u,required:d,invalid:f}=e,p=n===void 0?``:n,m=c===void 0?3:c,h;t[0]!==r||t[1]!==i||t[2]!==p?(h={value:p,onChange:r,placeholder:i,multiline:!0},t[0]=r,t[1]=i,t[2]=p,t[3]=h):h=t[3];let{attachEditor:g,autocompleteFilter:_,autocompletePosition:v,closeAutocomplete:y,handleAutocompleteSelect:b,handleBlur:x,handleFocus:S,handleInput:C,handleKeyDown:w,handlePaste:T,nodes:E,showAutocomplete:D}=E8(h),O;t[4]===E?O=t[5]:(O=E.find(Gfe)?.id,t[4]=E,t[5]=O);let k=O,A=f&&`border-destructive focus-within:border-destructive focus-within:ring-destructive/20`,j=a&&`cursor-not-allowed opacity-50`,M;t[6]!==o||t[7]!==A||t[8]!==j?(M=Kv(`flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-colors focus-within:border-ring focus-within:outline-none focus-within:ring-[3px] focus-within:ring-ring/50 lg:text-sm`,A,j,o),t[6]=o,t[7]=A,t[8]=j,t[9]=M):M=t[9];let N=f||void 0,P=`${m*1.5}rem`,F;t[10]===P?F=t[11]:(F={minHeight:P},t[10]=P,t[11]=F);let I=f||void 0,L=d||void 0,R=!a,z;t[12]!==g||t[13]!==x||t[14]!==S||t[15]!==C||t[16]!==w||t[17]!==T||t[18]!==s||t[19]!==u||t[20]!==I||t[21]!==L||t[22]!==R?(z=(0,X.jsx)(`div`,{"aria-invalid":I,"aria-labelledby":u,"aria-required":L,className:`w-full whitespace-pre-wrap break-words outline-none`,contentEditable:R,id:s,onBlur:x,onFocus:S,onInput:C,onKeyDown:w,onPaste:T,ref:g,role:`textbox`,suppressContentEditableWarning:!0}),t[12]=g,t[13]=x,t[14]=S,t[15]=C,t[16]=w,t[17]=T,t[18]=s,t[19]=u,t[20]=I,t[21]=L,t[22]=R,t[23]=z):z=t[23];let B;t[24]!==F||t[25]!==z||t[26]!==M||t[27]!==N?(B=(0,X.jsx)(`div`,{className:M,"data-invalid":N,style:F,children:z}),t[24]=F,t[25]=z,t[26]=M,t[27]=N,t[28]=B):B=t[28];let V=k||void 0,H;t[29]!==_||t[30]!==v||t[31]!==y||t[32]!==l||t[33]!==b||t[34]!==D||t[35]!==V?(H=(0,X.jsx)(b8,{currentNodeId:V,fieldType:l,filter:_,isOpen:D,onClose:y,onSelect:b,position:v}),t[29]=_,t[30]=v,t[31]=y,t[32]=l,t[33]=b,t[34]=D,t[35]=V,t[36]=H):H=t[36];let U;return t[37]!==B||t[38]!==H?(U=(0,X.jsxs)(X.Fragment,{children:[B,H]}),t[37]=B,t[38]=H,t[39]=U):U=t[39],U}function Gfe(e){return e.selected}function J8(e){return e.type===`group`}function Kfe(e){let t=[];for(let n of e)J8(n)?t.push(...n.fields):t.push(n);return t}function qfe(e){let t=(0,Z.c)(8),{field:n,value:r,onChange:i,disabled:a}=e,o=n.label?`${n.key}-label`:void 0,s=typeof r==`string`?r:``,c;return t[0]!==a||t[1]!==n.key||t[2]!==n.placeholder||t[3]!==n.required||t[4]!==i||t[5]!==o||t[6]!==s?(c=(0,X.jsx)(O8,{disabled:a,id:n.key,labelledBy:o,onChange:i,placeholder:n.placeholder,required:n.required,value:s}),t[0]=a,t[1]=n.key,t[2]=n.placeholder,t[3]=n.required,t[4]=i,t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function Jfe(e){let t=(0,Z.c)(9),{field:n,value:r,onChange:i,disabled:a}=e,o=n.label?`${n.key}-label`:void 0,s=n.rows||4,c=typeof r==`string`?r:``,l;return t[0]!==a||t[1]!==n.key||t[2]!==n.placeholder||t[3]!==n.required||t[4]!==i||t[5]!==o||t[6]!==s||t[7]!==c?(l=(0,X.jsx)(Wfe,{disabled:a,id:n.key,labelledBy:o,onChange:i,placeholder:n.placeholder,required:n.required,rows:s,value:c}),t[0]=a,t[1]=n.key,t[2]=n.placeholder,t[3]=n.required,t[4]=i,t[5]=o,t[6]=s,t[7]=c,t[8]=l):l=t[8],l}function Yfe(e){let t=(0,Z.c)(8),{field:n,value:r,onChange:i,disabled:a}=e,o;t[0]===i?o=t[1]:(o=e=>i(e.target.value),t[0]=i,t[1]=o);let s=typeof r==`string`?r:``,c;return t[2]!==a||t[3]!==n.key||t[4]!==n.placeholder||t[5]!==o||t[6]!==s?(c=(0,X.jsx)(JZ,{disabled:a,id:n.key,onChange:o,placeholder:n.placeholder,value:s}),t[2]=a,t[3]=n.key,t[4]=n.placeholder,t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function Xfe(e){let t=(0,Z.c)(9),{field:n,value:r,onChange:i,disabled:a}=e,o=typeof r==`number`||typeof r==`string`?`${r}`:``,s;t[0]===i?s=t[1]:(s=e=>{let t=e.target.value.trim();if(!t){i(void 0);return}let n=Number.parseFloat(t);Number.isFinite(n)&&i(n)},t[0]=i,t[1]=s);let c;return t[2]!==a||t[3]!==o||t[4]!==n.key||t[5]!==n.min||t[6]!==n.placeholder||t[7]!==s?(c=(0,X.jsx)(JZ,{disabled:a,id:n.key,min:n.min,onChange:s,placeholder:n.placeholder,type:`number`,value:o}),t[2]=a,t[3]=o,t[4]=n.key,t[5]=n.min,t[6]=n.placeholder,t[7]=s,t[8]=c):c=t[8],c}function Zfe(e){let t=(0,Z.c)(15),{field:n,value:r,onChange:i,disabled:a}=e;if(!n.options)return null;let o=typeof r==`string`?r:``,s;t[0]===n.placeholder?s=t[1]:(s=(0,X.jsx)(T6,{placeholder:n.placeholder}),t[0]=n.placeholder,t[1]=s);let c;t[2]!==n.key||t[3]!==s?(c=(0,X.jsx)(E6,{className:`w-full`,id:n.key,children:s}),t[2]=n.key,t[3]=s,t[4]=c):c=t[4];let l;t[5]===n.options?l=t[6]:(l=n.options.map(Qfe),t[5]=n.options,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,X.jsx)(D6,{children:l}),t[7]=l,t[8]=u);let d;return t[9]!==a||t[10]!==i||t[11]!==o||t[12]!==c||t[13]!==u?(d=(0,X.jsxs)(S6,{disabled:a,onValueChange:i,value:o,children:[c,u]}),t[9]=a,t[10]=i,t[11]=o,t[12]=c,t[13]=u,t[14]=d):d=t[14],d}function Qfe(e){return(0,X.jsx)(k6,{value:e.value,children:e.label},e.value)}var $fe=0;function Y8(){return`kv-${++$fe}`}function epe(e){return typeof e!=`object`||!e||!(`name`in e&&`value`in e)?!1:typeof e.name==`string`&&typeof e.value==`string`}function tpe(e){if(typeof e!=`string`||!e)return[];try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(epe)}catch{}return[]}function npe(e){let t=(0,Z.c)(29),{value:n,onChange:r,disabled:i}=e,a;t[0]===n?a=t[1]:(a=()=>tpe(n).map(ipe),t[0]=n,t[1]=a);let[o,s]=(0,Y.useState)(a),c;t[2]===r?c=t[3]:(c=function(e){s(e),r(JSON.stringify(e.map(rpe)))},t[2]=r,t[3]=c);let l=c,u;t[4]!==o||t[5]!==l?(u=function(){l([...o,{name:``,value:``,_id:Y8()}])},t[4]=o,t[5]=l,t[6]=u):u=t[6];let d=u,f;t[7]!==o||t[8]!==l?(f=function(e){l(o.filter(t=>t._id!==e))},t[7]=o,t[8]=l,t[9]=f):f=t[9];let p=f,m;t[10]!==o||t[11]!==l?(m=function(e,t,n){l(o.map(r=>r._id===e?{...r,[t]:n}:r))},t[10]=o,t[11]=l,t[12]=m):m=t[12];let h=m,g;if(t[13]!==i||t[14]!==p||t[15]!==o||t[16]!==h){let e;t[18]!==i||t[19]!==p||t[20]!==h?(e=e=>(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(JZ,{className:`flex-1`,disabled:i,onChange:t=>h(e._id,`name`,t.target.value),placeholder:`Name`,value:e.name}),(0,X.jsx)(O8,{ariaLabel:`Value`,className:`flex-1`,disabled:i,onChange:t=>h(e._id,`value`,t??``),placeholder:`Value`,value:e.value}),(0,X.jsx)(Jv,{className:`size-8 shrink-0`,disabled:i,onClick:()=>p(e._id),size:`icon`,type:`button`,variant:`ghost`,children:(0,X.jsx)(Ty,{className:`size-4`})})]},e._id),t[18]=i,t[19]=p,t[20]=h,t[21]=e):e=t[21],g=o.map(e),t[13]=i,t[14]=p,t[15]=o,t[16]=h,t[17]=g}else g=t[17];let _;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,X.jsx)(yy,{className:`mr-1 size-3.5`}),t[22]=_):_=t[22];let v;t[23]!==d||t[24]!==i?(v=(0,X.jsxs)(Jv,{className:`h-8`,disabled:i,onClick:d,size:`sm`,type:`button`,variant:`outline`,children:[_,`Add`]}),t[23]=d,t[24]=i,t[25]=v):v=t[25];let y;return t[26]!==g||t[27]!==v?(y=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[g,v]}),t[26]=g,t[27]=v,t[28]=y):y=t[28],y}function rpe(e){let{name:t,value:n}=e;return{name:t,value:n}}function ipe(e){return{...e,_id:Y8()}}var ape={"template-input":qfe,"template-textarea":Jfe,text:Yfe,number:Xfe,select:Zfe,"key-value":npe};function X8(e,t,n,r){if(!b4(t,e.showWhen))return null;let i=t[e.key]??e.defaultValue??``,a=ape[e.type];return(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e.label&&(0,X.jsxs)(YZ,{className:`ml-1`,htmlFor:e.key,id:`${e.key}-label`,children:[e.label,e.required&&(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`text-destructive`,children:`*`})]}),(0,X.jsx)(a,{disabled:r,field:e,onChange:t=>n({[e.key]:t}),value:i})]},e.key)}function ope(e){let t=(0,Z.c)(19),{label:n,fields:r,config:i,onUpdateConfig:a,disabled:o,defaultExpanded:s}=e,[c,l]=(0,Y.useState)(s!==void 0&&s),u;t[0]===c?u=t[1]:(u=()=>l(!c),t[0]=c,t[1]=u);let d;t[2]===n?d=t[3]:(d=(0,X.jsx)(`span`,{className:`font-medium text-sm`,children:n}),t[2]=n,t[3]=d);let f=`size-3.5 text-muted-foreground transition-transform duration-200 ${c?``:`-rotate-90`}`,p;t[4]===f?p=t[5]:(p=(0,X.jsx)(ay,{className:f}),t[4]=f,t[5]=p);let m;t[6]!==u||t[7]!==d||t[8]!==p?(m=(0,X.jsxs)(`button`,{className:`ml-1 flex items-center gap-1 text-left`,onClick:u,type:`button`,children:[d,p]}),t[6]=u,t[7]=d,t[8]=p,t[9]=m):m=t[9];let h;t[10]!==i||t[11]!==o||t[12]!==r||t[13]!==c||t[14]!==a?(h=c&&(0,X.jsx)(`div`,{className:`ml-1 space-y-4 border-primary/50 border-l-2 py-2 pl-3`,children:r.map(e=>X8(e,i,a,o))}),t[10]=i,t[11]=o,t[12]=r,t[13]=c,t[14]=a,t[15]=h):h=t[15];let g;return t[16]!==m||t[17]!==h?(g=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[m,h]}),t[16]=m,t[17]=h,t[18]=g):g=t[18],g}function spe(e){let t=(0,Z.c)(11),{fields:n,config:r,onUpdateConfig:i,disabled:a}=e,o;if(t[0]!==r||t[1]!==a||t[2]!==n||t[3]!==i){let e;t[5]!==r||t[6]!==a||t[7]!==i?(e=e=>J8(e)?(0,X.jsx)(ope,{config:r,defaultExpanded:e.defaultExpanded,disabled:a,fields:e.fields,label:e.label,onUpdateConfig:i},`group-${e.label}`):X8(e,r,i,a),t[5]=r,t[6]=a,t[7]=i,t[8]=e):e=t[8],o=n.map(e),t[0]=r,t[1]=a,t[2]=n,t[3]=i,t[4]=o}else o=t[4];let s;return t[9]===o?s=t[10]:(s=(0,X.jsx)(X.Fragment,{children:o}),t[9]=o,t[10]=s),s}var cpe=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,Z8=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=cpe[n[e]&63];return t};function lpe(e){return e===`within_next`||e===`more_than_from_now`||e===`less_than_ago`||e===`more_than_ago`}function upe(e){return e===`before`||e===`after`}function dpe(e){return e===`equals`||e===`not_equals`||e===`contains`}function fpe(e){return e===`equals`||e===`not_equals`||e===`greater_than`||e===`greater_or_equal`||e===`less_than`||e===`less_or_equal`}function ppe(e){return e===`is_true`||e===`is_false`}function mpe(e){return I6.some(t=>t.value===e)}function hpe(e,t){let n=t?pde:[];return e===`timestamp`?[...lde,...n]:e===`string`?[...ude,...n]:e===`number`?[...dde,...n]:[...fde,...n]}function gpe(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,16)}function _pe(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toISOString()}function vpe(e){return F6(e,{groupId:Z8(),conditionId:Z8()})}function Q8(e){return P6(e,Z8())}function ype(e){let{condition:t,operatorValue:n}=e;return lpe(n)?{id:t.id,field:t.field,fieldType:`timestamp`,operator:n,amount:j6(t)?t.amount:1,unit:j6(t)?t.unit:`days`}:upe(n)?{id:t.id,field:t.field,fieldType:`timestamp`,operator:n,dateTime:M6(t)?t.dateTime:new Date().toISOString()}:null}function bpe(e){return e===`is_set`||e===`is_not_set`}function xpe(e,t){let n={id:e.id,field:e.field};if(bpe(t))return{...n,fieldType:e.fieldType,operator:t};if(e.fieldType===`timestamp`)return ype({condition:N6(e)?{...n,fieldType:`timestamp`,operator:`within_next`,amount:1,unit:`days`}:e,operatorValue:t});if(e.fieldType===`string`){if(!dpe(t))return null;let r=!N6(e)&&`value`in e?e.value:``;return{...n,fieldType:`string`,operator:t,value:r}}if(e.fieldType===`number`){if(!fpe(t))return null;let r=!N6(e)&&`value`in e?e.value:0;return{...n,fieldType:`number`,operator:t,value:r}}return ppe(t)?{...n,fieldType:`boolean`,operator:t}:null}function $8(e){let t=(0,Z.c)(6),{value:n,onChange:r,disabled:i}=e,a;t[0]!==i||t[1]!==r||t[2]!==n?(a=cde.map(e=>{let t=e.value===n;return(0,X.jsx)(`button`,{className:`rounded-full px-3 py-1 font-medium text-xs transition-colors ${t?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground`}`,disabled:i,onClick:()=>r(e.value),type:`button`,children:e.label},e.value)}),t[0]=i,t[1]=r,t[2]=n,t[3]=a):a=t[3];let o;return t[4]===a?o=t[5]:(o=(0,X.jsx)(`div`,{className:`inline-flex items-center rounded-full border bg-card p-0.5`,children:a}),t[4]=a,t[5]=o),o}function Spe(e){let t=(0,Z.c)(56),{condition:n,disabled:r,currentNodeId:i,enumValues:a,onConditionChange:o}=e;if(N6(n))return null;if(n.fieldType===`timestamp`){if(j6(n)){let e;t[0]!==n||t[1]!==o?(e=e=>{let t=Number.parseInt(e.target.value,10);o({...n,amount:Number.isNaN(t)?1:Math.max(t,1)})},t[0]=n,t[1]=o,t[2]=e):e=t[2];let i;t[3]!==n.amount||t[4]!==r||t[5]!==e?(i=(0,X.jsx)(JZ,{className:`w-24`,disabled:r,min:1,onChange:e,type:`number`,value:n.amount}),t[3]=n.amount,t[4]=r,t[5]=e,t[6]=i):i=t[6];let a;t[7]!==n||t[8]!==o?(a=C6(e=>{mpe(e)&&o({...n,unit:e})}),t[7]=n,t[8]=o,t[9]=a):a=t[9];let s;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(E6,{className:`w-36`,children:(0,X.jsx)(T6,{})}),t[10]=s):s=t[10];let c;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(D6,{children:I6.map(wpe)}),t[11]=c):c=t[11];let l;t[12]!==n.unit||t[13]!==r||t[14]!==a?(l=(0,X.jsxs)(S6,{disabled:r,onValueChange:a,value:n.unit,children:[s,c]}),t[12]=n.unit,t[13]=r,t[14]=a,t[15]=l):l=t[15];let u;return t[16]!==i||t[17]!==l?(u=(0,X.jsxs)(X.Fragment,{children:[i,l]}),t[16]=i,t[17]=l,t[18]=u):u=t[18],u}let e;t[19]!==n||t[20]!==o?(e=e=>{M6(n)&&o({...n,dateTime:_pe(e.target.value)})},t[19]=n,t[20]=o,t[21]=e):e=t[21];let i;t[22]===n?i=t[23]:(i=M6(n)?gpe(n.dateTime):``,t[22]=n,t[23]=i);let a;return t[24]!==r||t[25]!==e||t[26]!==i?(a=(0,X.jsx)(JZ,{disabled:r,onChange:e,type:`datetime-local`,value:i}),t[24]=r,t[25]=e,t[26]=i,t[27]=a):a=t[27],a}if(n.fieldType===`string`){if(a&&a.length>0&&(n.operator===`equals`||n.operator===`not_equals`)){let e;t[28]!==n||t[29]!==o?(e=C6(e=>{o({...n,value:e})}),t[28]=n,t[29]=o,t[30]=e):e=t[30];let i=a.includes(n.value)?n.value:null,s;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(E6,{className:`min-w-[240px]`,children:(0,X.jsx)(T6,{placeholder:`Select value`})}),t[31]=s):s=t[31];let c;t[32]===a?c=t[33]:(c=a.map(Cpe),t[32]=a,t[33]=c);let l;t[34]===c?l=t[35]:(l=(0,X.jsx)(D6,{children:c}),t[34]=c,t[35]=l);let u;return t[36]!==r||t[37]!==e||t[38]!==i||t[39]!==l?(u=(0,X.jsxs)(S6,{disabled:r,onValueChange:e,value:i,children:[s,l]}),t[36]=r,t[37]=e,t[38]=i,t[39]=l,t[40]=u):u=t[40],u}let e;t[41]!==n||t[42]!==o?(e=e=>{o({...n,value:e})},t[41]=n,t[42]=o,t[43]=e):e=t[43];let s;return t[44]!==n.value||t[45]!==i||t[46]!==r||t[47]!==e?(s=(0,X.jsx)(O8,{className:`min-w-[240px]`,currentNodeId:i,disabled:r,onChange:e,placeholder:`value`,value:n.value}),t[44]=n.value,t[45]=i,t[46]=r,t[47]=e,t[48]=s):s=t[48],s}if(n.fieldType===`number`){let e;t[49]!==n||t[50]!==o?(e=e=>{let t=Number.parseFloat(e.target.value);o({...n,value:Number.isNaN(t)?0:t})},t[49]=n,t[50]=o,t[51]=e):e=t[51];let i=String(n.value),a;return t[52]!==r||t[53]!==e||t[54]!==i?(a=(0,X.jsx)(JZ,{disabled:r,onChange:e,placeholder:`0`,type:`number`,value:i}),t[52]=r,t[53]=e,t[54]=i,t[55]=a):a=t[55],a}return null}function Cpe(e){return(0,X.jsx)(k6,{value:e,children:e},e)}function wpe(e){return(0,X.jsx)(k6,{value:e.value,children:e.label},e.value)}function e5(e){let t=(0,Z.c)(61),{label:n,description:r,fields:i,emptyFieldsMessage:a,value:o,onChange:s,currentNodeId:c,disabled:l}=e,u=i[0]??null,d;t[0]===i?d=t[1]:(d=new Map(i.map(Ape)),t[0]=i,t[1]=d);let f=d,p;if(t[2]!==i){let e=new Map;for(let t of i){let n=e.get(t.sourceNodeLabel);n?n.push(t):e.set(t.sourceNodeLabel,[t])}p=Array.from(e.entries()).toSorted(kpe).map(Dpe),t[2]=i,t[3]=p}else p=t[3];let m=p,h,g,_,v,y,b,x;if(t[4]!==i||t[5]!==m||t[6]!==c||t[7]!==r||t[8]!==l||t[9]!==a||t[10]!==f||t[11]!==n||t[12]!==s||t[13]!==u||t[14]!==o){x=Symbol.for(`react.early_return_sentinel`);bb0:{let e=o.trim(),d=Q6(e),p=d.valid?d.model:null,S;t[22]===s?S=t[23]:(S=e=>{let t=r8(e);s({model:$6(e),expression:t.valid?t.expression:``})},t[22]=s,t[23]=S);let C=S,w;t[24]!==C||t[25]!==u?(w=()=>{u&&C(vpe(u))},t[24]=C,t[25]=u,t[26]=w):w=t[26];let T=w,E=p?sde(p,f):null;g=E?r8(E):null;let D=(e,t)=>{E&&C({...E,groups:E.groups.map(n=>n.id===e?t(n):n)})},O=(e,t,n)=>{D(e,e=>({...e,conditions:e.conditions.map(e=>e.id===t?n(e):e)}))},k=e=>{E&&u&&D(e,e=>({...e,conditions:[...e.conditions,Q8(u)]}))},A=(e,t)=>{E&&D(e,e=>e.conditions.length<=1?e:{...e,conditions:e.conditions.filter(e=>e.id!==t)})};h=()=>{E&&u&&C({...E,groups:[...E.groups,{id:Z8(),logic:`and`,conditions:[Q8(u)]}]})};let j=e=>{!E||E.groups.length<=1||C({...E,groups:E.groups.filter(t=>t.id!==e)})};if(!E){let o;t[27]===n?o=t[28]:(o=(0,X.jsx)(YZ,{className:`text-sm`,children:n}),t[27]=n,t[28]=o);let s;t[29]===r?s=t[30]:(s=(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:r}),t[29]=r,t[30]=s);let c;t[31]!==T||t[32]!==i.length||t[33]!==l||t[34]!==a?(c=i.length>0?(0,X.jsx)(Jv,{disabled:l,onClick:T,size:`sm`,type:`button`,variant:`outline`,children:`Configure condition`}):(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:a}),t[31]=T,t[32]=i.length,t[33]=l,t[34]=a,t[35]=c):c=t[35],x=(0,X.jsxs)(`div`,{className:`space-y-2 rounded-md border bg-muted/30 p-3`,children:[o,s,c,e&&!d.valid&&(0,X.jsx)(`p`,{className:`text-destructive text-xs`,children:d.error})]});break bb0}y=`space-y-3 rounded-md border bg-muted/30 p-3`;let M;t[36]===n?M=t[37]:(M=(0,X.jsx)(YZ,{className:`text-sm`,children:n}),t[36]=n,t[37]=M);let N;t[38]===r?N=t[39]:(N=(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:r}),t[38]=r,t[39]=N),t[40]!==M||t[41]!==N?(b=(0,X.jsxs)(`div`,{className:`space-y-1`,children:[M,N]}),t[40]=M,t[41]=N,t[42]=b):b=t[42],_=`space-y-3`,v=E.groups.map((e,t)=>(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{className:`rounded-lg border bg-card`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between border-b px-3 py-2`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`rounded-md bg-muted px-2 py-1 font-medium text-xs`,children:t+1}),(0,X.jsx)(`span`,{className:`font-medium text-sm`,children:`Filter group`}),(0,X.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[e.conditions.length,` `,e.conditions.length===1?`condition`:`conditions`]})]}),(0,X.jsx)(Jv,{disabled:l||E.groups.length<=1,onClick:()=>j(e.id),size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,X.jsx)(Cy,{className:`size-4`})})]}),(0,X.jsxs)(`div`,{className:`space-y-3 p-3`,children:[e.conditions.map((t,n)=>{let r=f.get(t.field),a=hpe(t.fieldType,r?.nullable),o=e.conditions.length>1,s=!r;return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsxs)(S6,{disabled:l||i.length===0,onValueChange:C6(n=>{let r=f.get(n);r&&O(e.id,t.id,e=>P6(r,e.id))}),value:t.field,children:[(0,X.jsx)(E6,{className:`min-w-[280px]`,children:(0,X.jsx)(T6,{placeholder:`Select field`})}),(0,X.jsxs)(D6,{children:[s&&(0,X.jsxs)(k6,{value:t.field,children:[t.field,` (Unavailable)`]}),m.map(Epe)]})]}),(0,X.jsxs)(S6,{disabled:l,onValueChange:C6(n=>{let r=xpe(t,n);r&&O(e.id,t.id,()=>r)}),value:t.operator,children:[(0,X.jsx)(E6,{className:`min-w-[190px]`,children:(0,X.jsx)(T6,{placeholder:`Select operator`})}),(0,X.jsx)(D6,{children:a.map(Tpe)})]}),(0,X.jsx)(Spe,{condition:t,currentNodeId:c,disabled:l,enumValues:r?.enumValues,onConditionChange:n=>{O(e.id,t.id,()=>n)}}),(0,X.jsx)(Jv,{disabled:l||!o,onClick:()=>A(e.id,t.id),size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,X.jsx)(Cy,{className:`size-4`})})]}),n<e.conditions.length-1&&(0,X.jsx)(`div`,{className:`py-2 pl-2`,children:(0,X.jsx)($8,{disabled:l,onChange:t=>{D(e.id,e=>({...e,logic:t}))},value:e.logic})})]},t.id)}),(0,X.jsxs)(Jv,{disabled:l||!u,onClick:()=>k(e.id),size:`sm`,type:`button`,variant:`ghost`,children:[(0,X.jsx)(yy,{className:`size-4`}),`Add condition`]})]})]}),t<E.groups.length-1&&(0,X.jsx)(`div`,{className:`flex justify-center py-2`,children:(0,X.jsx)($8,{disabled:l,onChange:e=>{C({...E,groupLogic:e})},value:E.groupLogic})})]},e.id))}t[4]=i,t[5]=m,t[6]=c,t[7]=r,t[8]=l,t[9]=a,t[10]=f,t[11]=n,t[12]=s,t[13]=u,t[14]=o,t[15]=h,t[16]=g,t[17]=_,t[18]=v,t[19]=y,t[20]=b,t[21]=x}else h=t[15],g=t[16],_=t[17],v=t[18],y=t[19],b=t[20],x=t[21];if(x!==Symbol.for(`react.early_return_sentinel`))return x;let S;t[43]!==_||t[44]!==v?(S=(0,X.jsx)(`div`,{className:_,children:v}),t[43]=_,t[44]=v,t[45]=S):S=t[45];let C=l||!u,w;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,X.jsx)(yy,{className:`size-4`}),t[46]=w):w=t[46];let T;t[47]!==h||t[48]!==C?(T=(0,X.jsx)(`div`,{className:`flex justify-center`,children:(0,X.jsxs)(Jv,{disabled:C,onClick:h,size:`sm`,type:`button`,variant:`outline`,children:[w,`Add group`]})}),t[47]=h,t[48]=C,t[49]=T):T=t[49];let E;t[50]===g?E=t[51]:(E=g?.valid===!1&&(0,X.jsx)(`p`,{className:`text-destructive text-xs`,children:g.error}),t[50]=g,t[51]=E);let D;t[52]===g?D=t[53]:(D=g?.valid&&(0,X.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Compiled CEL: `,g.expression]}),t[52]=g,t[53]=D);let O;return t[54]!==T||t[55]!==E||t[56]!==D||t[57]!==y||t[58]!==b||t[59]!==S?(O=(0,X.jsxs)(`div`,{className:y,children:[b,S,T,E,D]}),t[54]=T,t[55]=E,t[56]=D,t[57]=y,t[58]=b,t[59]=S,t[60]=O):O=t[60],O}function Tpe(e){return(0,X.jsx)(k6,{value:e.value,children:e.label},e.value)}function Epe(e){return(0,X.jsxs)(w6,{children:[(0,X.jsx)(O6,{children:e.sourceLabel}),e.fields.map(t=>(0,X.jsx)(k6,{value:t.path,children:(0,X.jsxs)(`span`,{className:`flex w-full flex-col items-start`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[t.label,t.nullable&&(0,X.jsx)(`span`,{className:`rounded bg-muted px-1 py-0.5 font-normal text-xs text-muted-foreground leading-none`,children:`nullable`})]}),t.sourceNodeLabels.length>1&&(0,X.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`Also from`,` `,t.sourceNodeLabels.filter(t=>t!==e.sourceLabel).join(`, `)]})]})},t.path))]},e.sourceLabel)}function Dpe(e){let[t,n]=e;return{sourceLabel:t,fields:n.toSorted(Ope)}}function Ope(e,t){return e.path.localeCompare(t.path)}function kpe(e,t){let[n]=e,[r]=t;return n.localeCompare(r)}function Ape(e){return[e.path,e]}function t5(e){let t=(0,Z.c)(18),{children:n,className:r,title:i,variant:a}=e;if((a===void 0?`box`:a)===`text`){let e;t[0]===r?e=t[1]:(e=Kv(`text-warning text-xs`,r),t[0]=r,t[1]=e);let i;return t[2]!==n||t[3]!==e?(i=(0,X.jsx)(`p`,{className:e,children:n}),t[2]=n,t[3]=e,t[4]=i):i=t[4],i}let o;t[5]===r?o=t[6]:(o=Kv(`flex items-start gap-2 rounded-md border border-warning/30 bg-warning/10 p-2`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(wy,{className:`mt-0.5 size-3.5 shrink-0 text-warning`}),t[7]=s):s=t[7];let c;t[8]===i?c=t[9]:(c=i?(0,X.jsx)(`p`,{className:`font-medium text-warning text-xs`,children:i}):null,t[8]=i,t[9]=c);let l;t[10]===n?l=t[11]:(l=(0,X.jsx)(`p`,{className:`text-warning text-xs`,children:n}),t[10]=n,t[11]=l);let u;t[12]!==c||t[13]!==l?(u=(0,X.jsxs)(`div`,{className:`space-y-0.5`,children:[c,l]}),t[12]=c,t[13]=l,t[14]=u):u=t[14];let d;return t[15]!==o||t[16]!==u?(d=(0,X.jsxs)(`div`,{className:o,children:[s,u]}),t[15]=o,t[16]=u,t[17]=d):d=t[17],d}function jpe(e,t,n,r,i,a,o,s,c,l=2){let u=JG(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return WG(n.current,u)?void 0:u}var n5=Y.createContext(void 0),r5=Y.createContext(void 0),i5=Y.createContext(void 0),a5=Y.createContext(!1),o5=Y.createContext(``);function s5(){let e=Y.useContext(n5);if(!e)throw Error(Jg(22));return e}function c5(){let e=Y.useContext(r5);if(!e)throw Error(Jg(23));return e}function l5(){let e=Y.useContext(i5);if(!e)throw Error(Jg(24));return e}function u5(){return Y.useContext(o5)}function Mpe(){return Y.useContext(a5)}var d5={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?A3(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>w3(t,e,n)):w3(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemProps:e=>e.itemProps,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight};function f5(e){return e==null?void 0:`${e}-popup`}function Npe(e,t){return(n,r)=>n!=null&&e.contains(n,r,t)}function p5(e){return Array.isArray(e)?e.map(e=>p5(e)).join(`,`):e==null?``:String(e)}var m5=new Map;function Ppe(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${p5(e.locale)}|${JSON.stringify(t)}`,r=m5.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),a={contains(e,t,n){if(!t)return!0;let r=j3(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=j3(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=j3(e,n),a=t.length;return r.length>=a&&i.compare(r.slice(r.length-a),t)===0}};return m5.set(n,a),a}var Fpe=Ppe;function Ipe(e,t=!1){let{overflowY:n}=Sg(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}var h5=Symbol(`none`),g5={value:h5,index:-1};function Lpe(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:o,inputValue:s,open:c,defaultOpen:l=!1,selectionMode:u,onItemHighlighted:d,name:f,form:p,disabled:m=!1,readOnly:h=!1,required:g=!1,inputRef:_,grid:v=!1,items:y,filteredItems:b,filter:x,openOnInputClick:S=!0,autoHighlight:C=!1,keepHighlight:w=!1,highlightItemOnHover:T=!0,loopFocus:E=!0,itemToStringLabel:D,itemToStringValue:O,isItemEqualToValue:k=C3,virtualized:A=!1,inline:j=!1,fillInputOnItemPress:M=!0,modal:N=!1,limit:P=-1,autoComplete:F=`list`,formAutoComplete:I,locale:L,submitOnItemClick:R=!1}=e,{clearErrors:z}=F3(),{setDirty:B,validityData:V,setFilled:H,name:U,disabled:W,setTouched:G,setFocused:K,validationMode:q,validation:J}=y3(),ee=K3(),te=S3({id:t}),ne=Fpe({locale:L}),[re,ie]=Y.useState(!1),[ae,oe]=Y.useState(null),se=Y.useRef([]),ce=Y.useRef([]),le=Y.useRef(null),ue=Y.useRef(null),de=Y.useRef(null),fe=Y.useRef(null),pe=Y.useRef(null),me=Y.useRef(!0),he=Y.useRef(!1),ge=Y.useRef(null),_e=Y.useRef(null),ve=Y.useRef(null),ye=Y.useRef(g5),be=Y.useRef(null),xe=Y.useRef([]),Se=Y.useRef(null),Ce=W||m,we=U??f,Te=u===`multiple`,Ee=u===`single`,De=s!==void 0||o!==void 0,Oe=y!==void 0,ke=b!==void 0,Ae;Ae=C===`always`?`always`:C?`input-change`:!1;let[je,Me]=d3({controlled:i,default:Te?r??s_:r,name:`Combobox`,state:`selectedValue`}),Ne=Y.useMemo(()=>x===null?()=>!0:x===void 0?Npe(ne,D):x,[x,ne,D]),Pe=Ag(()=>De?o??``:Ee?j3(je,D):``).current,[Fe,Ie]=d3({controlled:s,default:Pe,name:`Combobox`,state:`inputValue`}),[Le,Re]=d3({controlled:c,default:l,name:`Combobox`,state:`open`}),ze=k3(y),Be=ae??String(Fe).trim(),Ve=Ee?j3(je,D):``,He=Ee&&!re&&Be!==``&&Ve.length===Be.length&&ne.contains(Ve,Be),Ue=He?``:Be,We=Oe&&ke&&He,Ge=Y.useMemo(()=>y?ze?y.flatMap(e=>e.items):y:s_,[y,ze]),Ke=Y.useMemo(()=>{if(b&&!We)return b;if(!y)return s_;if(ze){let e=y,t=[],n=0;for(let r of e){if(P>-1&&n>=P)break;let e=P>-1?P-n:1/0,i=Ue===``?r.items.slice(0,e):[];if(Ue!==``)for(let t of r.items){if(i.length>=e)break;Ne(t,Ue,D)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if(Ue===``)return P>-1?Ge.slice(0,P):Ge;let e=[];for(let t of Ge){if(P>-1&&e.length>=P)break;Ne(t,Ue,D)&&e.push(t)}return e},[b,We,y,ze,Ue,P,Ne,D,Ge]),qe=Y.useMemo(()=>ze?Ke.flatMap(e=>e.items):Ke,[Ke,ze]),Je=Ag(()=>{let e=null;return j&&Le&&Oe&&u!==`none`&&(e=E3(qe,je,k,Te)),new IJ({id:te,labelId:void 0,selectedValue:je,open:Le,items:y,selectionMode:u,listRef:se,labelsRef:ce,popupRef:le,emptyRef:pe,inputRef:ue,startDismissRef:de,endDismissRef:fe,keyboardActiveRef:me,chipsContainerRef:ge,clearRef:_e,valuesRef:xe,pointerDownItemRef:Se,selectionEventRef:ve,name:we,form:p,disabled:Ce,readOnly:h,required:g,grid:v,virtualized:A,openOnInputClick:S,itemToStringLabel:D,isItemEqualToValue:k,modal:N,autoHighlight:Ae,submitOnItemClick:R,hasInputValue:De,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:j,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemProps:c_,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:u===`none`,onOpenChangeComplete:o_,setOpen:o_,setInputValue:o_,setSelectedValue:o_,setIndices:o_,handleSelection:o_,forceMount:o_,requestSubmit:o_})}).current,Ye=u===`none`?Fe:je,Xe=Y.useMemo(()=>u===`none`?Ye:Array.isArray(je)?je.map(e=>M3(e,O)):M3(je,O),[Ye,O,u,je]),Ze=Ng(d),Qe=Ng(n),$e=$(Je,d5.activeIndex),et=$(Je,d5.selectedIndex),tt=$(Je,d5.positionerElement),nt=$(Je,d5.listElement),rt=$(Je,d5.triggerElement),it=$(Je,d5.inputElement),at=$(Je,d5.inputGroupElement),ot=$(Je,d5.inline),st=$(Je,d5.inputInsidePopup),ct=$(Je,d5.inputOwnsFormValue),lt=oG(rt),{mounted:ut,setMounted:dt,transitionStatus:ft}=VJ(Le),{openMethod:pt,triggerProps:mt}=MX(Le),ht=Ng(()=>Xe);b3(st?lt:ue,te,Ye,ht,!Ce,f);let gt=Ng(()=>{y?ce.current=qe.map(e=>j3(e,D)):Je.set(`forceMounted`,!0)}),_t=Ng((e,t,n)=>{if(t===-1){if(ye.current===g5)return;ye.current=g5}else ye.current={value:e,index:t};Ze(e,$U(n,void 0,{index:t}))}),vt=Ng(e=>{Je.update(e);let t=e.activeIndex;if(t===void 0)return;let n=e.type||`none`;t===null?_t(void 0,-1,n):_t(xe.current[t],t,n)}),yt=Ng((t,n)=>{if(he.current=n.reason===BU,e.onInputValueChange?.(t,n),!n.isCanceled){if(n.reason===`input-change`){Le&&ae!==null&&oe(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&ie(!0),be.current={hasQuery:e};let n=Je.state.listElement;if(!Je.state.virtualized&&n){let e=le.current;for(let t of Eg(n.firstElementChild??n)){if(!lg(t)||(e?!zW(e,t):t.getAttribute(`role`)===`dialog`))break;if(Ipe(t)){t.scrollTop=0;break}}}e&&Ae&&Je.state.activeIndex==null&&(Le||ot)&&Je.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&Je.state.inputInsidePopup&&(be.current={hasQuery:!1,selection:!0});Ie(t)}}),bt=Ng((t,n)=>{if(Le!==t&&(n.reason===`escape-key`&&Oe&&qe.length===0&&!pe.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(t&&st&&!ot&&ae!==null&&(ie(!1),oe(null),Fe!==``&&n.reason!==`input-change`&&yt(``,QU(BU,n.event))),!t&&re&&(Ee?(ot||oe(Be),Be===``&&ie(!1)):Te&&(ot||oe(Be),st&&vt({activeIndex:null}),(!st||ot)&&yt(``,QU(BU,n.event)))),Re(t),!t&&st&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(G(!0),K(!1),q===`onBlur`)))){let e=u===`none`?Fe:je;J.commit(e)}}),xt=Ng((e,t)=>{a?.(e,t),!t.isCanceled&&(Me(e),(u===`none`&&le.current&&M||Ee&&!Je.state.inputInsidePopup)&&yt(j3(e,D),QU(t.reason,t.event)))}),St=Ng((e,t)=>{let n=BW(e),r=ve.current??e;ve.current=null;let i=QU(LU,r),a=n?.closest(`a`)?.getAttribute(`href`);if(a){a.startsWith(`#`)&&bt(!1,i);return}if(Te){let e=Array.isArray(je)?je:[],n=oue(e,t,k)?D3(e,t,k):[...e,t];if(xt(n,i),i.isCanceled||!(ue.current&&ue.current.value.trim()!==``))return;Je.state.inputInsidePopup?yt(``,QU(BU,i.event)):bt(!1,i)}else{if(xt(t,i),i.isCanceled)return;bt(!1,i)}}),Ct=Ng(()=>{let e=J.inputRef.current?.form??Je.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),wt=Ng(()=>{if(dt(!1),Qe?.(!1),ie(!1),oe(null),vt(u===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Te&&ue.current&&ue.current.value!==``&&!he.current&&yt(``,QU(BU)),Ee){if(Je.state.inputInsidePopup)ue.current&&ue.current.value!==``&&yt(``,QU(BU));else{let e=j3(je,D);ue.current&&ue.current.value!==e&&yt(e,QU(e===``?BU:MU))}}}),Tt=Y.useMemo(()=>ot&&tt?{current:tt.closest(`[role="dialog"]`)}:le,[ot,tt]);UJ({enabled:!e.actionsRef,open:Le,ref:Tt,onComplete(){Le||wt()}}),Y.useImperativeHandle(e.actionsRef,()=>({unmount:wt}),[wt]),Q(function(){if(Le||(Se.current=null,u===`none`))return;let e=Oe?Ge:xe.current;vt({selectedIndex:E3(e,je,k,Te)})},[Le,je,u,Te,Oe,Ge,k,vt]),Q(()=>{y&&(xe.current=qe,se.current.length=qe.length)},[y,qe]),Q(()=>{let e=be.current;if(e){let t=Le||ot||Je.state.positionerElement?.hidden===!1;if(e.hasQuery)Ae&&t&&Je.set(`activeIndex`,0),be.current=null;else if(String(Fe).trim()===``&&(be.current=null,t)){let t=e.selection;Ae===`always`&&!t&&Je.state.selectionMode===`none`&&Je.set(`activeIndex`,0),queueMicrotask(()=>{if(!Je.state.open&&!Je.state.inline||ue.current&&ue.current.value.trim()!==``)return;let e=Je.state.selectedValue,n=Je.state.selectionMode===`multiple`,r=n&&Array.isArray(e)?e[e.length-1]:e,i=Je.state.selectionMode!==`none`&&r!=null;if(i||t){let t=Oe||ke?qe:xe.current;Je.set(`activeIndex`,i?E3(t,e,Je.state.isItemEqualToValue,n):null)}else Ae===`always`&&Je.set(`activeIndex`,0)})}}if(!Le&&!ot)return;let t=Oe||ke?qe:xe.current,n=Je.state.activeIndex;if(n==null){if(Ae===`always`&&t.length>0){Je.set(`activeIndex`,0);return}_t(void 0,-1,MU);return}if(n>=t.length){_t(void 0,-1,MU),Je.set(`activeIndex`,null);return}let r=t[n],i=ye.current.value,a=i!==h5&&w3(r,i,Je.state.isItemEqualToValue);(ye.current.index!==n||!a)&&_t(r,n,MU)},[$e,Ae,_t,ke,Oe,qe,ot,Le,Je,Fe]),Q(()=>{if(u===`none`){H(String(Fe)!==``);return}H(Te?Array.isArray(je)&&je.length>0:je!=null)},[H,u,Fe,je,Te]),Y.useEffect(()=>{Oe&&Ae&&qe.length===0&&vt({activeIndex:null})},[Oe,Ae,qe.length,vt]);function Et(e){let t=V.initialValue;return Array.isArray(e)&&Array.isArray(t)?!I3(e,t,(e,t)=>w3(e,t,k)):e!==t}AX(Be,()=>{!Le||Be===``||Be===String(Pe)||ie(!0)});function Dt(){let e=j3(je,D);Fe!==e&&yt(e,QU(MU))}AX(je,()=>{u!==`none`&&(z(we),B(Et(je)),J.change(je),Ee&&!De&&!st&&Dt())}),AX(Fe,()=>{u===`none`&&(z(we),B(Fe!==V.initialValue),J.change(Fe))}),AX(y,()=>{!Ee||De||st||re||Dt()});let Ot=mY({open:ot?!0:Le,onOpenChange:bt,elements:{reference:st?rt:it,floating:tt}}),kt=v?`grid`:`listbox`,At=Le||ot,jt=At?`true`:`false`,Mt=Y.useMemo(()=>{let e=it?.tagName===`INPUT`,t=it==null||e,n=t||At,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=jt,r[`aria-haspopup`]=kt,r[`aria-controls`]=At?nt?.id:void 0,r[`aria-autocomplete`]=F),{reference:r,floating:{role:`presentation`}}},[it,At,jt,kt,nt?.id,F]),Nt=mq(Ot,{enabled:!h&&!Ce&&S,event:`mousedown-only`,toggle:!1,touchOpenDelay:st?0:100,reason:VU}),Pt=bq(Ot,{enabled:!h&&!Ce&&!ot,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:ot?!0:void 0,outsidePress(e){let t=BW(e);return!zW(rt,t)&&!zW(_e.current,t)&&!zW(ge.current,t)&&!zW(at,t)}}),Ft=PY(Ot,{enabled:!h&&!Ce,id:te,listRef:se,activeIndex:$e,selectedIndex:et,virtual:!0,loopFocus:E,allowEscape:E&&!Ae,focusItemOnOpen:re||u===`none`&&!Ae?!1:`auto`,focusItemOnHover:T,resetOnPointerLeave:!w,orientation:v?`horizontal`:void 0,rtl:ee===`rtl`,disabledIndices:s_,grid:v?jpe:void 0,onNavigate(e,t){!t&&!Le||ft===`ending`||vt(t?{activeIndex:e,type:me.current?GU:KU}:{activeIndex:e})}}),It=Y.useMemo(()=>Rg(Ft.reference,{onKeyDown(e){v&&Je.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},Pt.reference,Nt.reference,Mt.reference),[Ft.reference,Pt.reference,Nt.reference,Mt.reference,v,Je]),Lt=Y.useMemo(()=>Rg(WJ,Pt.floating),[Pt.floating]),Rt=Y.useMemo(()=>Rg(Ft.floating,Mt.floating),[Ft.floating,Mt.floating]),zt=Y.useMemo(()=>{let e=Ft.item;return e?{...e,onFocus:void 0}:c_},[Ft.item]);l3(()=>{Je.update({inline:j,popupProps:Lt,listProps:Rt,inputProps:It,triggerProps:mt,itemProps:zt,setOpen:bt,setInputValue:yt,setSelectedValue:xt,setIndices:vt,handleSelection:St,forceMount:gt,requestSubmit:Ct,onOpenChangeComplete:Qe})}),Q(()=>{Je.update({id:te,selectedValue:je,open:Le,mounted:ut,transitionStatus:ft,items:y,inline:j,popupProps:Lt,listProps:Rt,inputProps:It,triggerProps:mt,openMethod:pt,itemProps:zt,selectionMode:u,name:we,form:p,disabled:Ce,readOnly:h,required:g,grid:v,virtualized:A,openOnInputClick:S,itemToStringLabel:D,modal:N,autoHighlight:Ae,isItemEqualToValue:k,submitOnItemClick:R,hasInputValue:De,inputOwnsFormValue:u===`none`&&(j||!Je.state.inputInsidePopup)})},[Je,te,je,Le,ut,ft,y,Lt,Rt,It,zt,pt,mt,u,we,Ce,h,g,v,A,S,D,N,k,R,De,j,Ae,p]);let Bt=t_(_,J.inputRef),Vt=Y.useMemo(()=>({query:Be,hasItems:Oe,filteredItems:Ke,flatFilteredItems:qe}),[Be,Oe,Ke,qe]),Ht=Y.useMemo(()=>Array.isArray(Ye)?``:M3(Ye,O),[Ye,O]),Ut=Te&&Array.isArray(je)&&je.length>0,Wt=Te||u===`none`&&ct?void 0:we,Gt=Y.useMemo(()=>!Te||!Array.isArray(je)||!we?null:je.map(e=>{let t=M3(e,O);return(0,X.jsx)(`input`,{type:`hidden`,form:p,name:we,value:t,disabled:Ce},t)}),[Te,je,p,we,O,Ce]),Kt=(0,X.jsxs)(Y.Fragment,{children:[e.children,(0,X.jsx)(`input`,{...J.getValidationProps(Ce,{onFocus(){if(st){rt?.focus();return}(ue.current||rt)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||Ce||h)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=QU(MU,e.nativeEvent),i=()=>xe.current.findIndex(e=>M3(e,O).toLowerCase()===n||j3(e,D).toLowerCase()===n);function a(){if(Te)return;if(u===`none`){yt(t,r);return}let e=i();e===-1&&(e=xe.current.findIndex((e,t)=>{let r=ce.current[t];return r!=null&&r.toLowerCase()===n}));let a=e===-1?void 0:xe.current[e];a!=null&&xt?.(a,r)}Ee&&(gt(),y&&i()===-1&&Je.set(`forceMounted`,!0)),queueMicrotask(a)}}),id:te&&Wt==null?`${te}-hidden-input`:void 0,form:p,name:Wt,autoComplete:I,disabled:Ce,required:g&&!Ut,readOnly:h,value:Ht,ref:Bt,style:Wt?mG:pG,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Gt]});return(0,X.jsx)(n5.Provider,{value:Je,children:(0,X.jsx)(r5.Provider,{value:Ot,children:(0,X.jsx)(a5.Provider,{value:Oe,children:(0,X.jsx)(i5.Provider,{value:Vt,children:(0,X.jsx)(o5.Provider,{value:Fe,children:Kt})})})})})}function Rpe(e){let{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:a,...o}=e;return(0,X.jsx)(Lpe,{...o,selectionMode:t?`multiple`:`single`,selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:a})}var _5={...OU,...g3,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":``}:null},zpe=Y.createContext(void 0);function Bpe(){return Y.useContext(zpe)}var v5=Y.createContext(void 0);function y5(e){let t=Y.useContext(v5);if(t===void 0&&!e)throw Error(Jg(21));return t}var b5=Y.forwardRef(function(e,t){let n=s5(),{buttonRef:r,getButtonProps:i}=$g({native:!1}),a=t_(t,r);function o(e){n.state.setOpen(!1,QU(RU,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return(0,X.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:mG})});function x5(e){let t=$(e,d5.mounted),n=$(e,d5.popupSide),r=$(e,d5.positionerElement);return t&&r?n:null}function S5(){return l5().filteredItems.length===0}function Vpe(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function Hpe(e,t){let n=e>=t-1?t-2:e;return n>=0?n:void 0}function C5(e,t,n){let r=e.state.listRef.current[t];r&&(e.state.selectionEventRef.current=n,r.click(),e.state.selectionEventRef.current=null)}var Upe=Y.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:o,...s}=e,{state:c,disabled:l,setTouched:u,setFocused:d,validationMode:f,validation:p}=y3(),{labelId:m}=x3(),h=Bpe(),g=!!y5(!0),_=s5(),v=u5(),y=K3(),b=$(_,d5.required),x=$(_,d5.disabled),S=$(_,d5.readOnly),C=$(_,d5.name),w=$(_,d5.form),T=$(_,d5.selectionMode),E=$(_,d5.autoHighlight),D=$(_,d5.inputProps),O=$(_,d5.triggerProps),k=$(_,d5.open),A=$(_,d5.mounted),j=$(_,d5.selectedValue),M=$(_,d5.id),N=$(_,d5.inline),P=$(_,d5.modal),F=!!E,I=x5(_),L=l||x||i,R=S5(),z=g||N,B=!z||P,V=aW(a??(z?void 0:M)),H=g?h3:c,[U,W]=Y.useState(null),G=Y.useRef(!1),K=Y.useRef(null),q=Y.useRef(!1),J=T===`none`&&!g,ee=Ng(e=>{let t=g||_.state.inline;t&&!_.state.hasInputValue&&_.state.setInputValue(``,QU(MU)),_.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:J})}),te=g?s:p.getValidationProps(L,s);function ne(){_.state.setIndices({activeIndex:null,selectedIndex:null,type:_.state.keyboardActiveRef.current?GU:KU})}function re(){_.state.keyboardActiveRef.current=!1}let ie={...H,open:k,disabled:L,readOnly:S,popupSide:I,listEmpty:R};function ae(e){if(!h)return;let t,{highlightedChipIndex:n}=h,r=h.chipsRef.current.length,[i,a]=Vpe(y);return n===void 0?(e.key===i&&(e.currentTarget.selectionStart??0)===0&&j.length>0&&(e.preventDefault(),t=r>0?r-1:void 0),t):(e.key===i?(e.preventDefault(),t=n>0?n-1:void 0):e.key===a?(e.preventDefault(),t=n<r-1?n+1:void 0):(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),t=Hpe(n,j.length),ne()),t)}let oe=l_(`input`,e,{state:ie,ref:[t,_.state.inputRef,ee],props:[D,O,{value:U??v,"aria-readonly":S||void 0,"aria-required":b||void 0,"aria-labelledby":m,disabled:L,readOnly:S,required:T===`none`?b:void 0,form:w,...J&&C&&{name:C},id:V,onFocus(){if(d(!0),!N||!q.current)return;q.current=!1;let e=K.current;e==null||!Object.hasOwn(_.state.valuesRef.current,e)||_.state.setIndices({activeIndex:e})},onBlur(){u(!0),d(!1);let e=_.state.activeIndex;if(N&&e!==null&&E!==`always`&&(K.current=e,q.current=!0,_.state.setIndices({activeIndex:null})),f===`onBlur`){let e=T===`none`?v:j;p.commit(e)}},onCompositionStart(e){yW||(G.current=!0,W(e.currentTarget.value))},onCompositionEnd(e){G.current=!1;let t=e.currentTarget.value;W(null),_.state.setInputValue(t,QU(zU,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=G.current||!r;function a(e){S||L||!e||!i||(_.state.setOpen(!0,QU(zU,t)),F||ne())}if(G.current){let n=e.currentTarget.value;W(n),n===``&&!_.state.openOnInputClick&&!_.state.inputInsidePopup&&_.state.setOpen(!1,QU(BU,t));let r=n.trim(),i=F&&r!==``;a(r),k&&_.state.activeIndex!==null&&!i&&ne();return}let o=QU(zU,t);if(_.state.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=QU(BU,t);s&&!_.state.inputInsidePopup&&(T===`single`&&_.state.setSelectedValue(null,c),_.state.openOnInputClick||_.state.setOpen(!1,c)),a(e.currentTarget.value.trim()),k&&_.state.activeIndex!==null&&!F&&ne()},onKeyDown(e){if(L||S||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;_.state.keyboardActiveRef.current=!0;let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=y===`rtl`;if(e.key===`Home`){EW(e);let n=CW&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){EW(e);let i=CW&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!A&&e.key===`Escape`){let t=T===`multiple`&&Array.isArray(j)?j.length===0:j===null,n=QU(UU,e.nativeEvent),r=T===`multiple`?[]:null;_.state.setInputValue(``,n),_.state.setSelectedValue(r,n),!t&&!_.state.inline&&!n.isPropagationAllowed&&e.stopPropagation();return}if(h&&e.key===`Backspace`&&t.value===``&&h.highlightedChipIndex===void 0&&Array.isArray(j)&&j.length>0){let t=h.chipsRef.current.length,n=t>0?t-1:j.length-1,r=j.filter((e,t)=>t!==n);ne(),_.state.setSelectedValue(r,QU(MU,e.nativeEvent));return}let i=h?.highlightedChipIndex!==void 0,a=ae(e);if(h?.setHighlightedChipIndex(a),a===void 0?i&&_.state.inputRef.current?.focus():h?.chipsRef.current[a]?.focus(),e.which!==229&&e.key===`Enter`&&k){let t=_.state.activeIndex,n=e.nativeEvent;if(t===null){if(N)return;_.state.setOpen(!1,QU(MU,n));return}EW(e),C5(_,t,n)}},onPointerMove:re,onPointerDown:re},te],stateAttributesMapping:_5}),se=g?(0,X.jsx)(v3.Provider,{value:_3,children:oe}):oe;return(0,X.jsxs)(Y.Fragment,{children:[k&&B&&(0,X.jsx)(b5,{ref:_.state.startDismissRef}),se]})});function Wpe(e,t,n,r,i){if(e.baseUIHandlerPrevented||r)return;let a=BW(e.nativeEvent),o=cg(a)?a:null;o!==e.currentTarget&&(i?.(o)||GW(o))||(e.preventDefault(),!n&&(t.state.inputRef.current?.focus(),t.state.openOnInputClick&&t.state.setOpen(!0,QU(VU,e.nativeEvent))))}var Gpe=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=y3(),s=s5(),c=$(s,d5.open),l=$(s,d5.disabled),u=$(s,d5.readOnly),d=$(s,d5.hasSelectedValue),f=$(s,d5.selectionMode),p=x5(s),m=l,h=S5(),g=f!==`none`&&!d,_={...o,open:c,disabled:m,readOnly:u,popupSide:p,listEmpty:h,placeholder:g};return l_(`div`,e,{ref:[t,Ng(e=>{s.set(`inputGroupElement`,e)})],props:[{role:`group`,onMouseDown(e){Wpe(e,s,m,u,e=>zW(s.state.chipsContainerRef.current,e))}},a],state:_,stateAttributesMapping:_5})}),Kpe=Y.forwardRef(function(e,t){let{render:n,className:r,nativeButton:i=!0,disabled:a=!1,id:o,style:s,...c}=e,{state:l,disabled:u,setTouched:d,setFocused:f,validationMode:p,validation:m}=y3(),{labelId:h}=x3(),g=s5(),_=$(g,d5.selectionMode),v=$(g,d5.disabled),y=$(g,d5.readOnly),b=$(g,d5.required),x=$(g,d5.positionerElement),S=$(g,d5.listElement),C=$(g,d5.popupId),w=$(g,d5.triggerProps),T=$(g,d5.inputInsidePopup),E=$(g,d5.id),D=$(g,d5.labelId),O=$(g,d5.open),k=$(g,d5.selectedValue),A=$(g,d5.activeIndex),j=$(g,d5.selectedIndex),M=$(g,d5.hasSelectedValue),N=c5(),P=u5(),F=uW(),I=u||v||a,L=S5(),R=x5(g);S3({id:T?o:void 0});let z=T?o??E:o,B=B3(h,D),V;O&&T?V=C??f5(E):O&&(V=S?.id);let H=Y.useRef(``);function U(e){H.current=e.pointerType}let{reference:W}=FY(N,{enabled:!O&&!y&&!v&&_===`single`,listRef:g.state.labelsRef,activeIndex:A,selectedIndex:j,onMatch(e){let t=g.state.valuesRef.current[e];t!==void 0&&g.state.setSelectedValue(t,QU(MU))}}),{reference:G}=mq(N,{enabled:!y&&!v,event:`mousedown`}),{buttonRef:K,getButtonProps:q}=$g({native:i,disabled:I}),J={...l,open:O,disabled:I,popupSide:R,listEmpty:L,placeholder:_!==`none`&&!M};return l_(`button`,e,{ref:[t,K,Ng(e=>{g.set(`triggerElement`,e)})],state:J,props:[w,G,W,{id:z,tabIndex:T?0:-1,role:T?`combobox`:void 0,"aria-expanded":O,"aria-haspopup":T?`dialog`:`listbox`,"aria-controls":V,"aria-required":T&&b||void 0,"aria-labelledby":B,onPointerDown:U,onPointerEnter:U,onFocus(){f(!0),!(I||y)&&F.start(0,g.state.forceMount)},onBlur(e){if(!zW(x,e.relatedTarget)&&(d(!0),f(!1),p===`onBlur`)){let e=_===`none`?P:k;m.commit(e)}},onMouseDown(e){if(I||y||(T||N.set(`domReferenceElement`,e.currentTarget),g.state.forceMount(),H.current!==`touch`&&(g.state.inputRef.current?.focus(),T||e.preventDefault()),O))return;let t=Zg(e.currentTarget);function n(e){let t=g.state.triggerElement;if(!t)return;let n=BW(e),r=g.state.positionerElement,i=g.state.listElement;zW(t,n)||zW(r,n)||zW(i,n)||H3(e,t)||g.state.setOpen(!1,QU(qU,e))}T&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){y||(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(EW(e),g.state.setOpen(!0,QU(WU,e.nativeEvent)),g.state.inputRef.current?.focus())}},m.getValidationProps(I,c),q],stateAttributesMapping:_5})}),qpe=Y.createContext(null);function Jpe(){return Y.useContext(qpe)}function Ype(e){let{children:t}=e,{filteredItems:n}=l5(),r=Jpe(),i=r?r.items:n;return(0,X.jsx)(Y.Fragment,{children:i.map(t)})}var Xpe=Y.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=s5(),l=c5(),u=!!y5(!0),{filteredItems:d,hasItems:f}=l5(),p=$(c,d5.selectionMode),m=$(c,d5.grid),h=$(c,d5.listProps),g=$(c,d5.virtualized),_=$(c,d5.forceMounted),v=p===`multiple`,y=d.length===0,b=Ng(e=>{c.set(`positionerElement`,e)}),x=Ng(e=>{c.set(`listElement`,e)}),S=Y.useMemo(()=>typeof o==`function`?n||=(0,X.jsx)(Ype,{children:o}):o,[o]),C={empty:y},w=l.useState(`floatingId`),T=l_(`div`,e,{state:C,ref:[t,x,u?null:b],props:[h,{children:S,tabIndex:-1,id:w,role:m?`grid`:`listbox`,"aria-multiselectable":v?`true`:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;EW(e),C5(c,t,e.nativeEvent)}},onKeyDownCapture(){c.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){c.state.keyboardActiveRef.current=!1}},s]});if(g)return T;let E=f&&!_?void 0:c.state.labelsRef;return(0,X.jsx)(W3,{elementsRef:c.state.listRef,labelsRef:E,children:T})}),Zpe=`⁠`;function Qpe(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=null;for(;t.nextNode();){let e=t.currentNode;e.nodeValue!==``&&(n=e)}return n}function $pe(){let e=uW(),t=Y.useRef(null);return Y.useEffect(()=>{if(_W)return;let n=t.current;if(n==null)return;let r=Qpe(n);if(r==null)return;let i=r.data,a=`${i}${Zpe}`;return r.nodeValue=a,e.start(200,()=>{r.nodeValue===a&&(r.nodeValue=i)}),()=>{e.clear(),r.nodeValue===a&&(r.nodeValue=i)}},[t,e]),t}var w5=Y.createContext(void 0);function eme(){let e=Y.useContext(w5);if(e===void 0)throw Error(Jg(20));return e}var tme=Y.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=s5(),a=$(i,d5.mounted),o=$(i,d5.forceMounted);return a||n||o?(0,X.jsx)(w5.Provider,{value:n,children:(0,X.jsx)(JK,{ref:t,...r})}):null}),nme=Y.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m=!1,collisionAvoidance:h=VK,style:g,..._}=e,v=s5(),y=c5(),b=eme(),x=$(v,d5.modal),S=$(v,d5.open),C=$(v,d5.mounted),w=$(v,d5.openMethod),T=$(v,d5.positionerElement),E=$(v,d5.triggerElement),D=$(v,d5.inputElement),O=$(v,d5.inputGroupElement),k=$(v,d5.inputInsidePopup),A=$(v,d5.transitionStatus),j=S5(),M=Z3({anchor:i??(k?E:O??D),floatingRootContext:y,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,lazyFlip:!0});a6(S&&x,w===`touch`,T,E);let N={open:S,side:M.side,align:M.align,anchorHidden:M.anchorHidden,empty:j};Q(()=>{v.set(`popupSide`,M.side)},[v,M.side]);let P=Ng(e=>{v.set(`positionerElement`,e)}),F=i6(e,N,{styles:M.positionerStyles,transitionStatus:A,props:_,refs:[t,P],hidden:!C,inert:!S});return(0,X.jsxs)(v5.Provider,{value:M,children:[C&&x&&(0,X.jsx)(sX,{inert:oX(!S),cutout:O??D??E}),F]})}),rme={...kU,...xU},ime=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=s5(),l=y5(),u=c5(),d=$(c,d5.mounted),f=$(c,d5.open),p=$(c,d5.openMethod),m=$(c,d5.popupProps),h=$(c,d5.transitionStatus),g=$(c,d5.inputInsidePopup),_=$(c,d5.inputElement),v=$(c,d5.modal),y=$(c,d5.id),b=S5(),x=s.id??(g?f5(y):void 0);Q(()=>(c.set(`popupId`,c.state.popupRef.current?.id||x),()=>{c.set(`popupId`,void 0)}),[c,x]),UJ({open:f,ref:c.state.popupRef,onComplete(){f&&c.state.onOpenChangeComplete(!0)}});let S=l_(`div`,e,{state:{open:f,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:b},ref:[t,c.state.popupRef],props:[m,{id:x,role:g?`dialog`:`presentation`,onFocus(e){let t=BW(e.nativeEvent);p!==`touch`&&(zW(c.state.listElement,t)||t===e.currentTarget)&&c.state.inputRef.current?.focus()}},r6(h),s],stateAttributesMapping:rme}),C=a===void 0?g?e=>e===`touch`?c.state.popupRef.current:_:!1:a,w;w=o??(g?void 0:!1);let T=!g||v;return(0,X.jsx)(pq,{context:u,disabled:!d,modal:T,openInteractionType:p,initialFocus:C,returnFocus:w,getInsideElements:()=>[c.state.startDismissRef.current,c.state.endDismissRef.current],children:(0,X.jsxs)(Y.Fragment,{children:[S,T&&(0,X.jsx)(b5,{ref:c.state.endDismissRef})]})})}),T5=Y.createContext(void 0);function E5(){let e=Y.useContext(T5);if(!e)throw Error(Jg(19));return e}var ame=Y.createContext(!1);function ome(){return Y.useContext(ame)}function D5(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:i}=e,{render:a,className:o,style:s,value:c=null,index:l,disabled:u=!1,nativeButton:d=!1,...f}=t,p=Y.useRef(null),m=h6({guess:!0,index:l,textRef:p}),h=s5(),g=ome(),_=Mpe(),v=$(h,d5.selectionMode),y=$(h,d5.disabled),b=$(h,d5.readOnly),x=$(h,d5.isItemEqualToValue),S=y||u,C=v!==`none`,w=l??i??m.index,T=w!==-1,E=$(h,d5.id),D=$(h,d5.isActive,w),O=$(h,d5.isSelected,c),k=$(h,d5.itemProps),A=Y.useRef(null),j=E!=null&&T?`${E}-${w}`:void 0,M=O&&C;Q(()=>{if(!(T&&(r||l!=null)))return;let e=h.state.listRef.current;return e[w]=A.current,()=>{delete e[w]}},[T,r,w,l,h]),Q(()=>{if(!T||_)return;let e=h.state.valuesRef.current;return e[w]=c,()=>{delete e[w]}},[T,_,w,c,h]),Q(()=>{if(!T||_)return;let e=h.state.selectedValue,t=Array.isArray(e)?e[e.length-1]:e;w3(c,t,x)&&h.set(`selectedIndex`,w)},[T,_,h,w,c,x]);let{getButtonProps:N,buttonRef:P}=$g({disabled:S,focusableWhenDisabled:!0,native:d,composite:!0}),F={disabled:S,selected:M,highlighted:D};function I(e){function t(){h.state.handleSelection(e,c)}h.state.submitOnItemClick?(Xi.flushSync(t),h.state.requestSubmit()):t()}let L={id:j,role:g?`gridcell`:`option`,"aria-selected":C?M:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(h.state.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){S||b||I(e.nativeEvent)},onMouseUp(e){let t=h.state.pointerDownItemRef.current===e.currentTarget;h.state.pointerDownItemRef.current=null,!(S||b||e.button!==0||t||!D)&&I(e.nativeEvent)}},R=l_(`div`,t,{ref:[P,n,m.ref,A],state:F,props:[k,L,f,N]}),z=Y.useMemo(()=>({selected:M,textRef:p}),[M,p]);return(0,X.jsx)(T5.Provider,{value:z,children:R})}function sme(e){let{componentProps:t,forwardedRef:n}=e,r=$(s5(),d5.isItemEqualToValue),{flatFilteredItems:i}=l5(),a=T3(i,t.value??null,r);return(0,X.jsx)(D5,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:a})}var cme=Y.memo(Y.forwardRef(function(e,t){let n=$(s5(),d5.virtualized);return n&&e.index==null?(0,X.jsx)(sme,{componentProps:e,forwardedRef:t}):(0,X.jsx)(D5,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})})),lme=Y.forwardRef(function(e,t){let{selected:n}=E5();return e.keepMounted||n?(0,X.jsx)(ume,{...e,ref:t}):null}),ume=Y.memo(Y.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=E5(),c=Y.useRef(null),{transitionStatus:l,setMounted:u}=VJ(s),d=l_(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:xU});return UJ({open:s,ref:c,onComplete(){s||u(!1)}}),d})),dme=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{filteredItems:s}=l5(),c=s5(),l=$pe(),u=s.length===0?a:null;return l_(`div`,e,{ref:[t,c.state.emptyRef,l],props:[{children:u,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})});function fme(e){let t=(0,Z.c)(2),n;return t[0]===e?n=t[1]:(n=(0,X.jsx)(Rpe,{...e}),t[0]=e,t[1]=n),n}function pme(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`relative flex w-full items-center`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Gpe,{className:i,"data-slot":`combobox-input-group`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function mme(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent py-1 pr-16 pl-3 text-base shadow-xs outline-none transition-[color,box-shadow] placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Upe,{className:i,"data-slot":`combobox-input`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var hme=`flex size-7 items-center justify-center rounded-sm text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50`;function gme(e){let t=(0,Z.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(hme,`absolute right-1`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(ay,{className:`size-4 opacity-50`}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,X.jsx)(Kpe,{className:i,"data-slot":`combobox-trigger`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function _me(e){let t=(0,Z.c)(18),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({className:r,children:n,side:a,sideOffset:o,align:s,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a===void 0?`bottom`:a,l=o===void 0?4:o,u=s===void 0?`start`:s,d;t[7]===r?d=t[8]:(d=Kv(`data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-open:animate-in`,r),t[7]=r,t[8]=d);let f;t[9]!==n||t[10]!==i||t[11]!==d?(f=(0,X.jsx)(ime,{className:d,"data-slot":`combobox-content`,...i,children:n}),t[9]=n,t[10]=i,t[11]=d,t[12]=f):f=t[12];let p;return t[13]!==u||t[14]!==c||t[15]!==l||t[16]!==f?(p=(0,X.jsx)(tme,{children:(0,X.jsx)(nme,{align:u,className:`isolate z-50 outline-none`,side:c,sideOffset:l,children:f})}),t[13]=u,t[14]=c,t[15]=l,t[16]=f,t[17]=p):p=t[17],p}function vme(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`max-h-64 overflow-y-auto overscroll-contain`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Xpe,{className:i,"data-slot":`combobox-list`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function yme(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`px-2 py-3 text-muted-foreground text-xs empty:hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(dme,{className:i,"data-slot":`combobox-empty`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function bme(e){let t=(0,Z.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=Kv(`relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=(0,X.jsx)(`span`,{className:`min-w-0 flex-1`,children:n}),t[6]=n,t[7]=o);let s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(lme,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,X.jsx)(iy,{className:`size-4`})}),t[8]=s):s=t[8];let c;return t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,X.jsxs)(cme,{className:a,"data-slot":`combobox-item`,...i,children:[o,s]}),t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function xme(e,t){let n=t.trim().toLowerCase();return!n||e.label.toLowerCase().includes(n)||e.name.toLowerCase().includes(n)}function Sme(e,t){return e.name===t.name}function Cme(e){let t=(0,Z.c)(9),{inputId:n,placeholder:r}=e,i;t[0]!==n||t[1]!==r?(i=(0,X.jsx)(mme,{id:n,placeholder:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(gme,{"aria-label":`Show the Events`}),t[3]=a):a=t[3];let o;t[4]===i?o=t[5]:(o=(0,X.jsxs)(pme,{children:[i,a]}),t[4]=i,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsxs)(_me,{children:[(0,X.jsx)(yme,{children:`No Event matches that.`}),(0,X.jsx)(vme,{children:wme})]}),t[6]=s):s=t[6];let c;return t[7]===o?c=t[8]:(c=(0,X.jsxs)(X.Fragment,{children:[o,s]}),t[7]=o,t[8]=c),c}function wme(e){return(0,X.jsxs)(bme,{value:e,children:[(0,X.jsx)(`span`,{className:`block truncate`,children:e.label}),e.label===e.name?null:(0,X.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:e.name})]},e.name)}function O5(e){let t=(0,Z.c)(16),{choices:n,value:r,onValueChange:i,disabled:a,inputId:o,placeholder:s}=e,c=s===void 0?`Search Events`:s,l;if(t[0]!==n||t[1]!==r){let e;t[3]===n?e=t[4]:(e=e=>n.find(t=>t.name===e)??[],t[3]=n,t[4]=e),l=r.flatMap(e),t[0]=n,t[1]=r,t[2]=l}else l=t[2];let u=l,d;t[5]===i?d=t[6]:(d=e=>i(e.map(Tme)),t[5]=i,t[6]=d);let f;t[7]!==o||t[8]!==c?(f=(0,X.jsx)(Cme,{inputId:o,placeholder:c}),t[7]=o,t[8]=c,t[9]=f):f=t[9];let p;return t[10]!==n||t[11]!==a||t[12]!==u||t[13]!==d||t[14]!==f?(p=(0,X.jsx)(fme,{disabled:a,filter:xme,isItemEqualToValue:Sme,items:n,itemToStringLabel:Eme,multiple:!0,onValueChange:d,value:u,children:f}),t[10]=n,t[11]=a,t[12]=u,t[13]=d,t[14]=f,t[15]=p):p=t[15],p}function Tme(e){return e.name}function Eme(e){return e.label}function Dme(e){let t=(0,Z.c)(30),{config:n,onUpdateConfig:r,disabled:i}=e,a=(0,Y.useId)(),o=q8(n),s=ky(),c=o.map(Ome),l;t[0]===r?l=t[1]:(l=e=>{r({waitFor:e})},t[0]=r,t[1]=l);let u=l,d;t[2]!==o||t[3]!==u?(d=e=>{u(e.map(e=>o.find(t=>t.event===e)??{event:e}))},t[2]=o,t[3]=u,t[4]=d):d=t[4];let f=d,p;t[5]!==o||t[6]!==u?(p=e=>{u(o.filter(t=>t.event!==e))},t[5]=o,t[6]=u,t[7]=p):p=t[7];let m=p,h;t[8]!==o||t[9]!==u?(h=(e,t)=>{u(o.map(n=>n.event===e?{event:n.event,...t?{match:t}:{}}:n))},t[8]=o,t[9]=u,t[10]=h):h=t[10];let g=h,_;t[11]===a?_=t[12]:(_=(0,X.jsx)(YZ,{htmlFor:a,children:`Resume when the event is`}),t[11]=a,t[12]=_);let v;t[13]!==s.events||t[14]!==i||t[15]!==a||t[16]!==c||t[17]!==f?(v=s.events.length>0?(0,X.jsx)(O5,{choices:s.events,disabled:i,inputId:a,onValueChange:f,value:c}):(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`This server declares no Events, so there is nothing for a wait to park on. Ask whoever runs it to declare the Event.`}),t[13]=s.events,t[14]=i,t[15]=a,t[16]=c,t[17]=f,t[18]=v):v=t[18];let y;t[19]!==_||t[20]!==v?(y=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[_,v]}),t[19]=_,t[20]=v,t[21]=y):y=t[21];let b;t[22]!==i||t[23]!==m||t[24]!==o||t[25]!==g?(b=o.length===0?(0,X.jsx)(t5,{children:`Name at least one event. A wait with none cannot be resumed by anything, and the workflow will not save.`}):o.map(e=>(0,X.jsx)(kme,{disabled:i,onMatchChange:g,onRemove:m,subscription:e},e.event)),t[22]=i,t[23]=m,t[24]=o,t[25]=g,t[26]=b):b=t[26];let x;return t[27]!==y||t[28]!==b?(x=(0,X.jsxs)(`div`,{className:`space-y-3`,children:[y,b]}),t[27]=y,t[28]=b,t[29]=x):x=t[29],x}function Ome(e){return e.event}function kme(e){let t=(0,Z.c)(59),{subscription:n,onMatchChange:r,onRemove:i,disabled:a}=e,o=_j(R4),s=_j(j4),c=ky(),l;t[0]!==c||t[1]!==n.event?(l=Uy(c,n.event),t[0]=c,t[1]=n.event,t[2]=l):l=t[2];let u=l,d;t[3]===s?d=t[4]:(d=s.filter(Mme).map(jme).find(Ame),t[3]=s,t[4]=d);let f=d,p;t[5]!==c||t[6]!==n.event?(p=afe(c,n.event),t[5]=c,t[6]=n.event,t[7]=p):p=t[7];let m=p,h;t[8]!==r||t[9]!==n.event?(h=e=>{r(n.event,e.model)},t[8]=r,t[9]=n.event,t[10]=h):h=t[10];let g=h,_;t[11]!==r||t[12]!==n.event?(_=()=>{r(n.event,``)},t[11]=r,t[12]=n.event,t[13]=_):_=t[13];let v=_,y;t[14]!==f||t[15]!==u?.correlationPath||t[16]!==n.event?(y=()=>f?e2({rules:f,eventName:n.event,declaredPath:u?.correlationPath}):u?.correlationPath,t[14]=f,t[15]=u?.correlationPath,t[16]=n.event,t[17]=y):y=t[17],u?.correlationPath;let b;t[18]===y?b=t[19]:(b=y(),t[18]=y,t[19]=b);let x=b,S;t[20]!==m||t[21]!==r||t[22]!==x||t[23]!==n.event?(S=()=>{let e=m.find(e=>e.path===x)??m[0];e&&r(n.event,$6(F6(e,{groupId:`${n.event}-group`,conditionId:`${n.event}-rule`})))},t[20]=m,t[21]=r,t[22]=x,t[23]=n.event,t[24]=S):S=t[24];let C=S,w;t[25]===u?w=t[26]:(w=u?(0,X.jsx)(`p`,{className:`truncate text-xs`,children:u.label}):null,t[25]=u,t[26]=w);let T;t[27]===n.event?T=t[28]:(T=(0,X.jsx)(`p`,{className:`truncate font-mono text-xs text-muted-foreground`,children:n.event}),t[27]=n.event,t[28]=T);let E;t[29]===u?E=t[30]:(E=u?null:(0,X.jsx)(`p`,{className:`text-destructive text-xs`,children:`This app no longer declares this Event; the workflow will not save until it is removed or declared again.`}),t[29]=u,t[30]=E);let D;t[31]!==n.event||t[32]!==T||t[33]!==E||t[34]!==w?(D=(0,X.jsxs)(`div`,{className:`min-w-0`,title:n.event,children:[w,T,E]}),t[31]=n.event,t[32]=T,t[33]=E,t[34]=w,t[35]=D):D=t[35];let O=`Remove ${n.event}`,k;t[36]!==i||t[37]!==n.event?(k=()=>i(n.event),t[36]=i,t[37]=n.event,t[38]=k):k=t[38];let A;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,X.jsx)(Ty,{className:`size-3.5`}),t[39]=A):A=t[39];let j;t[40]!==a||t[41]!==O||t[42]!==k?(j=(0,X.jsx)(Jv,{"aria-label":O,className:`size-7 shrink-0`,disabled:a,onClick:k,size:`icon`,type:`button`,variant:`ghost`,children:A}),t[40]=a,t[41]=O,t[42]=k,t[43]=j):j=t[43];let M;t[44]!==D||t[45]!==j?(M=(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[D,j]}),t[44]=D,t[45]=j,t[46]=M):M=t[46];let N;t[47]!==a||t[48]!==m||t[49]!==g||t[50]!==v||t[51]!==C||t[52]!==o||t[53]!==n.event||t[54]!==n.match?(N=n.match?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(e5,{currentNodeId:o??void 0,description:`Only an arrival satisfying this resumes the run. Compare a payload field against a literal, or against a value from this run.`,disabled:a,emptyFieldsMessage:`This Event declares no fields, so there is nothing to match on.`,fields:m,label:`Match`,onChange:g,value:n.match}),(0,X.jsxs)(Jv,{disabled:a,onClick:v,size:`sm`,type:`button`,variant:`ghost`,children:[`Resume on any `,n.event]})]}):(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Any `,n.event,` resumes this run, whatever it carries.`]}),(0,X.jsx)(Jv,{disabled:a||m.length===0,onClick:C,size:`sm`,type:`button`,variant:`outline`,children:`Add a match`})]}),t[47]=a,t[48]=m,t[49]=g,t[50]=v,t[51]=C,t[52]=o,t[53]=n.event,t[54]=n.match,t[55]=N):N=t[55];let P;return t[56]!==M||t[57]!==N?(P=(0,X.jsxs)(`div`,{className:`space-y-2 rounded-md border p-2`,children:[M,N]}),t[56]=M,t[57]=N,t[58]=P):P=t[58],P}function Ame(e){return e!==void 0}function jme(e){return Q0(e.data.config)}function Mme(e){return e.data.type===`lifecycle`}function k5(e){let t=(0,Z.c)(5),{logoUrl:n,label:r,fallback:i}=e,a;t[0]===n?a=t[1]:(a=n?.trim(),t[0]=n,t[1]=a);let o=a;if(!o)return i;let s=`${r} logo`,c;return t[2]!==o||t[3]!==s?(c=(0,X.jsx)(`img`,{alt:s,className:`size-4 rounded-sm object-contain`,height:16,loading:`lazy`,src:o,width:16}),t[2]=o,t[3]=s,t[4]=c):c=t[4],c}function Nme(e){let t=(0,Z.c)(15),{config:n,onUpdateConfig:r,disabled:i}=e,a=_j(R4),o=_j(j4),s=_j(M4),c=ky(),l=a??void 0,u;t[0]!==c||t[1]!==s||t[2]!==o||t[3]!==l?(u=v8({currentNodeId:l,nodes:o,edges:s,catalog:c}),t[0]=c,t[1]=s,t[2]=o,t[3]=l,t[4]=u):u=t[4];let d=u,f;t[5]===r?f=t[6]:(f=e=>{r({conditionModel:e.model,condition:e.expression})},t[5]=r,t[6]=f);let p=f,m=a??void 0,h;t[7]===n?h=t[8]:(h=F2(n,`conditionModel`)??``,t[7]=n,t[8]=h);let g;return t[9]!==i||t[10]!==d||t[11]!==p||t[12]!==m||t[13]!==h?(g=(0,X.jsx)(e5,{currentNodeId:m,description:`Build a condition from the Lifecycle Node and upstream action output fields. Timestamp fields support relative and absolute time filters.`,disabled:i,emptyFieldsMessage:`No upstream fields available. Connect this node to the Lifecycle Node or an action with typed outputs first.`,fields:d,label:`Condition`,onChange:p,value:h}),t[9]=i,t[10]=d,t[11]=p,t[12]=m,t[13]=h,t[14]=g):g=t[14],g}function Pme(){let e=(0,Z.c)(3),t=V8(_j(R4)),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(`p`,{className:`font-medium text-sm`,children:`Splits On Event`}),e[0]=n):n=e[0];let r;return e[1]===t?r=e[2]:(r=(0,X.jsxs)(`div`,{className:`space-y-3 rounded-md border bg-muted/30 p-3`,children:[n,t.length===0?(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`No Event reaches this node yet. Connect it below the Lifecycle Node, and it draws one outlet per Start Event.`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`ul`,{className:`space-y-1`,children:t.map(Fme)}),(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`A run leaves by the outlet naming the Event it arrived on. An outlet with nothing connected ends the run there.`})]})]}),e[1]=t,e[2]=r),r}function Fme(e){return(0,X.jsxs)(`li`,{className:`text-sm`,children:[e.label,(0,X.jsx)(`span`,{className:`ml-2 text-muted-foreground text-xs`,children:e.name})]},e.name)}function Ime(e){let t=(0,Z.c)(87),{config:n,onUpdateConfig:r,disabled:i}=e,a;t[0]===n?a=t[1]:(a=I2(n,`waitGateMode`,`off`),t[0]=n,t[1]=a);let o=a,s;t[2]===n?s=t[3]:(s=F2(n,`waitUntil`),t[2]=n,t[3]=s);let c=s,l;t[4]===n?l=t[5]:(l=F2(n,`waitDuration`),t[4]=n,t[5]=l);let u=l,d;t[6]===n?d=t[7]:(d=G8(n),t[6]=n,t[7]=d);let f=d,p;t[8]===n?p=t[9]:(p=F2(n,`waitAllowedHoursMode`),t[8]=n,t[9]=p);let m=p===`daily_window`,h;t[10]!==n||t[11]!==r?(h=e=>{let t={...n,waitDelayTimingMode:e},i=Object.fromEntries(K8(t).map(Lme));r({...i,waitDelayTimingMode:e})},t[10]=n,t[11]=r,t[12]=h):h=t[12];let g=h,_;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,X.jsx)(`p`,{className:`font-medium text-sm`,children:`Time-Based Wait`}),t[13]=_):_=t[13];let v;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,X.jsx)(YZ,{htmlFor:`waitDelayTimingMode`,children:`Time input mode`}),t[14]=v):v=t[14];let y;t[15]===g?y=t[16]:(y=C6(g),t[15]=g,t[16]=y);let b;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,X.jsx)(E6,{className:`w-full`,id:`waitDelayTimingMode`,children:(0,X.jsx)(T6,{placeholder:`Select time input mode`})}),t[17]=b):b=t[17];let x;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,X.jsxs)(D6,{children:[(0,X.jsx)(k6,{value:`duration`,children:`Wait for duration`}),(0,X.jsx)(k6,{value:`until`,children:`Wait until date/time`})]}),t[18]=x):x=t[18];let S;t[19]!==f||t[20]!==i||t[21]!==y?(S=(0,X.jsxs)(S6,{disabled:i,onValueChange:y,value:f,children:[b,x]}),t[19]=f,t[20]=i,t[21]=y,t[22]=S):S=t[22];let C;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Pick one mode. Switching modes clears fields that do not apply.`}),t[23]=C):C=t[23];let w;t[24]===S?w=t[25]:(w=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[v,S,C]}),t[24]=S,t[25]=w);let T;t[26]!==n||t[27]!==u||t[28]!==c||t[29]!==f||t[30]!==i||t[31]!==r?(T=f===`duration`?(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(YZ,{htmlFor:`waitDuration`,children:`Wait for (duration)`}),(0,X.jsx)(O8,{disabled:i,fieldType:U8.waitDuration.type,id:`waitDuration`,onChange:e=>r({waitDuration:e}),placeholder:`24h, 90m, 3600000, or P1D`,value:u}),(0,X.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Example: use `,(0,X.jsx)(`code`,{children:`24h`}),` to continue one day later.`]})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(YZ,{htmlFor:`waitUntil`,children:`Wait until this date/time`}),(0,X.jsx)(O8,{disabled:i,fieldType:U8.waitUntil.type,id:`waitUntil`,onChange:e=>r({waitUntil:e}),placeholder:`2026-03-10T09:00:00-05:00 or {{@lifecycle_1:Lifecycle.appointment.startsAt}}`,value:c}),(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Use this when timing comes from payload data, like an appointment start time.`})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(YZ,{htmlFor:`waitOffset`,children:`Send before/after that time (optional)`}),(0,X.jsx)(O8,{disabled:i,fieldType:U8.waitOffset.type,id:`waitOffset`,onChange:e=>r({waitOffset:e}),placeholder:`-1d, 6h, 30m`,value:F2(n,`waitOffset`)}),(0,X.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Example: `,(0,X.jsx)(`code`,{children:`-1d`}),` sends one day before the target time.`]})]})]}),t[26]=n,t[27]=u,t[28]=c,t[29]=f,t[30]=i,t[31]=r,t[32]=T):T=t[32];let E;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,X.jsx)(YZ,{htmlFor:`waitGateMode`,children:`Continue only if time actually elapsed`}),t[33]=E):E=t[33];let D;t[34]===r?D=t[35]:(D=e=>r({waitGateMode:e}),t[34]=r,t[35]=D);let O;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,X.jsx)(E6,{className:`w-full`,id:`waitGateMode`,children:(0,X.jsx)(T6,{placeholder:`Select behavior`})}),t[36]=O):O=t[36];let k;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,X.jsxs)(D6,{children:[(0,X.jsx)(k6,{value:`off`,children:`Off (continue immediately)`}),(0,X.jsx)(k6,{value:`require_actual_wait`,children:`Skip branch when already due`})]}),t[37]=k):k=t[37];let A;t[38]!==i||t[39]!==D||t[40]!==o?(A=(0,X.jsxs)(S6,{disabled:i,onValueChange:D,value:o,children:[O,k]}),t[38]=i,t[39]=D,t[40]=o,t[41]=A):A=t[41];let j;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Prevents immediate sends when the computed time is now or in the past after an update/reschedule.`}),t[42]=j):j=t[42];let M;t[43]===A?M=t[44]:(M=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[E,A,j]}),t[43]=A,t[44]=M);let N;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,X.jsx)(YZ,{htmlFor:`waitAllowedHoursMode`,children:`Allowed send window`}),t[45]=N):N=t[45];let P;t[46]===r?P=t[47]:(P=e=>r({waitAllowedHoursMode:e}),t[46]=r,t[47]=P);let F;t[48]===n?F=t[49]:(F=I2(n,`waitAllowedHoursMode`,`off`),t[48]=n,t[49]=F);let I;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,X.jsx)(E6,{className:`w-full`,id:`waitAllowedHoursMode`,children:(0,X.jsx)(T6,{placeholder:`Select window mode`})}),t[50]=I):I=t[50];let L;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,X.jsxs)(D6,{children:[(0,X.jsx)(k6,{value:`off`,children:`Off (allow any time)`}),(0,X.jsx)(k6,{value:`daily_window`,children:`Daily window`})]}),t[51]=L):L=t[51];let R;t[52]!==i||t[53]!==P||t[54]!==F?(R=(0,X.jsxs)(S6,{disabled:i,onValueChange:P,value:F,children:[I,L]}),t[52]=i,t[53]=P,t[54]=F,t[55]=R):R=t[55];let z;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`When enabled, times outside the window shift to the next allowed start.`}),t[56]=z):z=t[56];let B;t[57]===R?B=t[58]:(B=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[N,R,z]}),t[57]=R,t[58]=B);let V;t[59]!==n||t[60]!==i||t[61]!==m||t[62]!==r?(V=m&&(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(YZ,{htmlFor:`waitAllowedStartTime`,children:`Window start`}),(0,X.jsx)(JZ,{disabled:i,id:`waitAllowedStartTime`,onChange:e=>r({waitAllowedStartTime:e.target.value}),placeholder:`09:00`,value:F2(n,`waitAllowedStartTime`)})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(YZ,{htmlFor:`waitAllowedEndTime`,children:`Window end`}),(0,X.jsx)(JZ,{disabled:i,id:`waitAllowedEndTime`,onChange:e=>r({waitAllowedEndTime:e.target.value}),placeholder:`17:00`,value:F2(n,`waitAllowedEndTime`)})]}),(0,X.jsx)(`p`,{className:`col-span-2 text-muted-foreground text-xs`,children:`Use 24-hour format (HH:MM). Start must be before end. Requires timezone below.`})]}),t[59]=n,t[60]=i,t[61]=m,t[62]=r,t[63]=V):V=t[63];let H=m?` (required for send window)`:` (optional)`,U;t[64]===H?U=t[65]:(U=(0,X.jsxs)(YZ,{htmlFor:`waitTimezone`,children:[`Timezone`,H]}),t[64]=H,t[65]=U);let W;t[66]===r?W=t[67]:(W=e=>r({waitTimezone:e}),t[66]=r,t[67]=W);let G;t[68]===n?G=t[69]:(G=I2(n,`waitTimezone`,`UTC`),t[68]=n,t[69]=G);let K;t[70]!==i||t[71]!==W||t[72]!==G?(K=(0,X.jsx)(bfe,{disabled:i,id:`waitTimezone`,onValueChange:W,value:G}),t[70]=i,t[71]=W,t[72]=G,t[73]=K):K=t[73];let q=m&&` Also determines when the daily send window applies.`,J;t[74]===q?J=t[75]:(J=(0,X.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Used when the target date/time does not include an offset.`,q]}),t[74]=q,t[75]=J);let ee;t[76]!==U||t[77]!==K||t[78]!==J?(ee=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[U,K,J]}),t[76]=U,t[77]=K,t[78]=J,t[79]=ee):ee=t[79];let te;return t[80]!==w||t[81]!==T||t[82]!==M||t[83]!==B||t[84]!==V||t[85]!==ee?(te=(0,X.jsxs)(`div`,{className:`space-y-3 rounded-md border bg-muted/30 p-3`,children:[_,w,T,M,B,V,ee]}),t[80]=w,t[81]=T,t[82]=M,t[83]=B,t[84]=V,t[85]=ee,t[86]=te):te=t[86],te}function Lme(e){return[e,``]}function Rme(e){let t=(0,Z.c)(35),{config:n,onUpdateConfig:r,disabled:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(`p`,{className:`font-medium text-sm`,children:`Wait for Event`}),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==i||t[3]!==r?(o=(0,X.jsx)(Dme,{config:n,disabled:i,onUpdateConfig:r}),t[1]=n,t[2]=i,t[3]=r,t[4]=o):o=t[4];let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(YZ,{htmlFor:`waitTimeout`,children:`Stop waiting after`}),t[5]=s):s=t[5];let c;t[6]===r?c=t[7]:(c=e=>r({waitTimeout:e}),t[6]=r,t[7]=c);let l;t[8]===n?l=t[9]:(l=F2(n,`waitTimeout`),t[8]=n,t[9]=l);let u;t[10]!==i||t[11]!==c||t[12]!==l?(u=(0,X.jsx)(O8,{disabled:i,fieldType:U8.waitTimeout.type,id:`waitTimeout`,onChange:c,placeholder:`7d`,value:l}),t[10]=i,t[11]=c,t[12]=l,t[13]=u):u=t[13];let d;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Required. A wait with no end holds a run, and a place in the run list, until somebody notices.`}),t[14]=d):d=t[14];let f;t[15]===u?f=t[16]:(f=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[s,u,d]}),t[15]=u,t[16]=f);let p;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,X.jsx)(YZ,{htmlFor:`waitTimeoutBehavior`,children:`On timeout`}),t[17]=p):p=t[17];let m;t[18]===r?m=t[19]:(m=e=>r({waitTimeoutBehavior:e}),t[18]=r,t[19]=m);let h;t[20]===n?h=t[21]:(h=I2(n,`waitTimeoutBehavior`,`continue`),t[20]=n,t[21]=h);let g;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,X.jsx)(E6,{className:`w-full`,id:`waitTimeoutBehavior`,children:(0,X.jsx)(T6,{placeholder:`Select timeout behavior`})}),t[22]=g):g=t[22];let _;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,X.jsxs)(D6,{children:[(0,X.jsx)(k6,{value:`continue`,children:`Continue workflow`}),(0,X.jsx)(k6,{value:`skip`,children:`Skip remaining branch`})]}),t[23]=_):_=t[23];let v;t[24]!==i||t[25]!==m||t[26]!==h?(v=(0,X.jsxs)(S6,{disabled:i,onValueChange:m,value:h,children:[g,_]}),t[24]=i,t[25]=m,t[26]=h,t[27]=v):v=t[27];let y;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Choose whether to continue downstream nodes or halt the branch when the timeout expires.`}),t[28]=y):y=t[28];let b;t[29]===v?b=t[30]:(b=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[p,v,y]}),t[29]=v,t[30]=b);let x;return t[31]!==b||t[32]!==o||t[33]!==f?(x=(0,X.jsxs)(`div`,{className:`space-y-3 rounded-md border bg-muted/30 p-3`,children:[a,o,f,b]}),t[31]=b,t[32]=o,t[33]=f,t[34]=x):x=t[34],x}function zme(e){let t=(0,Z.c)(31),{config:n,onUpdateConfig:r,disabled:i}=e,a;t[0]===n?a=t[1]:(a=I2(n,`waitMode`,`delay`),t[0]=n,t[1]=a);let o=a,s;t[2]!==n||t[3]!==r?(s=e=>{let t={...n,waitMode:e},i=Object.fromEntries(K8(t).map(Bme));r({...i,waitMode:e,...e===`event`&&!(F2(n,`waitTimeout`)??``).trim()?{waitTimeout:`7d`}:{}})},t[2]=n,t[3]=r,t[4]=s):s=t[4];let c=s,l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,X.jsx)(YZ,{htmlFor:`waitMode`,children:`How should this step wait?`}),t[5]=l):l=t[5];let u;t[6]===c?u=t[7]:(u=C6(c),t[6]=c,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsx)(E6,{className:`w-full`,id:`waitMode`,children:(0,X.jsx)(T6,{placeholder:`Select wait mode`})}),t[8]=d):d=t[8];let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,X.jsxs)(D6,{children:[(0,X.jsx)(k6,{value:`delay`,children:`Wait for time`}),(0,X.jsx)(k6,{value:`event`,children:`Wait for an event`})]}),t[9]=f):f=t[9];let p;t[10]!==i||t[11]!==u||t[12]!==o?(p=(0,X.jsxs)(S6,{disabled:i,onValueChange:u,value:o,children:[d,f]}),t[10]=i,t[11]=u,t[12]=o,t[13]=p):p=t[13];let m;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Resume on a clock, or when an event arrives that this step's match accepts.`}),t[14]=m):m=t[14];let h;t[15]===p?h=t[16]:(h=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[l,p,m]}),t[15]=p,t[16]=h);let g;t[17]!==n||t[18]!==i||t[19]!==r||t[20]!==o?(g=o===`delay`&&(0,X.jsx)(Ime,{config:n,disabled:i,onUpdateConfig:r}),t[17]=n,t[18]=i,t[19]=r,t[20]=o,t[21]=g):g=t[21];let _;t[22]!==n||t[23]!==i||t[24]!==r||t[25]!==o?(_=o===`event`&&(0,X.jsx)(Rme,{config:n,disabled:i,onUpdateConfig:r}),t[22]=n,t[23]=i,t[24]=r,t[25]=o,t[26]=_):_=t[26];let v;return t[27]!==g||t[28]!==_||t[29]!==h?(v=(0,X.jsxs)(X.Fragment,{children:[h,g,_]}),t[27]=g,t[28]=_,t[29]=h,t[30]=v):v=t[30],v}function Bme(e){return[e,``]}function Vme(e){let t=(0,Z.c)(9),{actionType:n,config:r,onUpdateConfig:i,disabled:a}=e;switch(n){case Y0.condition:{let e;return t[0]!==r||t[1]!==a||t[2]!==i?(e=(0,X.jsx)(Nme,{config:r,disabled:a,onUpdateConfig:i}),t[0]=r,t[1]=a,t[2]=i,t[3]=e):e=t[3],e}case Y0.eventSplit:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Pme,{}),t[4]=e):e=t[4],e}case Y0.wait:{let e;return t[5]!==r||t[6]!==a||t[7]!==i?(e=(0,X.jsx)(zme,{config:r,disabled:a,onUpdateConfig:i}),t[5]=r,t[6]=a,t[7]=i,t[8]=e):e=t[8],e}default:return null}}function Hme(){let e=(0,Z.c)(2),t=ky(),n;if(e[0]!==t){let r=rne(t);n=Object.fromEntries(Object.entries(r).map(Ume)),e[0]=t,e[1]=n}else n=e[1];return n}function Ume(e){let[t,n]=e;return[t,n.map(Wme)]}function Wme(e){return{id:e.id,label:e.label,logoUrl:e.logoUrl,integration:e.integration}}function Gme(e,t){return Wy(e,t)?.category??null}function Kme(e){let t=(0,Z.c)(81),{config:n,onUpdateConfig:r,disabled:i,isOwner:a}=e,o=a===void 0||a,s=ky(),c=F2(n,`actionType`),l=Hme(),u;t[0]===l?u=t[1]:(u=Object.keys(l).filter(Yme).toSorted(),t[0]=l,t[1]=u);let d=u,f=c&&Gme(s,c)||``,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=k2(),t[2]=p):p=t[2];let{data:m}=Xe(p),h;t[3]===m?h=t[4]:(h=m===void 0?[]:m,t[3]=m,t[4]=h);let g=h,{push:_}=cZ(),v;t[5]!==l||t[6]!==r?(v=e=>{let t=l[e]?.[0];t&&r({actionType:t.id})},t[5]=l,t[6]=r,t[7]=v):v=t[7];let y=v,b;t[8]===r?b=t[9]:(b=e=>{r({actionType:e})},t[8]=r,t[9]=b);let x=b,S=c?Wy(s,c):void 0,C=S?.integration,w;if(t[10]!==g||t[11]!==C){let e;t[13]===C?e=t[14]:(e=e=>e.type===C,t[13]=C,t[14]=e),w=g.some(e),t[10]=g,t[11]=C,t[12]=w}else w=t[12];let T=w,E;t[15]!==C||t[16]!==r||t[17]!==_?(E=()=>{C&&_(i3,{type:C,onSuccess:e=>{r({integrationId:e})}})},t[15]=C,t[16]=r,t[17]=_,t[18]=E):E=t[18];let D=E,O;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,X.jsx)(YZ,{className:`ml-1`,htmlFor:`actionCategory`,children:`Service`}),t[19]=O):O=t[19];let k;t[20]===y?k=t[21]:(k=C6(y),t[20]=y,t[21]=k);let A=f||void 0,j;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,X.jsx)(E6,{className:`w-full`,id:`actionCategory`,children:(0,X.jsx)(T6,{placeholder:`Select category`})}),t[22]=j):j=t[22];let M;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,X.jsx)(k6,{value:`System`,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Sy,{className:`size-4`}),(0,X.jsx)(`span`,{children:`System`})]})}),t[23]=M):M=t[23];let N;t[24]===d.length?N=t[25]:(N=d.length>0&&(0,X.jsx)($ue,{}),t[24]=d.length,t[25]=N);let P;if(t[26]!==l||t[27]!==d){let e;t[29]===l?e=t[30]:(e=e=>{let t=l[e],n=t?.[0]?.integration,r=t?.map(Jme).find(qme);return(0,X.jsx)(k6,{value:e,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(k5,{fallback:n?(0,X.jsx)(t3,{className:`size-4`,integration:n}):(0,X.jsx)(Ey,{className:`size-4`}),label:e,logoUrl:r}),(0,X.jsx)(`span`,{children:e})]})},e)},t[29]=l,t[30]=e),P=d.map(e),t[26]=l,t[27]=d,t[28]=P}else P=t[28];let F;t[31]!==N||t[32]!==P?(F=(0,X.jsxs)(D6,{children:[M,N,P]}),t[31]=N,t[32]=P,t[33]=F):F=t[33];let I;t[34]!==i||t[35]!==k||t[36]!==A||t[37]!==F?(I=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[O,(0,X.jsxs)(S6,{disabled:i,onValueChange:k,value:A,children:[j,F]})]}),t[34]=i,t[35]=k,t[36]=A,t[37]=F,t[38]=I):I=t[38];let L;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,X.jsx)(YZ,{className:`ml-1`,htmlFor:`actionType`,children:`Action`}),t[39]=L):L=t[39];let R=i||!f,z;t[40]===x?z=t[41]:(z=C6(x),t[40]=x,t[41]=z);let B=c||void 0,V;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,X.jsx)(E6,{className:`w-full`,id:`actionType`,children:(0,X.jsx)(T6,{placeholder:`Select action`})}),t[42]=V):V=t[42];let H;t[43]!==l||t[44]!==f?(H=f&&l[f]?.map(e=>{let t;return t=f===`System`?(0,X.jsx)(Sy,{className:`size-4`}):e.integration?(0,X.jsx)(t3,{className:`size-4`,integration:e.integration}):(0,X.jsx)(Ey,{className:`size-4`}),(0,X.jsx)(k6,{value:e.id,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(k5,{fallback:t,label:e.label,logoUrl:e.logoUrl}),(0,X.jsx)(`span`,{children:e.label})]})},e.id)}),t[43]=l,t[44]=f,t[45]=H):H=t[45];let U;t[46]===H?U=t[47]:(U=(0,X.jsx)(D6,{children:H}),t[46]=H,t[47]=U);let W;t[48]!==R||t[49]!==z||t[50]!==B||t[51]!==U?(W=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[L,(0,X.jsxs)(S6,{disabled:R,onValueChange:z,value:B,children:[V,U]})]}),t[48]=R,t[49]=z,t[50]=B,t[51]=U,t[52]=W):W=t[52];let G;t[53]!==I||t[54]!==W?(G=(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[I,W]}),t[53]=I,t[54]=W,t[55]=G):G=t[55];let K;t[56]!==n||t[57]!==i||t[58]!==T||t[59]!==C||t[60]!==o||t[61]!==r||t[62]!==D?(K=C&&o&&(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsxs)(`div`,{className:`ml-1 flex items-center justify-between`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(YZ,{children:`Connection`}),(0,X.jsx)(L8,{children:(0,X.jsxs)(R8,{children:[(0,X.jsx)(z8,{render:(0,X.jsx)(`span`,{className:`inline-flex`,children:(0,X.jsx)(cy,{className:`size-3.5 text-muted-foreground`})}),children:(0,X.jsx)(`span`,{className:`sr-only`,children:`Connection help`})}),(0,X.jsx)(B8,{children:(0,X.jsx)(`p`,{children:`API key or OAuth credentials for this service`})})]})})]}),T&&(0,X.jsx)(Jv,{"aria-label":`Add connection`,className:`size-6`,disabled:i,onClick:D,size:`icon`,variant:`ghost`,children:(0,X.jsx)(yy,{className:`size-4`})})]}),(0,X.jsx)(tue,{disabled:i,integrationType:C,onChange:e=>r({integrationId:e}),value:F2(n,`integrationId`)})]}),t[56]=n,t[57]=i,t[58]=T,t[59]=C,t[60]=o,t[61]=r,t[62]=D,t[63]=K):K=t[63];let q;t[64]===n?q=t[65]:(q=F2(n,`actionType`)??``,t[64]=n,t[65]=q);let J;t[66]!==n||t[67]!==i||t[68]!==r||t[69]!==q?(J=(0,X.jsx)(Vme,{actionType:q,config:n,disabled:i,onUpdateConfig:r}),t[66]=n,t[67]=i,t[68]=r,t[69]=q,t[70]=J):J=t[70];let ee;t[71]!==S||t[72]!==n||t[73]!==i||t[74]!==r?(ee=S&&S.configFields.length>0&&(0,X.jsx)(spe,{config:n,disabled:i,fields:S.configFields,onUpdateConfig:r}),t[71]=S,t[72]=n,t[73]=i,t[74]=r,t[75]=ee):ee=t[75];let te;return t[76]!==G||t[77]!==K||t[78]!==J||t[79]!==ee?(te=(0,X.jsxs)(X.Fragment,{children:[G,K,J,ee]}),t[76]=G,t[77]=K,t[78]=J,t[79]=ee,t[80]=te):te=t[80],te}function qme(e){return typeof e==`string`&&e.trim().length>0}function Jme(e){return e.logoUrl}function Yme(e){return e!==`System`}var A5=Y.createContext(void 0);function j5(e){let t=Y.useContext(A5);if(t===void 0&&!e)throw Error(Jg(33));return t}var M5=Y.createContext(void 0);function N5(e){let t=Y.useContext(M5);if(t===void 0&&!e)throw Error(Jg(36));return t}var Xme=Y.createContext(void 0);function P5(e=!0){let t=Y.useContext(Xme);if(t===void 0&&!e)throw Error(Jg(25));return t}function Zme(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=P5(!0),f=d!==void 0;return Y.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:LU})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!bW&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&Qg(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var F5={type:`regular-item`};function I5(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=Y.useRef(null),{getButtonProps:d,buttonRef:f}=$g({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Zme({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=Y.useCallback(e=>Rg(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=t_(u,f);return Y.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var L5=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.highlighted=`data-highlighted`,e}({}),R5={checked(e){return e?{[L5.checked]:``}:{[L5.unchecked]:``}},...xU},Qme=Y.createContext(void 0),$me=Y.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=h6({guess:!0,label:a}),f=j5(!0),p=aW(i),{store:m}=N5(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=I5({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:F5});return l_(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})}),z5=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=N5(),{side:c,align:l}=j5(),u=c6(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`hoverEnabled`),w=s.useState(`disabled`),T=s.useState(`openMethod`),E=_.type===`context-menu`;UJ({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),Y.useEffect(()=>{function e(e){s.setOpen(!1,QU(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]),wY(b,{enabled:C&&!w&&!E&&_.type!==`menubar`,closeDelay:S});let D=s.useStateSetter(`popupElement`),O=l_(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,D],stateAttributesMapping:AU,props:[p,{onKeyDown(e){u&&XY.has(e.key)&&e.stopPropagation()}},r6(f),o,{"data-rootownerid":y}]}),k=_.type===void 0||E;return(g||_.type===`menubar`&&v!==`outside-press`)&&(k=!0),(0,X.jsx)(pq,{context:b,openInteractionType:T,modal:E,disabled:!m,returnFocus:a===void 0?k:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:O})}),B5=Y.createContext(void 0);function ehe(){let e=Y.useContext(B5);if(e===void 0)throw Error(Jg(32));return e}var V5=Y.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=N5();return i.useState(`mounted`)||n?(0,X.jsx)(B5.Provider,{value:n,children:(0,X.jsx)(JK,{ref:t,...r})}):null}),H5=Y.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=VK,style:g,..._}=e,{store:v}=N5(),y=ehe(),b=P5(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),T=v.useState(`open`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`activeTriggerElement`),k=v.useState(`transitionStatus`),A=v.useState(`positionerElement`),j=v.useState(`instantType`),M=v.useState(`adaptiveOrigin`),N=v.useState(`lastOpenChangeReason`),P=v.useState(`floatingNodeId`),F=v.useState(`floatingParentNodeId`),I=S.useState(`domReferenceElement`),L=Y.useRef(null),R=HJ(A),z=n,B=c,V=l,H=s,U=h;x.type===`context-menu`&&(z=n??x.context?.anchor,H??=`start`,!o&&H!==`center`&&(V=e.alignOffset??2,B=e.sideOffset??-5));let W=o,G=H;x.type===`menu`?(W??=`inline-end`,G??=`start`,U=e.collisionAvoidance??HK):x.type===`menubar`&&(W??=x.context.orientation===`vertical`?`inline-end`:`bottom`,G??=`start`);let K=x.type===`context-menu`,q=Z3({anchor:z,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:W,sideOffset:B,align:G,alignOffset:V,arrowPadding:K?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:P,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:U,shift:K?{crossAxis:!(`side`in U&&U.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:C,adaptiveOrigin:M});Y.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===P&&v.set(`hoverEnabled`,!1),e.nodeId!==P&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,QU(JU)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,P]),Y.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,QU(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let J=uW();Y.useEffect(()=>{T||J.clear()},[T,J]),Y.useEffect(()=>{function e(e){if(!(!T||e.nodeId!==v.select(`floatingParentNodeId`))){if(e.target&&O&&O!==e.target){let e=v.select(`closeDelay`);e>0?J.isStarted()||J.start(e,()=>{v.setOpen(!1,QU(JU))}):v.setOpen(!1,QU(JU))}else J.clear()}}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,O,v,J]),Y.useEffect(()=>{let e={open:T,nodeId:P,parentNodeId:F,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,P,F]),Q(()=>{let e=I,t=L.current;if(e&&(L.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return R(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,R,v]);let ee={open:T,side:q.side,align:q.align,anchorHidden:q.anchorHidden,nested:x.type===`menu`,instant:j},te=x.type===`menubar`&&x.context.modal;a6(T&&(te||E&&N!==`trigger-hover`),D===`touch`,A,O);let ne=i6(e,ee,{styles:q.positionerStyles,transitionStatus:k,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),re=w&&x.type!==`menu`&&(x.type!==`menubar`&&E&&N!==`trigger-hover`||x.type===`menubar`&&x.context.modal),ie=null;return x.type===`menubar`?ie=x.context.contentElement:x.type===void 0&&(ie=O),(0,X.jsxs)(A5.Provider,{value:q,children:[re&&(0,X.jsx)(sX,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:oX(!T),cutout:ie}),(0,X.jsx)(nq,{id:P,children:(0,X.jsx)(W3,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:ne})})]})}),U5=Y.createContext(void 0);function the(){let e=Y.useContext(U5);if(e===void 0)throw Error(Jg(34));return e}var nhe=Y.memo(Y.forwardRef(function(e,t){let{render:n,className:r,value:i,defaultValue:a,onValueChange:o,disabled:s=!1,style:c,"aria-labelledby":l,...u}=e,[d,f]=Y.useState(void 0),[p,m]=d3({controlled:i,default:a,name:`MenuRadioGroup`}),h=Ng((e,t)=>{o?.(e,t),!t.isCanceled&&m(e)}),g=l_(`div`,e,{state:{disabled:s},ref:t,props:{role:`group`,"aria-labelledby":l??d,"aria-disabled":s||void 0,...u}}),_=Y.useMemo(()=>({value:p,setValue:h,disabled:s}),[p,h,s]);return(0,X.jsx)(Qme.Provider,{value:f,children:(0,X.jsx)(U5.Provider,{value:_,children:g})})})),W5=Y.createContext(void 0);function rhe(){let e=Y.useContext(W5);if(e===void 0)throw Error(Jg(35));return e}var ihe=Y.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,value:l,style:u,...d}=e,f=h6({guess:!0,label:a}),p=j5(!0),m=aW(i),{store:h}=N5(),g=h.useState(`isActive`,f.index),_=h.useState(`itemProps`),{value:v,setValue:y,disabled:b}=the(),x=h.useState(`disabled`),S=s||b||x,C=v===l,{getItemProps:w,itemRef:T}=I5({closeOnClick:c,disabled:S,highlighted:g,id:m,store:h,nativeButton:o,nodeId:p?.context.nodeId,itemMetadata:F5}),E=Y.useMemo(()=>({disabled:S,highlighted:g,checked:C}),[S,g,C]);function D(e){let t=QU(LU,e.nativeEvent,void 0,{preventUnmountOnClose:o_});y(l,t)}let O=l_(`div`,e,{state:E,stateAttributesMapping:R5,props:[_,{role:`menuitemradio`,"aria-checked":C,onClick:D},d,w],ref:[T,t,f.ref]});return(0,X.jsx)(W5.Provider,{value:E,children:O})}),ahe=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=rhe(),c=Y.useRef(null),{transitionStatus:l,mounted:u,setMounted:d}=VJ(s.checked);return UJ({open:s.checked,ref:c,onComplete(){s.checked||d(!1)}}),l_(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},stateAttributesMapping:R5,ref:[t,c],props:{"aria-hidden":!0,...o},enabled:a||u})}),ohe=Y.createContext(null);function G5(e){let t=Y.useContext(ohe);if(t===null&&!e)throw Error(Jg(5));return t}var she={...fY,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},che=class extends LJ{constructor(e){super({...uhe(),...e},lhe(),she),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null};function lhe(){return{positionerRef:Y.createRef(),popupRef:Y.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:Y.createRef(),beforeContentFocusGuardRef:Y.createRef(),onOpenChangeComplete:void 0,triggerElements:new rY}}function uhe(){return{...aY(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new XK,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:c_,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0}}var K5=Y.createContext(void 0);function q5(){return Y.useContext(K5)}var J5=OJ(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=P5(!0),_=N5(!0),v=G5(!0),y=q5(),b=Y.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=dhe({open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:b});x.useControlledProp(`openProp`,n),x.useControlledProp(`triggerIdProp`,p),x.useContextCallback(`onOpenChangeComplete`,i);let S=iW(),C=iW(),w=x.useState(`floatingTreeRoot`),T=tq(w),E=$K(),D=x.useState(`open`),O=x.useState(`activeTriggerElement`),k=x.useState(`positionerElement`),A=x.useState(`hoverEnabled`),j=x.useState(`disabled`),M=x.useState(`lastOpenChangeReason`),N=x.useState(`parent`),P=x.useState(`activeIndex`),F=x.useState(`payload`),I=x.useState(`floatingParentNodeId`),L=Y.useRef(null),R=Y.useRef(N.type!==`context-menu`),z=uW(),B=Y.useRef(!0),V=uW(),H=I!=null,{openMethod:U,triggerProps:W}=MX(D);x.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:N.type===void 0?s:void 0,openMethod:U,rootId:S}),$J(x);let{forceUnmount:G}=eY(D,x,()=>{x.set(`allowMouseEnter`,!1)});Q(()=>{g&&!_?x.update({parent:{type:`context-menu`,context:g},floatingNodeId:T,floatingParentNodeId:E}):_&&x.update({floatingNodeId:T,floatingParentNodeId:E})},[g,_,T,E,x]),Y.useEffect(()=>{if(D||(L.current=null),N.type===`context-menu`){if(!D){z.clear(),R.current=!1;return}z.start(500,()=>{R.current=!0})}},[z,D,N.type]),Q(()=>{!D&&!A&&x.set(`hoverEnabled`,!0)},[D,A,x]);let K=Ng((e,t)=>{let n=t.reason;if(!e&&!x.select(`open`)||D===e&&t.trigger===O&&M===n)return;let i=XJ(t);if(!e&&t.trigger==null&&(t.trigger=O??void 0),r?.(e,t),t.isCanceled)return;x.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!B.current)return;e&&n===`trigger-focus`?(B.current=!1,V.start(300,()=>{B.current=!0})):(B.current=!0,V.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null),c={open:e,openChangeReason:n};L.current=t.event,YJ(c,e,t.trigger,i()),x.update(c),N.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?x.set(`instantType`,`group`):o||s?x.set(`instantType`,o?`click`:`dismiss`):x.set(`instantType`,void 0)}),q=BJ({popupStore:x,floatingId:C,nested:E!=null,onOpenChange:K}),J=q.context.events;Q(()=>{let e=({open:e,eventDetails:t})=>K(e,t);return J.on(`setOpen`,e),()=>{J?.off(`setOpen`,e)}},[J,K]);let ee=Y.useCallback(()=>{x.setOpen(!1,QU(XU))},[x]);Y.useImperativeHandle(u,()=>({unmount:G,close:ee}),[G,ee]);let te;N.type===`context-menu`&&(te=N.context),Y.useImperativeHandle(te?.positionerRef,()=>k,[k]),Y.useImperativeHandle(te?.actionsRef,()=>({setOpen:K}),[K]);let ne=bq(q,{enabled:!j,bubbles:{escapeKey:d&&N.type===`menu`},outsidePress(){return N.type!==`context-menu`||L.current?.type===`contextmenu`||R.current},externalTree:H?w:void 0}),re=K3(),ie=Y.useCallback(e=>{x.select(`activeIndex`)!==e&&x.set(`activeIndex`,e)},[x]),ae=PY(q,{enabled:!j,listRef:x.context.itemDomElements,activeIndex:P,nested:N.type!==void 0,loopFocus:c,orientation:l,parentOrientation:N.type===`menubar`?N.context.orientation:void 0,rtl:re===`rtl`,disabledIndices:s_,onNavigate:ie,openOnArrowKeyDown:N.type!==`context-menu`,externalTree:H?w:void 0,focusItemOnHover:h}),oe=Y.useCallback(e=>{x.context.typingRef.current=e},[x]),se=FY(q,{enabled:!j,listRef:x.context.itemLabels,elementsRef:x.context.itemDomElements,activeIndex:P,resetMs:500,onMatch:e=>{D&&e!==P&&x.set(`activeIndex`,e)},onTyping:oe});tY(x,{floatingRootContext:q,activeTriggerProps:Y.useMemo(()=>{let e=Rg(se.reference,ae.reference,ne.reference,{onMouseMove(){x.set(`allowMouseEnter`,!0)}},W);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=D,e},[x,se.reference,ae.reference,ne.reference,W,D]),inactiveTriggerProps:Y.useMemo(()=>{let e=Rg(ae.trigger,ne.trigger,W);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[ae.trigger,ne.trigger,W]),popupProps:Y.useMemo(()=>Rg(WJ,{id:C,role:`menu`,"aria-labelledby":O?.id,onMouseMove(){x.set(`allowMouseEnter`,!0),N.type===`menu`&&x.set(`hoverEnabled`,!1)},onClick(){x.select(`hoverEnabled`)&&x.set(`hoverEnabled`,!1)},onKeyDown(e){let t=x.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},se.floating,ae.floating,ne.floating),[O,C,N.type,x,se.floating,ae.floating,ne.floating]),itemProps:ae.item??c_});let ce=Y.useMemo(()=>({store:x,parent:b}),[x,b]),le=(0,X.jsxs)(M5.Provider,{value:ce,children:[f&&(0,X.jsx)(qJ,{handle:f,store:x}),typeof t==`function`?t({payload:F}):t]});return N.type===void 0||N.type===`context-menu`?(0,X.jsx)(rq,{externalTree:w,children:le}):le});function dhe(e){return Ag(()=>new che(e)).current}function fhe(e){let t=N5().store,n=Y.useMemo(()=>({parentMenu:t}),[t]);return(0,X.jsx)(K5.Provider,{value:n,children:(0,X.jsx)(J5,{...e})})}function phe(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Xg(),{ref:i,index:a}=h6(e),o=n===a,s=Y.useRef(null),c=t_(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function Y5(e){let{render:t,className:n,style:r,state:i=c_,props:a=s_,refs:o=s_,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=phe({metadata:s});return l_(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function X5(e){if(lg(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!xg(e))return X5(wg(e))}function mhe(e,t){let n=Y.useRef(null);function r(t){Xi.flushSync(()=>{e.setOpen(!1,QU(HU,t.nativeEvent,t.currentTarget))}),yK(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&bK(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{Xi.flushSync(()=>{e.setOpen(!1,QU(HU,n.nativeEvent,n.currentTarget))});let i=vK(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&zW(r,i);){let e=i;if(i=hK(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function hhe(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=Y.useRef(!1);return Y.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Zg(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:c_,[t,n,r])}var ghe=kJ(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=N5(!0),h=pY(d)??m?.store;if(!h)throw Error(Jg(85));let g=aW(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=Y.useRef(null),S=vhe(),C=Xg(!0),w=eq(),T=Y.useMemo(()=>w??new XK,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=QJ(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:tq(T),floatingParentNodeId:$K(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=$g({disabled:A,native:o});Y.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=Y.useRef(null),P=uW(),F=Ng(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;zW(N.current,t)||zW(h.select(`positionerElement`),t)||t===N.current||(t==null||X5(t)!==h.select(`rootId`))&&(H3(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:qU}))});Y.useEffect(()=>{y&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&Zg(N.current).addEventListener(`mouseup`,F,{once:!0})},[y,F,h]);let I=O&&S.context.hasSubmenuOpen,L=EY(v,{enabled:(c??I)&&!A&&(!O||I&&!D),handleClose:UY({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),R=_he(y,h.select(`lastOpenChangeReason`)),z=mq(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&R}),B=vY(v,{enabled:!A&&I}),V=hhe({open:y,enabled:O,mouseDownAction:`open`}),H=Y.useMemo(()=>Rg(B.reference,z.reference),[B.reference,z.reference]),U=h.useState(`triggerProps`,D),{preFocusGuardRef:W,handlePreFocusGuardFocus:G,handleFocusTargetFocus:K}=mhe(h,x),q={disabled:A,open:y},J=[N,t,M,E,x],ee=[H,L??c_,U,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Zg(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},O?{role:`menuitem`}:{},V,p,j],te=l_(`button`,e,{enabled:!O,stateAttributesMapping:OU,state:q,ref:J,props:ee});return O?(0,X.jsx)(Y5,{tag:`button`,render:n,className:r,style:i,state:q,refs:J,props:ee,stateAttributesMapping:OU}):y?(0,X.jsxs)(Y.Fragment,{children:[(0,X.jsx)(hG,{ref:W,onFocus:G},`${g}-pre-focus-guard`),(0,X.jsx)(Y.Fragment,{children:te},g),(0,X.jsx)(hG,{ref:h.context.triggerFocusTargetRef,onFocus:K},`${g}-post-focus-guard`)]}):(0,X.jsx)(Y.Fragment,{children:te},g)});function _he(e,t){let n=uW(),[r,i]=Y.useState(!1);return Q(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function vhe(){let e=G5(!0);return Y.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var yhe=Y.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return l_(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),bhe={"aria-expanded":void 0},xhe=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,label:a,id:o,nativeButton:s=!1,openOnHover:c=!0,delay:l=100,closeDelay:u=0,disabled:d=!1,...f}=e,p=q5();if(!p?.parentMenu)throw Error(Jg(37));let m=h6({guess:!0,label:a}),h=j5(),{store:g}=N5(),_=aW(o),v=g.useState(`open`),y=g.useState(`floatingRootContext`),b=g.useState(`floatingTreeRoot`),x=g.useState(`triggerPopupId`,_),S=JJ(_,g),C=Y.useCallback(e=>{let t=S(e);return e!==null&&g.select(`open`)&&g.select(`activeTriggerId`)==null&&g.update({activeTriggerId:_,activeTriggerElement:e,closeDelay:u}),t},[S,u,g,_]),w=Y.useRef(null),T=Y.useCallback(e=>{w.current=e,g.set(`activeTriggerElement`,e)},[g]);g.useSyncedValue(`closeDelay`,u);let E=p.parentMenu,D=g.useState(`disabled`),O=E.useState(`disabled`),k=d||D||O,A=E.useState(`itemProps`),j=E.useState(`isActive`,m.index),M=Y.useMemo(()=>({type:`submenu-trigger`,setActive(){E.select(`highlightItemOnHover`)&&E.set(`activeIndex`,m.index)}}),[E,m.index]),{getItemProps:N,itemRef:P}=I5({closeOnClick:!1,disabled:k,highlighted:j,id:_,store:g,typingRef:E.context.typingRef,nativeButton:s,itemMetadata:M,nodeId:h?.context.nodeId}),F=EY(y,{enabled:g.useState(`hoverEnabled`)&&c&&!k,handleClose:UY({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:l,delay:{open:l,close:u},shouldOpen:l>0?()=>E.select(`allowMouseEnter`):void 0,triggerElementRef:w,externalTree:b,isClosing:()=>g.select(`transitionStatus`)===`ending`,guardStaleOpen:!0}),I=mq(y,{enabled:!k,event:`mousedown`,toggle:!c,ignoreMouse:c,stickIfOpen:!1}).reference??c_,L=g.useState(`triggerProps`,!0);delete L.id;let R={disabled:k,highlighted:j,open:v},z=g.useState(`openMethod`),B=g.useState(`lastOpenChangeReason`)===`list-navigation`||z===`keyboard`;return l_(`div`,e,{state:R,stateAttributesMapping:DU,props:[I,F,L,A,v&&B&&wW?bhe:void 0,{"aria-controls":x,tabIndex:v||j?0:-1,onBlur(){j&&E.set(`activeIndex`,null)}},f,N],ref:[t,m.ref,P,C,T]})});function Z5(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(J5,{"data-slot":`dropdown-menu`,...n}),t[2]=n,t[3]=r),r}function Q5(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(ghe,{"data-slot":`dropdown-menu-trigger`,...n}),t[2]=n,t[3]=r),r}function $5(e){let t=(0,Z.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,sideOffset:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?4:a,s;t[5]===r?s=t[6]:(s=Kv(`data-[starting-style]:fade-in-0 data-[starting-style]:zoom-in-95 data-[ending-style]:fade-out-0 data-[ending-style]: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 z-50 max-h-(--available-height) min-w-[8rem] origin-(--transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[closed]:animate-out data-[open]:animate-in`,r),t[5]=r,t[6]=s);let c;t[7]!==n||t[8]!==s?(c=(0,X.jsx)(z5,{className:s,"data-slot":`dropdown-menu-content`,children:n}),t[7]=n,t[8]=s,t[9]=c):c=t[9];let l;return t[10]!==i||t[11]!==o||t[12]!==c?(l=(0,X.jsx)(V5,{children:(0,X.jsx)(H5,{className:`z-50`,sideOffset:o,...i,children:c})}),t[10]=i,t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function e7(e){let t=(0,Z.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=Kv(`data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden data-[variant=destructive]:data-[highlighted]:bg-destructive/10 data-[variant=destructive]:data-[highlighted]:text-destructive data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[inset]:pl-8 data-[highlighted]:text-accent-foreground data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 dark:data-[variant=destructive]:data-[highlighted]:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,X.jsx)($me,{className:s,"data-inset":r,"data-slot":`dropdown-menu-item`,"data-variant":o,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function She(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(nhe,{"data-slot":`dropdown-menu-radio-group`,...n}),t[2]=n,t[3]=r),r}function t7(e){let t=(0,Z.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=Kv(`relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,X.jsx)(ahe,{children:(0,X.jsx)(ly,{className:`size-2 fill-current`})})}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,X.jsxs)(ihe,{className:a,"data-slot":`dropdown-menu-radio-item`,...i,children:[o,n]}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function n7(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(yhe,{className:i,"data-slot":`dropdown-menu-separator`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Che(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(fhe,{"data-slot":`dropdown-menu-sub`,...n}),t[2]=n,t[3]=r),r}function whe(e){let t=(0,Z.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,inset:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=Kv(`flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden data-[highlighted]:bg-accent data-[popup-open]:bg-accent data-[inset]:pl-8 data-[highlighted]:text-accent-foreground data-[popup-open]:text-accent-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(sy,{className:`ml-auto size-4`}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,X.jsxs)(xhe,{className:o,"data-inset":i,"data-slot":`dropdown-menu-sub-trigger`,...a,children:[n,s]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function The(e){let t=(0,Z.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,sideOffset:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?4:a,s;t[5]===r?s=t[6]:(s=Kv(`data-[starting-style]:fade-in-0 data-[starting-style]:zoom-in-95 data-[ending-style]:fade-out-0 data-[ending-style]: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 z-50 min-w-[8rem] origin-(--transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[closed]:animate-out data-[open]:animate-in`,r),t[5]=r,t[6]=s);let c;t[7]!==n||t[8]!==s?(c=(0,X.jsx)(z5,{className:s,"data-slot":`dropdown-menu-sub-content`,children:n}),t[7]=n,t[8]=s,t[9]=c):c=t[9];let l;return t[10]!==i||t[11]!==o||t[12]!==c?(l=(0,X.jsx)(V5,{children:(0,X.jsx)(H5,{className:`z-50`,sideOffset:o,...i,children:c})}),t[10]=i,t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function Ehe(){return`ontouchstart`in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function Dhe(){return ky().actions}function Ohe(e){let t=(0,Z.c)(4),{group:n}=e,r=n.actions[0];if(r?.integration){let e;return t[0]===r.integration?e=t[1]:(e=(0,X.jsx)(t3,{className:`size-4`,integration:r.integration}),t[0]=r.integration,t[1]=e),e}if(n.category===`System`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Sy,{className:`size-4`}),t[2]=e):e=t[2],e}let i;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(Ey,{className:`size-4`}),t[3]=i):i=t[3],i}function khe(e){let t=(0,Z.c)(11),{action:n,className:r}=e;if(n.integration){let e;return t[0]!==n.integration||t[1]!==r?(e=(0,X.jsx)(t3,{className:r,integration:n.integration}),t[0]=n.integration,t[1]=r,t[2]=e):e=t[2],e}if(n.category===`System`){let e;t[3]===r?e=t[4]:(e=Kv(r,`text-muted-foreground`),t[3]=r,t[4]=e);let n;return t[5]===e?n=t[6]:(n=(0,X.jsx)(Sy,{className:e}),t[5]=e,t[6]=n),n}let i;t[7]===r?i=t[8]:(i=Kv(r,`text-muted-foreground`),t[7]=r,t[8]=i);let a;return t[9]===i?a=t[10]:(a=(0,X.jsx)(Ey,{className:i}),t[9]=i,t[10]=a),a}var r7=`workflow-action-grid-hidden-groups`,i7=`workflow-action-grid-view-mode`;function Ahe(){if(typeof window>`u`)return new Set;try{let e=localStorage.getItem(r7);return e?new Set(JSON.parse(e)):new Set}catch{return new Set}}function jhe(){if(typeof window>`u`)return`list`;try{return localStorage.getItem(i7)===`grid`?`grid`:`list`}catch{return`list`}}function Mhe(e){let t=(0,Z.c)(72),{onSelectAction:n,disabled:r,isNewlyCreated:i}=e,[a,o]=(0,Y.useState)(``),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=new Set,t[0]=s):s=t[0];let[c,l]=(0,Y.useState)(s),[u,d]=(0,Y.useState)(Ahe),[f,p]=(0,Y.useState)(!1),[m,h]=(0,Y.useState)(jhe),g=Dhe(),_;t[1]===m?_=t[2]:(_=()=>{let e=m===`list`?`grid`:`list`;h(e),localStorage.setItem(i7,e)},t[1]=m,t[2]=_);let v=_,y;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{l(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[3]=y):y=t[3];let b=y,x;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),localStorage.setItem(r7,JSON.stringify([...n])),n})},t[4]=x):x=t[4];let S=x,C;if(t[5]!==g||t[6]!==a){let e;t[8]===a?e=t[9]:(e=e=>{let t=a.toLowerCase();return e.label.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.category.toLowerCase().includes(t)},t[8]=a,t[9]=e),C=g.filter(e),t[5]=g,t[6]=a,t[7]=C}else C=t[7];let w=C,T;if(t[10]!==w){let e={};for(let t of w){let n=t.category;e[n]||(e[n]=[]),e[n].push(t)}T=Object.keys(e).toSorted(Nhe).map(t=>({category:t,actions:e[t]})),t[10]=w,t[11]=T}else T=t[11];let E=T,D;bb0:{if(f){D=E;break bb0}let e;if(t[12]!==E||t[13]!==u){let n;t[15]===u?n=t[16]:(n=e=>!u.has(e.category),t[15]=u,t[16]=n),e=E.filter(n),t[12]=E,t[13]=u,t[14]=e}else e=t[14];D=e}let O=D,k=u.size,A;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,X.jsx)(by,{className:`absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),t[17]=A):A=t[17];let j;t[18]===i?j=t[19]:(j=i===!0&&!Ehe(),t[18]=i,t[19]=j);let M;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>o(e.target.value),t[20]=M):M=t[20];let N;t[21]!==r||t[22]!==a||t[23]!==j?(N=(0,X.jsxs)(`div`,{className:`relative flex-1`,children:[A,(0,X.jsx)(JZ,{autoFocus:j,className:`pl-9`,"data-testid":`action-search-input`,disabled:r,id:`action-filter`,onChange:M,placeholder:`Search actions...`,value:a})]}),t[21]=r,t[22]=a,t[23]=j,t[24]=N):N=t[24];let P;t[25]===v?P=t[26]:(P=(0,X.jsx)(Jv,{className:`shrink-0`,onClick:v,size:`icon`,variant:`ghost`}),t[25]=v,t[26]=P);let F;t[27]===m?F=t[28]:(F=m===`list`?(0,X.jsx)(Qee,{className:`size-4`}):(0,X.jsx)(nte,{className:`size-4`}),t[27]=m,t[28]=F);let I;t[29]!==P||t[30]!==F?(I=(0,X.jsx)(z8,{render:P,children:F}),t[29]=P,t[30]=F,t[31]=I):I=t[31];let L=m===`list`?`Grid view`:`List view`,R;t[32]===L?R=t[33]:(R=(0,X.jsx)(B8,{children:L}),t[32]=L,t[33]=R);let z;t[34]!==I||t[35]!==R?(z=(0,X.jsx)(L8,{children:(0,X.jsxs)(R8,{children:[I,R]})}),t[34]=I,t[35]=R,t[36]=z):z=t[36];let B;t[37]!==k||t[38]!==f?(B=k>0&&(0,X.jsx)(L8,{children:(0,X.jsxs)(R8,{children:[(0,X.jsx)(z8,{render:(0,X.jsx)(Jv,{className:Kv(`shrink-0`,f&&`bg-muted`),onClick:()=>p(!f),size:`icon`,variant:`ghost`}),children:f?(0,X.jsx)(my,{className:`size-4`}):(0,X.jsx)(py,{className:`size-4`})}),(0,X.jsx)(B8,{children:f?`Hide hidden groups`:`Show ${k} hidden group${k>1?`s`:``}`})]})}),t[37]=k,t[38]=f,t[39]=B):B=t[39];let V;t[40]!==N||t[41]!==z||t[42]!==B?(V=(0,X.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[N,z,B]}),t[40]=N,t[41]=z,t[42]=B,t[43]=V):V=t[43];let H;t[44]===w.length?H=t[45]:(H=w.length===0&&(0,X.jsx)(`p`,{className:`py-4 text-center text-muted-foreground text-sm`,children:`No actions found`}),t[44]=w.length,t[45]=H);let U;t[46]!==w.length||t[47]!==O?(U=w.length>0&&O.length===0&&(0,X.jsx)(`p`,{className:`py-4 text-center text-muted-foreground text-sm`,children:`All groups are hidden`}),t[46]=w.length,t[47]=O,t[48]=U):U=t[48];let W;t[49]!==r||t[50]!==w||t[51]!==u||t[52]!==n||t[53]!==f||t[54]!==m||t[55]!==O?(W=m===`grid`&&O.length>0&&(0,X.jsx)(`div`,{className:`grid gap-2 p-1`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(72px, 1fr))`},children:w.filter(e=>f||!u.has(e.category)).map(e=>(0,X.jsxs)(`button`,{className:Kv(`flex aspect-square flex-col items-center justify-center gap-1.5 rounded-lg border border-transparent p-2 text-center transition-colors hover:border-border hover:bg-muted`,r&&`pointer-events-none opacity-50`),"data-testid":`action-option-${e.id.toLowerCase().replace(/\s+/g,`-`)}`,disabled:r,onClick:()=>n(e.id),type:`button`,children:[(0,X.jsx)(khe,{action:e,className:`size-6`}),(0,X.jsx)(`span`,{className:`line-clamp-2 font-medium text-xs leading-tight`,children:e.label})]},e.id))}),t[49]=r,t[50]=w,t[51]=u,t[52]=n,t[53]=f,t[54]=m,t[55]=O,t[56]=W):W=t[56];let G;t[57]!==c||t[58]!==r||t[59]!==u||t[60]!==n||t[61]!==m||t[62]!==O?(G=m===`list`&&O.length>0&&O.map((e,t)=>{let i=c.has(e.category),a=u.has(e.category);return(0,X.jsxs)(`div`,{children:[t>0&&(0,X.jsx)(`div`,{className:`my-2 h-px bg-border`}),(0,X.jsxs)(`div`,{className:Kv(`sticky top-0 z-10 mb-1 flex items-center gap-2 bg-background px-3 py-2 font-medium text-muted-foreground text-xs uppercase tracking-wider`,a&&`opacity-50`),children:[(0,X.jsxs)(`button`,{className:`flex flex-1 items-center gap-2 text-left hover:text-foreground`,onClick:()=>b(e.category),type:`button`,children:[(0,X.jsx)(sy,{className:Kv(`size-3.5 transition-transform`,!i&&`rotate-90`)}),(0,X.jsx)(Ohe,{group:e}),e.category]}),(0,X.jsxs)(Z5,{children:[(0,X.jsx)(Q5,{render:(0,X.jsx)(`button`,{className:`rounded p-0.5 hover:bg-muted hover:text-foreground`,type:`button`}),children:(0,X.jsx)(dy,{className:`size-4`})}),(0,X.jsx)($5,{align:`end`,children:(0,X.jsx)(e7,{onClick:()=>S(e.category),children:a?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(my,{className:`mr-2 size-4`}),`Show group`]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(py,{className:`mr-2 size-4`}),`Hide group`]})})})]})]}),!i&&e.actions.map(e=>(0,X.jsx)(`button`,{className:Kv(`flex w-full items-center rounded-md px-3 py-2 text-left text-sm transition-colors hover:bg-muted`,r&&`pointer-events-none opacity-50`),"data-testid":`action-option-${e.id.toLowerCase().replace(/\s+/g,`-`)}`,disabled:r,onClick:()=>n(e.id),type:`button`,children:(0,X.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:e.label}),e.description&&(0,X.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[` `,`- `,e.description]})]})},e.id))]},e.category)}),t[57]=c,t[58]=r,t[59]=u,t[60]=n,t[61]=m,t[62]=O,t[63]=G):G=t[63];let K;t[64]!==H||t[65]!==U||t[66]!==W||t[67]!==G?(K=(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-4`,"data-testid":`action-grid`,children:[H,U,W,G]}),t[64]=H,t[65]=U,t[66]=W,t[67]=G,t[68]=K):K=t[68];let q;return t[69]!==V||t[70]!==K?(q=(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3`,children:[V,K]}),t[69]=V,t[70]=K,t[71]=q):q=t[71],q}function Nhe(e,t){return e===`System`?-1:t===`System`?1:e.localeCompare(t)}function Phe(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}function a7(e){return{checked(t){return e.indeterminate?{}:t?{"data-checked":``}:{"data-unchecked":``}},...g3}}var Fhe=Y.createContext({disabled:!1});function o7(){return Y.useContext(Fhe)}function s7(e,t,n,r=!0,i){let[a,o]=Y.useState(),s=aW(i?`${i}-label`:void 0),c=e??t??a;return Q(()=>{let i=e||t||!r?void 0:Ihe(n.current,s);a!==i&&o(i)}),c}function Ihe(e,t){let n=Lhe(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function Lhe(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var Rhe=Y.createContext(void 0);function zhe(){return Y.useContext(Rhe)}var c7=Y.createContext(void 0);function Bhe(){let e=Y.useContext(c7);if(e===void 0)throw Error(Jg(14));return e}var Vhe=`data-parent`,Hhe=Y.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":a,disabled:o=!1,form:s,id:c,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:f,parent:p=!1,readOnly:m=!1,render:h,required:g=!1,uncheckedValue:_,value:v,nativeButton:y=!1,style:b,...x}=e,{clearErrors:S}=F3(),{disabled:C,name:w,setDirty:T,setFilled:E,setFocused:D,setTouched:O,state:k,validationMode:A,validityData:j,validation:M}=y3(),N=o7(),{labelId:P,controlId:F,registerControlId:I,getDescriptionProps:L}=x3(),R=zhe(),z=R?.allValues===void 0?void 0:R.parent,B=z!==void 0,V=C||N.disabled||R?.disabled||o,H=w??d,U=v??H,W=aW(),G=aW(),K=c||F;B&&(p?K=G:U===void 0?K||=G:K=`${z.id}-${U}`);let q={};B&&(p?q=z.getParentProps():U!==void 0&&(q=z.getChildProps(U)));let{checked:J=n,indeterminate:ee=l,onCheckedChange:te,...ne}=q,re=R?.value,ie=Y.useRef(null),ae=Ag(()=>Symbol()),oe=Y.useRef(!1),{getButtonProps:se,buttonRef:ce}=$g({disabled:V,native:y}),le=R?.validation??M,[ue,de]=d3({controlled:U!==void 0&&re!==void 0&&!p?re.includes(U):J,default:i,name:`Checkbox`,state:`checked`}),fe=B?!!J:ue,pe=B&&ee||l;Q(()=>{I!==o_&&(oe.current=!0,I(ae.current,K))},[K,I,ae]),Y.useEffect(()=>{let e=ae.current;return()=>{!oe.current||I===o_||(oe.current=!1,I(e,void 0))}},[I,ae]),b3(ie,W,ue,void 0,!R&&!V,d);let me=Y.useRef(null),he=le.registerInput,ge=R?U:void 0,_e=Y.useCallback(e=>he(e,{controlRef:ie,value:ge}),[he,ge]),ve=t_(u,me,p?void 0:_e),ye=s7(a,P,me,!y,K??void 0);Q(()=>{me.current&&(me.current.indeterminate=pe,ue&&E(!0))},[ue,pe,E]),AX(ue,()=>{R||(S(H),E(ue),T(ue!==j.initialValue),le.change(ue))});let be=Rg({checked:ue,disabled:V,form:s,name:p?void 0:H,id:y?void 0:K??void 0,required:g,ref:ve,style:H?mG:pG,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(m){e.preventDefault();return}let t=e.currentTarget.checked,n=QU(MU,e.nativeEvent);if(f?.(t,n),!n.isCanceled&&(te?.(t,n),!n.isCanceled&&(de(t),U!==void 0&&R!==void 0&&!p&&!B))){let e=t?[...R.value,U]:R.value.filter(e=>e!==U);R.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){ie.current?.focus()}},v===void 0?c_:{value:(R?ue&&v:v)||``},L,e=>le.getValidationProps(V,e));Y.useEffect(()=>{if(!z||U===void 0)return;let e=z.disabledStatesRef.current;return e.set(U,V),()=>{e.delete(U)}},[z,V,U]);let xe=Y.useMemo(()=>({...k,checked:fe,disabled:V,readOnly:m,required:g,indeterminate:pe}),[k,fe,V,m,g,pe]),Se=a7(xe),Ce=l_(`span`,e,{state:xe,ref:[ce,ie,t],props:[{id:y?K??void 0:W,role:`checkbox`,"aria-checked":pe?`mixed`:fe,"aria-readonly":m||void 0,"aria-required":g||void 0,"aria-labelledby":ye,[Vhe]:p?``:void 0,onFocus(){V||D(!0)},onBlur(){let e=me.current;e&&(O(!0),D(!1),A===`onBlur`&&le.commit(R?re:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=me.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),ag(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||Phe(t)?.click()})},onClick(e){if(m||V)return;e.preventDefault();let t=me.current;t&&Qg(t,e)}},x,ne,se,L,e=>le.getValidationProps(V,e)],stateAttributesMapping:Se});return(0,X.jsxs)(c7.Provider,{value:xe,children:[Ce,!ue&&!R&&H&&!p&&_!==void 0&&(0,X.jsx)(`input`,{type:`hidden`,form:s,name:H,value:_,disabled:V}),(0,X.jsx)(`input`,{...be,suppressHydrationWarning:!0})]})}),Uhe=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=Bhe(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:d}=VJ(c),f=Y.useRef(null),p={...s,transitionStatus:u};UJ({open:c,ref:f,onComplete(){c||d(!1)}});let m={...a7(s),...xU},h=a||l,g=l_(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:m,props:o});return h?g:null});function l7(e){let t=(0,Z.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`peer inline-grid size-4 shrink-0 place-content-center rounded-[4px] border border-input shadow-xs outline-none transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 data-[disabled]:cursor-not-allowed data-[checked]:border-primary data-[invalid]:border-destructive data-[checked]:bg-primary data-[checked]:text-primary-foreground data-[disabled]:opacity-50 data-[invalid]:ring-destructive/20 dark:bg-input/30 dark:data-[checked]:bg-primary dark:data-[invalid]:ring-destructive/40`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(Uhe,{className:`grid place-content-center text-current transition-none`,"data-slot":`checkbox-indicator`,children:(0,X.jsx)(iy,{className:`size-3.5`})}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,X.jsx)(Hhe,{className:i,"data-slot":`checkbox`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}var u7={checked(e){return e?{"data-checked":``}:{"data-unchecked":``}},...xU,...g3},Whe=`data-composite-item-active`,d7=Y.createContext(void 0);function Ghe(){return Y.useContext(d7)}var f7=Y.createContext(void 0);function Khe(){let e=Y.useContext(f7);if(e===void 0)throw Error(Jg(52));return e}var qhe=Y.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,readOnly:a=!1,required:o=!1,"aria-labelledby":s,value:c,inputRef:l,nativeButton:u=!1,id:d,style:f,...p}=e,m=Ghe(),{disabled:h,readOnly:g,required:_,form:v,checkedValue:y,touched:b=!1,validation:x,name:S,setCheckedValue:C=o_,setTouched:w=o_,registerInputRef:T=o_}=m??{},{setTouched:E,setFilled:D,state:O,disabled:k}=y3(),A=o7(),{labelId:j,getDescriptionProps:M}=x3(),N=k||A.disabled||h||i,P=g||a,F=_||o,I=v,L=m?y===c:c===``,R=Y.useRef(null),z=Y.useRef(null),B=x?.registerInput,V=t_(l,z,T,Y.useCallback(e=>B?.(e,{controlRef:R,value:void 0}),[B]));Q(()=>{z.current?.checked&&D(!0)},[D]),Q(()=>{if(z.current){if(N&&L){T(null);return}T(z.current)}},[L,N,T]);let H=aW(),U=S3({id:d,implicit:!1,controlRef:R}),W=u?void 0:U,G={role:`radio`,"aria-checked":L,"aria-labelledby":s7(s,j,z,!u,W),[Whe]:L?``:void 0,id:u?U:H,onKeyDown(e){e.key===`Enter`&&e.preventDefault()},onClick(e){if(e.defaultPrevented||N||P)return;e.preventDefault();let t=z.current;t&&Qg(t,e)},onFocus(e){e.defaultPrevented||N||P||!b||(z.current?.click(),w(!1))}},{getButtonProps:K,buttonRef:q}=$g({disabled:N,native:u,composite:!1}),J={type:`radio`,ref:V,form:I,id:W,name:S,tabIndex:-1,style:S?mG:pG,"aria-hidden":!0,...c===void 0?c_:{value:O3(c)},disabled:N,checked:L,required:F,readOnly:P,onChange(e){if(e.nativeEvent.defaultPrevented||N||P||c===void 0)return;let t=QU(MU,e.nativeEvent);C(c,t),!t.isCanceled&&E(!0)},onClick(e){e.stopPropagation()},onFocus(){R.current?.focus()}},ee=Y.useMemo(()=>({...O,required:F,disabled:N,readOnly:P,checked:L}),[O,N,P,L,F]),te=ee,ne=m!==void 0,re=[t,R,q],ie=[G,p,K,M,x?e=>x.getValidationProps(N,e):c_],ae=l_(`span`,e,{enabled:!ne,state:ee,ref:re,props:ie,stateAttributesMapping:u7});return(0,X.jsxs)(f7.Provider,{value:te,children:[ne?(0,X.jsx)(Y5,{tag:`span`,render:n,className:r,style:f,state:ee,refs:re,props:ie,stateAttributesMapping:u7}):ae,(0,X.jsx)(`input`,{...J,suppressHydrationWarning:!0})]})}),Jhe=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=Khe(),c=s.checked,{mounted:l,transitionStatus:u,setMounted:d}=VJ(c),f={...s,transitionStatus:u},p=Y.useRef(null),m=a||l,h=l_(`span`,e,{ref:[t,p],state:f,props:o,stateAttributesMapping:u7});return UJ({open:c,ref:p,onComplete(){c||d(!1)}}),m?h:null}),Yhe=[];function Xhe(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=Yhe}=e,[p,m]=Y.useState(0),h=r!=null,g=Y.useRef(null),_=t_(g,c),v=Y.useRef([]),y=Y.useRef(!1),b=o??p,x=Ng((e,t=!1)=>{if((s??m)(e),t){let t=v.current[e];tX(g.current,t,a,n)}}),S=Ng(e=>{if(e.size===0||y.current)return;y.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)x(i);else if(YG(t,b,d)){let e=qG(t,{disabledIndices:d});WG(t,e)||x(e)}tX(g.current,r,a,n)});Q(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(YG(e,b,d)){let t=qG(e,{disabledIndices:d});WG(e,t)||x(t)}},[d,o,b,v,x]);let C=Ng((e,t,n)=>i?i(e,t,n,v):n),w=Ng(e=>{let o=e.key===`Home`||e.key===`End`;if(!XY.has(e.key)||!l&&o||Zhe(e,f)||!g.current)return;let s=a===`rtl`,c=s?JY:YY,p=s?YY:JY,m=n===`vertical`?qY:c,_=n===`vertical`?KY:p,y=BW(e.nativeEvent);if(y!=null&&eX(y)&&!u3(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let S=b,w=GG(v,d),T=KG(v,d);r!=null&&(S=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:b,loopFocus:t,maxIndex:T,minIndex:w,onLoop:C,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?S=w:e.key===`End`&&(S=T)),S===b&&(E||D)&&(t&&S===T&&E?(S=w,i&&(S=i(e,b,S,v))):t&&S===w&&D?(S=T,i&&(S=i(e,b,S,v))):S=qG(v.current,{startingIndex:S,decrement:D,disabledIndices:d})),S!==b&&!WG(v.current,S)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),x(S,!0),queueMicrotask(()=>{v.current[S]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=BW(e.nativeEvent);!t||n==null||!eX(n)||n.setSelectionRange(0,n.value.length)},onKeyDown:w},highlightedIndex:b,onHighlightedIndexChange:x,elementsRef:v,onMapChange:S,relayKeyboardEvent:w}}function Zhe(e,t){for(let n of QY)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Qhe(e){let{render:t,className:n,style:r,refs:i=s_,props:a=s_,state:o=c_,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:E,onMapChange:D,relayKeyboardEvent:O}=Xhe({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:K3(),disabledIndices:v,modifierKeys:y}),k=l_(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),A=Y.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:T,highlightItemOnHover:b,relayKeyboardEvent:O}),[w,T,b,O]);return(0,X.jsx)(Yg.Provider,{value:A,children:(0,X.jsx)(W3,{elementsRef:E,onMapChange:e=>{h?.(e),D(e)},children:k})})}Object.keys(m3);function $he(e,t){return e.matches(`:disabled`)?!1:!t||e.form===t||e.form===null&&!e.hasAttribute(`form`)}var ege=Y.createContext(void 0);function tge(e=!1){let t=Y.useContext(ege);if(!t&&!e)throw Error(Jg(86));return t}var nge=[ZY],rge=Y.forwardRef(function(e,t){let{render:n,className:r,disabled:i,readOnly:a,required:o,onValueChange:s,value:c,defaultValue:l,form:u,name:d,inputRef:f,id:p,style:m,...h}=e,{setTouched:g,setFocused:_,validationMode:v,name:y,disabled:b,state:x,validation:S,setDirty:C,setFilled:w,validityData:T}=y3(),{labelId:E}=x3(),{clearErrors:D,elementRef:O}=F3(),k=tge(!0),A=b||i,j=y??d,M=aW(p),[N,P]=d3({controlled:c,default:l,name:`RadioGroup`,state:`value`}),[F,I]=Y.useState(!1),L=Ng((e,t)=>{s?.(e,t),!t.isCanceled&&P(e)}),R=S.getInputControl,z=Y.useMemo(()=>({get current(){return R()}}),[R]),B=Y.useRef(null),V=Y.useRef(null);function H(e){let t;return f&&(typeof f==`function`?t=f(e):f.current=e),B.current=e,t}let U=Ng(e=>{if(!e||e.disabled)return;V.current||=e;let t=B.current,n=e.checked||t==null||t.disabled?H(e):void 0;return()=>{V.current===e&&(V.current=null),B.current===e?n?(n(),B.current=null):H(null):n?.()}}),W=Ng(()=>{let e=O.current;if(!e)return N??null;for(let t of S.registeredInputs.keys())if(t.checked&&$he(t,e))return N??null;return null});b3(z,M,N??null,W,!A,d),AX(N,()=>{D(j),C(N!==T.initialValue),w(N!=null),S.change(N);let e=V.current;N==null&&e&&!e.disabled&&H(e)});let G=E??k?.legendId,K={...x,disabled:A??!1,required:o??!1,readOnly:a??!1},q=Y.useMemo(()=>({checkedValue:N,disabled:A,form:u,validation:S,name:j,readOnly:a,registerInputRef:U,required:o,setCheckedValue:L,setTouched:I,touched:F}),[N,A,u,S,j,a,U,o,L,I,F]),J={id:p,role:`radiogroup`,"aria-required":o||void 0,"aria-disabled":A||void 0,"aria-readonly":a||void 0,"aria-labelledby":G,onFocus(){_(!0)},onBlur(e){zW(e.currentTarget,e.relatedTarget)||(g(!0),_(!1),v===`onBlur`&&S.commit(N))},onKeyDownCapture(e){e.key.startsWith(`Arrow`)&&(I(!0),_(!0))}};return(0,X.jsx)(d7.Provider,{value:q,children:(0,X.jsx)(Qhe,{render:n,className:r,style:m,state:K,props:[J,h,e=>S.getValidationProps(A??!1,e)],refs:[t],stateAttributesMapping:g3,enableHomeAndEndKeys:!1,modifierKeys:nge})})});function ige(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`space-y-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(rge,{className:i,"data-slot":`radio-group`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function age(e){let t=(0,Z.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`flex size-4 shrink-0 items-center justify-center rounded-full border border-input bg-background outline-none transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 data-[checked]:border-primary data-[checked]:bg-primary data-[checked]:text-primary-foreground data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(Jhe,{className:`flex items-center justify-center before:size-1.5 before:rounded-full before:bg-current data-[unchecked]:hidden`}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,X.jsx)(qhe,{className:i,"data-slot":`radio`,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function oge(e){let t=(0,Z.c)(95),{config:n,onUpdateConfig:r,disabled:i}=e,a=(0,Y.useId)(),o=(0,Y.useId)(),s=(0,Y.useId)(),c=(0,Y.useId)(),l=ky(),u,d;t[0]!==l||t[1]!==n?(u=Q0(n)??Z0,d=Cce({rules:u,catalog:l}),t[0]=l,t[1]=n,t[2]=u,t[3]=d):(u=t[2],d=t[3]);let f=d,p;t[4]===r?p=t[5]:(p=e=>{r({lifecycleRules:e})},t[4]=r,t[5]=p);let m=p,h;t[6]!==u||t[7]!==m?(h=e=>{m(a2({...u,startEvents:e}))},t[6]=u,t[7]=m,t[8]=h):h=t[8];let g=h,_;t[9]!==u||t[10]!==m?(_=e=>{m(a2({...u,cancelEvents:e}))},t[9]=u,t[10]=m,t[11]=_):_=t[11];let v=_,y;t[12]!==u||t[13]!==m?(y=e=>{m(a2({...u,concurrency:e}))},t[12]=u,t[13]=m,t[14]=y):y=t[14];let b=y,x;t[15]!==u||t[16]!==m?(x=(e,t)=>{let n=t.trim(),r={...u.correlationPaths};n?r[e]=n:delete r[e],m({...u,correlationPaths:Object.keys(r).length>0?r:void 0})},t[15]=u,t[16]=m,t[17]=x):x=t[17];let S=x,C=l.events.length>0,w;t[18]!==l.events||t[19]!==i||t[20]!==u.startEvents||t[21]!==g||t[22]!==a?(w=(0,X.jsx)(O5,{choices:l.events,disabled:i,inputId:a,onValueChange:g,value:u.startEvents}),t[18]=l.events,t[19]=i,t[20]=u.startEvents,t[21]=g,t[22]=a,t[23]=w):w=t[23];let T;t[24]!==l||t[25]!==i||t[26]!==u||t[27]!==S||t[28]!==g?(T=u.startEvents.map(e=>(0,X.jsx)(m7,{catalog:l,disabled:i,eventName:e,label:Uy(l,e)?.label,onCommitPath:S,onRemove:()=>g(u.startEvents.filter(t=>t!==e)),request:i2({rules:u,catalog:l,eventName:e,role:`start`})},e)),t[24]=l,t[25]=i,t[26]=u,t[27]=S,t[28]=g,t[29]=T):T=t[29];let E;t[30]!==a||t[31]!==C||t[32]!==w||t[33]!==T?(E=(0,X.jsxs)(p7,{help:`A run starts when one of these Events arrives. Naming several is how one workflow answers an appointment being booked and being moved: Concurrency decides what happens to the run already going.`,hasEvents:C,inputId:a,label:`Start Events`,children:[w,T]}),t[30]=a,t[31]=C,t[32]=w,t[33]=T,t[34]=E):E=t[34];let D;t[35]===s?D=t[36]:(D=(0,X.jsx)(YZ,{id:s,children:`Concurrency`}),t[35]=s,t[36]=D);let O=u.concurrency,k;t[37]!==i||t[38]!==u.concurrency?(k=dge.map(e=>(0,X.jsxs)(`label`,{className:Kv(`flex w-full cursor-pointer items-start gap-2 rounded-md border p-2 transition-colors`,u.concurrency===e.value?`border-primary bg-muted/50`:`border-input hover:bg-muted/30`,i&&`pointer-events-none opacity-50`),children:[(0,X.jsx)(age,{className:`mt-0.5`,value:e.value}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`font-medium text-sm`,children:e.label}),(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:e.description})]})]},e.value)),t[37]=i,t[38]=u.concurrency,t[39]=k):k=t[39];let A;t[40]!==s||t[41]!==i||t[42]!==u.concurrency||t[43]!==b||t[44]!==k?(A=(0,X.jsx)(ige,{"aria-labelledby":s,disabled:i,onValueChange:b,value:O,children:k}),t[40]=s,t[41]=i,t[42]=u.concurrency,t[43]=b,t[44]=k,t[45]=A):A=t[45];let j;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`The entity is the value at the Correlation Path. A start carrying no payload uses the workflow itself, so every manual run is about the same entity.`}),t[46]=j):j=t[46];let M;t[47]!==D||t[48]!==A?(M=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[D,A,j]}),t[47]=D,t[48]=A,t[49]=M):M=t[49];let N=u.allowManualStart===!0,P;t[50]!==u||t[51]!==m?(P=e=>m({...u,allowManualStart:e}),t[50]=u,t[51]=m,t[52]=P):P=t[52];let F;t[53]!==i||t[54]!==c||t[55]!==N||t[56]!==P?(F=(0,X.jsx)(l7,{checked:N,disabled:i,id:c,onCheckedChange:P}),t[53]=i,t[54]=c,t[55]=N,t[56]=P,t[57]=F):F=t[57];let I;t[58]===c?I=t[59]:(I=(0,X.jsx)(YZ,{htmlFor:c,children:`Allow manual runs`}),t[58]=c,t[59]=I);let L;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`The Run button and the execute route. With this off, only a Start Event starts a run.`}),t[60]=L):L=t[60];let R;t[61]===u.startEvents.length?R=t[62]:(R=u.startEvents.length===0?(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`A manual run's payload is described by nothing, so downstream nodes are offered no fields to reference. Add a Start Event to give them its payload.`}):null,t[61]=u.startEvents.length,t[62]=R);let z;t[63]!==I||t[64]!==R?(z=(0,X.jsxs)(`div`,{className:`space-y-0.5`,children:[I,L,R]}),t[63]=I,t[64]=R,t[65]=z):z=t[65];let B;t[66]!==F||t[67]!==z?(B=(0,X.jsxs)(`div`,{className:`flex items-start gap-2`,children:[F,z]}),t[66]=F,t[67]=z,t[68]=B):B=t[68];let V=l.events.length>0,H;t[69]!==o||t[70]!==l.events||t[71]!==i||t[72]!==u.cancelEvents||t[73]!==v?(H=(0,X.jsx)(O5,{choices:l.events,disabled:i,inputId:o,onValueChange:v,value:u.cancelEvents}),t[69]=o,t[70]=l.events,t[71]=i,t[72]=u.cancelEvents,t[73]=v,t[74]=H):H=t[74];let U;t[75]!==l||t[76]!==i||t[77]!==u||t[78]!==v||t[79]!==S?(U=u.cancelEvents.map(e=>(0,X.jsx)(m7,{catalog:l,disabled:i,eventName:e,label:Uy(l,e)?.label,onCommitPath:S,onRemove:()=>v(u.cancelEvents.filter(t=>t!==e)),request:i2({rules:u,catalog:l,eventName:e,role:`cancel`})},e)),t[75]=l,t[76]=i,t[77]=u,t[78]=v,t[79]=S,t[80]=U):U=t[80];let W;t[81]!==o||t[82]!==V||t[83]!==H||t[84]!==U?(W=(0,X.jsxs)(p7,{hasEvents:V,help:`When one of these arrives, Workflow Graph reads its Entity Value at the Correlation Path you set for it and cancels the runs already going for that entity. A canceled run leaves through the Canceled outlet.`,inputId:o,label:`Cancel Events`,children:[H,U]}),t[81]=o,t[82]=V,t[83]=H,t[84]=U,t[85]=W):W=t[85];let G;t[86]!==f.error||t[87]!==f.valid?(G=f.valid?null:(0,X.jsx)(t5,{title:`This will not save`,children:f.error}),t[86]=f.error,t[87]=f.valid,t[88]=G):G=t[88];let K;return t[89]!==E||t[90]!==M||t[91]!==B||t[92]!==W||t[93]!==G?(K=(0,X.jsxs)(`div`,{className:`space-y-4`,children:[E,M,B,W,G]}),t[89]=E,t[90]=M,t[91]=B,t[92]=W,t[93]=G,t[94]=K):K=t[94],K}function p7(e){let t=(0,Z.c)(12),{label:n,inputId:r,hasEvents:i,help:a,children:o}=e,s;t[0]!==r||t[1]!==n?(s=(0,X.jsx)(YZ,{htmlFor:r,children:n}),t[0]=r,t[1]=n,t[2]=s):s=t[2];let c;t[3]!==o||t[4]!==i?(c=i?o:(0,X.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`This server declares no Events. Whoever runs it passes them to`,(0,X.jsx)(`code`,{className:`mx-1 font-mono text-xs`,children:`createWfGraphApp`}),`, and they appear here.`]}),t[3]=o,t[4]=i,t[5]=c):c=t[5];let l;t[6]===a?l=t[7]:(l=(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:a}),t[6]=a,t[7]=l);let u;return t[8]!==s||t[9]!==c||t[10]!==l?(u=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[s,c,l]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function m7(e){let t=(0,Z.c)(19),{eventName:n,label:r,request:i,catalog:a,onCommitPath:o,onRemove:s,disabled:c}=e,l=r??n,u;t[0]!==n||t[1]!==l?(u=(0,X.jsx)(`p`,{className:`min-w-0 truncate text-xs`,title:n,children:l}),t[0]=n,t[1]=l,t[2]=u):u=t[2];let d=`Remove ${n}`,f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,X.jsx)(Ty,{className:`size-3.5`}),t[3]=f):f=t[3];let p;t[4]!==c||t[5]!==s||t[6]!==d?(p=(0,X.jsx)(Jv,{"aria-label":d,className:`size-7 shrink-0`,disabled:c,onClick:s,size:`icon`,type:`button`,variant:`ghost`,children:f}),t[4]=c,t[5]=s,t[6]=d,t[7]=p):p=t[7];let m;t[8]!==u||t[9]!==p?(m=(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[u,p]}),t[8]=u,t[9]=p,t[10]=m):m=t[10];let h;t[11]!==a||t[12]!==c||t[13]!==o||t[14]!==i?(h=i?(0,X.jsx)(sge,{catalog:a,disabled:c,onCommit:o,request:i}):null,t[11]=a,t[12]=c,t[13]=o,t[14]=i,t[15]=h):h=t[15];let g;return t[16]!==m||t[17]!==h?(g=(0,X.jsxs)(`div`,{className:`space-y-2 rounded-md border p-2`,children:[m,h]}),t[16]=m,t[17]=h,t[18]=g):g=t[18],g}function sge(e){let t=(0,Z.c)(47),{request:n,catalog:r,disabled:i,onCommit:a}=e,o=(0,Y.useId)(),{eventName:s,declaredPath:c,suppliedPath:l}=n,u,d,f,p,m,h,g,_,v,y;if(t[0]!==r||t[1]!==c||t[2]!==i||t[3]!==s||t[4]!==o||t[5]!==a||t[6]!==l){let e=uge(r,s,c,l);v=`space-y-1`,t[17]!==s||t[18]!==o?(y=(0,X.jsx)(YZ,{className:`sr-only`,htmlFor:o,children:s}),t[17]=s,t[18]=o,t[19]=y):y=t[19],d=S6,m=i,t[20]!==c||t[21]!==s||t[22]!==a?(h=e=>a(s,e===c||e===null?``:e),t[20]=c,t[21]=s,t[22]=a,t[23]=h):h=t[23],g=l??c??null;let n;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(T6,{}),t[24]=n):n=t[24],t[25]===o?_=t[26]:(_=(0,X.jsx)(E6,{className:`w-full`,id:o,children:n}),t[25]=o,t[26]=_),u=D6,t[27]===c?f=t[28]:(f=c?null:(0,X.jsx)(k6,{value:null,children:`Choose a path`}),t[27]=c,t[28]=f),p=e.map(cge),t[0]=r,t[1]=c,t[2]=i,t[3]=s,t[4]=o,t[5]=a,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=y}else u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=t[16];let b;t[29]!==u||t[30]!==f||t[31]!==p?(b=(0,X.jsxs)(u,{children:[f,p]}),t[29]=u,t[30]=f,t[31]=p,t[32]=b):b=t[32];let x;t[33]!==d||t[34]!==m||t[35]!==h||t[36]!==g||t[37]!==_||t[38]!==b?(x=(0,X.jsxs)(d,{disabled:m,onValueChange:h,value:g,children:[_,b]}),t[33]=d,t[34]=m,t[35]=h,t[36]=g,t[37]=_,t[38]=b,t[39]=x):x=t[39];let S=c?`Runs are matched on this payload path. The Event declares ${c}; a path here is read instead.`:`Runs are matched on this payload path. This Event declares none, so choose the one holding the value that identifies the entity.`,C;t[40]===S?C=t[41]:(C=(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:S}),t[40]=S,t[41]=C);let w;return t[42]!==x||t[43]!==C||t[44]!==v||t[45]!==y?(w=(0,X.jsxs)(`div`,{className:v,children:[y,x,C]}),t[42]=x,t[43]=C,t[44]=v,t[45]=y,t[46]=w):w=t[46],w}function cge(e){return(0,X.jsx)(k6,{value:e,children:e},e)}var lge=new Set([`string`,`number`]);function uge(e,t,n,r){return Ja(Ka([...(Uy(e,t)?.payloadFields??[]).filter(e=>lge.has(e.type??``)).map(e=>e.path),n,r]))}var dge=[{value:`unlimited`,label:`Unlimited`,description:`Every Event starts its own run.`},{value:`newest-wins`,label:`Newest wins`,description:`A new run for the same entity supersedes the ones already going, which end with that status.`},{value:`first-wins`,label:`First wins`,description:`A run already going for the same entity keeps it. The arriving Event is recorded as a Refused Start.`}];function fge(e){let[t]=v8({currentNodeId:e.nodeId,nodes:e.nodes,edges:e.edges,catalog:e.catalog});if(!t)return;let n=F6(t),r=r8(n);return{conditionModel:$6(n),condition:r.valid?r.expression:``}}function pge(){let e=(0,Z.c)(17),t=ky(),n=uj(),r=Fe(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={from:`/workflows/$workflowId`},e[0]=i):i=e[0];let a=Gi(i),o=_j(R4),s=vj(q4),c=vj(Kle),l;e[1]!==t||e[2]!==r||e[3]!==o||e[4]!==n||e[5]!==s?(l=e=>{let i=n.get(j4),a=i.find(e=>e.id===o);if(!a)return;let c=typeof e.actionType==`string`&&!!a.data.config?.integrationId,l={...a.data.config,...e,...c?{integrationId:void 0}:{}};e.actionType===Y0.condition&&!l.conditionModel&&Object.assign(l,fge({nodeId:a.id,nodes:i,edges:n.get(M4),catalog:t}));let u=r.getQueryData(k2().queryKey),d=u?z2(t,{...a,data:{...a.data,config:l}},u).data.config:l;s({id:a.id,data:{config:d}})},e[1]=t,e[2]=r,e[3]=o,e[4]=n,e[5]=s,e[6]=l):l=e[6];let u=l,d;e[7]===r?d=e[8]:(d=()=>M2(r),e[7]=r,e[8]=d);let f=d,p;e[9]!==c||e[10]!==a||e[11]!==r?(p=O2.workflow.deleteExecutions.mutationOptions({onSuccess:async()=>{c(),a({search:{},replace:!0}),await M2(r),Fy.success(`All runs deleted`)},meta:{errorMessage:`Failed to delete runs`}}),e[9]=c,e[10]=a,e[11]=r,e[12]=p):p=e[12];let m=Ze(p),h;return e[13]!==m||e[14]!==f||e[15]!==u?(h={updateConfig:u,refreshRuns:f,deleteRuns:m},e[13]=m,e[14]=f,e[15]=u,e[16]=h):h=e[16],h}var mge=[`pending`,`running`,`waiting`,`completed`,`canceled`,`superseded`,`failed`],hge=[`pending`,`running`,`waiting`];function h7(e){return hge.some(t=>t===e)}function gge(e){return{supersededCount:e.supersededCount,refusedStarts:e.refusedStarts.map(e=>({...e,createdAt:new Date(e.createdAt)})),executions:e.items.map(e=>({...e,startedAt:new Date(e.startedAt),waitingAt:e.waitingAt?new Date(e.waitingAt):null,cancelledAt:e.cancelledAt?new Date(e.cancelledAt):null,completedAt:e.completedAt?new Date(e.completedAt):null}))}}function _ge(e){return{logs:g7(e),waits:e.waits.map(e=>({...e,waitUntil:e.waitUntil?new Date(e.waitUntil):null})),execution:{...vge(e.execution),workflowVersionId:e.execution.workflowVersionId}}}function vge(e){return{id:e.id,workflowId:e.workflowId,status:yge(e.status),startSource:e.startSource,runMode:e.runMode,startEventName:e.startEventName,entityValue:e.entityValue,workflowRunId:null,startedAt:new Date(e.startedAt),waitingAt:null,cancelledAt:null,completedAt:e.completedAt?new Date(e.completedAt):null,duration:e.duration,error:e.error}}function yge(e){for(let t of mge)if(t===e)return t;return`failed`}function bge(e){return wge(g7(e))}function xge(e){return{workflowId:e.execution.workflowId,workflowVersionId:e.execution.workflowVersionId}}function Sge(e){return e.events.map(e=>({...e,createdAt:new Date(e.createdAt)}))}function g7(e){return Tge(e.logs.map(e=>({id:e.id,nodeId:e.nodeId,nodeName:e.nodeName,nodeType:e.nodeType,status:e.status,startedAt:new Date(e.startedAt),completedAt:e.completedAt?new Date(e.completedAt):null,duration:e.duration,input:e.input,output:e.output,error:e.error})),e.execution.status)}function Cge(e){return new Date(e.startedAt).getTime()}function wge(e){let t={};for(let n of e){let e=t[n.nodeId];e?.startedAt!==void 0&&Cge(n)<new Date(e.startedAt).getTime()||(t[n.nodeId]={nodeId:n.nodeId,nodeName:n.nodeName,nodeType:n.nodeType,status:n.status,input:n.input,output:n.output,startedAt:n.startedAt,completedAt:n.completedAt})}return t}function Tge(e,t){return t!==`canceled`&&t!==`superseded`?e:e.map(e=>e.status===`pending`||e.status===`running`?{...e,status:`cancelled`,error:e.error||`Run cancelled before step completion`}:e)}function _7(e,t){return`${e} ${t}${e===1?``:`s`} ago`}function v7(e){let t=new Date,n=new Date(e),r=Math.floor((t.getTime()-n.getTime())/1e3);if(r<60)return`just now`;let i=Math.floor(r/60);if(i<60)return _7(i,`min`);let a=Math.floor(i/60);if(a<24)return _7(a,`hour`);let o=Math.floor(a/24);if(o<7)return _7(o,`day`);let s=Math.floor(o/7);if(s<4)return _7(s,`week`);let c=Math.floor(o/30);return c<12?_7(c,`month`):_7(Math.floor(o/365),`year`)}function y7(e){let t=(0,Z.c)(5),{refusedStarts:n}=e;if(n.length===0)return null;let r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(ry,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,X.jsx)(`p`,{className:`font-medium text-sm`,children:`Refused Starts`})]}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=n.map(Ege),t[1]=n,t[2]=i);let a;return t[3]===i?a=t[4]:(a=(0,X.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,children:[r,(0,X.jsx)(`div`,{className:`divide-y`,children:i})]}),t[3]=i,t[4]=a),a}function Ege(e){return(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3 py-2`,children:[(0,X.jsx)(`p`,{className:`text-foreground text-xs`,children:e.message}),(0,X.jsx)(`p`,{className:`shrink-0 text-muted-foreground text-xs tabular-nums`,title:e.createdAt.toLocaleString(),children:v7(e.createdAt)})]},e.id)}var Dge=Vy(`workflow`,`run`),Oge={pending:`muted`,running:`info`,waiting:`pending`,completed:`good`,canceled:`quiet`,superseded:`quiet`,failed:`bad`},kge={pending:`muted`,running:`info`,success:`good`,error:`bad`,cancelled:`quiet`};function b7(e){return Oge[e]??kge[e]??`muted`}var Age={good:`bg-success`,bad:`bg-destructive`,info:`bg-info`,pending:`bg-warning`,quiet:`bg-cancelled`,muted:`bg-muted-foreground`},jge={pending:`Pending`,running:`Running`,waiting:`Waiting`,completed:`Completed`,canceled:`Canceled`,superseded:`Superseded`,failed:`Failed`},Mge={pending:`Pending`,running:`Running`,success:`Success`,error:`Error`,cancelled:`Cancelled`},Nge={good:`border-success/30 bg-success/10 text-success`,bad:`border-destructive/30 bg-destructive/10 text-destructive`,info:`border-info/30 bg-info/10 text-info`,pending:`border-warning/30 bg-warning/10 text-warning`,quiet:`border-cancelled/30 bg-cancelled/10 text-cancelled`,muted:`border-muted bg-muted/40 text-muted-foreground`};function x7(e){return Age[b7(e)]}function S7(e){return jge[e]??Mge[e]??`Unknown`}function C7(e){return Nge[b7(e)]}function w7(e){let t=Number.parseInt(e,10);return t<1e3?`${e}ms`:`${(t/1e3).toFixed(2)}s`}var Pge=Jh(Eh({base64:Sh.check(Bh(101))}));function T7(e){return Pge(e)?.base64??null}function Fge(e){try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function E7(e){let t=(0,Z.c)(4),{data:n}=e,r;t[0]===n?r=t[1]:(r=JSON.stringify(n,null,2).split(/("https?:\/\/[^"]+"|"[^"]*")/g).map(Ige),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,X.jsx)(X.Fragment,{children:r}),t[2]=r,t[3]=i),i}function Ige(e){if(e.startsWith(`"`)&&e.endsWith(`"`)){let t=e.slice(1,-1);if(Fge(t))return(0,X.jsx)(`a`,{className:`text-info underline underline-offset-2 hover:text-info/80`,href:t,rel:`noopener noreferrer`,target:`_blank`,children:e},t)}return e}function Lge({data:e,isError:t=!1}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(Jv,{className:`h-7 px-2`,onClick:async n=>{n.stopPropagation();try{let n=t?String(e):JSON.stringify(e,null,2);await navigator.clipboard.writeText(n),r(!0),setTimeout(()=>r(!1),2e3)}catch(e){Dge.error(`Failed to copy the run payload`,{error:e})}},size:`sm`,type:`button`,variant:`ghost`,children:n?(0,X.jsx)(iy,{className:`size-3 text-success`}):(0,X.jsx)(uy,{className:`size-3`})})}function D7(e){let t=(0,Z.c)(21),{title:n,children:r,defaultExpanded:i,copyData:a,isError:o}=e,s=i!==void 0&&i,c=o!==void 0&&o,[l,u]=(0,Y.useState)(s),d;t[0]===l?d=t[1]:(d=()=>u(!l),t[0]=l,t[1]=d);let f;t[2]===l?f=t[3]:(f=l?(0,X.jsx)(ay,{className:`size-3 text-muted-foreground`}):(0,X.jsx)(sy,{className:`size-3 text-muted-foreground`}),t[2]=l,t[3]=f);let p;t[4]===n?p=t[5]:(p=(0,X.jsx)(`span`,{className:`font-medium text-muted-foreground text-sm`,children:n}),t[4]=n,t[5]=p);let m;t[6]!==d||t[7]!==f||t[8]!==p?(m=(0,X.jsxs)(`button`,{className:`flex items-center gap-1.5`,onClick:d,type:`button`,children:[f,p]}),t[6]=d,t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;t[10]!==a||t[11]!==c?(h=a===void 0?null:(0,X.jsx)(Lge,{data:a,isError:c}),t[10]=a,t[11]=c,t[12]=h):h=t[12];let g;t[13]===h?g=t[14]:(g=(0,X.jsx)(`div`,{className:`flex items-center gap-1`,children:h}),t[13]=h,t[14]=g);let _;t[15]!==m||t[16]!==g?(_=(0,X.jsxs)(`div`,{className:`mb-2 flex w-full items-center justify-between`,children:[m,g]}),t[15]=m,t[16]=g,t[17]=_):_=t[17];let v=l?r:null,y;return t[18]!==v||t[19]!==_?(y=(0,X.jsxs)(`div`,{children:[_,v]}),t[18]=v,t[19]=_,t[20]=y):y=t[20],y}function Rge(e,t){let n=t?.integration;if(!n)return;let r=`${n}/`;if(t.id.startsWith(r))return e[n]?.outputComponents?.[t.id.slice(r.length)]}function zge(e){let t=(0,Z.c)(22),{output:n,input:r,actionType:i}=e,a=ky(),o=jy(),s;t[0]!==i||t[1]!==a||t[2]!==o?(s=i?Rge(o,Wy(a,i)):void 0,t[0]=i,t[1]=a,t[2]=o,t[3]=s):s=t[3];let c=s,l;t[4]!==c||t[5]!==n?(l=c?null:T7(n),t[4]=c,t[5]=n,t[6]=l):l=t[6];let u=l,d;t[7]!==c||t[8]!==u||t[9]!==r||t[10]!==n?(d=c?(0,X.jsx)(`div`,{className:`overflow-hidden rounded-lg border bg-muted/50 p-3`,children:(0,X.jsx)(c,{input:r,output:n})}):u?(0,X.jsx)(`div`,{className:`overflow-hidden rounded-lg border bg-muted/50 p-3`,children:(0,X.jsx)(`img`,{alt:`Step output`,className:`max-h-96 w-auto rounded`,height:384,src:`data:image/png;base64,${u}`,width:384})}):null,t[7]=c,t[8]=u,t[9]=r,t[10]=n,t[11]=d):d=t[11];let f=d,p;t[12]===n?p=t[13]:(p=(0,X.jsx)(`pre`,{className:`overflow-auto rounded-lg border bg-muted/50 p-3 font-mono text-xs leading-relaxed`,children:(0,X.jsx)(E7,{data:n})}),t[12]=n,t[13]=p);let m;t[14]!==n||t[15]!==p?(m=(0,X.jsx)(D7,{copyData:n,title:`Output`,children:p}),t[14]=n,t[15]=p,t[16]=m):m=t[16];let h;t[17]===f?h=t[18]:(h=f?(0,X.jsx)(D7,{defaultExpanded:!0,title:`Result`,children:f}):null,t[17]=f,t[18]=h);let g;return t[19]!==m||t[20]!==h?(g=(0,X.jsxs)(X.Fragment,{children:[m,h]}),t[19]=m,t[20]=h,t[21]=g):g=t[21],g}var O7=`grid w-full grid-cols-[1.5rem_minmax(0,1fr)_5rem] items-start gap-3 px-1 py-3 text-left`;function Bge(e){return e.type===`back`?(0,X.jsx)(`button`,{"aria-label":`Back to runs list`,className:`mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-md transition-colors hover:bg-muted`,onClick:e.onBack,type:`button`,children:(0,X.jsx)(Kee,{className:`size-4 text-muted-foreground`})}):(0,X.jsx)(`div`,{"aria-hidden":!0,className:`size-6 shrink-0`})}function Vge(e,t){return t.type===`cancel`?(0,X.jsx)(`div`,{className:`flex w-20 justify-end`,children:(0,X.jsxs)(Jv,{className:`w-full`,disabled:t.isCanceling,onClick:()=>t.onCancel(e.id),size:`sm`,variant:`outline`,children:[t.isCanceling?(0,X.jsx)(gy,{className:`mr-1 size-3 animate-spin`}):(0,X.jsx)(ry,{className:`mr-1 size-3`}),`Cancel`]})}):(0,X.jsx)(`div`,{"aria-hidden":!0,className:`w-20 shrink-0`})}function Hge(e){let t=(0,Z.c)(41),{execution:n,runNumber:r,showStartEventName:i}=e,a;t[0]===n.status?a=t[1]:(a=Kv(`mt-1 size-2.5 shrink-0 rounded-full`,x7(n.status)),t[0]=n.status,t[1]=a);let o;t[2]===a?o=t[3]:(o=(0,X.jsx)(`div`,{className:a}),t[2]=a,t[3]=o);let s;t[4]===r?s=t[5]:(s=(0,X.jsxs)(`span`,{className:`font-medium text-sm`,children:[`Run #`,r]}),t[4]=r,t[5]=s);let c;t[6]===n.status?c=t[7]:(c=Kv(`rounded border px-1.5 py-0.5 font-medium text-xs uppercase`,C7(n.status)),t[6]=n.status,t[7]=c);let l;t[8]===n.status?l=t[9]:(l=S7(n.status),t[8]=n.status,t[9]=l);let u;t[10]!==c||t[11]!==l?(u=(0,X.jsx)(`span`,{className:c,children:l}),t[10]=c,t[11]=l,t[12]=u):u=t[12];let d;t[13]===n.runMode?d=t[14]:(d=n.runMode===`test`?(0,X.jsx)(`span`,{className:`rounded border border-warning/40 bg-warning/10 px-1.5 py-0.5 font-medium text-xs text-warning uppercase`,children:`Test Mode`}):null,t[13]=n.runMode,t[14]=d);let f;t[15]!==s||t[16]!==u||t[17]!==d?(f=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s,u,d]}),t[15]=s,t[16]=u,t[17]=d,t[18]=f):f=t[18];let p;t[19]===n.startedAt?p=t[20]:(p=v7(n.startedAt),t[19]=n.startedAt,t[20]=p);let m;t[21]===p?m=t[22]:(m=(0,X.jsx)(`span`,{children:p}),t[21]=p,t[22]=m);let h;t[23]===n.startSource?h=t[24]:(h=n.startSource?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{children:`·`}),(0,X.jsx)(`span`,{className:`capitalize`,children:n.startSource})]}):null,t[23]=n.startSource,t[24]=h);let g;t[25]!==n.startEventName||t[26]!==i?(g=i&&n.startEventName?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{children:`·`}),(0,X.jsx)(`span`,{children:n.startEventName})]}):null,t[25]=n.startEventName,t[26]=i,t[27]=g):g=t[27];let _;t[28]===n.duration?_=t[29]:(_=n.duration?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{children:`·`}),(0,X.jsx)(`span`,{className:`font-mono tabular-nums`,children:w7(n.duration)})]}):null,t[28]=n.duration,t[29]=_);let v;t[30]!==m||t[31]!==h||t[32]!==g||t[33]!==_?(v=(0,X.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-muted-foreground text-xs`,children:[m,h,g,_]}),t[30]=m,t[31]=h,t[32]=g,t[33]=_,t[34]=v):v=t[34];let y;t[35]!==v||t[36]!==f?(y=(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[f,v]}),t[35]=v,t[36]=f,t[37]=y):y=t[37];let b;return t[38]!==y||t[39]!==o?(b=(0,X.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[o,y]}),t[38]=y,t[39]=o,t[40]=b):b=t[40],b}function k7(e){let t=(0,Z.c)(21),{execution:n,runNumber:r,leading:i,trailing:a,onClick:o,selected:s,showStartEventName:c}=e,l=s!==void 0&&s,u=c!==void 0&&c,d;t[0]===i?d=t[1]:(d=Bge(i),t[0]=i,t[1]=d);let f;t[2]!==n||t[3]!==r||t[4]!==u?(f=(0,X.jsx)(Hge,{execution:n,runNumber:r,showStartEventName:u}),t[2]=n,t[3]=r,t[4]=u,t[5]=f):f=t[5];let p;t[6]!==n||t[7]!==a?(p=Vge(n,a),t[6]=n,t[7]=a,t[8]=p):p=t[8];let m;t[9]!==d||t[10]!==f||t[11]!==p?(m=(0,X.jsxs)(X.Fragment,{children:[d,f,p]}),t[9]=d,t[10]=f,t[11]=p,t[12]=m):m=t[12];let h=m;if(o){let e=l&&`bg-muted/50`,n;t[13]===e?n=t[14]:(n=Kv(O7,`transition-colors hover:bg-muted/50`,e),t[13]=e,t[14]=n);let r;return t[15]!==h||t[16]!==o||t[17]!==n?(r=(0,X.jsx)(`button`,{className:n,"data-testid":`workflow-run-summary-row`,onClick:o,type:`button`,children:h}),t[15]=h,t[16]=o,t[17]=n,t[18]=r):r=t[18],r}let g;return t[19]===h?g=t[20]:(g=(0,X.jsx)(`div`,{className:O7,"data-testid":`workflow-run-summary-row`,children:h}),t[19]=h,t[20]=g),g}function Uge(e){let t=(0,Z.c)(36),{log:n,isLast:r}=e,[i,a]=(0,Y.useState)(!1),o;t[0]===r?o=t[1]:(o=r?null:(0,X.jsx)(`div`,{className:`absolute top-5 bottom-0 left-2 w-px bg-border`}),t[0]=r,t[1]=o);let s;t[2]===n.status?s=t[3]:(s=Kv(`size-4 rounded-full ring-2 ring-background`,x7(n.status)),t[2]=n.status,t[3]=s);let c;t[4]===s?c=t[5]:(c=(0,X.jsx)(`div`,{className:`relative z-10 mt-1.5 flex shrink-0 items-center justify-center`,children:(0,X.jsx)(`div`,{className:s})}),t[4]=s,t[5]=c);let l;t[6]===i?l=t[7]:(l=()=>a(!i),t[6]=i,t[7]=l);let u=n.nodeName||n.nodeType,d;t[8]===u?d=t[9]:(d=(0,X.jsx)(`span`,{className:`truncate font-medium text-sm transition-colors group-hover:text-foreground`,children:u}),t[8]=u,t[9]=d);let f;t[10]===n.status?f=t[11]:(f=S7(n.status),t[10]=n.status,t[11]=f);let p;t[12]===f?p=t[13]:(p=(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:f}),t[12]=f,t[13]=p);let m;t[14]===n.duration?m=t[15]:(m=n.duration?(0,X.jsx)(`span`,{className:`shrink-0 font-mono text-muted-foreground text-xs tabular-nums`,children:w7(n.duration)}):null,t[14]=n.duration,t[15]=m);let h;t[16]!==d||t[17]!==p||t[18]!==m?(h=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[d,p,m]}),t[16]=d,t[17]=p,t[18]=m,t[19]=h):h=t[19];let g;t[20]!==h||t[21]!==l?(g=(0,X.jsx)(`button`,{className:`group w-full text-left`,onClick:l,type:`button`,children:h}),t[20]=h,t[21]=l,t[22]=g):g=t[22];let _;t[23]!==i||t[24]!==n.error||t[25]!==n.input||t[26]!==n.nodeType||t[27]!==n.output?(_=i?(0,X.jsxs)(`div`,{className:`mt-2 space-y-3`,children:[n.input!==null&&n.input!==void 0?(0,X.jsx)(D7,{copyData:n.input,title:`Input`,children:(0,X.jsx)(`pre`,{className:`overflow-auto rounded-lg border bg-muted/50 p-3 font-mono text-xs leading-relaxed`,children:(0,X.jsx)(E7,{data:n.input})})}):null,n.output!==null&&n.output!==void 0?(0,X.jsx)(zge,{actionType:n.nodeType,input:n.input,output:n.output}):null,n.error?(0,X.jsx)(D7,{copyData:n.error,defaultExpanded:!0,isError:!0,title:`Error`,children:(0,X.jsx)(`pre`,{className:`overflow-auto rounded-lg border border-destructive/20 bg-destructive/5 p-3 font-mono text-destructive text-xs leading-relaxed`,children:n.error})}):null,n.input||n.output||n.error?null:(0,X.jsx)(`div`,{className:`rounded-lg border bg-muted/30 py-4 text-center text-muted-foreground text-xs`,children:`No data recorded`})]}):null,t[23]=i,t[24]=n.error,t[25]=n.input,t[26]=n.nodeType,t[27]=n.output,t[28]=_):_=t[28];let v;t[29]!==g||t[30]!==_?(v=(0,X.jsxs)(`div`,{className:`min-w-0 flex-1 pb-4`,children:[g,_]}),t[29]=g,t[30]=_,t[31]=v):v=t[31];let y;return t[32]!==o||t[33]!==v||t[34]!==c?(y=(0,X.jsxs)(`div`,{className:`relative flex gap-3`,children:[o,c,v]}),t[32]=o,t[33]=v,t[34]=c,t[35]=y):y=t[35],y}function Wge(e){let t=(0,Z.c)(7),{logs:n}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`div`,{className:`py-8 text-center text-muted-foreground text-xs`,children:`No steps recorded`}),t[0]=e):e=t[0],e}let r;if(t[1]!==n){let e;t[3]===n.length?e=t[4]:(e=(e,t)=>(0,X.jsx)(Uge,{isLast:t===n.length-1,log:e},e.id),t[3]=n.length,t[4]=e),r=n.map(e),t[1]=n,t[2]=r}else r=t[2];let i;return t[5]===r?i=t[6]:(i=(0,X.jsx)(`div`,{className:`pl-1`,children:r}),t[5]=r,t[6]=i),i}function Gge(e){let t=(0,Z.c)(32),{execution:n,runNumber:r,notice:i,logs:a,events:o,waits:s,isCanceling:c,isResuming:l,onBack:u,onCancel:d,onResume:f}=e,p;t[0]===a?p=t[1]:(p=a.toSorted(qge),t[0]=a,t[1]=p);let m=p,h;t[2]===u?h=t[3]:(h={onBack:u,type:`back`},t[2]=u,t[3]=h);let g;t[4]!==n.status||t[5]!==c||t[6]!==d?(g=h7(n.status)?{isCanceling:c,onCancel:d,type:`cancel`}:{type:`spacer`},t[4]=n.status,t[5]=c,t[6]=d,t[7]=g):g=t[7];let _;t[8]!==n||t[9]!==r||t[10]!==h||t[11]!==g?(_=(0,X.jsx)(k7,{execution:n,leading:h,runNumber:r,showStartEventName:!0,trailing:g}),t[8]=n,t[9]=r,t[10]=h,t[11]=g,t[12]=_):_=t[12];let v;t[13]===i?v=t[14]:(v=i?(0,X.jsx)(`p`,{className:`rounded-md border bg-muted/30 p-2 text-muted-foreground text-xs`,children:i}):null,t[13]=i,t[14]=v);let y;if(t[15]!==l||t[16]!==f||t[17]!==s){let e;t[19]!==l||t[20]!==f?(e=e=>(0,X.jsxs)(`div`,{className:`space-y-1.5 rounded-md border bg-muted/30 p-2`,children:[(0,X.jsxs)(`p`,{className:`font-medium text-xs`,children:[`Parked at `,e.nodeName]}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.subscribedEvents.length>0?`Waiting for ${e.subscribedEvents.join(`, `)}`:`Waiting on a timer`}),e.resumeToken?(0,X.jsx)(Jv,{disabled:l,onClick:()=>f(e.resumeToken??``),size:`sm`,type:`button`,variant:`outline`,children:`Resume now`}):null]},e.id),t[19]=l,t[20]=f,t[21]=e):e=t[21],y=s.map(e),t[15]=l,t[16]=f,t[17]=s,t[18]=y}else y=t[18];let b;t[22]===m?b=t[23]:(b=(0,X.jsx)(Wge,{logs:m}),t[22]=m,t[23]=b);let x;t[24]===o?x=t[25]:(x=o.length>0?(0,X.jsx)(D7,{title:`Audit Events`,children:(0,X.jsx)(`div`,{className:`space-y-2`,children:o.map(Kge)})}):null,t[24]=o,t[25]=x);let S;return t[26]!==_||t[27]!==v||t[28]!==y||t[29]!==b||t[30]!==x?(S=(0,X.jsxs)(`div`,{className:`space-y-4`,children:[_,v,y,b,x]}),t[26]=_,t[27]=v,t[28]=y,t[29]=b,t[30]=x,t[31]=S):S=t[31],S}function Kge(e){return(0,X.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border bg-muted/30 px-2 py-1.5`,children:[(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`div`,{className:`truncate font-medium text-xs`,children:e.message}),(0,X.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.eventType})]}),(0,X.jsx)(`div`,{className:`ml-3 shrink-0 text-xs text-muted-foreground`,children:v7(e.createdAt)})]},e.id)}function qge(e,t){return new Date(e.startedAt).getTime()-new Date(t.startedAt).getTime()}function Jge(e){let t=(0,Z.c)(10),{executions:n,selectedId:r,onSelect:i}=e,a;if(t[0]!==n||t[1]!==i||t[2]!==r){let e;t[4]!==n.length||t[5]!==i||t[6]!==r?(e=(e,t)=>{let a=r===e.id,o=n.length-t;return(0,X.jsx)(k7,{execution:e,leading:{type:`spacer`},onClick:()=>i(e.id),runNumber:o,selected:a,trailing:{type:`spacer`}},e.id)},t[4]=n.length,t[5]=i,t[6]=r,t[7]=e):e=t[7],a=n.map(e),t[0]=n,t[1]=i,t[2]=r,t[3]=a}else a=t[3];let o;return t[8]===a?o=t[9]:(o=(0,X.jsx)(`div`,{className:`divide-y`,children:a}),t[8]=a,t[9]=o),o}var A7=2e3,j7=50,Yge=`This run has left the runs list, so what it shows stops here. A newer start supersedes the runs going for the same entity, and the list holds the newest 50.`,Xge=ma(`/workflows/$workflowId`);function Zge(){let e=(0,Z.c)(82),t=_j(U2),n=_j(y4),r=Fe(),{executionId:i}=Xge.useSearch(),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={from:`/workflows/$workflowId`},e[0]=a):a=e[0];let o=Gi(a),[s,c]=(0,Y.useState)(!1),l=s||i!==void 0,u;e[1]!==t||e[2]!==l?(u=O2.workflow.getExecutions.queryOptions({input:{workflowId:t??``,includeSuperseded:l},select:gge}),e[1]=t,e[2]=l,e[3]=u):u=e[3];let d=t!==null,f;e[4]!==u||e[5]!==d?(f={...u,enabled:d,staleTime:0,refetchInterval:A7,placeholderData:L},e[4]=u,e[5]=d,e[6]=f):f=e[6];let p=Xe(f),m;e[7]===p.data?.executions?m=e[8]:(m=p.data?.executions??[],e[7]=p.data?.executions,e[8]=m);let h=m,g=p.data?.supersededCount??0,_;e[9]===p.data?.refusedStarts?_=e[10]:(_=p.data?.refusedStarts??[],e[9]=p.data?.refusedStarts,e[10]=_);let v=_,y;e[11]!==i||e[12]!==h?(y=i===void 0?-1:h.findIndex(e=>e.id===i),e[11]=i,e[12]=h,e[13]=y):y=e[13];let b=y,x=b>=0?h[b]:void 0,S=h7(x?.status)?A7:!1,C;e[14]===i?C=e[15]:(C=O2.workflow.getExecutionLogs.queryOptions({input:{executionId:i??``},select:_ge}),e[14]=i,e[15]=C);let w=i!==void 0,T;e[16]!==S||e[17]!==C||e[18]!==w?(T={...C,enabled:w,staleTime:0,refetchInterval:S},e[16]=S,e[17]=C,e[18]=w,e[19]=T):T=e[19];let E=Xe(T),D;e[20]===i?D=e[21]:(D=O2.workflow.getExecutionEvents.queryOptions({input:{executionId:i??``},select:Sge}),e[20]=i,e[21]=D);let O=i!==void 0,k;e[22]!==S||e[23]!==D||e[24]!==O?(k={...D,enabled:O,staleTime:0,refetchInterval:S},e[22]=S,e[23]=D,e[24]=O,e[25]=k):k=e[25];let A=Xe(k),j;e[26]===r?j=e[27]:(j=O2.workflow.cancelExecution.mutationOptions({onSuccess:()=>M2(r),meta:{errorMessage:`Failed to cancel run`}}),e[26]=r,e[27]=j);let M=Ze(j),N;e[28]===r?N=e[29]:(N=O2.workflow.resumeWait.mutationOptions({onSuccess:()=>M2(r),meta:{errorMessage:`Failed to resume the run`}}),e[28]=r,e[29]=N);let P=Ze(N),F;e[30]===o?F=e[31]:(F=e=>{o({search:{executionId:e}})},e[30]=o,e[31]=F);let I=F,R;e[32]===o?R=e[33]:(R=()=>{o({search:{},replace:!0})},e[32]=o,e[33]=R);let z=R;if(p.isPending&&i===void 0){let t;return e[34]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,X.jsx)(Dy,{})}),e[34]=t):t=e[34],t}let B;e[35]!==s||e[36]!==g?(B=g>0?(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-1 pb-2`,children:[(0,X.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[g===1?`1 run was superseded by a newer start`:`${g} runs were superseded by newer starts`,g>j7?`, of which the newest ${j7} can be shown`:``]}),(0,X.jsx)(Jv,{onClick:()=>c(Qge),size:`sm`,type:`button`,variant:`ghost`,children:s?`Hide`:`Show`})]}):null,e[35]=s,e[36]=g,e[37]=B):B=e[37];let V=B;if(i!==void 0){let t=x??E.data?.execution;if(!t){if(!E.isError&&(E.isPending||p.isPending)){let t;return e[38]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,X.jsx)(Dy,{})}),e[38]=t):t=e[38],t}let t;e[39]===z?t=e[40]:(t=(0,X.jsx)(Jv,{"aria-label":`Back to runs list`,onClick:z,size:`sm`,type:`button`,variant:`ghost`,children:`Back`}),e[39]=z,e[40]=t);let n;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`This run could not be loaded.`}),e[41]=n):n=e[41];let r;return e[42]===t?r=e[43]:(r=(0,X.jsxs)(`div`,{className:`space-y-2 px-1 py-2`,children:[t,n]}),e[42]=t,e[43]=r),r}let n=b>=0?h.length-b:0,r;e[44]===A.data?r=e[45]:(r=A.data??[],e[44]=A.data,e[45]=r);let i=M.isPending&&M.variables?.executionId===t.id,a;e[46]===E.data?.logs?a=e[47]:(a=E.data?.logs??[],e[46]=E.data?.logs,e[47]=a);let o=x?void 0:Yge,s;e[48]===M?s=e[49]:(s=e=>M.mutate({executionId:e}),e[48]=M,e[49]=s);let c;e[50]===P?c=e[51]:(c=e=>P.mutate({token:e}),e[50]=P,e[51]=c);let l;e[52]===E.data?.waits?l=e[53]:(l=E.data?.waits??[],e[52]=E.data?.waits,e[53]=l);let u;return e[54]!==t||e[55]!==z||e[56]!==P.isPending||e[57]!==n||e[58]!==r||e[59]!==i||e[60]!==a||e[61]!==o||e[62]!==s||e[63]!==c||e[64]!==l?(u=(0,X.jsx)(Gge,{events:r,execution:t,isCanceling:i,isResuming:P.isPending,logs:a,notice:o,onBack:z,onCancel:s,onResume:c,runNumber:n,waits:l}),e[54]=t,e[55]=z,e[56]=P.isPending,e[57]=n,e[58]=r,e[59]=i,e[60]=a,e[61]=o,e[62]=s,e[63]=c,e[64]=l,e[65]=u):u=e[65],u}if(h.length===0){let t;e[66]===v?t=e[67]:(t=(0,X.jsx)(y7,{refusedStarts:v}),e[66]=v,e[67]=t);let n;e[68]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16`,children:[(0,X.jsx)(`div`,{className:`mb-3 rounded-lg border border-dashed p-4`,children:(0,X.jsx)(vy,{className:`size-6 text-muted-foreground`})}),(0,X.jsx)(`div`,{className:`font-medium text-foreground text-sm`,children:`No runs yet`}),(0,X.jsx)(`div`,{className:`mt-1 text-muted-foreground text-xs`,children:`Execute your workflow to see runs here`})]}),e[68]=n):n=e[68];let r;return e[69]!==V||e[70]!==t?(r=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[V,t,n]}),e[69]=V,e[70]=t,e[71]=r):r=e[71],r}let H;e[72]===v?H=e[73]:(H=(0,X.jsx)(y7,{refusedStarts:v}),e[72]=v,e[73]=H);let U;e[74]!==h||e[75]!==I||e[76]!==n?(U=(0,X.jsx)(Jge,{executions:h,onSelect:I,selectedId:n}),e[74]=h,e[75]=I,e[76]=n,e[77]=U):U=e[77];let W;return e[78]!==V||e[79]!==H||e[80]!==U?(W=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[V,H,U]}),e[78]=V,e[79]=H,e[80]=U,e[81]=W):W=e[81],W}function Qge(e){return!e}function M7(){let e=(0,Z.c)(3),t=_j(_4),n=vj(s4),r;return e[0]!==n||e[1]!==t?(r={validActiveTab:t,setActiveTab:n},e[0]=n,e[1]=t,e[2]=r):r=e[2],r}function $ge(){let{validActiveTab:e}=M7(),t=_j(R4),n=_j(z4);return e===`runs`?`Runs`:t?`Properties`:n?`Connection`:`Workflow`}function e_e(e){let t=(0,Z.c)(27),{placement:n,activeTab:r,onSelect:i,propertiesLabel:a,showRuns:o}=e;if(n===`bottom`){let e=`flex flex-1 flex-col items-center gap-1 py-3 font-medium text-xs transition-colors ${r===`properties`?`text-foreground`:`text-muted-foreground`}`,n;t[0]===i?n=t[1]:(n=()=>i(`properties`),t[0]=i,t[1]=n);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(xy,{className:`size-5`}),t[2]=s):s=t[2];let c;t[3]!==a||t[4]!==e||t[5]!==n?(c=(0,X.jsxs)(`button`,{className:e,onClick:n,type:`button`,children:[s,a]}),t[3]=a,t[4]=e,t[5]=n,t[6]=c):c=t[6];let l;t[7]!==r||t[8]!==i||t[9]!==o?(l=o?(0,X.jsxs)(`button`,{className:`flex flex-1 flex-col items-center gap-1 py-3 font-medium text-xs transition-colors ${r===`runs`?`text-foreground`:`text-muted-foreground`}`,onClick:()=>i(`runs`),type:`button`,children:[(0,X.jsx)(vy,{className:`size-5`}),`Runs`]}):null,t[7]=r,t[8]=i,t[9]=o,t[10]=l):l=t[10];let u;return t[11]!==c||t[12]!==l?(u=(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center justify-around border-t bg-background pb-safe`,children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}let s=`inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center rounded-sm px-2 py-1 font-medium text-sm transition-[color,box-shadow] ${r===`properties`?`bg-background text-foreground shadow-sm`:`text-muted-foreground`}`,c;t[14]===i?c=t[15]:(c=()=>i(`properties`),t[14]=i,t[15]=c);let l;t[16]!==a||t[17]!==s||t[18]!==c?(l=(0,X.jsx)(`button`,{className:s,onClick:c,type:`button`,children:a}),t[16]=a,t[17]=s,t[18]=c,t[19]=l):l=t[19];let u;t[20]!==r||t[21]!==i||t[22]!==o?(u=o?(0,X.jsx)(`button`,{className:`inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center rounded-sm px-2 py-1 font-medium text-sm transition-[color,box-shadow] ${r===`runs`?`bg-background text-foreground shadow-sm`:`text-muted-foreground`}`,onClick:()=>i(`runs`),type:`button`,children:`Runs`}):null,t[20]=r,t[21]=i,t[22]=o,t[23]=u):u=t[23];let d;return t[24]!==l||t[25]!==u?(d=(0,X.jsx)(`div`,{className:`shrink-0 border-b px-4 py-2.5`,children:(0,X.jsxs)(`div`,{className:`inline-flex h-9 w-full items-center justify-center rounded-lg bg-muted p-[3px] text-muted-foreground`,children:[l,u]})}),t[24]=l,t[25]=u,t[26]=d):d=t[26],d}function N7(e){let t=(0,Z.c)(92),{frame:n}=e,{updateConfig:r,refreshRuns:i,deleteRuns:a}=pge(),{validActiveTab:o,setActiveTab:s}=M7(),c=_j(R4),l=_j(z4),u=_j(j4),d=_j(M4),f=_j(g4),p=_j(U2),m=_j(W2),h=vj(fle),[g,_]=yj(q2),v=_j(K2),y=vj(q4),b=vj(Y4),x=vj(X4),S=vj(Ule),C=vj(Z4),w=P2(),[T,E]=yj(B4),D;if(t[0]!==u||t[1]!==c){let e;t[3]===c?e=t[4]:(e=e=>e.id===c,t[3]=c,t[4]=e),D=u.find(e),t[0]=u,t[1]=c,t[2]=D}else D=t[2];let O=D,k;if(t[5]!==d||t[6]!==l){let e;t[8]===l?e=t[9]:(e=e=>e.id===l,t[8]=l,t[9]=e),k=d.find(e),t[5]=d,t[6]=l,t[7]=k}else k=t[7];let A=k,j;t[10]===u?j=t[11]:(j=u.filter(n_e),t[10]=u,t[11]=j);let M=j,N;t[12]===d?N=t[13]:(N=d.filter(t_e),t[12]=d,t[13]=N);let P=N,F=M.length+P.length>1,I;t[14]!==P.length||t[15]!==M.length?(I=[],M.length>0&&I.push(`${M.length} ${M.length===1?`step`:`steps`}`),P.length>0&&I.push(`${P.length} ${P.length===1?`connection`:`connections`}`),t[14]=P.length,t[15]=M.length,t[16]=I):I=t[16];let L=I.join(` and `),R;t[17]!==O||t[18]!==y?(R=e=>{O&&y({id:O.id,data:{label:e}})},t[17]=O,t[18]=y,t[19]=R):R=t[19];let z=R,B;t[20]!==O||t[21]!==y?(B=e=>{O&&y({id:O.id,data:{description:e}})},t[20]=O,t[21]=y,t[22]=B):B=t[22];let V=B,H;t[23]!==O||t[24]!==y?(H=()=>{O&&y({id:O.id,data:{enabled:O.data.enabled===!1}})},t[23]=O,t[24]=y,t[25]=H):H=t[25];let U=H,W;t[26]!==h||t[27]!==_?(W=async e=>{let t=await h(e);t&&_(t.message||`Failed to update workflow name`)},t[26]=h,t[27]=_,t[28]=W):W=t[28];let G=W,K;t[29]!==b||t[30]!==n||t[31]!==O?(K=()=>{if(!O)return;let e=O.id;n.confirm({title:`Delete Step`,message:`Are you sure you want to delete this step? This action cannot be undone.`,confirmLabel:`Delete`,onConfirm:()=>{b(e),n.dismiss?.()}})},t[29]=b,t[30]=n,t[31]=O,t[32]=K):K=t[32];let q=K,J;t[33]!==x||t[34]!==n||t[35]!==l?(J=()=>{l&&n.confirm({title:`Delete Connection`,message:`Are you sure you want to delete this connection? This action cannot be undone.`,confirmLabel:`Delete`,onConfirm:()=>{x(l),n.dismiss?.()}})},t[33]=x,t[34]=n,t[35]=l,t[36]=J):J=t[36];let ee=J,te;t[37]!==S||t[38]!==n||t[39]!==L?(te=()=>{n.confirm({title:`Delete Selected Items`,message:`Are you sure you want to delete ${L}? This action cannot be undone.`,confirmLabel:`Delete`,onConfirm:()=>{S(),n.dismiss?.()}})},t[37]=S,t[38]=n,t[39]=L,t[40]=te):te=t[40];let ne=te,re;t[41]!==p||t[42]!==a||t[43]!==n?(re=()=>{n.confirm({title:`Delete All Runs`,message:`Are you sure you want to delete all workflow runs? This action cannot be undone.`,confirmLabel:`Delete`,onConfirm:()=>{p&&a.mutate({workflowId:p})}})},t[41]=p,t[42]=a,t[43]=n,t[44]=re):re=t[44];let ie=re,ae;t[45]!==C||t[46]!==n?(ae=()=>{n.confirm({title:`Clear Workflow`,message:`Remove every step and connection? The Lifecycle Node is kept, and this saves right away.`,confirmLabel:`Clear Workflow`,onConfirm:()=>C()})},t[45]=C,t[46]=n,t[47]=ae):ae=t[47];let oe=ae,se;t[48]!==p||t[49]!==m||t[50]!==w||t[51]!==n?(se=()=>{n.confirm({title:`Delete Workflow`,message:`Are you sure you want to delete "${m}"? This will permanently delete the workflow. This cannot be undone.`,confirmLabel:`Delete Workflow`,onConfirm:()=>{p&&w.mutate({workflowId:p},{onSuccess:()=>n.dismiss?.()})}})},t[48]=p,t[49]=m,t[50]=w,t[51]=n,t[52]=se):se=t[52];let ce=se,le=O?.data.type===`action`&&!O.data.config?.actionType&&v,ue;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,X.jsx)(`div`,{className:`rounded-lg border border-muted bg-muted/30 p-3`,children:(0,X.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`You are viewing a public workflow. Duplicate it to make changes.`})}),t[53]=ue):ue=t[53];let de=ue,fe;t[54]!==oe||t[55]!==ee||t[56]!==q||t[57]!==ne||t[58]!==ce||t[59]!==p||t[60]!==m||t[61]!==U||t[62]!==r||t[63]!==V||t[64]!==z||t[65]!==G||t[66]!==F||t[67]!==f||t[68]!==v||t[69]!==T||t[70]!==A||t[71]!==O||t[72]!==L||t[73]!==E||t[74]!==le||t[75]!==g?(fe=()=>F?(0,X.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(YZ,{children:`Selection`}),(0,X.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[L,` selected`]})]}),v?(0,X.jsx)(`div`,{className:`flex items-center gap-2 pt-4`,children:(0,X.jsxs)(Jv,{onClick:ne,size:`sm`,variant:`outline`,children:[(0,X.jsx)(Cy,{className:`mr-2 size-4 text-destructive`}),(0,X.jsx)(`span`,{className:`text-destructive`,children:`Delete`})]})}):null]}):A&&!O?(0,X.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(YZ,{htmlFor:`edge-id`,children:`Connection ID`}),(0,X.jsx)(JZ,{disabled:!0,id:`edge-id`,value:A.id})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(YZ,{htmlFor:`edge-source`,children:`Source`}),(0,X.jsx)(JZ,{disabled:!0,id:`edge-source`,value:A.source})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(YZ,{htmlFor:`edge-target`,children:`Target`}),(0,X.jsx)(JZ,{disabled:!0,id:`edge-target`,value:A.target})]}),v?(0,X.jsx)(`div`,{className:`flex items-center gap-2 pt-4`,children:(0,X.jsxs)(Jv,{onClick:ee,size:`sm`,variant:`outline`,children:[(0,X.jsx)(Cy,{className:`mr-2 size-4 text-destructive`}),(0,X.jsx)(`span`,{className:`text-destructive`,children:`Delete`})]})}):null]}):O?le?(0,X.jsx)(`div`,{className:`px-4 pt-4`,children:(0,X.jsx)(Mhe,{disabled:f,isNewlyCreated:O.id===T,onSelectAction:e=>{r({actionType:e}),O.id===T&&E(null)}},O.id)}):(0,X.jsxs)(`div`,{className:`space-y-4 p-4`,children:[O.data.type===`lifecycle`?(0,X.jsx)(oge,{config:O.data.config||{},disabled:f||!v,onUpdateConfig:r}):null,O.data.type===`action`&&!O.data.config?.actionType?(0,X.jsx)(`div`,{className:`rounded-lg border border-muted bg-muted/30 p-3`,children:(0,X.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No action configured for this step.`})}):null,O.data.type===`action`&&O.data.config?.actionType?(0,X.jsx)(Kme,{config:O.data.config||{},disabled:f||!v,isOwner:v,onUpdateConfig:r},O.id):null,O.data.type!==`action`||O.data.config?.actionType?(0,X.jsxs)(`div`,{className:O.data.type===`lifecycle`?`space-y-3 rounded-md border border-muted/70 bg-muted/20 p-3`:`space-y-4`,children:[O.data.type===`lifecycle`?(0,X.jsx)(`p`,{className:`font-medium text-muted-foreground text-sm`,children:`Node Metadata`}):null,(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(YZ,{htmlFor:`label`,children:`Label`}),(0,X.jsx)(JZ,{disabled:f||!v,id:`label`,onChange:e=>z(e.target.value),value:O.data.label})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(YZ,{htmlFor:`description`,children:`Description`}),(0,X.jsx)(JZ,{disabled:f||!v,id:`description`,onChange:e=>V(e.target.value),placeholder:`Optional description`,value:O.data.description||``})]})]}):null,v?null:de,v?(0,X.jsxs)(`div`,{className:`flex items-center gap-2 pt-4`,children:[O.data.type===`action`?(0,X.jsx)(Jv,{onClick:U,size:`sm`,variant:`outline`,children:O.data.enabled===!1?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(py,{className:`mr-2 size-4`}),`Disabled`]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(my,{className:`mr-2 size-4`}),`Enabled`]})}):null,(0,X.jsxs)(Jv,{onClick:q,size:`sm`,variant:`outline`,children:[(0,X.jsx)(Cy,{className:`mr-2 size-4 text-destructive`}),(0,X.jsx)(`span`,{className:`text-destructive`,children:`Delete`})]})]}):null]}):(0,X.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(YZ,{htmlFor:`workflow-name`,children:`Workflow Name`}),(0,X.jsx)(JZ,{className:g?`border-destructive`:void 0,disabled:!v,id:`workflow-name`,onChange:e=>G(e.target.value),value:m}),g?(0,X.jsx)(`p`,{className:`text-destructive text-xs`,children:g}):null]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(YZ,{htmlFor:`workflow-id`,children:`Workflow ID`}),(0,X.jsx)(JZ,{disabled:!0,id:`workflow-id`,value:p||`Not saved`})]}),v?null:de,v?(0,X.jsxs)(`div`,{className:`flex items-center gap-2 pt-4`,children:[(0,X.jsxs)(Jv,{className:`text-muted-foreground`,onClick:oe,size:`sm`,variant:`ghost`,children:[(0,X.jsx)(fy,{className:`mr-2 size-4`}),`Clear`]}),(0,X.jsxs)(Jv,{onClick:ce,size:`sm`,variant:`outline`,children:[(0,X.jsx)(Cy,{className:`mr-2 size-4 text-destructive`}),(0,X.jsx)(`span`,{className:`text-destructive`,children:`Delete`})]})]}):null]}),t[54]=oe,t[55]=ee,t[56]=q,t[57]=ne,t[58]=ce,t[59]=p,t[60]=m,t[61]=U,t[62]=r,t[63]=V,t[64]=z,t[65]=G,t[66]=F,t[67]=f,t[68]=v,t[69]=T,t[70]=A,t[71]=O,t[72]=L,t[73]=E,t[74]=le,t[75]=g,t[76]=fe):fe=t[76];let pe=fe,me=O||A||F?`Properties`:`Workflow`,he;t[77]!==n.tabs||t[78]!==v||t[79]!==s||t[80]!==me||t[81]!==o?(he=(0,X.jsx)(e_e,{activeTab:o,onSelect:s,placement:n.tabs,propertiesLabel:me,showRuns:v}),t[77]=n.tabs,t[78]=v,t[79]=s,t[80]=me,t[81]=o,t[82]=he):he=t[82];let ge=he,_e=n.tabs===`top`?ge:null,ve;t[83]!==ie||t[84]!==i||t[85]!==pe||t[86]!==o?(ve=o===`properties`?(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain [scrollbar-gutter:stable_both-edges]`,children:pe()}):(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b px-4 py-2`,children:[(0,X.jsxs)(Jv,{onClick:i,size:`sm`,variant:`outline`,children:[(0,X.jsx)(dte,{className:`mr-2 size-4`}),`Refresh`]}),(0,X.jsxs)(Jv,{className:`text-muted-foreground`,onClick:ie,size:`sm`,variant:`ghost`,children:[(0,X.jsx)(fy,{className:`mr-2 size-4`}),`Clear All`]})]}),(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-4 [scrollbar-gutter:stable_both-edges]`,children:(0,X.jsx)(Zge,{})})]}),t[83]=ie,t[84]=i,t[85]=pe,t[86]=o,t[87]=ve):ve=t[87];let ye=n.tabs===`bottom`?ge:null,be;return t[88]!==_e||t[89]!==ve||t[90]!==ye?(be=(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-testid":`properties-panel`,children:[_e,ve,ye]}),t[88]=_e,t[89]=ve,t[90]=ye,t[91]=be):be=t[91],be}function t_e(e){return e.selected}function n_e(e){return e.selected}function P7(e){let t=(0,Z.c)(16),{overlayId:n}=e,{push:r,closeAll:i}=cZ(),a=$ge(),o=tZ(),s;t[0]!==i||t[1]!==o?(s=()=>{o||i()},t[0]=i,t[1]=o,t[2]=s):s=t[2],UX(o,s);let c;t[3]===r?c=t[4]:(c=e=>{let{title:t,message:n,confirmLabel:i,onConfirm:a}=e;return r(qZ,{title:t,message:n,confirmLabel:i,confirmVariant:`destructive`,destructive:!0,onConfirm:a})},t[3]=r,t[4]=c);let l;t[5]!==i||t[6]!==c?(l={confirm:c,dismiss:i,tabs:`bottom`},t[5]=i,t[6]=c,t[7]=l):l=t[7];let u=l,d;t[8]!==n||t[9]!==a?(d=(0,X.jsx)(GZ,{overlayId:n,title:a}),t[8]=n,t[9]=a,t[10]=d):d=t[10];let f;t[11]===u?f=t[12]:(f=(0,X.jsx)(N7,{frame:u}),t[11]=u,t[12]=f);let p;return t[13]!==d||t[14]!==f?(p=(0,X.jsxs)(`div`,{className:`flex h-full max-h-[80vh] flex-col`,children:[d,f]}),t[13]=d,t[14]=f,t[15]=p):p=t[15],p}function r_e(){let e=(0,Z.c)(2),t=ME(i_e),n;return e[0]===t?n=e[1]:(n=()=>{document.documentElement.style.setProperty(`--rf-zoom`,String(t))},e[0]=t,e[1]=n),UX(t,n),null}function i_e(e){return e.transform[2]}var a_e=e=>{let t=(0,Z.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=[`Backspace`,`Delete`],t[3]=i):i=t[3];let a,o;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(r_e,{}),o=(0,X.jsx)(Jk,{bgColor:`var(--sidebar)`,color:`var(--border)`,gap:24,size:2}),t[4]=a,t[5]=o):(a=t[4],o=t[5]);let s;return t[6]!==n||t[7]!==r?(s=(0,X.jsxs)(Lk,{deleteKeyCode:i,fitView:!0,panActivationKeyCode:null,selectionOnDrag:!1,zoomOnDoubleClick:!1,zoomOnPinch:!0,...r,children:[a,o,n]}),t[6]=n,t[7]=r,t[8]=s):s=t[8],s},F7=.5,o_e=e=>{let t=(0,Z.c)(8),{fromX:n,fromY:r,toX:i,toY:a}=e,o=`M${n},${r} C ${n+(i-n)*F7},${r} ${n+(i-n)*F7},${a} ${i},${a}`,s;t[0]===o?s=t[1]:(s=(0,X.jsx)(`path`,{className:`animated`,d:o,fill:`none`,stroke:`var(--color-ring)`,strokeWidth:1}),t[0]=o,t[1]=s);let c;t[2]!==i||t[3]!==a?(c=(0,X.jsx)(`circle`,{cx:i,cy:a,fill:`#fff`,r:3,stroke:`var(--color-ring)`,strokeWidth:1}),t[2]=i,t[3]=a,t[4]=c):c=t[4];let l;return t[5]!==s||t[6]!==c?(l=(0,X.jsxs)(`g`,{children:[s,c]}),t[5]=s,t[6]=c,t[7]=l):l=t[7],l},s_e=__(`flex w-fit shrink-0 items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none`}},defaultVariants:{orientation:`horizontal`}});function I7(e){let t=(0,Z.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=Kv(s_e({orientation:r}),n),t[4]=n,t[5]=r,t[6]=a):a=t[6];let o;return t[7]!==r||t[8]!==i||t[9]!==a?(o=(0,X.jsx)(`div`,{className:a,"data-orientation":r,"data-slot":`button-group`,role:`group`,...i}),t[7]=r,t[8]=i,t[9]=a,t[10]=o):o=t[10],o}var c_e=e=>{let t=(0,Z.c)(33),{onReflow:n,canReflow:r}=e,i=r===void 0||r,{zoomIn:a,zoomOut:o,fitView:s}=jD(),[c,l]=yj(c4),u;t[0]===a?u=t[1]:(u=()=>{a()},t[0]=a,t[1]=u);let d=u,f;t[2]===o?f=t[3]:(f=()=>{o()},t[2]=o,t[3]=f);let p=f,m;t[4]===s?m=t[5]:(m=()=>{s({padding:.2,duration:300})},t[4]=s,t[5]=m);let h=m,g;t[6]!==l||t[7]!==c?(g=()=>{l(!c)},t[6]=l,t[7]=c,t[8]=g):g=t[8];let _=g,v;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,X.jsx)(vte,{className:`size-4`}),t[9]=v):v=t[9];let y;t[10]===d?y=t[11]:(y=(0,X.jsx)(Jv,{className:`border hover:bg-secondary disabled:opacity-100 dark:hover:bg-secondary disabled:[&>svg]:text-muted-foreground`,onClick:d,size:`icon`,title:`Zoom in`,variant:`secondary`,children:v}),t[10]=d,t[11]=y);let b;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,X.jsx)(yte,{className:`size-4`}),t[12]=b):b=t[12];let x;t[13]===p?x=t[14]:(x=(0,X.jsx)(Jv,{className:`border hover:bg-secondary disabled:opacity-100 dark:hover:bg-secondary disabled:[&>svg]:text-muted-foreground`,onClick:p,size:`icon`,title:`Zoom out`,variant:`secondary`,children:b}),t[13]=p,t[14]=x);let S;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,X.jsx)(ate,{className:`size-4`}),t[15]=S):S=t[15];let C;t[16]===h?C=t[17]:(C=(0,X.jsx)(Jv,{className:`border hover:bg-secondary disabled:opacity-100 dark:hover:bg-secondary disabled:[&>svg]:text-muted-foreground`,onClick:h,size:`icon`,title:`Fit view`,variant:`secondary`,children:S}),t[16]=h,t[17]=C);let w=c?`Hide minimap`:`Show minimap`,T;t[18]===c?T=t[19]:(T=c?(0,X.jsx)(ite,{className:`size-4`}):(0,X.jsx)(rte,{className:`size-4`}),t[18]=c,t[19]=T);let E;t[20]!==_||t[21]!==w||t[22]!==T?(E=(0,X.jsx)(Jv,{className:`border hover:bg-secondary disabled:opacity-100 dark:hover:bg-secondary disabled:[&>svg]:text-muted-foreground`,onClick:_,size:`icon`,title:w,variant:`secondary`,children:T}),t[20]=_,t[21]=w,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==i||t[25]!==n?(D=n?(0,X.jsx)(Jv,{"aria-label":`Reflow nodes`,className:`border hover:bg-secondary disabled:opacity-100 dark:hover:bg-secondary disabled:[&>svg]:text-muted-foreground`,disabled:!i,onClick:n,size:`icon`,title:`Reflow nodes`,variant:`secondary`,children:(0,X.jsx)(ute,{className:`size-4`})}):null,t[24]=i,t[25]=n,t[26]=D):D=t[26];let O;return t[27]!==C||t[28]!==E||t[29]!==D||t[30]!==y||t[31]!==x?(O=(0,X.jsxs)(I7,{orientation:`vertical`,children:[y,x,C,E,D]}),t[27]=C,t[28]=E,t[29]=D,t[30]=y,t[31]=x,t[32]=O):O=t[32],O};function L7(e){return new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})}function l_e(e){navigator.clipboard.writeText(e),Fy.success(`Copied to clipboard`)}function u_e(e){let t=(0,Z.c)(19),{overlayId:n,onCreated:r}=e,{pop:i}=cZ(),a=Fe(),[o,s]=(0,Y.useState)(``),c;t[0]!==r||t[1]!==i||t[2]!==a?(c=O2.apiKey.create.mutationOptions({onSuccess:async e=>{r(e.key),Fy.success(`API key created successfully`),await a.invalidateQueries({queryKey:O2.apiKey.key()}),i()},meta:{errorMessage:`Failed to create API key`}}),t[0]=r,t[1]=i,t[2]=a,t[3]=c):c=t[3];let l=Ze(c),u;t[4]!==l||t[5]!==o?(u=()=>l.mutate({name:o||null}),t[4]=l,t[5]=o,t[6]=u):u=t[6];let d;t[7]!==l.isPending||t[8]!==u?(d=[{label:`Create`,onClick:u,loading:l.isPending}],t[7]=l.isPending,t[8]=u,t[9]=d):d=t[9];let f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,X.jsx)(`p`,{className:`mb-4 text-muted-foreground text-sm`,children:`Create a new API key for webhook authentication`}),t[10]=f):f=t[10];let p;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,X.jsx)(YZ,{htmlFor:`key-name`,children:`Label (optional)`}),t[11]=p):p=t[11];let m;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(m=e=>s(e.target.value),t[12]=m):m=t[12];let h;t[13]===o?h=t[14]:(h=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[p,(0,X.jsx)(JZ,{id:`key-name`,onChange:m,placeholder:`e.g., Production, Testing`,value:o})]}),t[13]=o,t[14]=h);let g;return t[15]!==n||t[16]!==d||t[17]!==h?(g=(0,X.jsxs)(KZ,{actions:d,overlayId:n,title:`Create API Key`,children:[f,h]}),t[15]=n,t[16]=d,t[17]=h,t[18]=g):g=t[18],g}function d_e(e){let t=(0,Z.c)(26),{overlayId:n}=e,{push:r,closeAll:i}=cZ(),a=Fe(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={...O2.apiKey.getAll.queryOptions({input:{}}),meta:{errorMessage:`Failed to load API keys`}},t[0]=o):o=t[0];let{data:s,isPending:c}=Xe(o),l;t[1]===s?l=t[2]:(l=s===void 0?[]:s,t[1]=s,t[2]=l);let u=l,[d,f]=(0,Y.useState)(null),p;t[3]===a?p=t[4]:(p=O2.apiKey.delete.mutationOptions({onSuccess:async()=>{Fy.success(`API key deleted`),await a.invalidateQueries({queryKey:O2.apiKey.key()})},meta:{errorMessage:`Failed to delete API key`}}),t[3]=a,t[4]=p);let m=Ze(p),h=m.isPending?m.variables?.keyId:void 0,g;t[5]!==m||t[6]!==r?(g=e=>{r(qZ,{title:`Delete API Key`,message:`Are you sure you want to delete this API key? Any webhooks using this key will stop working immediately.`,confirmLabel:`Delete`,confirmVariant:`destructive`,destructive:!0,onConfirm:()=>m.mutate({keyId:e})})},t[5]=m,t[6]=r,t[7]=g):g=t[7];let _=g,v;t[8]===r?v=t[9]:(v={label:`New API Key`,variant:`outline`,onClick:()=>r(u_e,{onCreated:f})},t[8]=r,t[9]=v);let y;t[10]===i?y=t[11]:(y={label:`Done`,onClick:i},t[10]=i,t[11]=y);let b;t[12]!==v||t[13]!==y?(b=[v,y],t[12]=v,t[13]=y,t[14]=b):b=t[14];let x;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,X.jsx)(`p`,{className:`-mt-2 mb-4 text-muted-foreground text-sm`,children:`Manage API keys for webhook authentication`}),t[15]=x):x=t[15];let S;t[16]!==u||t[17]!==h||t[18]!==c||t[19]!==d||t[20]!==_?(S=c?(0,X.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,X.jsx)(Dy,{})}):(0,X.jsxs)(`div`,{className:`space-y-4`,children:[d&&(0,X.jsxs)(`div`,{className:`rounded-md border border-warning/50 bg-warning/10 p-3`,children:[(0,X.jsx)(`p`,{className:`mb-2 font-medium text-sm text-warning`,children:`Copy your API key now. You won't be able to see it again!`}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`code`,{className:`flex-1 rounded bg-muted px-2 py-1 font-mono text-xs`,children:d}),(0,X.jsx)(Jv,{onClick:()=>l_e(d),size:`sm`,variant:`outline`,children:(0,X.jsx)(uy,{className:`size-4`})})]}),(0,X.jsx)(Jv,{className:`mt-2`,onClick:()=>f(null),size:`sm`,variant:`ghost`,children:`Dismiss`})]}),u.length===0?(0,X.jsxs)(`div`,{className:`py-8 text-center text-muted-foreground text-sm`,children:[(0,X.jsx)(hy,{className:`mx-auto mb-2 size-8 opacity-50`}),(0,X.jsx)(`p`,{children:`No API keys yet`}),(0,X.jsx)(`p`,{className:`text-xs`,children:`Create an API key to authenticate webhook requests`})]}):(0,X.jsx)(`div`,{className:`space-y-2`,children:u.map(e=>(0,X.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-3`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsxs)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-xs`,children:[e.keyPrefix,`...`]}),e.name&&(0,X.jsx)(`span`,{className:`truncate text-sm`,children:e.name})]}),(0,X.jsxs)(`p`,{className:`mt-1 text-muted-foreground text-xs`,children:[`Created `,L7(e.createdAt),e.lastUsedAt&&` · Last used ${L7(e.lastUsedAt)}`]})]}),(0,X.jsx)(Jv,{disabled:h===e.id,onClick:()=>_(e.id),size:`sm`,variant:`ghost`,children:h===e.id?(0,X.jsx)(Dy,{className:`size-4`}):(0,X.jsx)(Cy,{className:`size-4 text-destructive`})})]},e.id))})]}),t[16]=u,t[17]=h,t[18]=c,t[19]=d,t[20]=_,t[21]=S):S=t[21];let C;return t[22]!==n||t[23]!==S||t[24]!==b?(C=(0,X.jsxs)(KZ,{actions:b,overlayId:n,title:`API Keys`,children:[x,S]}),t[22]=n,t[23]=S,t[24]=b,t[25]=C):C=t[25],C}function f_e(e){let t=(0,Z.c)(24),{filter:n}=e,r=n===void 0?``:n,i=ky(),{push:a}=cZ(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={...k2(),meta:{errorMessage:`Failed to load integrations`}},t[0]=o):o=t[0];let{data:s,isPending:c}=Xe(o),l;t[1]===s?l=t[2]:(l=s===void 0?[]:s,t[1]=s,t[2]=l);let u=l,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=O2.integration.testConnection.mutationOptions({onSuccess:r3,meta:{errorMessage:`Connection test failed`}}),t[3]=d):d=t[3];let f=Ze(d),p;if(t[4]!==i||t[5]!==r||t[6]!==u){let e=r.toLowerCase(),n;t[8]===i?n=t[9]:(n=e=>{let t=Gy(i,e.type);return{...e,label:t?.label??e.type,hasTest:t?.hasTest===!0,known:t!==void 0}},t[8]=i,t[9]=n),p=u.map(n).filter(t=>!r||t.label.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||t.type.toLowerCase().includes(e)).toSorted(p_e),t[4]=i,t[5]=r,t[6]=u,t[7]=p}else p=t[7];let m=p,h;t[10]===a?h=t[11]:(h=e=>{a(a3,{integration:e})},t[10]=a,t[11]=h);let g=h,_;t[12]===a?_=t[13]:(_=e=>{a(o3,{integration:e})},t[12]=a,t[13]=_);let v=_,y=f.isPending?f.variables?.integrationId:void 0;if(c){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,X.jsx)(Dy,{})}),t[14]=e):e=t[14],e}let b;t[15]!==v||t[16]!==g||t[17]!==u.length||t[18]!==m||t[19]!==f||t[20]!==y?(b=()=>u.length===0?(0,X.jsx)(`div`,{className:`py-8 text-center`,children:(0,X.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No connections configured yet`})}):m.length===0?(0,X.jsx)(`div`,{className:`py-8 text-center`,children:(0,X.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No connections match your filter`})}):(0,X.jsx)(`div`,{className:`space-y-1`,children:m.map(e=>(0,X.jsxs)(`div`,{className:`flex items-center justify-between rounded-md px-2 py-1.5`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(t3,{className:`size-4`,integration:e.type}),(0,X.jsx)(`span`,{className:`font-medium text-sm`,children:e.label}),(0,X.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:e.name}),e.known?null:(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Not available in this build`})]}),(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.hasTest&&(0,X.jsx)(Jv,{className:`h-7 px-2`,disabled:y===e.id,onClick:()=>f.mutate({integrationId:e.id}),size:`sm`,variant:`outline`,children:y===e.id?(0,X.jsx)(Dy,{className:`size-3`}):(0,X.jsx)(`span`,{className:`text-xs`,children:`Test`})}),(0,X.jsx)(Jv,{className:`size-7`,onClick:()=>g(e),size:`icon`,variant:`outline`,children:(0,X.jsx)(_y,{className:`size-3`})}),(0,X.jsx)(Jv,{className:`size-7`,onClick:()=>v(e),size:`icon`,variant:`outline`,children:(0,X.jsx)(Cy,{className:`size-3`})})]})]},e.id))}),t[15]=v,t[16]=g,t[17]=u.length,t[18]=m,t[19]=f,t[20]=y,t[21]=b):b=t[21];let x=b,S;return t[22]===x?S=t[23]:(S=(0,X.jsx)(`div`,{className:`space-y-1`,children:x()}),t[22]=x,t[23]=S),S}function p_e(e,t){let n=e.label.localeCompare(t.label);return n===0?e.name.localeCompare(t.name):n}function m_e(e){let t=(0,Z.c)(25),{overlayId:n}=e,{push:r,closeAll:i}=cZ(),[a,o]=(0,Y.useState)(``),s;t[0]===r?s=t[1]:(s=()=>{r(Zle,{})},t[0]=r,t[1]=s);let c=s,l;t[2]===i?l=t[3]:(l=()=>i(),t[2]=i,t[3]=l);let u=l,d;t[4]===c?d=t[5]:(d={label:`Add Connection`,variant:`outline`,onClick:c},t[4]=c,t[5]=d);let f;t[6]===u?f=t[7]:(f={label:`Done`,onClick:u},t[6]=u,t[7]=f);let p;t[8]!==d||t[9]!==f?(p=[d,f],t[8]=d,t[9]=f,t[10]=p):p=t[10];let m;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,X.jsx)(`p`,{className:`-mt-2 mb-4 text-muted-foreground text-sm`,children:`Manage API keys and credentials used by your workflows`}),t[11]=m):m=t[11];let h;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,X.jsx)(by,{className:`absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),t[12]=h):h=t[12];let g;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>o(e.target.value),t[13]=g):g=t[13];let _;t[14]===a?_=t[15]:(_=(0,X.jsxs)(`div`,{className:`relative`,children:[h,(0,X.jsx)(JZ,{className:`pl-9`,onChange:g,placeholder:`Filter connections...`,value:a})]}),t[14]=a,t[15]=_);let v;t[16]===a?v=t[17]:(v=(0,X.jsx)(`div`,{className:`max-h-[300px] overflow-y-auto`,children:(0,X.jsx)(f_e,{filter:a})}),t[16]=a,t[17]=v);let y;t[18]!==v||t[19]!==_?(y=(0,X.jsxs)(`div`,{className:`space-y-4`,children:[_,v]}),t[18]=v,t[19]=_,t[20]=y):y=t[20];let b;return t[21]!==n||t[22]!==y||t[23]!==p?(b=(0,X.jsxs)(KZ,{actions:p,overlayId:n,title:`Connections`,children:[m,y]}),t[21]=n,t[22]=y,t[23]=p,t[24]=b):b=t[24],b}var h_e=()=>{let e=(0,Z.c)(25),{theme:t,setTheme:n}=wZ(),{open:r}=cZ(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(Q5,{render:(0,X.jsx)(Jv,{className:`h-9`,size:`sm`,variant:`outline`}),children:`Settings`}),e[0]=i):i=e[0];let a;e[1]===r?a=e[2]:(a=()=>r(m_e),e[1]=r,e[2]=a);let o,s;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(cte,{className:`size-4`}),s=(0,X.jsx)(`span`,{children:`Connections`}),e[3]=o,e[4]=s):(o=e[3],s=e[4]);let c;e[5]===a?c=e[6]:(c=(0,X.jsxs)(e7,{onClick:a,children:[o,s]}),e[5]=a,e[6]=c);let l;e[7]===r?l=e[8]:(l=()=>r(d_e),e[7]=r,e[8]=l);let u,d;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,X.jsx)(hy,{className:`size-4`}),d=(0,X.jsx)(`span`,{children:`API Keys`}),e[9]=u,e[10]=d):(u=e[9],d=e[10]);let f;e[11]===l?f=e[12]:(f=(0,X.jsxs)(e7,{onClick:l,children:[u,d]}),e[11]=l,e[12]=f);let p;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,X.jsx)(n7,{}),e[13]=p):p=e[13];let m;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,X.jsxs)(whe,{children:[(0,X.jsx)(hte,{className:`size-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0`}),(0,X.jsx)(ote,{className:`absolute size-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100`}),(0,X.jsx)(`span`,{children:`Theme`})]}),e[14]=m):m=e[14];let h,g,_;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,X.jsx)(t7,{value:`light`,children:`Light`}),g=(0,X.jsx)(t7,{value:`dark`,children:`Dark`}),_=(0,X.jsx)(t7,{value:`system`,children:`System`}),e[15]=h,e[16]=g,e[17]=_):(h=e[15],g=e[16],_=e[17]);let v;e[18]!==n||e[19]!==t?(v=(0,X.jsxs)(Che,{children:[m,(0,X.jsx)(The,{children:(0,X.jsxs)(She,{onValueChange:n,value:t,children:[h,g,_]})})]}),e[18]=n,e[19]=t,e[20]=v):v=e[20];let y;return e[21]!==v||e[22]!==c||e[23]!==f?(y=(0,X.jsxs)(Z5,{children:[i,(0,X.jsxs)($5,{align:`end`,className:`w-56`,children:[c,f,p,v]})]}),e[21]=v,e[22]=c,e[23]=f,e[24]=y):y=e[24],y};function g_e(e){let t=(0,Z.c)(5),{className:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(`path`,{className:`fill-foreground`,d:`M125.776 0C120.929 1.64945e-05 117 3.9291 117 8.77539V61.4248C117 66.2711 120.929 70.2002 125.776 70.2002H160.875L161.253 70.2051C169.032 70.4023 175.301 76.6734 175.495 84.4531L175.5 84.8252V143.325C175.5 148.171 179.429 152.101 184.276 152.101H219.375L219.753 152.105C227.53 152.303 233.798 158.571 233.995 166.348L234 166.726V225.225C234 230.071 237.929 234 242.776 234H295.425C300.271 234 304.2 230.071 304.2 225.225V172.575C304.2 167.729 300.271 163.8 295.425 163.8H260.25C252.334 163.76 245.905 157.43 245.705 149.553L245.7 149.176V90.6758C245.7 85.8295 241.771 81.9004 236.925 81.9004H201.825C193.874 81.9004 187.405 75.5551 187.205 67.6523L187.2 67.2754V8.77539C187.2 3.9291 183.271 1.64951e-05 178.425 0H125.776Z`}),i=(0,X.jsx)(`path`,{className:`fill-foreground`,d:`M67.2755 81.9004C62.4293 81.9004 58.5002 85.8295 58.5002 90.6758V143.325C58.5004 148.171 62.4294 152.101 67.2755 152.101H102.375L102.753 152.105C110.53 152.303 116.798 158.571 116.995 166.348L117 166.726V225.225C117 230.071 120.929 234 125.776 234H178.425C183.271 234 187.2 230.071 187.2 225.225V172.575C187.2 167.729 183.271 163.8 178.425 163.8H143.25C135.334 163.76 128.905 157.43 128.705 149.553L128.7 149.176V90.6758C128.7 85.8295 124.771 81.9004 119.925 81.9004H67.2755Z`}),a=(0,X.jsx)(`path`,{className:`fill-foreground`,d:`M8.77454 163.8C3.92844 163.8 0.00012207 167.729 0.00012207 172.575V225.225C0.00012207 230.071 3.92844 234 8.77454 234H61.4249C66.2712 234 70.2003 230.071 70.2003 225.225V172.575C70.2003 167.729 66.2712 163.8 61.4249 163.8H8.77454Z`}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;return t[3]===n?o=t[4]:(o=(0,X.jsxs)(`svg`,{className:n,fill:`none`,height:`16`,viewBox:`0 0 305 234`,width:`16`,xmlns:`http://www.w3.org/2000/svg`,children:[r,i,a]}),t[3]=n,t[4]=o),o}function __e(e){let t=new Set(e.map(e=>e.toLowerCase())),n=`New Workflow`;if(!t.has(`new workflow`))return n;let r=2;for(;t.has(`${n} (${r})`.toLowerCase());)r+=1;return`${n} (${r})`}function R7(e){let t=(0,Z.c)(50),{open:n,onOpenChange:r,existingWorkflowNames:i,onCreated:a}=e,o;t[0]===i?o=t[1]:(o=()=>__e(i),t[0]=i,t[1]=o);let[s,c]=(0,Y.useState)(o),[l,u]=(0,Y.useState)(null),d=Fe(),f;if(t[2]!==a||t[3]!==r||t[4]!==d){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>{u(e instanceof x2?e.message:`Failed to create workflow`)},t[6]=e):e=t[6],f=O2.workflow.create.mutationOptions({onSuccess:async e=>{await A2(d),await a(e.id),r(!1),Fy.success(`Workflow created`)},onError:e,meta:{errorShownByCaller:!0}}),t[2]=a,t[3]=r,t[4]=d,t[5]=f}else f=t[5];let p=Ze(f),m=p.isPending,h;t[7]!==p||t[8]!==s?(h=()=>{let e=s.trim();if(!e){u(`Workflow name is required.`);return}u(null),p.mutate({name:e,graph:h2({nodes:[],edges:[]})})},t[7]=p,t[8]=s,t[9]=h):h=t[9];let g=h,_;t[10]!==m||t[11]!==r?(_=e=>{e||m||r(!1)},t[10]=m,t[11]=r,t[12]=_):_=t[12];let v=_,y=!m,b;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,X.jsxs)(LX,{children:[(0,X.jsx)(zX,{children:`Create Workflow`}),(0,X.jsx)(BX,{children:`Choose a name for the new workflow.`})]}),t[13]=b):b=t[13];let x;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,X.jsx)(YZ,{htmlFor:`create-workflow-name`,children:`Name`}),t[14]=x):x=t[14];let S=l?!0:void 0,C;t[15]===l?C=t[16]:(C=e=>{c(e.target.value),l&&u(null)},t[15]=l,t[16]=C);let w;t[17]===g?w=t[18]:(w=e=>{e.key===`Enter`&&(e.preventDefault(),g())},t[17]=g,t[18]=w);let T;t[19]!==m||t[20]!==w||t[21]!==S||t[22]!==C||t[23]!==s?(T=(0,X.jsx)(JZ,{"aria-invalid":S,autoFocus:!0,disabled:m,id:`create-workflow-name`,onChange:C,onKeyDown:w,placeholder:`Workflow name`,value:s}),t[19]=m,t[20]=w,t[21]=S,t[22]=C,t[23]=s,t[24]=T):T=t[24];let E;t[25]===l?E=t[26]:(E=l?(0,X.jsx)(`p`,{className:`text-destructive text-xs`,children:l}):null,t[25]=l,t[26]=E);let D;t[27]!==T||t[28]!==E?(D=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[x,T,E]}),t[27]=T,t[28]=E,t[29]=D):D=t[29];let O;t[30]===r?O=t[31]:(O=()=>{r(!1)},t[30]=r,t[31]=O);let k;t[32]!==m||t[33]!==O?(k=(0,X.jsx)(Jv,{disabled:m,onClick:O,type:`button`,variant:`outline`,children:`Cancel`}),t[32]=m,t[33]=O,t[34]=k):k=t[34];let A=m?`Creating...`:`Create Workflow`,j;t[35]!==g||t[36]!==m||t[37]!==A?(j=(0,X.jsx)(Jv,{disabled:m,onClick:g,type:`button`,children:A}),t[35]=g,t[36]=m,t[37]=A,t[38]=j):j=t[38];let M;t[39]!==k||t[40]!==j?(M=(0,X.jsxs)(RX,{children:[k,j]}),t[39]=k,t[40]=j,t[41]=M):M=t[41];let N;t[42]!==D||t[43]!==M||t[44]!==y?(N=(0,X.jsxs)(IX,{showCloseButton:y,children:[b,D,M]}),t[42]=D,t[43]=M,t[44]=y,t[45]=N):N=t[45];let P;return t[46]!==v||t[47]!==n||t[48]!==N?(P=(0,X.jsx)(NX,{onOpenChange:v,open:n,children:N}),t[46]=v,t[47]=n,t[48]=N,t[49]=P):P=t[49],P}var v_e=132;function z7(e){return e>1?e*v_e:192}function y_e(e){let t=(0,Z.c)(10),{isPublishing:n,disabled:r,handlePublish:i}=e,a=r||n,o=n?`Publishing...`:`Publish workflow`,s;t[0]===n?s=t[1]:(s=n?(0,X.jsx)(gy,{className:`size-4 animate-spin`,"data-icon":`inline-start`}):(0,X.jsx)(_te,{className:`size-4`,"data-icon":`inline-start`}),t[0]=n,t[1]=s);let c=n?`Publishing`:`Publish`,l;t[2]===c?l=t[3]:(l=(0,X.jsx)(`span`,{className:`hidden @xl:inline`,children:c}),t[2]=c,t[3]=l);let u;return t[4]!==i||t[5]!==a||t[6]!==o||t[7]!==s||t[8]!==l?(u=(0,X.jsxs)(Jv,{className:`relative gap-1.5`,disabled:a,onClick:i,size:`default`,title:o,variant:`default`,children:[s,l]}),t[4]=i,t[5]=a,t[6]=o,t[7]=s,t[8]=l,t[9]=u):u=t[9],u}function b_e(e){let t=(0,Z.c)(13),{state:n,handleSave:r}=e,i;t[0]===n.nodes?i=t[1]:(i=n.nodes.some(x_e),t[0]=n.nodes,t[1]=i);let a=!i||n.isGenerating||n.isSaving,o=n.isSaving?`Saving...`:`Save workflow`,s;t[2]===n.isSaving?s=t[3]:(s=n.isSaving?(0,X.jsx)(gy,{className:`size-4 animate-spin`}):(0,X.jsx)(fte,{className:`size-4`}),t[2]=n.isSaving,t[3]=s);let c;t[4]!==n.hasUnsavedChanges||t[5]!==n.isSaving?(c=n.hasUnsavedChanges&&!n.isSaving&&(0,X.jsx)(`div`,{className:`absolute top-1.5 right-1.5 size-2 rounded-full bg-primary`}),t[4]=n.hasUnsavedChanges,t[5]=n.isSaving,t[6]=c):c=t[6];let l;return t[7]!==r||t[8]!==a||t[9]!==o||t[10]!==s||t[11]!==c?(l=(0,X.jsxs)(Jv,{className:`relative border hover:bg-secondary disabled:opacity-100 dark:hover:bg-secondary disabled:[&>svg]:text-muted-foreground`,disabled:a,onClick:r,size:`icon`,title:o,variant:`secondary`,children:[s,c]}),t[7]=r,t[8]=a,t[9]=o,t[10]=s,t[11]=c,t[12]=l):l=t[12],l}function x_e(e){return e.type!==`add`}function S_e(e){let t=(0,Z.c)(8),{state:n,actions:r}=e,i=n.isExecuting||n.nodes.length===0||n.isGenerating||!n.currentWorkflowId,a;t[0]===r?a=t[1]:(a=()=>r.handleExecute(),t[0]=r,t[1]=a);let o;t[2]===n.isExecuting?o=t[3]:(o=n.isExecuting?(0,X.jsx)(gy,{className:`size-4 animate-spin`}):(0,X.jsx)(vy,{className:`size-4`}),t[2]=n.isExecuting,t[3]=o);let s;return t[4]!==i||t[5]!==a||t[6]!==o?(s=(0,X.jsx)(I7,{className:`flex`,orientation:`horizontal`,children:(0,X.jsx)(Jv,{className:`border hover:bg-secondary disabled:opacity-100 dark:hover:bg-secondary disabled:[&>svg]:text-muted-foreground`,disabled:i,onClick:a,size:`icon`,title:`Run Workflow`,variant:`secondary`,children:o})}),t[4]=i,t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function C_e(e){let t=(0,Z.c)(6),{isDuplicating:n,onDuplicate:r}=e,i;t[0]===n?i=t[1]:(i=n?(0,X.jsx)(gy,{className:`mr-2 size-4 animate-spin`}):(0,X.jsx)(uy,{className:`mr-2 size-4`}),t[0]=n,t[1]=i);let a;return t[2]!==n||t[3]!==r||t[4]!==i?(a=(0,X.jsxs)(Jv,{className:`h-9 border hover:bg-secondary dark:hover:bg-secondary`,disabled:n,onClick:r,size:`sm`,title:`Duplicate to your workflows`,variant:`secondary`,children:[i,`Duplicate`]}),t[2]=n,t[3]=r,t[4]=i,t[5]=a):a=t[5],a}function w_e(e){let t=(0,Z.c)(81),{workflowId:n,state:r,actions:i}=e,{open:a,push:o}=cZ(),[s]=yj(R4),[c]=yj(z4),l=_j(j4),u=_j(M4),d=vj(Y4),f=vj(X4),{screenToFlowPosition:p}=jD(),m=tZ(),h=_j(F4),g;if(t[0]!==l||t[1]!==s){let e;t[3]===s?e=t[4]:(e=e=>e.id===s,t[3]=s,t[4]=e),g=l.find(e),t[0]=l,t[1]=s,t[2]=g}else g=t[2];let _=g,v;if(t[5]!==u||t[6]!==c){let e;t[8]===c?e=t[9]:(e=e=>e.id===c,t[8]=c,t[9]=e),v=u.find(e),t[5]=u,t[6]=c,t[7]=v}else v=t[7];let y=_||v,b;t[10]!==h||t[11]!==r?(b=h||r.isSaving||!r.nodes.some(T_e),t[10]=h,t[11]=r,t[12]=b):b=t[12];let x=b;if(n&&!r.isOwner)return null;let S;t[13]!==f||t[14]!==d||t[15]!==o||t[16]!==c||t[17]!==s?(S=()=>{let e=s?`Node`:`Connection`;o(qZ,{title:`Delete ${e}`,message:`Are you sure you want to delete this ${e.toLowerCase()}? This action cannot be undone.`,confirmLabel:`Delete`,confirmVariant:`destructive`,onConfirm:()=>{s?d(s):c&&f(c)}})},t[13]=f,t[14]=d,t[15]=o,t[16]=c,t[17]=s,t[18]=S):S=t[18];let C=S,w;t[19]!==p||t[20]!==r?(w=()=>{let e=document.querySelector(`.react-flow`);if(!e)return;let t=e.getBoundingClientRect(),n=t.left+t.width/2,i=t.top+t.height/2,a=p({x:n,y:i});a.x-=96,a.y-=96;let o={...a},s=!0,c=0;for(;s&&c<20;)s=r.nodes.some(e=>Math.abs(e.position.x-o.x)<192&&Math.abs(e.position.y-o.y)<192),s&&(o.x+=20,o.y+=20,c+=1);let l={id:Z8(),type:`action`,position:o,data:{label:``,description:``,type:`action`,config:{},status:`idle`}};r.addNode(l),r.setSelectedNodeId(l.id),r.setActiveTab(`properties`)},t[19]=p,t[20]=r,t[21]=w):w=t[21];let T=w,E;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,X.jsx)(yy,{className:`size-4`}),t[22]=E):E=t[22];let D;t[23]!==T||t[24]!==r.isGenerating?(D=(0,X.jsx)(I7,{className:`flex`,orientation:`horizontal`,children:(0,X.jsx)(Jv,{className:`border hover:bg-secondary disabled:opacity-100 dark:hover:bg-secondary disabled:[&>svg]:text-muted-foreground`,disabled:r.isGenerating,onClick:T,size:`icon`,title:`Add Step`,variant:`secondary`,children:E})}),t[23]=T,t[24]=r.isGenerating,t[25]=D):D=t[25];let O=m?``:`hidden`,k;t[26]===O?k=t[27]:(k=Kv(`flex`,O),t[26]=O,t[27]=k);let A;t[28]===a?A=t[29]:(A=()=>a(P7,{}),t[28]=a,t[29]=A);let j;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,X.jsx)(xy,{className:`size-4`}),t[30]=j):j=t[30];let M;t[31]===A?M=t[32]:(M=(0,X.jsx)(Jv,{className:`border hover:bg-secondary dark:hover:bg-secondary`,onClick:A,size:`icon`,title:`Configuration`,variant:`secondary`,children:j}),t[31]=A,t[32]=M);let N;t[33]!==C||t[34]!==y?(N=y&&(0,X.jsx)(Jv,{className:`border hover:bg-secondary dark:hover:bg-secondary`,onClick:C,size:`icon`,title:`Delete`,variant:`secondary`,children:(0,X.jsx)(Cy,{className:`size-4`})}),t[33]=C,t[34]=y,t[35]=N):N=t[35];let P;t[36]!==M||t[37]!==N||t[38]!==k?(P=(0,X.jsxs)(I7,{className:k,orientation:`horizontal`,children:[M,N]}),t[36]=M,t[37]=N,t[38]=k,t[39]=P):P=t[39];let F=!r.canUndo||r.isGenerating,I;t[40]===r?I=t[41]:(I=()=>r.undo(),t[40]=r,t[41]=I);let L;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,X.jsx)(gte,{className:`size-4`}),t[42]=L):L=t[42];let R;t[43]!==F||t[44]!==I?(R=(0,X.jsx)(Jv,{className:`border hover:bg-secondary disabled:opacity-100 dark:hover:bg-secondary disabled:[&>svg]:text-muted-foreground`,disabled:F,onClick:I,size:`icon`,title:`Undo`,variant:`secondary`,children:L}),t[43]=F,t[44]=I,t[45]=R):R=t[45];let z=!r.canRedo||r.isGenerating,B;t[46]===r?B=t[47]:(B=()=>r.redo(),t[46]=r,t[47]=B);let V;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,X.jsx)(lte,{className:`size-4`}),t[48]=V):V=t[48];let H;t[49]!==z||t[50]!==B?(H=(0,X.jsx)(Jv,{className:`border hover:bg-secondary disabled:opacity-100 dark:hover:bg-secondary disabled:[&>svg]:text-muted-foreground`,disabled:z,onClick:B,size:`icon`,title:`Redo`,variant:`secondary`,children:V}),t[49]=z,t[50]=B,t[51]=H):H=t[51];let U;t[52]!==R||t[53]!==H?(U=(0,X.jsxs)(I7,{className:`flex`,orientation:`horizontal`,children:[R,H]}),t[52]=R,t[53]=H,t[54]=U):U=t[54];let W;t[55]!==i.handleSave||t[56]!==r?(W=(0,X.jsx)(b_e,{handleSave:i.handleSave,state:r}),t[55]=i.handleSave,t[56]=r,t[57]=W):W=t[57];let G;t[58]!==i.handlePublish||t[59]!==i.isPublishing||t[60]!==x?(G=(0,X.jsx)(y_e,{disabled:x,handlePublish:i.handlePublish,isPublishing:i.isPublishing}),t[58]=i.handlePublish,t[59]=i.isPublishing,t[60]=x,t[61]=G):G=t[61];let K;t[62]!==W||t[63]!==G?(K=(0,X.jsxs)(I7,{className:`flex`,orientation:`horizontal`,children:[W,G]}),t[62]=W,t[63]=G,t[64]=K):K=t[64];let q;t[65]!==i||t[66]!==r?(q=(0,X.jsx)(S_e,{actions:i,state:r}),t[65]=i,t[66]=r,t[67]=q):q=t[67];let J;t[68]!==i||t[69]!==r.isGenerating||t[70]!==r.isSaving||t[71]!==r.workflowMode||t[72]!==n?(J=n&&(0,X.jsx)(I7,{"aria-label":`Workflow mode`,className:`flex`,orientation:`horizontal`,role:`radiogroup`,children:[`live`,`test`].map(e=>{let t=r.workflowMode===e;return(0,X.jsx)(Jv,{"aria-checked":t,className:`border`,disabled:r.isSaving||r.isGenerating,onClick:()=>i.handleSetWorkflowMode(e),role:`radio`,size:`default`,variant:t?`default`:`outline`,children:e===`live`?`Live`:`Test`},e)})}),t[68]=i,t[69]=r.isGenerating,t[70]=r.isSaving,t[71]=r.workflowMode,t[72]=n,t[73]=J):J=t[73];let ee;return t[74]!==P||t[75]!==U||t[76]!==K||t[77]!==q||t[78]!==J||t[79]!==D?(ee=(0,X.jsxs)(X.Fragment,{children:[D,P,U,K,q,J]}),t[74]=P,t[75]=U,t[76]=K,t[77]=q,t[78]=J,t[79]=D,t[80]=ee):ee=t[80],ee}function T_e(e){return e.type!==`add`}function E_e(e){let t=(0,Z.c)(54),{workflowId:n,state:r,actions:i}=e,a=Gi(),[o,s]=(0,Y.useState)(!1),[c,l]=(0,Y.useState)(0),u;t[0]===i?u=t[1]:(u=e=>e&&i.loadWorkflows(),t[0]=i,t[1]=u);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsx)(g_e,{className:`size-4 shrink-0`}),t[2]=d):d=t[2];let f;t[3]!==r.workflowName||t[4]!==n?(f=n?r.workflowName:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`sm:hidden`,children:`Dashboard`}),(0,X.jsx)(`span`,{className:`hidden sm:inline`,children:`Workflow Dashboard`})]}),t[3]=r.workflowName,t[4]=n,t[5]=f):f=t[5];let p;t[6]===f?p=t[7]:(p=(0,X.jsx)(`p`,{className:`truncate font-medium text-sm`,children:f}),t[6]=f,t[7]=p);let m;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,X.jsx)(ay,{className:`size-3 shrink-0 opacity-50`}),t[8]=m):m=t[8];let h;t[9]===p?h=t[10]:(h=(0,X.jsxs)(Q5,{className:`flex h-full cursor-pointer items-center gap-2 px-3 font-medium text-sm transition-all hover:bg-secondary dark:hover:bg-secondary`,children:[d,p,m]}),t[9]=p,t[10]=h);let g;t[11]===a?g=t[12]:(g=()=>a({to:`/`}),t[11]=a,t[12]=g);let _;t[13]===n?_=t[14]:(_=!n&&(0,X.jsx)(iy,{className:`size-4 shrink-0`}),t[13]=n,t[14]=_);let v;t[15]!==g||t[16]!==_?(v=(0,X.jsxs)(e7,{className:`flex items-center justify-between`,onClick:g,children:[`Dashboard `,_]}),t[15]=g,t[16]=_,t[17]=v):v=t[17];let y,b;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,X.jsxs)(e7,{className:`flex items-center gap-2`,onClick:()=>{l(k_e),s(!0)},children:[(0,X.jsx)(yy,{className:`size-4`}),`New Workflow...`]}),b=(0,X.jsx)(n7,{}),t[18]=y,t[19]=b):(y=t[18],b=t[19]);let x;t[20]!==a||t[21]!==r.allWorkflows||t[22]!==r.currentWorkflowId?(x=r.allWorkflows.length===0?(0,X.jsx)(e7,{disabled:!0,children:`No workflows found`}):r.allWorkflows.filter(O_e).map(e=>(0,X.jsxs)(e7,{className:`flex items-center justify-between`,onClick:()=>a({to:`/workflows/$workflowId`,params:{workflowId:e.id}}),children:[(0,X.jsx)(`span`,{className:`truncate`,children:e.name}),e.id===r.currentWorkflowId&&(0,X.jsx)(iy,{className:`size-4 shrink-0`})]},e.id)),t[20]=a,t[21]=r.allWorkflows,t[22]=r.currentWorkflowId,t[23]=x):x=t[23];let S;t[24]!==i||t[25]!==r.isOwner||t[26]!==n?(S=n&&r.isOwner&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(n7,{}),(0,X.jsxs)(e7,{className:`flex items-center gap-2`,disabled:i.isDuplicating,onClick:i.handleDuplicate,children:[i.isDuplicating?(0,X.jsx)(gy,{className:`size-4 animate-spin`}):(0,X.jsx)(uy,{className:`size-4`}),`Duplicate`]}),(0,X.jsxs)(e7,{className:`flex items-center gap-2 text-destructive focus:text-destructive`,onClick:i.handleDeleteWorkflow,children:[(0,X.jsx)(Cy,{className:`size-4`}),`Delete Workflow`]})]}),t[24]=i,t[25]=r.isOwner,t[26]=n,t[27]=S):S=t[27];let C;t[28]!==x||t[29]!==S||t[30]!==v?(C=(0,X.jsxs)($5,{align:`start`,className:`w-64`,children:[v,y,b,x,S]}),t[28]=x,t[29]=S,t[30]=v,t[31]=C):C=t[31];let w;t[32]!==u||t[33]!==C||t[34]!==h?(w=(0,X.jsx)(`div`,{className:`flex h-9 max-w-[160px] items-center overflow-hidden rounded-md border bg-secondary text-secondary-foreground sm:max-w-none`,children:(0,X.jsxs)(Z5,{onOpenChange:u,children:[h,C]})}),t[32]=u,t[33]=C,t[34]=h,t[35]=w):w=t[35];let T;t[36]!==r.isOwner||t[37]!==n?(T=n&&!r.isOwner&&(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs @xl:hidden`,children:`Read-only`}),t[36]=r.isOwner,t[37]=n,t[38]=T):T=t[38];let E;t[39]!==w||t[40]!==T?(E=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[w,T]}),t[39]=w,t[40]=T,t[41]=E):E=t[41];let D;t[42]===r.allWorkflows?D=t[43]:(D=r.allWorkflows.map(D_e),t[42]=r.allWorkflows,t[43]=D);let O;t[44]===a?O=t[45]:(O=e=>a({to:`/workflows/$workflowId`,params:{workflowId:e}}),t[44]=a,t[45]=O);let k;t[46]!==c||t[47]!==o||t[48]!==D||t[49]!==O?(k=(0,X.jsx)(R7,{existingWorkflowNames:D,onCreated:O,onOpenChange:s,open:o},c),t[46]=c,t[47]=o,t[48]=D,t[49]=O,t[50]=k):k=t[50];let A;return t[51]!==E||t[52]!==k?(A=(0,X.jsxs)(X.Fragment,{children:[E,k]}),t[51]=E,t[52]=k,t[53]=A):A=t[53],A}function D_e(e){return e.name}function O_e(e){return e.name!==`__current__`}function k_e(e){return e+1}function A_e(e,t){if(!t)return;let n=t.trim();if(!n)return;let r=Ka(n.split(`.`)),i=e;for(let e of r){if(i==null)return;if(Array.isArray(i)){if(!/^\d+$/.test(e))return;let t=Number(e);if(!Number.isSafeInteger(t))return;i=i[t];continue}if(typeof i==`object`){i=i[e];continue}return}return i}function j_e(e,t,n){let r=Ka(t.trim().split(`.`)),i=r.pop();if(!i)return e;let a=e;for(let e of r){let t=a[e],n=typeof t==`object`&&t&&!Array.isArray(t)?t:{};a[e]=n,a=n}return a[i]=n,e}function M_e(e){return!e.path.includes(`[`)&&e.type!==`array`&&e.type!==`object`}function N_e(e){return e.enumValues&&e.enumValues.length>0?`select`:e.type===`boolean`?`checkbox`:e.type===`number`?`number`:e.type===`timestamp`?`datetime`:`text`}function B7(e){return e?e.payloadFields.filter(M_e).map(e=>({path:e.path,...e.description?{description:e.description}:{},control:N_e(e),...e.enumValues?{options:[...e.enumValues]}:{},optional:e.nullable===!0})):[]}function P_e(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=t.getTimezoneOffset()*6e4;return new Date(t.getTime()-n).toISOString().slice(0,16)}function V7(e,t){let n={};for(let r of e){let e=A_e(t,r.path);if(e==null){n[r.path]=``;continue}let i=typeof e==`string`?e:JSON.stringify(e);n[r.path]=r.control===`datetime`?P_e(i):i}return n}function F_e(e,t){let n=t.trim();if(n){if(e.control===`checkbox`)return n===`true`;if(e.control===`number`){let e=Number(n);return Number.isFinite(e)?e:n}if(e.control===`datetime`){let e=new Date(n);return Number.isNaN(e.getTime())?n:_de(e)}return n}}function I_e(e,t,n={}){let r=structuredClone(n);for(let n of e){let e=F_e(n,t[n.path]??``);e!==void 0&&j_e(r,n.path,e)}return r}function H7(e){let t=e.trim();if(!t)return{ok:!0,payload:{}};let n;try{n=JSON.parse(t)}catch{return{ok:!1,error:`This is not valid JSON.`}}let r=Dce(n);return r?{ok:!0,payload:r}:{ok:!1,error:`A payload has to be a JSON object.`}}function U7(e){return e.find(e=>e.data.type===`lifecycle`)}function L_e(e){return Q0(U7(e)?.data.config)}function W7(e){return kce(U7(e)?.data.config)??{}}function R_e(e,t){return t.eventName?{...e,byEvent:{...e.byEvent,[t.eventName]:t.input}}:{...e,manual:t.input}}var G7=``;function z_e(e,t){return Uy(e,t)?.label??t}function B_e(e){let t=(0,Z.c)(29),{field:n,value:r,onChange:i}=e;if(n.control===`checkbox`){let e=r===`true`,a;t[0]===i?a=t[1]:(a=e=>i(e?`true`:`false`),t[0]=i,t[1]=a);let o;return t[2]!==n.path||t[3]!==e||t[4]!==a?(o=(0,X.jsx)(l7,{checked:e,id:n.path,onCheckedChange:a}),t[2]=n.path,t[3]=e,t[4]=a,t[5]=o):o=t[5],o}if(n.control===`select`){let e;t[6]===i?e=t[7]:(e=C6(i),t[6]=i,t[7]=e);let a;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(T6,{placeholder:`Choose a value`}),t[8]=a):a=t[8];let o;t[9]===n.path?o=t[10]:(o=(0,X.jsx)(E6,{className:`w-full`,id:n.path,children:a}),t[9]=n.path,t[10]=o);let s;t[11]===n.options?s=t[12]:(s=n.options??[],t[11]=n.options,t[12]=s);let c;t[13]===s?c=t[14]:(c=s.map(V_e),t[13]=s,t[14]=c);let l;t[15]===c?l=t[16]:(l=(0,X.jsx)(D6,{children:c}),t[15]=c,t[16]=l);let u;return t[17]!==e||t[18]!==o||t[19]!==l||t[20]!==r?(u=(0,X.jsxs)(S6,{onValueChange:e,value:r,children:[o,l]}),t[17]=e,t[18]=o,t[19]=l,t[20]=r,t[21]=u):u=t[21],u}let a;t[22]===i?a=t[23]:(a=e=>i(e.target.value),t[22]=i,t[23]=a);let o=n.control===`number`?`number`:n.control===`datetime`?`datetime-local`:`text`,s;return t[24]!==n.path||t[25]!==a||t[26]!==o||t[27]!==r?(s=(0,X.jsx)(JZ,{id:n.path,onChange:a,type:o,value:r}),t[24]=n.path,t[25]=a,t[26]=o,t[27]=r,t[28]=s):s=t[28],s}function V_e(e){return(0,X.jsx)(k6,{value:e,children:e},e)}function H_e(e){let t=(0,Z.c)(10),{fields:n,values:r,onChange:i}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`This Event declares no payload field the form can draw. Use the JSON tab to write the payload.`}),t[0]=e):e=t[0],e}let a;if(t[1]!==n||t[2]!==i||t[3]!==r){let e;t[5]!==i||t[6]!==r?(e=e=>(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsxs)(YZ,{className:`font-mono text-xs`,htmlFor:e.path,children:[e.path,e.optional&&(0,X.jsx)(`span`,{className:`ml-2 font-sans text-muted-foreground`,children:`optional`})]}),(0,X.jsx)(B_e,{field:e,onChange:t=>i(e.path,t),value:r[e.path]??``}),e.description&&(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:e.description})]},e.path),t[5]=i,t[6]=r,t[7]=e):e=t[7],a=n.map(e),t[1]=n,t[2]=i,t[3]=r,t[4]=a}else a=t[4];let o;return t[8]===a?o=t[9]:(o=(0,X.jsx)(`div`,{className:`space-y-4`,children:a}),t[8]=a,t[9]=o),o}function U_e(e){let t=(0,Z.c)(92),{overlayId:n,startEvents:r,allowManualStart:i,hasEventSplit:a,savedPayloads:o,onRun:s}=e,c=ky(),{closeAll:l}=cZ(),[u,d]=(0,Y.useState)(r[0]??G7),[f,p]=(0,Y.useState)(`form`),m=u===G7?void 0:u,h;t[0]!==m||t[1]!==o?(h=c2(o,m),t[0]=m,t[1]=o,t[2]=h):h=t[2];let g=h,_;t[3]!==c||t[4]!==m?(_=B7(m?Uy(c,m):void 0),t[3]=c,t[4]=m,t[5]=_):_=t[5];let v=_,y;t[6]!==v||t[7]!==g?(y=()=>V7(v,g),t[6]=v,t[7]=g,t[8]=y):y=t[8];let[b,x]=(0,Y.useState)(y),S;t[9]===g?S=t[10]:(S=()=>JSON.stringify(g??{},null,2),t[9]=g,t[10]=S);let[C,w]=(0,Y.useState)(S),[T,E]=(0,Y.useState)(null),D;t[11]===g?D=t[12]:(D=()=>g??{},t[11]=g,t[12]=D);let[O,k]=(0,Y.useState)(D),A;t[13]!==c||t[14]!==o?(A=e=>{d(e);let t=e===G7?void 0:e,n=c2(o,t)??{},r=B7(t?Uy(c,t):void 0);x(V7(r,n)),w(JSON.stringify(n,null,2)),k(n),E(null)},t[13]=c,t[14]=o,t[15]=A):A=t[15];let j=A,M;t[16]!==O||t[17]!==v||t[18]!==b?(M=()=>I_e(v,b,O),t[16]=O,t[17]=v,t[18]=b,t[19]=M):M=t[19];let N=M,P;t[20]===N?P=t[21]:(P=()=>{w(JSON.stringify(N(),null,2)),E(null),p(`json`)},t[20]=N,t[21]=P);let F=P,I;t[22]!==v||t[23]!==C?(I=()=>{let e=H7(C);if(!e.ok){E(e.error);return}x(V7(v,e.payload)),k(e.payload),E(null),p(`form`)},t[22]=v,t[23]=C,t[24]=I):I=t[24];let L=I,R=!a||m!==void 0,z;t[25]!==l||t[26]!==N||t[27]!==m||t[28]!==C||t[29]!==s||t[30]!==f?(z=()=>{if(f===`json`){let e=H7(C);if(!e.ok){E(e.error);return}s({...m?{eventName:m}:{},input:e.payload}),l();return}s({...m?{eventName:m}:{},input:N()}),l()},t[25]=l,t[26]=N,t[27]=m,t[28]=C,t[29]=s,t[30]=f,t[31]=z):z=t[31];let B=z,V;t[32]===l?V=t[33]:(V={label:`Cancel`,variant:`outline`,onClick:l},t[32]=l,t[33]=V);let H=!R,U;t[34]!==B||t[35]!==H?(U={label:`Run`,onClick:B,disabled:H},t[34]=B,t[35]=H,t[36]=U):U=t[36];let W;t[37]!==V||t[38]!==U?(W=[V,U],t[37]=V,t[38]=U,t[39]=W):W=t[39];let G;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,X.jsx)(YZ,{htmlFor:`testRunEvent`,children:`Which Event does this run stand in for?`}),t[40]=G):G=t[40];let K;t[41]===j?K=t[42]:(K=C6(j),t[41]=j,t[42]=K);let q;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,X.jsx)(E6,{className:`w-full`,id:`testRunEvent`,children:(0,X.jsx)(T6,{placeholder:`Choose an Event`})}),t[43]=q):q=t[43];let J;if(t[44]!==c||t[45]!==r){let e;t[47]===c?e=t[48]:(e=e=>(0,X.jsx)(k6,{value:e,children:z_e(c,e)},e),t[47]=c,t[48]=e),J=r.map(e),t[44]=c,t[45]=r,t[46]=J}else J=t[46];let ee;t[49]!==i||t[50]!==a?(ee=i&&(0,X.jsx)(k6,{disabled:a,value:G7,children:`No Event (manual start)`}),t[49]=i,t[50]=a,t[51]=ee):ee=t[51];let te;t[52]!==J||t[53]!==ee?(te=(0,X.jsxs)(D6,{children:[J,ee]}),t[52]=J,t[53]=ee,t[54]=te):te=t[54];let ne;t[55]!==u||t[56]!==K||t[57]!==te?(ne=(0,X.jsxs)(S6,{onValueChange:K,value:u,children:[q,te]}),t[55]=u,t[56]=K,t[57]=te,t[58]=ne):ne=t[58];let re;t[59]===a?re=t[60]:(re=a&&(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`This workflow splits on the Event a run is on, so a run has to name one.`}),t[59]=a,t[60]=re);let ie;t[61]!==ne||t[62]!==re?(ie=(0,X.jsxs)(`div`,{className:`space-y-2`,children:[G,ne,re]}),t[61]=ne,t[62]=re,t[63]=ie):ie=t[63];let ae;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,X.jsx)(`span`,{className:`font-medium text-sm`,children:`Payload`}),t[64]=ae):ae=t[64];let oe=f===`form`?`secondary`:`ghost`,se;t[65]!==L||t[66]!==oe?(se=(0,X.jsx)(Jv,{onClick:L,size:`sm`,variant:oe,children:`Form`}),t[65]=L,t[66]=oe,t[67]=se):se=t[67];let ce=f===`json`?`secondary`:`ghost`,le;t[68]!==F||t[69]!==ce?(le=(0,X.jsx)(Jv,{onClick:F,size:`sm`,variant:ce,children:`JSON`}),t[68]=F,t[69]=ce,t[70]=le):le=t[70];let ue;t[71]!==se||t[72]!==le?(ue=(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[ae,(0,X.jsxs)(`div`,{className:`flex gap-1`,children:[se,le]})]}),t[71]=se,t[72]=le,t[73]=ue):ue=t[73];let de;t[74]!==v||t[75]!==C||t[76]!==f||t[77]!==b?(de=f===`form`?(0,X.jsx)(H_e,{fields:v,onChange:(e,t)=>x(n=>({...n,[e]:t})),values:b}):(0,X.jsx)(`textarea`,{"aria-label":`Payload JSON`,className:`min-h-64 w-full rounded-md border border-input bg-transparent p-3 font-mono text-xs shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,onChange:e=>{w(e.target.value),E(null)},spellCheck:!1,value:C}),t[74]=v,t[75]=C,t[76]=f,t[77]=b,t[78]=de):de=t[78];let fe;t[79]===T?fe=t[80]:(fe=T&&(0,X.jsx)(`p`,{className:`text-destructive text-xs`,children:T}),t[79]=T,t[80]=fe);let pe;t[81]!==ue||t[82]!==de||t[83]!==fe?(pe=(0,X.jsxs)(`div`,{className:`space-y-3`,children:[ue,de,fe]}),t[81]=ue,t[82]=de,t[83]=fe,t[84]=pe):pe=t[84];let me;t[85]!==ie||t[86]!==pe?(me=(0,X.jsxs)(`div`,{className:`space-y-6`,children:[ie,pe]}),t[85]=ie,t[86]=pe,t[87]=me):me=t[87];let he;return t[88]!==n||t[89]!==W||t[90]!==me?(he=(0,X.jsx)(KZ,{actions:W,description:`A test run carries the payload an Event would have sent, so every template downstream resolves the way it will in production.`,overlayId:n,title:`Test run`,children:me}),t[88]=n,t[89]=W,t[90]=me,t[91]=he):he=t[91],he}function W_e(e){let t=(0,Z.c)(38),{overlayId:n,issues:r,onGoToStep:i,onRunAnyway:a,allowRunAnyway:o}=e,s=o!==void 0&&o,{push:c,closeAll:l}=cZ(),u=tZ(),d=s3(),{brokenReferences:f,missingRequiredFields:p,missingIntegrations:m}=r,h=f.length+p.length+m.length,g;t[0]!==l||t[1]!==u||t[2]!==i||t[3]!==c?(g=(e,t)=>{i(e,t),u?c(P7,{}):l()},t[0]=l,t[1]=u,t[2]=i,t[3]=c,t[4]=g):g=t[4];let _=g,v;t[5]!==c||t[6]!==d?(v=e=>{c(i3,{type:e,onSuccess:()=>void d()})},t[5]=c,t[6]=d,t[7]=v):v=t[7];let y=v,b;t[8]!==l||t[9]!==a?(b=()=>{a&&(l(),a())},t[8]=l,t[9]=a,t[10]=b):b=t[10];let x=b,S=p.length+m.length,C;t[11]!==s||t[12]!==l||t[13]!==x||t[14]!==a?(C=s&&a?[{label:`Run Anyway`,variant:`outline`,onClick:x},{label:`Cancel`,onClick:l}]:[{label:`Close`,onClick:l}],t[11]=s,t[12]=l,t[13]=x,t[14]=a,t[15]=C):C=t[15];let w=`Workflow Issues (${h})`,T;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-warning`,children:[(0,X.jsx)(wy,{className:`size-5`}),(0,X.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`This workflow has issues that may cause it to fail.`})]}),t[16]=T):T=t[16];let E;t[17]===S?E=t[18]:(E=S>0&&(0,X.jsx)(`p`,{className:`mt-2 text-destructive text-sm`,children:`Resolve blocking issues before running this workflow.`}),t[17]=S,t[18]=E);let D;t[19]!==y||t[20]!==m?(D=m.length>0&&(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(`h4`,{className:`font-medium text-muted-foreground text-sm`,children:`Missing Connections`}),m.map(e=>(0,X.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,X.jsx)(t3,{className:`size-4 shrink-0`,integration:e.integrationType}),(0,X.jsxs)(`p`,{className:`min-w-0 flex-1 text-sm`,children:[(0,X.jsx)(`span`,{className:`font-medium`,children:e.integrationLabel}),(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[` — `,e.nodeNames.length>3?`${e.nodeNames.slice(0,3).join(`, `)} +${e.nodeNames.length-3} more`:e.nodeNames.join(`, `)]})]}),(0,X.jsx)(Jv,{className:`shrink-0`,onClick:()=>y(e.integrationType),size:`sm`,variant:`outline`,children:`Add`})]},e.integrationType))]}),t[19]=y,t[20]=m,t[21]=D):D=t[21];let O;t[22]!==f||t[23]!==_?(O=f.length>0&&(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`h4`,{className:`font-medium text-muted-foreground text-sm`,children:`Broken References`}),f.map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`font-medium text-sm`,children:e.nodeLabel}),(0,X.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:e.brokenReferences.map(t=>(0,X.jsxs)(`div`,{className:`flex items-center gap-3 py-0.5 pl-3`,children:[(0,X.jsxs)(`p`,{className:`min-w-0 flex-1 text-muted-foreground text-sm`,children:[(0,X.jsx)(`span`,{className:`font-mono`,children:t.displayText}),` in `,t.fieldLabel]}),(0,X.jsx)(Jv,{className:`shrink-0`,onClick:()=>_(e.nodeId,t.fieldKey),size:`sm`,variant:`outline`,children:`Fix`})]},`${e.nodeId}-${t.fieldKey}-${t.displayText}-${t.fieldLabel}`))})]},e.nodeId))]}),t[22]=f,t[23]=_,t[24]=O):O=t[24];let k;t[25]!==_||t[26]!==p?(k=p.length>0&&(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`h4`,{className:`font-medium text-muted-foreground text-sm`,children:`Missing Required Fields`}),p.map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`p`,{className:`font-medium text-sm`,children:e.nodeLabel}),(0,X.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:e.missingFields.map(t=>(0,X.jsxs)(`div`,{className:`flex items-center gap-3 py-0.5 pl-3`,children:[(0,X.jsx)(`p`,{className:`min-w-0 flex-1 text-muted-foreground text-sm`,children:t.fieldLabel}),(0,X.jsx)(Jv,{className:`shrink-0`,onClick:()=>_(e.nodeId,t.fieldKey),size:`sm`,variant:`outline`,children:`Fix`})]},`${e.nodeId}-${t.fieldKey}`))})]},e.nodeId))]}),t[25]=_,t[26]=p,t[27]=k):k=t[27];let A;t[28]!==O||t[29]!==k||t[30]!==D?(A=(0,X.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[D,O,k]}),t[28]=O,t[29]=k,t[30]=D,t[31]=A):A=t[31];let j;return t[32]!==n||t[33]!==A||t[34]!==C||t[35]!==w||t[36]!==E?(j=(0,X.jsxs)(KZ,{actions:C,overlayId:n,title:w,children:[T,E,A]}),t[32]=n,t[33]=A,t[34]=C,t[35]=w,t[36]=E,t[37]=j):j=t[37],j}var G_e=Vy(`workflow`,`run`),K7={workflow_paused:`Workflow is paused and cannot start new runs.`,concurrency_first_wins:`A run for this entity is already going, and this workflow keeps the first one.`,entity_value_missing:`This payload carries nothing at the workflow's Correlation Path, and its Concurrency needs an entity to compare.`,manual_start_not_allowed:`This workflow does not list manual runs as a start source.`,start_event_required:`This workflow splits on the Event a run is on, so a run has to name one.`};function q7(e,t,n){t(e.map(e=>({nodeId:e.id,status:n})))}function K_e(e){let t=U7(e.nodes);t&&e.updateNodeData({id:t.id,data:{config:{...t.data.config,testPayloads:R_e(W7(e.nodes),e.request)}}})}async function q_e({runWorkflow:e,nodes:t,setNodeStatuses:n,setIsExecuting:r,navigateToExecution:i}){q7(t,n,`idle`),n(t.filter(e=>e.data.type===`lifecycle`).map(e=>({nodeId:e.id,status:`running`})));try{let a=await e();if(a.status!==`running`||!a.executionId){Fy.message(a.status===`ignored`?K7[a.reason]:`Execution completed without starting a new run.`),r(!1),q7(t,n,`idle`);return}if(typeof a.supersededExecutions==`number`&&a.supersededExecutions>0){let e=Array.isArray(a.failedToSupersede)?a.failedToSupersede.length:0,t=`Superseded ${a.supersededExecutions} run${a.supersededExecutions===1?``:`s`} for this entity and started a new one.`;e>0?Fy.error(`${t} ${e} could not be signalled and may still be running. Cancel them from the Runs panel.`):Fy.success(t)}await i(a.executionId)}catch(e){G_e.error(`Failed to execute the workflow`,{error:e}),q7(t,n,`error`),r(!1)}}var J_e=/^([01]\d|2[0-3]):([0-5]\d)$/;function J7(e){return typeof e==`string`&&e.trim()===`daily_window`?`daily_window`:`off`}function Y7(e){if(typeof e!=`string`)return null;let t=e.trim(),n=J_e.exec(t);if(!n)return null;let[,r,i]=n;return r&&i?Number.parseInt(r,10)*60+Number.parseInt(i,10):null}function Y_e(e){let t=[],n=typeof e.mode==`string`?e.mode.trim():J7(e.mode);if(n.length>0&&n!==`off`&&n!==`daily_window`)return t.push({field:`mode`,message:`Allowed-hours mode must be either "off" or "daily_window".`}),t;if(n!==`daily_window`)return t;let r=Y7(e.startTime);r===null&&t.push({field:`start`,message:`Allowed-hours start must use HH:MM (24-hour) format.`});let i=Y7(e.endTime);return i===null&&t.push({field:`end`,message:`Allowed-hours end must use HH:MM (24-hour) format.`}),r!==null&&i!==null&&r>=i&&t.push({field:`window`,message:`Allowed-hours start must be earlier than end (same-day window only).`}),t}function X_e(e){return e.type===`group`&&`fields`in e&&Array.isArray(e.fields)}function X7(e){return e==null||typeof e==`string`&&e.trim().length===0}function Z_e(e){let t=[];for(let n of e){if(X_e(n)){t.push(...n.fields);continue}t.push(n)}return t}function Q_e(e){let{config:t,configFields:n}=e;return Z_e(n).filter(e=>e.required===!0&&b4(t,e.showWhen)&&X7(t[e.key])).map(e=>({fieldKey:e.key,fieldLabel:e.label}))}function $_e(e){return $$(e.waitMode)===`event`?`event`:`delay`}function eve(e){if($_e(e)===`event`){let t=[];q8(e).length===0&&t.push({fieldKey:`waitFor`,fieldLabel:`Wait for these events`});for(let n of q8(e)){let e=$$(n.match);if(!e)continue;let r=Bde(e);!r.valid&&r.incomplete&&t.push({fieldKey:`waitFor`,fieldLabel:`Match value for "${n.event}"`})}return X7(e.waitTimeout)&&t.push({fieldKey:`waitTimeout`,fieldLabel:`Stop waiting after`}),t}let t=[];if(G8(e)===`until`?X7(e.waitUntil)&&t.push({fieldKey:`waitUntil`,fieldLabel:`Wait until this date/time`}):X7(e.waitDuration)&&t.push({fieldKey:`waitDuration`,fieldLabel:`Wait for (duration)`}),$$(e.waitAllowedHoursMode)===`daily_window`){let n=$$(e.waitAllowedStartTime);(!n||Y7(n)===null)&&t.push({fieldKey:`waitAllowedStartTime`,fieldLabel:`Window start (HH:MM)`});let r=$$(e.waitAllowedEndTime);(!r||Y7(r)===null)&&t.push({fieldKey:`waitAllowedEndTime`,fieldLabel:`Window end (HH:MM)`}),X7(e.waitTimezone)&&t.push({fieldKey:`waitTimezone`,fieldLabel:`Timezone`})}return t}function tve(e){let{actionType:t,config:n}=e;switch(t){case Y0.condition:return X7(n.condition)?[{fieldKey:`condition`,fieldLabel:`Condition`}]:[];case Y0.wait:return eve(n);default:return[]}}function Z7(e){let{node:t,actionType:n,actionLabel:r}=e;return $$(t.data.label)||r||n||t.id}function nve(e){let{node:t,resolveActionByType:n}=e;if(t.data.type!==`action`||t.data.enabled===!1)return null;let r=t.data.config??{},i=$$(r.actionType);if(!i)return{nodeId:t.id,nodeLabel:Z7({node:t}),missingFields:[{fieldKey:`actionType`,fieldLabel:`Action`}]};let a=n(i),o=tve({actionType:i,config:r}),s=a?Q_e({config:r,configFields:a.configFields??[]}):[],c=[...o,...s];return c.length===0?null:{nodeId:t.id,nodeLabel:Z7({node:t,actionType:i,actionLabel:a?.label}),missingFields:c}}function rve(e){let{nodes:t,resolveActionByType:n}=e;return t.map(e=>nve({node:e,resolveActionByType:n})).filter(e=>e!==null)}function ive(e){return t=>Wy(e,t)}function Q7(e){return $$(e.node.data.label)||(e.actionLabel?e.actionLabel:e.actionType?e.actionType:e.node.id)}function ave(e){return rve({nodes:e.nodes,resolveActionByType:ive(e.catalog)}).flatMap(e=>e.missingFields.map(t=>({kind:`missing_required_field`,severity:`blocking`,nodeId:e.nodeId,nodeLabel:e.nodeLabel,fieldKey:t.fieldKey,fieldLabel:t.fieldLabel,message:`Node "${e.nodeLabel}" is missing required field "${t.fieldLabel}"`})))}function ove(e){let t=new Set(e.integrations.map(e=>e.id)),n=[];for(let r of e.nodes){if(r.data.type!==`action`||r.data.enabled===!1)continue;let i=L2(r.data.config,`actionType`);if(!i)continue;let a=Wy(e.catalog,i),o=a?.integration;if(!o)continue;let s=L2(r.data.config,`integrationId`);if(s&&t.has(s))continue;let c=Gy(e.catalog,o)?.label??o,l=Q7({node:r,actionLabel:a?.label,actionType:i});n.push({kind:`missing_integration`,severity:`blocking`,nodeId:r.id,nodeLabel:l,integrationType:o,integrationLabel:c,message:`Node "${l}" needs a ${c} connection`})}return n}function sve(e){return typeof e==`string`?S4(e).map(e=>({nodeId:e.nodeId,displayText:e.fieldPath?`${e.nodeLabel}.${e.fieldPath}`:e.nodeLabel})):[]}function $7(e,t=``){let n=[];for(let[r,i]of Object.entries(e)){let e=t?`${t}.${r}`:r;if(typeof i==`string`){for(let t of sve(i))n.push({field:e,...t});continue}if(typeof i==`object`&&i&&!Array.isArray(i)){let t={...i};n.push(...$7(t,e))}}return n}function cve(e){let t=new Set(e.nodes.map(e=>e.id)),n=[];for(let r of e.nodes){if(r.data.enabled===!1)continue;let i=r.data.config;if(!i||typeof i!=`object`)continue;let a=$7(i).filter(e=>!t.has(e.nodeId));if(a.length===0)continue;let o=L2(i,`actionType`),s=o?Wy(e.catalog,o):void 0,c=s?Kfe(s.configFields):[],l=Q7({node:r,actionLabel:s?.label,actionType:o});for(let e of a){let t=c.find(t=>t.key===e.field)?.label??e.field;n.push({kind:`broken_reference`,severity:`warning`,nodeId:r.id,nodeLabel:l,fieldKey:e.field,fieldLabel:t,referencedNodeId:e.nodeId,displayText:e.displayText,message:`Node "${l}" references missing step in ${t}`})}}return n}function lve(e){return[...ave(e),...ove(e),...cve(e)]}function uve(e){return e.some(e=>e.severity===`blocking`)}function dve(e){let t=new Map,n=new Map,r=new Map;for(let i of e)switch(i.kind){case`missing_required_field`:{let e=t.get(i.nodeId);if(e){e.missingFields.push({fieldKey:i.fieldKey,fieldLabel:i.fieldLabel});break}t.set(i.nodeId,{nodeId:i.nodeId,nodeLabel:i.nodeLabel,missingFields:[{fieldKey:i.fieldKey,fieldLabel:i.fieldLabel}]});break}case`broken_reference`:{let e=n.get(i.nodeId);if(e){e.brokenReferences.push({fieldKey:i.fieldKey,fieldLabel:i.fieldLabel,referencedNodeId:i.referencedNodeId,displayText:i.displayText});break}n.set(i.nodeId,{nodeId:i.nodeId,nodeLabel:i.nodeLabel,brokenReferences:[{fieldKey:i.fieldKey,fieldLabel:i.fieldLabel,referencedNodeId:i.referencedNodeId,displayText:i.displayText}]});break}case`missing_integration`:{let e=r.get(i.integrationType);if(e){e.nodeNames.includes(i.nodeLabel)||e.nodeNames.push(i.nodeLabel);break}r.set(i.integrationType,{integrationType:i.integrationType,integrationLabel:i.integrationLabel,nodeNames:[i.nodeLabel]});break}default:throw Error(`Unhandled workflow issue`)}return{missingRequiredFields:Array.from(t.values()),missingIntegrations:Array.from(r.values()),brokenReferences:Array.from(n.values())}}function fve(e){let t=(0,Z.c)(43),{currentWorkflowId:n,workflowName:r,nodes:i,edges:a,updateNodeData:o,isExecuting:s,setIsExecuting:c,setCurrentWorkflowName:l,setWorkflowNameError:u,setIsTransitioningFromHomepage:d,setActiveTab:f,setSelectedNodeId:p,userIntegrations:m}=e,h=ky(),{open:g}=cZ(),_=Gi(),v=Fe(),y=vj(Lle),b=vj(A4),x=vj(e3),S=vj(n4),C=vj(mle),w;t[0]===v?w=t[1]:(w=O2.workflow.execute.mutationOptions({onSuccess:()=>M2(v)}),t[0]=v,t[1]=w);let T=Ze(w),E;t[2]!==C||t[3]!==n||t[4]!==a||t[5]!==_||t[6]!==i||t[7]!==S||t[8]!==l||t[9]!==d||t[10]!==u||t[11]!==r?(E=async()=>{if(!i.some(pve)){u(`Add at least one step before saving.`);return}let e=r.trim();if(!e){u(`Workflow name is required.`);return}if(n){let t=await S({name:e,nodes:i,edges:a},{immediate:!0});if(t&&!t.ok){u(t.error.message||`Failed to save workflow. Please try again.`);return}l(e),u(null);return}let t=await C({name:e,nodes:i,edges:a});if(!t.ok){u(t.error.message||`Failed to save workflow. Please try again.`);return}d(!0),await _({to:`/workflows/$workflowId`,params:{workflowId:t.workflow.id},replace:!0})},t[2]=C,t[3]=n,t[4]=a,t[5]=_,t[6]=i,t[7]=S,t[8]=l,t[9]=d,t[10]=u,t[11]=r,t[12]=E):E=t[12];let D=E,O;t[13]!==y||t[14]!==n||t[15]!==_||t[16]!==i||t[17]!==T||t[18]!==f||t[19]!==b||t[20]!==c||t[21]!==x||t[22]!==p||t[23]!==o?(O=async e=>{if(!n){Fy.error(`Please save the workflow before executing`);return}K_e({nodes:i,updateNodeData:o,request:e}),f(`runs`),b(null),y(),p(null),c(!0),await q_e({runWorkflow:()=>T.mutateAsync({workflowId:n,input:e.input,...e.eventName?{eventName:e.eventName}:{}}),nodes:i,setNodeStatuses:x,setIsExecuting:c,navigateToExecution:e=>_({to:`/workflows/$workflowId`,params:{workflowId:n},search:{executionId:e}})})},t[13]=y,t[14]=n,t[15]=_,t[16]=i,t[17]=T,t[18]=f,t[19]=b,t[20]=c,t[21]=x,t[22]=p,t[23]=o,t[24]=O):O=t[24];let k=O,A;t[25]!==k||t[26]!==i||t[27]!==g?(A=()=>{let e=L_e(i)??Z0;g(U_e,{startEvents:e.startEvents,allowManualStart:t2(e),hasEventSplit:i.some(l8),savedPayloads:W7(i),onRun:e=>{k(e)}})},t[25]=k,t[26]=i,t[27]=g,t[28]=A):A=t[28];let j=A,M;t[29]!==f||t[30]!==p?(M=(e,t)=>{p(e),f(`properties`),t&&setTimeout(()=>{let e=document.getElementById(t);e&&(e.focus(),e.scrollIntoView({behavior:`smooth`,block:`center`}))},100)},t[29]=f,t[30]=p,t[31]=M):M=t[31];let N=M,P;t[32]!==h||t[33]!==N||t[34]!==s||t[35]!==i||t[36]!==g||t[37]!==j||t[38]!==m?(P=async()=>{if(s)return;let e=lve({nodes:i,catalog:h,integrations:m});if(e.length>0){let t=uve(e);g(W_e,{issues:dve(e),onGoToStep:N,onRunAnyway:t?void 0:j,allowRunAnyway:!t});return}j()},t[32]=h,t[33]=N,t[34]=s,t[35]=i,t[36]=g,t[37]=j,t[38]=m,t[39]=P):P=t[39];let F=P,I;return t[40]!==F||t[41]!==D?(I={handleSave:D,handleExecute:F},t[40]=F,t[41]=D,t[42]=I):I=t[42],I}function pve(e){return e.type!==`add`}function mve(){let e=(0,Z.c)(33),t=_j(j4),n=_j(M4),[r,i]=yj(h4),[a]=yj(g4),o=vj(Z4),s=vj(q4),[c]=yj(U2),[l,u]=yj(W2),[d,f]=yj(G2),p=vj(q2),m=vj(l4),h=_j(K2),g=_j(X2),_=_j(Z2),v=vj(Q4),y=vj($4),b=vj(K4),[x]=yj(Wle),[S]=yj(Gle),C=vj(s4),w=vj(R4),T;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=k2(),e[0]=T):T=e[0];let{data:E}=Xe(T),D;e[1]===E?D=e[2]:(D=E===void 0?[]:E,e[1]=E,e[2]=D);let O=D,k;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(k=nle(),e[3]=k):k=e[3];let{data:A}=Xe(k),j;e[4]===A?j=e[5]:(j=A===void 0?[]:A,e[4]=A,e[5]=j);let M=j,N;return e[6]!==b||e[7]!==M||e[8]!==S||e[9]!==x||e[10]!==o||e[11]!==c||e[12]!==n||e[13]!==_||e[14]!==r||e[15]!==a||e[16]!==h||e[17]!==g||e[18]!==t||e[19]!==y||e[20]!==C||e[21]!==f||e[22]!==u||e[23]!==i||e[24]!==m||e[25]!==w||e[26]!==p||e[27]!==v||e[28]!==s||e[29]!==O||e[30]!==d||e[31]!==l?(N={nodes:t,edges:n,isExecuting:r,setIsExecuting:i,isGenerating:a,clearWorkflow:o,updateNodeData:s,currentWorkflowId:c,workflowName:l,workflowMode:d,setCurrentWorkflowName:u,setCurrentWorkflowMode:f,setWorkflowNameError:p,setIsTransitioningFromHomepage:m,isOwner:h,isSaving:g,hasUnsavedChanges:_,undo:v,redo:y,addNode:b,canUndo:x,canRedo:S,allWorkflows:M,setActiveTab:C,setSelectedNodeId:w,userIntegrations:O},e[6]=b,e[7]=M,e[8]=S,e[9]=x,e[10]=o,e[11]=c,e[12]=n,e[13]=_,e[14]=r,e[15]=a,e[16]=h,e[17]=g,e[18]=t,e[19]=y,e[20]=C,e[21]=f,e[22]=u,e[23]=i,e[24]=m,e[25]=w,e[26]=p,e[27]=v,e[28]=s,e[29]=O,e[30]=d,e[31]=l,e[32]=N):N=e[32],N}function hve(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable}function gve(e){let t=(0,Z.c)(57),{open:n}=cZ(),r=Gi(),i=Fe(),a=P2(),o=vj(ple),{currentWorkflowId:s,workflowName:c,workflowMode:l,setCurrentWorkflowName:u,setCurrentWorkflowMode:d,setWorkflowNameError:f,setIsTransitioningFromHomepage:p,nodes:m,edges:h,updateNodeData:g,isExecuting:_,setIsExecuting:v,clearWorkflow:y,setActiveTab:b,setSelectedNodeId:x,userIntegrations:S}=e,C;t[0]!==s||t[1]!==h||t[2]!==_||t[3]!==m||t[4]!==b||t[5]!==u||t[6]!==v||t[7]!==p||t[8]!==x||t[9]!==f||t[10]!==g||t[11]!==S||t[12]!==c?(C={currentWorkflowId:s,workflowName:c,nodes:m,edges:h,updateNodeData:g,isExecuting:_,setIsExecuting:v,setCurrentWorkflowName:u,setWorkflowNameError:f,setIsTransitioningFromHomepage:p,setActiveTab:b,setSelectedNodeId:x,userIntegrations:S},t[0]=s,t[1]=h,t[2]=_,t[3]=m,t[4]=b,t[5]=u,t[6]=v,t[7]=p,t[8]=x,t[9]=f,t[10]=g,t[11]=S,t[12]=c,t[13]=C):C=t[13];let{handleSave:w,handleExecute:T}=fve(C),E;t[14]===T?E=t[15]:(E=e=>{if(!((e.metaKey||e.ctrlKey)&&e.key===`Enter`))return;let t=e.target;t instanceof HTMLElement&&hve(t)||(e.preventDefault(),e.stopPropagation(),T())},t[14]=T,t[15]=E);let D=E,O;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(O={capture:!0},t[16]=O):O=t[16],HX(document,`keydown`,D,O);let k;t[17]!==y||t[18]!==n?(k=()=>{n(qZ,{title:`Clear Workflow`,message:`Remove every step and connection? The Lifecycle Node is kept, and this saves right away.`,confirmLabel:`Clear Workflow`,confirmVariant:`destructive`,destructive:!0,onConfirm:()=>{y()}})},t[17]=y,t[18]=n,t[19]=k):k=t[19];let A=k,j;t[20]!==s||t[21]!==a||t[22]!==n||t[23]!==c?(j=()=>{n(qZ,{title:`Delete Workflow`,message:`Are you sure you want to delete "${c}"? This will permanently delete the workflow. This cannot be undone.`,confirmLabel:`Delete Workflow`,confirmVariant:`destructive`,destructive:!0,onConfirm:()=>{s&&a.mutate({workflowId:s})}})},t[20]=s,t[21]=a,t[22]=n,t[23]=c,t[24]=j):j=t[24];let M=j,N;t[25]===i?N=t[26]:(N=()=>A2(i),t[25]=i,t[26]=N);let P=N,F;t[27]!==P||t[28]!==r?(F=O2.workflow.duplicate.mutationOptions({onSuccess:async e=>{Fy.success(`Workflow duplicated successfully`),await P(),await r({to:`/workflows/$workflowId`,params:{workflowId:e.id}})},meta:{errorMessage:`Failed to duplicate workflow. Please try again.`}}),t[27]=P,t[28]=r,t[29]=F):F=t[29];let I=Ze(F),L;t[30]!==P||t[31]!==i?(L=O2.workflow.publish.mutationOptions({onSuccess:e=>{Fy.success(`Published version ${e.publishedVersion}`),j2(i,e),P()}}),t[30]=P,t[31]=i,t[32]=L):L=t[32];let R=Ze(L),z;t[33]!==s||t[34]!==I?(z=()=>{s&&I.mutate({workflowId:s})},t[33]=s,t[34]=I,t[35]=z):z=t[35];let B=z,V;t[36]!==s||t[37]!==h||t[38]!==m||t[39]!==R?(V=()=>{s&&R.mutate({workflowId:s,graph:b2({nodes:m,edges:h})})},t[36]=s,t[37]=h,t[38]=m,t[39]=R,t[40]=V):V=t[40];let H=V,U;t[41]!==s||t[42]!==d||t[43]!==o||t[44]!==l?(U=async e=>{if(!s||l===e)return;let t=await o(e);if(!t?.ok){Fy.error(`Failed to update workflow mode`);return}d(t.workflow.mode),Fy.success(e===`test`?`Workflow set to Test mode`:`Workflow set to Live mode`)},t[41]=s,t[42]=d,t[43]=o,t[44]=l,t[45]=U):U=t[45];let W=U,G;return t[46]!==I.isPending||t[47]!==A||t[48]!==M||t[49]!==B||t[50]!==T||t[51]!==H||t[52]!==w||t[53]!==W||t[54]!==P||t[55]!==R.isPending?(G={handleSave:w,handleExecute:T,handleClearWorkflow:A,handleDeleteWorkflow:M,loadWorkflows:P,handleDuplicate:B,isDuplicating:I.isPending,handlePublish:H,isPublishing:R.isPending,handleSetWorkflowMode:W},t[46]=I.isPending,t[47]=A,t[48]=M,t[49]=B,t[50]=T,t[51]=H,t[52]=w,t[53]=W,t[54]=P,t[55]=R.isPending,t[56]=G):G=t[56],G}function _ve(e){let t=(0,Z.c)(3),{isPublished:n,hasUnpublishedChanges:r}=e;if(!n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`span`,{className:`rounded-md border bg-card px-2 py-1 font-medium text-muted-foreground text-xs`,children:`Never published`}),t[0]=e):e=t[0],e}let i=r?`Unpublished changes`:`Published`,a;return t[1]===i?a=t[2]:(a=(0,X.jsx)(`span`,{className:`rounded-md border bg-card px-2 py-1 font-medium text-muted-foreground text-xs`,children:i}),t[1]=i,t[2]=a),a}var vve=e=>{let t=(0,Z.c)(52),{workflowId:n}=e,r=mve(),i=gve(r),a;if(t[0]!==r.allWorkflows||t[1]!==r.currentWorkflowId){let e;t[3]===r.currentWorkflowId?e=t[4]:(e=e=>e.id===r.currentWorkflowId,t[3]=r.currentWorkflowId,t[4]=e),a=r.allWorkflows.find(e),t[0]=r.allWorkflows,t[1]=r.currentWorkflowId,t[2]=a}else a=t[2];let o=!!a?.publishedVersionId,s=n??``,c;t[5]===s?c=t[6]:(c=ile(s),t[5]=s,t[6]=c);let l=!!n,u;t[7]!==c||t[8]!==l?(u={...c,enabled:l},t[7]=c,t[8]=l,t[9]=u):u=t[9];let{data:d}=Xe(u),f=d!==void 0&&d,p;t[10]!==i||t[11]!==r||t[12]!==n?(p=(0,X.jsx)(E_e,{actions:i,state:r,workflowId:n}),t[10]=i,t[11]=r,t[12]=n,t[13]=p):p=t[13];let m;t[14]!==r.workflowMode||t[15]!==n?(m=n&&r.workflowMode===`test`&&(0,X.jsx)(`span`,{className:`rounded-md border border-warning/40 bg-warning/10 px-2 py-1 font-medium text-warning text-xs`,children:`Test mode`}),t[14]=r.workflowMode,t[15]=n,t[16]=m):m=t[16];let h;t[17]!==f||t[18]!==o||t[19]!==n?(h=n&&(0,X.jsx)(_ve,{hasUnpublishedChanges:f,isPublished:o}),t[17]=f,t[18]=o,t[19]=n,t[20]=h):h=t[20];let g;t[21]!==r.isOwner||t[22]!==n?(g=n&&!r.isOwner&&(0,X.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Read-only`}),t[21]=r.isOwner,t[22]=n,t[23]=g):g=t[23];let _;t[24]!==g||t[25]!==p||t[26]!==m||t[27]!==h?(_=(0,X.jsxs)(`div`,{className:`pointer-events-auto flex min-w-0 flex-wrap items-center gap-2`,children:[p,m,h,g]}),t[24]=g,t[25]=p,t[26]=m,t[27]=h,t[28]=_):_=t[28];let v;t[29]!==i||t[30]!==r||t[31]!==n?(v=(0,X.jsx)(w_e,{actions:i,state:r,workflowId:n}),t[29]=i,t[30]=r,t[31]=n,t[32]=v):v=t[32];let y;t[33]!==i||t[34]!==r.isOwner||t[35]!==n?(y=n&&!r.isOwner&&(0,X.jsx)(C_e,{isDuplicating:i.isDuplicating,onDuplicate:i.handleDuplicate}),t[33]=i,t[34]=r.isOwner,t[35]=n,t[36]=y):y=t[36];let b;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,X.jsx)(h_e,{}),t[37]=b):b=t[37];let x;t[38]===y?x=t[39]:(x=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[y,b]}),t[38]=y,t[39]=x);let S;t[40]!==v||t[41]!==x?(S=(0,X.jsxs)(`div`,{className:`pointer-events-auto flex items-center gap-2 overflow-x-auto @xl:justify-end`,children:[v,x]}),t[40]=v,t[41]=x,t[42]=S):S=t[42];let C;t[43]!==_||t[44]!==S?(C=(0,X.jsxs)(`div`,{className:`pointer-events-none absolute inset-x-4 top-4 z-10 flex flex-col items-stretch gap-2 @container @xl:flex-row @xl:items-start @xl:justify-between`,children:[_,S]}),t[43]=_,t[44]=S,t[45]=C):C=t[45];let w;t[46]!==r.workflowMode||t[47]!==n?(w=n&&r.workflowMode===`test`&&(0,X.jsxs)(`div`,{className:`-translate-x-1/2 pointer-events-none absolute bottom-4 left-1/2 z-10 max-w-xl rounded-md border border-warning/30 bg-warning/10 px-4 py-2 text-xs`,children:[(0,X.jsx)(`p`,{className:`font-medium text-warning`,children:`Test mode active`}),(0,X.jsx)(`p`,{className:`font-medium text-foreground`,children:`No real email or SMS is sent unless a node is configured to route to a test recipient.`})]}),t[46]=r.workflowMode,t[47]=n,t[48]=w):w=t[48];let T;return t[49]!==C||t[50]!==w?(T=(0,X.jsxs)(X.Fragment,{children:[C,w]}),t[49]=C,t[50]=w,t[51]=T):T=t[51],T};function yve(e,t){return Vde(e)??t?.displayLabel??null}function bve(e){return e?.opacity!==void 0}var xve=e=>{let t=(0,Z.c)(13),{id:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,selected:l}=e,u;t[0]!==s||t[1]!==r||t[2]!==i||t[3]!==c||t[4]!==a||t[5]!==o?(u=BO({sourceX:r,sourceY:i,sourcePosition:s,targetX:a,targetY:o,targetPosition:c}),t[0]=s,t[1]=r,t[2]=i,t[3]=c,t[4]=a,t[5]=o,t[6]=u):u=t[6];let[d]=u,f=l?`var(--muted-foreground)`:`var(--border)`,p;t[7]===f?p=t[8]:(p={stroke:f,strokeDasharray:`5, 5`},t[7]=f,t[8]=p);let m;return t[9]!==d||t[10]!==n||t[11]!==p?(m=(0,X.jsx)(RO,{className:`stroke-1`,id:n,path:d,style:p}),t[9]=d,t[10]=n,t[11]=p,t[12]=m):m=t[12],m},e9=(e,t,n,r)=>{let i=e.internals.handleBounds?.[t];if(!(i&&i.length>0))return[0,0];let a=(r?i.find(e=>(e.id??null)===r):void 0)??i.find(e=>e.position===n)??i[0];if(!a)return[0,0];let o=a.width/2,s=a.height/2;switch(n){case Vw.Left:o=0;break;case Vw.Right:o=a.width;break;case Vw.Top:s=0;break;case Vw.Bottom:s=a.height;break;default:throw Error(`Invalid handle position`)}return[e.internals.positionAbsolute.x+a.x+o,e.internals.positionAbsolute.y+a.y+s]},Sve=(e,t,n,r)=>{let i=Vw.Bottom,[a,o]=e9(e,`source`,i,n),s=Vw.Top,[c,l]=e9(t,`target`,s,r);return{sx:a,sy:o,tx:c,ty:l,sourcePos:i,targetPos:s}},t9={Temporary:xve,Animated:e=>{let t=(0,Z.c)(29),{id:n,source:r,sourceHandleId:i,target:a,targetHandleId:o,style:s,selected:c,data:l}=e,u=Vk(r),d=Vk(a);if(!(u&&d))return null;let f;if(t[0]!==i||t[1]!==u||t[2]!==o||t[3]!==d){let{sx:e,sy:n,tx:r,ty:a,sourcePos:s,targetPos:c}=Sve(u,d,i,o);f=NT({sourceX:e,sourceY:n,sourcePosition:s,targetX:r,targetY:a,targetPosition:c}),t[0]=i,t[1]=u,t[2]=o,t[3]=d,t[4]=f}else f=t[4];let[p,m,h]=f,g;t[5]!==l||t[6]!==i?(g=yve(i,l),t[5]=l,t[6]=i,t[7]=g):g=t[7];let _=g,v;t[8]===s?v=t[9]:(v=bve(s),t[8]=s,t[9]=v);let y=v,b=c?`var(--muted-foreground)`:`var(--border)`,x=y?`5, 5`:5,S;t[10]===y?S=t[11]:(S=y?{}:{animation:`dashdraw 0.5s linear infinite`},t[10]=y,t[11]=S);let C;t[12]!==s||t[13]!==b||t[14]!==x||t[15]!==S?(C={...s,stroke:b,strokeWidth:2,strokeDasharray:x,...S},t[12]=s,t[13]=b,t[14]=x,t[15]=S,t[16]=C):C=t[16];let w;t[17]!==p||t[18]!==n||t[19]!==C?(w=(0,X.jsx)(RO,{id:n,path:p,style:C}),t[17]=p,t[18]=n,t[19]=C,t[20]=w):w=t[20];let T;t[21]!==_||t[22]!==y||t[23]!==m||t[24]!==h?(T=_&&(0,X.jsx)(zk,{children:(0,X.jsx)(`div`,{className:`pointer-events-none absolute rounded-sm border bg-background px-1.5 py-0.5 font-medium text-xs text-muted-foreground leading-none`,style:{transform:`translate(-50%, -50%) translate(${m}px,${h}px)`,...y?{opacity:.7}:{}},children:_})}),t[21]=_,t[22]=y,t[23]=m,t[24]=h,t[25]=T):T=t[25];let E;return t[26]!==w||t[27]!==T?(E=(0,X.jsxs)(X.Fragment,{children:[w,T]}),t[26]=w,t[27]=T,t[28]=E):E=t[28],E}},Cve=e=>{let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`m-4 rounded-md border bg-card p-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(UE,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};function wve(e,t){let n=t.filter(t=>t.source===e);return n.some(e=>i8(e.sourceHandle)===`true`)?n.some(e=>i8(e.sourceHandle)===`false`)?`true`:`false`:`true`}function Tve(e){let{nodes:t,edges:n,sourceNodeId:r,catalog:i}=e,a=p8({targetNodeId:r,nodes:t,edges:n,catalog:i}),o=new Set(n.filter(e=>e.source===r).map(e=>e.sourceHandle)),s=a.find(e=>!o.has(s8(e.name)))??a[0];return s?s8(s.name):null}function Eve(e){let{nodes:t,edges:n,sourceNodeId:r,sourceHandle:i,catalog:a}=e,o=i8(i);if(o)return o;let s=t.find(e=>e.id===r);if(s?.data.type===`lifecycle`)return Ele(i)?i:T4;if(l8(s)){let e=c8(i);return e?s8(e):Tve({nodes:t,edges:n,sourceNodeId:r,catalog:a})}return a8(s)?wve(r,n):i??null}var Dve=e=>{let t=(0,Z.c)(12),{className:n}=e,r;t[0]===n?r=t[1]:(r=Kv(`pointer-events-none absolute inset-0 animate-border-mask rounded-[inherit]`,n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(`svg`,{className:`size-full overflow-visible`,xmlns:`http://www.w3.org/2000/svg`,children:(0,X.jsx)(`rect`,{fill:`none`,height:`calc(100% - 2px)`,rx:`6`,stroke:`var(--info)`,strokeWidth:`2`,width:`calc(100% - 2px)`,x:`1`,y:`1`})}),t[2]=i):i=t[2];let a;t[3]===r?a=t[4]:(a=(0,X.jsx)(`div`,{className:r,children:i}),t[3]=r,t[4]=a);let o;t[5]===n?o=t[6]:(o=Kv(`pointer-events-none absolute inset-0 rounded-[inherit] border-2 border-info/20`,n),t[5]=n,t[6]=o);let s;t[7]===o?s=t[8]:(s=(0,X.jsx)(`div`,{className:o}),t[7]=o,t[8]=s);let c;return t[9]!==a||t[10]!==s?(c=(0,X.jsxs)(X.Fragment,{children:[a,s]}),t[9]=a,t[10]=s,t[11]=c):c=t[11],c},Ove=__(`flex flex-col rounded-xl border text-card-foreground shadow-sm`,{variants:{size:{default:`gap-6 py-6`,sm:`gap-4 py-4`}},defaultVariants:{size:`default`}});function kve(e){let t=(0,Z.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,size:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o;t[4]!==n||t[5]!==a?(o=Kv(Ove({size:a}),n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==a||t[9]!==o?(s=(0,X.jsx)(`div`,{className:o,"data-size":a,"data-slot":`card`,...r}),t[7]=r,t[8]=a,t[9]=o,t[10]=s):s=t[10],s}function Ave(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`font-semibold leading-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{className:i,"data-slot":`card-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function jve(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`text-muted-foreground text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{className:i,"data-slot":`card-description`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Mve={running:{label:`Running`,Icon:gy,className:`bg-primary/5 text-foreground`,iconClassName:`animate-spin motion-reduce:animate-none`},success:{label:`Succeeded`,Icon:iy,className:`bg-success/10 text-success`,iconClassName:``},error:{label:`Failed`,Icon:Yee,className:`bg-destructive/10 text-destructive`,iconClassName:``},cancelled:{label:`Cancelled`,Icon:ry,className:`bg-cancelled/10 text-cancelled`,iconClassName:``}},Nve=e=>{let t=(0,Z.c)(11),{status:n}=e;if(!n||n===`idle`)return null;let r=Mve[n],i;t[0]===r.className?i=t[1]:(i=Kv(`absolute top-2 right-2 z-10 flex items-center gap-1 rounded-sm py-0.5 pr-2 pl-1.5 font-medium text-xs leading-none`,r.className),t[0]=r.className,t[1]=i);let a=r.Icon,o;t[2]===r.iconClassName?o=t[3]:(o=Kv(`size-3`,r.iconClassName),t[2]=r.iconClassName,t[3]=o);let s;t[4]!==r.Icon||t[5]!==o?(s=(0,X.jsx)(a,{className:o,strokeWidth:2.5}),t[4]=r.Icon,t[5]=o,t[6]=s):s=t[6];let c;return t[7]!==r.label||t[8]!==i||t[9]!==s?(c=(0,X.jsxs)(`div`,{className:i,role:`status`,children:[s,r.label]}),t[7]=r.label,t[8]=i,t[9]=s,t[10]=c):c=t[10],c};function n9(e,t){return t===!1?null:t===!0?(0,X.jsx)(iO,{position:e===`source`?Vw.Bottom:Vw.Top,type:e}):t.map(t=>{let n=[e,t.position,t.style?.top,t.style?.right,t.style?.bottom,t.style?.left].join(`:`);return(0,X.jsx)(iO,{id:t.id,position:t.position,style:t.style,type:e},t.id??n)})}var r9=e=>{let t=(0,Z.c)(25),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({handles:r,className:n,status:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===`success`&&`border-2 border-success`,s=a===`error`&&`border-2 border-destructive`,c=a===`cancelled`&&`border-2 border-cancelled`,l;t[5]!==n||t[6]!==o||t[7]!==s||t[8]!==c?(l=Kv(`node-container relative size-full h-auto w-sm gap-0 overflow-visible rounded-md bg-card p-0 transition-all duration-200`,o,s,c,n),t[5]=n,t[6]=o,t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]===a?u=t[11]:(u=a===`running`&&(0,X.jsx)(Dve,{}),t[10]=a,t[11]=u);let d;t[12]===a?d=t[13]:(d=(0,X.jsx)(Nve,{status:a}),t[12]=a,t[13]=d);let f;t[14]===r.target?f=t[15]:(f=n9(`target`,r.target),t[14]=r.target,t[15]=f);let p;t[16]===r.source?p=t[17]:(p=n9(`source`,r.source),t[16]=r.source,t[17]=p);let m;return t[18]!==i||t[19]!==l||t[20]!==u||t[21]!==d||t[22]!==f||t[23]!==p?(m=(0,X.jsxs)(kve,{className:l,...i,children:[u,d,f,p,i.children]}),t[18]=i,t[19]=l,t[20]=u,t[21]=d,t[22]=f,t[23]=p,t[24]=m):m=t[24],m},i9=e=>{let t=(0,Z.c)(2),n;return t[0]===e?n=t[1]:(n=(0,X.jsx)(Ave,{...e}),t[0]=e,t[1]=n),n},a9=e=>{let t=(0,Z.c)(2),n;return t[0]===e?n=t[1]:(n=(0,X.jsx)(jve,{...e}),t[0]=e,t[1]=n),n},Pve=/(-?\d+(?:\.\d+)?)\s*(ms|s|m|h|d|w)/gi,Fve=/(Z|[+-]\d{2}:\d{2})$/i,Ive=/^(-)?P(?:(\d+(?:\.\d+)?)W)?(?:(\d+(?:\.\d+)?)D)?(?:T(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?)?$/i,Lve=/^-?\d+(?:\.\d+)?$/,Rve=/^\d+$/,zve=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?$/;function o9(e){switch(e){case`ms`:return 1;case`s`:return 1e3;case`m`:return 6e4;case`h`:return 36e5;case`d`:return 864e5;case`w`:return 6048e5;default:return NaN}}function Bve(e){let t=Ive.exec(e.trim());if(!t)return null;let n=t[1]?-1:1,r=Number.parseFloat(t[2]??`0`),i=Number.parseFloat(t[3]??`0`),a=Number.parseFloat(t[4]??`0`),o=Number.parseFloat(t[5]??`0`),s=Number.parseFloat(t[6]??`0`);return n*(r*o9(`w`)+i*o9(`d`)+a*o9(`h`)+o*o9(`m`)+s*o9(`s`))}function s9(e){if(typeof e==`number`&&Number.isFinite(e))return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t)return null;if(Lve.test(t))return Number.parseFloat(t);let n=Bve(t);if(n!==null)return n;let r=0,i=!1;for(let e of t.matchAll(Pve)){let t=Number.parseFloat(e[1]),n=o9(e[2].toLowerCase());if(!Number.isFinite(t)||Number.isNaN(n))return null;i=!0,r+=t*n}return i?r:null}function Vve(e){let t=zve.exec(e);return t?{year:Number.parseInt(t[1],10),month:Number.parseInt(t[2],10),day:Number.parseInt(t[3],10),hour:Number.parseInt(t[4]??`0`,10),minute:Number.parseInt(t[5]??`0`,10),second:Number.parseInt(t[6]??`0`,10)}:null}function c9(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1}).formatToParts(e),r=Object.fromEntries(n.map(e=>[e.type,e.value]));return Date.UTC(Number.parseInt(r.year,10),Number.parseInt(r.month,10)-1,Number.parseInt(r.day,10),Number.parseInt(r.hour,10),Number.parseInt(r.minute,10),Number.parseInt(r.second,10))-e.getTime()}function Hve(e,t){let n=Vve(e);if(!n)return null;let r=new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second)),i=c9(r,t),a=new Date(r.getTime()-i),o=c9(a,t);return o===i?a:new Date(r.getTime()-o)}function l9(e,t){if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e==`number`)return u9(e);if(typeof e!=`string`)return null;let n=e.trim();return n?Uve(n)??Wve(n)??Gve(n,t):null}function u9(e){if(typeof e==`number`&&!Number.isFinite(e))return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Uve(e){if(!Rve.test(e))return null;let t=Number.parseInt(e,10);return u9(e.length<=10?t*1e3:t)}function Wve(e){return Fve.test(e)?u9(e):null}function Gve(e,t){if(t){let n=Hve(e,t);if(n)return n}return u9(e)}function Kve(e,t,n,r){let i=c9(e,r),a=e.getTime()+i,o=new Date(a),s=o.getUTCHours()*60+o.getUTCMinutes();if(s>=t&&s<n)return e;let c=Math.floor(t/60),l=t%60,u=s<t?0:1,d=new Date(a);d.setUTCDate(d.getUTCDate()+u),d.setUTCHours(c,l,0,0);let f=new Date(d.getTime()-i),p=c9(f,r);return p===i?f:new Date(d.getTime()-p)}function qve(e){let t=J7(e.waitAllowedHoursMode);if(t===`off`)return{date:e.candidate};let n=Y_e({mode:t,startTime:e.waitAllowedStartTime,endTime:e.waitAllowedEndTime});if(n.length>0)return{date:e.candidate,error:n.map(e=>e.message).join(` `)};if(!e.timeZone)return{date:e.candidate,error:`Timezone is required when allowed-hours window is enabled.`};let r=Y7(e.waitAllowedStartTime),i=Y7(e.waitAllowedEndTime);return r===null||i===null?{date:e.candidate,error:`Invalid allowed-hours time format after validation.`}:{date:Kve(e.candidate,r,i,e.timeZone)}}function d9(e){let t=e.now??new Date,n=typeof e.waitTimezone==`string`&&e.waitTimezone.trim()?e.waitTimezone.trim():void 0,r;if(e.waitUntil!==void 0&&e.waitUntil!==``){let t=l9(e.waitUntil,n);if(!t)return{error:`Invalid waitUntil value. Use an ISO timestamp or unix epoch.`};let i=s9(e.waitOffset);if(e.waitOffset!==void 0&&e.waitOffset!==``&&i===null)return{error:`Invalid waitOffset value. Use duration like -1d, 6h, 30m, or ISO duration.`};r=new Date(t.getTime()+(i??0))}else{let n=s9(e.waitDuration);if(n===null)return{error:`Invalid waitDuration value. Use milliseconds, duration tokens (e.g. 24h), or ISO duration.`};r=new Date(t.getTime()+n)}let i=qve({candidate:r,waitAllowedHoursMode:e.waitAllowedHoursMode,waitAllowedStartTime:e.waitAllowedStartTime,waitAllowedEndTime:e.waitAllowedEndTime,timeZone:n});return i.error?{error:i.error}:{waitUntil:i.date}}var Jve={};function Yve(){let e=(0,Z.c)(5),t=_j(y4),n;e[0]===t?n=e[1]:(n=O2.workflow.getExecutionLogs.queryOptions({input:{executionId:t??``},select:bge}),e[0]=t,e[1]=n);let r=t!==null,i;e[2]!==n||e[3]!==r?(i={...n,enabled:r},e[2]=n,e[3]=r,e[4]=i):i=e[4];let{data:a}=Xe(i);return a??Jve}var Xve=Jh(Eh({waitMode:gh(Vh),waitTimezone:gh(Vh),waitDuration:gh(yh),waitUntil:gh(yh),waitOffset:gh(yh),waitTimeout:gh(yh)}));function f9(e){return typeof e==`string`&&e.includes(`{{`)&&e.includes(`}}`)}function p9(e){let t=Math.max(Math.floor(e/1e3),0),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=t%60;return`${n} ${n===1?`day`:`days`} ${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}:${String(a).padStart(2,`0`)}`}function m9(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,month:`long`,day:`numeric`,year:`numeric`,hour:`numeric`,minute:`2-digit`,hour12:!0,timeZoneName:`short`}),r=Object.fromEntries(n.formatToParts(e).map(e=>[e.type,e.value])),i=r.dayPeriod?` ${r.dayPeriod.toUpperCase()}`:``,a=r.timeZoneName?` ${r.timeZoneName}`:``;return`${r.month} ${r.day}, ${r.year} ${r.hour}:${r.minute}${i}${a}`}function Zve(e,t){let n=(0,Z.c)(15),r=I2(t,`waitMode`,`delay`),i=e===Y0.wait&&(r===`delay`||r===`event`),a=t?.waitDuration,o=t?.waitUntil,s=t?.waitOffset,c;n[0]===t?c=n[1]:(c=typeof t?.waitTimezone==`string`&&t.waitTimezone.trim()?t.waitTimezone.trim():void 0,n[0]=t,n[1]=c);let l=c,u=f9(a)||f9(o)||f9(s),d;bb0:{if(!i||u||r===`event`){d=null;break bb0}let e;n[2]!==a||n[3]!==s||n[4]!==l||n[5]!==o?(e=d9({waitDuration:a,waitUntil:o,waitOffset:s,waitTimezone:l}),n[2]=a,n[3]=s,n[4]=l,n[5]=o,n[6]=e):e=n[6],d=e}let f=d;if(!i)return null;if(r===`event`){let e;return n[7]===Symbol.for(`react.memo_cache_sentinel`)?(e={countdown:`Waiting for event`,triggerTime:`Resumes when a matching event arrives`},n[7]=e):e=n[7],e}if(u){let e;return n[8]===Symbol.for(`react.memo_cache_sentinel`)?(e={countdown:`Runtime-calculated`,triggerTime:`Trigger time comes from workflow data`},n[8]=e):e=n[8],e}if(!f?.waitUntil){let e;return n[9]===Symbol.for(`react.memo_cache_sentinel`)?(e={countdown:`Set wait duration`,triggerTime:`Add a valid wait time`},n[9]=e):e=n[9],e}let p;n[10]!==f.waitUntil||n[11]!==l?(p=m9(f.waitUntil,l),n[10]=f.waitUntil,n[11]=l,n[12]=p):p=n[12];let m;return n[13]===p?m=n[14]:(m={countdown:`Delay configured`,triggerTime:p},n[13]=p,n[14]=m),m}function Qve(e,t,n){let r=(0,Z.c)(16),i=e===Y0.wait&&t!==null&&n!==void 0&&(n.status===`running`||n.status===`pending`),a;r[0]===i?a=r[1]:(a={intervalMs:1e3,enabled:i},r[0]=i,r[1]=a);let o=KX(a);n?.input;let s;bb0:{if(!i){s=null;break bb0}let e;r[2]===n?.input?e=r[3]:(e=Xve(n?.input)??null,r[2]=n?.input,r[3]=e),s=e}let c=s,l,u,d;if(r[4]!==n||r[5]!==o||r[6]!==c||r[7]!==i){d=Symbol.for(`react.early_return_sentinel`);bb1:{let e=i&&n?.startedAt!==void 0?l9(n.startedAt):null;if(!(i&&c&&e)){d=null;break bb1}let t=c.waitMode||`delay`,a=c.waitTimezone||void 0;if(t===`event`){let t=d9({now:e,waitDuration:c.waitTimeout});if(!t.waitUntil){d={countdown:`Waiting for event`,triggerTime:`Resumes when matching event arrives`};break bb1}d={countdown:p9(t.waitUntil.getTime()-o),triggerTime:m9(t.waitUntil,a)};break bb1}let s=d9({now:e,waitDuration:c.waitDuration,waitUntil:c.waitUntil,waitOffset:c.waitOffset,waitTimezone:a});if(!s.waitUntil){d={countdown:`Runtime-calculated`,triggerTime:`Waiting timestamp unavailable`};break bb1}let f=s.waitUntil.getTime()-o;r[11]===f?l=r[12]:(l=p9(f),r[11]=f,r[12]=l),u=m9(s.waitUntil,a)}r[4]=n,r[5]=o,r[6]=c,r[7]=i,r[8]=l,r[9]=u,r[10]=d}else l=r[8],u=r[9],d=r[10];if(d!==Symbol.for(`react.early_return_sentinel`))return d;let f;return r[13]!==l||r[14]!==u?(f={countdown:l,triggerTime:u},r[13]=l,r[14]=u,r[15]=f):f=r[15],f}var $ve=e=>({"gpt-5":`GPT-5`,"openai/gpt-5.1-instant":`GPT-5.1 Instant`,"openai/gpt-5.1-codex":`GPT-5.1 Codex`,"openai/gpt-5.1-codex-mini":`GPT-5.1 Codex Mini`,"openai/gpt-5.1-thinking":`GPT-5.1 Thinking`,"gpt-4":`GPT-4`,"gpt-4o":`GPT-4o`,"gpt-4o-mini":`GPT-4o Mini`,"claude-3-5-sonnet":`Claude 3.5`,"claude-3-opus":`Claude 3 Opus`,"anthropic/claude-opus-4.5":`Claude Opus 4.5`,"anthropic/claude-sonnet-4.5":`Claude Sonnet 4.5`,"anthropic/claude-haiku-4.5":`Claude Haiku 4.5`,"google/gemini-3-pro-preview":`Gemini 3 Pro Preview`,"google/gemini-2.5-flash-lite":`Gemini 2.5 Flash Lite`,"google/gemini-2.5-flash":`Gemini 2.5 Flash`,"google/gemini-2.5-pro":`Gemini 2.5 Pro`,"meta/llama-4-scout":`Llama 4 Scout`,"meta/llama-3.3-70b":`Llama 3.3 70B`,"meta/llama-3.1-8b":`Llama 3.1 8B`,"moonshotai/kimi-k2-0905":`Kimi K2`,"openai/gpt-oss-120b":`GPT OSS 120B`,"openai/gpt-oss-safeguard-20b":`GPT OSS Safeguard 20B`,"openai/gpt-oss-20b":`GPT OSS 20B`,"o1-preview":`o1 Preview`,"o1-mini":`o1 Mini`,"bfl/flux-2-pro":`FLUX.2 Pro`,"bfl/flux-1-pro":`FLUX.1 Pro`,"openai/dall-e-3":`DALL-E 3`,"google/imagen-4.0-generate":`Imagen 4.0`})[e]||e,eye=(e,t)=>{let n=Wy(e,t)?.integration;return n&&Gy(e,n)?.label||`System`},tye=(e,t)=>!!Wy(e,t)?.integration,nye=e=>{let t=(0,Z.c)(6),{actionType:n,catalog:r}=e,i=jy();switch(n){case Y0.condition:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Zee,{className:`size-12 text-node-condition`,strokeWidth:1.5}),t[0]=e):e=t[0],e}case Y0.eventSplit:{let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(mte,{className:`size-12 text-node-split`,strokeWidth:1.5}),t[1]=e):e=t[1],e}case Y0.wait:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)($ee,{className:`size-12 text-node-wait`,strokeWidth:1.5}),t[2]=e):e=t[2],e}}let a=Wy(r,n)?.integration;if(a){let e=i[a];if(e){let n=e.icon,r;return t[3]===n?r=t[4]:(r=(0,X.jsx)(n,{className:`size-12`}),t[3]=n,t[4]=r),r}}let o;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(Ey,{className:`size-12 text-node-wait`,strokeWidth:1.5}),t[5]=o):o=t[5],o},rye=e=>{let t=(0,Z.c)(4),{model:n}=e;if(!n)return null;let r;t[0]===n?r=t[1]:(r=$ve(n),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,X.jsx)(`div`,{className:`rounded-full border border-muted-foreground/50 px-2 py-0.5 font-medium text-xs text-muted-foreground`,children:r}),t[2]=r,t[3]=i),i};function iye(e){let t=(0,Z.c)(12),{base64:n}=e,[r,i]=(0,Y.useState)(!1),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>{e.stopPropagation(),i(!0)},t[0]=a):a=t[0];let o=`data:image/png;base64,${n}`,s;t[1]===o?s=t[2]:(s=(0,X.jsx)(`button`,{className:`relative size-12 cursor-zoom-in overflow-hidden rounded-lg transition-transform hover:scale-105`,onClick:a,type:`button`,children:(0,X.jsx)(`img`,{alt:`Generated output`,className:`size-12 object-cover`,height:48,src:o,width:48})}),t[1]=o,t[2]=s);let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(zX,{className:`sr-only`,children:`Generated Image`}),t[3]=c):c=t[3];let l=`data:image/png;base64,${n}`,u;t[4]===l?u=t[5]:(u=(0,X.jsxs)(IX,{className:`max-w-3xl p-2`,showCloseButton:!1,children:[c,(0,X.jsx)(`div`,{className:`relative aspect-square w-full overflow-hidden rounded-lg`,children:(0,X.jsx)(`img`,{alt:`Generated output`,className:`h-auto w-full object-contain`,height:768,src:l,width:768})})]}),t[4]=l,t[5]=u);let d;t[6]!==r||t[7]!==u?(d=(0,X.jsx)(NX,{onOpenChange:i,open:r,children:u}),t[6]=r,t[7]=u,t[8]=d):d=t[8];let f;return t[9]!==s||t[10]!==d?(f=(0,X.jsxs)(X.Fragment,{children:[s,d]}),t[9]=s,t[10]=d,t[11]=f):f=t[11],f}var aye=`38%`,oye=`62%`;function h9(e,t){return`${(e+.5)/t*100}%`}var g9=(0,Y.memo)(e=>{let t=(0,Z.c)(102),{data:n,selected:r,id:i}=e,a=ky(),o=Bk(),s=_j(y4),c=Yve(),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=tle(),t[0]=l):l=t[0];let{data:u,isPending:d}=Xe(l),f=u===void 0?ele:u,p=!d,m=c[i],h,g,_;t[1]===n?.config?(h=t[2],g=t[3],_=t[4]):(h=F2(n?.config,`actionType`),g=Hde(h),_=Ude(h),t[1]=n?.config,t[2]=h,t[3]=g,t[4]=_);let v=_,y=V8(v?i:null),b=Qve(h??``,s,m),x=Zve(h??``,n?.config),S=b??x,C;t[5]!==v||t[6]!==y?(C=v?y.map(sye).join(`|`):null,t[5]=v,t[6]=y,t[7]=C):C=t[7];let w=C,T;if(t[8]!==i||t[9]!==g||t[10]!==v||t[11]!==o?(T=()=>{(g||v)&&o(i)},t[8]=i,t[9]=g,t[10]=v,t[11]=o,t[12]=T):T=t[12],WX(g?i:w,T),!n)return null;let E=n.status,D;t[13]!==h||t[14]!==m?.output||t[15]!==s?(D=s&&h===`Generate Image`?T7(m?.output):null,t[13]=h,t[14]=m?.output,t[15]=s,t[16]=D):D=t[16];let O=D;if(!h){let e=n.enabled===!1,a=r&&`border-primary`,o=e&&`opacity-50`,s;t[17]!==a||t[18]!==o?(s=Kv(`flex size-48 flex-col items-center justify-center shadow-none transition-all duration-150 ease-out`,a,o),t[17]=a,t[18]=o,t[19]=s):s=t[19];let c=`action-node-${i}`,l;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(l={target:!0,source:!0},t[20]=l):l=t[20];let u;t[21]===e?u=t[22]:(u=e&&(0,X.jsx)(`div`,{className:`absolute top-2 left-2 rounded-full bg-muted-foreground/50 p-1`,children:(0,X.jsx)(py,{className:`size-3.5 text-background`})}),t[21]=e,t[22]=u);let d;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsx)(Ey,{className:`size-12 text-muted-foreground`,strokeWidth:1.5}),t[23]=d):d=t[23];let f=n.label||`Action`,p;t[24]===f?p=t[25]:(p=(0,X.jsx)(i9,{className:`text-base`,children:f}),t[24]=f,t[25]=p);let m;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,X.jsx)(a9,{className:`text-xs`,children:`Select an action`}),t[26]=m):m=t[26];let h;t[27]===p?h=t[28]:(h=(0,X.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 p-6`,children:[d,(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-1 text-center`,children:[p,m]})]}),t[27]=p,t[28]=h);let g;return t[29]!==E||t[30]!==c||t[31]!==u||t[32]!==h||t[33]!==s?(g=(0,X.jsxs)(r9,{className:s,"data-testid":c,handles:l,status:E,children:[u,h]}),t[29]=E,t[30]=c,t[31]=u,t[32]=h,t[33]=s,t[34]=g):g=t[34],g}let k;t[35]!==h||t[36]!==a?(k=Wy(a,h),t[35]=h,t[36]=a,t[37]=k):k=t[37];let A=k,j=n.label||A?.label||h,M;t[38]!==h||t[39]!==a||t[40]!==n.description?(M=n.description||eye(a,h),t[38]=h,t[39]=a,t[40]=n.description,t[41]=M):M=t[41];let N=M,P;t[42]!==h||t[43]!==a?(P=tye(a,h),t[42]=h,t[43]=a,t[44]=P):P=t[44];let F=P,I;if(t[45]!==f||t[46]!==n.config){let e=F2(n.config,`integrationId`);I=e&&f.has(e),t[45]=f,t[46]=n.config,t[47]=I}else I=t[47];let L=p&&F&&!I,R;t[48]!==h||t[49]!==n.config?(R=h===`Generate Text`?I2(n.config,`aiModel`,`meta/llama-4-scout`):h===`Generate Image`?I2(n.config,`imageModel`,`google/imagen-4.0-generate`):null,t[48]=h,t[49]=n.config,t[50]=R):R=t[50];let z=R,B=n.enabled===!1,V=r&&`border-primary`,H=B&&`opacity-50`,U;t[51]!==V||t[52]!==H?(U=Kv(`relative flex size-48 flex-col items-center justify-center shadow-none transition-all duration-150 ease-out`,V,H),t[51]=V,t[52]=H,t[53]=U):U=t[53];let W=`action-node-${i}`,G;t[54]!==g||t[55]!==v||t[56]!==y?(G=g?[{id:`true`,position:Vw.Bottom,style:{left:aye,width:12,height:12}},{id:`false`,position:Vw.Bottom,style:{left:oye,width:12,height:12}}]:!v||y.map((e,t)=>({id:s8(e.name),position:Vw.Bottom,style:{left:h9(t,y.length),width:12,height:12}})),t[54]=g,t[55]=v,t[56]=y,t[57]=G):G=t[57];let K;t[58]===G?K=t[59]:(K={target:!0,source:G},t[58]=G,t[59]=K);let q;t[60]!==v||t[61]!==y?(q=v&&y.length>1?{width:z7(y.length)}:void 0,t[60]=v,t[61]=y,t[62]=q):q=t[62];let J;t[63]===B?J=t[64]:(J=B&&(0,X.jsx)(`div`,{className:`absolute top-2 left-2 rounded-full bg-muted-foreground/50 p-1`,children:(0,X.jsx)(py,{className:`size-3.5 text-background`})}),t[63]=B,t[64]=J);let ee;t[65]!==L||t[66]!==B?(ee=!B&&L&&(0,X.jsx)(`div`,{className:`absolute top-2 left-2 rounded-full bg-warning/50 p-1`,children:(0,X.jsx)(wy,{className:`size-3.5 text-background`})}),t[65]=L,t[66]=B,t[67]=ee):ee=t[67];let te;t[68]===g?te=t[69]:(te=g&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`pointer-events-none absolute -bottom-8 left-[38%] -translate-x-1/2 rounded-sm border bg-card px-1.5 py-0.5 text-xs text-muted-foreground leading-none`,children:`True`}),(0,X.jsx)(`div`,{className:`pointer-events-none absolute -bottom-8 left-[62%] -translate-x-1/2 rounded-sm border bg-card px-1.5 py-0.5 text-xs text-muted-foreground leading-none`,children:`False`})]}),t[68]=g,t[69]=te);let ne;t[70]!==v||t[71]!==y?(ne=v&&y.map((e,t)=>(0,X.jsx)(`div`,{className:`pointer-events-none absolute -bottom-8 max-w-28 -translate-x-1/2 truncate rounded-sm border bg-card px-1.5 py-0.5 text-xs text-muted-foreground leading-none`,style:{left:h9(t,y.length)},title:e.name,children:e.label},e.name)),t[70]=v,t[71]=y,t[72]=ne):ne=t[72];let re;t[73]!==h||t[74]!==a||t[75]!==O?(re=O?(0,X.jsx)(iye,{base64:O}):(0,X.jsx)(nye,{actionType:h,catalog:a}),t[73]=h,t[74]=a,t[75]=O,t[76]=re):re=t[76];let ie;t[77]===j?ie=t[78]:(ie=(0,X.jsx)(i9,{className:`text-base`,children:j}),t[77]=j,t[78]=ie);let ae;t[79]!==N||t[80]!==S?(ae=S?(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-0.5`,children:[(0,X.jsx)(a9,{className:`font-medium text-xs tabular-nums`,children:S.countdown}),(0,X.jsx)(a9,{className:`max-w-[10.5rem] text-xs leading-tight`,children:S.triggerTime})]}):N&&(0,X.jsx)(a9,{className:`text-xs`,children:N}),t[79]=N,t[80]=S,t[81]=ae):ae=t[81];let oe;t[82]===z?oe=t[83]:(oe=z&&(0,X.jsx)(rye,{model:z}),t[82]=z,t[83]=oe);let se;t[84]!==ie||t[85]!==ae||t[86]!==oe?(se=(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-1 text-center`,children:[ie,ae,oe]}),t[84]=ie,t[85]=ae,t[86]=oe,t[87]=se):se=t[87];let ce;t[88]!==re||t[89]!==se?(ce=(0,X.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 p-6`,children:[re,se]}),t[88]=re,t[89]=se,t[90]=ce):ce=t[90];let le;return t[91]!==E||t[92]!==U||t[93]!==W||t[94]!==K||t[95]!==q||t[96]!==J||t[97]!==ee||t[98]!==te||t[99]!==ne||t[100]!==ce?(le=(0,X.jsxs)(r9,{className:U,"data-testid":W,handles:K,style:q,status:E,children:[J,ee,te,ne,ce]}),t[91]=E,t[92]=U,t[93]=W,t[94]=K,t[95]=q,t[96]=J,t[97]=ee,t[98]=te,t[99]=ne,t[100]=ce,t[101]=le):le=t[101],le});g9.displayName=`ActionNode`;function sye(e){return e.name}function cye(e){let t=(0,Z.c)(3),{data:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(yy,{className:`size-4`}),t[0]=r):r=t[0];let i;return t[1]===n.onClick?i=t[2]:(i=(0,X.jsx)(`div`,{className:`flex items-center justify-center rounded-lg border border-border border-dashed bg-background/50 p-8 backdrop-blur-sm`,children:(0,X.jsxs)(Jv,{className:`gap-2 shadow-lg`,onClick:n.onClick,size:`default`,children:[r,`Add a Step`]})}),t[1]=n.onClick,t[2]=i),i}var _9=`25%`,v9=`75%`;function lye(e){let t=Q0(e);return t?.startEvents.length?`On ${t.startEvents.join(`, `)}`:t2(t)?`Manual runs only`:`Nothing starts this yet`}var y9=(0,Y.memo)(e=>{let t=(0,Z.c)(32),{data:n,selected:r}=e;if(!n)return null;let i=n.label||`Lifecycle`,a=n.description||`Where a run begins`,o;t[0]===n.config?o=t[1]:(o=lye(n.config),t[0]=n.config,t[1]=o);let s=o,c=n.status,l;t[2]===n.config?l=t[3]:(l=$0(n.config),t[2]=n.config,t[3]=l);let u=!l,d=r&&`border-primary`,f;t[4]===d?f=t[5]:(f=Kv(`flex size-48 flex-col items-center justify-center shadow-none transition-all duration-150 ease-out`,d),t[4]=d,t[5]=f);let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p={id:T4,position:Vw.Bottom,style:{left:_9,width:12,height:12}},t[6]=p):p=t[6];let m;t[7]===u?m=t[8]:(m={target:!1,source:[p,{id:E4,position:Vw.Bottom,style:{left:v9,width:12,height:12,...u?{opacity:.45}:{}}}]},t[7]=u,t[8]=m);let h;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,X.jsx)(`div`,{className:`pointer-events-none absolute -bottom-8 -translate-x-1/2 rounded-sm border bg-card px-1.5 py-0.5 text-xs text-muted-foreground leading-none`,style:{left:_9},children:`Started`}),t[9]=h):h=t[9];let g=u&&`opacity-50`,_;t[10]===g?_=t[11]:(_=Kv(`pointer-events-none absolute -bottom-8 -translate-x-1/2 rounded-sm border bg-card px-1.5 py-0.5 text-xs text-muted-foreground leading-none`,g),t[10]=g,t[11]=_);let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v={left:v9},t[12]=v):v=t[12];let y;t[13]===_?y=t[14]:(y=(0,X.jsx)(`div`,{className:_,style:v,children:`Canceled`}),t[13]=_,t[14]=y);let b;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,X.jsx)(vy,{className:`size-12 text-node-lifecycle`,strokeWidth:1.5}),t[15]=b):b=t[15];let x;t[16]===i?x=t[17]:(x=(0,X.jsx)(i9,{className:`text-base`,children:i}),t[16]=i,t[17]=x);let S;t[18]===a?S=t[19]:(S=a&&(0,X.jsx)(a9,{className:`text-xs`,children:a}),t[18]=a,t[19]=S);let C;t[20]===s?C=t[21]:(C=(0,X.jsx)(`p`,{className:`max-w-40 text-xs text-muted-foreground leading-tight`,children:s}),t[20]=s,t[21]=C);let w;t[22]!==x||t[23]!==S||t[24]!==C?(w=(0,X.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 p-6`,children:[b,(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-1 text-center`,children:[x,S,C]})]}),t[22]=x,t[23]=S,t[24]=C,t[25]=w):w=t[25];let T;return t[26]!==c||t[27]!==y||t[28]!==w||t[29]!==f||t[30]!==m?(T=(0,X.jsxs)(r9,{className:f,handles:m,status:c,children:[h,y,w]}),t[26]=c,t[27]=y,t[28]=w,t[29]=f,t[30]=m,t[31]=T):T=t[31],T});y9.displayName=`LifecycleNode`;function uye(e){let t=(0,Z.c)(59),{menuState:n,onClose:r}=e,i=_j(j4),a=vj(Y4),o=vj(X4),s=vj(K4),c=vj(R4),l=vj(s4),{open:u}=cZ(),d=tZ(),f=(0,Y.useRef)(null),p;t[0]!==a||t[1]!==n||t[2]!==r||t[3]!==u?(p=()=>{if(n?.nodeId){let e=n.nodeId;r(),u(qZ,{title:`Delete Step`,message:`Are you sure you want to delete this node? This action cannot be undone.`,confirmLabel:`Delete`,confirmVariant:`destructive`,onConfirm:()=>{a(e)}})}},t[0]=a,t[1]=n,t[2]=r,t[3]=u,t[4]=p):p=t[4];let m=p,h;t[5]!==d||t[6]!==n||t[7]!==r||t[8]!==u||t[9]!==l||t[10]!==c?(h=()=>{if(n?.nodeId){let e=n.nodeId;r(),c(e),l(`properties`),d&&u(P7,{})}},t[5]=d,t[6]=n,t[7]=r,t[8]=u,t[9]=l,t[10]=c,t[11]=h):h=t[11];let g=h,_;t[12]!==o||t[13]!==n||t[14]!==r||t[15]!==u?(_=()=>{if(n?.edgeId){let e=n.edgeId;r(),u(qZ,{title:`Delete Connection`,message:`Are you sure you want to delete this connection? This action cannot be undone.`,confirmLabel:`Delete`,confirmVariant:`destructive`,onConfirm:()=>{o(e)}})}},t[12]=o,t[13]=n,t[14]=r,t[15]=u,t[16]=_):_=t[16];let v=_,y;t[17]!==s||t[18]!==n||t[19]!==r||t[20]!==l||t[21]!==c?(y=()=>{if(n?.flowPosition){let e={id:Z8(),type:`action`,position:{x:n.flowPosition.x,y:n.flowPosition.y-96},data:{label:``,description:``,type:`action`,config:{},status:`idle`},selected:!0};s(e),c(e.id),l(`properties`)}r()},t[17]=s,t[18]=n,t[19]=r,t[20]=l,t[21]=c,t[22]=y):y=t[22];let b=y,x;t[23]===r?x=t[24]:(x=e=>{let t=e.target;f.current&&!(t instanceof globalThis.Node&&f.current.contains(t))&&r()},t[23]=r,t[24]=x);let S=x,C;t[25]===r?C=t[26]:(C=e=>{e.key===`Escape`&&r()},t[25]=r,t[26]=C);let w=C,T=n!==null,E;t[27]===T?E=t[28]:(E={deferAttach:!0,enabled:T},t[27]=T,t[28]=E),HX(document,`mousedown`,S,E);let D;t[29]===T?D=t[30]:(D={enabled:T},t[29]=T,t[30]=D),HX(document,`keydown`,w,D);let O;if(t[31]===T?O=t[32]:(O={enabled:T},t[31]=T,t[32]=O),HX(window,`resize`,r,O),!n)return null;let k;t[33]!==n.nodeId||t[34]!==i?(k=n.nodeId&&i.find(e=>e.id===n.nodeId)?.data.type===`lifecycle`,t[33]=n.nodeId,t[34]=i,t[35]=k):k=t[35];let A=!!k,j;t[36]!==n.nodeId||t[37]!==i?(j=()=>n.nodeId&&i.find(e=>e.id===n.nodeId)?.data.label||`Step`,t[36]=n.nodeId,t[37]=i,t[38]=j):j=t[38];let M=j,N;t[39]!==n.position.x||t[40]!==n.position.y?(N={left:n.position.x,top:n.position.y},t[39]=n.position.x,t[40]=n.position.y,t[41]=N):N=t[41];let P;t[42]!==M||t[43]!==m||t[44]!==g||t[45]!==A||t[46]!==n.type?(P=n.type===`node`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(b9,{icon:(0,X.jsx)(pte,{className:`size-4`}),label:`Edit ${M()}`,onClick:g}),(0,X.jsx)(b9,{disabled:A,icon:(0,X.jsx)(Cy,{className:`size-4`}),label:`Delete ${M()}`,onClick:m,variant:`destructive`})]}),t[42]=M,t[43]=m,t[44]=g,t[45]=A,t[46]=n.type,t[47]=P):P=t[47];let F;t[48]!==v||t[49]!==n.type?(F=n.type===`edge`&&(0,X.jsx)(b9,{icon:(0,X.jsx)(tte,{className:`size-4`}),label:`Delete Connection`,onClick:v,variant:`destructive`}),t[48]=v,t[49]=n.type,t[50]=F):F=t[50];let I;t[51]!==b||t[52]!==n.type?(I=n.type===`pane`&&(0,X.jsx)(b9,{icon:(0,X.jsx)(yy,{className:`size-4`}),label:`Add Step`,onClick:b}),t[51]=b,t[52]=n.type,t[53]=I):I=t[53];let L;return t[54]!==N||t[55]!==P||t[56]!==F||t[57]!==I?(L=(0,X.jsxs)(`div`,{className:`fade-in-0 zoom-in-95 fixed z-50 min-w-[8rem] animate-in overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md`,ref:f,style:N,children:[P,F,I]}),t[54]=N,t[55]=P,t[56]=F,t[57]=I,t[58]=L):L=t[58],L}function b9(e){let t=(0,Z.c)(9),{icon:n,label:r,onClick:i,variant:a,disabled:o}=e,s=(a===void 0?`default`:a)===`destructive`&&`text-destructive hover:bg-destructive/10 hover:text-destructive focus:bg-destructive/10 focus:text-destructive`,c=o&&`pointer-events-none opacity-50`,l;t[0]!==s||t[1]!==c?(l=Kv(`relative flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none`,`hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground`,s,c),t[0]=s,t[1]=c,t[2]=l):l=t[2];let u;return t[3]!==o||t[4]!==n||t[5]!==r||t[6]!==i||t[7]!==l?(u=(0,X.jsxs)(`button`,{className:l,disabled:o,onClick:i,type:`button`,children:[n,r]}),t[3]=o,t[4]=n,t[5]=r,t[6]=i,t[7]=l,t[8]=u):u=t[8],u}function dye(e,t){let n=(0,Z.c)(11),r;n[0]===t?r=n[1]:(r=(e,n)=>{e.preventDefault(),t({type:`node`,position:{x:e.clientX,y:e.clientY},nodeId:n.id})},n[0]=t,n[1]=r);let i=r,a;n[2]===t?a=n[3]:(a=(e,n)=>{e.preventDefault(),t({type:`edge`,position:{x:e.clientX,y:e.clientY},edgeId:n.id})},n[2]=t,n[3]=a);let o=a,s;n[4]!==e||n[5]!==t?(s=n=>{n.preventDefault();let r=e({x:n.clientX,y:n.clientY});t({type:`pane`,position:{x:n.clientX,y:n.clientY},flowPosition:r})},n[4]=e,n[5]=t,n[6]=s):s=n[6];let c=s,l;return n[7]!==o||n[8]!==i||n[9]!==c?(l={onNodeContextMenu:i,onEdgeContextMenu:o,onPaneContextMenu:c},n[7]=o,n[8]=i,n[9]=c,n[10]=l):l=n[10],l}var x9=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),S9=x9((e,t)=>{var n=Object.defineProperty,r=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,i=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),a=(e,t,n)=>r(e,typeof t==`symbol`?t:t+``,n),o=i((e,t)=>{var n=class{constructor(e){a(this,`_isDirected`,!0),a(this,`_isMultigraph`,!1),a(this,`_isCompound`,!1),a(this,`_label`),a(this,`_defaultNodeLabelFn`,()=>{}),a(this,`_defaultEdgeLabelFn`,()=>{}),a(this,`_nodes`,{}),a(this,`_in`,{}),a(this,`_preds`,{}),a(this,`_out`,{}),a(this,`_sucs`,{}),a(this,`_edgeObjs`,{}),a(this,`_edgeLabels`,{}),a(this,`_nodeCount`,0),a(this,`_edgeCount`,0),a(this,`_parent`),a(this,`_children`),e&&(this._isDirected=!Object.hasOwn(e,`directed`)||e.directed,this._isMultigraph=Object.hasOwn(e,`multigraph`)?e.multigraph:!1,this._isCompound=Object.hasOwn(e,`compound`)?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,typeof e!=`function`&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>Object.keys(e._in[t]).length===0)}sinks(){var e=this;return this.nodes().filter(t=>Object.keys(e._out[t]).length===0)}setNodes(e,t){var n=arguments,r=this;return e.forEach(function(e){n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var n=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(var n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){var t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){let r=new Set(t);for(var n of this.successors(e))r.add(n);return Array.from(r.values())}}isLeaf(e){var t;return t=this.isDirected()?this.successors(e):this.neighbors(e),t.length===0}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach(function([n,r]){e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var r={};function i(e){var a=n.parent(e);return a===void 0||t.hasNode(a)?(r[e]=a,a):a in r?r[a]:i(a)}return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,i(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,typeof e!=`function`&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var n=this,r=arguments;return e.reduce(function(e,i){return r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i}),this}setEdge(){var e,t,n,i,a=!1,c=arguments[0];typeof c==`object`&&c&&`v`in c?(e=c.v,t=c.w,n=c.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=c,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=``+e,t=``+t,n!==void 0&&(n=``+n);var l=o(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,l))return a&&(this._edgeLabels[l]=i),this;if(n!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(e),this.setNode(t),this._edgeLabels[l]=a?i:this._defaultEdgeLabelFn(e,t,n);var u=s(this._isDirected,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[l]=u,r(this._preds[t],e),r(this._sucs[e],t),this._in[t][l]=u,this._out[e][l]=u,this._edgeCount++,this}edge(e,t,n){var r=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(){let e=this.edge(...arguments);return typeof e==`object`?e:{label:e}}hasEdge(e,t,n){var r=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,e,t,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(e,t,n){var r=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,e,t,n),a=this._edgeObjs[r];return a&&(e=a.v,t=a.w,delete this._edgeLabels[r],delete this._edgeObjs[r],i(this._preds[t],e),i(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}filterEdges(e,t,n){if(e){var r=Object.values(e);return n?r.filter(function(e){return e.v===t&&e.w===n||e.v===n&&e.w===t}):r}}};function r(e,t){e[t]?e[t]++:e[t]=1}function i(e,t){--e[t]||delete e[t]}function o(e,t,n,r){var i=``+t,a=``+n;if(!e&&i>a){var o=i;i=a,a=o}return i+``+a+``+(r===void 0?`\0`:r)}function s(e,t,n,r){var i=``+t,a=``+n;if(!e&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return r&&(s.name=r),s}function c(e,t){return o(e,t.v,t.w,t.name)}t.exports=n}),s=i((e,t)=>{t.exports=`3.0.2`}),c=i((e,t)=>{t.exports={Graph:o(),version:s()}}),l=i((e,t)=>{var n=o();t.exports={write:r,read:s};function r(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:i(e),edges:a(e)};return e.graph()!==void 0&&(t.value=structuredClone(e.graph())),t}function i(e){return e.nodes().map(function(t){var n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function a(e){return e.edges().map(function(t){var n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function s(e){var t=new n(e.options).setGraph(e.value);return e.nodes.forEach(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}),u=i((e,t)=>{t.exports=r;var n=()=>1;function r(e,t,r,a){return i(e,String(t),r||n,a||function(t){return e.outEdges(t)})}function i(e,t,n,r){var i={},a=!0,o=0,s=e.nodes(),c=function(e){var t=n(e);i[e.v].distance+t<i[e.w].distance&&(i[e.w]={distance:i[e.v].distance+t,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){var n=t.v===e?t.v:t.w;c({v:n,w:n===t.v?t.w:t.v})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0}});for(var u=s.length,d=1;d<u&&(a=!1,o++,l(),a);d++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}}),d=i((e,t)=>{t.exports=n;function n(e){var t={},n=[],r;function i(n){Object.hasOwn(t,n)||(t[n]=!0,r.push(n),e.successors(n).forEach(i),e.predecessors(n).forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}}),f=i((e,t)=>{t.exports=class{constructor(){a(this,`_arr`,[]),a(this,`_keyIndices`,{})}size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){var n=this._keyIndices;if(e=String(e),!Object.hasOwn(n,e)){var r=this._arr,i=r.length;return n[e]=i,r.push({key:e,priority:t}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw Error(`New priority is greater than current priority. Key: `+e+` Old: `+this._arr[n].priority+` New: `+t);this._arr[n].priority=t,this._decrease(n)}_heapify(e){var t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){for(var t=this._arr,n=t[e].priority,r;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){var n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}}}),p=i((e,t)=>{var n=f();t.exports=i;var r=()=>1;function i(e,t,n,i){return a(e,String(t),n||r,i||function(t){return e.outEdges(t)})}function a(e,t,r,i){var a={},o=new n,s,c,l=function(e){var t=e.v===s?e.w:e.v,n=a[t],i=r(e),l=c.distance+i;if(i<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+i);l<n.distance&&(n.distance=l,n.predecessor=s,o.decrease(t,l))};for(e.nodes().forEach(function(e){var n=e===t?0:1/0;a[e]={distance:n},o.add(e,n)});o.size()>0&&(s=o.removeMin(),c=a[s],c.distance!==1/0);)i(s).forEach(l);return a}}),m=i((e,t)=>{var n=p();t.exports=r;function r(e,t,r){return e.nodes().reduce(function(i,a){return i[a]=n(e,a,t,r),i},{})}}),h=i((e,t)=>{t.exports=n;function n(e,t,n){if(e[t].predecessor!==void 0)throw Error(`Invalid source vertex`);if(e[n].predecessor===void 0&&n!==t)throw Error(`Invalid destination vertex`);return{weight:e[n].distance,path:r(e,t,n)}}function r(e,t,n){for(var r=[],i=n;i!==t;)r.push(i),i=e[i].predecessor;return r.push(t),r.reverse()}}),g=i((e,t)=>{t.exports=n;function n(e){var t=0,n=[],r={},i=[];function a(o){var s=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).forEach(function(e){Object.hasOwn(r,e)?r[e].onStack&&(s.lowlink=Math.min(s.lowlink,r[e].index)):(a(e),s.lowlink=Math.min(s.lowlink,r[e].lowlink))}),s.lowlink===s.index){var c=[],l;do l=n.pop(),r[l].onStack=!1,c.push(l);while(o!==l);i.push(c)}}return e.nodes().forEach(function(e){Object.hasOwn(r,e)||a(e)}),i}}),_=i((e,t)=>{var n=g();t.exports=r;function r(e){return n(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}}),v=i((e,t)=>{t.exports=r;var n=()=>1;function r(e,t,r){return i(e,t||n,r||function(t){return e.outEdges(t)})}function i(e,t,n){var r={},i=e.nodes();return i.forEach(function(e){r[e]={},r[e][e]={distance:0},i.forEach(function(t){e!==t&&(r[e][t]={distance:1/0})}),n(e).forEach(function(n){var i=n.v===e?n.w:n.v,a=t(n);r[e][i]={distance:a,predecessor:e}})}),i.forEach(function(e){var t=r[e];i.forEach(function(n){var a=r[n];i.forEach(function(n){var r=a[e],i=t[n],o=a[n],s=r.distance+i.distance;s<o.distance&&(o.distance=s,o.predecessor=i.predecessor)})})}),r}}),y=i((e,t)=>{function n(e){var t={},n={},i=[];function a(o){if(Object.hasOwn(n,o))throw new r;Object.hasOwn(t,o)||(n[o]=!0,t[o]=!0,e.predecessors(o).forEach(a),delete n[o],i.push(o))}if(e.sinks().forEach(a),Object.keys(t).length!==e.nodeCount())throw new r;return i}var r=class extends Error{constructor(){super(...arguments)}};t.exports=n,n.CycleException=r}),b=i((e,t)=>{var n=y();t.exports=r;function r(e){try{n(e)}catch(e){if(e instanceof n.CycleException)return!1;throw e}return!0}}),x=i((e,t)=>{t.exports=n;function n(e,t,n,i,a){Array.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),s={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);a=r(e,t,n===`post`,s,o,i,a)}),a}function r(e,t,n,i,a,o,s){return Object.hasOwn(i,t)||(i[t]=!0,n||(s=o(s,t)),a(t).forEach(function(t){s=r(e,t,n,i,a,o,s)}),n&&(s=o(s,t))),s}}),S=i((e,t)=>{var n=x();t.exports=r;function r(e,t,r){return n(e,t,r,function(e,t){return e.push(t),e},[])}}),C=i((e,t)=>{var n=S();t.exports=r;function r(e,t){return n(e,t,`post`)}}),w=i((e,t)=>{var n=S();t.exports=r;function r(e,t){return n(e,t,`pre`)}}),T=i((e,t)=>{var n=o(),r=f();t.exports=i;function i(e,t){var i=new n,a={},o=new r,s;function c(e){var n=e.v===s?e.w:e.v,r=o.priority(n);if(r!==void 0){var i=t(e);i<r&&(a[n]=s,o.decrease(n,i))}}if(e.nodeCount()===0)return i;e.nodes().forEach(function(e){o.add(e,1/0),i.setNode(e)}),o.decrease(e.nodes()[0],0);for(var l=!1;o.size()>0;){if(s=o.removeMin(),Object.hasOwn(a,s))i.setEdge(s,a[s]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}e.nodeEdges(s).forEach(c)}return i}}),E=i((e,t)=>{var n=p(),r=u();t.exports=i;function i(e,t,n,r){return a(e,t,n,r||function(t){return e.outEdges(t)})}function a(e,t,i,a){if(i===void 0)return n(e,t,i,a);for(var o=!1,s=e.nodes(),c=0;c<s.length;c++){for(var l=a(s[c]),u=0;u<l.length;u++){var d=l[u],f=d.v===s[c]?d.v:d.w;i({v:f,w:f===d.v?d.w:d.v})<0&&(o=!0)}if(o)return r(e,t,i,a)}return n(e,t,i,a)}}),D=i((e,t)=>{t.exports={bellmanFord:u(),components:d(),dijkstra:p(),dijkstraAll:m(),extractPath:h(),findCycles:_(),floydWarshall:v(),isAcyclic:b(),postorder:C(),preorder:w(),prim:T(),shortestPaths:E(),reduce:x(),tarjan:g(),topsort:y()}}),O=c();t.exports={Graph:O.Graph,json:l(),alg:D(),version:O.version}}),fye=x9((e,t)=>{var n=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return r(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&r(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,i)),n=n._prev;return`[`+e.join(`, `)+`]`}};function r(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function i(e,t){if(e!==`_next`&&e!==`_prev`)return t}t.exports=n}),pye=x9((e,t)=>{var n=S9().Graph,r=fye();t.exports=a;var i=()=>1;function a(e,t){if(e.nodeCount()<=1)return[];let n=c(e,t||i);return o(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))}function o(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)s(e,t,n,o);for(;o=i.dequeue();)s(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i].dequeue(),o){r=r.concat(s(e,t,n,o,!0));break}}}return r}function s(e,t,n,r,i){let a=i?[]:void 0;return e.inEdges(r.v).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,l(t,n,s)}),e.outEdges(r.v).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,l(t,n,o)}),e.removeNode(r.v),a}function c(e,t){let i=new n,a=0,o=0;e.nodes().forEach(e=>{i.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let n=i.edge(e.v,e.w)||0,r=t(e),s=n+r;i.setEdge(e.v,e.w,s),o=Math.max(o,i.node(e.v).out+=r),a=Math.max(a,i.node(e.w).in+=r)});let s=u(o+a+3).map(()=>new r),c=a+1;return i.nodes().forEach(e=>{l(s,c,i.node(e))}),{graph:i,buckets:s,zeroIdx:c}}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function u(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}}),C9=x9((e,t)=>{var n=S9().Graph;t.exports={addBorderNode:f,addDummyNode:r,applyWithChunking:h,asNonCompoundGraph:a,buildLayerMatrix:l,intersectRect:c,mapValues:w,maxRank:g,normalizeRanks:u,notime:y,partition:_,pick:C,predecessorWeights:s,range:S,removeEmptyRanks:d,simplify:i,successorWeights:o,time:v,uniqueId:x,zipObject:T};function r(e,t,n,r){for(var i=r;e.hasNode(i);)i=x(r);return n.dummy=t,e.setNode(i,n),i}function i(e){let t=new n().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function a(e){let t=new n({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function o(e){let t=e.nodes().map(t=>{let n={};return e.outEdges(t).forEach(t=>{n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return T(e.nodes(),t)}function s(e){let t=e.nodes().map(t=>{let n={};return e.inEdges(t).forEach(t=>{n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return T(e.nodes(),t)}function c(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function l(e){let t=S(g(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i][r.order]=n)}),t}function u(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=h(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function d(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=h(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function f(e,t,n,i){let a={width:0,height:0};return arguments.length>=4&&(a.rank=n,a.order=i),r(e,`border`,a,t)}function p(e,t=m){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var m=65535;function h(e,t){if(t.length>m){let n=p(t);return e.apply(null,n.map(t=>e.apply(null,t)))}return e.apply(null,t)}function g(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return h(Math.max,t)}function _(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function v(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function y(e,t){return t()}var b=0;function x(e){return e+(``+ ++b)}function S(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function C(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function w(e,t){let n=t;return typeof t==`string`&&(n=e=>e[t]),Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function T(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}}),mye=x9((e,t)=>{var n=pye(),r=C9().uniqueId;t.exports={run:i,undo:o};function i(e){(e.graph().acyclicer===`greedy`?n(e,t(e)):a(e)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r(`rev`))});function t(e){return t=>e.edge(t).weight}}function a(e){let t=[],n={},r={};function i(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,e.outEdges(a).forEach(e=>{Object.hasOwn(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return e.nodes().forEach(i),t}function o(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}}),hye=x9((e,t)=>{var n=C9();t.exports={run:r,undo:a};function r(e){e.graph().dummyChains=[],e.edges().forEach(t=>i(e,t))}function i(e,t){let r=t.v,i=e.node(r).rank,a=t.w,o=e.node(a).rank,s=t.name,c=e.edge(t),l=c.labelRank;if(o===i+1)return;e.removeEdge(t);let u,d,f;for(f=0,++i;i<o;++f,++i)c.points=[],d={width:0,height:0,edgeLabel:c,edgeObj:t,rank:i},u=n.addDummyNode(e,`edge`,d,`_d`),i===l&&(d.width=c.width,d.height=c.height,d.dummy=`edge-label`,d.labelpos=c.labelpos),e.setEdge(r,u,{weight:c.weight},s),f===0&&e.graph().dummyChains.push(u),r=u;e.setEdge(r,a,{weight:c.weight},s)}function a(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}}),w9=x9((e,t)=>{var{applyWithChunking:n}=C9();t.exports={longestPath:r,slack:i};function r(e){var t={};function r(i){var a=e.node(i);if(Object.hasOwn(t,i))return a.rank;t[i]=!0;let o=e.outEdges(i).map(t=>t==null?1/0:r(t.w)-e.edge(t).minlen);var s=n(Math.min,o);return s===1/0&&(s=0),a.rank=s}e.sources().forEach(r)}function i(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}),T9=x9((e,t)=>{var n=S9().Graph,r=w9().slack;t.exports=i;function i(e){var t=new n({directed:!1}),i=e.nodes()[0],c=e.nodeCount();t.setNode(i,{});for(var l,u;a(t,e)<c;)l=o(t,e),u=t.hasNode(l.v)?r(e,l):-r(e,l),s(t,e,u);return t}function a(e,t){function n(i){t.nodeEdges(i).forEach(a=>{var o=a.v,s=i===o?a.w:o;!e.hasNode(s)&&!r(t,a)&&(e.setNode(s,{}),e.setEdge(i,s,{}),n(s))})}return e.nodes().forEach(n),e.nodeCount()}function o(e,t){return t.edges().reduce((n,i)=>{let a=1/0;return e.hasNode(i.v)!==e.hasNode(i.w)&&(a=r(t,i)),a<n[0]?[a,i]:n},[1/0,null])[1]}function s(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}}),gye=x9((e,t)=>{var n=T9(),r=w9().slack,i=w9().longestPath,a=S9().alg.preorder,o=S9().alg.postorder,s=C9().simplify;t.exports=c,c.initLowLimValues=f,c.initCutValues=l,c.calcCutValue=d,c.leaveEdge=m,c.enterEdge=h,c.exchangeEdges=g;function c(e){e=s(e),i(e);var t=n(e);f(t),l(t,e);for(var r,a;r=m(t);)a=h(t,e,r),g(t,e,r,a)}function l(e,t){var n=o(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>u(e,t,n))}function u(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=d(e,t,n)}function d(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,t.nodeEdges(n).forEach(a=>{var s=a.v===n,c=s?a.w:a.v;if(c!==r){var l=s===i,u=t.edge(a).weight;if(o+=l?u:-u,v(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function f(e,t){arguments.length<2&&(t=e.nodes()[0]),p(e,{},1,t)}function p(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,e.neighbors(r).forEach(i=>{Object.hasOwn(t,i)||(n=p(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function m(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function h(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var o=e.node(i),s=e.node(a),c=o,l=!1;return o.lim>s.lim&&(c=s,l=!0),t.edges().filter(t=>l===y(e,e.node(t.v),c)&&l!==y(e,e.node(t.w),c)).reduce((e,n)=>r(t,n)<r(t,e)?n:e)}function g(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),f(e),l(e,t),_(e,t)}function _(e,t){var n=a(e,e.nodes().find(e=>!t.node(e).parent));n=n.slice(1),n.forEach(n=>{var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function v(e,t,n){return e.hasEdge(t,n)}function y(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}}),_ye=x9((e,t)=>{var n=w9().longestPath,r=T9(),i=gye();t.exports=a;function a(e){var t=e.graph().ranker;if(t instanceof Function)return t(e);switch(e.graph().ranker){case`network-simplex`:c(e);break;case`tight-tree`:s(e);break;case`longest-path`:o(e);break;case`none`:break;default:c(e)}}var o=n;function s(e){n(e),r(e)}function c(e){i(e)}}),vye=x9((e,t)=>{t.exports=n;function n(e){let t=i(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),a=i.edgeObj,o=r(e,t,a.v,a.w),s=o.path,c=o.lca,l=0,u=s[l],d=!0;for(;n!==a.w;){if(i=e.node(n),d){for(;(u=s[l])!==c&&e.node(u).maxRank<i.rank;)l++;u===c&&(d=!1)}if(!d){for(;l<s.length-1&&e.node(u=s[l+1]).minRank<=i.rank;)l++;u=s[l]}e.setParent(n,u),n=e.successors(n)[0]}})}function r(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c,l;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function i(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children().forEach(r),t}}),yye=x9((e,t)=>{var n=C9();t.exports={run:r,cleanup:s};function r(e){let t=n.addDummyNode(e,`root`,{},`_root`),r=a(e),s=Object.values(r),c=n.applyWithChunking(Math.max,s)-1,l=2*c+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=l);let u=o(e)+1;e.children().forEach(n=>i(e,t,l,u,c,r,n)),e.graph().nodeRankFactor=l}function i(e,t,r,a,o,s,c){let l=e.children(c);if(!l.length){c!==t&&e.setEdge(t,c,{weight:0,minlen:r});return}let u=n.addBorderNode(e,`_bt`),d=n.addBorderNode(e,`_bb`),f=e.node(c);e.setParent(u,c),f.borderTop=u,e.setParent(d,c),f.borderBottom=d,l.forEach(n=>{i(e,t,r,a,o,s,n);let l=e.node(n),f=l.borderTop?l.borderTop:n,p=l.borderBottom?l.borderBottom:n,m=l.borderTop?a:2*a,h=f===p?o-s[c]+1:1;e.setEdge(u,f,{weight:m,minlen:h,nestingEdge:!0}),e.setEdge(p,d,{weight:m,minlen:h,nestingEdge:!0})}),e.parent(c)||e.setEdge(t,u,{weight:0,minlen:o+s[c]})}function a(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children().forEach(e=>n(e,1)),t}function o(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function s(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}),bye=x9((e,t)=>{var n=C9();t.exports=r;function r(e){function t(n){let r=e.children(n),a=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(a,`minRank`)){a.borderLeft=[],a.borderRight=[];for(let t=a.minRank,r=a.maxRank+1;t<r;++t)i(e,`borderLeft`,`_bl`,n,a,t),i(e,`borderRight`,`_br`,n,a,t)}}e.children().forEach(t)}function i(e,t,r,i,a,o){let s={width:0,height:0,rank:o,borderType:t},c=a[t][o-1],l=n.addDummyNode(e,`border`,s,r);a[t][o]=l,e.setParent(l,i),c&&e.setEdge(c,l,{weight:1})}}),xye=x9((e,t)=>{t.exports={adjust:n,undo:r};function n(e){let t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&i(e)}function r(e){let t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&o(e),(t===`lr`||t===`rl`)&&(c(e),i(e))}function i(e){e.nodes().forEach(t=>a(e.node(t))),e.edges().forEach(t=>a(e.edge(t)))}function a(e){let t=e.width;e.width=e.height,e.height=t}function o(e){e.nodes().forEach(t=>s(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(s),Object.hasOwn(n,`y`)&&s(n)})}function s(e){e.y=-e.y}function c(e){e.nodes().forEach(t=>l(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(l),Object.hasOwn(n,`x`)&&l(n)})}function l(e){let t=e.x;e.x=e.y,e.y=t}}),Sye=x9((e,t)=>{var n=C9();t.exports=r;function r(e){let t={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=n.applyWithChunking(Math.max,i),o=n.range(a+1).map(()=>[]);function s(n){if(t[n])return;t[n]=!0;let r=e.node(n);o[r.rank].push(n),e.successors(n).forEach(s)}return r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(s),o}}),Cye=x9((e,t)=>{var n=C9().zipObject;t.exports=r;function r(e,t){let n=0;for(let r=1;r<t.length;++r)n+=i(e,t[r-1],t[r]);return n}function i(e,t,r){let i=n(r,r.map((e,t)=>t)),a=t.flatMap(t=>e.outEdges(t).map(t=>({pos:i[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),o=1;for(;o<r.length;)o<<=1;let s=2*o-1;--o;let c=Array(s).fill(0),l=0;return a.forEach(e=>{let t=e.pos+o;c[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=c[t+1]),t=t-1>>1,c[t]+=e.weight;l+=e.weight*n}),l}}),wye=x9((e,t)=>{t.exports=n;function n(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(n.length){let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})}}),Tye=x9((e,t)=>{var n=C9();t.exports=r;function r(e,t){let n={};return e.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight)}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(n[e.w]))}),i(Object.values(n).filter(e=>!e.indegree))}function i(e){let t=[];function r(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&a(e,t)}}function i(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let n=e.pop();t.push(n),n.in.reverse().forEach(r(n)),n.out.forEach(i(n))}return t.filter(e=>!e.merged).map(e=>n.pick(e,[`vs`,`i`,`barycenter`,`weight`]))}function a(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}}),Eye=x9((e,t)=>{var n=C9();t.exports=r;function r(e,t){let r=n.partition(e,e=>Object.hasOwn(e,`barycenter`)),o=r.lhs,s=r.rhs.sort((e,t)=>t.i-e.i),c=[],l=0,u=0,d=0;o.sort(a(!!t)),d=i(c,s,d),o.forEach(e=>{d+=e.vs.length,c.push(e.vs),l+=e.barycenter*e.weight,u+=e.weight,d=i(c,s,d)});let f={vs:c.flat(!0)};return u&&(f.barycenter=l/u,f.weight=u),f}function i(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function a(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}),Dye=x9((e,t)=>{var n=wye(),r=Tye(),i=Eye();t.exports=a;function a(e,t,c,l){let u=e.children(t),d=e.node(t),f=d?d.borderLeft:void 0,p=d?d.borderRight:void 0,m={};f&&(u=u.filter(e=>e!==f&&e!==p));let h=n(e,u);h.forEach(t=>{if(e.children(t.v).length){let n=a(e,t.v,c,l);m[t.v]=n,Object.hasOwn(n,`barycenter`)&&s(t,n)}});let g=r(h,c);o(g,m);let _=i(g,l);if(f&&(_.vs=[f,_.vs,p].flat(!0),e.predecessors(f).length)){let t=e.node(e.predecessors(f)[0]),n=e.node(e.predecessors(p)[0]);Object.hasOwn(_,`barycenter`)||(_.barycenter=0,_.weight=0),_.barycenter=(_.barycenter*_.weight+t.order+n.order)/(_.weight+2),_.weight+=2}return _}function o(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function s(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}}),Oye=x9((e,t)=>{var n=S9().Graph,r=C9();t.exports=i;function i(e,t,r,i){i||=e.nodes();let o=a(e),s=new n({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(t=>e.node(t));return i.forEach(n=>{let i=e.node(n),a=e.parent(n);(i.rank===t||i.minRank<=t&&t<=i.maxRank)&&(s.setNode(n),s.setParent(n,a||o),e[r](n).forEach(t=>{let r=t.v===n?t.w:t.v,i=s.edge(r,n),a=i===void 0?0:i.weight;s.setEdge(r,n,{weight:e.edge(t).weight+a})}),Object.hasOwn(i,`minRank`)&&s.setNode(n,{borderLeft:i.borderLeft[t],borderRight:i.borderRight[t]}))}),s}function a(e){for(var t;e.hasNode(t=r.uniqueId(`_root`)););return t}}),kye=x9((e,t)=>{t.exports=n;function n(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}}),Aye=x9((e,t)=>{var n=Sye(),r=Cye(),i=Dye(),a=Oye(),o=kye(),s=S9().Graph,c=C9();t.exports=l;function l(e,t={}){if(typeof t.customOrder==`function`){t.customOrder(e,l);return}let i=c.maxRank(e),a=u(e,c.range(1,i+1),`inEdges`),o=u(e,c.range(i-1,-1,-1),`outEdges`),s=n(e);if(f(e,s),t.disableOptimalOrderHeuristic)return;let p=1/0,m,h=t.constraints||[];for(let t=0,n=0;n<4;++t,++n){d(t%2?a:o,t%4>=2,h),s=c.buildLayerMatrix(e);let i=r(e,s);i<p?(n=0,m=Object.assign({},s),p=i):i===p&&(m=structuredClone(s))}f(e,m)}function u(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return a(e,t,n,r.get(t)||[])})}function d(e,t,n){let r=new s;e.forEach(function(e){n.forEach(e=>r.setEdge(e.left,e.right));let a=e.graph().root,s=i(e,a,r,t);s.vs.forEach((t,n)=>e.node(t).order=n),o(e,r,s.vs)})}function f(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}}),jye=x9((e,t)=>{var n=S9().Graph,r=C9();t.exports={positionX:h,findType1Conflicts:i,findType2Conflicts:a,addConflict:s,hasConflict:c,verticalAlignment:l,horizontalCompaction:u,alignCoordinates:p,findSmallestWidthAlignment:f,balance:m};function i(e,t){let n={};function r(t,r){let i=0,a=0,c=t.length,l=r[r.length-1];return r.forEach((t,u)=>{let d=o(e,t),f=d?e.node(d).order:c;(d||t===l)&&(r.slice(a,u+1).forEach(t=>{e.predecessors(t).forEach(r=>{let a=e.node(r),o=a.order;(o<i||f<o)&&!(a.dummy&&e.node(t).dummy)&&s(n,r,t)})}),a=u+1,i=f)}),r}return t.length&&t.reduce(r),n}function a(e,t){let n={};function i(t,i,a,o,c){let l;r.range(i,a).forEach(r=>{l=t[r],e.node(l).dummy&&e.predecessors(l).forEach(t=>{let r=e.node(t);r.dummy&&(r.order<o||r.order>c)&&s(n,t,l)})})}function a(t,n){let r=-1,a,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);t.length&&(a=e.node(t[0]).order,i(n,o,c,r,a),o=c,r=a)}i(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(a),n}function o(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}function s(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function c(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&Object.hasOwn(e[t],n)}function l(e,t,n,r){let i={},a={},o={};return t.forEach(e=>{e.forEach((e,t)=>{i[e]=e,a[e]=e,o[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s.length){s=s.sort((e,t)=>o[e]-o[t]);let r=(s.length-1)/2;for(let l=Math.floor(r),u=Math.ceil(r);l<=u;++l){let r=s[l];a[e]===e&&t<o[r]&&!c(n,e,r)&&(a[r]=e,a[e]=i[e]=i[r],t=o[r])}}})}),{root:i,align:a}}function u(e,t,n,r,i){let a={},o=d(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){a[e]=o.inEdges(e).reduce((e,t)=>Math.max(e,a[t.v]+o.edge(t)),0)}function u(t){let n=o.outEdges(t).reduce((e,t)=>Math.min(e,a[t.w]-o.edge(t)),1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),Object.keys(r).forEach(e=>a[e]=a[n[e]]),a}function d(e,t,r,i){let a=new n,o=e.graph(),s=g(o.nodesep,o.edgesep,i);return t.forEach(t=>{let n;t.forEach(t=>{let i=r[t];if(a.setNode(i),n){var o=r[n],c=a.edge(o,i);a.setEdge(o,i,Math.max(s(e,t,n),c||0))}n=t})}),a}function f(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=_(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function p(e,t){let n=Object.values(t),i=r.applyWithChunking(Math.min,n),a=r.applyWithChunking(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(o=>{let s=n+o,c=e[s];if(c===t)return;let l=Object.values(c),u=i-r.applyWithChunking(Math.min,l);o!==`l`&&(u=a-r.applyWithChunking(Math.max,l)),u&&(e[s]=r.mapValues(c,e=>e+u))})})}function m(e,t){return r.mapValues(e.ul,(n,r)=>{if(t)return e[t.toLowerCase()][r];{let t=Object.values(e).map(e=>e[r]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}function h(e){let t=r.buildLayerMatrix(e),n=Object.assign(i(e,t),a(e,t)),o={},s;return[`u`,`d`].forEach(i=>{s=i===`u`?t:Object.values(t).reverse(),[`l`,`r`].forEach(t=>{t===`r`&&(s=s.map(e=>Object.values(e).reverse()));let a=(i===`u`?e.predecessors:e.successors).bind(e),c=l(e,s,n,a),d=u(e,s,c.root,c.align,t===`r`);t===`r`&&(d=r.mapValues(d,e=>-e)),o[i+t]=d})}),p(o,f(e,o)),m(o,e.graph().align)}function g(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2;break}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2;break}return l&&(c+=n?l:-l),l=0,c}}function _(e,t){return e.node(t).width}}),Mye=x9((e,t)=>{var n=C9(),r=jye().positionX;t.exports=i;function i(e){e=n.asNonCompoundGraph(e),a(e),Object.entries(r(e)).forEach(([t,n])=>e.node(t).x=n)}function a(e){let t=n.buildLayerMatrix(e),r=e.graph().ranksep,i=e.graph().rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}}),Nye=x9((e,t)=>{var n=mye(),r=hye(),i=_ye(),a=C9().normalizeRanks,o=vye(),s=C9().removeEmptyRanks,c=yye(),l=bye(),u=xye(),d=Aye(),f=Mye(),p=C9(),m=S9().Graph;t.exports=h;function h(e,t={}){let n=t.debugTiming?p.time:p.notime;return n(`layout`,()=>{let r=n(` buildLayoutGraph`,()=>E(e));return n(` runLayout`,()=>g(r,n,t)),n(` updateInputGraph`,()=>_(e,r)),r})}function g(e,t,m){t(` makeSpaceForEdgeLabels`,()=>D(e)),t(` removeSelfEdges`,()=>I(e)),t(` acyclic`,()=>n.run(e)),t(` nestingGraph.run`,()=>c.run(e)),t(` rank`,()=>i(p.asNonCompoundGraph(e))),t(` injectEdgeLabelProxies`,()=>O(e)),t(` removeEmptyRanks`,()=>s(e)),t(` nestingGraph.cleanup`,()=>c.cleanup(e)),t(` normalizeRanks`,()=>a(e)),t(` assignRankMinMax`,()=>k(e)),t(` removeEdgeLabelProxies`,()=>A(e)),t(` normalize.run`,()=>r.run(e)),t(` parentDummyChains`,()=>o(e)),t(` addBorderSegments`,()=>l(e)),t(` order`,()=>d(e,m)),t(` insertSelfEdges`,()=>L(e)),t(` adjustCoordinateSystem`,()=>u.adjust(e)),t(` position`,()=>f(e)),t(` positionSelfEdges`,()=>R(e)),t(` removeBorderNodes`,()=>F(e)),t(` normalize.undo`,()=>r.undo(e)),t(` fixupEdgeLabelCoords`,()=>N(e)),t(` undoCoordinateSystem`,()=>u.undo(e)),t(` translateGraph`,()=>j(e)),t(` assignNodeIntersects`,()=>M(e)),t(` reversePoints`,()=>P(e)),t(` acyclic.undo`,()=>n.undo(e))}function _(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var v=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],y={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`,rankalign:`center`},b=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],x=[`width`,`height`,`rank`],S={width:0,height:0},C=[`minlen`,`weight`,`width`,`height`,`labeloffset`],w={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},T=[`labelpos`];function E(e){let t=new m({multigraph:!0,compound:!0}),n=B(e.graph());return t.setGraph(Object.assign({},y,z(n,v),p.pick(n,b))),e.nodes().forEach(n=>{let r=z(B(e.node(n)),x);Object.keys(S).forEach(e=>{r[e]===void 0&&(r[e]=S[e])}),t.setNode(n,r),t.setParent(n,e.parent(n))}),e.edges().forEach(n=>{let r=B(e.edge(n));t.setEdge(n,Object.assign({},w,z(r,C),p.pick(r,T)))}),t}function D(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function O(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v),r={rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t};p.addDummyNode(e,`edge-proxy`,r,`_ep`)}})}function k(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function A(e){e.nodes().forEach(t=>{let n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function j(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function M(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(p.intersectRect(r,a)),n.points.push(p.intersectRect(i,o))})}function N(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset;break}})}function P(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function F(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function I(e){e.edges().forEach(t=>{if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function L(e){p.buildLayerMatrix(e).forEach(t=>{var n=0;t.forEach((t,r)=>{var i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach(t=>{p.addDummyNode(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function R(e){e.nodes().forEach(t=>{var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function z(e,t){return p.mapValues(p.pick(e,t),Number)}function B(e){var t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}}),Pye=x9((e,t)=>{var n=C9(),r=S9().Graph;t.exports={debugOrdering:i};function i(e){let t=n.buildLayerMatrix(e),i=new r({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{i.setNode(t,{label:t}),i.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>i.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let n=`layer`+t;i.setNode(n,{rank:`same`}),e.reduce((e,t)=>(i.setEdge(e,t,{style:`invis`}),t))}),i}}),Fye=x9((e,t)=>{t.exports=`2.0.4`}),E9=x9((e,t)=>{t.exports={graphlib:S9(),layout:Nye(),debug:Pye(),util:{time:C9().time,notime:C9().notime},version:Fye()}})();function Iye(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function Lye(){return this.eachAfter(Iye)}function Rye(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function zye(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function Bye(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function Vye(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function Hye(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function Uye(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Wye(e){for(var t=this,n=Gye(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function Gye(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function Kye(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function qye(){return Array.from(this)}function Jye(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Yye(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Xye(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function D9(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=$ye)):t===void 0&&(t=Qye);for(var n=new O9(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new O9(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(tbe)}function Zye(){return D9(this).eachBefore(ebe)}function Qye(e){return e.children}function $ye(e){return Array.isArray(e)?e[1]:null}function ebe(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function tbe(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function O9(e){this.data=e,this.depth=this.height=0,this.parent=null}O9.prototype=D9.prototype={constructor:O9,count:Lye,each:Rye,eachAfter:Bye,eachBefore:zye,find:Vye,sum:Hye,sort:Uye,path:Wye,ancestors:Kye,descendants:qye,leaves:Jye,links:Yye,copy:Zye,[Symbol.iterator]:Xye};function nbe(e,t){return e.parent===t.parent?1:2}function k9(e){var t=e.children;return t?t[0]:e.t}function A9(e){var t=e.children;return t?t[t.length-1]:e.t}function rbe(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function ibe(e){for(var t=0,n=0,r=e.children,i=r.length,a;--i>=0;)a=r[i],a.z+=t,a.m+=t,t+=a.s+(n+=a.c)}function abe(e,t,n){return e.a.parent===t.parent?e.a:n}function j9(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}j9.prototype=Object.create(O9.prototype);function obe(e){for(var t=new j9(e,0),n,r=[t],i,a,o,s;n=r.pop();)if(a=n._.children)for(n.children=Array(s=a.length),o=s-1;o>=0;--o)r.push(i=n.children[o]=new j9(a[o],o)),i.parent=n;return(t.parent=new j9(null,0)).children=[t],t}function sbe(){var e=nbe,t=1,n=1,r=null;function i(i){var s=obe(i);if(s.eachAfter(a),s.parent.m=-s.z,s.eachBefore(o),r)i.eachBefore(c);else{var l=i,u=i,d=i;i.eachBefore(function(e){e.x<l.x&&(l=e),e.x>u.x&&(u=e),e.depth>d.depth&&(d=e)});var f=l===u?1:e(l,u)/2,p=f-l.x,m=t/(u.x+f+p),h=n/(d.depth||1);i.eachBefore(function(e){e.x=(e.x+p)*m,e.y=e.depth*h})}return i}function a(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n){ibe(t);var a=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=s(t,i,t.parent.A||r[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(t,n,r){if(n){for(var i=t,a=t,o=n,s=i.parent.children[0],c=i.m,l=a.m,u=o.m,d=s.m,f;o=A9(o),i=k9(i),o&&i;)s=k9(s),a=A9(a),a.a=t,f=o.z+u-i.z-c+e(o._,i._),f>0&&(rbe(abe(o,t,r),t,f),c+=f,l+=f),u+=o.m,c+=i.m,d+=s.m,l+=a.m;o&&!A9(a)&&(a.t=o,a.m+=u-l),i&&!k9(s)&&(s.t=i,s.m+=c-d,r=t)}return r}function c(e){e.x*=t,e.y=e.depth*n}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i}var cbe=`TB`,lbe=132,ube=118,M9=40,N9=`__workflow-root__`;function P9(e,t){return e.x!==t.x||e.y!==t.y}function dbe(e){return e.sourceHandle===`true`?4:e.sourceHandle===`false`?3:c8(e.sourceHandle)?4:6}function fbe(e){return typeof e==`number`&&Number.isFinite(e)&&e<1024?{nodeSpacing:96,rankSpacing:96}:{nodeSpacing:lbe,rankSpacing:ube}}function pbe(e,t){let n=e.node(t);return n?.x===void 0||n.y===void 0?null:{x:n.x,y:n.y}}var mbe=new Map([[`true`,0],[`false`,1],[T4,0],[E4,1]]),hbe=2**53-1;function gbe(e){if(!l8(e.node))return{width:192,handleRanks:mbe};let t=p8({targetNodeId:e.node.id,nodes:e.nodes,edges:e.edges,catalog:e.catalog});return{width:z7(t.length),handleRanks:new Map(t.map((e,t)=>[s8(e.name),t]))}}function _be(e){let t=t=>e.ranks.get(t.sourceHandle??``)??hbe,n=t=>e.positionXById.get(t)??0;return e.edges.toSorted((e,r)=>{let i=t(e)-t(r);return i===0?n(e.target)-n(r.target):i})}function vbe(e){let t=new Map(e.nodes.map(e=>[e.id,e.position.x])),n=new Map(e.nodes.map(e=>[e.id,[]]));for(let t of e.edges)n.get(t.source)?.push(t);let r=new Map;for(let i of e.nodes){let a=gbe({node:i,nodes:e.nodes,edges:e.edges,catalog:e.catalog});r.set(i.id,a.width),n.set(i.id,_be({edges:n.get(i.id)??[],ranks:a.handleRanks,positionXById:t}))}return{nodes:e.nodes.toSorted((e,t)=>e.position.x-t.position.x),widthById:r,outEdgesBySource:n}}function ybe(e){let t=new E9.graphlib.Graph({directed:!0,multigraph:!1,compound:!1});t.setGraph({rankdir:cbe,nodesep:e.spacing.nodeSpacing,ranksep:e.spacing.rankSpacing,marginx:M9,marginy:M9}),t.setDefaultEdgeLabel(()=>({}));let n=t=>e.model.widthById.get(t)??192;for(let r of e.model.nodes)t.setNode(r.id,{width:n(r.id),height:192});for(let n of e.model.nodes)for(let r of e.model.outEdgesBySource.get(n.id)??[])t.setEdge(r.source,r.target,{weight:dbe(r)});E9.layout(t);let r=!1;return{nodes:e.nodes.map(e=>{let i=pbe(t,e.id);if(!i)return e;let a={x:Math.round(i.x-n(e.id)/2),y:Math.round(i.y-96)};return P9(e.position,a)?(r=!0,{...e,position:a}):e}),changed:r}}function bbe(e){let t=new Map(e.nodes.map(e=>[e.id,0]));for(let n of e.model.outEdgesBySource.values())for(let e of n)if(e.source===e.target||(t.set(e.target,(t.get(e.target)??0)+1),(t.get(e.target)??0)>1))return null;let n=e.model.nodes.filter(e=>(t.get(e.id)??0)===0);if(n.length===0)return null;let r=new Set,i=new Set;function a(t){if(i.has(t))return null;i.add(t),r.add(t);let n=e.model.outEdgesBySource.get(t)??[],o=[];for(let e of n){let t=a(e.target);if(!t)return null;o.push(t)}return i.delete(t),o.length===0?{id:t}:{id:t,children:o}}let o=[];for(let e of n){let t=a(e.id);if(!t)return null;o.push(t)}return r.size===e.nodes.length?{id:N9,children:o}:null}function xbe(e){let t=bbe({nodes:e.nodes,model:e.model});if(!t)return null;let n=t=>e.model.widthById.get(t)??192,r=D9(t,e=>e.children??[]),i=192+e.spacing.nodeSpacing;sbe().nodeSize([i,192+e.spacing.rankSpacing]).separation((t,r)=>{let a=t.parent===r.parent?e.spacing.nodeSpacing:e.spacing.nodeSpacing*2;return(n(t.data.id)/2+n(r.data.id)/2+a)/i})(r);let a=r.descendants().filter(e=>e.data.id!==N9);if(a.length===0)return{nodes:e.nodes,changed:!1};let o=new Map;for(let e of a){let t=e.x??0,r=e.y??0;o.set(e.data.id,{x:t-n(e.data.id)/2,y:r-96})}let s=Array.from(o.values()),c=Math.min(...s.map(e=>e.x)),l=Math.min(...s.map(e=>e.y)),u=!1;return{nodes:e.nodes.map(e=>{let t=o.get(e.id);if(!t)return e;let n={x:Math.round(t.x-c+M9),y:Math.round(t.y-l+M9)};return P9(e.position,n)?(u=!0,{...e,position:n}):e}),changed:u}}function Sbe(e){return e.type!==`add`}function Cbe(e){let t=e.nodes.filter(Sbe);if(t.length===0)return{nodes:e.nodes,changed:!1};let n=new Set(t.map(e=>e.id)),r=e.edges.filter(e=>n.has(e.source)&&n.has(e.target)),i=fbe(e.availableWidth),a=vbe({nodes:t,edges:r,catalog:e.catalog}),o=xbe({nodes:t,model:a,spacing:i})??ybe({nodes:t,model:a,spacing:i}),s=new Map(o.nodes.map(e=>[e.id,e])),c=!1;return{nodes:e.nodes.map(e=>{let t=s.get(e.id);return!t||!P9(e.position,t.position)?e:(c=!0,{...e,position:t.position})}),changed:c}}var wbe={animated:t9.Animated,temporary:t9.Temporary};function Tbe(){let e=ky(),t=_j(jle),n=_j(Mle),r=_j(F4),i=_j(U2),[a]=yj(c4),o=tZ(),{open:s}=cZ(),c=_j(ble),l=o?null:c,[u,d]=yj(l4),f=vj(zle),p=vj(Ble),m=vj(R4),h=vj(z4),g=vj(K4),_=vj(Hle),v=vj(Vle),y=vj(Rle),b=vj(Ile),x=vj(Q4),S=vj($4),C=vj(s4),{screenToFlowPosition:w,fitView:T,getViewport:E,setViewport:D}=jD(),O=(0,Y.useRef)(null),k=(0,Y.useRef)(null),A=(0,Y.useRef)(null),j=(0,Y.useRef)(!1),M=(0,Y.useRef)(!1),N=(0,Y.useRef)(null),P=(0,Y.useRef)(0),F=(0,Y.useRef)(!1),[I,L]=(0,Y.useState)(!1),[R,z]=(0,Y.useState)(!1),[B,V]=(0,Y.useState)(null),{onNodeContextMenu:H,onEdgeContextMenu:U,onPaneContextMenu:W}=dye(w,V),G=(0,Y.useCallback)(()=>{V(null)},[]),K=t.some(e=>e.type!==`add`),q=(0,Y.useMemo)(()=>t.filter(e=>e.type!==`add`).length,[t]),J=(0,Y.useRef)(!1);UX(u,()=>{if(!u||J.current||(J.current=!0,document.cookie.split(`; `).find(e=>e.startsWith(`sidebar-collapsed=`))?.split(`=`)[1]===`true`))return;let e=E(),t=window.innerWidth*.3/2;D({...e,x:e.x-t},{duration:0})}),WX(i,()=>{if(u&&M.current){L(!0),d(!1);return}T({maxZoom:1,minZoom:.5,padding:.2,duration:0}),M.current=!0,L(!0),d(!1)}),WX(!i&&K,()=>{i||!K||(T({maxZoom:1,minZoom:.5,padding:.2,duration:0}),M.current=!0,L(!0))});let ee=(0,Y.useCallback)(e=>{if(!(e.metaKey||e.ctrlKey)||e.key.toLowerCase()!==`z`)return;let t=e.target;t instanceof HTMLElement&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||r||(e.preventDefault(),e.shiftKey?S():x())},[x,S,r]);HX(window,`keydown`,ee);let te=(0,Y.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&e.key===`/`&&(e.preventDefault(),T({padding:.2,duration:300}))},[T]);HX(window,`keydown`,te);let ne=(0,Y.useCallback)(()=>{if(r||q<2||F.current)return;F.current=!0,z(!0);let i=P.current+1;P.current=i;try{let r=N.current?.getBoundingClientRect().width??(typeof window<`u`?window.innerWidth:void 0),{nodes:a,changed:o}=Cbe({nodes:t,edges:n,availableWidth:r,catalog:e});if(i!==P.current)return;o&&_(a),window.requestAnimationFrame(()=>{Promise.resolve(T({maxZoom:1,minZoom:.5,padding:.2,duration:300})).catch(()=>void 0)})}finally{i===P.current&&(F.current=!1,z(!1))}},[_,n,T,r,t,q,e]),re=(0,Y.useMemo)(()=>({lifecycle:y9,action:g9,add:cye}),[]),ie=(0,Y.useCallback)((e,n)=>{let r=t.find(t=>t.id===e);return!r||r.type===`add`?!1:n!==`target`||r.type!==`lifecycle`},[t]),ae=(0,Y.useCallback)(e=>{let t=e.source,r=e.target;if(!(t&&r)||t===r)return!1;let i=`id`in e&&typeof e.id==`string`?e.id:null;return!n.find(e=>e.target===r&&e.id!==i)},[n]),oe=(0,Y.useCallback)((r,i)=>Eve({nodes:t,edges:n,sourceNodeId:r,sourceHandle:i,catalog:e}),[t,n,e]),se=(0,Y.useCallback)(e=>{if(!(e.source&&e.target)||!ae(e))return;let t=oe(e.source,e.sourceHandle),n={id:Z8(),...e,sourceHandle:t,type:`animated`};v(n)},[oe,ae,v]),ce=(0,Y.useCallback)(({nodes:e,edges:t})=>e.some(e=>e.data.type!==`lifecycle`)||t.length>0?(b(),Promise.resolve(!0)):Promise.resolve(!1),[b]),le=(0,Y.useCallback)((e,t)=>{m(t.id),C(`properties`),o&&s(P7,{})},[m,C,o,s]),ue=(0,Y.useCallback)((e,t)=>{O.current=t.nodeId,k.current=t.handleType,A.current=t.handleId??null},[]),de=(0,Y.useCallback)(e=>({clientX:`changedTouches`in e?e.changedTouches[0].clientX:e.clientX,clientY:`changedTouches`in e?e.changedTouches[0].clientY:e.clientY}),[]),fe=(0,Y.useCallback)((e,t,n)=>{let r=(e.target instanceof Element?e.target:void 0)?.closest(`.react-flow`)?.getBoundingClientRect();return{adjustedX:r?t-r.left:t,adjustedY:r?n-r.top:n}},[]),pe=(0,Y.useCallback)(e=>{let t=e.getAttribute(`data-id`),n=k.current===`source`,r=n?`target`:`source`,i=O.current;if(t&&i&&t!==i&&ie(t,r)){let e=n?i:t,r=n?t:i,a=oe(e,n?A.current:null),o=n?null:A.current;se({source:e,target:r,sourceHandle:a,targetHandle:o})}},[ie,oe,se]),me=(0,Y.useCallback)((e,t,n)=>{let r=O.current;if(!r)return;let i=k.current===`source`;if(!(i||ae({source:`__new_node__`,target:r,sourceHandle:null,targetHandle:null})))return;let{adjustedX:a,adjustedY:o}=fe(e,t,n),s=w({x:a,y:o});s.y-=96;let c={id:Z8(),type:`action`,position:s,data:{label:``,description:``,type:`action`,config:{},status:`idle`},selected:!0};g(c),m(c.id),C(`properties`),setTimeout(()=>{y(c.id)},50);let l=i?r:c.id,u=i?c.id:r,d=oe(l,i?A.current:null),f=i?null:A.current;se({source:l,target:u,sourceHandle:d,targetHandle:f}),j.current=!0,setTimeout(()=>{j.current=!1},100)},[fe,w,g,y,m,C,oe,se,ae]),he=(0,Y.useCallback)(e=>{if(!O.current)return;let{clientX:t,clientY:n}=de(e),r;if(r=`changedTouches`in e?document.elementFromPoint(t,n):e.target instanceof Element?e.target:null,!r){O.current=null,k.current=null,A.current=null;return}let i=r.closest(`.react-flow__node`),a=r.closest(`.react-flow__handle`);if(i&&!a&&k.current){pe(i),O.current=null,k.current=null,A.current=null;return}i||a||me(e,t,n),O.current=null,k.current=null,A.current=null},[de,pe,me]),ge=(0,Y.useCallback)(()=>{j.current||(m(null),h(null),G())},[m,h,G]),_e=(0,Y.useCallback)(({nodes:e})=>{j.current&&e.length===0||(e.length===0?m(null):e.length===1&&m(e[0].id))},[m]);return(0,X.jsxs)(`div`,{className:`relative h-full bg-background`,"data-testid":`workflow-canvas`,ref:N,style:{opacity:+!!I,width:l?`calc(100% - ${l})`:`100%`,transition:`opacity 300ms`},children:[(0,X.jsx)(`div`,{className:`pointer-events-auto`,children:(0,X.jsx)(vve,{workflowId:i??void 0})}),(0,X.jsxs)(a_e,{className:`bg-background`,connectionLineComponent:o_e,connectionMode:Fw.Strict,edges:n,edgeTypes:wbe,elementsSelectable:!r,isValidConnection:ae,nodes:t,nodesConnectable:!r,nodesDraggable:!r,nodeTypes:re,onBeforeDelete:ce,onConnect:r?void 0:se,onConnectEnd:r?void 0:he,onConnectStart:r?void 0:ue,onEdgeContextMenu:r?void 0:U,onEdgesChange:r?void 0:p,onNodeClick:r?void 0:le,onNodeContextMenu:r?void 0:H,onNodesChange:r?void 0:f,onPaneClick:ge,onPaneContextMenu:r?void 0:W,onSelectionChange:r?void 0:_e,children:[(0,X.jsx)(Cve,{className:`workflow-controls-panel border-none bg-transparent p-0`,position:`bottom-left`,children:(0,X.jsx)(c_e,{canReflow:!r&&q>1&&!R,onReflow:r?void 0:ne})}),a&&(0,X.jsx)(yA,{bgColor:`var(--sidebar)`,className:`rounded-lg border shadow-sm`,maskColor:`color-mix(in oklch, var(--muted) 60%, transparent)`,nodeColor:`var(--muted-foreground)`,nodeStrokeColor:`var(--border)`})]}),(0,X.jsx)(uye,{menuState:B,onClose:G})]})}var Ebe=/^\/workflows\/[^/]+$/;function Dbe(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={select:Obe},e[0]=t):t=e[0];let n=za(t);if(!Ebe.test(n))return null;let r;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(`div`,{className:`fixed inset-0 z-0`,children:(0,X.jsx)(Tbe,{})}),e[1]=r):r=e[1],r}function Obe(e){return e.location.pathname}var F9=oj(),I9=`The workflow could not be loaded. Try again.`;function kbe(e){return e instanceof x2&&e.status===404?{notFound:!0,message:null}:{notFound:!1,message:I9}}function Abe(e){return e?`runs`:`properties`}var jbe=ma(`/workflows/$workflowId`);function Mbe(){let e=(0,Z.c)(19),t=_j(U2),[n,r]=yj(y4),i=vj(A4),a=vj(qle),{executionId:o}=jbe.useSearch(),s;e[0]===o?s=e[1]:(s=O2.workflow.getExecutionLogs.queryOptions({input:{executionId:o??``},select:xge}),e[0]=o,e[1]=s);let c=o!==void 0,l;e[2]!==s||e[3]!==c?(l={...s,enabled:c,staleTime:0},e[2]=s,e[3]=c,e[4]=l):l=e[4];let u=Xe(l),d=u.data?.workflowVersionId,f;e[5]===d?f=e[6]:(f=O2.workflow.getVersionGraph.queryOptions({input:{versionId:d??``},select:Pbe}),e[5]=d,e[6]=f);let p=d!==void 0,m;e[7]!==f||e[8]!==p?(m={...f,enabled:p,staleTime:1/0},e[7]=f,e[8]=p,e[9]=m):m=e[9];let h=Xe(m),g=u.data,_=h.data,v=g!==void 0&&_!==void 0&&g.workflowId===t,y;e[10]!==t||e[11]!==g||e[12]!==o||e[13]!==_||e[14]!==a||e[15]!==n||e[16]!==i||e[17]!==r?(y=()=>{if(o===void 0){r(null),i(null);return}if(n!==o&&a(),r(o),g===void 0||_===void 0||g.workflowId!==t){i(null);return}let e=_2(_);i({nodes:e.nodes.map(Nbe),edges:e.edges.map(y2)})},e[10]=t,e[11]=g,e[12]=o,e[13]=_,e[14]=a,e[15]=n,e[16]=i,e[17]=r,e[18]=y):y=e[18],UX(o===void 0?`closed`:v?`ready:${o}:${t}`:`open:${o}:${t??``}`,y)}function Nbe(e){return{...v2(e),selected:!1}}function Pbe(e){return e.graph}function Fbe(){return Mbe(),null}function Ibe(e){return TX(`alert-dialog`,e)}function L9(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(Ibe,{"data-slot":`alert-dialog`,...n}),t[2]=n,t[3]=r),r}function Lbe(e){let t=(0,Z.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(cX,{"data-slot":`alert-dialog-portal`,...n}),t[2]=n,t[3]=r),r}function Rbe(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`data-[starting-style]:fade-in-0 data-[ending-style]:fade-out-0 fixed inset-0 z-50 bg-foreground/50 data-[closed]:animate-out data-[open]:animate-in`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(jU,{className:i,"data-slot":`alert-dialog-overlay`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function R9(e){let t=(0,Z.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(Rbe,{}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=Kv(`data-[starting-style]:fade-in-0 data-[starting-style]:zoom-in-95 data-[ending-style]:fade-out-0 data-[ending-style]:zoom-out-95 grid w-full max-w-lg gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[closed]:animate-out data-[open]:animate-in`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a?(o=(0,X.jsxs)(Lbe,{children:[i,(0,X.jsx)(DX,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,children:(0,X.jsx)(aX,{className:a,"data-slot":`alert-dialog-content`,...r})})]}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function z9(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`flex flex-col gap-2 text-center sm:text-left`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{className:i,"data-slot":`alert-dialog-header`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function B9(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{className:i,"data-slot":`alert-dialog-footer`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function V9(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`font-semibold text-lg`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(OX,{className:i,"data-slot":`alert-dialog-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function H9(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(`text-muted-foreground text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(oW,{className:i,"data-slot":`alert-dialog-description`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function U9(e){let t=(0,Z.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==i?(a=Kv(qv({variant:i}),n),t[4]=n,t[5]=i,t[6]=a):a=t[6];let o;return t[7]!==r||t[8]!==a?(o=(0,X.jsx)(eW,{className:a,...r}),t[7]=r,t[8]=a,t[9]=o):o=t[9],o}function W9(e){let t=(0,Z.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Kv(qv({variant:`outline`}),n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(eW,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function zbe(e){let t=(0,Z.c)(18),{open:n,onOpenChange:r,onConfirm:i,title:a,description:o,confirmLabel:s}=e,c=a===void 0?`Delete`:a,l=o===void 0?`Are you sure? This action cannot be undone.`:o,u=s===void 0?`Delete`:s,d;t[0]===c?d=t[1]:(d=(0,X.jsx)(V9,{children:c}),t[0]=c,t[1]=d);let f;t[2]===l?f=t[3]:(f=(0,X.jsx)(H9,{children:l}),t[2]=l,t[3]=f);let p;t[4]!==d||t[5]!==f?(p=(0,X.jsxs)(z9,{children:[d,f]}),t[4]=d,t[5]=f,t[6]=p):p=t[6];let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,X.jsx)(W9,{children:`Cancel`}),t[7]=m):m=t[7];let h;t[8]!==u||t[9]!==i?(h=(0,X.jsxs)(B9,{children:[m,(0,X.jsx)(U9,{onClick:i,variant:`destructive`,children:u})]}),t[8]=u,t[9]=i,t[10]=h):h=t[10];let g;t[11]!==p||t[12]!==h?(g=(0,X.jsxs)(R9,{children:[p,h]}),t[11]=p,t[12]=h,t[13]=g):g=t[13];let _;return t[14]!==r||t[15]!==n||t[16]!==g?(_=(0,X.jsx)(L9,{onOpenChange:r,open:n,children:g}),t[14]=r,t[15]=n,t[16]=g,t[17]=_):_=t[17],_}var Bbe=4;function Vbe(){let e=(0,Z.c)(11),[t,n]=(0,Y.useState)(null),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={confirm:n,tabs:`top`},e[0]=r):r=e[0];let i=r,a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(N7,{frame:i}),e[1]=a):a=e[1];let o=t?.confirmLabel,s=t?.message,c;e[2]===t?c=e[3]:(c=()=>t?.onConfirm(),e[2]=t,e[3]=c);let l;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=e=>{e||n(null)},e[4]=l):l=e[4];let u=t!==null,d=t?.title,f;return e[5]!==o||e[6]!==s||e[7]!==c||e[8]!==u||e[9]!==d?(f=(0,X.jsxs)(`aside`,{className:`flex size-full flex-col overflow-hidden bg-card`,children:[a,(0,X.jsx)(zbe,{confirmLabel:o,description:s,onConfirm:c,onOpenChange:l,open:u,title:d})]}),e[5]=o,e[6]=s,e[7]=c,e[8]=u,e[9]=d,e[10]=f):f=e[10],f}function Hbe(){let e=(0,Z.c)(24),t=tZ(),[n,r]=yj(d4),[i,a]=yj(p4),o=_j(R4),{open:s,hasOverlays:c}=cZ(),l;e[0]!==c||e[1]!==t||e[2]!==s||e[3]!==o?(l=()=>{t&&o&&!c&&s(P7,{})},e[0]=c,e[1]=t,e[2]=s,e[3]=o,e[4]=l):l=e[4],UX(t,l);let[u,d]=(0,Y.useState)(!1),f=(0,Y.useRef)(!1),p;e[5]===r?p=e[6]:(p=e=>{(e.metaKey||e.ctrlKey)&&e.key===`b`&&(e.preventDefault(),r(Gbe))},e[5]=r,e[6]=p),HX(window,`keydown`,p);let m;e[7]!==r||e[8]!==a?(m=e=>{e.preventDefault(),f.current=!0,d(!0);let t=e.clientX,n=!1,i=e=>{if(!f.current||(Math.abs(e.clientX-t)>Bbe&&(n=!0),!n))return;let r=(window.innerWidth-e.clientX)/window.innerWidth*100;a(Math.min(50,Math.max(20,r)))},o=()=>{f.current=!1,d(!1),document.removeEventListener(`pointermove`,i),document.removeEventListener(`pointerup`,o),document.removeEventListener(`pointercancel`,o),document.body.style.cursor=``,document.body.style.userSelect=``,n||r(Wbe)};document.addEventListener(`pointermove`,i),document.addEventListener(`pointerup`,o),document.addEventListener(`pointercancel`,o),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},e[7]=r,e[8]=a,e[9]=m):m=e[9];let h=m,g;e[10]!==t||e[11]!==n||e[12]!==r?(g=!t&&n&&(0,X.jsx)(`button`,{className:`pointer-events-auto absolute top-1/2 right-0 z-20 flex size-6 -translate-y-1/2 items-center justify-center rounded-l-full border border-r-0 bg-background shadow-sm transition-colors hover:bg-muted`,onClick:()=>{r(!1)},type:`button`,children:(0,X.jsx)(oy,{className:`size-4`})}),e[10]=t,e[11]=n,e[12]=r,e[13]=g):g=e[13];let _;e[14]!==h||e[15]!==u||e[16]!==t||e[17]!==n||e[18]!==i||e[19]!==r?(_=!t&&(0,X.jsxs)(`div`,{className:`workflow-sidebar-panel pointer-events-auto absolute inset-y-0 right-0 z-20 border-l bg-sidebar transition-transform duration-200 ease-out`,style:{width:m4(i),transform:n?`translateX(100%)`:`translateX(0)`},children:[(0,X.jsxs)(`div`,{"aria-label":`Resize properties panel. Click to collapse.`,"aria-orientation":`vertical`,"aria-valuenow":i,className:`group absolute inset-y-0 left-0 z-10 w-3 cursor-col-resize`,onPointerDown:h,role:`separator`,tabIndex:0,children:[(0,X.jsx)(`div`,{className:`absolute inset-y-0 left-0 w-1 bg-transparent transition-colors group-hover:bg-ring group-active:bg-primary`}),!(u||n)&&(0,X.jsx)(`button`,{"aria-label":`Collapse panel`,className:`absolute top-1/2 left-0 flex size-6 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full border bg-background shadow-sm transition-opacity hover:bg-muted focus-visible:opacity-100 lg:opacity-0 lg:group-hover:opacity-100`,onClick:e=>{e.stopPropagation(),r(!0)},onPointerDown:Ube,type:`button`,children:(0,X.jsx)(sy,{className:`size-4`})})]}),(0,X.jsx)(Vbe,{})]}),e[14]=h,e[15]=u,e[16]=t,e[17]=n,e[18]=i,e[19]=r,e[20]=_):_=e[20];let v;return e[21]!==g||e[22]!==_?(v=(0,X.jsxs)(X.Fragment,{children:[g,_]}),e[21]=g,e[22]=_,e[23]=v):v=e[23],v}function Ube(e){return e.stopPropagation()}function Wbe(e){return!e}function Gbe(e){return!e}var Kbe=500,qbe=()=>{let e=(0,Z.c)(33),t=_j(g4),n=_j(Q2),r=_j(j4),i=_j(M4),[a]=yj(U2),[o]=yj(y4),s=_j(P4),c=vj(h4),l=vj(n4),u=vj(e3),d=_j(J2),f=_j(Y2),p;e[0]===n?p=e[1]:(p=()=>{n&&!Kce(n)&&Fy.error(n.message||`Failed to save workflow`)},e[0]=n,e[1]=p),UX(n,p);let m;e[2]!==a||e[3]!==i||e[4]!==t||e[5]!==r||e[6]!==l?(m=async()=>{if(!a||t)return;let e=await l({nodes:r,edges:i},{immediate:!0});e&&!e.ok&&Fy.error(e.error.message||`Failed to save workflow`)},e[2]=a,e[3]=i,e[4]=t,e[5]=r,e[6]=l,e[7]=m):m=e[7];let h=m,g;e[8]===h?g=e[9]:(g=e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),e.stopPropagation(),h())},e[8]=h,e[9]=g);let _=g,v;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(v={capture:!0},e[10]=v):v=e[10],HX(document,`keydown`,_,v);let y;e[11]===o?y=e[12]:(y=O2.workflow.getExecutionStatus.queryOptions({input:{executionId:o??``}}),e[11]=o,e[12]=y);let b=o!==null,x;e[13]!==y||e[14]!==b?(x={...y,enabled:b,staleTime:0,refetchIntervalInBackground:!1,refetchInterval:Jbe},e[13]=y,e[14]=b,e[15]=x):x=e[15];let S=Xe(x).data,C;e[16]===S?.nodeStatuses?C=e[17]:(C=S?.nodeStatuses.map(Ybe).join(`,`)??``,e[16]=S?.nodeStatuses,e[17]=C);let w=C,T;e[18]!==S||e[19]!==r||e[20]!==o||e[21]!==c||e[22]!==u?(T=()=>{if(!o){u(r.map(Xbe)),c(!1);return}S&&(u(S.nodeStatuses.map(Zbe)),c(h7(S.status)))},e[18]=S,e[19]=r,e[20]=o,e[21]=c,e[22]=u,e[23]=T):T=e[23],UX(o===null?`idle`:`${o}:${s}:${S===void 0?`loading`:`${S.status}:${w}`}`,T);let E;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,X.jsx)(Fbe,{}),e[24]=E):E=e[24];let D;e[25]===d?D=e[26]:(D=d&&(0,X.jsx)(`div`,{className:`pointer-events-auto absolute inset-0 z-20 flex items-center justify-center`,children:(0,X.jsxs)(`div`,{className:`rounded-lg border bg-background p-8 text-center shadow-lg`,children:[(0,X.jsx)(`h1`,{className:`mb-2 font-semibold text-2xl`,children:`Workflow Not Found`}),(0,X.jsx)(`p`,{className:`mb-6 text-muted-foreground`,children:`The workflow you're looking for doesn't exist or has been deleted.`}),(0,X.jsx)(Jv,{render:(0,X.jsx)(fa,{to:`/`}),children:`Go to Dashboard`})]})}),e[25]=d,e[26]=D);let O;e[27]===f?O=e[28]:(O=f&&(0,X.jsx)(`div`,{className:`pointer-events-auto absolute inset-0 z-20 flex items-center justify-center`,children:(0,X.jsxs)(`div`,{className:`rounded-lg border bg-background p-8 text-center shadow-lg`,children:[(0,X.jsx)(`h1`,{className:`mb-2 font-semibold text-2xl`,children:`Couldn't Load Workflow`}),(0,X.jsx)(`p`,{className:`mb-6 text-muted-foreground`,children:f}),(0,X.jsx)(Jv,{onClick:Qbe,children:`Try Again`})]})}),e[27]=f,e[28]=O);let k;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,X.jsx)(Hbe,{}),e[29]=k):k=e[29];let A;return e[30]!==D||e[31]!==O?(A=(0,X.jsxs)(`div`,{className:`flex h-dvh w-full flex-col overflow-hidden`,children:[E,D,O,k]}),e[30]=D,e[31]=O,e[32]=A):A=e[32],A};function Jbe(e){return h7(e.state.data?.status)?Kbe:!1}function Ybe(e){return`${e.nodeId}=${e.status}`}function Xbe(e){return{nodeId:e.id,status:`idle`}}function Zbe(e){return{nodeId:e.nodeId,status:e.status===`pending`?`idle`:e.status}}function Qbe(){return window.location.reload()}var $be=Vy(`workflows`),G9=3,K9=[`running`,`waiting`,`failed`,`completed`,`canceled`,`pending`],exe=[...K9,`superseded`];function txe(e){if(!e)return`-`;let t=Number.parseInt(e,10);return Number.isNaN(t)?e:t<1e3?`${t}ms`:`${(t/1e3).toFixed(2)}s`}var nxe=100;function rxe(e){return e.toSorted(ixe)}function ixe(e,t){return new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()}function axe(e){return e===`pause`?`Paused`:e===`resume`?`Resumed`:`Deleted`}function q9(e,t,n){return e===1?t:n}function oxe(){let e=(0,Z.c)(165),t=Gi(),n=Fe(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,e[0]=r):r=e[0];let[i,a]=(0,Y.useState)(r),o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Set,e[1]=o):o=e[1];let[s,c]=(0,Y.useState)(o),[l,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(!1),[p,m]=(0,Y.useState)(0),[h,g]=(0,Y.useState)(``),[_,v]=(0,Y.useState)(null),y;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=O2.workflow.getAll.queryOptions({input:{},select:rxe,meta:{errorMessage:`Failed to load workflows`}}),e[2]=y):y=e[2];let{data:b,isPending:x}=Xe(y),S;e[3]===b?S=e[4]:(S=b===void 0?[]:b,e[3]=b,e[4]=S);let C=S,w;e[5]===C?w=e[6]:(w=C.filter(_xe),e[5]=C,e[6]=w);let T=w,E;e[7]===i?E=e[8]:(E=Array.from(i),e[7]=i,e[8]=E);let D=E,O;e[9]!==D||e[10]!==T?(O=D.filter(e=>T.some(t=>t.id===e&&t.isOwner!==!1)),e[9]=D,e[10]=T,e[11]=O):O=e[11];let k=O,A;e[12]!==i||e[13]!==T?(A=T.length>0&&T.every(e=>i.has(e.id)),e[12]=i,e[13]=T,e[14]=A):A=e[14];let j=A,M=l&&k.length>0,N;e[15]!==M||e[16]!==k||e[17]!==s?(N=Q$({workflowIds:M?k.toSorted():void 0,statuses:s.size>0?Array.from(s).toSorted():K9.toSorted(),limit:nxe},Z$),e[15]=M,e[16]=k,e[17]=s,e[18]=N):N=e[18];let P=N,F;e[19]===P?F=e[20]:(F=O2.workflow.getExecutionsGlobal.infiniteOptions({input:e=>({...P,cursor:e}),initialPageParam:void 0,getNextPageParam:gxe,meta:{errorMessage:`Failed to load workflow runs`}}),e[19]=P,e[20]=F);let I=Qe(F),L;e[21]===I.data?.pages?L=e[22]:(L=I.data?.pages.flatMap(hxe)??[],e[21]=I.data?.pages,e[22]=L);let R=L,z=I.isPending,B=I.isFetchingNextPage,V;e[23]===n?V=e[24]:(V=()=>A2(n),e[23]=n,e[24]=V);let H=V,U;e[25]===n?U=e[26]:(U=()=>M2(n),e[25]=n,e[26]=U);let W=U,G;e[27]===H?G=e[28]:(G=O2.workflow.update.mutationOptions({onSuccess:async(e,t)=>{let{mode:n}=t;await H(),Fy.success(n===`test`?`Switched workflow to Test mode`:`Switched workflow to Live mode`)},meta:{errorMessage:`Failed to switch workflow mode`}}),e[27]=H,e[28]=G);let K=Ze(G),q;e[29]===T?q=e[30]:(q=e=>{if(!e){a(new Set);return}a(new Set(T.map(mxe)))},e[29]=T,e[30]=q);let J=q,ee;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(e,t)=>{a(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},e[31]=ee):ee=e[31];let te=ee,ne;e[32]===Symbol.for(`react.memo_cache_sentinel`)?(ne=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},e[32]=ne):ne=e[32];let re=ne,ie;e[33]===n?ie=e[34]:(ie=O2.workflow.bulkLifecycle.mutationOptions({onSuccess:async(e,t)=>{let{action:r}=t;if(e.summary.failed===0?Fy.success(`${axe(r)} ${e.summary.succeeded} workflow${q9(e.summary.succeeded,``,`s`)}`):Fy.error(`${r} finished with ${e.summary.failed} failure${q9(e.summary.failed,``,`s`)}`),await A2(n),r!==`delete`)return;let i=new Set(e.results.filter(pxe).map(fxe));a(e=>{let t=new Set;for(let n of e)i.has(n)||t.add(n);return t}),await M2(n)},onError:dxe,meta:{errorShownByCaller:!0}}),e[33]=n,e[34]=ie);let ae=Ze(ie),oe=ae.isPending?ae.variables.action:null,se=ae.mutate,ce;e[35]===se?ce=e[36]:(ce=(e,t)=>{t.length!==0&&se({workflowIds:t,action:e})},e[35]=se,e[36]=ce);let le=ce,ue;e[37]===C?ue=e[38]:(ue=e=>{if(e.length===0)return;let t=new Map(C.map(uxe)),n=e.map(e=>t.get(e)??`Untitled workflow`),r=e.length===1?`Delete Workflow`:`Delete Workflows`,i=e.length===1?`This will permanently delete "${n[0]}" and all of its runs and events. This cannot be undone.`:`This will permanently delete ${e.length} workflows and all of their runs and events. This cannot be undone.`;v({workflowIds:e,workflowNames:n,title:r,description:i})},e[37]=C,e[38]=ue);let de=ue,fe;e[39]!==j||e[40]!==x||e[41]!==oe||e[42]!==t||e[43]!==de||e[44]!==le||e[45]!==i||e[46]!==K||e[47]!==J||e[48]!==T?(fe=()=>x&&T.length===0?(0,X.jsx)(`div`,{className:`p-6 text-muted-foreground text-sm`,children:`Loading workflows...`}):T.length===0?(0,X.jsx)(`div`,{className:`p-6 text-muted-foreground text-sm`,children:`No workflows found.`}):(0,X.jsxs)(`table`,{className:`w-full text-left text-sm`,children:[(0,X.jsx)(`thead`,{className:`sticky top-0 bg-card`,children:(0,X.jsxs)(`tr`,{className:`border-b`,children:[(0,X.jsx)(`th`,{className:`w-10 px-4 py-2`,children:(0,X.jsx)(l7,{"aria-label":`Select all workflows`,checked:j,onCheckedChange:e=>{J(e)}})}),(0,X.jsx)(`th`,{className:`px-2 py-2`,children:`Name`}),(0,X.jsx)(`th`,{className:`px-2 py-2`,children:`State`}),(0,X.jsx)(`th`,{className:`px-2 py-2`,children:`Mode`}),(0,X.jsx)(`th`,{className:`px-2 py-2`,children:`Updated`}),(0,X.jsx)(`th`,{className:`w-10`})]})}),(0,X.jsx)(`tbody`,{children:T.map(e=>{let n=i.has(e.id),r=e.isOwner!==!1,a=e.isPaused?`border-amber-500/30 bg-amber-500/10 text-amber-700`:`border-emerald-500/30 bg-emerald-500/10 text-emerald-700`,o=e.isPaused?`Paused`:`Active`,s=e.mode===`test`?`border-destructive/30 bg-destructive/10 text-destructive`:`border-zinc-500/30 bg-zinc-500/10 text-zinc-700`,c=e.mode===`test`?`Test`:`Live`,l=e.isPaused?`resume`:`pause`,u=e.isPaused?`Resume`:`Pause`;return(0,X.jsxs)(`tr`,{className:`border-b last:border-b-0`,children:[(0,X.jsx)(`td`,{className:`px-4 py-3`,children:(0,X.jsx)(l7,{"aria-label":`Select ${e.name}`,checked:n,onCheckedChange:t=>{te(e.id,t)}})}),(0,X.jsxs)(`td`,{className:`px-2 py-3`,children:[(0,X.jsx)(`button`,{className:`text-left font-medium text-foreground hover:underline`,onClick:()=>{t({to:`/workflows/$workflowId`,params:{workflowId:e.id}})},type:`button`,children:e.name}),(0,X.jsx)(`div`,{className:`font-mono text-muted-foreground text-xs`,children:e.id})]}),(0,X.jsx)(`td`,{className:`px-2 py-3`,children:(0,X.jsx)(`span`,{className:`inline-flex rounded border px-2 py-0.5 font-medium text-xs transition-colors duration-200 ${a}`,children:o})}),(0,X.jsx)(`td`,{className:`px-2 py-3`,children:(0,X.jsx)(`span`,{className:`inline-flex rounded border px-2 py-0.5 font-medium text-xs uppercase transition-colors duration-200 ${s}`,children:c})}),(0,X.jsx)(`td`,{className:`px-2 py-3 text-muted-foreground text-xs`,children:v7(e.updatedAt)}),(0,X.jsx)(`td`,{className:`px-2 py-3`,children:(0,X.jsxs)(Z5,{children:[(0,X.jsx)(Q5,{className:`inline-flex size-8 items-center justify-center rounded-md border border-input bg-background text-muted-foreground hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50`,disabled:!r||oe!==null,children:(0,X.jsx)(dy,{className:`size-4`})}),(0,X.jsxs)($5,{align:`end`,children:[(0,X.jsx)(e7,{onClick:()=>{K.mutate({workflowId:e.id,mode:e.mode===`test`?`live`:`test`})},children:e.mode===`test`?`Switch to Live`:`Switch to Test`}),(0,X.jsx)(e7,{onClick:()=>{le(l,[e.id])},children:u}),(0,X.jsx)(n7,{}),(0,X.jsx)(e7,{onClick:()=>{de([e.id])},variant:`destructive`,children:`Delete`})]})]})})]},e.id)})})]}),e[39]=j,e[40]=x,e[41]=oe,e[42]=t,e[43]=de,e[44]=le,e[45]=i,e[46]=K,e[47]=J,e[48]=T,e[49]=fe):fe=e[49];let pe=fe,me;e[50]!==z||e[51]!==t||e[52]!==R?(me=()=>z&&R.length===0?(0,X.jsx)(`div`,{className:`p-6 text-muted-foreground text-sm`,children:`Loading runs...`}):R.length===0?(0,X.jsx)(`div`,{className:`p-6 text-muted-foreground text-sm`,children:`No runs found.`}):(0,X.jsxs)(`table`,{className:`w-full text-left text-sm`,children:[(0,X.jsx)(`thead`,{className:`sticky top-0 bg-card`,children:(0,X.jsxs)(`tr`,{className:`border-b`,children:[(0,X.jsx)(`th`,{className:`px-4 py-2`,children:`Workflow`}),(0,X.jsx)(`th`,{className:`px-2 py-2`,children:`Status`}),(0,X.jsx)(`th`,{className:`px-2 py-2`,children:`Started`}),(0,X.jsx)(`th`,{className:`px-2 py-2`,children:`Duration`}),(0,X.jsx)(`th`,{className:`px-4 py-2 text-right`,children:`Open`})]})}),(0,X.jsx)(`tbody`,{children:R.map(e=>(0,X.jsxs)(`tr`,{className:`border-b last:border-b-0`,children:[(0,X.jsxs)(`td`,{className:`px-4 py-3`,children:[(0,X.jsx)(`div`,{className:`font-medium text-foreground text-sm`,children:e.workflowName}),(0,X.jsx)(`div`,{className:`font-mono text-muted-foreground text-xs`,children:e.workflowId})]}),(0,X.jsx)(`td`,{className:`px-2 py-3`,children:(0,X.jsx)(`span`,{className:`inline-flex rounded border px-2 py-0.5 font-medium text-xs uppercase ${C7(e.status)}`,children:e.status})}),(0,X.jsx)(`td`,{className:`px-2 py-3 text-muted-foreground text-xs`,children:v7(e.startedAt)}),(0,X.jsx)(`td`,{className:`px-2 py-3 text-muted-foreground text-xs`,children:txe(e.duration)}),(0,X.jsx)(`td`,{className:`px-4 py-3 text-right`,children:(0,X.jsx)(Jv,{onClick:()=>{t({to:`/workflows/$workflowId`,params:{workflowId:e.workflowId},search:{executionId:e.id}})},size:`sm`,type:`button`,variant:`outline`,children:`Open`})})]},e.id))})]}),e[50]=z,e[51]=t,e[52]=R,e[53]=me):me=e[53];let he=me,ge;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,X.jsx)(`h1`,{className:`font-semibold text-2xl text-foreground`,children:`Workflow Dashboard`}),e[54]=ge):ge=e[54];let _e;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[ge,(0,X.jsx)(Jv,{onClick:()=>{m(lxe),f(!0)},type:`button`,children:`New Workflow`})]}),(0,X.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Manage workflows in bulk and review runs across every workflow. Paused workflows block new starts. Test mode makes runs execute with test-mode action behavior.`})]}),e[55]=_e):_e=e[55];let ve;e[56]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{className:`font-medium text-foreground text-sm`,children:`Workflows`}),(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Select one or more workflows to run bulk actions.`})]}),e[56]=ve):ve=e[56];let ye=x||oe!==null,be;e[57]!==H||e[58]!==ye?(be=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 border-b px-4 py-3`,children:[ve,(0,X.jsx)(Jv,{disabled:ye,onClick:H,size:`sm`,type:`button`,variant:`outline`,children:`Refresh`})]}),e[57]=H,e[58]=ye,e[59]=be):be=e[59];let xe=k.length===0||oe!==null,Se;e[60]!==le||e[61]!==k?(Se=()=>{le(`pause`,k)},e[60]=le,e[61]=k,e[62]=Se):Se=e[62];let Ce;e[63]!==xe||e[64]!==Se?(Ce=(0,X.jsx)(Jv,{disabled:xe,onClick:Se,size:`sm`,type:`button`,variant:`outline`,children:`Pause Selected`}),e[63]=xe,e[64]=Se,e[65]=Ce):Ce=e[65];let we=k.length===0||oe!==null,Te;e[66]!==le||e[67]!==k?(Te=()=>{le(`resume`,k)},e[66]=le,e[67]=k,e[68]=Te):Te=e[68];let Ee;e[69]!==we||e[70]!==Te?(Ee=(0,X.jsx)(Jv,{disabled:we,onClick:Te,size:`sm`,type:`button`,variant:`outline`,children:`Resume Selected`}),e[69]=we,e[70]=Te,e[71]=Ee):Ee=e[71];let De=k.length===0||oe!==null,Oe;e[72]!==de||e[73]!==k?(Oe=()=>{de(k)},e[72]=de,e[73]=k,e[74]=Oe):Oe=e[74];let ke;e[75]!==De||e[76]!==Oe?(ke=(0,X.jsx)(Jv,{disabled:De,onClick:Oe,size:`sm`,type:`button`,variant:`destructive`,children:`Delete Selected`}),e[75]=De,e[76]=Oe,e[77]=ke):ke=e[77];let Ae;e[78]!==Ce||e[79]!==Ee||e[80]!==ke?(Ae=(0,X.jsx)(`div`,{className:`border-b px-4 py-2`,children:(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[Ce,Ee,ke]})}),e[78]=Ce,e[79]=Ee,e[80]=ke,e[81]=Ae):Ae=e[81];let je;e[82]===pe?je=e[83]:(je=(0,X.jsx)(`div`,{className:`max-h-[65vh] overflow-auto`,children:pe()}),e[82]=pe,e[83]=je);let Me;e[84]!==be||e[85]!==Ae||e[86]!==je?(Me=(0,X.jsxs)(`section`,{className:`rounded-xl border bg-card`,children:[be,Ae,je]}),e[84]=be,e[85]=Ae,e[86]=je,e[87]=Me):Me=e[87];let Ne;e[88]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{className:`font-medium text-foreground text-sm`,children:`All Runs`}),(0,X.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`Combined run history across workflows.`})]}),e[88]=Ne):Ne=e[88];let Pe=z||B,Ie;e[89]===W?Ie=e[90]:(Ie=()=>{W()},e[89]=W,e[90]=Ie);let Le;e[91]!==Pe||e[92]!==Ie?(Le=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 border-b px-4 py-3`,children:[Ne,(0,X.jsx)(Jv,{disabled:Pe,onClick:Ie,size:`sm`,type:`button`,variant:`outline`,children:`Refresh`})]}),e[91]=Pe,e[92]=Ie,e[93]=Le):Le=e[93];let Re;e[94]===Symbol.for(`react.memo_cache_sentinel`)?(Re=()=>{c(new Set)},e[94]=Re):Re=e[94];let ze=s.size===0?`secondary`:`outline`,Be;e[95]===ze?Be=e[96]:(Be=(0,X.jsx)(Jv,{onClick:Re,size:`sm`,type:`button`,variant:ze,children:`All statuses`}),e[95]=ze,e[96]=Be);let Ve;e[97]===s?Ve=e[98]:(Ve=exe.map(e=>(0,X.jsx)(Jv,{onClick:()=>{re(e)},size:`sm`,type:`button`,variant:s.has(e)?`secondary`:`outline`,children:e},e)),e[97]=s,e[98]=Ve);let He=k.length===0,Ue;e[99]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=()=>{u(cxe)},e[99]=Ue):Ue=e[99];let We=l?`secondary`:`outline`,Ge=l?`Showing selected workflows`:`Show selected workflows only`,Ke;e[100]!==He||e[101]!==We||e[102]!==Ge?(Ke=(0,X.jsx)(Jv,{disabled:He,onClick:Ue,size:`sm`,type:`button`,variant:We,children:Ge}),e[100]=He,e[101]=We,e[102]=Ge,e[103]=Ke):Ke=e[103];let qe;e[104]!==Be||e[105]!==Ve||e[106]!==Ke?(qe=(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b px-4 py-2`,children:[Be,Ve,Ke]}),e[104]=Be,e[105]=Ve,e[106]=Ke,e[107]=qe):qe=e[107];let Je;e[108]===he?Je=e[109]:(Je=(0,X.jsx)(`div`,{className:`max-h-[65vh] overflow-auto`,children:he()}),e[108]=he,e[109]=Je);let Ye;e[110]!==B||e[111]!==I?(Ye=I.hasNextPage?(0,X.jsx)(`div`,{className:`border-t px-4 py-3`,children:(0,X.jsx)(Jv,{disabled:B,onClick:()=>{I.fetchNextPage()},size:`sm`,type:`button`,variant:`outline`,children:B?`Loading...`:`Load more`})}):null,e[110]=B,e[111]=I,e[112]=Ye):Ye=e[112];let $e;e[113]!==Le||e[114]!==qe||e[115]!==Je||e[116]!==Ye?($e=(0,X.jsxs)(`section`,{className:`rounded-xl border bg-card`,children:[Le,qe,Je,Ye]}),e[113]=Le,e[114]=qe,e[115]=Je,e[116]=Ye,e[117]=$e):$e=e[117];let et;e[118]!==Me||e[119]!==$e?(et=(0,X.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[1600px] flex-col gap-6 p-6`,children:[_e,(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 xl:grid-cols-[1fr_1.5fr]`,children:[Me,$e]})]}),e[118]=Me,e[119]=$e,e[120]=et):et=e[120];let tt;e[121]===Symbol.for(`react.memo_cache_sentinel`)?(tt=e=>{e||(v(null),g(``))},e[121]=tt):tt=e[121];let nt=_!==null,rt=_?.title,it;e[122]===rt?it=e[123]:(it=(0,X.jsx)(V9,{children:rt}),e[122]=rt,e[123]=it);let at=_?.description,ot;e[124]===at?ot=e[125]:(ot=(0,X.jsx)(H9,{children:at}),e[124]=at,e[125]=ot);let st;e[126]!==it||e[127]!==ot?(st=(0,X.jsxs)(z9,{children:[it,ot]}),e[126]=it,e[127]=ot,e[128]=st):st=e[128];let ct;e[129]===_?ct=e[130]:(ct=_&&_.workflowNames.length>1?(0,X.jsxs)(`ul`,{className:`list-disc pl-5 text-muted-foreground text-sm`,children:[_.workflowIds.slice(0,3).map((e,t)=>(0,X.jsx)(`li`,{children:_.workflowNames[t]},e)),_.workflowNames.length>3?(0,X.jsxs)(`li`,{children:[`and `,_.workflowNames.length-3,` more`]}):null]}):null,e[129]=_,e[130]=ct);let lt;e[131]!==_||e[132]!==h?(lt=_&&_.workflowIds.length>G9?(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsxs)(YZ,{htmlFor:`delete-challenge`,children:[`Type `,_.workflowIds.length,` to confirm`]}),(0,X.jsx)(JZ,{autoComplete:`off`,id:`delete-challenge`,inputMode:`numeric`,onChange:e=>{g(e.target.value)},value:h})]}):null,e[131]=_,e[132]=h,e[133]=lt):lt=e[133];let ut;e[134]===Symbol.for(`react.memo_cache_sentinel`)?(ut=(0,X.jsx)(W9,{children:`Cancel`}),e[134]=ut):ut=e[134];let dt;e[135]!==_||e[136]!==h?(dt=_!==null&&_.workflowIds.length>G9&&h.trim()!==String(_.workflowIds.length),e[135]=_,e[136]=h,e[137]=dt):dt=e[137];let ft;e[138]!==_||e[139]!==le?(ft=()=>{_&&(le(`delete`,_.workflowIds),v(null),g(``))},e[138]=_,e[139]=le,e[140]=ft):ft=e[140];let pt;e[141]!==dt||e[142]!==ft?(pt=(0,X.jsxs)(B9,{children:[ut,(0,X.jsx)(U9,{disabled:dt,onClick:ft,variant:`destructive`,children:`Delete`})]}),e[141]=dt,e[142]=ft,e[143]=pt):pt=e[143];let mt;e[144]!==st||e[145]!==ct||e[146]!==lt||e[147]!==pt?(mt=(0,X.jsxs)(R9,{children:[st,ct,lt,pt]}),e[144]=st,e[145]=ct,e[146]=lt,e[147]=pt,e[148]=mt):mt=e[148];let ht;e[149]!==nt||e[150]!==mt?(ht=(0,X.jsx)(L9,{onOpenChange:tt,open:nt,children:mt}),e[149]=nt,e[150]=mt,e[151]=ht):ht=e[151];let gt;e[152]===C?gt=e[153]:(gt=C.map(sxe),e[152]=C,e[153]=gt);let _t;e[154]===t?_t=e[155]:(_t=e=>t({to:`/workflows/$workflowId`,params:{workflowId:e}}),e[154]=t,e[155]=_t);let vt;e[156]!==p||e[157]!==d||e[158]!==gt||e[159]!==_t?(vt=(0,X.jsx)(R7,{existingWorkflowNames:gt,onCreated:_t,onOpenChange:f,open:d},p),e[156]=p,e[157]=d,e[158]=gt,e[159]=_t,e[160]=vt):vt=e[160];let yt;return e[161]!==et||e[162]!==ht||e[163]!==vt?(yt=(0,X.jsxs)(`div`,{className:`pointer-events-auto h-dvh overflow-auto bg-background`,children:[et,ht,vt]}),e[161]=et,e[162]=ht,e[163]=vt,e[164]=yt):yt=e[164],yt}function sxe(e){return e.name}function cxe(e){return!e}function lxe(e){return e+1}function uxe(e){return[e.id,e.name]}function dxe(e,t){let{action:n}=t;$be.error(`Failed to ${n} workflows`,{action:n,error:e}),Fy.error(`Failed to ${n} workflows`)}function fxe(e){return e.workflowId}function pxe(e){return e.ok&&e.deleted===!0}function mxe(e){return e.id}function hxe(e){return e.items}function gxe(e){return e.nextCursor??void 0}function _xe(e){return e.name!==`__current__`}function vxe(e){return{executionId:typeof e.executionId==`string`&&e.executionId.length>0?e.executionId:void 0}}function yxe(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(Dbe,{}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsxs)(Nk,{children:[t,(0,X.jsx)(`div`,{className:`pointer-events-none relative z-10`,children:(0,X.jsx)(ka,{})})]}),e[1]=n):n=e[1],n}function bxe(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(MZ,{attribute:`class`,defaultTheme:`system`,disableTransitionOnChange:!0,enableSystem:!0,children:(0,X.jsx)(dj,{store:F9,children:(0,X.jsxs)(aZ,{children:[(0,X.jsx)(yxe,{}),(0,X.jsx)(FZ,{}),(0,X.jsx)(_Z,{})]})})}),e[0]=t):t=e[0],t}function J9(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(qbe,{}),e[0]=t):t=e[0],t}var Y9=ya({component:bxe}),xxe=_a({getParentRoute:()=>Y9,path:`/`,component:oxe}),Sxe=_a({getParentRoute:()=>Y9,path:`/workflows`,component:()=>(0,X.jsx)(Ki,{replace:!0,to:`/`})}),Cxe=_a({getParentRoute:()=>Y9,path:`/workflows/$workflowId`,validateSearch:vxe,beforeLoad:({search:e})=>{F9.set(s4,Abe(e.executionId))},loader:async({params:e})=>{F9.set(J2,!1),F9.set(Y2,null);let[t,n]=await Promise.allSettled([Hy.fetchQuery(O2.workflow.getById.queryOptions({input:{workflowId:e.workflowId},staleTime:0})),Hy.fetchQuery(k2())]);if(t.status===`rejected`){let e=kbe(t.reason);throw F9.set(J2,e.notFound),F9.set(Y2,e.message),t.reason}if(n.status===`rejected`)throw F9.set(Y2,I9),n.reason;let r=E2(t.value);F9.set(Ple,{...r,nodes:B2(nb(),r.nodes,n.value)})},errorComponent:J9,component:J9}),wxe=Fa({routeTree:Y9.addChildren([xxe,Sxe,Cxe]),defaultPreload:`intent`,basepath:My()}),X9=e=>typeof e==`string`&&e.includes(`ResizeObserver loop`);function Txe(e){if(typeof e==`string`)return e;if(typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)return e.message}(()=>{if(window.__resizeObserverPatched||!window.ResizeObserver)return;let e=window.ResizeObserver;window.ResizeObserver=class extends e{constructor(e){super((t,n)=>{window.requestAnimationFrame(()=>e(t,n))})}},window.__resizeObserverPatched=!0})(),window.addEventListener(`error`,e=>{X9(e.message)&&(e.preventDefault(),e.stopImmediatePropagation())}),window.addEventListener(`unhandledrejection`,e=>{X9(Txe(e.reason))&&e.preventDefault()});var Z9=document.getElementById(`root`);if(!Z9)throw Error(`Root element not found`);var Q9=(0,Uh.createRoot)(Z9);Q9.render((0,X.jsx)(bte,{}));var $9=await rb();Q9.render($9.ok?(0,X.jsx)(wte,{value:nb(),children:(0,X.jsx)(Tte,{value:ng,children:(0,X.jsx)(Ie,{client:Hy,children:(0,X.jsx)(Ra,{router:wxe})})})}):(0,X.jsx)(Ste,{endpoint:`${My()}/api/extensions`,reason:$9.reason}));