@workflow/web 4.0.1-beta.29 → 4.0.1-beta.30
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.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/fallback-build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +2 -2
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/server-reference-manifest.json +56 -41
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page/server-reference-manifest.json +56 -41
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/run/[runId]/page/server-reference-manifest.json +56 -41
- package/.next/server/app/run/[runId]/page.js.nft.json +1 -1
- package/.next/server/app/run/[runId]/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__61dd0871._.js +8 -8
- package/.next/server/chunks/ssr/[root-of-the-server]__61dd0871._.js.map +1 -1
- package/.next/server/chunks/ssr/_1ed240c0._.js +2 -2
- package/.next/server/chunks/ssr/_1ed240c0._.js.map +1 -1
- package/.next/server/chunks/ssr/_4c1b02ba._.js +1 -1
- package/.next/server/chunks/ssr/_4c1b02ba._.js.map +1 -1
- package/.next/server/chunks/ssr/_af28dabd._.js +1 -1
- package/.next/server/chunks/ssr/_af28dabd._.js.map +1 -1
- package/.next/server/chunks/ssr/_de318f70._.js +1 -1
- package/.next/server/chunks/ssr/_de318f70._.js.map +1 -1
- package/.next/server/chunks/ssr/packages_web__next-internal_server_app__not-found_page_actions_8572dae1.js +1 -1
- package/.next/server/chunks/ssr/packages_web__next-internal_server_app__not-found_page_actions_8572dae1.js.map +1 -1
- package/.next/server/chunks/ssr/packages_web__next-internal_server_app_page_actions_53d8fdde.js +1 -1
- package/.next/server/chunks/ssr/packages_web__next-internal_server_app_page_actions_53d8fdde.js.map +1 -1
- package/.next/server/chunks/ssr/packages_web__next-internal_server_app_run_[runId]_page_actions_ed901ed2.js +1 -1
- package/.next/server/chunks/ssr/packages_web__next-internal_server_app_run_[runId]_page_actions_ed901ed2.js.map +1 -1
- package/.next/server/chunks/ssr/packages_web_src_app_page_tsx_cd282e82._.js +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +95 -66
- package/.next/static/chunks/{755c9b4f72b135eb.js → 319ccae2953c32b6.js} +1 -1
- package/.next/static/chunks/{c0044452471a4fdd.js → 45b07a0e6457d32f.js} +1 -1
- package/.next/static/chunks/717798d7fe245de4.js +60 -0
- package/.next/static/chunks/8a592833ca776be5.js +5 -0
- package/.next/static/chunks/{9904359b12854691.css → c28a0fb79000efd0.css} +1 -1
- package/.next/static/chunks/{299d03c1e3679e32.js → c91752bdf4e78160.js} +1 -1
- package/.next/trace +1 -1
- package/.next/trace-build +1 -1
- package/package.json +3 -3
- package/.next/static/chunks/333d7c30ed99fda2.js +0 -5
- package/.next/static/chunks/e19420841ddbfc6e.js +0 -60
- /package/.next/static/{SoUD8AIvoPUHkapzBk8Sy → EsDNYt0LPNk2I-G0InIi7}/_buildManifest.js +0 -0
- /package/.next/static/{SoUD8AIvoPUHkapzBk8Sy → EsDNYt0LPNk2I-G0InIi7}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{SoUD8AIvoPUHkapzBk8Sy → EsDNYt0LPNk2I-G0InIi7}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,610062,349011,e=>{"use strict";e.i(113971);var t=e.i(686107);let r=function(){try{let e="nuqs-localStorage-test";if("undefined"==typeof localStorage)return!1;localStorage.setItem(e,e);let t=localStorage.getItem(e)===e;return localStorage.removeItem(e),t&&(localStorage.getItem("debug")||"").includes("nuqs")}catch{return!1}}();function n(e,...t){if(!r)return;let a=function(e,...t){return e.replace(/%[sfdO]/g,e=>{let r=t.shift();return"%O"===e&&r?JSON.stringify(r).replace(/"([^"]+)":/g,"$1:"):String(r)})}(e,...t);performance.mark(a);try{console.log(e,...t)}catch{console.log(a)}}function a(e,...t){r&&console.warn(e,...t)}let o={303:"Multiple adapter contexts detected. This might happen in monorepos.",404:"nuqs requires an adapter to work with your framework.",409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:"Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.",422:"Invalid options combination: `limitUrlUpdates: debounce` should be used in SSR scenarios, with `shallow: false`",429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:"Empty search params cache. Search params can't be accessed in Layouts.",501:"Search params cache already populated. Have you called `parse` twice?"};function s(e){return`[nuqs] ${o[e]}
|
|
2
|
+
See https://nuqs.dev/NUQS-${e}`}function i(e){if(0===e.size)return"";let t=[];for(let[r,n]of e.entries()){let e=r.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F");t.push(`${e}=${n.replace(/%/g,"%25").replace(/\+/g,"%2B").replace(/ /g,"+").replace(/#/g,"%23").replace(/&/g,"%26").replace(/"/g,"%22").replace(/'/g,"%27").replace(/`/g,"%60").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/[\x00-\x1F]/g,e=>encodeURIComponent(e))}`)}return"?"+t.join("&")}let l=(0,t.createContext)({useAdapter(){throw Error(s(404))}});function u(e){return({children:r,defaultOptions:n,processUrlSearchParams:a,...o})=>(0,t.createElement)(l.Provider,{...o,value:{useAdapter:e,defaultOptions:n,processUrlSearchParams:a}},r)}function d(e){let r=(0,t.useContext)(l);if(!("useAdapter"in r))throw Error(s(404));return r.useAdapter(e)}l.displayName="NuqsAdapterContext",r&&"undefined"!=typeof window&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==l&&console.error(s(303)),window.__NuqsAdapterContext=l);let c=()=>(0,t.useContext)(l).defaultOptions,f=()=>(0,t.useContext)(l).processUrlSearchParams;function m(e){return{method:"throttle",timeMs:e}}function p(e){return{method:"debounce",timeMs:e}}e.s(["a",()=>f,"c",()=>n,"i",()=>c,"l",()=>a,"n",()=>u,"o",()=>i,"r",()=>d,"s",()=>s],349011);let h=m(function(){if("undefined"==typeof window||!window.GestureEvent)return 50;try{let e=navigator.userAgent?.match(/version\/([\d\.]+) safari/i);return parseFloat(e[1])>=17?120:320}catch{return 320}}());function v(e){return null===e||Array.isArray(e)&&0===e.length}function g(e,t,r){if("string"==typeof e)r.set(t,e);else{for(let n of(r.delete(t),e))r.append(t,n);r.has(t)||r.set(t,"")}return r}function y(){let e=new Map;return{on(t,r){let n=e.get(t)||[];return n.push(r),e.set(t,n),()=>this.off(t,r)},off(t,r){let n=e.get(t);n&&e.set(t,n.filter(e=>e!==r))},emit(t,r){e.get(t)?.forEach(e=>e(r))}}}function x(e,t,r){let n=setTimeout(function(){e(),r.removeEventListener("abort",a)},t);function a(){clearTimeout(n),r.removeEventListener("abort",a)}r.addEventListener("abort",a)}function b(){let e=Promise;if(Promise.hasOwnProperty("withResolvers"))return Promise.withResolvers();let t=()=>{},r=()=>{};return{promise:new e((e,n)=>{t=e,r=n}),resolve:t,reject:r}}function w(){return new URLSearchParams(location.search)}var k=class{updateMap=new Map;options={history:"replace",scroll:!1,shallow:!0};timeMs=h.timeMs;transitions=new Set;resolvers=null;controller=null;lastFlushedAt=0;resetQueueOnNextPush=!1;push({key:e,query:t,options:r},a=h.timeMs){this.resetQueueOnNextPush&&(this.reset(),this.resetQueueOnNextPush=!1),n("[nuqs gtq] Enqueueing %s=%s %O",e,t,r),this.updateMap.set(e,t),"push"===r.history&&(this.options.history="push"),r.scroll&&(this.options.scroll=!0),!1===r.shallow&&(this.options.shallow=!1),r.startTransition&&this.transitions.add(r.startTransition),(!Number.isFinite(this.timeMs)||a>this.timeMs)&&(this.timeMs=a)}getQueuedQuery(e){return this.updateMap.get(e)}getPendingPromise({getSearchParamsSnapshot:e=w}){return this.resolvers?.promise??Promise.resolve(e())}flush({getSearchParamsSnapshot:e=w,rateLimitFactor:t=1,...r},a){if(this.controller??=new AbortController,!Number.isFinite(this.timeMs))return n("[nuqs gtq] Skipping flush due to throttleMs=Infinity"),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=b();let o=()=>{this.lastFlushedAt=performance.now();let[t,n]=this.applyPendingUpdates({...r,autoResetQueueOnUpdate:r.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:e},a);null===n?(this.resolvers.resolve(t),this.resetQueueOnNextPush=!0):this.resolvers.reject(t),this.resolvers=null},s=()=>{let e=performance.now()-this.lastFlushedAt,r=this.timeMs,a=t*Math.max(0,r-e);n("[nuqs gtq] Scheduling flush in %f ms. Throttled at %f ms (x%f)",a,r,t),0===a?o():x(o,a,this.controller.signal)};return x(s,0,this.controller.signal),this.resolvers.promise}abort(){return this.controller?.abort(),this.controller=new AbortController,this.resolvers?.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){let e=Array.from(this.updateMap.keys());return n("[nuqs gtq] Resetting queue %s",JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:"replace",scroll:!1,shallow:!0},this.timeMs=h.timeMs,e}applyPendingUpdates(e,t){let{updateUrl:r,getSearchParamsSnapshot:a}=e,o=a();if(n("[nuqs gtq] Applying %d pending update(s) on top of %s",this.updateMap.size,o.toString()),0===this.updateMap.size)return[o,null];let i=Array.from(this.updateMap.entries()),l={...this.options},u=Array.from(this.transitions);for(let[t,r]of(e.autoResetQueueOnUpdate&&this.reset(),n("[nuqs gtq] Flushing queue %O with options %O",i,l),i))null===r?o.delete(t):o=g(r,t,o);t&&(o=t(o));try{return!function(e,t){let r=t;for(let t=e.length-1;t>=0;t--){let n=e[t];if(!n)continue;let a=r;r=()=>n(a)}r()}(u,()=>{r(o,l)}),[o,null]}catch(e){return console.error(s(429),i.map(([e])=>e).join(),e),[o,e]}}};let _=new k;var j=class{callback;resolvers=b();controller=new AbortController;queuedValue=void 0;constructor(e){this.callback=e}abort(){this.controller.abort(),this.queuedValue=void 0}push(e,t){return this.queuedValue=e,this.controller.abort(),this.controller=new AbortController,x(()=>{let t=this.resolvers;try{n("[nuqs dq] Flushing debounce queue",e);let r=this.callback(e);n("[nuqs dq] Reset debounce queue %O",this.queuedValue),this.queuedValue=void 0,this.resolvers=b(),r.then(e=>t.resolve(e)).catch(e=>t.reject(e))}catch(e){this.queuedValue=void 0,t.reject(e)}},t,this.controller.signal),this.resolvers.promise}};let S=new class{throttleQueue;queues=new Map;queuedQuerySync=y();constructor(e=new k){this.throttleQueue=e}useQueuedQueries(e){var r,n;let a,o;return r=(e,t)=>this.queuedQuerySync.on(e,t),n=e=>this.getQueuedQuery(e),a=(0,t.useCallback)(()=>{let t=Object.fromEntries(e.map(e=>[e,n(e)]));return[JSON.stringify(t),t]},[e.join(","),n]),null===(o=(0,t.useRef)(null)).current&&(o.current=a()),(0,t.useSyncExternalStore)((0,t.useCallback)(t=>{let n=e.map(e=>r(e,t));return()=>n.forEach(e=>e())},[e.join(","),r]),()=>{let[e,t]=a();return o.current[0]===e?o.current[1]:(o.current=[e,t],t)},()=>o.current[1])}push(e,t,r,a){if(!Number.isFinite(t))return Promise.resolve((r.getSearchParamsSnapshot??w)());let o=e.key;if(!this.queues.has(o)){n("[nuqs dqc] Creating debounce queue for `%s`",o);let e=new j(e=>(this.throttleQueue.push(e),this.throttleQueue.flush(r,a).finally(()=>{this.queues.get(e.key)?.queuedValue===void 0&&(n("[nuqs dqc] Cleaning up empty queue for `%s`",e.key),this.queues.delete(e.key)),this.queuedQuerySync.emit(e.key)})));this.queues.set(o,e)}n("[nuqs dqc] Enqueueing debounce update %O",e);let s=this.queues.get(o).push(e,t);return this.queuedQuerySync.emit(o),s}abort(e){let t=this.queues.get(e);return t?(n("[nuqs dqc] Aborting debounce queue %s=%s",e,t.queuedValue?.query),this.queues.delete(e),t.abort(),this.queuedQuerySync.emit(e),e=>(e.then(t.resolvers.resolve,t.resolvers.reject),e)):e=>e}abortAll(){for(let[e,t]of this.queues.entries())n("[nuqs dqc] Aborting debounce queue %s=%s",e,t.queuedValue?.query),t.abort(),t.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(e);this.queues.clear()}getQueuedQuery(e){let t=this.queues.get(e)?.queuedValue?.query;return void 0!==t?t:this.throttleQueue.getQueuedQuery(e)}}(_);e.s(["a",()=>g,"c",()=>m,"i",()=>v,"n",()=>_,"o",()=>p,"r",()=>y,"s",()=>h,"t",()=>S],610062)},868924,(e,t,r)=>{t.exports=e.r(220096)},291967,e=>{"use strict";function t(e,r,{checkForDefaultPrevented:n=!0}={}){return function(t){if(e?.(t),!1===n||!t.defaultPrevented)return r?.(t)}}"undefined"!=typeof window&&window.document&&window.document.createElement,e.s(["composeEventHandlers",()=>t])},221588,e=>{"use strict";var t=e.i(686107);function r(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function n(...e){return t=>{let n=!1,a=e.map(e=>{let a=r(e,t);return n||"function"!=typeof a||(n=!0),a});if(n)return()=>{for(let t=0;t<a.length;t++){let n=a[t];"function"==typeof n?n():r(e[t],null)}}}}function a(...e){return t.useCallback(n(...e),e)}e.s(["composeRefs",()=>n,"useComposedRefs",()=>a])},810096,e=>{"use strict";var t=e.i(686107),r=e.i(666426);function n(e,n){let a=t.createContext(n),o=e=>{let{children:n,...o}=e,s=t.useMemo(()=>o,Object.values(o));return(0,r.jsx)(a.Provider,{value:s,children:n})};return o.displayName=e+"Provider",[o,function(r){let o=t.useContext(a);if(o)return o;if(void 0!==n)return n;throw Error(`\`${r}\` must be used within \`${e}\``)}]}function a(e,n=[]){let o=[],s=()=>{let r=o.map(e=>t.createContext(e));return function(n){let a=n?.[e]||r;return t.useMemo(()=>({[`__scope${e}`]:{...n,[e]:a}}),[n,a])}};return s.scopeName=e,[function(n,a){let s=t.createContext(a),i=o.length;o=[...o,a];let l=n=>{let{scope:a,children:o,...l}=n,u=a?.[e]?.[i]||s,d=t.useMemo(()=>l,Object.values(l));return(0,r.jsx)(u.Provider,{value:d,children:o})};return l.displayName=n+"Provider",[l,function(r,o){let l=o?.[e]?.[i]||s,u=t.useContext(l);if(u)return u;if(void 0!==a)return a;throw Error(`\`${r}\` must be used within \`${n}\``)}]},function(...e){let r=e[0];if(1===e.length)return r;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let a=n.reduce((t,{useScope:r,scopeName:n})=>{let a=r(e)[`__scope${n}`];return{...t,...a}},{});return t.useMemo(()=>({[`__scope${r.scopeName}`]:a}),[a])}};return n.scopeName=r.scopeName,n}(s,...n)]}e.s(["createContext",()=>n,"createContextScope",()=>a])},545136,e=>{"use strict";var t=e.i(686107),r=e.i(221588),n=e.i(666426);function a(e){var a;let o,s=(a=e,(o=t.forwardRef((e,n)=>{let{children:a,...o}=e;if(t.isValidElement(a)){var s;let e,i,l=(s=a,(i=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(i=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),u=function(e,t){let r={...t};for(let n in t){let a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{let t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}(o,a.props);return a.type!==t.Fragment&&(u.ref=n?(0,r.composeRefs)(n,l):l),t.cloneElement(a,u)}return t.Children.count(a)>1?t.Children.only(null):null})).displayName=`${a}.SlotClone`,o),l=t.forwardRef((e,r)=>{let{children:a,...o}=e,l=t.Children.toArray(a),u=l.find(i);if(u){let e=u.props.children,a=l.map(r=>r!==u?r:t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null);return(0,n.jsx)(s,{...o,ref:r,children:t.isValidElement(e)?t.cloneElement(e,void 0,a):null})}return(0,n.jsx)(s,{...o,ref:r,children:a})});return l.displayName=`${e}.Slot`,l}var o=Symbol("radix.slottable");function s(e){let t=({children:e})=>(0,n.jsx)(n.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=o,t}function i(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===o}e.s(["createSlot",()=>a,"createSlottable",()=>s])},692792,852947,e=>{"use strict";var t=e.i(686107),r=e.i(571577),n=e.i(545136),a=e.i(666426),o=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{let o=(0,n.createSlot)(`Primitive.${r}`),s=t.forwardRef((e,t)=>{let{asChild:n,...s}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,a.jsx)(n?o:r,{...s,ref:t})});return s.displayName=`Primitive.${r}`,{...e,[r]:s}},{});function s(e,t){e&&r.flushSync(()=>e.dispatchEvent(t))}function i(e){let r=t.useRef(e);return t.useEffect(()=>{r.current=e}),t.useMemo(()=>(...e)=>r.current?.(...e),[])}e.s(["Primitive",()=>o,"dispatchDiscreteCustomEvent",()=>s],692792),e.s(["useCallbackRef",()=>i],852947)},975287,e=>{"use strict";var t,r=e.i(686107),n=e.i(291967),a=e.i(692792),o=e.i(221588),s=e.i(852947),i=e.i(666426),l="dismissableLayer.update",u=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),d=r.forwardRef((e,d)=>{let{disableOutsidePointerEvents:m=!1,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:v,onInteractOutside:g,onDismiss:y,...x}=e,b=r.useContext(u),[w,k]=r.useState(null),_=w?.ownerDocument??globalThis?.document,[,j]=r.useState({}),S=(0,o.useComposedRefs)(d,e=>k(e)),E=Array.from(b.layers),[C]=[...b.layersWithOutsidePointerEventsDisabled].slice(-1),N=E.indexOf(C),L=w?E.indexOf(w):-1,R=b.layersWithOutsidePointerEventsDisabled.size>0,D=L>=N,T=function(e,t=globalThis?.document){let n=(0,s.useCallbackRef)(e),a=r.useRef(!1),o=r.useRef(()=>{});return r.useEffect(()=>{let e=e=>{if(e.target&&!a.current){let r=function(){f("dismissableLayer.pointerDownOutside",n,a,{discrete:!0})},a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);a.current=!1},r=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(r),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}(e=>{let t=e.target,r=[...b.branches].some(e=>e.contains(t));D&&!r&&(h?.(e),g?.(e),e.defaultPrevented||y?.())},_),M=function(e,t=globalThis?.document){let n=(0,s.useCallbackRef)(e),a=r.useRef(!1);return r.useEffect(()=>{let e=e=>{e.target&&!a.current&&f("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}(e=>{let t=e.target;![...b.branches].some(e=>e.contains(t))&&(v?.(e),g?.(e),e.defaultPrevented||y?.())},_);return!function(e,t=globalThis?.document){let n=(0,s.useCallbackRef)(e);r.useEffect(()=>{let e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{L===b.layers.size-1&&(p?.(e),!e.defaultPrevented&&y&&(e.preventDefault(),y()))},_),r.useEffect(()=>{if(w)return m&&(0===b.layersWithOutsidePointerEventsDisabled.size&&(t=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),b.layersWithOutsidePointerEventsDisabled.add(w)),b.layers.add(w),c(),()=>{m&&1===b.layersWithOutsidePointerEventsDisabled.size&&(_.body.style.pointerEvents=t)}},[w,_,m,b]),r.useEffect(()=>()=>{w&&(b.layers.delete(w),b.layersWithOutsidePointerEventsDisabled.delete(w),c())},[w,b]),r.useEffect(()=>{let e=()=>j({});return document.addEventListener(l,e),()=>document.removeEventListener(l,e)},[]),(0,i.jsx)(a.Primitive.div,{...x,ref:S,style:{pointerEvents:R?D?"auto":"none":void 0,...e.style},onFocusCapture:(0,n.composeEventHandlers)(e.onFocusCapture,M.onFocusCapture),onBlurCapture:(0,n.composeEventHandlers)(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:(0,n.composeEventHandlers)(e.onPointerDownCapture,T.onPointerDownCapture)})});function c(){let e=new CustomEvent(l);document.dispatchEvent(e)}function f(e,t,r,{discrete:n}){let o=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?(0,a.dispatchDiscreteCustomEvent)(o,s):o.dispatchEvent(s)}d.displayName="DismissableLayer",r.forwardRef((e,t)=>{let n=r.useContext(u),s=r.useRef(null),l=(0,o.useComposedRefs)(t,s);return r.useEffect(()=>{let e=s.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,i.jsx)(a.Primitive.div,{...e,ref:l})}).displayName="DismissableLayerBranch",e.s(["DismissableLayer",()=>d],975287)},244107,225088,e=>{"use strict";var t=e.i(686107),r=globalThis?.document?t.useLayoutEffect:()=>{};e.s(["useLayoutEffect",()=>r],225088);var n=t[" useId ".trim().toString()]||(()=>void 0),a=0;function o(e){let[o,s]=t.useState(n());return r(()=>{e||s(e=>e??String(a++))},[e]),e||(o?`radix-${o}`:"")}e.s(["useId",()=>o],244107)},50346,422957,e=>{"use strict";let t=["top","right","bottom","left"],r=t.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]),n=Math.min,a=Math.max,o=Math.round,s=Math.floor,i=e=>({x:e,y:e}),l={left:"right",right:"left",bottom:"top",top:"bottom"},u={start:"end",end:"start"};function d(e,t){return"function"==typeof e?e(t):e}function c(e){return e.split("-")[0]}function f(e){return e.split("-")[1]}function m(e){return"x"===e?"y":"x"}function p(e){return"y"===e?"height":"width"}let h=new Set(["top","bottom"]);function v(e){return h.has(c(e))?"y":"x"}function g(e,t,r){void 0===r&&(r=!1);let n=f(e),a=m(v(e)),o=p(a),s="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=_(s)),[s,_(s)]}function y(e){return e.replace(/start|end/g,e=>u[e])}let x=["left","right"],b=["right","left"],w=["top","bottom"],k=["bottom","top"];function _(e){return e.replace(/left|right|bottom|top/g,e=>l[e])}function j(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function S(e){let{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function E(e,t,r){let n,{reference:a,floating:o}=e,s=v(t),i=m(v(t)),l=p(i),u=c(t),d="y"===s,h=a.x+a.width/2-o.width/2,g=a.y+a.height/2-o.height/2,y=a[l]/2-o[l]/2;switch(u){case"top":n={x:h,y:a.y-o.height};break;case"bottom":n={x:h,y:a.y+a.height};break;case"right":n={x:a.x+a.width,y:g};break;case"left":n={x:a.x-o.width,y:g};break;default:n={x:a.x,y:a.y}}switch(f(t)){case"start":n[i]-=y*(r&&d?-1:1);break;case"end":n[i]+=y*(r&&d?-1:1)}return n}let C=async(e,t,r)=>{let{placement:n="bottom",strategy:a="absolute",middleware:o=[],platform:s}=r,i=o.filter(Boolean),l=await (null==s.isRTL?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:c}=E(u,n,l),f=n,m={},p=0;for(let r=0;r<i.length;r++){let{name:o,fn:h}=i[r],{x:v,y:g,data:y,reset:x}=await h({x:d,y:c,initialPlacement:n,placement:f,strategy:a,middlewareData:m,rects:u,platform:s,elements:{reference:e,floating:t}});d=null!=v?v:d,c=null!=g?g:c,m={...m,[o]:{...m[o],...y}},x&&p<=50&&(p++,"object"==typeof x&&(x.placement&&(f=x.placement),x.rects&&(u=!0===x.rects?await s.getElementRects({reference:e,floating:t,strategy:a}):x.rects),{x:d,y:c}=E(u,f,l)),r=-1)}return{x:d,y:c,placement:f,strategy:a,middlewareData:m}};async function N(e,t){var r;void 0===t&&(t={});let{x:n,y:a,platform:o,rects:s,elements:i,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:m=!1,padding:p=0}=d(t,e),h=j(p),v=i[m?"floating"===f?"reference":"floating":f],g=S(await o.getClippingRect({element:null==(r=await (null==o.isElement?void 0:o.isElement(v)))||r?v:v.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(i.floating)),boundary:u,rootBoundary:c,strategy:l})),y="floating"===f?{x:n,y:a,width:s.floating.width,height:s.floating.height}:s.reference,x=await (null==o.getOffsetParent?void 0:o.getOffsetParent(i.floating)),b=await (null==o.isElement?void 0:o.isElement(x))&&await (null==o.getScale?void 0:o.getScale(x))||{x:1,y:1},w=S(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:y,offsetParent:x,strategy:l}):y);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function L(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function R(e){return t.some(t=>e[t]>=0)}function D(e){let t=n(...e.map(e=>e.left)),r=n(...e.map(e=>e.top));return{x:t,y:r,width:a(...e.map(e=>e.right))-t,height:a(...e.map(e=>e.bottom))-r}}let T=new Set(["left","top"]);async function M(e,t){let{placement:r,platform:n,elements:a}=e,o=await (null==n.isRTL?void 0:n.isRTL(a.floating)),s=c(r),i=f(r),l="y"===v(r),u=T.has(s)?-1:1,m=o&&l?-1:1,p=d(t,e),{mainAxis:h,crossAxis:g,alignmentAxis:y}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return i&&"number"==typeof y&&(g="end"===i?-1*y:y),l?{x:g*m,y:h*u}:{x:h*u,y:g*m}}function A(){return"undefined"!=typeof window}function P(e){return F(e)?(e.nodeName||"").toLowerCase():"#document"}function I(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function O(e){var t;return null==(t=(F(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function F(e){return!!A()&&(e instanceof Node||e instanceof I(e).Node)}function $(e){return!!A()&&(e instanceof Element||e instanceof I(e).Element)}function H(e){return!!A()&&(e instanceof HTMLElement||e instanceof I(e).HTMLElement)}function W(e){return!!A()&&"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof I(e).ShadowRoot)}let V=new Set(["inline","contents"]);function q(e){let{overflow:t,overflowX:r,overflowY:n,display:a}=ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!V.has(a)}let B=new Set(["table","td","th"]),z=[":popover-open",":modal"];function U(e){return z.some(t=>{try{return e.matches(t)}catch(e){return!1}})}let Q=["transform","translate","scale","rotate","perspective"],Y=["transform","translate","scale","rotate","perspective","filter"],X=["paint","layout","strict","content"];function K(e){let t=J(),r=$(e)?ee(e):e;return Q.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||Y.some(e=>(r.willChange||"").includes(e))||X.some(e=>(r.contain||"").includes(e))}function J(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let Z=new Set(["html","body","#document"]);function G(e){return Z.has(P(e))}function ee(e){return I(e).getComputedStyle(e)}function et(e){return $(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function er(e){if("html"===P(e))return e;let t=e.assignedSlot||e.parentNode||W(e)&&e.host||O(e);return W(t)?t.host:t}function en(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let a=function e(t){let r=er(t);return G(r)?t.ownerDocument?t.ownerDocument.body:t.body:H(r)&&q(r)?r:e(r)}(e),o=a===(null==(n=e.ownerDocument)?void 0:n.body),s=I(a);if(o){let e=ea(s);return t.concat(s,s.visualViewport||[],q(a)?a:[],e&&r?en(e):[])}return t.concat(a,en(a,[],r))}function ea(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eo(e){let t=ee(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,a=H(e),s=a?e.offsetWidth:r,i=a?e.offsetHeight:n,l=o(r)!==s||o(n)!==i;return l&&(r=s,n=i),{width:r,height:n,$:l}}function es(e){return $(e)?e:e.contextElement}function ei(e){let t=es(e);if(!H(t))return i(1);let r=t.getBoundingClientRect(),{width:n,height:a,$:s}=eo(t),l=(s?o(r.width):r.width)/n,u=(s?o(r.height):r.height)/a;return l&&Number.isFinite(l)||(l=1),u&&Number.isFinite(u)||(u=1),{x:l,y:u}}let el=i(0);function eu(e){let t=I(e);return J()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:el}function ed(e,t,r,n){var a;void 0===t&&(t=!1),void 0===r&&(r=!1);let o=e.getBoundingClientRect(),s=es(e),l=i(1);t&&(n?$(n)&&(l=ei(n)):l=ei(e));let u=(void 0===(a=r)&&(a=!1),n&&(!a||n===I(s))&&a)?eu(s):i(0),d=(o.left+u.x)/l.x,c=(o.top+u.y)/l.y,f=o.width/l.x,m=o.height/l.y;if(s){let e=I(s),t=n&&$(n)?I(n):n,r=e,a=ea(r);for(;a&&n&&t!==r;){let e=ei(a),t=a.getBoundingClientRect(),n=ee(a),o=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,s=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;d*=e.x,c*=e.y,f*=e.x,m*=e.y,d+=o,c+=s,a=ea(r=I(a))}}return S({width:f,height:m,x:d,y:c})}function ec(e,t){let r=et(e).scrollLeft;return t?t.left+r:ed(O(e)).left+r}function ef(e,t){let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-ec(e,r),y:r.top+t.scrollTop}}let em=new Set(["absolute","fixed"]);function ep(e,t,r){var n;let o;if("viewport"===t)o=function(e,t){let r=I(e),n=O(e),a=r.visualViewport,o=n.clientWidth,s=n.clientHeight,i=0,l=0;if(a){o=a.width,s=a.height;let e=J();(!e||e&&"fixed"===t)&&(i=a.offsetLeft,l=a.offsetTop)}let u=ec(n);if(u<=0){let e=n.ownerDocument,t=e.body,r=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,s=Math.abs(n.clientWidth-t.clientWidth-a);s<=25&&(o-=s)}else u<=25&&(o+=u);return{width:o,height:s,x:i,y:l}}(e,r);else if("document"===t){let t,r,s,i,l,u,d;n=O(e),t=O(n),r=et(n),s=n.ownerDocument.body,i=a(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),l=a(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight),u=-r.scrollLeft+ec(n),d=-r.scrollTop,"rtl"===ee(s).direction&&(u+=a(t.clientWidth,s.clientWidth)-i),o={width:i,height:l,x:u,y:d}}else if($(t)){let e,n,a,s,l,u;n=(e=ed(t,!0,"fixed"===r)).top+t.clientTop,a=e.left+t.clientLeft,s=H(t)?ei(t):i(1),l=t.clientWidth*s.x,u=t.clientHeight*s.y,o={width:l,height:u,x:a*s.x,y:n*s.y}}else{let r=eu(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return S(o)}function eh(e){return"static"===ee(e).position}function ev(e,t){if(!H(e)||"fixed"===ee(e).position)return null;if(t)return t(e);let r=e.offsetParent;return O(e)===r&&(r=r.ownerDocument.body),r}function eg(e,t){var r;let n=I(e);if(U(e))return n;if(!H(e)){let t=er(e);for(;t&&!G(t);){if($(t)&&!eh(t))return t;t=er(t)}return n}let a=ev(e,t);for(;a&&(r=a,B.has(P(r)))&&eh(a);)a=ev(a,t);return a&&G(a)&&eh(a)&&!K(a)?n:a||function(e){let t=er(e);for(;H(t)&&!G(t);){if(K(t))return t;if(U(t))break;t=er(t)}return null}(e)||n}let ey=async function(e){let t=this.getOffsetParent||eg,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=H(t),a=O(t),o="fixed"===r,s=ed(e,!0,o,t),l={scrollLeft:0,scrollTop:0},u=i(0);if(n||!n&&!o)if(("body"!==P(t)||q(a))&&(l=et(t)),n){let e=ed(t,!0,o,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else a&&(u.x=ec(a));o&&!n&&a&&(u.x=ec(a));let d=!a||n||o?i(0):ef(a,l);return{x:s.left+l.scrollLeft-u.x-d.x,y:s.top+l.scrollTop-u.y-d.y,width:s.width,height:s.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},ex={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e,o="fixed"===a,s=O(n),l=!!t&&U(t.floating);if(n===s||l&&o)return r;let u={scrollLeft:0,scrollTop:0},d=i(1),c=i(0),f=H(n);if((f||!f&&!o)&&(("body"!==P(n)||q(s))&&(u=et(n)),H(n))){let e=ed(n);d=ei(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}let m=!s||f||o?i(0):ef(s,u);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-u.scrollLeft*d.x+c.x+m.x,y:r.y*d.y-u.scrollTop*d.y+c.y+m.y}},getDocumentElement:O,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:o,strategy:s}=e,i=[..."clippingAncestors"===r?U(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=en(e,[],!1).filter(e=>$(e)&&"body"!==P(e)),a=null,o="fixed"===ee(e).position,s=o?er(e):e;for(;$(s)&&!G(s);){let t=ee(s),r=K(s);r||"fixed"!==t.position||(a=null),(o?!r&&!a:!r&&"static"===t.position&&!!a&&em.has(a.position)||q(s)&&!r&&function e(t,r){let n=er(t);return!(n===r||!$(n)||G(n))&&("fixed"===ee(n).position||e(n,r))}(e,s))?n=n.filter(e=>e!==s):a=t,s=er(s)}return t.set(e,n),n}(t,this._c):[].concat(r),o],l=i[0],u=i.reduce((e,r)=>{let o=ep(t,r,s);return e.top=a(o.top,e.top),e.right=n(o.right,e.right),e.bottom=n(o.bottom,e.bottom),e.left=a(o.left,e.left),e},ep(t,l,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:eg,getElementRects:ey,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=eo(e);return{width:t,height:r}},getScale:ei,isElement:$,isRTL:function(e){return"rtl"===ee(e).direction}};function eb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ew(e,t,r,o){let i;void 0===o&&(o={});let{ancestorScroll:l=!0,ancestorResize:u=!0,elementResize:d="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:f=!1}=o,m=es(e),p=l||u?[...m?en(m):[],...en(t)]:[];p.forEach(e=>{l&&e.addEventListener("scroll",r,{passive:!0}),u&&e.addEventListener("resize",r)});let h=m&&c?function(e,t){let r,o=null,i=O(e);function l(){var e;clearTimeout(r),null==(e=o)||e.disconnect(),o=null}return!function u(d,c){void 0===d&&(d=!1),void 0===c&&(c=1),l();let f=e.getBoundingClientRect(),{left:m,top:p,width:h,height:v}=f;if(d||t(),!h||!v)return;let g={rootMargin:-s(p)+"px "+-s(i.clientWidth-(m+h))+"px "+-s(i.clientHeight-(p+v))+"px "+-s(m)+"px",threshold:a(0,n(1,c))||1},y=!0;function x(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return u();n?u(!1,n):r=setTimeout(()=>{u(!1,1e-7)},1e3)}1!==n||eb(f,e.getBoundingClientRect())||u(),y=!1}try{o=new IntersectionObserver(x,{...g,root:i.ownerDocument})}catch(e){o=new IntersectionObserver(x,g)}o.observe(e)}(!0),l}(m,r):null,v=-1,g=null;d&&(g=new ResizeObserver(e=>{let[n]=e;n&&n.target===m&&g&&(g.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var e;null==(e=g)||e.observe(t)})),r()}),m&&!f&&g.observe(m),g.observe(t));let y=f?ed(e):null;return f&&function t(){let n=ed(e);y&&!eb(y,n)&&r(),y=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;p.forEach(e=>{l&&e.removeEventListener("scroll",r),u&&e.removeEventListener("resize",r)}),null==h||h(),null==(e=g)||e.disconnect(),g=null,f&&cancelAnimationFrame(i)}}let ek=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:a,y:o,placement:s,middlewareData:i}=t,l=await M(t,e);return s===(null==(r=i.offset)?void 0:r.placement)&&null!=(n=i.arrow)&&n.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:s}}}}},e_=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,a,o,s;let{rects:i,middlewareData:l,placement:u,platform:m,elements:p}=t,{crossAxis:h=!1,alignment:v,allowedPlacements:x=r,autoAlignment:b=!0,...w}=d(e,t),k=void 0!==v||x===r?((s=v||null)?[...x.filter(e=>f(e)===s),...x.filter(e=>f(e)!==s)]:x.filter(e=>c(e)===e)).filter(e=>!s||f(e)===s||!!b&&y(e)!==e):x,_=await N(t,w),j=(null==(n=l.autoPlacement)?void 0:n.index)||0,S=k[j];if(null==S)return{};let E=g(S,i,await (null==m.isRTL?void 0:m.isRTL(p.floating)));if(u!==S)return{reset:{placement:k[0]}};let C=[_[c(S)],_[E[0]],_[E[1]]],L=[...(null==(a=l.autoPlacement)?void 0:a.overflows)||[],{placement:S,overflows:C}],R=k[j+1];if(R)return{data:{index:j+1,overflows:L},reset:{placement:R}};let D=L.map(e=>{let t=f(e.placement);return[e.placement,t&&h?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),T=(null==(o=D.filter(e=>e[2].slice(0,f(e[0])?2:3).every(e=>e<=0))[0])?void 0:o[0])||D[0][0];return T!==u?{data:{index:j+1,overflows:L},reset:{placement:T}}:{}}}},ej=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:o,placement:s}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...f}=d(e,t),p={x:r,y:o},h=await N(t,f),g=v(c(s)),y=m(g),x=p[y],b=p[g];if(i){let e="y"===y?"top":"left",t="y"===y?"bottom":"right",r=x+h[e],o=x-h[t];x=a(r,n(x,o))}if(l){let e="y"===g?"top":"left",t="y"===g?"bottom":"right",r=b+h[e],o=b-h[t];b=a(r,n(b,o))}let w=u.fn({...t,[y]:x,[g]:b});return{...w,data:{x:w.x-r,y:w.y-o,enabled:{[y]:i,[g]:l}}}}}},eS=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n,a,o,s;let i,l,u,{placement:m,middlewareData:p,rects:h,initialPlacement:j,platform:S,elements:E}=t,{mainAxis:C=!0,crossAxis:L=!0,fallbackPlacements:R,fallbackStrategy:D="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:M=!0,...A}=d(e,t);if(null!=(r=p.arrow)&&r.alignmentOffset)return{};let P=c(m),I=v(j),O=c(j)===j,F=await (null==S.isRTL?void 0:S.isRTL(E.floating)),$=R||(O||!M?[_(j)]:(i=_(j),[y(j),i,y(i)])),H="none"!==T;!R&&H&&$.push(...(l=f(j),u=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?b:x;return t?x:b;case"left":case"right":return t?w:k;default:return[]}}(c(j),"start"===T,F),l&&(u=u.map(e=>e+"-"+l),M&&(u=u.concat(u.map(y)))),u));let W=[j,...$],V=await N(t,A),q=[],B=(null==(n=p.flip)?void 0:n.overflows)||[];if(C&&q.push(V[P]),L){let e=g(m,h,F);q.push(V[e[0]],V[e[1]])}if(B=[...B,{placement:m,overflows:q}],!q.every(e=>e<=0)){let e=((null==(a=p.flip)?void 0:a.index)||0)+1,t=W[e];if(t&&("alignment"!==L||I===v(t)||B.every(e=>v(e.placement)!==I||e.overflows[0]>0)))return{data:{index:e,overflows:B},reset:{placement:t}};let r=null==(o=B.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!r)switch(D){case"bestFit":{let e=null==(s=B.filter(e=>{if(H){let t=v(e.placement);return t===I||"y"===t}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])?void 0:s[0];e&&(r=e);break}case"initialPlacement":r=j}if(m!==r)return{reset:{placement:r}}}return{}}}},eE=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,o;let s,i,{placement:l,rects:u,platform:m,elements:p}=t,{apply:h=()=>{},...g}=d(e,t),y=await N(t,g),x=c(l),b=f(l),w="y"===v(l),{width:k,height:_}=u.floating;"top"===x||"bottom"===x?(s=x,i=b===(await (null==m.isRTL?void 0:m.isRTL(p.floating))?"start":"end")?"left":"right"):(i=x,s="end"===b?"top":"bottom");let j=_-y.top-y.bottom,S=k-y.left-y.right,E=n(_-y[s],j),C=n(k-y[i],S),L=!t.middlewareData.shift,R=E,D=C;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(D=S),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(R=j),L&&!b){let e=a(y.left,0),t=a(y.right,0),r=a(y.top,0),n=a(y.bottom,0);w?D=k-2*(0!==e||0!==t?e+t:a(y.left,y.right)):R=_-2*(0!==r||0!==n?r+n:a(y.top,y.bottom))}await h({...t,availableWidth:D,availableHeight:R});let T=await m.getDimensions(p.floating);return k!==T.width||_!==T.height?{reset:{rects:!0}}:{}}}},eC=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r}=t,{strategy:n="referenceHidden",...a}=d(e,t);switch(n){case"referenceHidden":{let e=L(await N(t,{...a,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:R(e)}}}case"escaped":{let e=L(await N(t,{...a,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:R(e)}}}default:return{}}}}},eN=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:o,placement:s,rects:i,platform:l,elements:u,middlewareData:c}=t,{element:h,padding:g=0}=d(e,t)||{};if(null==h)return{};let y=j(g),x={x:r,y:o},b=m(v(s)),w=p(b),k=await l.getDimensions(h),_="y"===b,S=_?"clientHeight":"clientWidth",E=i.reference[w]+i.reference[b]-x[b]-i.floating[w],C=x[b]-i.reference[b],N=await (null==l.getOffsetParent?void 0:l.getOffsetParent(h)),L=N?N[S]:0;L&&await (null==l.isElement?void 0:l.isElement(N))||(L=u.floating[S]||i.floating[w]);let R=L/2-k[w]/2-1,D=n(y[_?"top":"left"],R),T=n(y[_?"bottom":"right"],R),M=L-k[w]-T,A=L/2-k[w]/2+(E/2-C/2),P=a(D,n(A,M)),I=!c.arrow&&null!=f(s)&&A!==P&&i.reference[w]/2-(A<D?D:T)-k[w]/2<0,O=I?A<D?A-D:A-M:0;return{[b]:x[b]+O,data:{[b]:P,centerOffset:A-P-O,...I&&{alignmentOffset:O}},reset:I}}}),eL=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){let{placement:r,elements:o,rects:s,platform:i,strategy:l}=t,{padding:u=2,x:f,y:m}=d(e,t),p=Array.from(await (null==i.getClientRects?void 0:i.getClientRects(o.reference))||[]),h=function(e){let t=e.slice().sort((e,t)=>e.y-t.y),r=[],n=null;for(let e=0;e<t.length;e++){let a=t[e];!n||a.y-n.y>n.height/2?r.push([a]):r[r.length-1].push(a),n=a}return r.map(e=>S(D(e)))}(p),g=S(D(p)),y=j(u),x=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===h.length&&h[0].left>h[1].right&&null!=f&&null!=m)return h.find(e=>f>e.left-y.left&&f<e.right+y.right&&m>e.top-y.top&&m<e.bottom+y.bottom)||g;if(h.length>=2){if("y"===v(r)){let e=h[0],t=h[h.length-1],n="top"===c(r),a=e.top,o=t.bottom,s=n?e.left:t.left,i=n?e.right:t.right;return{top:a,bottom:o,left:s,right:i,width:i-s,height:o-a,x:s,y:a}}let e="left"===c(r),t=a(...h.map(e=>e.right)),o=n(...h.map(e=>e.left)),s=h.filter(r=>e?r.left===o:r.right===t),i=s[0].top,l=s[s.length-1].bottom;return{top:i,bottom:l,left:o,right:t,width:t-o,height:l-i,x:o,y:i}}return g}},floating:o.floating,strategy:l});return s.reference.x!==x.reference.x||s.reference.y!==x.reference.y||s.reference.width!==x.reference.width||s.reference.height!==x.reference.height?{reset:{rects:x}}:{}}}},eR=function(e){return void 0===e&&(e={}),{options:e,fn(t){let{x:r,y:n,placement:a,rects:o,middlewareData:s}=t,{offset:i=0,mainAxis:l=!0,crossAxis:u=!0}=d(e,t),f={x:r,y:n},p=v(a),h=m(p),g=f[h],y=f[p],x=d(i,t),b="number"==typeof x?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(l){let e="y"===h?"height":"width",t=o.reference[h]-o.floating[e]+b.mainAxis,r=o.reference[h]+o.reference[e]-b.mainAxis;g<t?g=t:g>r&&(g=r)}if(u){var w,k;let e="y"===h?"width":"height",t=T.has(c(a)),r=o.reference[p]-o.floating[e]+(t&&(null==(w=s.offset)?void 0:w[p])||0)+(t?0:b.crossAxis),n=o.reference[p]+o.reference[e]+(t?0:(null==(k=s.offset)?void 0:k[p])||0)-(t?b.crossAxis:0);y<r?y=r:y>n&&(y=n)}return{[h]:g,[p]:y}}}},eD=(e,t,r)=>{let n=new Map,a={platform:ex,...r},o={...a.platform,_c:n};return C(e,t,{...a,platform:o})};e.s(["arrow",()=>eN,"autoPlacement",()=>e_,"autoUpdate",()=>ew,"computePosition",()=>eD,"flip",()=>eS,"hide",()=>eC,"inline",()=>eL,"limitShift",()=>eR,"offset",()=>ek,"shift",()=>ej,"size",()=>eE],422957);var eT=e.i(686107),eM=e.i(571577),eA="undefined"!=typeof document?eT.useLayoutEffect:function(){};function eP(e,t){let r,n,a;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!eP(e[n],t[n]))return!1;return!0}if((r=(a=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!({}).hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!=n--;){let r=a[n];if(("_owner"!==r||!e.$$typeof)&&!eP(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function eI(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eO(e,t){let r=eI(e);return Math.round(t*r)/r}function eF(e){let t=eT.useRef(e);return eA(()=>{t.current=e}),t}function e$(e){void 0===e&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:o,floating:s}={},transform:i=!0,whileElementsMounted:l,open:u}=e,[d,c]=eT.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=eT.useState(n);eP(f,n)||m(n);let[p,h]=eT.useState(null),[v,g]=eT.useState(null),y=eT.useCallback(e=>{e!==k.current&&(k.current=e,h(e))},[]),x=eT.useCallback(e=>{e!==_.current&&(_.current=e,g(e))},[]),b=o||p,w=s||v,k=eT.useRef(null),_=eT.useRef(null),j=eT.useRef(d),S=null!=l,E=eF(l),C=eF(a),N=eF(u),L=eT.useCallback(()=>{if(!k.current||!_.current)return;let e={placement:t,strategy:r,middleware:f};C.current&&(e.platform=C.current),eD(k.current,_.current,e).then(e=>{let t={...e,isPositioned:!1!==N.current};R.current&&!eP(j.current,t)&&(j.current=t,eM.flushSync(()=>{c(t)}))})},[f,t,r,C,N]);eA(()=>{!1===u&&j.current.isPositioned&&(j.current.isPositioned=!1,c(e=>({...e,isPositioned:!1})))},[u]);let R=eT.useRef(!1);eA(()=>(R.current=!0,()=>{R.current=!1}),[]),eA(()=>{if(b&&(k.current=b),w&&(_.current=w),b&&w){if(E.current)return E.current(b,w,L);L()}},[b,w,L,E,S]);let D=eT.useMemo(()=>({reference:k,floating:_,setReference:y,setFloating:x}),[y,x]),T=eT.useMemo(()=>({reference:b,floating:w}),[b,w]),M=eT.useMemo(()=>{let e={position:r,left:0,top:0};if(!T.floating)return e;let t=eO(T.floating,d.x),n=eO(T.floating,d.y);return i?{...e,transform:"translate("+t+"px, "+n+"px)",...eI(T.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,i,T.floating,d.x,d.y]);return eT.useMemo(()=>({...d,update:L,refs:D,elements:T,floatingStyles:M}),[d,L,D,T,M])}let eH=(e,t)=>({...ek(e),options:[e,t]}),eW=(e,t)=>({...ej(e),options:[e,t]}),eV=(e,t)=>({...eR(e),options:[e,t]}),eq=(e,t)=>({...eS(e),options:[e,t]}),eB=(e,t)=>({...eE(e),options:[e,t]}),ez=(e,t)=>({...eC(e),options:[e,t]}),eU=(e,t)=>({name:"arrow",options:e,fn(t){let{element:r,padding:n}="function"==typeof e?e(t):e;return r&&({}).hasOwnProperty.call(r,"current")?null!=r.current?eN({element:r.current,padding:n}).fn(t):{}:r?eN({element:r,padding:n}).fn(t):{}},options:[e,t]});e.s(["arrow",()=>eU,"flip",()=>eq,"hide",()=>ez,"limitShift",()=>eV,"offset",()=>eH,"shift",()=>eW,"size",()=>eB,"useFloating",()=>e$],50346)},509377,153840,e=>{"use strict";var t=e.i(686107),r=e.i(50346),n=e.i(422957),a=e.i(692792),o=e.i(666426),s=t.forwardRef((e,t)=>{let{children:r,width:n=10,height:s=5,...i}=e;return(0,o.jsx)(a.Primitive.svg,{...i,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,o.jsx)("polygon",{points:"0,0 30,0 15,10"})})});s.displayName="Arrow";var i=e.i(221588),l=e.i(810096),u=e.i(852947),d=e.i(225088),c="Popper",[f,m]=(0,l.createContextScope)(c),[p,h]=f(c),v=e=>{let{__scopePopper:r,children:n}=e,[a,s]=t.useState(null);return(0,o.jsx)(p,{scope:r,anchor:a,onAnchorChange:s,children:n})};v.displayName=c;var g="PopperAnchor",y=t.forwardRef((e,r)=>{let{__scopePopper:n,virtualRef:s,...l}=e,u=h(g,n),d=t.useRef(null),c=(0,i.useComposedRefs)(r,d),f=t.useRef(null);return t.useEffect(()=>{let e=f.current;f.current=s?.current||d.current,e!==f.current&&u.onAnchorChange(f.current)}),s?null:(0,o.jsx)(a.Primitive.div,{...l,ref:c})});y.displayName=g;var x="PopperContent",[b,w]=f(x),k=t.forwardRef((e,s)=>{let{__scopePopper:l,side:c="bottom",sideOffset:f=0,align:m="center",alignOffset:p=0,arrowPadding:v=0,avoidCollisions:g=!0,collisionBoundary:y=[],collisionPadding:w=0,sticky:k="partial",hideWhenDetached:_=!1,updatePositionStrategy:j="optimized",onPlaced:S,...L}=e,R=h(x,l),[D,T]=t.useState(null),M=(0,i.useComposedRefs)(s,e=>T(e)),[A,P]=t.useState(null),I=function(e){let[r,n]=t.useState(void 0);return(0,d.useLayoutEffect)(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,a;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;n({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),r}(A),O=I?.width??0,F=I?.height??0,$="number"==typeof w?w:{top:0,right:0,bottom:0,left:0,...w},H=Array.isArray(y)?y:[y],W=H.length>0,V={padding:$,boundary:H.filter(E),altBoundary:W},{refs:q,floatingStyles:B,placement:z,isPositioned:U,middlewareData:Q}=(0,r.useFloating)({strategy:"fixed",placement:c+("center"!==m?"-"+m:""),whileElementsMounted:(...e)=>(0,n.autoUpdate)(...e,{animationFrame:"always"===j}),elements:{reference:R.anchor},middleware:[(0,r.offset)({mainAxis:f+F,alignmentAxis:p}),g&&(0,r.shift)({mainAxis:!0,crossAxis:!1,limiter:"partial"===k?(0,r.limitShift)():void 0,...V}),g&&(0,r.flip)({...V}),(0,r.size)({...V,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{let{width:a,height:o}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${r}px`),s.setProperty("--radix-popper-available-height",`${n}px`),s.setProperty("--radix-popper-anchor-width",`${a}px`),s.setProperty("--radix-popper-anchor-height",`${o}px`)}}),A&&(0,r.arrow)({element:A,padding:v}),C({arrowWidth:O,arrowHeight:F}),_&&(0,r.hide)({strategy:"referenceHidden",...V})]}),[Y,X]=N(z),K=(0,u.useCallbackRef)(S);(0,d.useLayoutEffect)(()=>{U&&K?.()},[U,K]);let J=Q.arrow?.x,Z=Q.arrow?.y,G=Q.arrow?.centerOffset!==0,[ee,et]=t.useState();return(0,d.useLayoutEffect)(()=>{D&&et(window.getComputedStyle(D).zIndex)},[D]),(0,o.jsx)("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:U?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[Q.transformOrigin?.x,Q.transformOrigin?.y].join(" "),...Q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,o.jsx)(b,{scope:l,placedSide:Y,onArrowChange:P,arrowX:J,arrowY:Z,shouldHideArrow:G,children:(0,o.jsx)(a.Primitive.div,{"data-side":Y,"data-align":X,...L,ref:M,style:{...L.style,animation:U?void 0:"none"}})})})});k.displayName=x;var _="PopperArrow",j={top:"bottom",right:"left",bottom:"top",left:"right"},S=t.forwardRef(function(e,t){let{__scopePopper:r,...n}=e,a=w(_,r),i=j[a.placedSide];return(0,o.jsx)("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:(0,o.jsx)(s,{...n,ref:t,style:{...n.style,display:"block"}})})});function E(e){return null!==e}S.displayName=_;var C=e=>({name:"transformOrigin",options:e,fn(t){let{placement:r,rects:n,middlewareData:a}=t,o=a.arrow?.centerOffset!==0,s=o?0:e.arrowWidth,i=o?0:e.arrowHeight,[l,u]=N(r),d={start:"0%",center:"50%",end:"100%"}[u],c=(a.arrow?.x??0)+s/2,f=(a.arrow?.y??0)+i/2,m="",p="";return"bottom"===l?(m=o?d:`${c}px`,p=`${-i}px`):"top"===l?(m=o?d:`${c}px`,p=`${n.floating.height+i}px`):"right"===l?(m=`${-i}px`,p=o?d:`${f}px`):"left"===l&&(m=`${n.floating.width+i}px`,p=o?d:`${f}px`),{data:{x:m,y:p}}}});function N(e){let[t,r="center"]=e.split("-");return[t,r]}e.s(["Anchor",()=>y,"Arrow",()=>S,"Content",()=>k,"Root",()=>v,"createPopperScope",()=>m],509377);var L=e.i(571577),R=t.forwardRef((e,r)=>{let{container:n,...s}=e,[i,l]=t.useState(!1);(0,d.useLayoutEffect)(()=>l(!0),[]);let u=n||i&&globalThis?.document?.body;return u?L.default.createPortal((0,o.jsx)(a.Primitive.div,{...s,ref:r}),u):null});R.displayName="Portal",e.s(["Portal",()=>R],153840)},110515,e=>{"use strict";var t=e.i(686107),r=e.i(221588),n=e.i(225088),a=e=>{var a;let s,i,{present:l,children:u}=e,d=function(e){var r,a;let[s,i]=t.useState(),l=t.useRef(null),u=t.useRef(e),d=t.useRef("none"),[c,f]=(r=e?"mounted":"unmounted",a={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},t.useReducer((e,t)=>a[e][t]??e,r));return t.useEffect(()=>{let e=o(l.current);d.current="mounted"===c?e:"none"},[c]),(0,n.useLayoutEffect)(()=>{let t=l.current,r=u.current;if(r!==e){let n=d.current,a=o(t);e?f("MOUNT"):"none"===a||t?.display==="none"?f("UNMOUNT"):r&&n!==a?f("ANIMATION_OUT"):f("UNMOUNT"),u.current=e}},[e,f]),(0,n.useLayoutEffect)(()=>{if(s){let e,t=s.ownerDocument.defaultView??window,r=r=>{let n=o(l.current).includes(CSS.escape(r.animationName));if(r.target===s&&n&&(f("ANIMATION_END"),!u.current)){let r=s.style.animationFillMode;s.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===s.style.animationFillMode&&(s.style.animationFillMode=r)})}},n=e=>{e.target===s&&(d.current=o(l.current))};return s.addEventListener("animationstart",n),s.addEventListener("animationcancel",r),s.addEventListener("animationend",r),()=>{t.clearTimeout(e),s.removeEventListener("animationstart",n),s.removeEventListener("animationcancel",r),s.removeEventListener("animationend",r)}}f("ANIMATION_END")},[s,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:t.useCallback(e=>{l.current=e?getComputedStyle(e):null,i(e)},[])}}(l),c="function"==typeof u?u({present:d.isPresent}):t.Children.only(u),f=(0,r.useComposedRefs)(d.ref,(a=c,(i=(s=Object.getOwnPropertyDescriptor(a.props,"ref")?.get)&&"isReactWarning"in s&&s.isReactWarning)?a.ref:(i=(s=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in s&&s.isReactWarning)?a.props.ref:a.props.ref||a.ref));return"function"==typeof u||d.isPresent?t.cloneElement(c,{ref:f}):null};function o(e){return e?.animationName||"none"}a.displayName="Presence",e.s(["Presence",()=>a])},802313,e=>{"use strict";var t=e.i(686107),r=e.i(225088);t[" useEffectEvent ".trim().toString()],t[" useInsertionEffect ".trim().toString()];var n=t[" useInsertionEffect ".trim().toString()]||r.useLayoutEffect;function a({prop:e,defaultProp:r,onChange:a=()=>{},caller:o}){let[s,i,l]=function({defaultProp:e,onChange:r}){let[a,o]=t.useState(e),s=t.useRef(a),i=t.useRef(r);return n(()=>{i.current=r},[r]),t.useEffect(()=>{s.current!==a&&(i.current?.(a),s.current=a)},[a,s]),[a,o,i]}({defaultProp:r,onChange:a}),u=void 0!==e,d=u?e:s;{let r=t.useRef(void 0!==e);t.useEffect(()=>{let e=r.current;if(e!==u){let t=u?"controlled":"uncontrolled";console.warn(`${o} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}r.current=u},[u,o])}return[d,t.useCallback(t=>{if(u){let r="function"==typeof t?t(e):t;r!==e&&l.current?.(r)}else i(t)},[u,e,i,l])]}Symbol("RADIX:SYNC_STATE"),e.s(["useControllableState",()=>a],802313)},912738,962687,e=>{"use strict";var t=e.i(686107),r=e.i(291967),n=e.i(221588),a=e.i(810096),o=e.i(975287),s=e.i(244107),i=e.i(509377),l=(e.i(153840),e.i(110515)),u=e.i(692792),d=e.i(545136),c=e.i(802313),f=e.i(666426),m=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),p=t.forwardRef((e,t)=>(0,f.jsx)(u.Primitive.span,{...e,ref:t,style:{...m,...e.style}}));p.displayName="VisuallyHidden",e.s(["Root",()=>p,"VISUALLY_HIDDEN_STYLES",()=>m],962687);var[h,v]=(0,a.createContextScope)("Tooltip",[i.createPopperScope]),g=(0,i.createPopperScope)(),y="TooltipProvider",x="tooltip.open",[b,w]=h(y),k=e=>{let{__scopeTooltip:r,delayDuration:n=700,skipDelayDuration:a=300,disableHoverableContent:o=!1,children:s}=e,i=t.useRef(!0),l=t.useRef(!1),u=t.useRef(0);return t.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),(0,f.jsx)(b,{scope:r,isOpenDelayedRef:i,delayDuration:n,onOpen:t.useCallback(()=>{window.clearTimeout(u.current),i.current=!1},[]),onClose:t.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.current=!0,a)},[a]),isPointerInTransitRef:l,onPointerInTransitChange:t.useCallback(e=>{l.current=e},[]),disableHoverableContent:o,children:s})};k.displayName=y;var _="Tooltip",[j,S]=h(_),E=e=>{let{__scopeTooltip:r,children:n,open:a,defaultOpen:o,onOpenChange:l,disableHoverableContent:u,delayDuration:d}=e,m=w(_,e.__scopeTooltip),p=g(r),[h,v]=t.useState(null),y=(0,s.useId)(),b=t.useRef(0),k=u??m.disableHoverableContent,S=d??m.delayDuration,E=t.useRef(!1),[C,N]=(0,c.useControllableState)({prop:a,defaultProp:o??!1,onChange:e=>{e?(m.onOpen(),document.dispatchEvent(new CustomEvent(x))):m.onClose(),l?.(e)},caller:_}),L=t.useMemo(()=>C?E.current?"delayed-open":"instant-open":"closed",[C]),R=t.useCallback(()=>{window.clearTimeout(b.current),b.current=0,E.current=!1,N(!0)},[N]),D=t.useCallback(()=>{window.clearTimeout(b.current),b.current=0,N(!1)},[N]),T=t.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{E.current=!0,N(!0),b.current=0},S)},[S,N]);return t.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),(0,f.jsx)(i.Root,{...p,children:(0,f.jsx)(j,{scope:r,contentId:y,open:C,stateAttribute:L,trigger:h,onTriggerChange:v,onTriggerEnter:t.useCallback(()=>{m.isOpenDelayedRef.current?T():R()},[m.isOpenDelayedRef,T,R]),onTriggerLeave:t.useCallback(()=>{k?D():(window.clearTimeout(b.current),b.current=0)},[D,k]),onOpen:R,onClose:D,disableHoverableContent:k,children:n})})};E.displayName=_;var C="TooltipTrigger",N=t.forwardRef((e,a)=>{let{__scopeTooltip:o,...s}=e,l=S(C,o),d=w(C,o),c=g(o),m=t.useRef(null),p=(0,n.useComposedRefs)(a,m,l.onTriggerChange),h=t.useRef(!1),v=t.useRef(!1),y=t.useCallback(()=>h.current=!1,[]);return t.useEffect(()=>()=>document.removeEventListener("pointerup",y),[y]),(0,f.jsx)(i.Anchor,{asChild:!0,...c,children:(0,f.jsx)(u.Primitive.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...s,ref:p,onPointerMove:(0,r.composeEventHandlers)(e.onPointerMove,e=>{"touch"!==e.pointerType&&(v.current||d.isPointerInTransitRef.current||(l.onTriggerEnter(),v.current=!0))}),onPointerLeave:(0,r.composeEventHandlers)(e.onPointerLeave,()=>{l.onTriggerLeave(),v.current=!1}),onPointerDown:(0,r.composeEventHandlers)(e.onPointerDown,()=>{l.open&&l.onClose(),h.current=!0,document.addEventListener("pointerup",y,{once:!0})}),onFocus:(0,r.composeEventHandlers)(e.onFocus,()=>{h.current||l.onOpen()}),onBlur:(0,r.composeEventHandlers)(e.onBlur,l.onClose),onClick:(0,r.composeEventHandlers)(e.onClick,l.onClose)})})});N.displayName=C;var[L,R]=h("TooltipPortal",{forceMount:void 0}),D="TooltipContent",T=t.forwardRef((e,t)=>{let r=R(D,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...o}=e,s=S(D,e.__scopeTooltip);return(0,f.jsx)(l.Presence,{present:n||s.open,children:s.disableHoverableContent?(0,f.jsx)(O,{side:a,...o,ref:t}):(0,f.jsx)(M,{side:a,...o,ref:t})})}),M=t.forwardRef((e,r)=>{let a=S(D,e.__scopeTooltip),o=w(D,e.__scopeTooltip),s=t.useRef(null),i=(0,n.useComposedRefs)(r,s),[l,u]=t.useState(null),{trigger:d,onClose:c}=a,m=s.current,{onPointerInTransitChange:p}=o,h=t.useCallback(()=>{u(null),p(!1)},[p]),v=t.useCallback((e,t)=>{let r,n=e.currentTarget,a={x:e.clientX,y:e.clientY},o=function(e,t){let r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,a,o)){case o:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw Error("unreachable")}}(a,n.getBoundingClientRect());u(((r=[...function(e,t,r=5){let n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}(a,o),...function(e){let{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}(t.getBoundingClientRect())].slice()).sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:1*!!(e.y>t.y)),function(e){if(e.length<=1)return e.slice();let t=[];for(let r=0;r<e.length;r++){let n=e[r];for(;t.length>=2;){let e=t[t.length-1],r=t[t.length-2];if((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x))t.pop();else break}t.push(n)}t.pop();let r=[];for(let t=e.length-1;t>=0;t--){let n=e[t];for(;r.length>=2;){let e=r[r.length-1],t=r[r.length-2];if((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x))r.pop();else break}r.push(n)}return(r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y)?t:t.concat(r)}(r))),p(!0)},[p]);return t.useEffect(()=>()=>h(),[h]),t.useEffect(()=>{if(d&&m){let e=e=>v(e,m),t=e=>v(e,d);return d.addEventListener("pointerleave",e),m.addEventListener("pointerleave",t),()=>{d.removeEventListener("pointerleave",e),m.removeEventListener("pointerleave",t)}}},[d,m,v,h]),t.useEffect(()=>{if(l){let e=e=>{let t=e.target,r={x:e.clientX,y:e.clientY},n=d?.contains(t)||m?.contains(t),a=!function(e,t){let{x:r,y:n}=e,a=!1;for(let e=0,o=t.length-1;e<t.length;o=e++){let s=t[e],i=t[o],l=s.x,u=s.y,d=i.x,c=i.y;u>n!=c>n&&r<(d-l)*(n-u)/(c-u)+l&&(a=!a)}return a}(r,l);n?h():a&&(h(),c())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[d,m,l,c,h]),(0,f.jsx)(O,{...e,ref:i})}),[A,P]=h(_,{isInside:!1}),I=(0,d.createSlottable)("TooltipContent"),O=t.forwardRef((e,r)=>{let{__scopeTooltip:n,children:a,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,c=S(D,n),m=g(n),{onClose:h}=c;return t.useEffect(()=>(document.addEventListener(x,h),()=>document.removeEventListener(x,h)),[h]),t.useEffect(()=>{if(c.trigger){let e=e=>{let t=e.target;t?.contains(c.trigger)&&h()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[c.trigger,h]),(0,f.jsx)(o.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:h,children:(0,f.jsxs)(i.Content,{"data-state":c.stateAttribute,...m,...d,ref:r,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,f.jsx)(I,{children:a}),(0,f.jsx)(A,{scope:n,isInside:!0,children:(0,f.jsx)(p,{id:c.contentId,role:"tooltip",children:s||a})})]})})});T.displayName=D;var F="TooltipArrow";t.forwardRef((e,t)=>{let{__scopeTooltip:r,...n}=e,a=g(r);return P(F,r).isInside?null:(0,f.jsx)(i.Arrow,{...a,...n,ref:t})}).displayName=F,e.s(["Content",()=>T,"Provider",()=>k,"Root",()=>E,"TooltipProvider",()=>k,"Trigger",()=>N],912738)},933172,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return l},searchParamsToUrlQuery:function(){return o},urlQueryToSearchParams:function(){return i}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});function o(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function s(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function i(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,s(e));else t.set(r,s(n));return t}function l(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},860081,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let o=e.r(744066)._(e.r(933172)),s=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",i=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(o.urlQueryToSearchParams(l)));let d=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||s.test(n))&&!1!==u?(u="//"+(u||""),a&&"/"!==a[0]&&(a="/"+a)):u||(u=""),i&&"#"!==i[0]&&(i="#"+i),d&&"?"!==d[0]&&(d="?"+d),a=a.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${n}${u}${a}${d}${i}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return i(e)}},325201,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=e.r(686107);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=o(e,n)),t&&(a.current=o(t,n))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},212727,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return b},NormalizeError:function(){return y},PageNotFoundError:function(){return x},SP:function(){return h},ST:function(){return v},WEB_VITALS:function(){return o},execOnce:function(){return s},getDisplayName:function(){return c},getLocationOrigin:function(){return u},getURL:function(){return d},isAbsoluteUrl:function(){return l},isResSent:function(){return f},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return m},stringifyError:function(){return k}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let o=["CLS","FCP","FID","INP","LCP","TTFB"];function s(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>i.test(e);function u(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function d(){let{href:e}=window.location,t=u();return e.substring(t.length)}function c(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function m(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Object.defineProperty(Error(`"${c(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let h="undefined"!=typeof performance,v=h&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class y extends Error{}class x extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class b extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function k(e){return JSON.stringify({message:e.message,stack:e.stack})}},487532,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return o}});let n=e.r(212727),a=e.r(675751);function o(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},788282,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},414576,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return g},useLinkStatus:function(){return x}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let o=e.r(744066),s=e.r(666426),i=o._(e.r(686107)),l=e.r(860081),u=e.r(211115),d=e.r(325201),c=e.r(212727),f=e.r(184464);e.r(170349);let m=e.r(562579),p=e.r(487532),h=e.r(198164);function v(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}function g(t){var r;let n,a,o,[l,g]=(0,i.useOptimistic)(m.IDLE_LINK_STATUS),x=(0,i.useRef)(null),{href:b,as:w,children:k,prefetch:_=null,passHref:j,replace:S,shallow:E,scroll:C,onClick:N,onMouseEnter:L,onTouchStart:R,legacyBehavior:D=!1,onNavigate:T,ref:M,unstable_dynamicOnHover:A,...P}=t;n=k,D&&("string"==typeof n||"number"==typeof n)&&(n=(0,s.jsx)("a",{children:n}));let I=i.default.useContext(u.AppRouterContext),O=!1!==_,F=!1!==_?null===(r=_)||"auto"===r?h.FetchStrategy.PPR:h.FetchStrategy.Full:h.FetchStrategy.PPR,{href:$,as:H}=i.default.useMemo(()=>{let e=v(b);return{href:e,as:w?v(w):e}},[b,w]);if(D){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=i.default.Children.only(n)}let W=D?a&&"object"==typeof a&&a.ref:M,V=i.default.useCallback(e=>(null!==I&&(x.current=(0,m.mountLinkInstance)(e,$,I,F,O,g)),()=>{x.current&&((0,m.unmountLinkForCurrentNavigation)(x.current),x.current=null),(0,m.unmountPrefetchableInstance)(e)}),[O,$,I,F,g]),q={ref:(0,d.useMergedRef)(V,W),onClick(t){D||"function"!=typeof N||N(t),D&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!I||t.defaultPrevented||function(t,r,n,a,o,s,l){if("undefined"!=typeof window){let u,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,p.isLocalURL)(r)){o&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:c}=e.r(80755);i.default.startTransition(()=>{c(n||r,o?"replace":"push",s??!0,a.current)})}}(t,$,H,x,S,C,T)},onMouseEnter(e){D||"function"!=typeof L||L(e),D&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),I&&O&&(0,m.onNavigationIntent)(e.currentTarget,!0===A)},onTouchStart:function(e){D||"function"!=typeof R||R(e),D&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),I&&O&&(0,m.onNavigationIntent)(e.currentTarget,!0===A)}};return(0,c.isAbsoluteUrl)(H)?q.href=H:D&&!j&&("a"!==a.type||"href"in a.props)||(q.href=(0,f.addBasePath)(H)),o=D?i.default.cloneElement(a,q):(0,s.jsx)("a",{...P,...q,children:n}),(0,s.jsx)(y.Provider,{value:l,children:o})}e.r(788282);let y=(0,i.createContext)(m.IDLE_LINK_STATUS),x=()=>(0,i.useContext)(y);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},695018,(e,t,r)=>{function n(e,t,r,n){return Math.round(e/r)+" "+n+(t>=1.5*r?"s":"")}t.exports=function(e,t){t=t||{};var r,a,o,s,i=typeof e;if("string"===i&&e.length>0){var l=e;if(!((l=String(l)).length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(u){var d=parseFloat(u[1]);switch((u[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*d;case"weeks":case"week":case"w":return 6048e5*d;case"days":case"day":case"d":return 864e5*d;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*d;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*d;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*d;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:break}}}return}if("number"===i&&isFinite(e)){return t.long?(a=Math.abs(r=e))>=864e5?n(r,a,864e5,"day"):a>=36e5?n(r,a,36e5,"hour"):a>=6e4?n(r,a,6e4,"minute"):a>=1e3?n(r,a,1e3,"second"):r+" ms":(s=Math.abs(o=e))>=864e5?Math.round(o/864e5)+"d":s>=36e5?Math.round(o/36e5)+"h":s>=6e4?Math.round(o/6e4)+"m":s>=1e3?Math.round(o/1e3)+"s":o+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},202311,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={callServer:function(){return o.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return s.findSourceMapURL}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let o=e.r(448597),s=e.r(241752),i=e.r(143432)},345342,e=>{e.v({alignEnd:"trace-viewer-module__m4L2Da__alignEnd",alignStart:"trace-viewer-module__m4L2Da__alignStart",ancestorDuration:"trace-viewer-module__m4L2Da__ancestorDuration",ancestorLine:"trace-viewer-module__m4L2Da__ancestorLine",ancestorLineContainer:"trace-viewer-module__m4L2Da__ancestorLineContainer",ancestorName:"trace-viewer-module__m4L2Da__ancestorName",ancestorNode:"trace-viewer-module__m4L2Da__ancestorNode",ancestorText:"trace-viewer-module__m4L2Da__ancestorText",buttonLink:"trace-viewer-module__m4L2Da__buttonLink",childRow:"trace-viewer-module__m4L2Da__childRow",collapsed:"trace-viewer-module__m4L2Da__collapsed",color0:"trace-viewer-module__m4L2Da__color0",color1:"trace-viewer-module__m4L2Da__color1",color2:"trace-viewer-module__m4L2Da__color2",color3:"trace-viewer-module__m4L2Da__color3",color4:"trace-viewer-module__m4L2Da__color4",colorHighlight:"trace-viewer-module__m4L2Da__colorHighlight",colorVercel:"trace-viewer-module__m4L2Da__colorVercel",cursorMarker:"trace-viewer-module__m4L2Da__cursorMarker",cursorMarkerContainer:"trace-viewer-module__m4L2Da__cursorMarkerContainer",cursorMarkerLabel:"trace-viewer-module__m4L2Da__cursorMarkerLabel",cursorMarkerLabelContainer:"trace-viewer-module__m4L2Da__cursorMarkerLabelContainer",cursorMarkerStickyParent:"trace-viewer-module__m4L2Da__cursorMarkerStickyParent",cursorSelection:"trace-viewer-module__m4L2Da__cursorSelection",customEventColor:"trace-viewer-module__m4L2Da__customEventColor",detailGroup:"trace-viewer-module__m4L2Da__detailGroup",detailHeading:"trace-viewer-module__m4L2Da__detailHeading",detailHeadingIcon:"trace-viewer-module__m4L2Da__detailHeadingIcon",divider:"trace-viewer-module__m4L2Da__divider",eventDefault:"trace-viewer-module__m4L2Da__eventDefault",eventDiamond:"trace-viewer-module__m4L2Da__eventDiamond",eventFailed:"trace-viewer-module__m4L2Da__eventFailed",eventHook:"trace-viewer-module__m4L2Da__eventHook",eventMarker:"trace-viewer-module__m4L2Da__eventMarker",eventMarkers:"trace-viewer-module__m4L2Da__eventMarkers",eventMarkersContainer:"trace-viewer-module__m4L2Da__eventMarkersContainer",eventName:"trace-viewer-module__m4L2Da__eventName",eventRetrying:"trace-viewer-module__m4L2Da__eventRetrying",eventTimestamp:"trace-viewer-module__m4L2Da__eventTimestamp",hasQueuedTime:"trace-viewer-module__m4L2Da__hasQueuedTime",hidden:"trace-viewer-module__m4L2Da__hidden",hoverInfo:"trace-viewer-module__m4L2Da__hoverInfo",huge:"trace-viewer-module__m4L2Da__huge",inert:"trace-viewer-module__m4L2Da__inert",infraSpanDescription:"trace-viewer-module__m4L2Da__infraSpanDescription",mapCanvas:"trace-viewer-module__m4L2Da__mapCanvas",mapContainer:"trace-viewer-module__m4L2Da__mapContainer",mapThumb:"trace-viewer-module__m4L2Da__mapThumb",marker:"trace-viewer-module__m4L2Da__marker",markerLabel:"trace-viewer-module__m4L2Da__markerLabel",markers:"trace-viewer-module__m4L2Da__markers",markersContainer:"trace-viewer-module__m4L2Da__markersContainer",mobile:"trace-viewer-module__m4L2Da__mobile",notch:"trace-viewer-module__m4L2Da__notch",note:"trace-viewer-module__m4L2Da__note",searchBar:"trace-viewer-module__m4L2Da__searchBar",searchInput:"trace-viewer-module__m4L2Da__searchInput",searchInputLabel:"trace-viewer-module__m4L2Da__searchInputLabel",searchInputPrefix:"trace-viewer-module__m4L2Da__searchInputPrefix",selected:"trace-viewer-module__m4L2Da__selected",skeleton:"trace-viewer-module__m4L2Da__skeleton",skeletonRounded:"trace-viewer-module__m4L2Da__skeletonRounded",small:"trace-viewer-module__m4L2Da__small","span-skeleton":"trace-viewer-module__m4L2Da__span-skeleton",spanCancelled:"trace-viewer-module__m4L2Da__spanCancelled",spanCompleted:"trace-viewer-module__m4L2Da__spanCompleted",spanDetailPanel:"trace-viewer-module__m4L2Da__spanDetailPanel",spanDetailPanelAttribute:"trace-viewer-module__m4L2Da__spanDetailPanelAttribute",spanDetailPanelAttributeKey:"trace-viewer-module__m4L2Da__spanDetailPanelAttributeKey",spanDetailPanelAttributeValue:"trace-viewer-module__m4L2Da__spanDetailPanelAttributeValue",spanDetailPanelBody:"trace-viewer-module__m4L2Da__spanDetailPanelBody",spanDetailPanelClose:"trace-viewer-module__m4L2Da__spanDetailPanelClose",spanDetailPanelCloseVerticalRule:"trace-viewer-module__m4L2Da__spanDetailPanelCloseVerticalRule",spanDetailPanelCorner:"trace-viewer-module__m4L2Da__spanDetailPanelCorner",spanDetailPanelCornerInner:"trace-viewer-module__m4L2Da__spanDetailPanelCornerInner",spanDetailPanelDuration:"trace-viewer-module__m4L2Da__spanDetailPanelDuration",spanDetailPanelName:"trace-viewer-module__m4L2Da__spanDetailPanelName",spanDetailPanelQuickLink:"trace-viewer-module__m4L2Da__spanDetailPanelQuickLink",spanDetailPanelQuickLinkLabel:"trace-viewer-module__m4L2Da__spanDetailPanelQuickLinkLabel",spanDetailPanelResizer:"trace-viewer-module__m4L2Da__spanDetailPanelResizer",spanDetailPanelTop:"trace-viewer-module__m4L2Da__spanDetailPanelTop",spanDetailPanelTopInfo:"trace-viewer-module__m4L2Da__spanDetailPanelTopInfo",spanDetailPanelTraceViewer:"trace-viewer-module__m4L2Da__spanDetailPanelTraceViewer",spanDetailPanelTruncatedHeading:"trace-viewer-module__m4L2Da__spanDetailPanelTruncatedHeading",spanDuration:"trace-viewer-module__m4L2Da__spanDuration",spanFailed:"trace-viewer-module__m4L2Da__spanFailed",spanHook:"trace-viewer-module__m4L2Da__spanHook",spanName:"trace-viewer-module__m4L2Da__spanName",spanNameDetailPanel:"trace-viewer-module__m4L2Da__spanNameDetailPanel",spanNode:"trace-viewer-module__m4L2Da__spanNode",spanNodeEvent:"trace-viewer-module__m4L2Da__spanNodeEvent",spanPending:"trace-viewer-module__m4L2Da__spanPending",spanPendingStriped:"trace-viewer-module__m4L2Da__spanPendingStriped",spanRunning:"trace-viewer-module__m4L2Da__spanRunning",spanSleep:"trace-viewer-module__m4L2Da__spanSleep",spanSpacer:"trace-viewer-module__m4L2Da__spanSpacer",timeline:"trace-viewer-module__m4L2Da__timeline",traceNode:"trace-viewer-module__m4L2Da__traceNode",traceViewer:"trace-viewer-module__m4L2Da__traceViewer",traceViewerContent:"trace-viewer-module__m4L2Da__traceViewerContent",unlit:"trace-viewer-module__m4L2Da__unlit",xHover:"trace-viewer-module__m4L2Da__xHover","zoom-buttons-fade-in":"trace-viewer-module__m4L2Da__zoom-buttons-fade-in",zoomButton:"trace-viewer-module__m4L2Da__zoomButton",zoomButtonGroup:"trace-viewer-module__m4L2Da__zoomButtonGroup",zoomButtonTraceViewer:"trace-viewer-module__m4L2Da__zoomButtonTraceViewer"})},403222,e=>{e.v(e.b(["static/chunks/1e906f76938176a7.js","static/chunks/0807db8fd89b4be6.js","static/chunks/turbopack-2622f25fe34cd7ab.js"]))},64016,(e,t,r)=>{"use strict";var n=e.r(686107),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useState,s=n.useEffect,i=n.useLayoutEffect,l=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!a(e,r)}catch(e){return!0}}var d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=o({inst:{value:r,getSnapshot:t}}),a=n[0].inst,d=n[1];return i(function(){a.value=r,a.getSnapshot=t,u(a)&&d({inst:a})},[e,r,t]),s(function(){return u(a)&&d({inst:a}),e(function(){u(a)&&d({inst:a})})},[e]),l(r),r};r.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:d},483309,(e,t,r)=>{"use strict";t.exports=e.r(64016)},169764,360088,655809,418669,275221,710839,823665,531875,886288,687602,762847,545030,524914,857812,658665,806746,897884,259280,932671,257151,545739,195547,742334,e=>{"use strict";let t;function r(e,t){if("string"!=typeof t)return null;let[r,n,...a]=t.split("//");if(r!==e||!n||0===a.length)return null;let o=a.at(-1)??"",s=a.join("//"),i=(n.split("/").at(-1)??"").split(".").at(0)??"";return["default","__default"].includes(o)&&i&&(o=i),{shortName:o,path:n,functionName:s}}function n(e){return r("workflow",e)}function a(e){return r("step",e)}function o(e,t,r){return 1===r?e:t}e.s(["parseStepName",()=>a,"parseWorkflowName",()=>n],360088),e.s(["pluralize",()=>o],655809),e.i(695018),e.s([],418669);var s,i,l,u,d,c,f,m,p,h,v,g,y,x,b,w,k,_,j=e.i(686107),S=e.i(356089);function E(e){if("string"==typeof e&&(e=new Date(e)),!e||!(e instanceof Date))return[0,0];let t=e.getTime();return[Math.floor(t/1e3),t%1e3*1e6]}function C(e){return 1e3*e[0]+e[1]/1e6}function N(e,t){if("string"==typeof e&&(e=new Date(e)),"string"==typeof t&&(t=new Date(t)),!e||!(e instanceof Date))return[0,0];let r=(t&&t instanceof Date?t:new Date).getTime()-e.getTime();return[Math.floor(r/1e3),r%1e3*1e6]}let L={name:"workflow-development-kit",version:"4.0.0"},R=new Set(["hook_created","hook_received","hook_disposed","step_started","step_retrying","step_failed","workflow_failed","wait_created","wait_completed"]);function D(e,t=!0){return e.filter(e=>!t||R.has(e.eventType)).map(e=>{var t;return{name:e.eventType,timestamp:E(e.createdAt),attributes:{eventId:e.eventId,correlationId:e.correlationId,eventData:"eventData"in e?e.eventData:void 0},showVerticalLine:"hook_created"===(t=e.eventType)||"hook_received"===t||"hook_disposed"===t}})}let T=e=>{let t=e.find(e=>"wait_created"===e.eventType);if(!t)return null;let r=e.find(e=>"wait_completed"===e.eventType);return{waitId:t.correlationId,runId:t.runId,createdAt:t.createdAt,resumeAt:t.eventData?.resumeAt,completedAt:r?.createdAt}},M=e=>{let t=e.find(e=>"hook_created"===e.eventType);if(!t)return null;let r=e.filter(e=>"hook_received"===e.eventType),n=e.filter(e=>"hook_disposed"===e.eventType),a=r.at(-1);return{hookId:t.correlationId,runId:t.runId,createdAt:t.createdAt,receivedCount:r.length,lastReceivedAt:a?.createdAt||void 0,disposedAt:n.at(-1)?.createdAt||void 0}};var A=e.i(202311),P=(0,A.createServerReference)("6042bba2f5fc532390b6627a48ab81290f6272e86b",A.callServer,void 0,A.findSourceMapURL,"cancelRun"),I=(0,A.createServerReference)("706077d5d38d36c7d9403c49ab404caa0f41c57d79",A.callServer,void 0,A.findSourceMapURL,"fetchEvents");e.s(["fetchEvents",()=>I],275221);var O=(0,A.createServerReference)("70f0f002f40e64e25c2912afaf3a0c8e6979153434",A.callServer,void 0,A.findSourceMapURL,"fetchEventsByCorrelationId");e.s(["fetchEventsByCorrelationId",()=>O],710839);var F=(0,A.createServerReference)("70e047f875d1cbdf5d00ac3bcafd6c38c9f36d8f27",A.callServer,void 0,A.findSourceMapURL,"fetchHook"),$=(0,A.createServerReference)("607ffe09e3b62823353adf5a532b04cdda5bb7366b",A.callServer,void 0,A.findSourceMapURL,"fetchHooks"),H=(0,A.createServerReference)("70d5a2f0f69f8b9256fec87837c3a5c7d519e6f846",A.callServer,void 0,A.findSourceMapURL,"fetchRun");e.s(["fetchRun",()=>H],823665);var W=(0,A.createServerReference)("6091a1edf0334df36fdbcf6537789e9b47db0372dc",A.callServer,void 0,A.findSourceMapURL,"fetchRuns"),V=(0,A.createServerReference)("78cde4add8a3800f51f1c729d13a2eb9a92b45d5c6",A.callServer,void 0,A.findSourceMapURL,"fetchStep"),q=(0,A.createServerReference)("701628587f01ee067c5c7b5ec6784780caa1bb9ee5",A.callServer,void 0,A.findSourceMapURL,"fetchSteps"),B=(0,A.createServerReference)("6008006ebfa1438a2c3bc7decd52c08ca3487ac23b",A.callServer,void 0,A.findSourceMapURL,"fetchStreams"),z=(0,A.createServerReference)("703cfeac5dd456a92d7169854894b6720aa4be3b07",A.callServer,void 0,A.findSourceMapURL,"readStreamServerAction"),U=(0,A.createServerReference)("60d7d7a08e5b245a44d54528329070a0088a23fee2",A.callServer,void 0,A.findSourceMapURL,"recreateRun"),Q=(0,A.createServerReference)("60fc71cf8cc0a68fb894783ccf362224c872617d76",A.callServer,void 0,A.findSourceMapURL,"reenqueueRun"),Y=(0,A.createServerReference)("703db7e540ae0074631495655227cd0a41e6e966af",A.callServer,void 0,A.findSourceMapURL,"resumeHook"),X=(0,A.createServerReference)("7090a3295cb5cbade67412d22a34d1a91a3505f4a3",A.callServer,void 0,A.findSourceMapURL,"wakeUpRun");async function K(e){let t;try{t=await e}catch(e){t={success:!1,error:e}}if(!t.success){var r;return(console.error("[web-api-client] error",t.error),t.error)?{error:new J((r=t.error).message,{cause:r.cause,request:r.request,layer:r.layer}),result:null}:{error:new J("Unknown error occurred",{layer:"client"}),result:null}}return{error:null,result:t.data}}class J extends Error{request;layer;constructor(e,t){super(e,{cause:t?.cause}),this.name="WorkflowWebAPIError",this.request=t?.request,this.layer=t?.layer,t?.cause instanceof Error&&(this.stack=`${this.stack}
|
|
3
|
+
Caused by: ${t.cause.stack}`)}}function Z(e,t){let{workflowName:r,status:n,limit:a=10,sortOrder:o="desc"}=t,[s,i]=(0,j.useState)(void 0),[l,u]=(0,j.useState)(!1),[d,c]=(0,j.useState)(0),[f,m]=(0,j.useState)([void 0]),[p,h]=(0,j.useState)(1),[v,g]=(0,j.useState)(new Map([[0,{data:null,isLoading:!0,error:null}]])),y=(0,j.useRef)(new Map),x=(0,j.useCallback)(async(t,s,l=!1)=>{let d=s??"initial";if(g(e=>{let r=new Map(e);return r.set(t,{data:e.get(t)?.data??null,isLoading:!0,error:null}),r}),!l&&y.current.has(d)){let e=y.current.get(d);if(e){g(r=>{let n=new Map(r);return n.set(t,{data:e.data,isLoading:!1,error:null}),n}),i(e.cursor),u(e.hasMore);return}}let{error:c,result:f}=await K(W(e,{cursor:s,sortOrder:o,limit:a,workflowName:r,status:n}));c?g(e=>{let r=new Map(e);return r.set(t,{data:e.get(t)?.data??null,isLoading:!1,error:c}),r}):(y.current.set(d,{data:f.data,cursor:f.cursor,hasMore:f.hasMore}),g(e=>{let r=new Map(e);return r.set(t,{data:f.data,isLoading:!1,error:null}),r}),i(f.cursor),u(f.hasMore))},[e,r,a,o,n]);(0,j.useEffect)(()=>{x(0,void 0,!0)},[x,o,e,a,r,n]);let b=(0,j.useCallback)(()=>{if(l&&s){let e=d+1;m(e=>[...e,s]),c(e),h(t=>Math.max(t,e+1)),v.has(e)||g(t=>{let r=new Map(t);return r.set(e,{data:null,isLoading:!0,error:null}),r}),x(e,s)}},[l,s,x,d,v]),w=(0,j.useCallback)(()=>{if(d>0){let e=d-1,t=f[e];c(e),x(e,t)}},[d,f,x]),k=(0,j.useCallback)(()=>{y.current.clear(),g(new Map([[0,{data:null,isLoading:!0,error:null}]])),c(0),m([void 0]),h(1),x(0,void 0,!0)},[x]),_=(0,j.useCallback)(()=>{let e=f[d],t=e??"initial";y.current.delete(t),x(d,e,!0)},[x,d,f]),E=v.get(d)??{data:null,isLoading:!0,error:null},C=Array.from(v.values()).find(e=>e.error)?.error??null,N=Array.from(v.values()).some(e=>e.isLoading),L=l?d+2:d+1,R=d+1,D=(0,S.getPaginationDisplay)(R,p,R===p&&l);return{data:E,allData:Array.from(v.values()),error:C,isLoading:N,currentPage:d,totalPages:L,nextPage:b,previousPage:w,hasNextPage:l,hasPreviousPage:d>0,reload:k,refresh:_,pageInfo:D}}function G(e,t){let{runId:r,limit:n=10,sortOrder:a="desc"}=t,[o,s]=(0,j.useState)(void 0),[i,l]=(0,j.useState)(!1),[u,d]=(0,j.useState)(0),[c,f]=(0,j.useState)([void 0]),[m,p]=(0,j.useState)(1),[h,v]=(0,j.useState)(new Map([[0,{data:null,isLoading:!0,error:null}]])),g=(0,j.useRef)(new Map),y=(0,j.useCallback)(async(t,o,i=!1)=>{let u=o??"initial";if(v(e=>{let r=new Map(e);return r.set(t,{data:e.get(t)?.data??null,isLoading:!0,error:null}),r}),!i&&g.current.has(u)){let e=g.current.get(u);if(e){v(r=>{let n=new Map(r);return n.set(t,{data:e.data,isLoading:!1,error:null}),n}),s(e.cursor),l(e.hasMore);return}}let{error:d,result:c}=await K($(e,{runId:r,cursor:o,sortOrder:a,limit:n}));d?v(e=>{let r=new Map(e);return r.set(t,{data:e.get(t)?.data??null,isLoading:!1,error:d}),r}):(g.current.set(u,{data:c.data,cursor:c.cursor,hasMore:c.hasMore}),v(e=>{let r=new Map(e);return r.set(t,{data:c.data,isLoading:!1,error:null}),r}),s(c.cursor),l(c.hasMore))},[e,r,n,a]);(0,j.useEffect)(()=>{y(0,void 0)},[y]);let x=(0,j.useCallback)(()=>{if(i&&o){let e=u+1;f(e=>[...e,o]),d(e),p(t=>Math.max(t,e+1)),h.has(e)||v(t=>{let r=new Map(t);return r.set(e,{data:null,isLoading:!0,error:null}),r}),y(e,o)}},[i,o,y,u,h]),b=(0,j.useCallback)(()=>{if(u>0){let e=u-1,t=c[e];d(e),y(e,t)}},[u,c,y]),w=(0,j.useCallback)(()=>{g.current.clear(),v(new Map([[0,{data:null,isLoading:!0,error:null}]])),d(0),f([void 0]),p(1),y(0,void 0,!0)},[y]),k=(0,j.useCallback)(()=>{let e=c[u],t=e??"initial";g.current.delete(t),y(u,e,!0)},[y,u,c]),_=h.get(u)??{data:null,isLoading:!0,error:null},E=Array.from(h.values()).find(e=>e.error)?.error??null,C=Array.from(h.values()).some(e=>e.isLoading),N=i?u+2:u+1,L=u+1,R=(0,S.getPaginationDisplay)(L,m,L===m&&i);return{data:_,allData:Array.from(h.values()),error:E,isLoading:C,currentPage:u,totalPages:N,nextPage:x,previousPage:b,hasNextPage:i,hasPreviousPage:u>0,reload:w,refresh:k,pageInfo:R}}async function ee(e,t){let r,n=[];for(;;){let{error:a,result:o}=await K(q(e,t,{cursor:r,sortOrder:"asc",limit:100}));if(a||(n=[...n,...o.data],!o.hasMore||!o.cursor||n.length>=1e3))break;r=o.cursor}return{data:n,cursor:r}}async function et(e,t){let r,n=[];for(;;){let{error:a,result:o}=await K($(e,{runId:t,cursor:r,sortOrder:"asc",limit:100}));if(a||(n=[...n,...o.data],!o.hasMore||!o.cursor||n.length>=1e3))break;r=o.cursor}return{data:n,cursor:r}}async function er(e,t){let r,n=[];for(;;){let{error:a,result:o}=await K(I(e,t,{cursor:r,sortOrder:"asc",limit:1e3}));if(a||(n=[...n,...o.data],!o.hasMore||!o.cursor||n.length>=1e3))break;r=o.cursor}return{data:n,cursor:r}}function en(e,t,r={}){let{live:n=!1}=r,[a,o]=(0,j.useState)(null),[s,i]=(0,j.useState)([]),[l,u]=(0,j.useState)([]),[d,c]=(0,j.useState)([]),[f,m]=(0,j.useState)(!0),[p,h]=(0,j.useState)(!1),[v,g]=(0,j.useState)(null),[y,x]=(0,j.useState)(),[b,w]=(0,j.useState)(),[k,_]=(0,j.useState)(),S=(0,j.useRef)(!1),[E,C]=(0,j.useState)(!1),N=(0,j.useCallback)(async()=>{if(S.current)return;S.current=!0,m(!0),h(!0),g(null);let r=[K(H(e,t)).then(({error:e,result:t})=>e?void g(e):(o(t),t)),ee(e,t).then(e=>{i(e.data),x(e.cursor)}),et(e,t).then(e=>{u(e.data),w(e.cursor)}),er(e,t).then(e=>{c(e.data),_(e.cursor)})],n=await Promise.allSettled(r);m(!1),h(!1),C(!0),S.current=!1;let a=n.find(e=>"rejected"===e.status)?.reason;if(a)return void g(a)},[e,t]),L=(0,j.useCallback)((e,t)=>Array.from(new Map([...e,...t].map(e=>[e.stepId,e])).values()),[]),R=(0,j.useCallback)((e,t)=>Array.from(new Map([...e,...t].map(e=>[e.hookId,e])).values()),[]),D=(0,j.useCallback)((e,t)=>Array.from(new Map([...e,...t].map(e=>[e.eventId,e])).values()),[]),T=(0,j.useCallback)(async()=>{if(a?.completedAt)return!1;let{error:r,result:n}=await K(H(e,t));return r?(g(r),!1):(o(n),!0)},[e,t,a?.completedAt]),M=(0,j.useCallback)(async()=>{let{error:r,result:n}=await K(q(e,t,{cursor:y,sortOrder:"asc",limit:10}));return r?(g(r),!1):n.data.length>0&&(i(e=>L(e,n.data)),n.cursor&&n.hasMore&&x(n.cursor),!0)},[e,t,y,L]),A=(0,j.useCallback)(async()=>{let{error:r,result:n}=await K($(e,{runId:t,cursor:b,sortOrder:"asc",limit:10}));return r?(g(r),!1):n.data.length>0&&(u(e=>R(e,n.data)),n.cursor&&w(n.cursor),!0)},[e,t,b,R]),P=(0,j.useCallback)(async()=>{let{error:r,result:n}=await K(I(e,t,{cursor:k,sortOrder:"asc",limit:10}));return r?(g(r),!1):n.data.length>0&&(c(e=>D(e,n.data)),n.cursor&&_(n.cursor),!0)},[e,t,k,D]),O=(0,j.useCallback)(async(e=!1)=>{if(S.current||!E)return{foundNewItems:!1};let t=!1;try{let[r,n,a,o]=await Promise.all([e?Promise.resolve(!1):T(),M(),e?Promise.resolve(!1):A(),e?Promise.resolve(!1):P()]);t=n||a||o}catch(e){console.error("Update error:",e)}return{foundNewItems:t}},[M,A,P,E,T]);return(0,j.useEffect)(()=>{N()},[N]),(0,j.useEffect)(()=>{if(!n||!E||a?.completedAt)return;let e=setInterval(()=>{O()},5e3),t=setInterval(()=>{O(!0)},2e3);return()=>{clearInterval(e),clearInterval(t)}},[n,E,O,a?.completedAt]),{run:a??{},steps:s,hooks:l,events:d,loading:f,auxiliaryDataLoading:p,error:v,update:O}}async function ea(e,t,r,n={}){let a,o,s=n.resolveData??"all";if("run"===t){let{error:t,result:n}=await K(H(e,r,s));if(t)throw t;o=(a=n).runId}else if("step"===t){let{runId:t}=n;if(!t)throw new J("runId is required for step resource",{layer:"client"});let{error:i,result:l}=await K(V(e,t,r,s));if(i)throw i;o=(a=l).stepId}else if("hook"===t){let{error:t,result:n}=await K(F(e,r,s));if(t)throw t;o=(a=n).hookId}else throw new J(`Unknown resource type: ${t}`,{layer:"client"});return{data:a,correlationId:o}}function eo(e,t,r,n={}){let{refreshInterval:a=0,runId:o}=n,[s,i]=(0,j.useState)(null),[l,u]=(0,j.useState)(!0),[d,c]=(0,j.useState)(null),f=(0,j.useCallback)(async()=>{if(i(null),c(null),"hook"===t||"sleep"===t){let{error:n,result:a}=await K(O(e,r,{sortOrder:"asc",limit:100,withData:!0}));if(n)return void c(n);let o=a.data,s="hook"===t?M(o):T(o);return null===s?void c(Error(`Failed to load ${t} details: missing required event data`)):void i(s)}u(!0);try{let{data:n}=await ea(e,t,r,{runId:o});i(n)}catch(e){e instanceof Error?c(e):c(Error(String(e)));return}finally{u(!1)}},[e,t,r,o]);return(0,j.useEffect)(()=>{f()},[f]),(0,j.useEffect)(()=>{if(!a||a<=0)return;let e=setInterval(f,a);return()=>clearInterval(e)},[a,f]),{data:s,loading:l,error:d,refresh:f}}async function es(e,t){let{error:r}=await K(P(e,t));if(r)throw r}async function ei(e,t){let{error:r,result:n}=await K(U(e,t));if(r)throw r;return n}async function el(e,t){let{error:r}=await K(Q(e,t));if(r)throw r}async function eu(e,t,r){let{error:n,result:a}=await K(X(e,t,r));if(n)throw n;return a}async function ed(e,t,r){let{error:n,result:a}=await K(Y(e,t,r));if(n)throw n;return a}async function ec(e,t,r){try{let n=await z(e,t,r);if(!n)throw new J("Failed to read stream",{layer:"client"});if("object"==typeof n&&null!==n&&"message"in n&&"layer"in n&&"cause"in n&&"request"in n)throw new J(n.message,{layer:"client",cause:n.cause,request:n.request});return n}catch(e){if(e instanceof J)throw e;throw new J("Failed to read stream",{layer:"client",cause:e})}}async function ef(e,t){let{error:r,result:n}=await K(B(e,t));if(r)throw r;return n}function em(e,t,r=1e4){let[n,a]=(0,j.useState)([]),[o,s]=(0,j.useState)(!0),[i,l]=(0,j.useState)(null),u=(0,j.useCallback)(async()=>{s(!0),l(null);try{let r=await ef(e,t);a(r)}catch(e){l(e instanceof Error?e:Error(String(e)))}finally{s(!1)}},[e,t]);return(0,j.useEffect)(()=>{u()},[u]),(0,j.useEffect)(()=>{if(!r||r<=0)return;let e=setInterval(u,r);return()=>clearInterval(e)},[r,u]),{streams:n,loading:o,error:i,refresh:u}}e.s(["WorkflowWebAPIError",()=>J,"cancelRun",()=>es,"getErrorMessage",0,e=>"layer"in e&&e.layer?e instanceof J&&e.request?.status===403?"Your current vercel account does not have access to this resource. Use `vercel login` or `vercel switch` to ensure you are linked to the right account. You might need to run `vercel env pull` to use the latest environment variables.":e.message:e instanceof Error?e.message:"An error occurred","readStream",()=>ec,"recreateRun",()=>ei,"reenqueueRun",()=>el,"resumeHook",()=>ed,"unwrapServerActionResult",()=>K,"useWorkflowHooks",()=>G,"useWorkflowResourceData",()=>eo,"useWorkflowRuns",()=>Z,"useWorkflowStreams",()=>em,"useWorkflowTraceViewerData",()=>en,"wakeUpRun",()=>eu],531875);var ep=e.i(666426),eh=j;let ev=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var eg={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"};let ey=(0,j.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:o,iconNode:s,...i},l)=>(0,j.createElement)("svg",{ref:l,...eg,width:t,height:t,stroke:e,strokeWidth:n?24*Number(r)/Number(t):r,className:ev("lucide",a),...i},[...s.map(([e,t])=>(0,j.createElement)(e,t)),...Array.isArray(o)?o:[o]])),ex=(e,t)=>{let r=(0,j.forwardRef)(({className:r,...n},a)=>(0,j.createElement)(ey,{ref:a,iconNode:t,className:ev(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...n}));return r.displayName=`${e}`,r};e.s(["default",()=>ex],886288);let eb=ex("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",()=>eb],687602);let ew=ex("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);function ek({title:e,className:t,details:r="Unknown error"}){let[n,a]=(0,j.useState)(!1);return(0,ep.jsx)("div",{className:"flex justify-center w-full",children:(0,ep.jsxs)("div",{className:(0,S.cn)("rounded-lg border border-destructive/50 bg-destructive/5 w-full max-w-[800px]",t),children:[(0,ep.jsxs)("button",{type:"button",onClick:()=>a(!n),className:"w-full px-4 py-3 flex items-center justify-between gap-2 text-left hover:bg-destructive/10 transition-colors",children:[(0,ep.jsxs)("div",{className:"flex items-center gap-2 text-destructive",children:[(0,ep.jsx)(eb,{className:"h-4 w-4 shrink-0"}),(0,ep.jsx)("span",{className:"font-medium text-sm",children:e})]}),(0,ep.jsxs)("div",{className:"flex items-center gap-1.5 text-destructive/70",children:[(0,ep.jsx)("span",{className:"text-xs",children:"Click to show details"}),(0,ep.jsx)(ew,{className:(0,S.cn)("h-4 w-4 transition-transform duration-200",n&&"rotate-180")})]})]}),n&&r&&(0,ep.jsx)("div",{className:"px-4 pb-3 border-t border-destructive/20",children:(0,ep.jsx)("pre",{className:"mt-3 p-3 rounded-md bg-destructive/10 text-destructive text-xs font-mono whitespace-pre-wrap break-words overflow-auto",children:r})})]})})}e.s(["ChevronDown",()=>ew],762847);class e_ extends eh.default.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("Error caught by boundary:",e,t)}handleReset=()=>{this.setState({hasError:!1,error:null})};render(){if(this.state.hasError&&this.state.error){if(this.props.fallback)return this.props.fallback(this.state.error,this.handleReset);let e=this.state.error.stack?`${this.state.error.message}
|
|
4
|
+
|
|
5
|
+
${this.state.error.stack}`:this.state.error.message;return(0,ep.jsx)(ek,{title:this.props.title||"An error occurred",details:e})}return this.props.children}}e.s(["ErrorBoundary",()=>e_],545030);let ej=ex("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>ej],524914);let eS=ex("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);function eE({event:e,env:t}){var r;let[n,a]=(0,j.useState)(!1),[o,s]=(0,j.useState)(!1),[i,l]=(0,j.useState)(null),[u,d]=(0,j.useState)(null),c="step_failed"===(r=e.eventType)||"workflow_failed"===r?{color:"var(--ds-red-600)",background:"var(--ds-red-100)",border:"var(--ds-red-500)",text:"var(--ds-red-900)",secondary:"var(--ds-red-700)"}:"step_retrying"===r?{color:"var(--ds-amber-600)",background:"var(--ds-amber-100)",border:"var(--ds-amber-500)",text:"var(--ds-amber-900)",secondary:"var(--ds-amber-700)"}:"hook_created"===r||"hook_received"===r||"hook_disposed"===r?{color:"var(--ds-purple-600)",background:"var(--ds-purple-100)",border:"var(--ds-purple-500)",text:"var(--ds-purple-900)",secondary:"var(--ds-purple-700)"}:{color:"var(--ds-blue-600)",background:"var(--ds-blue-100)",border:"var(--ds-blue-500)",text:"var(--ds-blue-900)",secondary:"var(--ds-blue-700)"},f=new Date(e.createdAt),m="eventData"in e&&null!=e.eventData,p=(0,j.useCallback)(async()=>{if(null===i&&!m&&e.correlationId){s(!0),d(null);try{let r=await O(t,e.correlationId,{sortOrder:"asc",limit:100,withData:!0});if(!r.success)return void d(r.error?.message||"Failed to load event details");let n=r.data.data.find(t=>t.eventId===e.eventId);n&&"eventData"in n&&l(n.eventData)}catch(e){d(e instanceof Error?e.message:"Failed to load event details")}finally{s(!1)}}},[t,e.correlationId,e.eventId,i,m]),h=(0,j.useCallback)(()=>{let e=!n;a(e),e&&null===i&&!m&&p()},[n,i,m,p]),v=m?e.eventData:i;return(0,ep.jsxs)("div",{className:"rounded-lg border overflow-hidden transition-all",style:{backgroundColor:"var(--ds-background-100)",borderColor:c.border,borderLeftWidth:"1px",borderLeftColor:c.color},children:[(0,ep.jsxs)("button",{type:"button",onClick:h,className:"w-full text-left grid gap-3 items-center px-0 py-2 text-xs hover:brightness-[0.98] transition-all cursor-pointer",style:{gridTemplateColumns:"24px 100px minmax(120px, auto) 1fr 1fr"},children:[(0,ep.jsx)("div",{className:"flex justify-center",children:(0,ep.jsx)(ej,{className:"h-3.5 w-3.5 transition-transform",style:{color:c.secondary,transform:n?"rotate(90deg)":"rotate(0deg)"}})}),(0,ep.jsx)("div",{className:"font-mono tabular-nums",style:{color:c.secondary},children:f.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})+"."+f.getMilliseconds().toString().padStart(3,"0")}),(0,ep.jsx)("div",{className:"font-medium",style:{color:c.text},children:(0,ep.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,ep.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:c.color}}),e.eventType.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")]})}),(0,ep.jsx)("div",{className:"font-mono text-[11px] overflow-hidden text-ellipsis whitespace-nowrap",style:{color:c.secondary},title:e.correlationId||"-",children:e.correlationId||"-"}),(0,ep.jsx)("div",{className:"font-mono text-[11px] pr-3 overflow-hidden text-ellipsis whitespace-nowrap",style:{color:c.secondary},title:e.eventId,children:e.eventId})]}),n&&(0,ep.jsxs)("div",{className:"border-t px-4 py-3",style:{borderColor:c.border,backgroundColor:"var(--ds-background-100)"},children:[(0,ep.jsxs)("div",{className:"flex flex-col divide-y rounded-md border overflow-hidden",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)"},children:[(0,ep.jsx)(eC,{label:"Event ID",value:e.eventId,mono:!0}),(0,ep.jsx)(eC,{label:"Event Type",value:e.eventType}),(0,ep.jsx)(eC,{label:"Correlation ID",value:e.correlationId||"-",mono:!0}),(0,ep.jsx)(eC,{label:"Run ID",value:e.runId,mono:!0}),(0,ep.jsx)(eC,{label:"Created At",value:f.toLocaleString(void 0,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3})})]}),(0,ep.jsxs)("div",{className:"mt-3",children:[(0,ep.jsx)("div",{className:"text-xs font-medium mb-1.5",style:{color:"var(--ds-gray-700)"},children:"Event Data"}),o&&(0,ep.jsxs)("div",{className:"flex items-center gap-2 rounded-md border p-3",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)"},children:[(0,ep.jsx)(eS,{className:"h-4 w-4 animate-spin",style:{color:"var(--ds-gray-700)"}}),(0,ep.jsx)("span",{className:"text-xs",style:{color:"var(--ds-gray-700)"},children:"Loading event details..."})]}),u&&!o&&(0,ep.jsx)("div",{className:"rounded-md border p-3 text-xs",style:{borderColor:"var(--ds-red-400)",backgroundColor:"var(--ds-red-100)",color:"var(--ds-red-900)"},children:u}),!o&&!u&&null!=v&&(0,ep.jsx)("pre",{className:"text-[11px] overflow-x-auto rounded-md border p-3",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)",color:"var(--ds-gray-1000)"},children:(0,ep.jsx)("code",{children:JSON.stringify(v,null,2)})}),!o&&!u&&null==v&&!e.correlationId&&(0,ep.jsx)("div",{className:"rounded-md border p-3 text-xs",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)",color:"var(--ds-gray-700)"},children:"No event data available"}),!o&&!u&&null==v&&e.correlationId&&!m&&null===i&&(0,ep.jsx)("div",{className:"rounded-md border p-3 text-xs",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)",color:"var(--ds-gray-700)"},children:"No event data for this event type"})]})]})]})}function eC({label:e,value:t,mono:r=!1}){return(0,ep.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5",style:{borderColor:"var(--ds-gray-300)"},children:[(0,ep.jsx)("span",{className:"text-[11px] font-medium",style:{color:"var(--ds-gray-700)"},children:e}),(0,ep.jsx)("span",{className:`text-[11px] ${r?"font-mono":""} text-right max-w-[70%] break-all`,style:{color:"var(--ds-gray-1000)"},children:t})]})}function eN({events:e,env:t}){let r=(0,j.useMemo)(()=>e&&0!==e.length?[...e].sort((e,t)=>new Date(e.createdAt).getTime()-new Date(t.createdAt).getTime()):[],[e]);return e&&0!==e.length?(0,ep.jsxs)("div",{className:"h-full overflow-auto m-2",children:[(0,ep.jsxs)("div",{className:"grid gap-3 pb-2 mb-2 border-b text-xs font-medium sticky top-0 z-10",style:{gridTemplateColumns:"24px 100px minmax(120px, auto) 1fr 1fr",borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-background-100)",color:"var(--ds-gray-700)"},children:[(0,ep.jsx)("div",{}),(0,ep.jsx)("div",{children:"Time"}),(0,ep.jsx)("div",{children:"Event Type"}),(0,ep.jsx)("div",{children:"Correlation ID"}),(0,ep.jsx)("div",{children:"Event ID"})]}),(0,ep.jsx)("div",{className:"flex flex-col gap-2",children:r.map(e=>(0,ep.jsx)(eE,{event:e,env:t},e.eventId))}),(0,ep.jsxs)("div",{className:"mt-4 pt-3 border-t text-xs",style:{borderColor:"var(--ds-gray-300)",color:"var(--ds-gray-700)"},children:[r.length," event",1!==r.length?"s":""," total"]})]}):(0,ep.jsx)("div",{className:"flex items-center justify-center h-full text-sm",style:{color:"var(--ds-gray-700)"},children:"No events found"})}e.s(["Loader2",()=>eS],857812),e.s(["EventListView",()=>eN],658665);let eL=ex("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var eR=e.i(571577);let eD=Array(12).fill(0),eT=({visible:e,className:t})=>j.default.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},j.default.createElement("div",{className:"sonner-spinner"},eD.map((e,t)=>j.default.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),eM=j.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.default.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"})),eA=j.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},j.default.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"})),eP=j.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.default.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"})),eI=j.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.default.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"})),eO=j.default.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"},j.default.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),j.default.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),eF=1,e$=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,a="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:eF++,o=this.toasts.find(e=>e.id===a),s=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(t=>t.id===a?(this.publish({...t,...e,id:a,title:r}),{...t,...e,id:a,dismissible:s,title:r}):t):this.addToast({title:r,...n,dismissible:s,id:a}),a},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{let r,n;if(!t)return;void 0!==t.loading&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let a=Promise.resolve(e instanceof Function?e():e),o=void 0!==n,s=a.then(async e=>{if(r=["resolve",e],j.default.isValidElement(e))o=!1,this.create({id:n,type:"default",message:e});else if(eH(e)&&!e.ok){o=!1;let r="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,a="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description,s="object"!=typeof r||j.default.isValidElement(r)?{message:r}:r;this.create({id:n,type:"error",description:a,...s})}else if(e instanceof Error){o=!1;let r="function"==typeof t.error?await t.error(e):t.error,a="function"==typeof t.description?await t.description(e):t.description,s="object"!=typeof r||j.default.isValidElement(r)?{message:r}:r;this.create({id:n,type:"error",description:a,...s})}else if(void 0!==t.success){o=!1;let r="function"==typeof t.success?await t.success(e):t.success,a="function"==typeof t.description?await t.description(e):t.description,s="object"!=typeof r||j.default.isValidElement(r)?{message:r}:r;this.create({id:n,type:"success",description:a,...s})}}).catch(async e=>{if(r=["reject",e],void 0!==t.error){o=!1;let r="function"==typeof t.error?await t.error(e):t.error,a="function"==typeof t.description?await t.description(e):t.description,s="object"!=typeof r||j.default.isValidElement(r)?{message:r}:r;this.create({id:n,type:"error",description:a,...s})}}).finally(()=>{o&&(this.dismiss(n),n=void 0),null==t.finally||t.finally.call(t)}),i=()=>new Promise((e,t)=>s.then(()=>"reject"===r[0]?t(r[1]):e(r[1])).catch(t));return"string"!=typeof n&&"number"!=typeof n?{unwrap:i}:Object.assign(n,{unwrap:i})},this.custom=(e,t)=>{let r=(null==t?void 0:t.id)||eF++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},eH=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,eW=Object.assign((e,t)=>{let r=(null==t?void 0:t.id)||eF++;return e$.addToast({title:e,...t,id:r}),r},{success:e$.success,info:e$.info,warning:e$.warning,error:e$.error,custom:e$.custom,message:e$.message,promise:e$.promise,dismiss:e$.dismiss,loading:e$.loading},{getHistory:()=>e$.toasts,getToasts:()=>e$.getActiveToasts()});function eV(e){return void 0!==e.label}function eq(...e){return e.filter(Boolean).join(" ")}!function(e){if(!e||"undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}("[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}[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(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-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]{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%)}");let eB=e=>{var t,r,n,a,o,s,i,l,u,d,c,f,m;let{invert:p,toast:h,unstyled:v,interacting:g,setHeights:y,visibleToasts:x,heights:b,index:w,toasts:k,expanded:_,removeToast:S,defaultRichColors:E,closeButton:C,style:N,cancelButtonStyle:L,actionButtonStyle:R,className:D="",descriptionClassName:T="",duration:M,position:A,gap:P,expandByDefault:I,classNames:O,icons:F,closeButtonAriaLabel:$="Close toast"}=e,[H,W]=j.default.useState(null),[V,q]=j.default.useState(null),[B,z]=j.default.useState(!1),[U,Q]=j.default.useState(!1),[Y,X]=j.default.useState(!1),[K,J]=j.default.useState(!1),[Z,G]=j.default.useState(!1),[ee,et]=j.default.useState(0),[er,en]=j.default.useState(0),ea=j.default.useRef(h.duration||M||4e3),eo=j.default.useRef(null),es=j.default.useRef(null),ei=0===w,el=w+1<=x,eu=h.type,ed=!1!==h.dismissible,ec=h.className||"",ef=h.descriptionClassName||"",em=j.default.useMemo(()=>b.findIndex(e=>e.toastId===h.id)||0,[b,h.id]),ep=j.default.useMemo(()=>{var e;return null!=(e=h.closeButton)?e:C},[h.closeButton,C]),eh=j.default.useMemo(()=>h.duration||M||4e3,[h.duration,M]),ev=j.default.useRef(0),eg=j.default.useRef(0),ey=j.default.useRef(0),ex=j.default.useRef(null),[eb,ew]=A.split("-"),ek=j.default.useMemo(()=>b.reduce((e,t,r)=>r>=em?e:e+t.height,0),[b,em]),e_=(()=>{let[e,t]=j.default.useState(document.hidden);return j.default.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),ej=h.invert||p,eS="loading"===eu;eg.current=j.default.useMemo(()=>em*P+ek,[em,ek]),j.default.useEffect(()=>{ea.current=eh},[eh]),j.default.useEffect(()=>{z(!0)},[]),j.default.useEffect(()=>{let e=es.current;if(e){let t=e.getBoundingClientRect().height;return en(t),y(e=>[{toastId:h.id,height:t,position:h.position},...e]),()=>y(e=>e.filter(e=>e.toastId!==h.id))}},[y,h.id]),j.default.useLayoutEffect(()=>{if(!B)return;let e=es.current,t=e.style.height;e.style.height="auto";let r=e.getBoundingClientRect().height;e.style.height=t,en(r),y(e=>e.find(e=>e.toastId===h.id)?e.map(e=>e.toastId===h.id?{...e,height:r}:e):[{toastId:h.id,height:r,position:h.position},...e])},[B,h.title,h.description,y,h.id,h.jsx,h.action,h.cancel]);let eE=j.default.useCallback(()=>{Q(!0),et(eg.current),y(e=>e.filter(e=>e.toastId!==h.id)),setTimeout(()=>{S(h)},200)},[h,S,y,eg]);j.default.useEffect(()=>{let e;if((!h.promise||"loading"!==eu)&&h.duration!==1/0&&"loading"!==h.type){if(_||g||e_){if(ey.current<ev.current){let e=new Date().getTime()-ev.current;ea.current=ea.current-e}ey.current=new Date().getTime()}else ea.current!==1/0&&(ev.current=new Date().getTime(),e=setTimeout(()=>{null==h.onAutoClose||h.onAutoClose.call(h,h),eE()},ea.current));return()=>clearTimeout(e)}},[_,g,h,eu,e_,eE]),j.default.useEffect(()=>{h.delete&&(eE(),null==h.onDismiss||h.onDismiss.call(h,h))},[eE,h.delete]);let eC=h.icon||(null==F?void 0:F[eu])||(e=>{switch(e){case"success":return eM;case"info":return eP;case"warning":return eA;case"error":return eI;default:return null}})(eu);return j.default.createElement("li",{tabIndex:0,ref:es,className:eq(D,ec,null==O?void 0:O.toast,null==h||null==(t=h.classNames)?void 0:t.toast,null==O?void 0:O.default,null==O?void 0:O[eu],null==h||null==(r=h.classNames)?void 0:r[eu]),"data-sonner-toast":"","data-rich-colors":null!=(d=h.richColors)?d:E,"data-styled":!(h.jsx||h.unstyled||v),"data-mounted":B,"data-promise":!!h.promise,"data-swiped":Z,"data-removed":U,"data-visible":el,"data-y-position":eb,"data-x-position":ew,"data-index":w,"data-front":ei,"data-swiping":Y,"data-dismissible":ed,"data-type":eu,"data-invert":ej,"data-swipe-out":K,"data-swipe-direction":V,"data-expanded":!!(_||I&&B),"data-testid":h.testId,style:{"--index":w,"--toasts-before":w,"--z-index":k.length-w,"--offset":`${U?ee:eg.current}px`,"--initial-height":I?"auto":`${er}px`,...N,...h.style},onDragEnd:()=>{X(!1),W(null),ex.current=null},onPointerDown:e=>{2===e.button||eS||!ed||(eo.current=new Date,et(eg.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(X(!0),ex.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,r,n,a;if(K||!ed)return;ex.current=null;let o=Number((null==(e=es.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),s=Number((null==(t=es.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),i=new Date().getTime()-(null==(r=eo.current)?void 0:r.getTime()),l="x"===H?o:s,u=Math.abs(l)/i;if(Math.abs(l)>=45||u>.11){et(eg.current),null==h.onDismiss||h.onDismiss.call(h,h),"x"===H?q(o>0?"right":"left"):q(s>0?"down":"up"),eE(),J(!0);return}null==(n=es.current)||n.style.setProperty("--swipe-amount-x","0px"),null==(a=es.current)||a.style.setProperty("--swipe-amount-y","0px"),G(!1),X(!1),W(null)},onPointerMove:t=>{var r,n,a,o;if(!ex.current||!ed||(null==(r=window.getSelection())?void 0:r.toString().length)>0)return;let s=t.clientY-ex.current.y,i=t.clientX-ex.current.x,l=null!=(o=e.swipeDirections)?o:function(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}(A);!H&&(Math.abs(i)>1||Math.abs(s)>1)&&W(Math.abs(i)>Math.abs(s)?"x":"y");let u={x:0,y:0},d=e=>1/(1.5+Math.abs(e)/20);if("y"===H){if(l.includes("top")||l.includes("bottom"))if(l.includes("top")&&s<0||l.includes("bottom")&&s>0)u.y=s;else{let e=s*d(s);u.y=Math.abs(e)<Math.abs(s)?e:s}}else if("x"===H&&(l.includes("left")||l.includes("right")))if(l.includes("left")&&i<0||l.includes("right")&&i>0)u.x=i;else{let e=i*d(i);u.x=Math.abs(e)<Math.abs(i)?e:i}(Math.abs(u.x)>0||Math.abs(u.y)>0)&&G(!0),null==(n=es.current)||n.style.setProperty("--swipe-amount-x",`${u.x}px`),null==(a=es.current)||a.style.setProperty("--swipe-amount-y",`${u.y}px`)}},ep&&!h.jsx&&"loading"!==eu?j.default.createElement("button",{"aria-label":$,"data-disabled":eS,"data-close-button":!0,onClick:eS||!ed?()=>{}:()=>{eE(),null==h.onDismiss||h.onDismiss.call(h,h)},className:eq(null==O?void 0:O.closeButton,null==h||null==(n=h.classNames)?void 0:n.closeButton)},null!=(c=null==F?void 0:F.close)?c:eO):null,(eu||h.icon||h.promise)&&null!==h.icon&&((null==F?void 0:F[eu])!==null||h.icon)?j.default.createElement("div",{"data-icon":"",className:eq(null==O?void 0:O.icon,null==h||null==(a=h.classNames)?void 0:a.icon)},h.promise||"loading"===h.type&&!h.icon?h.icon||((null==F?void 0:F.loading)?j.default.createElement("div",{className:eq(null==O?void 0:O.loader,null==h||null==(m=h.classNames)?void 0:m.loader,"sonner-loader"),"data-visible":"loading"===eu},F.loading):j.default.createElement(eT,{className:eq(null==O?void 0:O.loader,null==h||null==(f=h.classNames)?void 0:f.loader),visible:"loading"===eu})):null,"loading"!==h.type?eC:null):null,j.default.createElement("div",{"data-content":"",className:eq(null==O?void 0:O.content,null==h||null==(o=h.classNames)?void 0:o.content)},j.default.createElement("div",{"data-title":"",className:eq(null==O?void 0:O.title,null==h||null==(s=h.classNames)?void 0:s.title)},h.jsx?h.jsx:"function"==typeof h.title?h.title():h.title),h.description?j.default.createElement("div",{"data-description":"",className:eq(T,ef,null==O?void 0:O.description,null==h||null==(i=h.classNames)?void 0:i.description)},"function"==typeof h.description?h.description():h.description):null),j.default.isValidElement(h.cancel)?h.cancel:h.cancel&&eV(h.cancel)?j.default.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||L,onClick:e=>{!eV(h.cancel)||ed&&(null==h.cancel.onClick||h.cancel.onClick.call(h.cancel,e),eE())},className:eq(null==O?void 0:O.cancelButton,null==h||null==(l=h.classNames)?void 0:l.cancelButton)},h.cancel.label):null,j.default.isValidElement(h.action)?h.action:h.action&&eV(h.action)?j.default.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||R,onClick:e=>{!eV(h.action)||(null==h.action.onClick||h.action.onClick.call(h.action,e),e.defaultPrevented||eE())},className:eq(null==O?void 0:O.actionButton,null==h||null==(u=h.classNames)?void 0:u.actionButton)},h.action.label):null)};function ez(){if("undefined"==typeof window||"undefined"==typeof document)return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}let eU=j.default.forwardRef(function(e,t){let{id:r,invert:n,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:s,closeButton:i,className:l,offset:u,mobileOffset:d,theme:c="light",richColors:f,duration:m,style:p,visibleToasts:h=3,toastOptions:v,dir:g=ez(),gap:y=14,icons:x,containerAriaLabel:b="Notifications"}=e,[w,k]=j.default.useState([]),_=j.default.useMemo(()=>r?w.filter(e=>e.toasterId===r):w.filter(e=>!e.toasterId),[w,r]),S=j.default.useMemo(()=>Array.from(new Set([a].concat(_.filter(e=>e.position).map(e=>e.position)))),[_,a]),[E,C]=j.default.useState([]),[N,L]=j.default.useState(!1),[R,D]=j.default.useState(!1),[T,M]=j.default.useState("system"!==c?c:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),A=j.default.useRef(null),P=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),I=j.default.useRef(null),O=j.default.useRef(!1),F=j.default.useCallback(e=>{k(t=>{var r;return(null==(r=t.find(t=>t.id===e.id))?void 0:r.delete)||e$.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return j.default.useEffect(()=>e$.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{k(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{eR.default.flushSync(()=>{k(t=>{let r=t.findIndex(t=>t.id===e.id);return -1!==r?[...t.slice(0,r),{...t[r],...e},...t.slice(r+1)]:[e,...t]})})})}),[w]),j.default.useEffect(()=>{if("system"!==c)return void M(c);if("system"===c&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?M("dark"):M("light")),"undefined"==typeof window)return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{e?M("dark"):M("light")})}catch(t){e.addListener(({matches:e})=>{try{e?M("dark"):M("light")}catch(e){console.error(e)}})}},[c]),j.default.useEffect(()=>{w.length<=1&&L(!1)},[w]),j.default.useEffect(()=>{let e=e=>{var t,r;o.every(t=>e[t]||e.code===t)&&(L(!0),null==(r=A.current)||r.focus()),"Escape"===e.code&&(document.activeElement===A.current||(null==(t=A.current)?void 0:t.contains(document.activeElement)))&&L(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]),j.default.useEffect(()=>{if(A.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,O.current=!1)}},[A.current]),j.default.createElement("section",{ref:t,"aria-label":`${b} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map((t,r)=>{var a;let o,[c,b]=t.split("-");return _.length?j.default.createElement("ol",{key:t,dir:"auto"===g?ez():g,tabIndex:-1,ref:A,className:l,"data-sonner-toaster":!0,"data-sonner-theme":T,"data-y-position":c,"data-x-position":b,style:{"--front-toast-height":`${(null==(a=E[0])?void 0:a.height)||0}px`,"--width":"356px","--gap":`${y}px`,...p,...(o={},[u,d].forEach((e,t)=>{let r=1===t,n=r?"--mobile-offset":"--offset",a=r?"16px":"24px";function s(e){["top","right","bottom","left"].forEach(t=>{o[`${n}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?s(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?o[`${n}-${t}`]=a:o[`${n}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):s(a)}),o)},onBlur:e=>{O.current&&!e.currentTarget.contains(e.relatedTarget)&&(O.current=!1,I.current&&(I.current.focus({preventScroll:!0}),I.current=null))},onFocus:e=>{!(e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible)&&(O.current||(O.current=!0,I.current=e.relatedTarget))},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{R||L(!1)},onDragEnd:()=>L(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||D(!0)},onPointerUp:()=>D(!1)},_.filter(e=>!e.position&&0===r||e.position===t).map((r,a)=>{var o,l;return j.default.createElement(eB,{key:r.id,icons:x,index:a,toast:r,defaultRichColors:f,duration:null!=(o=null==v?void 0:v.duration)?o:m,className:null==v?void 0:v.className,descriptionClassName:null==v?void 0:v.descriptionClassName,invert:n,visibleToasts:h,closeButton:null!=(l=null==v?void 0:v.closeButton)?l:i,interacting:R,position:t,style:null==v?void 0:v.style,unstyled:null==v?void 0:v.unstyled,classNames:null==v?void 0:v.classNames,cancelButtonStyle:null==v?void 0:v.cancelButtonStyle,actionButtonStyle:null==v?void 0:v.actionButtonStyle,closeButtonAriaLabel:null==v?void 0:v.closeButtonAriaLabel,removeToast:F,toasts:_.filter(e=>e.position==r.position),heights:E.filter(e=>e.position==r.position),setHeights:C,expandByDefault:s,gap:y,expanded:N,swipeDirections:e.swipeDirections})})):null}))});e.s(["Toaster",()=>eU,"toast",()=>eW],806746);var eQ=e.i(7284);let eY=ex("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function eX({isOpen:e,onClose:t,onSubmit:r,isSubmitting:n=!1}){let[a,o]=(0,j.useState)(""),[s,i]=(0,j.useState)(null),l=(0,j.useRef)(null);(0,j.useEffect)(()=>{e&&l.current&&l.current.focus()},[e]),(0,j.useEffect)(()=>{e||(o(""),i(null))},[e]),(0,j.useEffect)(()=>{let r=r=>{"Escape"===r.key&&e&&!n&&t()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,n,t]);let u=(0,j.useCallback)(async e=>{let t;e.preventDefault(),i(null);try{t=""===a.trim()?null:JSON.parse(a)}catch{i("Invalid JSON. Please check your input.");return}await r(t)},[a,r]),d=(0,j.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&!n&&(e.preventDefault(),u(e))},[u,n]);return e?(0,ep.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",role:"dialog","aria-modal":"true","aria-labelledby":"resolve-hook-modal-title",children:[(0,ep.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:n?void 0:t}),(0,ep.jsxs)("div",{className:(0,eQ.default)("relative z-10 w-full max-w-lg mx-4","bg-white dark:bg-gray-900 rounded-lg shadow-xl","border border-gray-200 dark:border-gray-700"),children:[(0,ep.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:[(0,ep.jsx)("h2",{id:"resolve-hook-modal-title",className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:"Resolve Hook"}),(0,ep.jsx)("button",{type:"button",onClick:t,disabled:n,className:(0,eQ.default)("p-1 rounded-md transition-colors","text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200","hover:bg-gray-100 dark:hover:bg-gray-800","disabled:opacity-50 disabled:cursor-not-allowed"),"aria-label":"Close modal",children:(0,ep.jsx)(eY,{className:"h-5 w-5"})})]}),(0,ep.jsxs)("form",{onSubmit:u,children:[(0,ep.jsxs)("div",{className:"px-4 py-4",children:[(0,ep.jsx)("label",{htmlFor:"json-payload",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"JSON Payload"}),(0,ep.jsxs)("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:["Enter a JSON value to send to the hook. Leave empty to send"," ",(0,ep.jsx)("code",{className:"px-1 py-0.5 bg-gray-100 dark:bg-gray-800 rounded text-xs",children:"null"}),"."]}),(0,ep.jsx)("textarea",{ref:l,id:"json-payload",value:a,onChange:e=>{o(e.target.value),i(null)},onKeyDown:d,disabled:n,placeholder:'{"key": "value"}',className:(0,eQ.default)("w-full h-40 px-3 py-2 font-mono text-sm","bg-gray-50 dark:bg-gray-800","border rounded-md","focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400","disabled:opacity-50 disabled:cursor-not-allowed","placeholder:text-gray-400 dark:placeholder:text-gray-500",s?"border-red-500 dark:border-red-400":"border-gray-300 dark:border-gray-600")}),s&&(0,ep.jsx)("p",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:s}),(0,ep.jsxs)("p",{className:"mt-2 text-xs text-gray-500 dark:text-gray-400",children:["Press"," ",(0,ep.jsx)("kbd",{className:"px-1.5 py-0.5 text-xs bg-gray-100 dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded",children:"⌘"})," ","+"," ",(0,ep.jsx)("kbd",{className:"px-1.5 py-0.5 text-xs bg-gray-100 dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded",children:"Enter"})," ","to submit"]})]}),(0,ep.jsxs)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-gray-200 dark:border-gray-700",children:[(0,ep.jsx)("button",{type:"button",onClick:t,disabled:n,className:(0,eQ.default)("px-4 py-2 text-sm font-medium rounded-md transition-colors","text-gray-700 dark:text-gray-300","bg-gray-100 dark:bg-gray-800","hover:bg-gray-200 dark:hover:bg-gray-700","disabled:opacity-50 disabled:cursor-not-allowed"),children:"Cancel"}),(0,ep.jsxs)("button",{type:"submit",disabled:n,className:(0,eQ.default)("flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-md transition-colors","text-white bg-blue-600 hover:bg-blue-700","dark:bg-blue-500 dark:hover:bg-blue-600","disabled:opacity-50 disabled:cursor-not-allowed"),children:[(0,ep.jsx)(eL,{className:"h-4 w-4"}),n?"Sending...":"Send Payload"]})]})]})]})]}):null}function eK({env:e,callbacks:t}){let[r,n]=(0,j.useState)(!1),[a,o]=(0,j.useState)(null),s=(0,j.useCallback)(e=>{o(e)},[]),i=(0,j.useCallback)(()=>{o(null)},[]),l=(0,j.useCallback)(async s=>{if(!r&&a)try{n(!0),await ed(e,a.token,s),eW.success("Hook resolved",{description:"The payload has been sent and the hook resolved."}),o(null),t?.onSuccess?.()}catch(e){console.error("Failed to resolve hook:",e),eW.error("Failed to resolve hook",{description:e instanceof Error?e.message:"An unknown error occurred"})}finally{n(!1)}},[e,a,r,t]);return{isResolving:r,selectedHook:a,openResolveModal:s,closeResolveModal:i,handleResolve:l}}function eJ({hook:e,stopPropagation:t=!1,onResolveClick:r,DropdownMenuItem:n}){return(0,ep.jsxs)(n,{onClick:n=>{t&&n.stopPropagation(),r(e)},children:[(0,ep.jsx)(eL,{className:"h-4 w-4 mr-2"}),"Resolve Hook"]})}function eZ({hookActions:e}){let{selectedHook:t,closeResolveModal:r,handleResolve:n,isResolving:a}=e;return(0,ep.jsx)(eX,{isOpen:null!==t,onClose:r,onSubmit:n,isSubmitting:a})}function eG(e){if(!e||0===e.length)return{hasPendingSleeps:!1,hasPendingSteps:!1,hasPendingHooks:!1,pendingSleepIds:[],pendingStepIds:[],pendingHookIds:[],lastStepActivityAt:null,lastStepCompletionAt:null};let t=new Map,r=new Set,n=new Map,a=new Set,o=new Map,s=new Set,i=null,l=null;for(let u of e){let e=u.correlationId;if(e)switch(u.eventType){case"wait_created":t.set(e,u);break;case"wait_completed":r.add(e);break;case"step_started":n.set(e,u),(!i||new Date(u.createdAt)>i)&&(i=new Date(u.createdAt));break;case"step_retrying":(!i||new Date(u.createdAt)>i)&&(i=new Date(u.createdAt));break;case"step_completed":case"step_failed":a.add(e),(!l||new Date(u.createdAt)>l)&&(l=new Date(u.createdAt));break;case"hook_created":o.set(e,u);break;case"hook_disposed":s.add(e)}}let u=Array.from(t.keys()).filter(e=>!r.has(e)),d=Array.from(n.keys()).filter(e=>!a.has(e)),c=Array.from(o.keys()).filter(e=>!s.has(e));return{hasPendingSleeps:u.length>0,hasPendingSteps:d.length>0,hasPendingHooks:c.length>0,pendingSleepIds:u,pendingStepIds:d,pendingHookIds:c,lastStepActivityAt:i,lastStepCompletionAt:l}}function e0({className:e,...t}){return(0,ep.jsx)("div",{className:(0,S.cn)("animate-pulse rounded-md bg-muted",e),...t})}e.s(["default",()=>eY],897884),e.s(["X",()=>eY],259280),e.s(["HookResolveModalWrapper",()=>eZ,"ResolveHookDropdownItem",()=>eJ,"useHookActions",()=>eK],932671),e.s(["analyzeEvents",()=>eG],257151);let e1=ex("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"}]]);e.s(["Zap",()=>e1],545739);let e2={root:{startTime:0,endTime:1,duration:1,depth:0,children:[]},spanMap:{},resourceMap:{},filter:"",selected:null,baseScale:1,scaleRatio:1,scale:1,width:640,height:480,timelineWidth:640,timelineHeight:480,panelWidth:380,panelHeight:480,scrollbarWidth:0,timelineRef:{current:null},scrollSnapshotRef:{current:void 0},memoCacheRef:{current:new Map},getQuickLinks:()=>[],withPanel:!1,isMobile:!1,customPanelComponent:null},e5=e=>(e.width-e.scrollbarWidth-Number(!!(e.selected&&e.withPanel))*e.panelWidth)/e.root.duration,e4=(0,j.createContext)({state:e2,dispatch:()=>{}});e4.displayName="TraceViewerContext";let e6=(e,t)=>{switch(t.type){case"setRoot":return e.scrollSnapshotRef.current=void 0,e.memoCacheRef.current.clear(),e6({...e,root:t.root,spanMap:t.spanMap,resourceMap:Object.fromEntries(t.resources.map(({name:e,attributes:t})=>[e,t]))},{type:"detectBaseScale"});case"setSize":{let r=t.height-56-40-24,n=e.withPanel&&t.width<=768,a={...e,width:t.width,height:t.height,timelineWidth:t.width-Number(!!(e.selected&&e.withPanel&&!n))*e.panelWidth,timelineHeight:r,panelHeight:r,isMobile:n};return a.width!==e.width&&(a=e6(a,{type:"detectBaseScale"})),a}case"setPanelWidth":{let r=Math.max(240,Math.min(t.width,e.width-240));return{...e,timelineWidth:e.width-r,panelWidth:r}}case"setFilter":return{...e,filter:t.filter};case"deselect":return e6({...e,selected:null,timelineWidth:e.width},{type:"minScale"});case"select":{let r=e.spanMap[t.id];if(!r)return e;return{...e,selected:r,timelineWidth:e.width-(e.withPanel&&!e.isMobile?e.panelWidth:0)}}case"escape":if(e.selected)return e6(e,{type:"deselect"});return e6(e,{type:"resetScale"});case"toggleSelection":{let r=e;if(e.selected&&(r=e6(r,{type:"deselect"})),e.selected?.span.spanId===t.id)return r;return e6(r,{type:"select",id:t.id})}case"detectBaseScale":{let t=(e.width-e.scrollbarWidth)/e.root.duration;return{...e,baseScale:t,scale:t*e.scaleRatio}}case"setScale":return{...e,scaleRatio:t.scale,scale:e.baseScale*t.scale};case"resetScale":return e6(e,{type:"scaleToRange",t1:e.root.startTime,t2:e.root.endTime});case"scaleToNode":{let r=e.spanMap[t.id];if(!r)return e;return e6(e6(e,{type:"setScale",scale:(e.width-e.scrollbarWidth-(e.withPanel&&!e.isMobile?e.panelWidth:0))/r.duration/e.baseScale}),{type:"setScrollSnapshot",anchorT:r.startTime-e.root.startTime,anchorX:0})}case"scaleToRange":{let r=Math.abs(t.t1-t.t2);return e6(e6(e,{type:"setScale",scale:(e.width-e.scrollbarWidth-(e.selected&&e.withPanel?e.panelWidth:0))/r/e.baseScale}),{type:"setScrollSnapshot",anchorT:Math.min(t.t1,t.t2)-e.root.startTime,anchorX:0})}case"adjustScaleRatio":{let{scaleRatio:r}=e;switch(t.direction){case -1:r*=.8;break;case 1:r*=1.25;break;default:r=1}let n=e.timelineRef.current;if(!n)return console.warn("timelineRef is null"),e;let{clientWidth:a,scrollLeft:o}=n;return e6(e6({...e,scaleRatio:r,scale:e.baseScale*r},{type:"minScale"}),{type:"setScrollSnapshot",anchorT:(o+.5*a)/e.scale,anchorX:.5*a})}case"trackpadScale":{let r=Math.max(e5(e)/e.baseScale,e.scaleRatio*(1+.2*Math.sign(t.delta)*Math.sqrt(Math.abs(t.delta))));return e6({...e,scaleRatio:r,scale:e.baseScale*r},{type:"setScrollSnapshot",anchorT:t.anchorT,anchorX:t.anchorX})}case"minScale":{let t=e5(e);if(e.scale>=t)return e;return{...e,scale:t,scaleRatio:t/e.baseScale}}case"setScrollSnapshot":{let r=e.timelineRef.current;if(!r)return e;let{anchorT:n,anchorX:a}=t,o=n*e.scale-a,{scrollTop:s}=r,i=(s-24-8)/26,l=i+Math.ceil(e.timelineHeight/26);return e.scrollSnapshotRef.current={anchorT:n,anchorX:a,scrollLeft:o,scrollTop:s,startTime:e.root.startTime+o/e.scale,endTime:e.root.startTime+(o+e.timelineWidth)/e.scale,startRow:i,endRow:l,scale:e.scale},e}case"setWithPanel":if(e.withPanel===t.withPanel)return e;return{...e,withPanel:t.withPanel};case"forceRender":return e.memoCacheRef.current.set("",{}),{...e}}};function e3({getQuickLinks:e,withPanel:t=!1,children:r,customSpanClassNameFunc:n,customSpanEventClassNameFunc:a,customPanelComponent:o=null}){let s=(0,j.useRef)(null),i=(0,j.useRef)(void 0),l=(0,j.useRef)(e);l.current=e;let u=(0,j.useRef)(new Map),d=(0,j.useRef)(new Map),[c,f]=(0,j.useReducer)(e6,e2,e=>({...e,scrollbarWidth:(()=>{if(!("document"in globalThis))return 0;let e=document.createElement("div");e.style.width="400px",e.style.height="400px",e.style.overflow="scroll",document.body.appendChild(e);let t=400-e.scrollWidth;return e.remove(),t})(),timelineRef:s,scrollSnapshotRef:i,customSpanClassNameFunc:n,customSpanEventClassNameFunc:a,customPanelComponent:o,memoCacheRef:u,withPanel:t,getQuickLinks:e=>{let t=e.spanId,r=d.current.get(t);if(r)return r;let n=l.current?.(e)||[];return d.current.set(t,n),n}}));(0,j.useEffect)(()=>f({type:"setWithPanel",withPanel:t}),[t]);let m=(0,j.useMemo)(()=>({state:c,dispatch:f}),[c,f]);return(0,ep.jsx)(e4.Provider,{value:m,children:r})}let e8=()=>(0,j.useContext)(e4);var e7=e.i(345342),e9=e.i(894128);let te=(e,t)=>e.duration*t>=500,tt=e=>e.isVercel?String(e7.default.colorVercel):String(e7.default[`color${e.resourceIndex%5}`]),tr=(e,t)=>{let r=te(e,t),n=e.isHovered&&!r&&!1!==e.isHighlighted;return(0,eQ.clsx)(e7.default.spanNode,r&&e7.default.huge,e.duration*t<64&&e7.default.small,e.isSelected&&e7.default.selected,n&&e7.default.xHover,e.isHighlighted?e7.default.colorHighlight:tt(e),!1===e.isHighlighted&&e7.default.unlit)},tn=(0,j.memo)(function({root:e,scale:t,spans:r,scrollSnapshotRef:n,cache:a,customSpanClassNameFunc:o,customSpanEventClassNameFunc:s}){return r.map(r=>(0,ep.jsx)(ta,{cacheKey:a.get(r.span.spanId),customSpanEventClassNameFunc:s,customSpanClassNameFunc:o,node:r,root:e,scale:t,scrollSnapshotRef:n},r.span.spanId))}),ta=(0,j.memo)(function({node:e,root:t,scale:r,scrollSnapshotRef:n,customSpanClassNameFunc:a,customSpanEventClassNameFunc:o}){let s=(0,j.useRef)(null);e.ref=s;let{span:i}=e,l=e.isInstrumentationHint?"Get Started":(0,S.formatDuration)(e.duration),u=(e.startTime-t.startTime)*r,d=24+26*e.row,c=e.duration*r,f=Math.max(c,4),m=24,p=te(e,r),h=c<64,v=e.isHovered&&!p&&!1!==e.isHighlighted;h&&!v&&(m*=.4,d+=(24-m)*.5);let g=!1;if(v){let{duration:r,endTime:a}=t,o=n.current;o&&(r=o.endTime-o.startTime,a=o.endTime),g=a-e.startTime<.25*r}let y=a?a(e):"";return(0,ep.jsxs)(ep.Fragment,{children:[(0,ep.jsx)("button",{"aria-label":`${i.name} - ${l}`,className:(0,eQ.clsx)(tr(e,r),y),"data-span-id":i.spanId,"data-start-time":e.startTime-t.startTime,"data-right-side":g,ref:s,style:{"--span-width":`${Math.max(c,1)}px`,minWidth:v?f:void 0,width:v?void 0:f,height:m,maxWidth:v&&!g?(t.endTime-e.startTime)*r:void 0,containIntrinsicWidth:v?void 0:f,containIntrinsicHeight:m,left:g?void 0:u,right:g?(t.endTime-e.endTime)*r:void 0,top:d},type:"button",children:h&&!v?null:(0,ep.jsxs)(ep.Fragment,{children:[(0,ep.jsx)("span",{className:e7.default.spanName,children:e.label||i.name}),p?(0,ep.jsx)("span",{className:e7.default.spanSpacer}):null,v||f>128?(0,ep.jsx)("span",{className:e7.default.spanDuration,children:l}):null]})}),e.events&&!h?e.events.map(n=>(0,ep.jsx)(to,{customSpanEventClassNameFunc:o,event:n,node:e,root:t,scale:r},n.key)):null]})}),to=(0,j.memo)(function({event:e,node:t,root:r,scale:n,customSpanEventClassNameFunc:a}){let o=(0,j.useRef)(null);e.ref=o;let{event:{name:s}}=e,i=(0,S.formatDuration)(e.timestamp-r.startTime),l=(e.timestamp-r.startTime)*n,u=24+26*t.row,d=a?a(e):"";return(0,ep.jsxs)("div",{title:`${s} at ${i}`,className:(0,eQ.clsx)(e7.default.spanNodeEvent,d,t.isHighlighted?e7.default.colorHighlight:tt(t),!1===t.isHighlighted&&e7.default.unlit),"data-hovered":e.isHovered,ref:o,style:{left:l,top:u},children:[(0,ep.jsxs)("div",{className:(0,eQ.clsx)(e7.default.hoverInfo,(e.timestamp-t.startTime)/t.duration<.5?e7.default.alignStart:e7.default.alignEnd),children:[(0,ep.jsx)("span",{className:e7.default.eventName,children:s}),(0,ep.jsx)("span",{className:e7.default.eventTimestamp,children:i})]}),(0,ep.jsx)("div",{className:e7.default.eventDiamond})]})}),ts={"gray-700":"var(--ds-gray-700)","gray-900":"var(--ds-gray-900)"};function ti({size:e=16,color:t="gray-700"}){let r={color:ts[t]||t};return(0,ep.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",style:r,"aria-hidden":!0,children:[(0,ep.jsx)("title",{children:"Cross"}),(0,ep.jsx)("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function tl({size:e=16}){return(0,ep.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,className:e7.default.detailHeadingIcon,children:[(0,ep.jsx)("title",{children:"Chevron Down"}),(0,ep.jsx)("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function tu({size:e=16,color:t="gray-900"}){let r={color:ts[t]||t};return(0,ep.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",style:r,"aria-hidden":!0,children:[(0,ep.jsx)("title",{children:"External Small"}),(0,ep.jsx)("path",{d:"M14 4h6m0 0v6m0-6L10 14",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,ep.jsx)("path",{d:"M20 14v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function td(e){let{as:t,className:r,href:n,children:a,...o}=e;return"span"!==(t||"a")&&n?(0,ep.jsx)("a",{className:r,href:n,...o,children:a}):(0,ep.jsx)("span",{className:r,...o,children:a})}function tc(e){let{className:t,children:r,size:n,...a}=e;return(0,ep.jsx)("a",{...a,className:(0,eQ.clsx)(e7.default.buttonLink,t),children:r})}function tf({children:e,className:t}){return(0,ep.jsx)("div",{className:(0,eQ.clsx)(e7.default.note,t),children:e})}function tm({width:e,height:t,rounded:r}){return(0,ep.jsx)("span",{className:(0,eQ.clsx)(e7.default.skeleton,r&&e7.default.skeletonRounded),style:{width:e,height:t},"aria-hidden":!0})}let tp=e=>`${(100*e).toFixed(3)}%`,th=(e,t)=>e<t?-1:+(e>t),tv=e=>{let t={};for(let[r,n]of Object.entries(e)){let e=r.indexOf("."),a="",o="";-1!==e?(a=r.substring(0,e),o=r.substring(e+1)):o=r;let s=t[a];s||(s={prefix:a,attributes:[]},t[a]=s),s.attributes.push({key:r,suffix:o,value:String(n)})}let r=Array.from(Object.values(t)).sort((e,t)=>th(e.prefix,t.prefix));for(let e of r)e.attributes.sort((e,t)=>th(e.suffix,t.suffix));return r},tg=()=>{let{state:{root:e,selected:t,resourceMap:r,getQuickLinks:n},dispatch:a}=e8(),o=(0,j.useMemo)(()=>((e,t)=>{let r=[];if(!t)return r;for(let e=t;"parent"in e;e=e.parent)r.unshift(e);return r})(0,t),[e,t]),s=(0,j.useMemo)(()=>tv(t?.span.attributes??{}),[t]),i=(0,j.useMemo)(()=>{let e=t?.span.resource;if(!e)return[];let n=r[e];return n?tv(n):[]},[r,t]);if(!t)return null;let{span:l}=t,u=tS(t);return(0,ep.jsxs)(ep.Fragment,{children:[t.isVercel?(0,ep.jsx)(tE,{node:t}):null,t.isInstrumentationHint?(0,ep.jsx)(tL,{}):null,!t.isInstrumentationHint&&o.length?(0,ep.jsx)(tb,{className:e7.default.ancestorGroup,name:"Location",children:o.map(r=>(0,ep.jsxs)("button",{className:e7.default.ancestorNode,onClick:()=>a({type:"select",id:r.span.spanId}),type:"button",children:[(0,ep.jsxs)("div",{className:e7.default.ancestorText,children:[(0,ep.jsx)("span",{className:e7.default.ancestorName,children:r.label||r.span.name}),(0,ep.jsx)("span",{className:e7.default.ancestorDuration,children:(0,S.formatDuration)(r.duration)})]}),(0,ep.jsx)("span",{"aria-hidden":!0,className:e7.default.ancestorLineContainer,children:(0,ep.jsx)("span",{className:(0,eQ.clsx)(e7.default.ancestorLine,tt(r)),style:{left:tp((r.startTime-e.startTime)/e.duration),width:tp(r.duration/e.duration)}})})]},`${t.span.spanId}.${r.span.spanId}`))}):null,u?(0,ep.jsx)(tC,{getQuickLinks:n,span:t.span}):null,t.events?.length?(0,ep.jsx)(tb,{name:"Events",children:t.events.map(t=>(0,ep.jsxs)(j.Fragment,{children:[(0,ep.jsxs)("dl",{className:e7.default.spanDetailPanelAttribute,children:[(0,ep.jsx)("dt",{className:e7.default.spanDetailPanelAttributeKey,children:t.event.name}),(0,ep.jsx)("dd",{className:e7.default.spanDetailPanelAttributeValue,children:(0,S.formatDuration)(t.timestamp-e.startTime)})]}),Object.entries(t.event.attributes).map(([e,r])=>(0,ep.jsx)(tR,{name:`${t.event.name}.${e}`,value:r},e))]},t.key))}):null,s.length?(0,ep.jsx)(tb,{name:"Attributes",children:s.map(e=>(0,ep.jsx)(j.Fragment,{children:e.attributes.map(({key:e,value:t})=>(0,ep.jsx)(tR,{name:e,value:t},e))},e.prefix))}):null,i.length?(0,ep.jsx)(tb,{name:"Resource",children:i.map(e=>(0,ep.jsx)(j.Fragment,{children:e.attributes.map(({key:e,value:t})=>(0,ep.jsx)(tR,{name:e,value:t},e))},e.prefix))}):null,t.isInstrumentationHint?null:(0,ep.jsxs)(tb,{name:"Library",children:[(0,ep.jsx)(tR,{name:"name",value:l.library.name}),l.library.version?(0,ep.jsx)(tR,{name:"version",value:l.library.version}):null]})]})};function ty({attached:e=!1}){let{state:{selected:t,isMobile:r,customPanelComponent:n},dispatch:a}=e8();if(!t)return null;let{span:o}=t;return(0,ep.jsxs)("div",{className:(0,eQ.clsx)(e7.default.spanDetailPanel,r&&e7.default.mobile),children:[e&&!r?(0,ep.jsx)(tD,{}):null,(0,ep.jsx)("div",{className:e7.default.spanDetailPanelTop,children:(0,ep.jsxs)("div",{className:e7.default.spanDetailPanelTopInfo,children:[(0,ep.jsx)("span",{className:e7.default.spanDetailPanelName,title:o.name,children:o.name}),(0,ep.jsxs)("div",{className:e7.default.spanDetailPanelCorner,children:[t.isInstrumentationHint?null:(0,ep.jsx)("span",{className:e7.default.spanDetailPanelDuration,children:(0,S.formatDuration)(t.duration)}),(0,ep.jsx)("div",{className:e7.default.spanDetailPanelCloseVerticalRule}),(0,ep.jsx)("button",{"aria-label":"Close Span Details",className:e7.default.spanDetailPanelClose,onClick:()=>a({type:"deselect"}),type:"button",children:(0,ep.jsx)(ti,{color:"gray-700",size:20})})]})]})}),(0,ep.jsx)("div",{className:(0,eQ.clsx)("flex gap-3",e7.default.spanDetailPanelBody),children:n||(0,ep.jsx)(tg,{})})]})}let tx="vc-trace-span-exp:";function tb({name:e,className:t="",children:r}){let[n,a]=(0,j.useState)(()=>!("localStorage"in globalThis)||"0"!==localStorage.getItem(`${tx}${e}`)),o=(0,j.useCallback)(()=>{a(t=>{let r=!t;return localStorage.setItem(`${tx}${e}`,String(Number(r))),r})},[e]);return(0,ep.jsxs)("div",{className:(0,eQ.clsx)(e7.default.detailGroup,n?e7.default.expanded:e7.default.collapsed,t),children:[(0,ep.jsxs)("button",{className:e7.default.detailHeading,onClick:o,type:"button",children:[(0,ep.jsx)("span",{children:e}),(0,ep.jsx)(tl,{})]}),n?r:null]})}let tw=new Set(["OPTIONS","HEAD","GET","PUT","POST","DELETE"]),tk={"Resolve Deployment":"How long it took Vercel's routing layer to retrieve details for the deployment.","Resolve Cache":"How long it took Vercel's routing layer to check for a cached function invocation.","Resolve Route":"How long it took Vercel's routing layer to resolve routing rules, including redirects and rewrites.","Invoke Middleware":"How long it took this middleware to start and run user code.","Invoke Function":"How long it took this Vercel Function to start and run user code.",waitUntil:"How long it took to run user code inside of waitUntil.","Start VM":"How long it took to start the Virtual Machine which contains the Vercel Function.","Spawn Node.js":"How long it took the Virtual Machine to start the Node.js runtime.","Spawn Python":"How long it took the Virtual Machine to start the Python runtime.","Init User Code":"How long it took to import the user code and run any globally-scoped code."},t_=new Set(["Start VM","Spawn Node.js","Spawn Python","Init User Code"]),tj=e=>{if(!e||!("span"in e))return null;let t=e.span.attributes,r=t["vercel.region"]||t["vercel.function.region"];return r?String(r):null},tS=e=>{if(!e.isVercel)return!1;let{name:t}=e.span,r=t.indexOf(" ");if(-1===r)return!1;let n=t.substring(0,r);return tw.has(n)};function tE({node:e}){let{name:t}=e.span,r=tk[t];if(!r&&tS(e)&&(r="How long it took for Vercel to process the request and send the response."),!r)return null;let n=(e=>{let{name:t}=e.span,r=tj(e),n=tj(e.parent);return"true"===e.span.attributes["vercel.middleware.internal"]?"The Vercel Toolbar created this middleware.":t_.has(t)||"Invoke Function"===t&&e.children.some(e=>t_.has(e.span.name))?"This function encountered a cold start.":r&&n&&r!==n?"This request was routed across regions.":null})(e);return(0,ep.jsx)(tb,{name:"What is this?",children:(0,ep.jsxs)("div",{className:e7.default.infraSpanDescription,children:[(0,ep.jsx)("span",{children:r}),n?(0,ep.jsx)(tf,{children:n}):n]})})}let tC=(0,j.memo)(function({getQuickLinks:e,span:t}){let r=e(t);return r.length?(0,ep.jsx)(tb,{name:"Links",children:r.map(({key:e,value:t})=>(0,ep.jsx)(tN,{link:t,name:e},e))}):null});function tN({name:e,link:t}){let r=function(e){let[t,r]=(0,j.useState)({}),n=void 0!==e.__resolvedValue||void 0!==e.__rejectedValue;return(0,j.useEffect)(()=>{n||e.then(t=>{e.__resolvedValue=t}).catch(t=>{e.__rejectedValue=t}).finally(()=>r({}))},[e,n]),e.__resolvedValue}(t);return(0,ep.jsxs)(td,{as:r?void 0:"span",className:(0,eQ.clsx)(e7.default.spanDetailPanelAttribute,e7.default.spanDetailPanelQuickLink),href:r?.href||"",children:[(0,ep.jsx)("span",{className:e7.default.spanDetailPanelAttributeKey,children:e}),(0,ep.jsx)("span",{className:(0,eQ.clsx)(e7.default.spanDetailPanelAttributeValue,e7.default.spanDetailPanelQuickLinkLabel),children:r?(0,ep.jsxs)(ep.Fragment,{children:[r.label,r.icon||(0,ep.jsx)(tu,{color:"gray-900"})]}):(0,ep.jsxs)(ep.Fragment,{children:[(0,ep.jsx)(tm,{height:18,width:32+8*e.length}),(0,ep.jsx)(tm,{height:18,rounded:!0,width:18})]})})]})}function tL(){return(0,ep.jsx)(tb,{name:"What is this?",children:(0,ep.jsxs)("div",{className:e7.default.infraSpanDescription,children:[(0,ep.jsx)("span",{children:"You can visualize your application's spans alongside Vercel's spans in this viewer."}),(0,ep.jsx)(tc,{href:"https://vercel.com/docs/session-tracing#adding-custom-spans",size:"small",target:"_blank",children:"Get Started"})]})})}function tR({name:e,value:t}){return(0,ep.jsxs)("dl",{className:e7.default.spanDetailPanelAttribute,children:[(0,ep.jsx)("dt",{className:e7.default.spanDetailPanelAttributeKey,children:e}),(0,ep.jsx)("dd",{className:e7.default.spanDetailPanelAttributeValue,title:String(t),children:String(t)})]})}function tD(){let{state:{panelWidth:e},dispatch:t}=e8(),r=(0,j.useRef)({start:{x:0,width:e},x:0,width:e,isHeld:!1});r.current.width=e;let n=(0,j.useCallback)(e=>{if("mouse"!==e.pointerType)return;e.preventDefault();let t=r.current;t.start.x=e.clientX,t.x=e.clientX,t.start.width=t.width,t.isHeld=!0},[]),a=(0,j.useCallback)(()=>{t({type:"setPanelWidth",width:e2.panelWidth})},[t]);return(0,j.useEffect)(()=>{let e=0,n=()=>{let e=r.current;t({type:"setPanelWidth",width:e.start.width+e.start.x-e.x})},a=t=>{r.current.isHeld&&(t.preventDefault(),r.current.x=t.clientX,cancelAnimationFrame(e),e=requestAnimationFrame(n))},o=()=>{r.current.isHeld=!1};return window.addEventListener("pointermove",a),window.addEventListener("pointerup",o),()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",o)}},[t]),(0,ep.jsx)("div",{"aria-hidden":!0,className:e7.default.spanDetailPanelResizer,onDoubleClick:a,onPointerDown:n})}function tT(e){let t=(0,j.useRef)({});return{setStyle:(0,j.useCallback)((r,n)=>{if(t.current[r]=n,e.current){if(!n)return void e.current.style.removeProperty(r);e.current.style.setProperty(r,n)}},[e]),styleRef:t,style:{...t.current}}}let tM=(0,j.memo)(function({timelineRef:e,rows:t,scale:r}){let{state:{root:n,baseScale:a,timelineWidth:o,width:s,scrollbarWidth:i}}=e8(),l=s+16,u=(()=>{let[e,t]=(0,j.useState)(1);return(0,j.useLayoutEffect)(()=>{let r=()=>t("devicePixelRatio"in globalThis&&globalThis.devicePixelRatio||1),n=matchMedia(`(resolution: ${e}dppx)`);return n.addEventListener("change",r),r(),()=>{n.removeEventListener("change",r)}},[e]),e})(),d=(0,j.useRef)(null),c=(0,j.useRef)(null),f=s/(s-i)*Math.min(s/o,a/r),m=Math.min(s,(o-i)*f);(0,j.useEffect)(()=>{let t,r=!1,n=0,a=e=>!!d.current?.contains(e),o=0,s=()=>{if(!r||!t)return;let a=e.current;a&&(a.scrollLeft=(n-.5*m-t.left)/f)},i=e=>{({clientX:n}=e),cancelAnimationFrame(o),o=requestAnimationFrame(s)},l=e=>{a(e.target)&&(r=!0,t=d.current?.getBoundingClientRect(),i(e))},u=()=>{r=!1,t=void 0},c=e=>{a(e.target)&&e.cancelable&&e.preventDefault()},p=e=>{r&&e.cancelable&&e.preventDefault()};return window.addEventListener("pointerdown",l),window.addEventListener("pointermove",i),window.addEventListener("pointerup",u),window.addEventListener("blur",u),window.addEventListener("touchstart",c,{passive:!1}),window.addEventListener("touchmove",p,{passive:!1}),()=>{window.removeEventListener("pointerdown",l),window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",u),window.removeEventListener("blur",u),window.removeEventListener("touchstart",c),window.removeEventListener("touchmove",p),cancelAnimationFrame(o)}},[e,f,m]),(0,j.useEffect)(()=>{let e=c.current,r=e?.getContext("2d");if(!e||!r)return;let a=requestAnimationFrame(()=>{r.resetTransform(),r.clearRect(0,0,e.width,e.height),r.scale(u,u);let a=(l-16)/n.duration;for(let e of(r.fillStyle="#ccc",r.beginPath(),t))for(let t of e){let e=7+4*t.row;if(e>=45)break;let o=8+(t.startTime-n.startTime)*a,s=t.duration*a;r.roundRect(o,e,s,3,3)}r.fill()});return()=>cancelAnimationFrame(a)},[u,n,l,t]);let p=(0,j.useRef)(null),{style:h,setStyle:v}=tT(p);return(0,j.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let r=0,n=()=>{v("transform",`translateX(${8+t.scrollLeft*f}px)`)};n();let a=()=>{cancelAnimationFrame(r),r=requestAnimationFrame(n)};return t.addEventListener("scroll",a),()=>{cancelAnimationFrame(r),t.removeEventListener("scroll",a)}},[e,f,v]),(0,ep.jsxs)("div",{className:e7.default.mapContainer,ref:d,style:{width:m>0?l:"100%",height:56},children:[(0,ep.jsx)("canvas",{className:e7.default.mapCanvas,height:56*u,ref:c,style:{width:l,height:56},width:l*u}),(0,ep.jsx)("div",{className:e7.default.mapThumb,ref:p,style:{transform:h.transform,width:m>0?m:"calc(100% - 16px)",top:2,height:52}})]})}),tA=[1,2,4,5,8,10];function tP({scale:e}){let{state:{root:t}}=e8(),r=t.duration,n=Math.floor(Math.log10(r)),a=Math.max(2,10**n*(Math.floor(Math.log10(.5*r))===n?1:.5)),o=a*e,s=1;for(let e of tA){if(a/e<24)break;s=e}a/=s,o/=s;let i=Math.ceil(r/a),l=Math.ceil(100/o)||1;return(0,ep.jsx)("div",{className:e7.default.markersContainer,children:(0,ep.jsx)("div",{"aria-hidden":!0,className:e7.default.markers,style:{width:Math.floor(t.duration*e+15),visibility:-1!==e?"visible":"hidden","--marker-width":`${o}px`},children:Array(i).fill(null).map((e,t)=>{let r=t%l==0;return(0,ep.jsx)("span",{className:(0,eQ.clsx)(e7.default.marker,!r&&e7.default.notch),children:r?(0,ep.jsx)("span",{className:e7.default.markerLabel,children:(0,e9.formatDurationForTimeline)(a*t)}):null},String(t))})})})}function tI({events:e,root:t,scale:r}){let n=(0,j.useMemo)(()=>e.filter(e=>!1!==e.event.showVerticalLine),[e]);return(0,ep.jsx)("div",{className:e7.default.eventMarkersContainer,children:(0,ep.jsx)("div",{"aria-hidden":!0,className:e7.default.eventMarkers,style:{width:Math.floor(t.duration*r)},children:n.map(e=>(0,ep.jsx)("span",{className:(0,eQ.clsx)(e7.default.eventMarker),style:{left:Math.floor((e.timestamp-t.startTime)*r),...e.event.color&&{borderLeftColor:e.event.color}}},e.key))})})}function tO({memoCacheRef:e,timelineRef:t,root:r,spans:n,events:a,scale:o,dispatch:s,scrollSnapshotRef:i}){var l;let u,d=(0,j.useRef)(!1),c=(0,j.useRef)(n);c.current=n;let f=(0,j.useRef)(a);f.current=a;let m=(0,j.useRef)(null),{style:p,setStyle:h}=tT(m),v=(0,j.useRef)(null),g=(0,j.useRef)(null),{style:y,setStyle:x}=tT(g),b=(0,j.useRef)(void 0),w=(0,j.useRef)(null),{style:k,setStyle:_}=tT(w),S=(0,j.useRef)(0);(0,j.useEffect)(()=>{let n=t.current;if(!n)return;let a=S.current,i=0,l=!1,u=!1,m=!1,p=!1,g=0,y=0,k=Date.now()+500,j=()=>{b.current||(b.current=n.getBoundingClientRect())},C=e=>b.current?(e-24-8)/26:0,N=()=>{let t=e.current;for(let e of c.current)e.isHovered&&(e.isHovered=!1,t.set(e.span.spanId,{}));s({type:"forceRender"})},L=0,R=()=>{if(!d.current)return;b.current||j();let t=b.current;if(!t)return;let{scrollLeft:p,scrollTop:S}=n,E=Math.max(0,Math.min(a+p-t.left-8,r.duration*o)),D=`${E-p+8}px`;x("left",D),h("left",D);let T=r.startTime+E/o,M=T-r.startTime;if(M<0||M>r.duration?v.current?.removeAttribute("data-text"):v.current?.setAttribute("data-text",(0,e9.formatTimeSelection)(M)),l){let e,n,s=a-i,l=Math.abs(s);if(!m){if(l<4)return;m=!0,_("display","flex"),N()}s>0?(_("left",""),_("right","0")):(_("left","0"),_("right","")),_("width",`${l}px`);let u=Math.max(0,Math.min(i+p-t.left-8,r.duration*o))/o;u<M?(e=u,n=M):(e=M,n=u),w.current?.setAttribute("data-range",`${(0,e9.formatTimeSelection)(e)} — ${(0,e9.formatTimeSelection)(n)}`),w.current?.setAttribute("data-duration",`${(0,e9.formatTimeSelection)(n-e)} selected`)}if(Date.now()<k){L=requestAnimationFrame(R);return}if(p!==g||S!==y){g=p,y=S,L=requestAnimationFrame(R);return}if(a-t.left<128?v.current?.setAttribute("data-align","left"):a-t.left>t.width-128?v.current?.setAttribute("data-align","right"):v.current?.removeAttribute("data-align"),!m&&!u){let r=e.current,n=C(S)-2,a=C(S+t.height)+2;for(let e of c.current){let t=e.row>=n&&e.row<=a&&T>=e.startTime&&T<=e.endTime;e.isHovered!==t&&(e.isHovered=t,r.set(e.span.spanId,{}))}let i=12/o;for(let e of f.current){let t=T>=e.timestamp-i&&T<=e.timestamp+i;if(e.isHovered===t)continue;e.isHovered=t;let r=e.ref?.current;r&&r.setAttribute("data-hovered",String(t))}s({type:"forceRender"})}};L=requestAnimationFrame(R);let D=e=>{"mouse"===e.pointerType&&(d.current=!0)},T=()=>{d.current&&(d.current=!1,N())},M=({clientX:e})=>{S.current=a=e,cancelAnimationFrame(L),L=requestAnimationFrame(R)},A=e=>{e.preventDefault()},P=e=>{if(2===e.button)p=!0,e.preventDefault();else{if(0!==e.button)return;p=!1}t.current?.contains(e.target)?(i=a,l=!0):(u=!0,requestAnimationFrame(N))},I=e=>{if(u=!1,!l||(l=!1,!m))return;if(m=!1,_("display",""),_("left",""),_("right",""),_("width",""),e.preventDefault(),e.stopImmediatePropagation(),p){p=!1;return}b.current||j();let t=b.current;if(!t)return;let{scrollLeft:d}=n,c=Math.max(0,Math.min((i+d-t.left-8)/o,r.duration)),f=Math.max(0,Math.min((a+d-t.left-8)/o,r.duration));s({type:"scaleToRange",t1:c+r.startTime,t2:f+r.startTime})},O=e=>{l&&"Escape"===e.key&&(p=!0,I(e))},F=()=>{b.current=void 0,E.current=void 0,cancelAnimationFrame(L),L=requestAnimationFrame(R)},$=()=>{cancelAnimationFrame(L),L=requestAnimationFrame(R)},H=new ResizeObserver(()=>{b.current=void 0});return H.observe(n),window.addEventListener("mousemove",M),n.addEventListener("contextmenu",A),window.addEventListener("mousedown",P),window.addEventListener("mouseup",I),window.addEventListener("blur",I),window.addEventListener("keydown",O,!0),window.addEventListener("scroll",F),n.addEventListener("scroll",$),n.addEventListener("pointerenter",D),n.addEventListener("pointerleave",T),()=>{H.disconnect(),window.removeEventListener("mousemove",M),n.removeEventListener("contextmenu",A),window.removeEventListener("mousedown",P),window.removeEventListener("mouseup",I),window.removeEventListener("blur",I),window.removeEventListener("keydown",O,!0),window.removeEventListener("scroll",F),n.removeEventListener("scroll",$),n.removeEventListener("pointerenter",D),n.removeEventListener("pointerleave",T),cancelAnimationFrame(L),S.current=a,N()}},[s,r,o,x,h,_,e,t,i]);let E=(0,j.useRef)(void 0);return l=e=>{let r=t.current;if(!r)return;b.current??=r.getBoundingClientRect();let n=b.current,a=Math.max(0,Math.min(S.current-n.left-8,n.width-16)),i=0,l=E.current;l?.anchorX===a?i=l.anchorT:E.current=l={anchorT:i=(r.scrollLeft+a)/o,anchorX:a},s({type:"trackpadScale",delta:e/64,anchorT:i,anchorX:a})},(u=(0,j.useRef)(l)).current=l,(0,j.useEffect)(()=>{let e=0,t=0,r=()=>{u.current(e),e=0},n=n=>{if(!n.ctrlKey&&!n.metaKey)return;n.preventDefault();let a=-n.deltaY;switch(n.deltaMode){case WheelEvent.DOM_DELTA_PAGE:a*=window.innerHeight;break;case WheelEvent.DOM_DELTA_LINE:a*=20}e+=a,cancelAnimationFrame(t),t=requestAnimationFrame(r)};return window.addEventListener("wheel",n,{passive:!1}),()=>{window.removeEventListener("wheel",n),cancelAnimationFrame(t)}},[]),(0,ep.jsxs)(ep.Fragment,{children:[(0,ep.jsx)("div",{className:e7.default.cursorMarkerStickyParent,children:(0,ep.jsx)("div",{className:e7.default.cursorMarkerLabelContainer,ref:m,style:p,children:(0,ep.jsx)("div",{className:e7.default.cursorMarkerLabel,ref:v})})}),(0,ep.jsx)("div",{className:e7.default.cursorMarkerStickyParent,children:(0,ep.jsx)("div",{className:e7.default.cursorMarkerContainer,ref:g,style:y,children:(0,ep.jsx)("div",{className:e7.default.cursorMarker,children:(0,ep.jsx)("div",{className:e7.default.cursorSelection,ref:w,style:k})})})})]})}function tF({height:e,width:t,value:r,placeholder:n,onChange:a}){return(0,ep.jsxs)("label",{className:e7.default.searchInputLabel,children:[(0,ep.jsx)("div",{className:e7.default.searchInputPrefix,children:(0,ep.jsx)(t$,{})}),(0,ep.jsx)("input",{type:"search",value:r,placeholder:n,onChange:a,style:{height:e,width:t}})]})}function t$(){return(0,ep.jsxs)("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",focusable:"false",children:[(0,ep.jsx)("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,ep.jsx)("path",{d:"M11.5 11.5L14 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function tH(){return(0,ep.jsx)("nav",{className:e7.default.searchBar,children:(0,ep.jsx)(tW,{})})}function tW(){let{dispatch:e}=e8(),[t,r]=(0,j.useState)("");return(0,j.useEffect)(()=>{let r=setTimeout(()=>e({type:"setFilter",filter:t}),100);return()=>{clearTimeout(r)}},[e,t]),(0,ep.jsx)("div",{className:e7.default.searchInput,children:(0,ep.jsx)(tF,{height:40,onChange:e=>r(e.target.value),placeholder:"Search spans…",value:t,width:"100%"})})}function tV({size:e=16}){return(0,ep.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[(0,ep.jsx)("title",{children:"Zoom In"}),(0,ep.jsx)("path",{d:"M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",stroke:"currentColor",strokeWidth:"2"}),(0,ep.jsx)("path",{d:"M11 8v6M8 11h6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,ep.jsx)("path",{d:"M20 20l-3.5-3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function tq({size:e=16}){return(0,ep.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[(0,ep.jsx)("title",{children:"Zoom Out"}),(0,ep.jsx)("path",{d:"M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",stroke:"currentColor",strokeWidth:"2"}),(0,ep.jsx)("path",{d:"M8 11h6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,ep.jsx)("path",{d:"M20 20l-3.5-3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function tB({size:e=16}){return(0,ep.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[(0,ep.jsx)("title",{children:"Minus"}),(0,ep.jsx)("path",{d:"M6 12h12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function tz(){let{dispatch:e}=e8(),t=(0,j.useCallback)(()=>{e({type:"adjustScaleRatio",direction:1})},[e]),r=(0,j.useCallback)(()=>{e({type:"adjustScaleRatio",direction:-1})},[e]),n=(0,j.useCallback)(()=>{e({type:"adjustScaleRatio",direction:0})},[e]);return(0,ep.jsxs)("div",{className:e7.default.zoomButtonGroup,children:[(0,ep.jsx)("button",{"aria-label":"Zoom Out",className:e7.default.zoomButton,onClick:r,type:"button",children:(0,ep.jsx)(tq,{size:18})}),(0,ep.jsx)("div",{className:e7.default.divider}),(0,ep.jsx)("button",{"aria-label":"Reset Zoom",className:e7.default.zoomButton,onClick:n,type:"button",children:(0,ep.jsx)(tB,{size:18})}),(0,ep.jsx)("div",{className:e7.default.divider}),(0,ep.jsx)("button",{"aria-label":"Zoom In",className:e7.default.zoomButton,onClick:t,type:"button",children:(0,ep.jsx)(tV,{size:18})})]})}var tU=e.i(925311);function tQ(){return[]}let tY={traceId:"skeleton",spans:[{parentSpanId:"",spanId:"root",name:"root span",kind:1,resource:"vercel.runtime",startTime:[5e3,0],endTime:[6e3,0],duration:[1e3,0],library:{name:"vercel-site"},status:{code:1},attributes:{"vercel.ownerId":"team_abc"},traceFlags:1,events:[],links:[]}],resources:[{name:"vercel.runtime",attributes:{}}],rootSpanId:"root"};function tX({trace:t=tY,className:r="",scrollLock:n=!1,height:a,withPanel:o=!1,highlightedSpans:s}){let i=t===tY,{state:l,dispatch:u}=e8(),{timelineRef:d,scrollSnapshotRef:c}=l,f=l.memoCacheRef.current,m=(s?.length??0)>0||t.spans.length<=10;(0,j.useEffect)(()=>{let{root:e,map:r}=(0,tU.parseTrace)(t);u({type:"setRoot",root:e,spanMap:r,resources:t.resources||[]})},[u,t]);let{rows:p,spans:h,events:v,scale:g}=(t=>{let{state:r,dispatch:n}=e8(),{root:a,filter:o,scale:s,timelineRef:i,timelineWidth:l,spanMap:u,scrollSnapshotRef:d,selected:c,memoCacheRef:f,customSpanClassNameFunc:m}=r,p=function(e){let[t,r]=(0,j.useState)(e);return(0,j.useEffect)(()=>{if(t===e)return;let n=0,a=0,o=()=>{if(++n<=3){a=requestAnimationFrame(o);return}r(e)};return o(),()=>{cancelAnimationFrame(a)}},[t,e]),t}(r.timelineHeight),h=(0,j.useRef)(0),[v,g]=(0,j.useState)(tQ),[y,x]=(0,j.useState)(tQ),[b,w]=(0,j.useState)(tQ),[k,_]=(0,j.useState)(-1),S=(0,j.useRef)(void 0);return(0,j.useEffect)(()=>S.current?.(o),[o]),(0,j.useEffect)(()=>{if(t?.length){for(let e of v)for(let r of e){let e=t.includes(r.span.spanId);r.isHighlighted!==e&&(r.isHighlighted=e,f.current.set(r.span.spanId,{}))}n({type:"forceRender"})}},[v,t,n,f]),(0,j.useEffect)(()=>{if(!a.startTime)return;let t=new Worker(e.r(403222)),r=++h.current;t.addEventListener("message",e=>{let t=e.data;switch(t.type){case"setRowsResult":if(t.isEnd)for(let e of t.rows)for(let t of e)t.span=u[t.span.spanId]?.span??t.span;g(t.rows);break;case"updateHighlight":{if(t?.requestId!==r)return;let{matches:e}=t;g(t=>{for(let r of t)for(let t of r){let r=e.has(t.span.spanId);t.isHighlighted!==r&&(t.isHighlighted=r,f.current.set(t.span.spanId,{}))}return t}),n({type:"forceRender"})}}});let o={requestId:r,type:"calculateSpanPositions",root:a};return t.postMessage(o),S.current=e=>{let n=e.trim().toLocaleLowerCase();if(!n)return void g(e=>e.map(e=>e.map(e=>(e.isHighlighted=void 0,{...e}))));let o={type:"filterSpans",requestId:r=++h.current,root:a,filter:n};t.postMessage(o)},()=>{t.terminate()}},[a,u,n,f]),(0,j.useEffect)(()=>{if(!v.length)return;let e=i.current,t=d.current,r=!1,n=!1,o=0,u=0,c=Math.max(500,.5*l),f=Array(v.length).fill(null),m=e=>t?e<t.startRow?e-t.startRow:e>t.endRow?e-t.endRow:0:0,h=e=>{if(!t)return 0;let r=0;e.endTime<t.startTime?r=t.startTime-e.endTime:e.startTime>t.endTime&&(r=e.startTime-t.endTime);let n=Math.abs(m(e.row));return r||n?Math.sqrt((r/s)**2+(24*n+2)**2):0},g=0,y=()=>{(r||!t)&&(r=!1,(()=>{if(!e)return;let{scrollLeft:r,scrollTop:n}=e,o=(n-24-8)/26,i=o+Math.ceil(p/26);d.current=t={anchorT:r/s,anchorX:0,scrollLeft:r,scrollTop:n,startTime:a.startTime+r/s,endTime:a.startTime+(r+l)/s,startRow:o,endRow:i,scale:s};for(let e=f.length;e--;)f[e]=null})()),(()=>{n=!0;let e=Math.min(1+u+Math.ceil(t?.endRow??1/0),v.length);for(let t=e;t--;){if(f[t])continue;let e=m(t);if(Math.abs(e)>u){if(n=!1,e>0)continue;break}let r=[],a=v[t];if(a){for(let e of a){if(!(0,tU.adjustSpanVisibility)(e,s))continue;let t=h(e);o=Math.max(t,o),r.push({d:t,span:e})}f[t]=r}}})();let i=[],b=[];for(let e of f)if(e)for(let{d:t,span:r}of e)!(t>u)&&(i.push(r),r.events&&b.push(...r.events));u<c&&(!n||u<o)&&(u=Math.min(c,u+100),g=requestAnimationFrame(y)),x(i),w(b),_(s)};y();let b=Date.now(),k=e=>{(e.ctrlKey||e.metaKey)&&(b=Date.now())};e?.addEventListener("wheel",k);let j=()=>{Date.now()-b<=50||(r=!0,cancelAnimationFrame(g),g=requestAnimationFrame(y))};return e?.addEventListener("scroll",j),()=>{cancelAnimationFrame(g),e?.removeEventListener("wheel",k),e?.removeEventListener("scroll",j)}},[v,a,s,d,i,l,p]),(0,j.useEffect)(()=>{let e;if(!c)return;for(let t of y)if(t.span.spanId===c.span.spanId){e=t;break}let t=e?.ref?.current;if(!e||!t)return;e.isSelected=!0;let r=tr(e,s),n=m?m(e):"";return t.className=(0,eQ.clsx)(r,n),()=>{e.isSelected=!1;let r=tr(e,s),n=m?m(e):"";t.className=(0,eQ.clsx)(r,n)}},[y,s,c,m]),{rows:v,spans:y,events:b,scale:k}})(s),y=(0,j.useRef)(null);(0,j.useLayoutEffect)(()=>{let e=y.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();u({type:"setSize",width:t.width-16,height:t.height})};t();let r=new ResizeObserver(t);return r.observe(e),window.addEventListener("resize",t),()=>{r.disconnect(),window.removeEventListener("resize",t)}},[u]);let x=(0,j.useRef)({t:0,x:-1,y:-1,spanId:""}),b=(0,j.useCallback)(e=>{let t=x.current,r=Date.now(),{clientX:n,clientY:a}=e,o=Math.sqrt((n-t.x)**2+(a-t.y)**2);if(r-t.t<=500&&o<=8)return(e.stopPropagation(),e.preventDefault(),t.spanId)?(u({type:"select",id:t.spanId}),void u({type:"scaleToNode",id:t.spanId})):void u({type:"resetScale"});let s=e.target;if(!s.closest(`.${String(e7.default.timeline)}`))return;let i=s.closest("[data-span-id]"),l=i?.dataset.spanId||"";x.current={x:n,y:a,t:r,spanId:l},l&&(u({type:"toggleSelection",id:l}),e.stopPropagation())},[u]);(0,j.useLayoutEffect)(()=>{let e=d.current;if(!e)return;let t=c.current;t&&(e.scrollLeft=t.anchorT*g-t.anchorX)},[c,d,g]),(0,j.useEffect)(()=>{let e=l.selected?.span.spanId;if(!e)return;let t=setTimeout(()=>{let t=l.timelineRef.current,r=t?.querySelector(`[data-span-id="${e}"]`);if(!t||!r)return;let n=t.getBoundingClientRect(),a=r.getBoundingClientRect();a.width<n.width&&(a.left<n.left||a.right>n.right||a.top<n.top||a.bottom>n.bottom)&&r.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})},500);return()=>{clearTimeout(t)}},[l.selected,l.timelineRef]),(0,j.useEffect)(()=>{let e=e=>{"Escape"===e.key&&u({type:"escape"})};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[u]),(0,j.useEffect)(()=>{if(!n)return;let e=document.documentElement,t=document.body;e.style.overflow="clip",t.style.overflow="clip";let r=e=>{e?.cancelable?e.preventDefault():window.scrollTo({left:0,top:0,behavior:"instant"})};return r(),window.addEventListener("scroll",r,{passive:!1}),()=>{e.style.overflow="",t.style.overflow="",window.removeEventListener("scroll",r)}},[n]);let w=Math.max(l.timelineHeight-l.scrollbarWidth,26+26*p.length-2+84),k=!!(l.isMobile&&l.selected);return(0,ep.jsxs)("div",{className:(0,eQ.clsx)(e7.default.traceViewer,i&&e7.default.skeleton,r),onClickCapture:b,ref:y,style:{height:a,"--timeline-padding":"8px","--row-height":"24px","--row-padding":"2px","--search-height":`${40*!m}px`,"--search-gap":`${!m?8:2}px`,"--map-height":"56px","--timeline-width":`${l.timelineWidth}px`,"--timeline-height":`${l.timelineHeight}px`,"--timeline-scroll-width":`${Math.round(l.root.duration*l.scale)}px`,"--panel-width":`${l.panelWidth}px`,"--panel-height":`${l.panelHeight}px`,"--height":`${l.height}px`,"--scrollbar-width":`${l.scrollbarWidth}px`,"--marker-height":"24px","--marker-notch-height":"8px"},children:[m?null:(0,ep.jsx)(tH,{}),(0,ep.jsx)(tM,{rows:p,scale:g,timelineRef:d}),(0,ep.jsxs)("div",{className:(0,eQ.clsx)(e7.default.traceViewerContent,k&&e7.default.inert),children:[(0,ep.jsx)("div",{className:e7.default.timeline,ref:d,children:(0,ep.jsx)("div",{style:{position:"relative",width:l.timelineWidth,height:l.timelineHeight-16,padding:8,paddingBottom:0},children:(0,ep.jsxs)("div",{className:e7.default.traceNode,style:{width:l.root.duration*g||void 0,height:w-16},children:[(0,ep.jsx)(tP,{scale:g}),(0,ep.jsx)(tI,{events:v,root:l.root,scale:g}),(0,ep.jsx)(tO,{dispatch:u,events:v,memoCacheRef:l.memoCacheRef,root:l.root,scale:g,scrollSnapshotRef:c,spans:h,timelineRef:d}),(0,ep.jsx)(tn,{cacheKey:f.get(""),cache:f,customSpanClassNameFunc:l.customSpanClassNameFunc,customSpanEventClassNameFunc:l.customSpanEventClassNameFunc,root:l.root,scale:g,scrollSnapshotRef:c,spans:h})]})})}),(0,ep.jsx)("div",{className:e7.default.zoomButtonTraceViewer,children:(0,ep.jsx)(tz,{})})]}),o?(0,ep.jsx)("div",{className:(0,eQ.clsx)(e7.default.spanDetailPanelTraceViewer,!l.selected&&e7.default.hidden,l.isMobile&&e7.default.mobile),children:(0,ep.jsx)(ty,{attached:!0})}):null]})}var tK=e.i(328582);function tJ({messages:e}){return 0===e.length?(0,ep.jsx)("div",{className:"text-center py-8 text-[11px]",style:{color:"var(--ds-gray-600)"},children:"No messages"}):(0,ep.jsx)("div",{className:"flex flex-col gap-3 p-3",children:e.map((e,t)=>(0,ep.jsx)(tZ,{message:e},t))})}function tZ({message:e}){var t;let r=e.role,n="string"==typeof(t=e.content)?[{type:"text",text:t}]:Array.isArray(t)?t.map(e=>"string"==typeof e?{type:"text",text:e}:e?.type==="text"?{type:"text",text:String(e.text??"")}:e?.type==="tool-call"?{type:"tool-call",toolName:e.toolName,input:e.input}:e?.type==="tool-result"?{type:"tool-result",toolName:e.toolName,output:e.output}:{type:"text",text:""}):[],a=function(e){switch(e){case"user":return{bg:"var(--ds-blue-100)",border:"var(--ds-blue-300)",label:"var(--ds-blue-700)"};case"assistant":default:return{bg:"var(--ds-gray-100)",border:"var(--ds-gray-300)",label:"var(--ds-gray-700)"};case"system":return{bg:"var(--ds-amber-100)",border:"var(--ds-amber-300)",label:"var(--ds-amber-700)"};case"tool":return{bg:"var(--ds-green-50)",border:"var(--ds-green-300)",label:"var(--ds-green-700)"}}}(r);return(0,ep.jsxs)("div",{className:"rounded-md border text-[11px]",style:{backgroundColor:a.bg,borderColor:a.border},children:[(0,ep.jsx)("div",{className:"px-2.5 py-1 border-b text-[10px] font-medium uppercase tracking-wide",style:{borderColor:a.border,color:a.label},children:r}),(0,ep.jsx)("div",{className:"px-2.5 py-2 space-y-2",children:n.map((e,t)=>(0,ep.jsx)(tG,{part:e,role:r},t))})]})}function tG({part:e,role:t}){if("text"===e.type)return e.text?"assistant"===t?(0,ep.jsx)("div",{className:"prose prose-sm max-w-none text-[11px] [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",style:{color:"var(--ds-gray-1000)"},children:(0,ep.jsx)(tK.i,{children:e.text})}):(0,ep.jsx)("div",{className:"whitespace-pre-wrap break-words",style:{color:"var(--ds-gray-1000)"},children:e.text}):null;if("tool-call"===e.type)return(0,ep.jsxs)("div",{className:"rounded border px-2 py-1.5",style:{backgroundColor:"var(--ds-purple-100)",borderColor:"var(--ds-purple-300)"},children:[(0,ep.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] font-medium",children:[(0,ep.jsx)("span",{children:"\uD83D\uDD27"}),(0,ep.jsx)("span",{style:{color:"var(--ds-purple-900)"},children:e.toolName})]}),null!=e.input&&(0,ep.jsx)("pre",{className:"mt-1.5 text-[10px] overflow-x-auto p-1.5 rounded",style:{backgroundColor:"var(--ds-gray-100)",color:"var(--ds-gray-800)"},children:"string"==typeof e.input?e.input:JSON.stringify(e.input,null,2)})]});if("tool-result"===e.type){let t=function(e){if(null==e)return null;let t="string"==typeof e?e:JSON.stringify(e,null,2);return t.length>500?`${t.slice(0,500)}...`:t}(e.output);return(0,ep.jsxs)("div",{className:"rounded border px-2 py-1.5",style:{backgroundColor:"var(--ds-green-100)",borderColor:"var(--ds-green-300)"},children:[(0,ep.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] font-medium",children:[(0,ep.jsx)("span",{children:"✓"}),(0,ep.jsxs)("span",{style:{color:"var(--ds-green-900)"},children:[e.toolName," result"]})]}),t&&(0,ep.jsx)("pre",{className:"mt-1.5 text-[10px] overflow-x-auto max-h-[80px] p-1.5 rounded",style:{backgroundColor:"var(--ds-gray-100)",color:"var(--ds-gray-800)"},children:t})]})}return null}function t0({summary:e,children:t}){return(0,ep.jsxs)("details",{className:"group",children:[(0,ep.jsx)("summary",{className:"cursor-pointer rounded-md border px-2.5 py-1.5 text-xs hover:brightness-95",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)",color:"var(--ds-gray-900)"},children:e}),(0,ep.jsxs)("div",{className:"relative pl-6 mt-3",children:[(0,ep.jsx)("div",{className:"absolute left-3 -top-3 w-px h-3",style:{backgroundColor:"var(--ds-gray-400)"}}),(0,ep.jsx)("div",{className:"absolute left-3 top-0 w-3 h-3 border-l border-b rounded-bl-lg",style:{borderColor:"var(--ds-gray-400)"}}),(0,ep.jsx)("div",{className:"absolute left-6 top-3 w-0 h-px -translate-y-px",style:{backgroundColor:"var(--ds-gray-400)"}}),(0,ep.jsx)("div",{children:t})]})]})}var t1=function(e,t,r){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,r),r},t2=function(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)};let t5=function(e){var t=0;e+="x";var r=Math.floor(65745979961613.07);for(let n=0;n<e.length;n++)t>r&&(t=Math.floor(t/137)),t=131*t+e.charCodeAt(n);return t},t4="0123456789abcdef".split(""),t6=[-0x80000000,8388608,32768,128],t3=[24,16,8,0],t8=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],t7=[];class t9{constructor(e=!1,t=!1){s.set(this,void 0),i.set(this,void 0),l.set(this,void 0),u.set(this,void 0),d.set(this,void 0),c.set(this,void 0),f.set(this,void 0),m.set(this,void 0),p.set(this,void 0),h.set(this,void 0),v.set(this,void 0),g.set(this,void 0),y.set(this,void 0),x.set(this,void 0),b.set(this,void 0),w.set(this,void 0),k.set(this,0),_.set(this,void 0),this.init(e,t)}init(e,t){t?(t7[0]=t7[16]=t7[1]=t7[2]=t7[3]=t7[4]=t7[5]=t7[6]=t7[7]=t7[8]=t7[9]=t7[10]=t7[11]=t7[12]=t7[13]=t7[14]=t7[15]=0,t1(this,i,t7)):t1(this,i,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),e?(t1(this,c,0xc1059ed8),t1(this,f,0x367cd507),t1(this,m,0x3070dd17),t1(this,p,0xf70e5939),t1(this,h,0xffc00b31),t1(this,v,0x68581511),t1(this,g,0x64f98fa7),t1(this,y,0xbefa4fa4)):(t1(this,c,0x6a09e667),t1(this,f,0xbb67ae85),t1(this,m,0x3c6ef372),t1(this,p,0xa54ff53a),t1(this,h,0x510e527f),t1(this,v,0x9b05688c),t1(this,g,0x1f83d9ab),t1(this,y,0x5be0cd19)),t1(this,s,t1(this,_,t1(this,l,t1(this,b,0)))),t1(this,u,t1(this,x,!1)),t1(this,d,!0),t1(this,w,e)}update(e){let t;if(t2(this,u))return this;t=e instanceof ArrayBuffer?new Uint8Array(e):e;let r=0,n=t.length,a=t2(this,i);for(;r<n;){let e;if(t2(this,x)&&(t1(this,x,!1),a[0]=t2(this,s),a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),"string"!=typeof t)for(e=t2(this,_);r<n&&e<64;++r)a[e>>2]|=t[r]<<t3[3&e++];else for(e=t2(this,_);r<n&&e<64;++r){let n=t.charCodeAt(r);n<128?a[e>>2]|=n<<t3[3&e++]:(n<2048?a[e>>2]|=(192|n>>6)<<t3[3&e++]:(n<55296||n>=57344?a[e>>2]|=(224|n>>12)<<t3[3&e++]:(n=65536+((1023&n)<<10|1023&t.charCodeAt(++r)),a[e>>2]|=(240|n>>18)<<t3[3&e++],a[e>>2]|=(128|n>>12&63)<<t3[3&e++]),a[e>>2]|=(128|n>>6&63)<<t3[3&e++]),a[e>>2]|=(128|63&n)<<t3[3&e++])}t1(this,k,e),t1(this,l,t2(this,l)+(e-t2(this,_))),e>=64?(t1(this,s,a[16]),t1(this,_,e-64),this.hash(),t1(this,x,!0)):t1(this,_,e)}return t2(this,l)>0xffffffff&&(t1(this,b,t2(this,b)+(t2(this,l)/0x100000000|0)),t1(this,l,t2(this,l)%0x100000000)),this}finalize(){if(t2(this,u))return;t1(this,u,!0);let e=t2(this,i),t=t2(this,k);e[16]=t2(this,s),e[t>>2]|=t6[3&t],t1(this,s,e[16]),t>=56&&(t2(this,x)||this.hash(),e[0]=t2(this,s),e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=t2(this,b)<<3|t2(this,l)>>>29,e[15]=t2(this,l)<<3,this.hash()}hash(){let e,t,r,n,a,o,s,l,u,x=t2(this,c),b=t2(this,f),k=t2(this,m),_=t2(this,p),j=t2(this,h),S=t2(this,v),E=t2(this,g),C=t2(this,y),N=t2(this,i);for(let r=16;r<64;++r)e=((n=N[r-15])>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,t=((n=N[r-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,N[r]=N[r-16]+e+N[r-7]+t|0;u=b&k;for(let i=0;i<64;i+=4)t2(this,d)?(t2(this,w)?(o=300032,C=(n=N[0]-0x543c9a5b)-0x8f1a6c7|0,_=n+0x170e9b5|0):(o=0x2a01a605,C=(n=N[0]-0xc881298)-0x5ab00ac6|0,_=n+0x8909ae5|0),t1(this,d,!1)):(e=(x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10),t=(j>>>6|j<<26)^(j>>>11|j<<21)^(j>>>25|j<<7),r=(o=x&b)^x&k^u,n=C+t+(j&S^~j&E)+t8[i]+N[i],a=e+r,C=_+n|0,_=n+a|0),e=(_>>>2|_<<30)^(_>>>13|_<<19)^(_>>>22|_<<10),t=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),r=(s=_&x)^_&b^o,n=E+t+(C&j^~C&S)+t8[i+1]+N[i+1],a=e+r,E=k+n|0,e=((k=n+a|0)>>>2|k<<30)^(k>>>13|k<<19)^(k>>>22|k<<10),t=(E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7),r=(l=k&_)^k&x^s,n=S+t+(E&C^~E&j)+t8[i+2]+N[i+2],a=e+r,S=b+n|0,e=((b=n+a|0)>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10),t=(S>>>6|S<<26)^(S>>>11|S<<21)^(S>>>25|S<<7),r=(u=b&k)^b&_^l,n=j+t+(S&E^~S&C)+t8[i+3]+N[i+3],a=e+r,j=x+n|0,x=n+a|0;t1(this,c,t2(this,c)+x|0),t1(this,f,t2(this,f)+b|0),t1(this,m,t2(this,m)+k|0),t1(this,p,t2(this,p)+_|0),t1(this,h,t2(this,h)+j|0),t1(this,v,t2(this,v)+S|0),t1(this,g,t2(this,g)+E|0),t1(this,y,t2(this,y)+C|0)}hex(){this.finalize();let e=t2(this,c),t=t2(this,f),r=t2(this,m),n=t2(this,p),a=t2(this,h),o=t2(this,v),s=t2(this,g),i=t2(this,y),l=t4[e>>28&15]+t4[e>>24&15]+t4[e>>20&15]+t4[e>>16&15]+t4[e>>12&15]+t4[e>>8&15]+t4[e>>4&15]+t4[15&e]+t4[t>>28&15]+t4[t>>24&15]+t4[t>>20&15]+t4[t>>16&15]+t4[t>>12&15]+t4[t>>8&15]+t4[t>>4&15]+t4[15&t]+t4[r>>28&15]+t4[r>>24&15]+t4[r>>20&15]+t4[r>>16&15]+t4[r>>12&15]+t4[r>>8&15]+t4[r>>4&15]+t4[15&r]+t4[n>>28&15]+t4[n>>24&15]+t4[n>>20&15]+t4[n>>16&15]+t4[n>>12&15]+t4[n>>8&15]+t4[n>>4&15]+t4[15&n]+t4[a>>28&15]+t4[a>>24&15]+t4[a>>20&15]+t4[a>>16&15]+t4[a>>12&15]+t4[a>>8&15]+t4[a>>4&15]+t4[15&a]+t4[o>>28&15]+t4[o>>24&15]+t4[o>>20&15]+t4[o>>16&15]+t4[o>>12&15]+t4[o>>8&15]+t4[o>>4&15]+t4[15&o]+t4[s>>28&15]+t4[s>>24&15]+t4[s>>20&15]+t4[s>>16&15]+t4[s>>12&15]+t4[s>>8&15]+t4[s>>4&15]+t4[15&s];return t2(this,w)||(l+=t4[i>>28&15]+t4[i>>24&15]+t4[i>>20&15]+t4[i>>16&15]+t4[i>>12&15]+t4[i>>8&15]+t4[i>>4&15]+t4[15&i]),l}toString(){return this.hex()}digest(){this.finalize();let e=t2(this,c),t=t2(this,f),r=t2(this,m),n=t2(this,p),a=t2(this,h),o=t2(this,v),s=t2(this,g),i=t2(this,y),l=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,a>>24&255,a>>16&255,a>>8&255,255&a,o>>24&255,o>>16&255,o>>8&255,255&o,s>>24&255,s>>16&255,s>>8&255,255&s];return t2(this,w)||l.push(i>>24&255,i>>16&255,i>>8&255,255&i),l}array(){return this.digest()}arrayBuffer(){this.finalize();let e=new ArrayBuffer(t2(this,w)?28:32),t=new DataView(e);return t.setUint32(0,t2(this,c)),t.setUint32(4,t2(this,f)),t.setUint32(8,t2(this,m)),t.setUint32(12,t2(this,p)),t.setUint32(16,t2(this,h)),t.setUint32(20,t2(this,v)),t.setUint32(24,t2(this,g)),t2(this,w)||t.setUint32(28,t2(this,y)),e}}function re(e){let t=new t9;return t.update(e),parseInt(t.hex().substring(0,8),16)}s=new WeakMap,i=new WeakMap,l=new WeakMap,u=new WeakMap,d=new WeakMap,c=new WeakMap,f=new WeakMap,m=new WeakMap,p=new WeakMap,h=new WeakMap,v=new WeakMap,g=new WeakMap,y=new WeakMap,x=new WeakMap,b=new WeakMap,w=new WeakMap,k=new WeakMap,_=new WeakMap;let rt=function(e){var t="#";return e.forEach(function(e){e<16&&(t+=0),t+=e.toString(16)}),t},rr=function(e,t,r){var n=r<.5?r*(1+t):r+t-r*t,a=2*r-n;return[(e/=360)+1/3,e,e-1/3].map(function(e){return e<0&&e++,e>1&&e--,Math.round(255*(e=e<1/6?a+(n-a)*6*e:e<.5?n:e<2/3?a+(n-a)*6*(2/3-e):a))})};function rn({active:e,onClick:t,children:r}){return(0,ep.jsx)("button",{type:"button",onClick:t,className:"px-3 py-1.5 text-[11px] font-medium transition-colors -mb-px",style:{backgroundColor:"transparent",borderTop:"none",borderLeft:"none",borderRight:"none",borderBottom:`2px solid ${e?"var(--ds-blue-600)":"transparent"}`,borderRadius:0,outline:"none",boxShadow:"none",cursor:"pointer",color:e?"var(--ds-gray-1000)":"var(--ds-gray-600)"},children:r})}function ra({conversation:e,args:t}){let[r,n]=(0,j.useState)("conversation");return(0,ep.jsx)(t0,{summary:`Input (${e.length} messages)`,children:(0,ep.jsxs)("div",{className:"rounded-md border",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"transparent"},children:[(0,ep.jsxs)("div",{className:"flex gap-1 border-b",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"transparent"},children:[(0,ep.jsx)(rn,{active:"conversation"===r,onClick:()=>n("conversation"),children:"Conversation"}),(0,ep.jsx)(rn,{active:"json"===r,onClick:()=>n("json"),children:"Raw JSON"})]}),"conversation"===r?(0,ep.jsx)(tJ,{messages:e}):(0,ep.jsx)("div",{className:"p-3",children:Array.isArray(t)?t.map((e,t)=>(0,ep.jsx)("div",{className:"mt-2 first:mt-0",children:rd(e)},t)):rd(t)})]})})}let ro=(0,j.createContext)(void 0),rs=new class{constructor(e={}){const[t,r]=[e.lightness,e.saturation].map(function(e){return Array.isArray(e=void 0!==e?e:[.35,.5,.65])?e.concat():[e]});this.L=t,this.S=r,"number"==typeof e.hue&&(e.hue={min:e.hue,max:e.hue}),"object"!=typeof e.hue||Array.isArray(e.hue)||(e.hue=[e.hue]),void 0===e.hue&&(e.hue=[]),this.hueRanges=e.hue.map(function(e){return{min:void 0===e.min?0:e.min,max:void 0===e.max?360:e.max}}),this.hash=re,"function"==typeof e.hash&&(this.hash=e.hash),"bkdr"===e.hash&&(this.hash=t5)}hsl(e){var t,r,n=this.hash(e);if(this.hueRanges.length){let e=this.hueRanges[n%this.hueRanges.length];t=n/this.hueRanges.length%727*(e.max-e.min)/727+e.min}else t=n%359;return n=Math.ceil(n/360),r=this.S[n%this.S.length],n=Math.ceil(n/this.S.length),[t,r,this.L[n%this.L.length]]}rgb(e){var t=this.hsl(e);return rr.apply(this,t)}hex(e){return rt(this.rgb(e))}}({saturation:[.5,.6,.7],lightness:[.4,.5,.6]}),ri=(e,t,r)=>`hsl(${e}, ${Math.round(100*t)}%, ${Math.round(100*r)}%)`,rl=({classInstanceRef:e})=>{let t=(()=>{let[e,t]=(0,j.useState)(()=>"undefined"!=typeof document&&document.documentElement.classList.contains("dark"));return(0,j.useEffect)(()=>{if("undefined"==typeof document)return;let e=new MutationObserver(()=>{t(document.documentElement.classList.contains("dark"))});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>e.disconnect()},[]),e})(),r=((e,t)=>{let[r,n,a]=rs.hsl(e);return t?{header:ri(r,n,Math.min(a+.1,.6)),body:ri(r,.8*n,.15),text:ri(r,.6*n,.8)}:{header:ri(r,n,a),body:ri(r,.4*n,.95),text:ri(r,.8*n,.25)}})(e.classId,t);return(0,ep.jsxs)("div",{className:"inline-flex flex-col rounded text-[11px] font-mono my-1",style:{backgroundColor:r.body,border:`1px solid ${r.header}`},children:[(0,ep.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 rounded-t",style:{backgroundColor:r.header,color:"#FFFFFF"},title:`Custom class: ${e.classId}`,children:[(0,ep.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ep.jsx)("title",{children:"Class instance"}),(0,ep.jsx)("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),(0,ep.jsx)("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),(0,ep.jsx)("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"})]}),(0,ep.jsx)("span",{className:"font-semibold",children:e.className})]}),(0,ep.jsx)("pre",{className:"px-2 py-1.5 overflow-x-auto whitespace-pre-wrap",style:{color:r.text},children:JSON.stringify(e.data,null,2)})]})},ru=({streamRef:e})=>{let t=(0,j.useContext)(ro);return(0,ep.jsxs)("button",{type:"button",onClick:()=>{t&&t(e.streamId)},className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-mono cursor-pointer hover:opacity-80 transition-opacity",style:{backgroundColor:"var(--ds-blue-200)",color:"var(--ds-blue-900)",border:"1px solid var(--ds-blue-400)"},title:`Click to view stream: ${e.streamId}`,children:[(0,ep.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ep.jsx)("title",{children:"Stream icon"}),(0,ep.jsx)("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),(0,ep.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}),e.streamId.length>40?`${e.streamId.slice(0,20)}...${e.streamId.slice(-15)}`:e.streamId]})},rd=e=>{let t,r,n,a,{json:o,streamRefs:s,classInstanceRefs:i}=(t=new Map,r=new Map,n=0,{json:JSON.stringify((a=e=>{if(null!==e&&"object"==typeof e&&"__type"in e&&"__workflow_stream_ref__"===e.__type&&"streamId"in e&&"string"==typeof e.streamId){let r=`__STREAM_REF_${n++}__`;return t.set(r,e),r}if(null!==e&&"object"==typeof e&&"__type"in e&&"__workflow_class_instance_ref__"===e.__type&&"className"in e&&"string"==typeof e.className){let t=`__CLASS_INSTANCE_REF_${n++}__`;return r.set(t,e),t}if(Array.isArray(e))return e.map(a);if(null!==e&&"object"==typeof e){let t={};for(let[r,n]of Object.entries(e))t[r]=a(n);return t}return e})(e),null,2),streamRefs:t,classInstanceRefs:r});if(0===s.size&&0===i.size)return(0,ep.jsx)("pre",{className:"text-[11px] overflow-x-auto rounded-md border p-3",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)",color:"var(--ds-gray-1000)"},children:(0,ep.jsx)("code",{children:o})});let l=new Map,u=0;for(let[e,t]of s)l.set(e,(0,ep.jsx)(ru,{streamRef:t},u++));for(let[e,t]of i)l.set(e,(0,ep.jsx)(rl,{classInstanceRef:t},u++));let d=[],c=o;for(;c.length>0;){let e=-1,t="",r=null;for(let[n,a]of l){let o=c.indexOf(`"${n}"`);-1!==o&&(-1===e||o<e)&&(e=o,t=n,r=a)}if(-1===e){d.push(c);break}e>0&&d.push(c.slice(0,e)),d.push(r),c=c.slice(e+t.length+2)}return(0,ep.jsx)("pre",{className:"text-[11px] overflow-x-auto rounded-md border p-3",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)",color:"var(--ds-gray-1000)"},children:(0,ep.jsx)("code",{children:d})})},rc=["workflowName","stepName","status","stepId","hookId","eventId","runId","attempt","token","correlationId","eventType","deploymentId","ownerId","projectId","environment","executionContext","createdAt","startedAt","updatedAt","completedAt","expiredAt","retryAfter","error","metadata","eventData","input","output","resumeAt"],rf=(e,t)=>(rc.indexOf(e)||0)-(rc.indexOf(t)||0),rm=e=>(e instanceof Date?e:new Date("number"==typeof e?e:"string"==typeof e?e:String(e))).toLocaleString(void 0,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3}),rp={workflowName:e=>n(String(e))?.shortName??"?",stepName:e=>a(String(e))?.shortName??"?",runId:e=>String(e),stepId:e=>String(e),hookId:e=>String(e),eventId:e=>String(e),status:e=>String(e),attempt:e=>String(e),token:e=>String(e),eventType:e=>String(e),correlationId:e=>String(e),deploymentId:e=>String(e),ownerId:e=>null,projectId:e=>null,environment:e=>null,executionContext:e=>null,createdAt:rm,startedAt:rm,updatedAt:rm,completedAt:rm,expiredAt:rm,retryAfter:rm,resumeAt:rm,metadata:rd,input:(e,t)=>{if(e&&"object"==typeof e&&"args"in e){let{args:r,closureVars:n}=e,a=Array.isArray(r)?r.length:0,o=n&&Object.keys(n).length>0;if(t?.stepName&&(0,S.isDoStreamStep)(t.stepName)){let e=(0,S.extractConversation)(r);if(e&&e.length>0)return(0,ep.jsxs)(ep.Fragment,{children:[(0,ep.jsx)(ra,{conversation:e,args:r}),o&&(0,ep.jsx)(t0,{summary:"Closure Variables",children:rd(n)})]})}return(0,ep.jsxs)(ep.Fragment,{children:[(0,ep.jsx)(t0,{summary:`Input (${a} arguments)`,children:Array.isArray(r)?r.map((e,t)=>(0,ep.jsx)("div",{className:"mt-2",children:rd(e)},t)):rd(r)}),o&&(0,ep.jsx)(t0,{summary:"Closure Variables",children:rd(n)})]})}let r=Array.isArray(e)?e.length:0;return(0,ep.jsx)(t0,{summary:`Input (${r} arguments)`,children:Array.isArray(e)?e.map((e,t)=>(0,ep.jsx)("div",{className:"mt-2",children:rd(e)},t)):rd(e)})},output:e=>(0,ep.jsx)(t0,{summary:"Output",children:rd(e)}),error:e=>e&&"object"==typeof e&&"message"in e?(0,ep.jsx)(t0,{summary:"Error",children:(0,ep.jsxs)("div",{className:"flex flex-col gap-2",children:[e.code&&(0,ep.jsxs)("div",{children:[(0,ep.jsxs)("span",{className:"text-[11px] font-medium",style:{color:"var(--ds-gray-700)"},children:["Error Code:"," "]}),(0,ep.jsx)("code",{className:"text-[11px]",style:{color:"var(--ds-gray-1000)"},children:e.code})]}),(0,ep.jsx)("pre",{className:"text-[11px] overflow-x-auto rounded-md border p-3",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)",color:"var(--ds-gray-1000)",whiteSpace:"pre-wrap"},children:(0,ep.jsx)("code",{children:e.stack||e.message})})]})}):(0,ep.jsx)(t0,{summary:"Error",children:(0,ep.jsx)("pre",{className:"text-[11px] overflow-x-auto rounded-md border p-3",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)",color:"var(--ds-gray-1000)",whiteSpace:"pre-wrap"},children:(0,ep.jsx)("code",{children:String(e)})})}),eventData:e=>(0,ep.jsx)(t0,{summary:"Event Data",children:rd(e)})},rh=["input","output","error","metadata","eventData"],rv=()=>(0,ep.jsx)("div",{className:"text-copy-12 rounded-md border p-4 my-2",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)",color:"var(--ds-gray-700)"},children:(0,ep.jsx)("span",{children:"The data for this run has expired and is no longer available."})}),rg=({attribute:e,value:t,isLoading:r,inline:n=!1,context:a})=>{let o=rp[e];if(!o)return null;let s=o(t,a);return s?n?(0,ep.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,ep.jsx)("span",{className:"text-[11px] font-medium",style:{color:"var(--ds-gray-700)"},children:e}),(0,ep.jsx)("span",{className:"text-[11px]",style:{color:"var(--ds-gray-1000)"},children:s})]}):(0,ep.jsxs)("div",{className:"relative",children:["boolean"==typeof r&&r&&(0,ep.jsx)("div",{className:"absolute top-9 right-4",children:(0,ep.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2",style:{borderColor:"var(--ds-gray-900)"}})}),(0,ep.jsxs)("div",{className:"flex flex-col gap-0 my-2",children:[(0,ep.jsx)("span",{className:"text-xs font-medium",style:{color:"var(--ds-gray-700)"},children:e}),(0,ep.jsx)("span",{className:"text-xs",style:{color:"var(--ds-gray-1000)"},children:s})]},e)]}):null},ry=({data:e,isLoading:t,error:r,expiredAt:n,onStreamClick:a})=>{let o=null!=n&&new Date(n)<new Date,s=Object.keys(e).filter(e=>!rh.includes(e)).sort(rf),i=Object.keys(e).filter(e=>rh.includes(e)).sort(rf),l=s.filter(t=>{let r=rp[t];return!!r&&null!==r(e[t])}),u=(0,j.useMemo)(()=>({stepName:e.stepName}),[e.stepName]);return(0,ep.jsx)(ro.Provider,{value:a,children:(0,ep.jsxs)("div",{children:[l.length>0&&(0,ep.jsx)("div",{className:"flex flex-col divide-y rounded-lg border mb-3 overflow-hidden",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)"},children:l.map(t=>(0,ep.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5",style:{borderColor:"var(--ds-gray-300)"},children:[(0,ep.jsx)("span",{className:"text-[11px] font-medium",style:{color:"var(--ds-gray-700)"},children:t}),(0,ep.jsx)("span",{className:"text-[11px] font-mono",style:{color:"var(--ds-gray-1000)"},children:rp[t]?.(e[t])})]},t))}),r?(0,ep.jsx)(ek,{title:"Failed to load resource details",details:r.message,className:"my-4"}):o?(0,ep.jsx)(rv,{}):i.map(r=>(0,ep.jsx)(rg,{isLoading:t,attribute:r,value:e[r],context:u},r))]})})};var rx=e.i(483309);e.s(["ERROR_REVALIDATE_EVENT",()=>3,"FOCUS_EVENT",()=>0,"MUTATE_EVENT",()=>2,"RECONNECT_EVENT",()=>1],387876);var rb=Object.prototype.hasOwnProperty;let rw=new WeakMap,rk=()=>{},r_=rk(),rj=Object,rS=e=>e===r_,rE=(e,t)=>({...e,...t}),rC={},rN={},rL="undefined",rR=typeof window!=rL,rD=typeof document!=rL,rT=rR&&"Deno"in window,rM=(e,t)=>{let r=rw.get(e);return[()=>!rS(t)&&e.get(t)||rC,n=>{if(!rS(t)){let a=e.get(t);t in rN||(rN[t]=a),r[5](t,rE(a,n),a||rC)}},r[6],()=>!rS(t)&&t in rN?rN[t]:!rS(t)&&e.get(t)||rC]},rA=!0,[rP,rI]=rR&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[rk,rk],rO={initFocus:e=>(rD&&document.addEventListener("visibilitychange",e),rP("focus",e),()=>{rD&&document.removeEventListener("visibilitychange",e),rI("focus",e)}),initReconnect:e=>{let t=()=>{rA=!0,e()},r=()=>{rA=!1};return rP("online",t),rP("offline",r),()=>{rI("online",t),rI("offline",r)}}},rF=!j.default.useId,r$=!rR||rT,rH=r$?j.useEffect:j.useLayoutEffect,rW="undefined"!=typeof navigator&&navigator.connection,rV=!r$&&rW&&(["slow-2g","2g"].includes(rW.effectiveType)||rW.saveData),rq=new WeakMap,rB=(e,t)=>e===`[object ${t}]`,rz=0,rU=e=>{let t,r,n=typeof e,a=rj.prototype.toString.call(e),o=rB(a,"Date"),s=rB(a,"RegExp"),i=rB(a,"Object");if(rj(e)!==e||o||s)t=o?e.toJSON():"symbol"==n?e.toString():"string"==n?JSON.stringify(e):""+e;else{if(t=rq.get(e))return t;if(t=++rz+"~",rq.set(e,t),Array.isArray(e)){for(r=0,t="@";r<e.length;r++)t+=rU(e[r])+",";rq.set(e,t)}if(i){t="#";let n=rj.keys(e).sort();for(;!rS(r=n.pop());)rS(e[r])||(t+=r+":"+rU(e[r])+",");rq.set(e,t)}}return t},rQ=e=>{if("function"==typeof e)try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?rU(e):"",t]},rY=0,rX=()=>++rY;async function rK(...e){let[t,r,n,a]=e,o=rE({populateCache:!0,throwOnError:!0},"boolean"==typeof a?{revalidate:a}:a||{}),s=o.populateCache,i=o.rollbackOnError,l=o.optimisticData,u=o.throwOnError;if("function"==typeof r){let e=[];for(let n of t.keys())!/^\$(inf|sub)\$/.test(n)&&r(t.get(n)._k)&&e.push(n);return Promise.all(e.map(d))}return d(r);async function d(r){let a,[d]=rQ(r);if(!d)return;let[c,f]=rM(t,d),[m,p,h,v]=rw.get(t),g=()=>{let e=m[d];return("function"==typeof o.revalidate?o.revalidate(c().data,r):!1!==o.revalidate)&&(delete h[d],delete v[d],e&&e[0])?e[0](2).then(()=>c().data):c().data};if(e.length<3)return g();let y=n,x=!1,b=rX();p[d]=[b,0];let w=!rS(l),k=c(),_=k.data,j=k._c,S=rS(j)?_:j;if(w&&f({data:l="function"==typeof l?l(S,_):l,_c:S}),"function"==typeof y)try{y=y(S)}catch(e){a=e,x=!0}if(y&&"function"==typeof y.then){let e;if(y=await y.catch(e=>{a=e,x=!0}),b!==p[d][0]){if(x)throw a;return y}x&&w&&(e=a,"function"==typeof i?i(e):!1!==i)&&(s=!0,f({data:S,_c:r_}))}if(s&&!x&&("function"==typeof s?f({data:s(y,S),error:r_,_c:r_}):f({data:y,error:r_,_c:r_})),p[d][1]=rX(),Promise.resolve(g()).then(()=>{f({_c:r_})}),x){if(u)throw a;return}return y}}let rJ=(e,t)=>{for(let r in e)e[r][0]&&e[r][0](t)},rZ=(e,t)=>{if(!rw.has(e)){let r=rE(rO,t),n=Object.create(null),a=rK.bind(r_,e),o=rk,s=Object.create(null),i=(e,t)=>{let r=s[e]||[];return s[e]=r,r.push(t),()=>r.splice(r.indexOf(t),1)},l=(t,r,n)=>{e.set(t,r);let a=s[t];if(a)for(let e of a)e(r,n)},u=()=>{if(!rw.has(e)&&(rw.set(e,[n,Object.create(null),Object.create(null),Object.create(null),a,l,i]),!r$)){let t=r.initFocus(setTimeout.bind(r_,rJ.bind(r_,n,0))),a=r.initReconnect(setTimeout.bind(r_,rJ.bind(r_,n,1)));o=()=>{t&&t(),a&&a(),rw.delete(e)}}};return u(),[e,a,u,o]}return[e,rw.get(e)[4]]},[rG,r0]=rZ(new Map),r1=rE({onLoadingSlow:rk,onSuccess:rk,onError:rk,onErrorRetry:(e,t,r,n,a)=>{let o=r.errorRetryCount,s=a.retryCount,i=~~((Math.random()+.5)*(1<<(s<8?s:8)))*r.errorRetryInterval;(rS(o)||!(s>o))&&setTimeout(n,i,a)},onDiscarded:rk,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:rV?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:rV?5e3:3e3,compare:function e(t,r){var n,a;if(t===r)return!0;if(t&&r&&(n=t.constructor)===r.constructor){if(n===Date)return t.getTime()===r.getTime();if(n===RegExp)return t.toString()===r.toString();if(n===Array){if((a=t.length)===r.length)for(;a--&&e(t[a],r[a]););return -1===a}if(!n||"object"==typeof t){for(n in a=0,t)if(rb.call(t,n)&&++a&&!rb.call(r,n)||!(n in r)||!e(t[n],r[n]))return!1;return Object.keys(r).length===a}}return t!=t&&r!=r},isPaused:()=>!1,cache:rG,mutate:r0,fallback:{}},{isOnline:()=>rA,isVisible:()=>{let e=rD&&document.visibilityState;return rS(e)||"hidden"!==e}}),r2=(e,t)=>{let r=rE(e,t);if(t){let{use:n,fallback:a}=e,{use:o,fallback:s}=t;n&&o&&(r.use=n.concat(o)),a&&s&&(r.fallback=rE(a,s))}return r},r5=(0,j.createContext)({});var r4=e.i(387876);let r6=rR&&window.__SWR_DEVTOOLS_USE__,r3=(r6?window.__SWR_DEVTOOLS_USE__:[]).concat(e=>(t,r,n)=>{let a=r&&((...e)=>{let[n]=rQ(t),[,,,a]=rw.get(rG);if(n.startsWith("$inf$"))return r(...e);let o=a[n];return rS(o)?r(...e):(delete a[n],o)});return e(t,a,n)});r6&&(window.__SWR_DEVTOOLS_REACT__=j.default);let r8=()=>{},r7=r8(),r9=(new WeakMap,j.default.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}})),ne={dedupe:!0},nt=Promise.resolve(r_);rj.defineProperty(e=>{let{value:t}=e,r=(0,j.useContext)(r5),n="function"==typeof t,a=(0,j.useMemo)(()=>n?t(r):t,[n,r,t]),o=(0,j.useMemo)(()=>n?a:r2(r,a),[n,r,a]),s=a&&a.provider,i=(0,j.useRef)(r_);s&&!i.current&&(i.current=rZ(s(o.cache||rG),a));let l=i.current;return l&&(o.cache=l[0],o.mutate=l[1]),rH(()=>{if(l)return l[2]&&l[2](),l[3]},[]),(0,j.createElement)(r5.Provider,rE(e,{value:o}))},"defaultValue",{value:r1});let nr=(t=(e,t,r)=>{let{cache:n,compare:a,suspense:o,fallbackData:s,revalidateOnMount:i,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:d,refreshWhenOffline:c,keepPreviousData:f}=r,[m,p,h,v]=rw.get(n),[g,y]=rQ(e),x=(0,j.useRef)(!1),b=(0,j.useRef)(!1),w=(0,j.useRef)(g),k=(0,j.useRef)(t),_=(0,j.useRef)(r),S=()=>_.current.isVisible()&&_.current.isOnline(),[E,C,N,L]=rM(n,g),R=(0,j.useRef)({}).current,D=rS(s)?rS(r.fallback)?r_:r.fallback[g]:s,T=(e,t)=>{for(let r in R)if("data"===r){if(!a(e[r],t[r])&&(!rS(e[r])||!a(W,t[r])))return!1}else if(t[r]!==e[r])return!1;return!0},M=(0,j.useMemo)(()=>{let e=!!g&&!!t&&(rS(i)?!_.current.isPaused()&&!o&&!1!==l:i),r=t=>{let r=rE(t);return(delete r._k,e)?{isValidating:!0,isLoading:!0,...r}:r},n=E(),a=L(),s=r(n),u=n===a?s:r(a),d=s;return[()=>{let e=r(E());return T(e,d)?(d.data=e.data,d.isLoading=e.isLoading,d.isValidating=e.isValidating,d.error=e.error,d):(d=e,e)},()=>u]},[n,g]),A=(0,rx.useSyncExternalStore)((0,j.useCallback)(e=>N(g,(t,r)=>{T(r,t)||e()}),[n,g]),M[0],M[1]),P=!x.current,I=m[g]&&m[g].length>0,O=A.data,F=rS(O)?D&&"function"==typeof D.then?r9(D):D:O,$=A.error,H=(0,j.useRef)(F),W=f?rS(O)?rS(H.current)?F:H.current:O:F,V=(!I||!!rS($))&&(P&&!rS(i)?i:!_.current.isPaused()&&(o?!rS(F)&&l:rS(F)||l)),q=!!(g&&t&&P&&V),B=rS(A.isValidating)?q:A.isValidating,z=rS(A.isLoading)?q:A.isLoading,U=(0,j.useCallback)(async e=>{let t,n,o=k.current;if(!g||!o||b.current||_.current.isPaused())return!1;let s=!0,i=e||{},l=!h[g]||!i.dedupe,u=()=>rF?!b.current&&g===w.current&&x.current:g===w.current,d={isValidating:!1,isLoading:!1},c=()=>{C(d)},f=()=>{let e=h[g];e&&e[1]===n&&delete h[g]},v={isValidating:!0};rS(E().data)&&(v.isLoading=!0);try{if(l&&(C(v),r.loadingTimeout&&rS(E().data)&&setTimeout(()=>{s&&u()&&_.current.onLoadingSlow(g,r)},r.loadingTimeout),h[g]=[o(y),rX()]),[t,n]=h[g],t=await t,l&&setTimeout(f,r.dedupingInterval),!h[g]||h[g][1]!==n)return l&&u()&&_.current.onDiscarded(g),!1;d.error=r_;let e=p[g];if(!rS(e)&&(n<=e[0]||n<=e[1]||0===e[1]))return c(),l&&u()&&_.current.onDiscarded(g),!1;let i=E().data;d.data=a(i,t)?i:t,l&&u()&&_.current.onSuccess(t,g,r)}catch(r){f();let e=_.current,{shouldRetryOnError:t}=e;!e.isPaused()&&(d.error=r,l&&u())&&(e.onError(r,g,e),(!0===t||"function"==typeof t&&t(r))&&(!_.current.revalidateOnFocus||!_.current.revalidateOnReconnect||S())&&e.onErrorRetry(r,g,e,e=>{let t=m[g];t&&t[0]&&t[0](r4.ERROR_REVALIDATE_EVENT,e)},{retryCount:(i.retryCount||0)+1,dedupe:!0}))}return s=!1,c(),!0},[g,n]),Q=(0,j.useCallback)((...e)=>rK(n,w.current,...e),[]);if(rH(()=>{k.current=t,_.current=r,rS(O)||(H.current=O)}),rH(()=>{var e;let t;if(!g)return;let r=U.bind(r_,ne),n=0;_.current.revalidateOnFocus&&(n=Date.now()+_.current.focusThrottleInterval);let a=(e=(e,t={})=>{if(e==r4.FOCUS_EVENT){let e=Date.now();_.current.revalidateOnFocus&&e>n&&S()&&(n=e+_.current.focusThrottleInterval,r())}else if(e==r4.RECONNECT_EVENT)_.current.revalidateOnReconnect&&S()&&r();else if(e==r4.MUTATE_EVENT)return U();else if(e==r4.ERROR_REVALIDATE_EVENT)return U(t)},(t=m[g]||(m[g]=[])).push(e),()=>{let r=t.indexOf(e);r>=0&&(t[r]=t[t.length-1],t.pop())});if(b.current=!1,w.current=g,x.current=!0,C({_k:y}),V&&!h[g])if(rS(F)||r$)r();else rR&&typeof window.requestAnimationFrame!=rL?window.requestAnimationFrame(r):setTimeout(r,1);return()=>{b.current=!0,a()}},[g]),rH(()=>{let e;function t(){let t="function"==typeof u?u(E().data):u;t&&-1!==e&&(e=setTimeout(r,t))}function r(){!E().error&&(d||_.current.isVisible())&&(c||_.current.isOnline())?U(ne).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[u,d,c,g]),(0,j.useDebugValue)(W),o){let e=g&&rS(F);if(!rF&&r$&&e)throw Error("Fallback data is required when using Suspense in SSR.");e&&(k.current=t,_.current=r,b.current=!1);let n=v[g];if(r9(!rS(n)&&e?Q(n):nt),!rS($)&&e)throw $;let a=e?U(ne):nt;!rS(W)&&e&&(a.status="fulfilled",a.value=!0),r9(a)}return{mutate:Q,get data(){return R.data=!0,W},get error(){return R.error=!0,$},get isValidating(){return R.isValidating=!0,B},get isLoading(){return R.isLoading=!0,z}}},function(...e){let r,n=(r=(0,j.useContext)(r5),(0,j.useMemo)(()=>rE(r1,r),[r])),[a,o,s]="function"==typeof e[1]?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],i=r2(n,s),l=t,{use:u}=i,d=(u||[]).concat(r3);for(let e=d.length;e--;)l=d[e](l);return l(a,o||i.fetcher||null,i)});function nn({correlationId:e,env:t,events:r,expiredAt:n}){let a=null!=n&&new Date(n)<new Date,o=(0,j.useCallback)(()=>O(t,e,{sortOrder:"asc",limit:100,withData:!a}).then(e=>{if(!e.success)throw Error(e.error?.message||"Failed to fetch events");return D(e.data.data||[],!1)}),[t,e,a]),{data:s,error:i,isLoading:l}=nr(["workflow","events",e],o,{fallbackData:r,revalidateOnFocus:!1}),u=(s?.length?s:r)||[];return(0,ep.jsxs)("div",{className:"mt-2",style:{color:"var(--ds-gray-1000)"},children:[(0,ep.jsxs)("h3",{className:"text-heading-16 font-medium mt-4 mb-2",style:{color:"var(--ds-gray-1000)"},children:["Events ",!l&&`(${u.length})`]}),i?(0,ep.jsx)(ek,{title:"Failed to load full event list",details:i?.message,className:"my-4"}):null,l?(0,ep.jsx)("div",{children:"Loading events..."}):null,!l&&!i&&0===u.length&&(0,ep.jsx)("div",{className:"text-sm",children:"No events found"}),u.length>0&&!i?(0,ep.jsx)("div",{className:"flex flex-col gap-2",children:u.map((e,t)=>(0,ep.jsxs)(t0,{summary:(0,ep.jsxs)(ep.Fragment,{children:[(0,ep.jsx)("span",{className:"font-medium",style:{color:"var(--ds-gray-1000)"},children:e.name})," ","-"," ",(0,ep.jsx)("span",{style:{color:"var(--ds-gray-700)"},children:rm(1e3*e.timestamp[0]+e.timestamp[1]/1e6)})]}),children:[(0,ep.jsx)("div",{className:"flex flex-col divide-y rounded-md border overflow-hidden",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)"},children:Object.entries(e.attributes).filter(([e])=>"eventData"!==e).map(([e,t])=>(0,ep.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5",style:{borderColor:"var(--ds-gray-300)"},children:[(0,ep.jsx)("span",{className:"text-[11px] font-medium",style:{color:"var(--ds-gray-700)"},children:e}),(0,ep.jsx)("span",{className:"text-[11px] font-mono",style:{color:"var(--ds-gray-1000)"},children:String(t)})]},e))}),i&&(0,ep.jsx)("div",{className:"text-xs text-red-500 mt-2",children:"Error loading event data"}),!i&&!l&&e.attributes.eventData&&(0,ep.jsx)("div",{className:"mt-2",children:(0,ep.jsx)(rg,{isLoading:l,attribute:"eventData",value:e.attributes.eventData})})]},`${e.name}-${t}`))}):null]})}function na({env:e,run:t,onStreamClick:r}){let{state:n}=e8(),{selected:a}=n,[o,s]=(0,j.useState)(!1),[i,l]=(0,j.useState)(!1),[u,d]=(0,j.useState)(!1),c=a?.span.attributes?.data,{resource:f,resourceId:m,runId:p}=(0,j.useMemo)(()=>{let e=a?.span.attributes?.resource;return"step"===e?{resource:"step",resourceId:c.stepId,runId:c.runId}:"run"===e?{resource:"run",resourceId:c.runId,runId:void 0}:"hook"===e?{resource:"hook",resourceId:c.hookId,runId:void 0}:"sleep"===e?{resource:"sleep",resourceId:a?.span?.spanId,runId:void 0}:{resource:void 0,resourceId:void 0,runId:void 0}},[a,c]),h=a?.span.events,v=h?.length??0,g=(0,j.useMemo)(()=>{if("sleep"!==f||!h||["completed","failed","cancelled"].includes(t.status)||h.some(e=>"wait_completed"===e.name))return!1;let e=h.find(e=>"wait_created"===e.name),r=e?.attributes?.eventData,n=r?.resumeAt;return!!n&&new Date(n).getTime()>Date.now()},[f,h,v,t.status]),y=(0,j.useMemo)(()=>"hook"===f&&!!h&&!(["completed","failed","cancelled"].includes(t.status)||h.some(e=>"hook_disposed"===e.name)),[f,h,v,t.status]),x=(0,j.useMemo)(()=>{if("hook"===f)return c?.token},[f,c]),{data:b,error:w,loading:k}=eo(e,f,m??"",{runId:p});(0,j.useEffect)(()=>{w&&a&&f&&eW.error(`Failed to load ${f} details`,{description:w.message})},[w,f,a]);let _=async()=>{if(!o&&m)try{s(!0),(await eu(e,t.runId,{correlationIds:[m]})).stoppedCount>0?eW.success("Run woken up",{description:"The sleep call has been interrupted and the run woken up."}):eW.info("Sleep already completed",{description:"This sleep call has already finished."})}catch(e){console.error("Failed to wake up run:",e),eW.error("Failed to wake up run",{description:e instanceof Error?e.message:"An unknown error occurred"})}finally{s(!1)}},S=(0,j.useCallback)(async t=>{if(!u&&x)try{d(!0),await ed(e,x,t),eW.success("Hook resolved",{description:"The payload has been sent and the hook resolved."}),l(!1)}catch(e){console.error("Failed to resolve hook:",e),eW.error("Failed to resolve hook",{description:e instanceof Error?e.message:"An unknown error occurred"})}finally{d(!1)}},[e,x,u]);if(!a||!f||!m)return null;let E=b||c;return(0,ep.jsxs)("div",{className:(0,eQ.default)("flex flex-col px-2"),children:["sleep"===f&&g&&(0,ep.jsxs)("div",{className:"mb-3 pb-3 border-b border-gray-200 dark:border-gray-700",children:[(0,ep.jsxs)("button",{type:"button",onClick:_,disabled:o,className:(0,eQ.default)("flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md w-full","bg-amber-100 dark:bg-amber-900/30 text-amber-800 dark:text-amber-200","hover:bg-amber-200 dark:hover:bg-amber-900/50","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors",o?"opacity-50 cursor-not-allowed":"cursor-pointer"),children:[(0,ep.jsx)(e1,{className:"h-4 w-4"}),o?"Waking up...":"Wake up"]}),(0,ep.jsx)("p",{className:"mt-1.5 text-xs text-gray-500 dark:text-gray-400",children:"Interrupt this sleep call and wake up the run."})]}),"hook"===f&&y&&(0,ep.jsxs)("div",{className:"mb-3 pb-3 border-b border-gray-200 dark:border-gray-700",children:[(0,ep.jsxs)("button",{type:"button",onClick:()=>l(!0),disabled:u,className:(0,eQ.default)("flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md w-full","bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-200","hover:bg-blue-200 dark:hover:bg-blue-900/50","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors",u?"opacity-50 cursor-not-allowed":"cursor-pointer"),children:[(0,ep.jsx)(eL,{className:"h-4 w-4"}),"Resolve Hook"]}),(0,ep.jsx)("p",{className:"mt-1.5 text-xs text-gray-500 dark:text-gray-400",children:"Send a JSON payload to resolve this hook."})]}),(0,ep.jsx)(eX,{isOpen:i,onClose:()=>l(!1),onSubmit:S,isSubmitting:u}),(0,ep.jsx)(ry,{data:E,expiredAt:t.expiredAt,isLoading:k,error:w??void 0,onStreamClick:r}),"run"!==f&&(0,ep.jsx)(nn,{correlationId:m,env:e,events:a.span.events,expiredAt:t.expiredAt})]})}function no(e,t=!1){if(t&&"pending"===e)return e7.default.spanPendingStriped;switch(e){case"running":return e7.default.spanRunning;case"pending":return e7.default.spanPending;case"completed":return e7.default.spanCompleted;case"cancelled":return e7.default.spanCancelled;case"failed":return e7.default.spanFailed;default:return""}}let ns=e=>{let t=e.span.attributes,r=t?.resource;if("step"===r){let e=t.data,r=e?.stepName;if(r&&String(r).toLowerCase().endsWith("sleep"))return e7.default.spanSleep;let n=e?.status==="pending";return no(e?.status,n)}if("run"===r){let e=t.data;return no(e?.status,!1)}return"hook"===r?e7.default.spanHook:"sleep"===r?e7.default.spanSleep:""},ni=e=>{let t=e.event.name;return"step_failed"===t||"workflow_failed"===t?e7.default.eventFailed:"step_retrying"===t?e7.default.eventRetrying:"hook_created"===t||"hook_received"===t||"hook_disposed"===t?e7.default.eventHook:e7.default.eventDefault};function nl({env:e,streamId:t}){let[r,n]=(0,j.useState)([]),[a,o]=(0,j.useState)(!0),[s,i]=(0,j.useState)(null),[l,u]=(0,j.useState)(!1),d=(0,j.useRef)(null),c=(0,j.useRef)(null),f=(0,j.useRef)(0),m=(0,j.useCallback)(()=>{if(d.current){let{scrollTop:e,scrollHeight:t,clientHeight:r}=d.current;u(!(t-e-r<10)&&t>r)}},[]);return(0,j.useEffect)(()=>{d.current&&(d.current.scrollTop=d.current.scrollHeight),m()},[r.length,m]),(0,j.useEffect)(()=>{let r=!0;c.current=new AbortController;let a=()=>{r&&o(!1)},s=e=>{if(r&&null!=e){let t=f.current++,r="string"==typeof e?e:JSON.stringify(e,null,2);n(e=>[...e,{id:t,text:r}])}},l=async e=>{for(;!c.current?.signal.aborted;){let{value:t,done:r}=await e.read();if(r){a();break}s(t)}};return(async()=>{try{let r=(await ec(e,t)).getReader();await l(r)}catch(e){r&&(i(e instanceof Error?e.message:String(e)),o(!1))}})(),()=>{r=!1,c.current&&c.current.abort()}},[e,t]),(0,ep.jsxs)("div",{className:"flex flex-col h-full pb-4",children:[(0,ep.jsxs)("div",{className:"flex items-center justify-between mb-3 px-1",children:[(0,ep.jsx)("code",{className:"text-xs font-mono truncate max-w-[80%]",style:{color:"var(--ds-gray-900)"},title:t,children:t}),(0,ep.jsxs)("span",{className:"text-xs flex items-center gap-1.5",style:{color:a?"var(--ds-green-700)":"var(--ds-gray-600)"},children:[(0,ep.jsx)("span",{className:"inline-block w-2 h-2 rounded-full",style:{backgroundColor:a?"var(--ds-green-600)":"var(--ds-gray-500)"}}),a?"Live":"Closed"]})]}),(0,ep.jsxs)("div",{className:"relative flex-1 min-h-[200px]",children:[(0,ep.jsx)("div",{ref:d,onScroll:m,className:"absolute inset-0 overflow-auto flex flex-col gap-2",children:s?(0,ep.jsxs)("div",{className:"text-[11px] rounded-md border p-3",style:{borderColor:"var(--ds-red-300)",backgroundColor:"var(--ds-red-100)",color:"var(--ds-red-700)"},children:[(0,ep.jsx)("div",{children:"Error reading stream:"}),(0,ep.jsx)("div",{children:s})]}):0===r.length?(0,ep.jsx)("div",{className:"text-[11px] rounded-md border p-3",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)",color:"var(--ds-gray-600)"},children:a?"Waiting for stream data...":"Stream is empty"}):r.map((e,r)=>(0,ep.jsx)("pre",{className:"text-[11px] rounded-md border p-3 m-0 whitespace-pre-wrap break-words",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)",color:"var(--ds-gray-1000)"},children:(0,ep.jsxs)("code",{children:[(0,ep.jsxs)("span",{className:"select-none mr-2",style:{color:"var(--ds-gray-500)"},children:["[",r,"]"]}),e.text]})},`${t}-chunk-${e.id}`))}),l&&(0,ep.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-8 pointer-events-none",style:{background:"linear-gradient(to top, var(--ds-background-100), transparent)"}})]})]})}e.s(["WorkflowTraceViewer",0,({run:e,steps:t,hooks:r,events:o,env:s,isLoading:i,error:l,onStreamClick:u})=>{let[d,c]=(0,j.useState)(()=>new Date);(0,j.useEffect)(()=>{if(!e?.completedAt){let e=setInterval(()=>{c(new Date)},2e3);return()=>clearInterval(e)}},[e?.completedAt]);let f=(0,j.useMemo)(()=>{let s,i,l,u,c;if(!e)return;let f=new Map,m=new Map,p=[],h=new Map,v=new Map;for(let e of o){if("wait_created"===e.eventType||"wait_completed"===e.eventType){let t=h.get(e.correlationId)||[];t.push(e),h.set(e.correlationId,t);continue}if("hook_received"===e.eventType||"hook_created"===e.eventType||"hook_disposed"===e.eventType){let t=v.get(e.correlationId)||[];t.push(e),v.set(e.correlationId,t);continue}let n=e.correlationId;if(n){let a=t.find(e=>e.stepId===n),o=r.find(e=>e.hookId===n);if(a){let t=f.get(n)||[];t.push(e),f.set(n,t)}else if(o){let t=m.get(n)||[];t.push(e),m.set(n,t)}else p.push(e)}else p.push(e)}let g=t.map(e=>{let t,r,n,o,s,i,l,u=f.get(e.stepId)||[];return t=d??new Date,r=a(String(e.stepName)),n=new Date(e.completedAt??t),o=D(u),s=new Date(e.createdAt),i=e.startedAt?new Date(e.startedAt):void 0,(l=u.find(e=>"step_started"===e.eventType))&&(i=new Date(l.createdAt)),{spanId:String(e.stepId),name:r?.shortName??"",kind:1,resource:"step",library:L,status:{code:0},traceFlags:1,attributes:{resource:"step",data:e},links:[],events:o,startTime:E(s),endTime:E(n),duration:N(s,n),activeStartTime:i&&i.getTime()>s.getTime()?E(i):void 0}}),y=Array.from(v.entries()).map(([t,r])=>(function(e,t,r){let n=M(e);if(!n)return null;let a=D(e),o=new Date(t.completedAt||r)??r,s=n.disposedAt||o;return{spanId:String(n.hookId),name:String(n.hookId),kind:1,resource:"hook",library:L,status:{code:1},traceFlags:1,attributes:{resource:"hook",data:n},links:[],events:a,startTime:E(n.createdAt),endTime:E(s),duration:N(n.createdAt,s)}})(r,e,d)).filter(e=>null!==e),x=Array.from(h.entries()).map(([t,r])=>(function(e,t,r){let n=T(e);if(!n)return null;let a=new Date(t.completedAt||r)??r,o=n?.createdAt??r,s=n?.completedAt??a,i=E(o),l=E(s),u=N(o,s),d=D(e);return{spanId:n.waitId,name:"sleep",kind:1,resource:"sleep",library:L,status:{code:0},traceFlags:1,attributes:{resource:"sleep",data:n},links:[],events:d,duration:u,startTime:i,endTime:l}})(r,e,d)).filter(e=>null!==e),b=[(s=d??new Date,i=new Date(e.createdAt),l=e.startedAt?new Date(e.startedAt):void 0,u=e.completedAt??s,c=D(p),{spanId:String(e.runId),name:String(n(e.workflowName)?.shortName??"?"),kind:1,resource:"run",library:L,status:{code:0},traceFlags:1,attributes:{resource:"run",data:e},links:[],events:c,startTime:E(i),endTime:E(u),duration:N(i,u),activeStartTime:l&&l.getTime()>i.getTime()?E(l):void 0}),...[...g,...y,...x].slice().sort((e,t)=>C(e.startTime)-C(t.startTime))],w=b.map((e,t)=>{let r=0===t?void 0:String(b[t-1].spanId);return{...e,parentSpanId:r}});return{traceId:e.runId,rootSpanId:e.runId,spans:w,resources:[{name:"workflow",attributes:{"service.name":L.name}}]}},[e,t,r,o,d]);return((0,j.useEffect)(()=>{l&&!i&&(console.error(l),eW.error("Error loading workflow trace data",{description:l.message}))},[l,i]),i||!f)?(0,ep.jsxs)("div",{className:"relative w-full h-full",children:[(0,ep.jsx)("div",{className:"border-b border-gray-alpha-400 w-full"}),(0,ep.jsx)(e0,{className:"w-full ml-2 mt-1 mb-1 h-[56px]"}),(0,ep.jsxs)("div",{className:"p-2 relative w-full",children:[(0,ep.jsx)(e0,{className:"w-full mt-6 h-[20px]"}),(0,ep.jsx)(e0,{className:"w-[10%] mt-2 ml-6 h-[20px]"}),(0,ep.jsx)(e0,{className:"w-[10%] mt-2 ml-12 h-[20px]"}),(0,ep.jsx)(e0,{className:"w-[20%] mt-2 ml-16 h-[20px]"})]})]}):(0,ep.jsx)("div",{className:"relative w-full h-full",children:(0,ep.jsx)(e3,{withPanel:!0,customSpanClassNameFunc:ns,customSpanEventClassNameFunc:ni,customPanelComponent:(0,ep.jsx)(e_,{title:"Failed to load entity details",children:(0,ep.jsx)(na,{env:s,run:e,onStreamClick:u})}),children:(0,ep.jsx)(tX,{height:"100%",trace:f,withPanel:!0})})})}],195547),e.s(["StreamViewer",()=>nl],742334),e.s([],169764)},949245,e=>{"use strict";var t=e.i(7284),r=e.i(884212);function n(...e){return(0,r.twMerge)((0,t.clsx)(e))}e.i(169764),e.s(["DEFAULT_PAGE_SIZE",0,10,"LIVE_UPDATE_INTERVAL_MS",0,5e3,"cn",()=>n])},638322,714594,e=>{"use strict";var t=e.i(666426),r=e.i(912738),n=e.i(686107),a=e.i(949245);r.Provider;let o=r.Root,s=r.Trigger,i=n.forwardRef(({className:e,sideOffset:n=4,...o},s)=>(0,t.jsx)(r.Content,{ref:s,sideOffset:n,className:(0,a.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));i.displayName=r.Content.displayName,e.s(["Tooltip",()=>o,"TooltipContent",()=>i,"TooltipTrigger",()=>s],638322);let l=(0,n.createContext)(null);function u({children:e,serverConfig:r}){return(0,t.jsx)(l.Provider,{value:{serverConfig:r},children:e})}function d(){let e=(0,n.useContext)(l);if(!e)throw Error("useServerConfig must be used within a ServerConfigProvider");return e}e.s(["ServerConfigProvider",()=>u,"useServerConfig",()=>d],714594)},68206,652773,e=>{"use strict";var t=e.i(686107);function r(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function n(...e){return t=>{let n=!1,a=e.map(e=>{let a=r(e,t);return n||"function"!=typeof a||(n=!0),a});if(n)return()=>{for(let t=0;t<a.length;t++){let n=a[t];"function"==typeof n?n():r(e[t],null)}}}}function a(...e){return t.useCallback(n(...e),e)}e.s(["composeRefs",()=>n,"useComposedRefs",()=>a],652773);var o=e.i(666426),s=t.forwardRef((e,r)=>{let{children:n,...a}=e,s=t.Children.toArray(n),l=s.find(u);if(l){let e=l.props.children,n=s.map(r=>r!==l?r:t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null);return(0,o.jsx)(i,{...a,ref:r,children:t.isValidElement(e)?t.cloneElement(e,void 0,n):null})}return(0,o.jsx)(i,{...a,ref:r,children:n})});s.displayName="Slot";var i=t.forwardRef((e,r)=>{let{children:a,...o}=e;if(t.isValidElement(a)){var s;let e,i,l=(s=a,(i=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(i=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref);return t.cloneElement(a,{...function(e,t){let r={...t};for(let n in t){let a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{o(...e),a(...e)}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}(o,a.props),ref:r?n(r,l):l})}return t.Children.count(a)>1?t.Children.only(null):null});i.displayName="SlotClone";var l=({children:e})=>(0,o.jsx)(o.Fragment,{children:e});function u(e){return t.isValidElement(e)&&e.type===l}e.s(["Slot",()=>s,"Slottable",()=>l],68206)},294237,e=>{"use strict";var t=e.i(7284);let r=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=t.clsx;e.s(["cva",0,(e,t)=>a=>{var o;if((null==t?void 0:t.variants)==null)return n(e,null==a?void 0:a.class,null==a?void 0:a.className);let{variants:s,defaultVariants:i}=t,l=Object.keys(s).map(e=>{let t=null==a?void 0:a[e],n=null==i?void 0:i[e];if(null===t)return null;let o=r(t)||r(n);return s[e][o]}),u=a&&Object.entries(a).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return n(e,l,null==t||null==(o=t.compoundVariants)?void 0:o.reduce((e,t)=>{let{class:r,className:n,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...i,...u}[t]):({...i,...u})[t]===r})?[...e,r,n]:e},[]),null==a?void 0:a.class,null==a?void 0:a.className)}])},260218,e=>{"use strict";var t=e.i(666426),r=e.i(68206),n=e.i(294237),a=e.i(686107),o=e.i(949245);let s=(0,n.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),i=a.forwardRef(({className:e,variant:n,size:a,asChild:i=!1,...l},u)=>{let d=i?r.Slot:"button";return(0,t.jsx)(d,{className:(0,o.cn)(s({variant:n,size:a,className:e})),ref:u,...l})});i.displayName="Button",e.s(["Button",()=>i,"buttonVariants",()=>s])}]);
|