@playwright-opentelemetry/trace-viewer 0.13.6 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -5
- package/bin/serve.js +8 -1
- package/dist/_headers +2 -0
- package/dist/assets/index-B9t42RLn.css +1 -0
- package/dist/assets/index-CB5ERgmm.js +14 -0
- package/dist/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/dist/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/dist/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/dist/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/dist/assets/screenshotZip-Bd6FAfM1.js +2 -0
- package/dist/index.html +2 -2
- package/dist/sw.js +1 -1
- package/package.json +3 -2
- package/dist/assets/index-DhR_6PM8.css +0 -2
- package/dist/assets/index-YfpltsWk.js +0 -13
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return t(this.context.count)},getNextContextId(){return t(this.context.count++)}};function t(t){let n=String(t),r=n.length-1;return e.context.id+(r?String.fromCharCode(96+r):``)+n}function n(t){e.context=t}function r(){return{...e.context,id:e.getNextContextId(),count:0}}var i=(e,t)=>e===t,a=Symbol(`solid-proxy`),o=typeof Proxy==`function`,s=Symbol(`solid-track`),c={equals:i},l=null,u=be,d=1,f=2,p={owned:null,cleanups:null,context:null,owner:null},m={},h=null,g=null,_=null,v=null,y=null,b=null,x=null,S=0;function C(e,t){let n=y,r=h,i=e.length===0,a=t===void 0?r:t,o=i?p:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>j(()=>Te(o)));h=o,y=null;try{return P(s,!0)}finally{y=n,h=r}}function w(e,t){t=t?Object.assign({},c,t):c;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[pe.bind(n),e=>(typeof e==`function`&&(e=g&&g.running&&g.sources.has(n)?e(n.tValue):e(n.value)),me(n,e))]}function T(e,t,n){let r=_e(e,t,!0,d);_&&g&&g.running?b.push(r):he(r)}function E(e,t,n){let r=_e(e,t,!1,d);_&&g&&g.running?b.push(r):he(r)}function D(e,t,n){u=Se;let r=_e(e,t,!1,d),i=fe&&ue(fe);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),x?x.push(r):he(r)}function O(e,t,n){n=n?Object.assign({},c,n):c;let r=_e(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,_&&g&&g.running?(r.tState=d,b.push(r)):he(r),pe.bind(r)}function ee(e){return e&&typeof e==`object`&&`then`in e}function k(t,n,r){let i,a,o;typeof n==`function`?(i=t,a=n,o=r||{}):(i=!0,a=t,o=n||{});let s=null,c=m,l=null,u=!1,d=!1,f=`initialValue`in o,p=typeof i==`function`&&O(i),_=new Set,[v,b]=(o.storage||w)(o.initialValue),[x,S]=w(void 0),[C,E]=w(void 0,{equals:!1}),[D,k]=w(f?`ready`:`unresolved`);e.context&&(l=e.getNextContextId(),o.ssrLoadFrom===`initial`?c=o.initialValue:e.load&&e.has(l)&&(c=e.load(l)));function A(e,t,n,r){return s===e&&(s=null,r!==void 0&&(f=!0),(e===c||t===c)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(r,{value:t})),c=m,g&&e&&u?(g.promises.delete(e),u=!1,P(()=>{g.running=!0,M(t,n)},!1)):M(t,n)),t}function M(e,t){P(()=>{t===void 0&&b(()=>e),k(t===void 0?f?`ready`:`unresolved`:`errored`),S(t);for(let e of _.keys())e.decrement();_.clear()},!1)}function te(){let e=fe&&ue(fe),t=v(),n=x();if(n!==void 0&&!s)throw n;return y&&!y.user&&e&&T(()=>{C(),s&&(e.resolved&&g&&u?g.promises.add(s):_.has(e)||(e.increment(),_.add(e)))}),t}function N(e=!0){if(e!==!1&&d)return;d=!1;let t=p?p():i;if(u=g&&g.running,t==null||t===!1){A(s,j(v));return}g&&s&&g.promises.delete(s);let n,r=c===m?j(()=>{try{return a(t,{value:v(),refetching:e})}catch(e){n=e}}):c;if(n!==void 0){A(s,void 0,De(n),t);return}else if(!ee(r))return A(s,r,void 0,t),r;return s=r,`v`in r?(r.s===1?A(s,r.v,void 0,t):A(s,void 0,De(r.v),t),r):(d=!0,queueMicrotask(()=>d=!1),P(()=>{k(f?`refreshing`:`pending`),E()},!1),r.then(e=>A(r,e,void 0,t),e=>A(r,void 0,De(e),t)))}Object.defineProperties(te,{state:{get:()=>D()},error:{get:()=>x()},loading:{get(){let e=D();return e===`pending`||e===`refreshing`}},latest:{get(){if(!f)return te();let e=x();if(e&&!s)throw e;return v()}}});let ne=h;return p?T(()=>(ne=h,N(!1))):N(!1),[te,{refetch:e=>ae(ne,()=>N(e)),mutate:b}]}function A(e){return P(e,!1)}function j(e){if(!v&&y===null)return e();let t=y;y=null;try{return v?v.untrack(e):e()}finally{y=t}}function M(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=j(()=>t(o,i,n));return i=o,s}}function te(e){D(()=>j(e))}function N(e){return h===null||(h.cleanups===null?h.cleanups=[e]:h.cleanups.push(e)),e}function ne(e,t){l||=Symbol(`error`),h=_e(void 0,void 0,!0),h.context={...h.context,[l]:[t]},g&&g.running&&g.sources.add(h);try{return e()}catch(e){ke(e)}finally{h=h.owner}}function re(){return y}function ie(){return h}function ae(e,t){let n=h,r=y;h=e,y=null;try{return P(t,!0)}catch(e){ke(e)}finally{h=n,y=r}}function oe(e){if(g&&g.running)return e(),g.done;let t=y,n=h;return Promise.resolve().then(()=>{y=t,h=n;let r;return(_||fe)&&(r=g||={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0},r.done||=new Promise(e=>r.resolve=e),r.running=!0),P(e,!1),y=h=null,r?r.done:void 0})}var[se,ce]=w(!1);function le(e,t){let n=Symbol(`context`);return{id:n,Provider:je(n),defaultValue:e}}function ue(e){let t;return h&&h.context&&(t=h.context[e.id])!==void 0?t:e.defaultValue}function de(e){let t=O(e),n=O(()=>Ae(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}var fe;function pe(){let e=g&&g.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===d)he(this);else{let e=b;b=null,P(()=>Ce(this),!1),b=e}if(y){let e=this.observers;if(!e||e[e.length-1]!==y){let t=e?e.length:0;y.sources?(y.sources.push(this),y.sourceSlots.push(t)):(y.sources=[this],y.sourceSlots=[t]),e?(e.push(y),this.observerSlots.push(y.sources.length-1)):(this.observers=[y],this.observerSlots=[y.sources.length-1])}}return e&&g.sources.has(this)?this.tValue:this.value}function me(e,t,n){let r=g&&g.running&&g.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(g){let r=g.running;(r||!n&&g.sources.has(e))&&(g.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&P(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=g&&g.running;r&&g.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?b.push(n):x.push(n),n.observers&&we(n)),r?n.tState=d:n.state=d)}if(b.length>1e6)throw b=[],Error()},!1)}return t}function he(e){if(!e.fn)return;Te(e);let t=S;ge(e,g&&g.running&&g.sources.has(e)?e.tValue:e.value,t),g&&!g.running&&g.sources.has(e)&&queueMicrotask(()=>{P(()=>{g&&(g.running=!0),y=h=e,ge(e,e.tValue,t),y=h=null},!1)})}function ge(e,t,n){let r,i=h,a=y;y=h=e;try{r=e.fn(t)}catch(t){return e.pure&&(g&&g.running?(e.tState=d,e.tOwned&&e.tOwned.forEach(Te),e.tOwned=void 0):(e.state=d,e.owned&&e.owned.forEach(Te),e.owned=null)),e.updatedAt=n+1,ke(t)}finally{y=a,h=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?me(e,r,!0):g&&g.running&&e.pure?(g.sources.has(e)||(e.value=r),g.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function _e(e,t,n,r=d,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:h,context:h?h.context:null,pure:n};if(g&&g.running&&(a.state=0,a.tState=r),h===null||h!==p&&(g&&g.running&&h.pure?h.tOwned?h.tOwned.push(a):h.tOwned=[a]:h.owned?h.owned.push(a):h.owned=[a]),v&&a.fn){let e=a.fn,[t,n]=w(void 0,{equals:!1}),r=v.factory(e,n);N(()=>r.dispose());let i,o=()=>oe(n).then(()=>{i&&=(i.dispose(),void 0)});a.fn=n=>(t(),g&&g.running?(i||=v.factory(e,o),i.track(n)):r.track(n))}return a}function ve(e){let t=g&&g.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===f)return Ce(e);if(e.suspense&&j(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<S);){if(t&&g.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(g.disposed.has(t))return}if((t?e.tState:e.state)===d)he(e);else if((t?e.tState:e.state)===f){let t=b;b=null,P(()=>Ce(e,n[0]),!1),b=t}}}function P(e,t){if(b)return e();let n=!1;t||(b=[]),x?n=!0:x=[],S++;try{let t=e();return ye(n),t}catch(e){n||(x=null),b=null,ke(e)}}function ye(e){if(b&&=(_&&g&&g.running?xe(b):be(b),null),e)return;let t;if(g){if(!g.promises.size&&!g.queue.size){let e=g.sources,n=g.disposed;x.push.apply(x,g.effects),t=g.resolve;for(let e of x)`tState`in e&&(e.state=e.tState),delete e.tState;g=null,P(()=>{for(let e of n)Te(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)Te(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}ce(!1)},!1)}else if(g.running){g.running=!1,g.effects.push.apply(g.effects,x),x=null,ce(!0);return}}let n=x;x=null,n.length&&P(()=>u(n),!1),t&&t()}function be(e){for(let t=0;t<e.length;t++)ve(e[t])}function xe(e){for(let t=0;t<e.length;t++){let n=e[t],r=g.queue;r.has(n)||(r.add(n),_(()=>{r.delete(n),P(()=>{g.running=!0,ve(n)},!1),g&&(g.running=!1)}))}}function Se(t){let r,i=0;for(r=0;r<t.length;r++){let e=t[r];e.user?t[i++]=e:ve(e)}if(e.context){if(e.count){e.effects||=[],e.effects.push(...t.slice(0,i));return}n()}for(e.effects&&(e.done||!e.count)&&(t=[...e.effects,...t],i+=e.effects.length,delete e.effects),r=0;r<i;r++)ve(t[r])}function Ce(e,t){let n=g&&g.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===d?i!==t&&(!i.updatedAt||i.updatedAt<S)&&ve(i):e===f&&Ce(i,t)}}}function we(e){let t=g&&g.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=f:r.state=f,r.pure?b.push(r):x.push(r),r.observers&&we(r))}}function Te(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Te(e.tOwned[t]);delete e.tOwned}if(g&&g.running&&e.pure)Ee(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)Te(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}g&&g.running?e.tState=0:e.state=0}function Ee(e,t){if(t||(e.tState=0,g.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)Ee(e.owned[t])}function De(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function Oe(e,t,n){try{for(let n of t)n(e)}catch(e){ke(e,n&&n.owner||null)}}function ke(e,t=h){let n=l&&t&&t.context&&t.context[l],r=De(e);if(!n)throw r;x?x.push({fn(){Oe(r,n,t)},state:d}):Oe(r,n,t)}function Ae(e){if(typeof e==`function`&&!e.length)return Ae(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=Ae(e[n]);if(Array.isArray(r))if(r.length<32768)t.push.apply(t,r);else for(let e=0;e<r.length;e++)t.push(r[e]);else t.push(r)}return t}return e}function je(e,t){return function(t){let n;return E(()=>n=j(()=>(h.context={...h.context,[e]:t.value},de(()=>t.children))),void 0),n}}var Me=Symbol(`fallback`);function Ne(e){for(let t=0;t<e.length;t++)e[t]()}function Pe(e,t,n={}){let r=[],i=[],a=[],o=0,c=t.length>1?[]:null;return N(()=>Ne(a)),()=>{let l=e()||[],u=l.length,d,f;return l[s],j(()=>{let e,t,s,m,h,g,_,v,y;if(u===0)o!==0&&(Ne(a),a=[],r=[],i=[],o=0,c&&=[]),n.fallback&&(r=[Me],i[0]=C(e=>(a[0]=e,n.fallback())),o=1);else if(o===0){for(i=Array(u),f=0;f<u;f++)r[f]=l[f],i[f]=C(p);o=u}else{for(s=Array(u),m=Array(u),c&&(h=Array(u)),g=0,_=Math.min(o,u);g<_&&r[g]===l[g];g++);for(_=o-1,v=u-1;_>=g&&v>=g&&r[_]===l[v];_--,v--)s[v]=i[_],m[v]=a[_],c&&(h[v]=c[_]);for(e=new Map,t=Array(v+1),f=v;f>=g;f--)y=l[f],d=e.get(y),t[f]=d===void 0?-1:d,e.set(y,f);for(d=g;d<=_;d++)y=r[d],f=e.get(y),f!==void 0&&f!==-1?(s[f]=i[d],m[f]=a[d],c&&(h[f]=c[d]),f=t[f],e.set(y,f)):a[d]();for(f=g;f<u;f++)f in s?(i[f]=s[f],a[f]=m[f],c&&(c[f]=h[f],c[f](f))):i[f]=C(p);i=i.slice(0,o=u),r=l.slice(0)}return i});function p(e){if(a[f]=e,c){let[e,n]=w(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}var Fe=!1;function F(t,i){if(Fe&&e.context){let a=e.context;n(r());let o=j(()=>t(i||{}));return n(a),o}return j(()=>t(i||{}))}function Ie(){return!0}var Le={get(e,t,n){return t===a?n:e.get(t)},has(e,t){return t===a?!0:e.has(t)},set:Ie,deleteProperty:Ie,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Ie,deleteProperty:Ie}},ownKeys(e){return e.keys()}};function Re(e){return(e=typeof e==`function`?e():e)?e:{}}function ze(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function I(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t||=!!r&&a in r,e[n]=typeof r==`function`?(t=!0,O(r)):r}if(o&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=Re(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in Re(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(Re(e[n])));return[...new Set(t)]}},Le);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:ze.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let i={},s=Object.keys(r);for(let e=s.length-1;e>=0;e--){let t=s[e],n=r[t];n&&n.get?Object.defineProperty(i,t,n):i[t]=n?n.value:void 0}return i}function Be(e,...t){let n=t.length;if(o&&a in e){let r=n>1?t.flat():t[0],i=t.map(t=>new Proxy({get(n){return t.includes(n)?e[n]:void 0},has(n){return t.includes(n)&&n in e},keys(){return t.filter(t=>t in e)}},Le));return i.push(new Proxy({get(t){return r.includes(t)?void 0:e[t]},has(t){return r.includes(t)?!1:t in e},keys(){return Object.keys(e).filter(e=>!r.includes(e))}},Le)),i}let r=[];for(let e=0;e<=n;e++)r[e]={};for(let i of Object.getOwnPropertyNames(e)){let a=n;for(let e=0;e<t.length;e++)if(t[e].includes(i)){a=e;break}let o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}var Ve=0;function He(){return e.context?e.getNextContextId():`cl-${Ve++}`}var Ue=e=>`Stale read from <${e}>.`;function L(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return O(Pe(()=>e.each,e.children,t||void 0))}function R(e){let t=e.keyed,n=O(()=>e.when,void 0,void 0),r=t?n:O(n,void 0,{equals:(e,t)=>!e==!t});return O(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?j(()=>a(t?i:()=>{if(!j(r))throw Ue(`Show`);return n()})):a}return e.fallback},void 0,void 0)}function We(e){let t=de(()=>e.children),n=O(()=>{let e=t(),n=Array.isArray(e)?e:[e],r=()=>void 0;for(let e=0;e<n.length;e++){let t=e,i=n[e],a=r,o=O(()=>a()?void 0:i.when,void 0,void 0),s=i.keyed?o:O(o,void 0,{equals:(e,t)=>!e==!t});r=()=>a()||(s()?[t,o,i]:void 0)}return r});return O(()=>{let t=n()();if(!t)return e.fallback;let[r,i,a]=t,o=a.children;return typeof o==`function`&&o.length>0?j(()=>o(a.keyed?i():()=>{if(j(n)()?.[0]!==r)throw Ue(`Match`);return i()})):o},void 0,void 0)}function Ge(e){return e}var Ke;function qe(t){let n;e.context&&e.load&&(n=e.load(e.getContextId()));let[r,i]=w(n,void 0);return Ke||=new Set,Ke.add(i),N(()=>Ke.delete(i)),O(()=>{let e;if(e=r()){let n=t.fallback;return typeof n==`function`&&n.length?j(()=>n(e,()=>i())):n}return ne(()=>t.children,i)},void 0,void 0)}var Je=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),Ye=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),Xe=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),Ze=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function Qe(e,t){let n=Ze[e];return typeof n==`object`?n[t]?n.$:void 0:n}var $e=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),et=new Set(`altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.color-profile.cursor.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.svg.switch.symbol.text.textPath.tref.tspan.use.view.vkern`.split(`.`)),tt={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},nt=e=>O(()=>e());function rt(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null)if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&!((d=l.get(t[c]))==null||d!==r+u);)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}var it=`_$DX_DELEGATE`;function at(e,t,n,r={}){let i;return C(r=>{i=r,t===document?e():H(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function z(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>j(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function ot(e,t=window.document){let n=t[it]||(t[it]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,xt))}}function B(e,t,n){_t(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function st(e,t,n,r){_t(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function ct(e,t,n){_t(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function lt(e,t){_t(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function ut(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function dt(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];!r||r===`undefined`||t[r]||(yt(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];!i||i===`undefined`||n[i]===o||!o||(yt(e,i,!0),n[i]=o)}return n}function ft(e,t,n){if(!t)return n?B(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function V(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function pt(e,t={},n,r){let i={};return r||E(()=>i.children=St(e,t.children,i.children)),E(()=>typeof t.ref==`function`&&mt(t.ref,e)),E(()=>ht(e,t,n,!0,i,!0)),i}function mt(e,t,n){return j(()=>e(t,n))}function H(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return St(e,t,r,n);E(r=>St(e,t(),r,n),r)}function ht(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=bt(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||St(e,t.children);continue}let s=t[o];i[o]=bt(e,o,s,i[o],n,a,t)}}function gt(t){let n,r;return!_t()||!(n=e.registry.get(r=Et()))?t():(e.completed&&e.completed.add(n),e.registry.delete(r),n)}function _t(t){return!!e.context&&!e.done&&(!t||t.isConnected)}function vt(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function yt(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function bt(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return ft(e,n,r);if(t===`classList`)return dt(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=$e.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(ut(e,i,n,a),a&&ot([i]))}else if(t.slice(0,5)===`attr:`)B(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)ct(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=Ye.has(t))||!i&&((u=Qe(t,e.tagName))||(c=Je.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(_t(e))return n;t===`class`||t===`className`?lt(e,n):s&&!c&&!l?e[vt(t)]=n:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&tt[t.split(`:`)[0]];r?st(e,r,t,n):B(e,Xe[t]||t,n)}return n}function xt(t){if(e.registry&&e.events&&e.events.find(([e,n])=>n===t))return;let n=t.target,r=`$$${t.type}`,i=t.target,a=t.currentTarget,o=e=>Object.defineProperty(t,"target",{configurable:!0,value:e}),s=()=>{let e=n[r];if(e&&!n.disabled){let i=n[`${r}Data`];if(i===void 0?e.call(n,t):e.call(n,i,t),t.cancelBubble)return}return n.host&&typeof n.host!=`string`&&!n.host._$host&&n.contains(t.target)&&o(n.host),!0},c=()=>{for(;s()&&(n=n._$host||n.parentNode||n.host););};if(Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}}),e.registry&&!e.done&&(e.done=_$HY.done=!0),t.composedPath){let e=t.composedPath();o(e[0]);for(let t=0;t<e.length-2&&(n=e[t],s());t++){if(n._$host){n=n._$host,c();break}if(n.parentNode===a)break}}else c();o(i)}function St(e,t,n,r,i){let a=_t(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=Tt(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=Tt(e,n,r)}else if(o===`function`)return E(()=>{let i=t();for(;typeof i==`function`;)i=i();n=St(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(Ct(o,t,n,i))return E(()=>n=St(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=Tt(e,n,r),s)return n}else c?n.length===0?wt(e,o,r):rt(e,n,o):(n&&Tt(e),wt(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Tt(e,n,r,t);Tt(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function Ct(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(!(o==null||o===!0||o===!1))if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=Ct(e,o,s)||i;else if(c===`function`)if(r){for(;typeof o==`function`;)o=o();i=Ct(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0;else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}return i}function wt(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Tt(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function Et(){return e.getNextContextId()}var Dt=`http://www.w3.org/2000/svg`;function Ot(e,t=!1,n=void 0){return t?document.createElementNS(Dt,e):document.createElement(e,{is:n})}function kt(t){let{useShadow:n}=t,r=document.createTextNode(``),i=()=>t.mount||document.body,a=ie(),o,s=!!e.context;return D(()=>{s&&(ie().user=s=!1),o||=ae(a,()=>O(()=>t.children));let e=i();if(e instanceof HTMLHeadElement){let[t,n]=w(!1);C(n=>H(e,()=>t()?n():o(),null)),N(()=>n(!0))}else{let i=Ot(t.isSVG?`g`:`div`,t.isSVG),a=n&&i.attachShadow?i.attachShadow({mode:`open`}):i;Object.defineProperty(i,"_$host",{get(){return r.parentNode},configurable:!0}),H(a,o),e.appendChild(i),t.ref&&t.ref(i),N(()=>e.removeChild(i))}},void 0,{render:!s}),r}function At(t,n){let r=O(t);return O(()=>{let t=r();switch(typeof t){case`function`:return j(()=>t(n));case`string`:let r=et.has(t),i=e.context?gt():Ot(t,r,j(()=>n.is));return pt(i,n,r),i}})}function jt(e){let[,t]=Be(e,[`component`]);return At(()=>e.component,t)}var Mt=e=>typeof e==`function`,Nt=(e,t)=>{for(let n of e)Mt(n)&&n(t)};function Pt(...e){let t=null;return D(()=>{Nt(e,t)}),n=>{t=n,Nt(e,n)}}var Ft=(e,t=[])=>({parts:(...n)=>{if(Lt(t))return Ft(e,n);throw Error(`createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?`)},extendWith:(...n)=>Ft(e,[...t,...n]),omit:(...n)=>Ft(e,t.filter(e=>!n.includes(e))),rename:e=>Ft(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${It(e)}"][data-part="${It(n)}"]`,`& [data-scope="${It(e)}"][data-part="${It(n)}"]`].join(`, `),attrs:{"data-scope":It(e),"data-part":It(n)}}}),{})}),It=e=>e.replace(/([A-Z])([A-Z])/g,`$1-$2`).replace(/([a-z])([A-Z])/g,`$1-$2`).replace(/[\s_]+/g,`-`).toLowerCase(),Lt=e=>e.length===0,Rt=Ft(`fieldset`).parts(`root`,`errorText`,`helperText`,`legend`).build(),U=()=>(e,t)=>Be(e,t),zt=e=>typeof e==`function`,Bt=(e,...t)=>zt(e)?e(...t):e;function Vt(e){return e==null?[]:Array.isArray(e)?e:[e]}var Ht=e=>e[0],Ut=e=>e[e.length-1],Wt=(e,t)=>e.indexOf(t)!==-1,Gt=(e,...t)=>e.concat(t),Kt=(e,...t)=>e.filter(e=>!t.includes(e)),qt=(e,t)=>Wt(e,t)?Kt(e,t):Gt(e,t);function Jt(e,t,n={}){let{step:r=1,loop:i=!0}=n,a=t+r,o=e.length,s=o-1;return t===-1?r>0?0:s:a<0?i?s:0:a>=o?i?0:t>o?o:t:a}function Yt(e,t,n={}){return e[Jt(e,t,n)]}function Xt(e,t,n={}){let{step:r=1,loop:i=!0}=n;return Jt(e,t,{step:-r,loop:i})}function Zt(e,t,n={}){return e[Xt(e,t,n)]}function Qt(e){return e.reduce((e,t)=>Array.isArray(t)?e.concat(Qt(t)):e.concat(t),[])}var $t=e=>e?.constructor.name===`Array`,en=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!tn(e[n],t[n]))return!1;return!0},tn=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual==`function`&&typeof t?.isEqual==`function`)return e.isEqual(t);if(typeof e==`function`&&typeof t==`function`)return e.toString()===t.toString();if($t(e)&&$t(t))return en(Array.from(e),Array.from(t));if(typeof e!=`object`||typeof t!=`object`)return!1;let n=Object.keys(t??Object.create(null)),r=n.length;for(let t=0;t<r;t++)if(!Reflect.has(e,n[t]))return!1;for(let i=0;i<r;i++){let r=n[i];if(!tn(e[r],t[r]))return!1}return!0},nn=e=>Array.isArray(e),rn=e=>e===!0||e===!1,an=e=>typeof e==`object`&&!!e,on=e=>an(e)&&!nn(e),sn=e=>typeof e==`number`&&!Number.isNaN(e),cn=e=>typeof e==`string`,ln=e=>typeof e==`function`,un=e=>e==null,dn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),fn=e=>Object.prototype.toString.call(e),pn=Function.prototype.toString,mn=pn.call(Object),hn=e=>{if(!an(e)||fn(e)!=`[object Object]`||vn(e))return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=dn(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&pn.call(n)==mn},gn=e=>typeof e==`object`&&!!e&&`$$typeof`in e&&`props`in e,_n=e=>typeof e==`object`&&!!e&&`__v_isVNode`in e,vn=e=>gn(e)||_n(e),yn=e=>e,bn=()=>{},xn=(...e)=>(...t)=>{e.forEach(function(e){e?.(...t)})};function Sn(e,t,...n){if(e in t){let r=t[e];return ln(r)?r(...n):r}let r=Error(`No matching key: ${JSON.stringify(e)} in ${JSON.stringify(Object.keys(t))}`);throw Error.captureStackTrace?.(r,Sn),r}var Cn=e=>String.fromCharCode(e+(e>25?39:97));function wn(e){let t=``,n;for(n=Math.abs(e);n>52;n=n/52|0)t=Cn(n%52)+t;return Cn(n%52)+t}function Tn(e,t){let n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return e}var En=e=>wn(Tn(5381,e)>>>0);function Dn(e){if(!hn(e)||e===void 0)return e;let t=Reflect.ownKeys(e).filter(e=>typeof e==`string`),n={};for(let r of t){let t=e[r];t!==void 0&&(n[r]=Dn(t))}return n}function On(e,t=Object.is){let n={...e},r=new Set,i=e=>(r.add(e),()=>r.delete(e)),a=()=>{r.forEach(e=>e())};return{subscribe:i,get:e=>n[e],set:(e,r)=>{t(n[e],r)||(n[e]=r,a())},update:e=>{let r=!1;for(let i in e){let a=e[i];a!==void 0&&!t(n[i],a)&&(n[i]=a,r=!0)}r&&a()},snapshot:()=>({...n})}}function kn(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function An(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function jn(e,t){if(e==null)throw Error(t())}function Mn(e,t,n){let r=[];for(let n of t)e[n]??r.push(n);if(r.length>0)throw Error(`[zag-js${n?` > ${n}`:``}] missing required props: ${r.join(`, `)}`)}var Nn=(...e)=>e.map(e=>e?.trim?.()).filter(Boolean).join(` `),Pn=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Fn=e=>{let t={},n;for(;n=Pn.exec(e);)t[n[1]]=n[2];return t},In=(e,t)=>{if(cn(e)){if(cn(t))return`${e};${t}`;e=Fn(e)}else cn(t)&&(t=Fn(t));return Object.assign({},e??{},t??{})};function Ln(...e){let t={};for(let n of e){if(!n)continue;for(let e in t){if(e.startsWith(`on`)&&typeof t[e]==`function`&&typeof n[e]==`function`){t[e]=xn(n[e],t[e]);continue}if(e===`className`||e===`class`){t[e]=Nn(t[e],n[e]);continue}if(e===`style`){t[e]=In(t[e],n[e]);continue}t[e]=n[e]===void 0?t[e]:n[e]}for(let e in n)t[e]===void 0&&(t[e]=n[e]);let e=Object.getOwnPropertySymbols(n);for(let r of e)t[r]=n[r]}return t}var Rn=`.`,zn=`#`,Bn=new WeakMap,Vn=new WeakMap;function Hn(e){return e.join(Rn)}function Un(e){return e.includes(Rn)}function Wn(e){return e.startsWith(zn)}function Gn(e){return e.startsWith(Rn)}function Kn(e){return Wn(e)?e.slice(zn.length):e}function qn(e,t){return e?`${e}${Rn}${t}`:t}function Jn(e){let t=new Map,n=new Map,r=(e,i)=>{t.set(e,i);let a=i.id;a&&(n.has(a)&&An(`[zag-js] Duplicate state id: "${a}"`),n.set(a,e));let o=i.states;if(o){jn(i.initial,()=>`[zag-js] Compound state "${e}" has child states but no "initial" property`),i.initial in o||An(`[zag-js] Compound state "${e}" has initial "${String(i.initial)}" which is not a child state`);for(let[t,n]of Object.entries(o))n&&r(qn(e,t),n)}};for(let[t,n]of Object.entries(e.states))n&&r(t,n);return{index:t,idIndex:n}}function Yn(e){let t=Bn.get(e);if(t)return t;let{index:n,idIndex:r}=Jn(e);return Bn.set(e,n),Vn.set(e,r),n}function Xn(e,t){return Yn(e),Vn.get(e)?.get(t)}function Zn(e){return e?String(e).split(Rn).filter(Boolean):[]}function Qn(e,t){if(!t)return[];let n=Yn(e),r=Zn(t),i=[],a=[];for(let e of r){a.push(e);let t=Hn(a),r=n.get(t);if(!r)break;i.push({path:t,state:r})}return i}function $n(e,t){let n=Yn(e),r=Zn(t);if(!r.length)return t;let i=[];for(let e of r){i.push(e);let r=Hn(i);if(!n.has(r))return t}let a=Hn(i),o=n.get(a);for(;o?.initial;){let e=`${a}${Rn}${o.initial}`,t=n.get(e);if(!t)break;a=e,o=t}return a}function er(e,t){return Yn(e).has(t)}function tr(e,t,n){let r=String(t);if(Wn(r)){let t=Kn(r),n=Xn(e,t);return jn(n,()=>`[zag-js] Unknown state id: "${t}"`),$n(e,n)}if(Gn(r)&&n)return $n(e,qn(n,r.slice(1)));if(!Un(r)&&n){let t=Zn(n);for(let n=t.length-1;n>=1;n--){let i=qn(t.slice(0,n).join(Rn),r);if(er(e,i))return $n(e,i)}if(er(e,r))return $n(e,r)}return $n(e,r)}function nr(e,t,n){let r=Qn(e,t);for(let e=r.length-1;e>=0;e--){let t=r[e]?.state.on?.[n];if(t)return{transitions:t,source:r[e]?.path}}return{transitions:e.on?.[n],source:void 0}}function rr(e,t,n,r){let i=t?Qn(e,t):[],a=Qn(e,n),o=0;for(;o<i.length&&o<a.length&&i[o]?.path===a[o]?.path;)o+=1;let s=i.slice(o).reverse(),c=a.slice(o),l=i.at(-1)?.path===a.at(-1)?.path;return r&&l&&(s=i.slice().reverse(),c=a),{exiting:s,entering:c}}function ir(e,t){return e?e===t||e.startsWith(`${t}${Rn}`):!1}function ar(e,t,n){return Qn(e,t).some(e=>e.state.tags?.includes(n))}function or(){return{and:(...e)=>function(t){return e.every(e=>t.guard(e))},or:(...e)=>function(t){return e.some(e=>t.guard(e))},not:e=>function(t){return!t.guard(e)}}}function sr(e){return Yn(e),e}function cr(){return{guards:or(),createMachine:e=>sr(e),choose:e=>function({choose:t}){return t(e)?.actions}}}var lr=(e=>(e.NotStarted=`Not Started`,e.Started=`Started`,e.Stopped=`Stopped`,e))(lr||{}),ur=`__init__`,dr=Object.defineProperty,fr=(e,t,n)=>t in e?dr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pr=(e,t,n)=>fr(e,typeof t==`symbol`?t:t+``,n);function mr(e){if(e)try{if(e.ownerDocument.activeElement!==e)return;let t=e.value.length;e.setSelectionRange(t,t)}catch{}}var hr=(e,t)=>e.map((n,r)=>e[(Math.max(t,0)+r)%e.length]),gr=()=>void 0,_r=e=>typeof e==`object`&&!!e,W=e=>e?``:void 0,vr=e=>e?`true`:void 0,yr=1,br=9,xr=11,G=e=>_r(e)&&e.nodeType===yr&&typeof e.nodeName==`string`,Sr=e=>_r(e)&&e.nodeType===br,Cr=e=>_r(e)&&e===e.window,wr=e=>G(e)?e.localName||``:`#document`;function Tr(e){return[`html`,`body`,`#document`].includes(wr(e))}var Er=e=>_r(e)&&e.nodeType!==void 0,Dr=e=>Er(e)&&e.nodeType===xr&&`host`in e,Or=e=>G(e)&&e.localName===`input`,kr=e=>!!e?.matches(`a[href]`),Ar=e=>G(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function jr(e){return e?Lr(e.getRootNode())===e:!1}var Mr=/(textarea|select)/;function Nr(e){if(e==null||!G(e))return!1;try{return Or(e)&&e.selectionStart!=null||Mr.test(e.localName)||e.isContentEditable||e.getAttribute(`contenteditable`)===`true`||e.getAttribute(`contenteditable`)===``}catch{return!1}}function Pr(e,t){if(!e||!t||!G(e)||!Er(t))return!1;if(G(t)&&e===t||e.contains(t))return!0;let n=t.getRootNode?.();if(n&&Dr(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Fr(e){return Sr(e)?e:Cr(e)?e.document:e?.ownerDocument??document}function Ir(e){return Fr(e).documentElement}function K(e){return Dr(e)?K(e.host):Sr(e)?e.defaultView??window:G(e)?e.ownerDocument?.defaultView??window:window}function Lr(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(!e||e===t)break;t=e}return t}function Rr(e){if(wr(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Dr(e)&&e.host||Ir(e);return Dr(t)?t.host:t}function zr(e){let t;try{if(t=e.getRootNode({composed:!0}),Sr(t)||Dr(t))return t}catch{}return e.ownerDocument??document}var Br=new WeakMap;function Vr(e){return Br.has(e)||Br.set(e,K(e).getComputedStyle(e)),Br.get(e)}var Hr=new Set([`menu`,`listbox`,`dialog`,`grid`,`tree`,`region`,`application`]),Ur=e=>Hr.has(e),Wr=e=>e.getAttribute(`aria-controls`)?.split(` `)||[];function Gr(e,t){let n=new Set,r=zr(e),i=e=>{let a=e.querySelectorAll(`[aria-controls]`);for(let e of a){if(e.getAttribute(`aria-expanded`)!==`true`)continue;let a=Wr(e);for(let e of a){if(!e||n.has(e))continue;n.add(e);let a=r.getElementById(e);if(a){let e=a.getAttribute(`role`),n=a.getAttribute(`aria-modal`)===`true`;if(e&&Ur(e)&&!n&&(a===t||a.contains(t)||i(a)))return!0}}}return!1};return i(e)}var Kr=()=>typeof document<`u`;function qr(){return navigator.userAgentData?.platform??navigator.platform}function Jr(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}var Yr=e=>Kr()&&e.test(qr()),Xr=e=>Kr()&&e.test(Jr()),Zr=()=>Kr()&&!!navigator.maxTouchPoints,Qr=()=>Yr(/^iPhone/i),$r=()=>Yr(/^iPad/i)||ni()&&navigator.maxTouchPoints>1,ei=()=>Qr()||$r(),ti=()=>ni()||ei(),ni=()=>Yr(/^Mac/i),ri=()=>Xr(/Firefox/i),ii=()=>Xr(/Android/i);function ai(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function q(e){return ai(e)?.[0]??e.target}function oi(e){let t=e.currentTarget;if(!t||!t.matches(`a[href], button[type='submit'], input[type='submit']`))return!1;let n=e.button===1,r=li(e);return n||r}function si(e){let t=e.currentTarget;if(!t)return!1;let n=t.localName;return e.altKey?n===`a`||n===`button`&&t.type===`submit`||n===`input`&&t.type===`submit`:!1}function ci(e){return yi(e).isComposing||e.keyCode===229}function li(e){return ni()?e.metaKey:e.ctrlKey}function ui(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}function di(e){return e.pointerType===``&&e.isTrusted?!0:ii()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}var fi=e=>e.button===0,pi=e=>e.button===2||ni()&&e.ctrlKey&&e.button===0,mi=e=>e.ctrlKey||e.altKey||e.metaKey,hi=e=>`touches`in e&&e.touches.length>0,gi={Up:`ArrowUp`,Down:`ArrowDown`,Esc:`Escape`," ":`Space`,",":`Comma`,Left:`ArrowLeft`,Right:`ArrowRight`},_i={ArrowLeft:`ArrowRight`,ArrowRight:`ArrowLeft`};function vi(e,t={}){let{dir:n=`ltr`,orientation:r=`horizontal`}=t,i=e.key;return i=gi[i]??i,n===`rtl`&&r===`horizontal`&&i in _i&&(i=_i[i]),i}function yi(e){return e.nativeEvent??e}function bi(e,t=`client`){let n=hi(e)?e.touches[0]||e.changedTouches[0]:e;return{x:n[`${t}X`],y:n[`${t}Y`]}}var xi=(e,t,n,r)=>{let i=typeof e==`function`?e():e;return i?.addEventListener(t,n,r),()=>{i?.removeEventListener(t,n,r)}},Si=e=>G(e)&&e.tagName===`IFRAME`;function Ci(e){let t=e.getAttribute(`tabindex`);return t?parseInt(t,10):NaN}var wi=e=>Ci(e)<0;function Ti(e){return Or(e)&&e.type===`radio`}function Ei(e){if(!Ti(e)||!e.name||e.checked)return!0;let t=`input[type="radio"][name="${CSS.escape(e.name)}"]`,n=e.form??e.ownerDocument,r=Array.from(n.querySelectorAll(t)).filter(t=>t.form===e.form&&Ai(t)),i=r.find(e=>e.checked);return i?i===e:r[0]===e}function Di(e,t){if(!t)return null;if(t===!0)return e.shadowRoot||null;let n=t(e);return(n===!0?e.shadowRoot:n)||null}function Oi(e,t,n){let r=[...e],i=[...e],a=new Set,o=new Map;e.forEach((e,t)=>o.set(e,t));let s=0;for(;s<i.length;){let e=i[s++];if(!e||a.has(e))continue;a.add(e);let c=Di(e,t);if(c){let t=Array.from(c.querySelectorAll(ki)).filter(n),a=o.get(e);if(a!==void 0){let e=a+1;r.splice(e,0,...t),t.forEach((t,n)=>{o.set(t,e+n)});for(let n=e+t.length;n<r.length;n++)o.set(r[n],n)}else{let e=r.length;r.push(...t),t.forEach((t,n)=>{o.set(t,e+n)})}i.push(...t)}}return r}var ki=`input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type`;function Ai(e){return!G(e)||e.closest(`[inert]`)?!1:e.matches(ki)&&Ar(e)}function ji(e,t={}){if(!e)return[];let{includeContainer:n,getShadowRoot:r}=t,i=Array.from(e.querySelectorAll(ki));n&&Mi(e)&&i.unshift(e);let a=[];for(let e of i)if(Mi(e)){if(Si(e)&&e.contentDocument){let t=e.contentDocument.body;a.push(...ji(t,{getShadowRoot:r}));continue}a.push(e)}if(r){let e=Oi(a,r,Mi);return!e.length&&n?i:e}return!a.length&&n?i:a}function Mi(e){return G(e)&&e.tabIndex>0?!0:!Ai(e)||wi(e)?!1:Ei(e)}function Ni(e,t={}){let n=ji(e,t);return[n[0]||null,n[n.length-1]||null]}function Pi(e){let{root:t,getInitialEl:n,filter:r,enabled:i=!0}=e;if(!i)return;let a=null;if(a||=typeof n==`function`?n():n,a||=t?.querySelector(`[data-autofocus],[autofocus]`),!a){let e=ji(t);a=r?e.filter(r)[0]:e[0]}return a||t||void 0}function Fi(e){let t=e.currentTarget;if(!t)return!1;let[n,r]=Ni(t);return!(jr(n)&&e.shiftKey||jr(r)&&!e.shiftKey||!n&&!r)}var Ii=class e{constructor(){pr(this,`id`,null),pr(this,`fn_cleanup`),pr(this,`cleanup`,()=>{this.cancel()})}static create(){return new e}request(e){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=e?.()})}cancel(){this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),this.fn_cleanup?.(),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function J(e){let t=Ii.create();return t.request(e),t.cleanup}function Li(e){let t=new Set;function n(e){let n=globalThis.requestAnimationFrame(e);t.add(()=>globalThis.cancelAnimationFrame(n))}return n(()=>n(e)),function(){t.forEach(e=>e())}}function Ri(e,t,n){let r=J(()=>{e.removeEventListener(t,i,!0),n()}),i=()=>{r(),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),r}function zi(e,t){if(!e)return;let{attributes:n,callback:r}=t,i=new(e.ownerDocument.defaultView||window).MutationObserver(e=>{for(let t of e)t.type===`attributes`&&t.attributeName&&n.includes(t.attributeName)&&r(t)});return i.observe(e,{attributes:!0,attributeFilter:n}),()=>i.disconnect()}function Bi(e,t){let{defer:n}=t,r=n?J:e=>e(),i=[];return i.push(r(()=>{let n=typeof e==`function`?e():e;i.push(zi(n,t))})),()=>{i.forEach(e=>e?.())}}function Vi(e){let t=()=>{let t=K(e);e.dispatchEvent(new t.MouseEvent(`click`))};ri()?Ri(e,`keyup`,t):queueMicrotask(t)}function Hi(e){let t=Rr(e);return Tr(t)?Fr(t).body:G(t)&&Ki(t)?t:Hi(t)}function Ui(e,t=[]){let n=Hi(e),r=n===e.ownerDocument.body,i=K(n);return r?t.concat(i,i.visualViewport||[],Ki(n)?n:[]):t.concat(n,Ui(n,[]))}var Wi=/auto|scroll|overlay|hidden|clip/,Gi=new Set([`inline`,`contents`]);function Ki(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=K(e).getComputedStyle(e);return Wi.test(t+r+n)&&!Gi.has(i)}function qi(e,t){return Array.from(e?.querySelectorAll(t)??[])}function Ji(e,t){return e?.querySelector(t)??null}var Yi=e=>e.id;function Xi(e,t,n=Yi){return e.find(e=>n(e)===t)}function Zi(e,t,n=Yi){let r=Xi(e,t,n);return r?e.indexOf(r):-1}function Qi(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function $i(e,t){let{rootEl:n,...r}=t||{};!e||!n||!Ki(n)||!Qi(n)||e.scrollIntoView(r)}var ea=e=>e.split(``).map(e=>{let t=e.charCodeAt(0);return t>0&&t<128?e:t>=128&&t<=255?`/x${t.toString(16)}`.replace(`/`,`\\`):``}).join(``).trim(),ta=e=>ea(e.dataset?.valuetext??e.textContent??``),na=(e,t)=>e.trim().toLowerCase().startsWith(t.toLowerCase());function ra(e,t,n,r=Yi){let i=n?Zi(e,n,r):-1,a=n?hr(e,i):e;return t.length===1&&(a=a.filter(e=>r(e)!==n)),a.find(e=>na(ta(e),t))}function ia(e,t){if(!e)return gr;let n=Object.keys(t).reduce((t,n)=>(t[n]=e.style.getPropertyValue(n),t),{});return aa(n,t)?gr:(Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute(`style`)})}function aa(e,t){return Object.keys(e).every(n=>e[n]===t[n])}function oa(e,t){let{state:n,activeId:r,key:i,timeout:a=350,itemToId:o}=t,s=n.keysSoFar+i,c=s.length>1&&Array.from(s).every(e=>e===s[0])?s[0]:s,l=ra(e.slice(),c,r,o);function u(){clearTimeout(n.timer),n.timer=-1}function d(e){n.keysSoFar=e,u(),e!==``&&(n.timer=+setTimeout(()=>{d(``),u()},a))}return d(s),l}var sa=Object.assign(oa,{defaultOptions:{keysSoFar:``,timer:-1},isValidEvent:ca});function ca(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var la={border:`0`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`};function ua(e,t,n){let{signal:r}=t;return[new Promise((t,i)=>{let a=setTimeout(()=>{i(Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener(`abort`,()=>{clearTimeout(a),i(new DOMException(`Promise aborted`,`AbortError`))}),e.then(e=>{r.aborted||(clearTimeout(a),t(e))}).catch(e=>{r.aborted||(clearTimeout(a),i(e))})}),()=>t.abort()]}function da(e,t){let{timeout:n,rootNode:r}=t,i=K(r),a=Fr(r),o=new i.AbortController;return ua(new Promise(t=>{let n=e();if(n){t(n);return}let r=new i.MutationObserver(()=>{let n=e();n&&n.isConnected&&(r.disconnect(),t(n))});r.observe(a.body,{childList:!0,subtree:!0})}),o,n)}function fa(e){let t=()=>e.getRootNode?.()??document,n=()=>Fr(t()),r=()=>n().defaultView??window,i=()=>Lr(t()),a=e=>t().getElementById(e);return{...e,getRootNode:t,getDoc:n,getWin:r,getActiveElement:i,isActiveElement:jr,getById:a}}function pa(e){let t=e().value??e().defaultValue,n=e().isEqual??Object.is,[r,i]=w(t),a=O(()=>e().value!=null),o={current:r()},s={current:void 0};D(()=>{let t=a()?e().value:r();s.current=t,o.current=t});let c=t=>{let r=s.current,c=ln(t)?t(o.current):t;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:c,prev:r}),a()||i(c),n(c,r)||e().onChange?.(c,r)};function l(){let t=a()?e().value:r;return ln(t)?t():t}return{initial:t,ref:o,get:l,set:c,invoke(t,n){e().onChange?.(t,n)},hash(t){return e().hash?.(t)??String(t)}}}pa.cleanup=e=>{N(()=>e())},pa.ref=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}};function ma(e){let t={current:e};return{get(e){return t.current[e]},set(e,n){t.current[e]=n}}}function ha(e){return ln(e)?e():e}var ga=(e,t)=>{let n=[],r=!0;D(()=>{if(r){n=e.map(e=>ha(e)),r=!1;return}let i=!1;for(let t=0;t<e.length;t++)if(!tn(n[t],ha(e[t]))){i=!0;break}i&&(n=e.map(e=>ha(e)),t())})};function _a(e,t={}){let n=O(()=>{let{id:e,ids:n,getRootNode:r}=ya(t);return fa({id:e,ids:n,getRootNode:r})}),r=(...t)=>{e.debug&&console.log(...t)},i=ba(O(()=>e.props?.({props:Dn(ya(t)),scope:n()})??ya(t))),a=e.context?.({prop:i,bindable:pa,get scope(){return n()},flush:va,getContext(){return o},getComputed(){return y},getRefs(){return p},getEvent(){return d()}}),o={get(e){return a?.[e].get()},set(e,t){a?.[e].set(t)},initial(e){return a?.[e].initial},hash(e){let t=a?.[e].get();return a?.[e].hash(t)}},s={current:new Map},c={current:null},l={current:null},u={current:{type:``}},d=()=>I(u.current,{current(){return u.current},previous(){return l.current}}),f=()=>I(b,{matches(...e){let t=b.get();return e.some(e=>ir(t,e))},hasTag(t){return ar(e,b.get(),t)}}),p=ma(e.refs?.({prop:i,context:o})??{}),m=()=>({state:f(),context:o,event:d(),prop:i,send:S,action:h,guard:g,track:ga,refs:p,computed:y,flush:va,get scope(){return n()},choose:v}),h=t=>{let n=ln(t)?t(m()):t;if(!n)return;let r=n.map(t=>{let n=e.implementations?.actions?.[t];return n||kn(`[zag-js] No implementation found for action "${JSON.stringify(t)}"`),n});for(let e of r)e?.(m())},g=t=>{if(ln(t))return t(m());let n=e.implementations?.guards?.[t];return n||kn(`[zag-js] No implementation found for guard "${JSON.stringify(t)}"`),n?.(m())},_=t=>{let n=ln(t)?t(m()):t;if(!n)return;let r=n.map(t=>{let n=e.implementations?.effects?.[t];return n||kn(`[zag-js] No implementation found for effect "${JSON.stringify(t)}"`),n}),i=[];for(let e of r){let t=e?.(m());t&&i.push(t)}return()=>i.forEach(e=>e?.())},v=e=>Vt(e).find(e=>{let t=!e.guard;return cn(e.guard)?t=!!g(e.guard):ln(e.guard)&&(t=e.guard(m())),t}),y=t=>{jn(e.computed,()=>`[zag-js] No computed object found on machine`);let r=e.computed[t];return r({context:o,event:u.current,prop:i,refs:p,scope:n(),computed:y})},b=pa(()=>({defaultValue:tr(e,e.initialState({prop:i})),onChange(t,n){let{exiting:r,entering:i}=rr(e,n,t,c.current?.reenter);if(r.forEach(e=>{s.current.get(e.path)?.(),s.current.delete(e.path)}),r.forEach(e=>{h(e.state?.exit)}),h(c.current?.actions),i.forEach(e=>{let t=_(e.state?.effects);if(t){let n=s.current.get(e.path);s.current.set(e.path,n?xn(n,t):t)}}),n===`__init__`){h(e.entry);let t=_(e.effects);if(t){let e=s.current.get(ur);s.current.set(ur,e?xn(e,t):t)}}i.forEach(e=>{h(e.state?.entry)})}})),x=lr.NotStarted;te(()=>{let e=x===lr.Started;x=lr.Started,r(e?`rehydrating...`:`initializing...`),b.invoke(b.initial,ur)}),N(()=>{r(`unmounting...`),x=lr.Stopped,s.current.forEach(e=>e?.()),s.current=new Map,c.current=null,h(e.exit)});let S=t=>{queueMicrotask(()=>{if(x!==lr.Started)return;l.current=u.current,u.current=t;let n=j(()=>b.get()),{transitions:i,source:a}=nr(e,n,t.type),o=v(i);if(!o)return;c.current=o;let s=tr(e,o.target??n,a);r(`transition`,t.type,o.target||n,`(${o.actions})`),s===n?o.reenter?b.invoke(n,n):h(o.actions):b.set(s)})};return e.watch?.(m()),{state:f(),send:S,context:o,prop:i,get scope(){return n()},refs:p,computed:y,event:d(),getStatus:()=>x}}function va(e){e()}function ya(e){return ln(e)?e():e}function ba(e){return function(t){return e()[t]}}function Y(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`function`&&(r=r()),r){let n=Object.getOwnPropertyDescriptors(r);for(let r in n)r in t||Object.defineProperty(t,r,{enumerable:!0,get(){let t={};if(r===`style`||r===`class`||r===`className`||r.startsWith(`on`)){for(let n=0;n<e.length;n++){let i=e[n];typeof i==`function`&&(i=i()),t=Ln(t,{[r]:(i||{})[r]})}return t[r]}for(let t=e.length-1;t>=0;t--){let n,i=e[t];if(typeof i==`function`&&(i=i()),n=(i||{})[r],n!==void 0)return n}}})}}return t}function xa(e){return new Proxy({},{get(t,n){return n===`style`?t=>e({style:t}).style:e}})}var Sa={onFocus:`onFocusIn`,onBlur:`onFocusOut`,onDoubleClick:`onDblClick`,onChange:`onInput`,defaultChecked:`checked`,defaultValue:`value`,htmlFor:`for`,className:`class`},Ca=e=>e.startsWith(`--`)?e:ja(e);function wa(e){return e in Sa?Sa[e]:e}var Ta=xa(e=>{let t={};for(let n in e){let r=e[n];if(!(n===`readOnly`&&r===!1)){if(n===`style`&&on(r)){t.style=Ea(r);continue}if(n===`children`){cn(r)&&(t.textContent=r);continue}t[wa(n)]=r}}return t});function Ea(e){let t={};for(let n in e){let r=e[n];!cn(r)&&!sn(r)||(t[Ca(n)]=r)}return t}var Da=/[A-Z]/g,Oa=/^ms-/;function ka(e){return`-`+e.toLowerCase()}var Aa={};function ja(e){if(Aa.hasOwnProperty(e))return Aa[e];let t=e.replace(Da,ka);return Aa[e]=Oa.test(t)?`-`+t:t}var Ma=e=>t=>{let[n,r]=Be(t,[`asChild`]);return n.asChild?n.asChild(e=>{let[,t]=Be(r,[`ref`]);return Y(t,e)}):F(jt,I({component:e},r))};function Na(){let e=new Map;return new Proxy(Ma,{apply(e,t,n){return Ma(n[0])},get(t,n){let r=n;return e.has(r)||e.set(r,Ma(r)),e.get(r)}})}var X=Na();function Pa(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Z(e={}){let{strict:t=!0,hookName:n=`useContext`,providerName:r=`Provider`,errorMessage:i,defaultValue:a}=e,o=le(a);function s(){let e=ue(o);if(!e&&t){let e=Error(i??Pa(n,r));throw e.name=`ContextError`,dn(Error,`captureStackTrace`)&&ln(Error.captureStackTrace)&&Error.captureStackTrace(e,s),e}return e}return[o.Provider,s,o]}var[Fa,Ia]=Z({hookName:`useEnvironmentContext`,providerName:`<EnvironmentProvider />`,strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})}),La=Object.defineProperty,Ra=(e,t)=>{for(var n in t)La(e,n,{get:t[n],enumerable:!0})},[za,Ba]=Z({hookName:`useFieldsetContext`,providerName:`<FieldsetProvider />`,strict:!1}),Va=e=>e.children(Ba()),Ha=e=>{let t=Ba(),n=Y(()=>t().getErrorTextProps(),e);return F(R,{get when(){return t().invalid},get children(){return F(X.span,n)}})},Ua=e=>{let t=Ba(),n=Y(()=>t().getHelperTextProps(),e);return F(X.span,n)},Wa=e=>{let t=Ba(),n=Y(()=>t().getLegendProps(),e);return F(X.legend,n)},Ga=e=>{let t=Ia(),n=I({disabled:!1,invalid:!1},Bt(e)),[r,i]=w(void 0),a=n.id??He(),o=`fieldset::${a}::legend`,s=`fieldset::${a}::error-text`,c=`fieldset::${a}::helper-text`,[l,u]=w(!1),[d,f]=w(!1);te(()=>{let e=r();if(!e)return;let n=()=>{let e=t().getRootNode();u(!!e.getElementById(s)),f(!!e.getElementById(c))};n();let i=new(t().getWindow()).MutationObserver(n);i.observe(e,{childList:!0,subtree:!0}),N(()=>i.disconnect())});let p=O(()=>{let e=[];return l()&&n.invalid&&e.push(s),d()&&e.push(c),e}),m=()=>({...Rt.root.attrs,disabled:n.disabled,"data-disabled":W(n.disabled),"data-invalid":W(n.invalid),"aria-labelledby":o,"aria-describedby":p().join(` `)||void 0}),h=()=>({id:o,...Rt.legend.attrs,"data-disabled":W(n.disabled),"data-invalid":W(n.invalid)}),g=()=>({id:c,...Rt.helperText.attrs}),_=()=>({id:s,...Rt.errorText.attrs,"aria-live":`polite`});return O(()=>({refs:{rootRef:i},ids:{legend:o,errorText:s,helperText:c},disabled:n.disabled,invalid:n.invalid,getRootProps:m,getLegendProps:h,getHelperTextProps:g,getErrorTextProps:_}))},Ka=e=>{let[t,n]=U()(e,[`id`,`disabled`,`invalid`]),r=Ga(t),i=Y(()=>r().getRootProps(),n);return F(za,{value:r,get children(){return F(X.fieldset,I(i,{ref(t){var n=Pt(r().refs.rootRef,e.ref);typeof n==`function`&&n(t)}}))}})};Ka.displayName=`FieldsetRoot`;var qa=e=>{let[{value:t},n]=U()(e,[`value`]),r=Y(()=>t().getRootProps(),n);return F(za,{value:t,get children(){return F(X.fieldset,r)}})};Ra({},{Context:()=>Va,ErrorText:()=>Ha,HelperText:()=>Ua,Legend:()=>Wa,Root:()=>Ka,RootProvider:()=>qa});var Ja=Ft(`field`).parts(`root`,`errorText`,`helperText`,`input`,`label`,`select`,`textarea`,`requiredIndicator`).build(),Ya=e=>{if(!e)return;let t=Vr(e),n=K(e),r=Fr(e),i=()=>{requestAnimationFrame(()=>{e.style.height=`auto`;let n;n=t.boxSizing===`content-box`?e.scrollHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):e.scrollHeight+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),t.maxHeight!==`none`&&n>parseFloat(t.maxHeight)?(t.overflowY===`hidden`&&(e.style.overflowY=`scroll`),n=parseFloat(t.maxHeight)):t.overflowY!==`hidden`&&(e.style.overflowY=`hidden`),e.style.height=`${n}px`})};e.addEventListener(`input`,i),e.form?.addEventListener(`reset`,i);let a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),`value`);a&&Object.defineProperty(e,"value",{...a,set(t){let r=a.get?.call(this);a.set?.call(this,t),i(),r!==t&&queueMicrotask(()=>{e.dispatchEvent(new n.InputEvent(`input`,{bubbles:!0}))})}});let o=new n.ResizeObserver(()=>{requestAnimationFrame(()=>i())});o.observe(e);let s=new n.MutationObserver(()=>i());return s.observe(e,{attributes:!0,attributeFilter:[`rows`,`placeholder`]}),r.fonts?.addEventListener(`loadingdone`,i),()=>{e.removeEventListener(`input`,i),e.form?.removeEventListener(`reset`,i),r.fonts?.removeEventListener(`loadingdone`,i),o.disconnect(),s.disconnect()}},[Xa,Za]=Z({hookName:`useFieldContext`,providerName:`<FieldProvider />`,strict:!1}),Qa=e=>e.children(Za()),$a=e=>{let t=Za(),n=Y(()=>t().getErrorTextProps(),e);return F(R,{get when(){return t?.().invalid},get children(){return F(X.span,n)}})},eo=e=>{let t=Za(),n=Y(()=>t().getHelperTextProps(),e);return F(X.span,n)},to=e=>{let t=Za(),n=Y(()=>t?.().getInputProps(),e);return F(X.input,n)},no=e=>{let t=Za(),n=O(()=>{let n=t?.();if(!n)throw Error(`Field.Item must be used within Field.Root`);let r=`field::${n.ids.control}::item::${e.value}`,i=`${r}::label`,a=()=>({...n.getInputProps(),id:r});return()=>({...n,ids:{...n.ids,control:r,label:i},getLabelProps:()=>({...n.getLabelProps(),id:i,htmlFor:r}),getInputProps:()=>({...a(),...Ja.input.attrs}),getSelectProps:()=>({...a(),...Ja.select.attrs}),getTextareaProps:()=>({...a(),...Ja.textarea.attrs})})});return F(Xa,{get value(){return n()},get children(){return e.children}})},ro=e=>{let t=Za(),n=Y(()=>t?.().getLabelProps(),e);return F(X.label,n)},io=e=>{let t=Za(),n=Y(()=>t().getRequiredIndicatorProps(),e);return F(R,{get when(){return t().required},get fallback(){return e.fallback},get children(){return F(X.span,I(n,{get children(){return e.children??`*`}}))}})},ao=e=>{let t=Ba(),n=Ia(),r=I({disabled:!!t?.().disabled,required:!1,invalid:!1,readOnly:!1},e),[i,a]=w(!1),[o,s]=w(!1),c=r.id??He(),[l,u]=w(void 0),d=r.ids?.control??`field::${c}`,f=r.ids?.errorText??`field::${c}::error-text`,p=r.ids?.helperText??`field::${c}::helper-text`,m=r.ids?.label??`field::${c}::label`;te(()=>{let e=l();if(!e)return;let t=()=>{let e=n().getRootNode();a(!!e.getElementById(f)),s(!!e.getElementById(p))};t();let r=new(n().getWindow()).MutationObserver(t);r.observe(e,{childList:!0,subtree:!0}),N(()=>r.disconnect())});let h=()=>({...Ja.root.attrs,id:d,role:`group`,"data-disabled":W(r.disabled),"data-invalid":W(r.invalid),"data-readonly":W(r.readOnly)}),g=r.target?`field::${c}::item::${r.target}`:void 0,_=()=>({...Ja.label.attrs,id:m,"data-disabled":W(r.disabled),"data-invalid":W(r.invalid),"data-readonly":W(r.readOnly),"data-required":W(r.required),htmlFor:g??c}),v=O(()=>{let e=[];return i()&&r.invalid&&e.push(f),o()&&e.push(p),e}),y=()=>({"aria-describedby":v().join(` `)||void 0,"aria-invalid":vr(r.invalid),"data-invalid":W(r.invalid),"data-required":W(r.required),"data-readonly":W(r.readOnly),id:c,required:r.required,disabled:r.disabled,readOnly:r.readOnly||void 0}),b=()=>({...y(),...Ja.input.attrs}),x=()=>({...y(),...Ja.textarea.attrs}),S=()=>({...y(),...Ja.select.attrs}),C=()=>({id:p,...Ja.helperText.attrs,"data-disabled":W(r.disabled)}),T=()=>({id:f,...Ja.errorText.attrs,"aria-live":`polite`}),E=()=>({"aria-hidden":!0,...Ja.requiredIndicator.attrs});return O(()=>({ariaDescribedby:v().join(` `),ids:{control:c,label:m,errorText:f,helperText:p},refs:{rootRef:u},disabled:r.disabled,invalid:r.invalid,readOnly:r.readOnly,required:r.required,getLabelProps:_,getRootProps:h,getInputProps:b,getTextareaProps:x,getSelectProps:S,getHelperTextProps:C,getErrorTextProps:T,getRequiredIndicatorProps:E}))},oo=e=>{let[t,n]=U()(e,[`id`,`ids`,`disabled`,`invalid`,`readOnly`,`required`,`target`]),r=ao(t),i=Y(()=>r().getRootProps(),n);return F(Xa,{value:r,get children(){return F(X.div,I(i,{ref(t){var n=Pt(r().refs.rootRef,e.ref);typeof n==`function`&&n(t)}}))}})},so=e=>{let[{value:t},n]=U()(e,[`value`]),r=Y(()=>t().getRootProps(),n);return F(Xa,{value:t,get children(){return F(X.div,r)}})},co=e=>{let t=Za(),n=Y(()=>t?.().getSelectProps(),e);return F(X.select,n)},lo=e=>{let t=Za(),n,[r,i]=Be(e,[`autoresize`]),a=Y(()=>t?.().getTextareaProps(),()=>({style:{resize:r.autoresize?`none`:void 0}}),i);return te(()=>{if(!r.autoresize)return;let e=Ya(n);N(()=>e?.())}),F(X.textarea,I(a,{ref(t){var r=Pt(e=>n=e,e.ref);typeof r==`function`&&r(t)}}))},uo={};Ra(uo,{Context:()=>Qa,ErrorText:()=>$a,HelperText:()=>eo,Input:()=>to,Item:()=>no,Label:()=>ro,RequiredIndicator:()=>io,Root:()=>oo,RootProvider:()=>so,Select:()=>co,Textarea:()=>lo});function fo(e){return!(e.metaKey||!ni()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}var po=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function mo(e,t,n){let r=n?q(n):null,i=Fr(r),a=K(r),o=Lr(i);return e=e||o instanceof a.HTMLInputElement&&!po.has(o?.type)||o instanceof a.HTMLTextAreaElement||o instanceof a.HTMLElement&&o.isContentEditable,!(e&&t===`keyboard`&&n instanceof a.KeyboardEvent&&!Reflect.has(bo,n.key))}var ho=null,go=new Set,_o=new Map,vo=!1,yo=!1,bo={Tab:!0,Escape:!0};function xo(e,t){for(let n of go)n(e,t)}function So(e){vo=!0,fo(e)&&(ho=`keyboard`,xo(`keyboard`,e))}function Co(e){ho=`pointer`,(e.type===`mousedown`||e.type===`pointerdown`)&&(vo=!0,xo(`pointer`,e))}function wo(e){di(e)&&(vo=!0,ho=`virtual`)}function To(e){let t=q(e);t===K(t)||t===Fr(t)||!e.isTrusted||(!vo&&!yo&&(ho=`virtual`,xo(`virtual`,e)),vo=!1,yo=!1)}function Eo(){vo=!1,yo=!0}function Do(e){if(typeof window>`u`||_o.get(K(e)))return;let t=K(e),n=Fr(e),r=t.HTMLElement.prototype.focus;function i(){vo=!0,r.apply(this,arguments)}try{Object.defineProperty(t.HTMLElement.prototype,"focus",{configurable:!0,value:i})}catch{}n.addEventListener(`keydown`,So,!0),n.addEventListener(`keyup`,So,!0),n.addEventListener(`click`,wo,!0),t.addEventListener(`focus`,To,!0),t.addEventListener(`blur`,Eo,!1),t.PointerEvent===void 0?(n.addEventListener(`mousedown`,Co,!0),n.addEventListener(`mousemove`,Co,!0),n.addEventListener(`mouseup`,Co,!0)):(n.addEventListener(`pointerdown`,Co,!0),n.addEventListener(`pointermove`,Co,!0),n.addEventListener(`pointerup`,Co,!0)),t.addEventListener(`beforeunload`,()=>{Oo(e)},{once:!0}),_o.set(t,{focus:r})}var Oo=(e,t)=>{let n=K(e),r=Fr(e);t&&r.removeEventListener(`DOMContentLoaded`,t);let i=_o.get(n);if(i){try{Object.defineProperty(n.HTMLElement.prototype,"focus",{configurable:!0,value:i.focus})}catch{}r.removeEventListener(`keydown`,So,!0),r.removeEventListener(`keyup`,So,!0),r.removeEventListener(`click`,wo,!0),n.removeEventListener(`focus`,To,!0),n.removeEventListener(`blur`,Eo,!1),n.PointerEvent===void 0?(r.removeEventListener(`mousedown`,Co,!0),r.removeEventListener(`mousemove`,Co,!0),r.removeEventListener(`mouseup`,Co,!0)):(r.removeEventListener(`pointerdown`,Co,!0),r.removeEventListener(`pointermove`,Co,!0),r.removeEventListener(`pointerup`,Co,!0)),_o.delete(n)}};function ko(){return ho}function Ao(e){ho=e,xo(e,null)}function jo(){return ho===`keyboard`||ho===`virtual`}function Mo(e={}){let{isTextInput:t,autoFocus:n,onChange:r,root:i}=e;Do(i),r?.({isFocusVisible:n||jo(),modality:ho});let a=(e,n)=>{mo(!!t,e,n)&&r?.({isFocusVisible:jo(),modality:e})};return go.add(a),()=>{go.delete(a)}}function No(e){let t=new Map;return function(n,r){let i=n+(r?Object.entries(r).sort((e,t)=>e[0]<t[0]?-1:1).join():``);if(t.has(i))return t.get(i);let a=new e(n,r);return t.set(i,a),a}}var Po=No(Intl.NumberFormat);function Fo(e,t,n={}){return Po(t,n).format(e)}var Io=[``,`kilo`,`mega`,`giga`,`tera`],Lo=[``,`kilo`,`mega`,`giga`,`tera`,`peta`],Ro=(e,t=`en-US`,n={})=>{if(Number.isNaN(e))return``;if(e===0)return`0 B`;let{unitSystem:r=`decimal`,precision:i=3,unit:a=`byte`,unitDisplay:o=`short`}=n,s=r===`binary`?1024:1e3,c=a===`bit`?Io:Lo,l=e<0,u=Math.abs(e),d=0;for(;u>=s&&d<c.length-1;)u/=s,d++;let f=parseFloat(u.toPrecision(i));return Fo(l?-f:f,t,{style:`unit`,unit:c[d]+a,unitDisplay:o})},[zo,Bo]=Z({hookName:`useEnvironmentContext`,providerName:`<EnvironmentProvider />`,strict:!1,defaultValue:()=>({dir:`ltr`,locale:`en-US`})}),Vo=Ft(`file-upload`).parts(`root`,`dropzone`,`item`,`itemDeleteTrigger`,`itemGroup`,`itemName`,`itemPreview`,`itemPreviewImage`,`itemSizeText`,`label`,`trigger`,`clearTrigger`).build(),Ho=e=>typeof e.getAsEntry==`function`?e.getAsEntry():typeof e.webkitGetAsEntry==`function`?e.webkitGetAsEntry():null,Uo=e=>e.isDirectory,Wo=e=>e.isFile,Go=(e,t)=>(Object.defineProperty(e,"relativePath",{value:t?`${t}/${e.name}`:e.name}),e),Ko=(e,t)=>Promise.all(Array.from(e).filter(e=>e.kind===`file`).map(e=>{let n=Ho(e);if(!n)return null;if(Uo(n)&&t)return qo(n.createReader(),`${n.name}`);if(Wo(n)&&typeof e.getAsFile==`function`){let t=e.getAsFile();return Promise.resolve(t?Go(t,``):null)}if(Wo(n))return new Promise(e=>{n.file(t=>{e(Go(t,``))})})}).filter(e=>e)),qo=(e,t=``)=>new Promise(n=>{let r=[],i=()=>{e.readEntries(e=>{if(e.length===0){n(Promise.all(r).then(e=>e.flat()));return}let a=e.map(e=>{if(!e)return null;if(Uo(e))return qo(e.createReader(),`${t}${e.name}`);if(Wo(e))return new Promise(n=>{e.file(e=>{n(Go(e,t))})})}).filter(e=>e);r.push(Promise.all(a)),i()})};i()});function Jo(e){return e===`audio/*`||e===`video/*`||e===`image/*`||e===`text/*`||/\w+\/[-+.\w]+/g.test(e)}function Yo(e){return/^.*\.[\w]+$/.test(e)}var Xo=e=>Jo(e)||Yo(e);function Zo(e){if(e!=null)return typeof e==`string`?e:Array.isArray(e)?e.filter(Xo).join(`,`):Object.entries(e).reduce((e,[t,n])=>[...e,t,...n],[]).filter(Xo).join(`,`)}var Qo=(e,t)=>e.name===t.name&&e.size===t.size&&e.type===t.type,$o=e=>e!=null;function es(e,t,n){if($o(e.size)){if($o(t)&&$o(n)){if(e.size>n)return[!1,`FILE_TOO_LARGE`];if(e.size<t)return[!1,`FILE_TOO_SMALL`]}else if($o(t)&&e.size<t)return[!1,`FILE_TOO_SMALL`];else if($o(n)&&e.size>n)return[!1,`FILE_TOO_LARGE`]}return[!0,null]}var ts=new Map(`3g2_video/3gpp2[3gp,3gpp_video/3gpp[3mf_model/3mf[7z_application/x-7z-compressed[aac_audio/aac[ac_application/pkix-attr-cert[adp_audio/adpcm[adts_audio/aac[ai_application/postscript[aml_application/automationml-aml+xml[amlx_application/automationml-amlx+zip[amr_audio/amr[apk_application/vnd.android.package-archive[apng_image/apng[appcache,manifest_text/cache-manifest[appinstaller_application/appinstaller[appx_application/appx[appxbundle_application/appxbundle[asc_application/pgp-keys[atom_application/atom+xml[atomcat_application/atomcat+xml[atomdeleted_application/atomdeleted+xml[atomsvc_application/atomsvc+xml[au,snd_audio/basic[avi_video/x-msvideo[avci_image/avci[avcs_image/avcs[avif_image/avif[aw_application/applixware[bdoc_application/bdoc[bin,bpk,buffer,deb,deploy,dist,distz,dll,dmg,dms,dump,elc,exe,img,iso,lrf,mar,msi,msm,msp,pkg,so_application/octet-stream[bmp,dib_image/bmp[btf,btif_image/prs.btif[bz2_application/x-bzip2[c_text/x-c[ccxml_application/ccxml+xml[cdfx_application/cdfx+xml[cdmia_application/cdmi-capability[cdmic_application/cdmi-container[cdmid_application/cdmi-domain[cdmio_application/cdmi-object[cdmiq_application/cdmi-queue[cer_application/pkix-cert[cgm_image/cgm[cjs_application/node[class_application/java-vm[coffee,litcoffee_text/coffeescript[conf,def,in,ini,list,log,text,txt_text/plain[cpp,cxx,cc_text/x-c++src[cpl_application/cpl+xml[cpt_application/mac-compactpro[crl_application/pkix-crl[css_text/css[csv_text/csv[cu_application/cu-seeme[cwl_application/cwl[cww_application/prs.cww[davmount_application/davmount+xml[dbk_application/docbook+xml[doc_application/msword[docx_application/vnd.openxmlformats-officedocument.wordprocessingml.document[dsc_text/prs.lines.tag[dssc_application/dssc+der[dtd_application/xml-dtd[dwd_application/atsc-dwd+xml[ear,jar,war_application/java-archive[ecma_application/ecmascript[emf_image/emf[eml,mime_message/rfc822[emma_application/emma+xml[emotionml_application/emotionml+xml[eot_application/vnd.ms-fontobject[eps,ps_application/postscript[epub_application/epub+zip[exi_application/exi[exp_application/express[exr_image/aces[ez_application/andrew-inset[fdf_application/fdf[fdt_application/fdt+xml[fits_image/fits[flac_audio/flac[flv_video/x-flv[g3_image/g3fax[geojson_application/geo+json[gif_image/gif[glb_model/gltf-binary[gltf_model/gltf+json[gml_application/gml+xml[go_text/x-go[gpx_application/gpx+xml[gz_application/gzip[h_text/x-h[h261_video/h261[h263_video/h263[h264_video/h264[heic_image/heic[heics_image/heic-sequence[heif_image/heif[heifs_image/heif-sequence[htm,html,shtml_text/html[ico_image/x-icon[icns_image/x-icns[ics,ifb_text/calendar[iges,igs_model/iges[ink,inkml_application/inkml+xml[ipa_application/octet-stream[java_text/x-java-source[jp2,jpg2_image/jp2[jpeg,jpe,jpg_image/jpeg[jpf,jpx_image/jpx[jpm,jpgm_image/jpm[jpgv_video/jpeg[jph_image/jph[js,mjs_text/javascript[json_application/json[json5_application/json5[jsonld_application/ld+json[jsx_text/jsx[jxl_image/jxl[jxr_image/jxr[ktx_image/ktx[ktx2_image/ktx2[less_text/less[m1v,m2v,mpe,mpeg,mpg_video/mpeg[m4a_audio/mp4[m4v_video/x-m4v[md,markdown_text/markdown[mid,midi,kar,rmi_audio/midi[mkv_video/x-matroska[mp2,mp2a,mp3,mpga,m3a,m2a_audio/mpeg[mp4,mp4v,mpg4_video/mp4[mp4a_audio/mp4[mp4s,m4p_application/mp4[odp_application/vnd.oasis.opendocument.presentation[oda_application/oda[ods_application/vnd.oasis.opendocument.spreadsheet[odt_application/vnd.oasis.opendocument.text[oga,ogg,opus,spx_audio/ogg[ogv_video/ogg[ogx_application/ogg[otf_font/otf[p12,pfx_application/x-pkcs12[pdf_application/pdf[pem_application/x-pem-file[php_text/x-php[png_image/png[ppt_application/vnd.ms-powerpoint[pptx_application/vnd.openxmlformats-officedocument.presentationml.presentation[pskcxml_application/pskc+xml[psd_image/vnd.adobe.photoshop[py_text/x-python[qt,mov_video/quicktime[rar_application/vnd.rar[rdf_application/rdf+xml[rtf_text/rtf[sass_text/x-sass[scss_text/x-scss[sgm,sgml_text/sgml[sh_application/x-sh[svg,svgz_image/svg+xml[swf_application/x-shockwave-flash[tar_application/x-tar[tif,tiff_image/tiff[toml_application/toml[ts_video/mp2t[tsx_text/tsx[tsv_text/tab-separated-values[ttc_font/collection[ttf_font/ttf[vtt_text/vtt[wasm_application/wasm[wav_audio/wav[weba_audio/webm[webm_video/webm[webmanifest_application/manifest+json[webp_image/webp[wma_audio/x-ms-wma[wmv_video/x-ms-wmv[woff_font/woff[woff2_font/woff2[xls_application/vnd.ms-excel[xlsx_application/vnd.openxmlformats-officedocument.spreadsheetml.sheet[xml_application/xml[xz_application/x-xz[yaml,yml_text/yaml[zip_application/zip`.split(`[`).flatMap(e=>{let[t,n]=e.split(`_`);return t.split(`,`).map(e=>[e,n])}));function ns(e){let t=e.split(`.`).pop();return t&&ts.get(t)||null}function rs(e,t){if(e&&t){let n=Array.isArray(t)?t:typeof t==`string`?t.split(`,`):[];if(n.length===0)return!0;let r=e.name||``,i=(e.type||ns(r)||``).toLowerCase(),a=i.replace(/\/.*$/,``);return n.some(e=>{let t=e.trim().toLowerCase();return t.charAt(0)===`.`?r.toLowerCase().endsWith(t):t.endsWith(`/*`)?a===t.replace(/\/.*$/,``):i===t})}return!0}function is(e,t){let n=e.type===`application/x-moz-file`||rs(e,t);return[n,n?null:`FILE_INVALID_TYPE`]}var as=e=>e.ids?.root??`file:${e.id}`,os=e=>e.ids?.dropzone??`file:${e.id}:dropzone`,ss=e=>e.ids?.hiddenInput??`file:${e.id}:input`,cs=e=>e.ids?.trigger??`file:${e.id}:trigger`,ls=e=>e.ids?.label??`file:${e.id}:label`,us=(e,t)=>e.ids?.item?.(t)??`file:${e.id}:item:${t}`,ds=(e,t)=>e.ids?.itemName?.(t)??`file:${e.id}:item-name:${t}`,fs=(e,t)=>e.ids?.itemSizeText?.(t)??`file:${e.id}:item-size:${t}`,ps=(e,t)=>e.ids?.itemPreview?.(t)??`file:${e.id}:item-preview:${t}`,ms=(e,t)=>e.ids?.itemDeleteTrigger?.(t)??`file:${e.id}:item-delete:${t}`,hs=e=>En(`${e.name}-${e.size}`),gs=e=>e.getById(as(e)),_s=e=>e.getById(ss(e)),vs=e=>e.getById(os(e));function ys(e){let t=q(e);return e.dataTransfer?e.dataTransfer.types.some(e=>e===`Files`||e===`application/x-moz-file`):!!t&&`files`in t}function bs(e,t,n){let{prop:r,computed:i}=e;return!i(`multiple`)&&t>1?!1:!i(`multiple`)&&t+n.length===2?!0:!(t+n.length>r(`maxFiles`))}function xs(e,t,n=[],r=[]){let{prop:i,computed:a}=e,o=[],s=[],c={acceptedFiles:n,rejectedFiles:r};return t.forEach(e=>{let[t,r]=is(e,a(`acceptAttr`)),[l,u]=es(e,i(`minFileSize`),i(`maxFileSize`)),d=n.some(t=>Qo(t,e))||o.some(t=>Qo(t,e)),f=i(`validate`)?.(e,c),p=f?f.length===0:!0;if(t&&l&&p&&!d)o.push(e);else{let t=[r,u];d&&t.push(`FILE_EXISTS`),p||t.push(...f??[]),s.push({file:e,errors:t.filter(Boolean)})}}),bs(e,o.length,n)||(o.forEach(e=>{s.push({file:e,errors:[`TOO_MANY_FILES`]})}),o.splice(0)),{acceptedFiles:o,rejectedFiles:s}}function Ss(e,t){let n=K(e);try{if(`DataTransfer`in n){let r=new n.DataTransfer;t.forEach(e=>{r.items.add(e)}),e.files=r.files}}catch{}}var Cs=`accepted`,ws=`button, a[href], input:not([type='file']), select, textarea, [tabindex], [contenteditable]`;function Ts(e,t){if(!e||e.getAttribute(`type`)===`file`)return!1;let n=e.closest(ws);return n!=t&&Pr(t,n)}function Es(e,t){let{state:n,send:r,prop:i,computed:a,scope:o,context:s}=e,c=!!i(`disabled`),l=!!i(`readOnly`),u=!!i(`required`),d=i(`allowDrop`),f=i(`translations`),p=n.matches(`dragging`),m=n.matches(`focused`)&&!c,h=s.get(`acceptedFiles`),g=i(`maxFiles`);return{dragging:p,focused:m,disabled:c,readOnly:l,transforming:s.get(`transforming`),maxFilesReached:h.length>=g,remainingFiles:Math.max(0,g-h.length),openFilePicker(){c||l||r({type:`OPEN`})},deleteFile(e,t=Cs){c||l||r({type:`FILE.DELETE`,file:e,itemType:t})},acceptedFiles:h,rejectedFiles:s.get(`rejectedFiles`),setFiles(e){c||l||r({type:`FILES.SET`,files:e,count:e.length})},clearRejectedFiles(){c||l||r({type:`REJECTED_FILES.CLEAR`})},clearFiles(){c||l||r({type:`FILES.CLEAR`})},getFileSize(e){return Ro(e.size,i(`locale`))},createFileUrl(e,t){let n=o.getWin(),r=n.URL.createObjectURL(e);return t(r),()=>n.URL.revokeObjectURL(r)},setClipboardFiles(e){if(c||l)return!1;let t=Array.from(e?.items??[]).reduce((e,t)=>{if(t.kind!==`file`)return e;let n=t.getAsFile();return n?[...e,n]:e},[]);return t.length?(r({type:`FILE.SELECT`,files:t}),!0):!1},getRootProps(){return t.element({...Vo.root.attrs,dir:i(`dir`),id:as(o),"data-disabled":W(c),"data-readonly":W(l),"data-dragging":W(p)})},getDropzoneProps(e={}){return t.element({...Vo.dropzone.attrs,dir:i(`dir`),id:os(o),tabIndex:c||l||e.disableClick?void 0:0,role:e.disableClick?`application`:`button`,"aria-label":f.dropzone,"aria-disabled":c||l||void 0,"data-invalid":W(i(`invalid`)),"data-disabled":W(c),"data-readonly":W(l),"data-dragging":W(p),onKeyDown(t){if(c||l||t.defaultPrevented)return;let n=q(t);Pr(t.currentTarget,n)&&(Ts(n,t.currentTarget)||e.disableClick||t.key!==`Enter`&&t.key!==` `||r({type:`DROPZONE.CLICK`,src:`keydown`}))},onClick(t){if(c||l||t.defaultPrevented||e.disableClick)return;let n=q(t);Pr(t.currentTarget,n)&&(Ts(n,t.currentTarget)||(t.currentTarget.localName===`label`&&t.preventDefault(),r({type:`DROPZONE.CLICK`})))},onDragOver(e){if(c||l||!d)return;e.preventDefault(),e.stopPropagation();try{e.dataTransfer.dropEffect=`copy`}catch{}if(!ys(e))return;let t=e.dataTransfer.items.length;r({type:`DROPZONE.DRAG_OVER`,count:t})},onDragLeave(e){c||l||d&&(Pr(e.currentTarget,e.relatedTarget)||r({type:`DROPZONE.DRAG_LEAVE`}))},onDrop(e){c||l||(d&&(e.preventDefault(),e.stopPropagation()),ys(e)&&Ko(e.dataTransfer.items,i(`directory`)).then(e=>{r({type:`DROPZONE.DROP`,files:Qt(e)})}))},onFocus(){c||l||r({type:`DROPZONE.FOCUS`})},onBlur(){c||l||r({type:`DROPZONE.BLUR`})}})},getTriggerProps(){return t.button({...Vo.trigger.attrs,dir:i(`dir`),id:cs(o),disabled:c||l,"data-disabled":W(c),"data-readonly":W(l),"data-invalid":W(i(`invalid`)),type:`button`,onClick(e){c||l||(Pr(vs(o),e.currentTarget)&&e.stopPropagation(),r({type:`OPEN`}))}})},getHiddenInputProps(){return t.input({id:ss(o),tabIndex:-1,disabled:c||l,type:`file`,required:i(`required`),capture:i(`capture`),name:i(`name`),accept:a(`acceptAttr`),webkitdirectory:i(`directory`)?``:void 0,multiple:a(`multiple`)||i(`maxFiles`)>1,"aria-hidden":!0,onClick(e){e.stopPropagation(),e.currentTarget.value=``},onInput(e){if(c||l)return;let{files:t}=e.currentTarget;r({type:`FILE.SELECT`,files:t?Array.from(t):[]})},style:la})},getItemGroupProps(e={}){let{type:n=Cs}=e;return t.element({...Vo.itemGroup.attrs,dir:i(`dir`),"data-disabled":W(c),"data-type":n})},getItemProps(e){let{file:n,type:r=Cs}=e;return t.element({...Vo.item.attrs,dir:i(`dir`),id:us(o,hs(n)),"data-disabled":W(c),"data-type":r})},getItemNameProps(e){let{file:n,type:r=Cs}=e;return t.element({...Vo.itemName.attrs,dir:i(`dir`),id:ds(o,hs(n)),"data-disabled":W(c),"data-type":r})},getItemSizeTextProps(e){let{file:n,type:r=Cs}=e;return t.element({...Vo.itemSizeText.attrs,dir:i(`dir`),id:fs(o,hs(n)),"data-disabled":W(c),"data-type":r})},getItemPreviewProps(e){let{file:n,type:r=Cs}=e;return t.element({...Vo.itemPreview.attrs,dir:i(`dir`),id:ps(o,hs(n)),"data-disabled":W(c),"data-type":r})},getItemPreviewImageProps(e){let{file:n,url:r,type:i=Cs}=e;if(!n.type.startsWith(`image/`))throw Error(`Preview Image is only supported for image files`);return t.img({...Vo.itemPreviewImage.attrs,alt:f.itemPreview?.(n),src:r,"data-disabled":W(c),"data-type":i})},getItemDeleteTriggerProps(e){let{file:n,type:a=Cs}=e;return t.button({...Vo.itemDeleteTrigger.attrs,dir:i(`dir`),id:ms(o,hs(n)),type:`button`,disabled:c||l,"data-disabled":W(c),"data-readonly":W(l),"data-type":a,"aria-label":f.deleteFile?.(n),onClick(){c||l||r({type:`FILE.DELETE`,file:n,itemType:a})}})},getLabelProps(){return t.label({...Vo.label.attrs,dir:i(`dir`),id:ls(o),htmlFor:ss(o),"data-disabled":W(c),"data-required":W(u)})},getClearTriggerProps(){return t.button({...Vo.clearTrigger.attrs,dir:i(`dir`),type:`button`,disabled:c||l,hidden:h.length===0,"data-disabled":W(c),"data-readonly":W(l),onClick(e){e.defaultPrevented||c||l||r({type:`FILES.CLEAR`})}})}}}var Ds=sr({props({props:e}){return{minFileSize:0,maxFileSize:1/0,maxFiles:1,allowDrop:!0,preventDocumentDrop:!0,defaultAcceptedFiles:[],...e,translations:{dropzone:`dropzone`,itemPreview:e=>`preview of ${e.name}`,deleteFile:e=>`delete file ${e.name}`,...e.translations}}},initialState(){return`idle`},context({prop:e,bindable:t,getContext:n}){return{acceptedFiles:t(()=>({defaultValue:e(`defaultAcceptedFiles`),value:e(`acceptedFiles`),isEqual:(e,t)=>e.length===t?.length&&e.every((e,n)=>Qo(e,t[n])),hash(e){return e.map(e=>`${e.name}-${e.size}`).join(`,`)},onChange(t){let r=n();e(`onFileAccept`)?.({files:t}),e(`onFileChange`)?.({acceptedFiles:t,rejectedFiles:r.get(`rejectedFiles`)})}})),rejectedFiles:t(()=>({defaultValue:[],isEqual:(e,t)=>e.length===t?.length&&e.every((e,n)=>Qo(e.file,t[n].file)),onChange(t){let r=n();e(`onFileReject`)?.({files:t}),e(`onFileChange`)?.({acceptedFiles:r.get(`acceptedFiles`),rejectedFiles:t})}})),transforming:t(()=>({defaultValue:!1}))}},computed:{acceptAttr:({prop:e})=>Zo(e(`accept`)),multiple:({prop:e})=>e(`maxFiles`)>1},watch({track:e,context:t,action:n}){e([()=>t.hash(`acceptedFiles`)],()=>{n([`syncInputElement`])})},on:{"FILES.SET":{actions:[`setFiles`]},"FILE.SELECT":{actions:[`setEventFiles`]},"FILE.DELETE":{actions:[`removeFile`]},"FILES.CLEAR":{actions:[`clearFiles`]},"REJECTED_FILES.CLEAR":{actions:[`clearRejectedFiles`]}},effects:[`preventDocumentDrop`],states:{idle:{on:{OPEN:{actions:[`openFilePicker`]},"DROPZONE.CLICK":{actions:[`openFilePicker`]},"DROPZONE.FOCUS":{target:`focused`},"DROPZONE.DRAG_OVER":{target:`dragging`}}},focused:{on:{"DROPZONE.BLUR":{target:`idle`},OPEN:{actions:[`openFilePicker`]},"DROPZONE.CLICK":{actions:[`openFilePicker`]},"DROPZONE.DRAG_OVER":{target:`dragging`}}},dragging:{on:{"DROPZONE.DROP":{target:`idle`,actions:[`setEventFiles`]},"DROPZONE.DRAG_LEAVE":{target:`idle`}}}},implementations:{effects:{preventDocumentDrop({prop:e,scope:t}){if(!e(`preventDocumentDrop`)||!e(`allowDrop`)||e(`disabled`))return;let n=t.getDoc();return xn(xi(n,`dragover`,e=>{e?.preventDefault()},!1),xi(n,`drop`,e=>{Pr(gs(t),q(e))||e.preventDefault()},!1))}},actions:{syncInputElement({scope:e,context:t}){queueMicrotask(()=>{let n=_s(e);if(!n)return;Ss(n,t.get(`acceptedFiles`));let r=e.getWin();n.dispatchEvent(new r.Event(`change`,{bubbles:!0}))})},openFilePicker({scope:e}){J(()=>{_s(e)?.click()})},setFiles(e){let{computed:t,context:n,event:r}=e,{acceptedFiles:i,rejectedFiles:a}=xs(e,r.files);n.set(`acceptedFiles`,t(`multiple`)?i:i.length>0?[i[0]]:[]),n.set(`rejectedFiles`,a)},setEventFiles(e){let{computed:t,context:n,event:r,prop:i}=e,a=n.get(`acceptedFiles`),o=n.get(`rejectedFiles`),{acceptedFiles:s,rejectedFiles:c}=xs(e,r.files,a,o),l=e=>{if(t(`multiple`)){n.set(`acceptedFiles`,t=>[...t,...e]),n.set(`rejectedFiles`,c);return}if(e.length){n.set(`acceptedFiles`,[e[0]]),n.set(`rejectedFiles`,c);return}c.length&&(n.set(`acceptedFiles`,n.get(`acceptedFiles`)),n.set(`rejectedFiles`,c))},u=i(`transformFiles`);u?(n.set(`transforming`,!0),u(s).then(l).catch(e=>{kn(`[zag-js/file-upload] error transforming files
|
|
2
|
-
${e}`)}).finally(()=>{n.set(`transforming`,!1)})):l(s)},removeFile({context:e,event:t}){if(t.itemType===`rejected`){let n=e.get(`rejectedFiles`).filter(e=>!Qo(e.file,t.file));e.set(`rejectedFiles`,n)}else{let n=e.get(`acceptedFiles`).filter(e=>!Qo(e,t.file));e.set(`acceptedFiles`,n)}},clearRejectedFiles({context:e}){e.set(`rejectedFiles`,[])},clearFiles({context:e}){e.set(`acceptedFiles`,[]),e.set(`rejectedFiles`,[])}}}}),[Os,ks]=Z({hookName:`useFileUploadContext`,providerName:`<FileUploadProvider />`}),As=e=>{let t=ks(),n=Y(()=>t().getClearTriggerProps(),e);return F(X.button,n)},js=e=>e.children(ks()),Ms=e=>{let[t,n]=U()(e,[`disableClick`]),r=ks(),i=Y(()=>r().getDropzoneProps(t),n);return F(X.div,i)},Ns=e=>{let t=ks(),n=Y(()=>t().getHiddenInputProps(),e),r=Za();return F(X.input,I({get"aria-describedby"(){return r?.().ariaDescribedby}},n))},[Ps,Fs]=Z({hookName:`useFileUploadItemGroupPropsContext`,providerName:`<FileUploadItemGroupPropsProvider />`}),[Is,Ls]=Z({hookName:`useFileUploadItemPropsContext`,providerName:`<FileUploadItemPropsProvider />`}),Rs=e=>{let[t,n]=U()(e,[`file`]),r=ks(),i=Fs(),a=O(()=>({...t,type:i.type})),o=Y(()=>r().getItemProps(a()),n);return F(Is,{value:a,get children(){return F(X.li,o)}})},zs=e=>{let t=ks(),n=Ls(),r=Y(()=>t().getItemDeleteTriggerProps(n()),e);return F(X.button,r)},Bs=e=>{let[t,n]=U()(e,[`type`]),r=ks(),i=Y(()=>r().getItemGroupProps(t),n);return F(Ps,{value:t,get children(){return F(X.ul,i)}})},Vs=e=>{let t=ks(),n=Ls(),r=Y(()=>t().getItemNameProps(n()),e);return F(X.div,I(r,{get children(){return e.children||n().file.name}}))},Hs=e=>{let t=ks(),n=Ls(),r=Y(()=>t().getItemPreviewProps(n()),e);return n().file.type.match(e.type??`.*`)?F(X.div,r):null},Us=e=>{let t=ks(),n=Ls(),[r,i]=w(``);D(()=>{N(t().createFileUrl(n().file,e=>i(e)))});let a=Y(()=>t().getItemPreviewImageProps({...n(),url:r()}),e);return F(R,{get when(){return r()},get children(){return F(X.img,a)}})},Ws=e=>{let t=ks(),n=Ls(),r=Y(()=>t().getItemSizeTextProps(n()),e);return F(X.div,I(r,{get children(){return e.children||t().getFileSize(n().file)}}))},Gs=e=>{let t=ks(),n=Y(()=>t().getLabelProps(),e);return F(X.label,n)},Ks=e=>{let t=He(),n=Bo(),r=Ia(),i=Za(),a=_a(Ds,O(()=>({id:t,ids:{label:i?.().ids.label,hiddenInput:i?.().ids.control},dir:n().dir,disabled:i?.().disabled,locale:n().locale,required:i?.().required,invalid:i?.().invalid,getRootNode:r().getRootNode,...Bt(e)})));return O(()=>Es(a,Ta))},qs=e=>{let[t,n]=U()(e,[`accept`,`acceptedFiles`,`allowDrop`,`capture`,`defaultAcceptedFiles`,`directory`,`disabled`,`id`,`ids`,`invalid`,`locale`,`maxFiles`,`maxFileSize`,`minFileSize`,`name`,`onFileAccept`,`onFileChange`,`onFileReject`,`preventDocumentDrop`,`readOnly`,`required`,`translations`,`transformFiles`,`validate`]),r=Ks(t),i=Y(()=>r().getRootProps(),n);return F(Os,{value:r,get children(){return F(X.div,i)}})},Js=e=>{let[{value:t},n]=U()(e,[`value`]),r=Y(()=>t().getRootProps(),n);return F(Os,{value:t,get children(){return F(X.div,r)}})},Ys=e=>{let t=ks(),n=Y(()=>t().getTriggerProps(),e);return F(X.button,n)},Xs={};Ra(Xs,{ClearTrigger:()=>As,Context:()=>js,Dropzone:()=>Ms,HiddenInput:()=>Ns,Item:()=>Rs,ItemDeleteTrigger:()=>zs,ItemGroup:()=>Bs,ItemName:()=>Vs,ItemPreview:()=>Hs,ItemPreviewImage:()=>Us,ItemSizeText:()=>Ws,Label:()=>Gs,Root:()=>qs,RootProvider:()=>Js,Trigger:()=>Ys});var Zs=`traceSource`,Qs=`traceToken`,$s=`http://trace-viewer.local`;function ec(){let e=tc(),[t,n]=w(e);return e&&ic(e.source,`replace`),typeof window<`u`&&window.addEventListener(`popstate`,()=>{let e=tc();n(e),e&&ic(e.source,`replace`)}),[t,(e,t=`ui`)=>{n(e?{source:e,origin:t}:null),ic(e,`push`)}]}function tc(){let e=nc();return e?{source:e,origin:`url`}:null}function nc(){return ac(new URLSearchParams(window.location.search).get(Zs),rc())}function rc(){return typeof window>`u`?null:new URLSearchParams(window.location.search).get(Qs)}function ic(e,t){let n=new URLSearchParams(window.location.search);e&&e.kind!==`local-zip`?n.set(Zs,lc(e)):n.delete(Zs),e?.kind===`remote-api`&&e.traceToken?n.set(Qs,e.traceToken):n.delete(Qs);let r=new URL(window.location.href);r.search=n.toString(),t===`replace`?window.history.replaceState(null,``,r.toString()):window.history.pushState(null,``,r.toString())}function ac(e,t){if(!e||e.trim()===``)return null;let n=e.trim();if(n===`local-zip`||n.startsWith(`local-zip:`))return null;let r=oc(n,t);return sc(r.url)?{kind:`remote-zip`,url:r.url}:{kind:`remote-api`,url:r.url,traceToken:r.traceToken}}function oc(e,t){let n=t?.trim();try{let t=new URL(e,$s).searchParams.get(Qs)?.trim();return{url:cc(e),traceToken:t||n||null}}catch{return{url:cc(e),traceToken:n||null}}}function sc(e){return e.toLowerCase().endsWith(`.zip`)}function cc(e){return e.split(/[?#]/,1)[0]}function lc(e){switch(e.kind){case`local-zip`:throw Error(`Local ZIP trace sources cannot be serialized`);case`remote-zip`:return e.url;case`remote-api`:return e.url}}var uc=z(`<div class="mx-auto max-w-xl rounded border border-blue-200 bg-blue-50 px-3 py-2 text-sm text-blue-700"><div class=font-medium>Loading trace</div><div class=mt-1>`),dc=z(`<div class="mx-auto max-w-xl rounded border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700"><div class=font-medium>Failed to load trace</div><div class="mt-1 break-words">`),fc=z(`<div class="flex items-start gap-2 justify-center"><button type=button class="px-4 py-2 bg-blue-600 hover:bg-blue-700 rounded transition-colors text-white disabled:opacity-50 disabled:cursor-not-allowed">Load`),pc=z(`<div class=space-y-3><div class="text-lg font-light">Drop trace ZIP file here</div><div class="text-sm text-gray-500">or`),mc=z(`<div class="flex-1 flex items-center justify-center px-4"><div class="w-full max-w-2xl text-center space-y-6"><div class="text-2xl font-light text-gray-500">Load a Playwright OpenTelemetry trace</div><div class=text-gray-500>or`),hc=`.zip,application/zip,application/x-zip-compressed`,gc={TOO_MANY_FILES:`Select one trace ZIP file at a time.`,FILE_INVALID_TYPE:`Select a Playwright OpenTelemetry trace ZIP file.`,FILE_TOO_LARGE:`The trace ZIP file is too large.`,FILE_TOO_SMALL:`The trace ZIP file is empty.`,FILE_INVALID:`Select a valid trace ZIP file.`,FILE_EXISTS:`That trace ZIP file is already selected.`};function _c(e){return e.name.toLowerCase().endsWith(`.zip`)||e.type===`application/zip`||e.type===`application/x-zip-compressed`}function vc(e){return gc[e]??String(e)}function yc(e){let[t,n]=w(e.initialApiUrl??``),[r,i]=w(``),[a,o]=w(``);D(()=>{let t=e.initialApiUrl;t!==void 0&&n(t)});let s=t=>{let n=t.files[0];n&&(i(``),o(``),e.onLoadSource({kind:`local-zip`,file:n}))},c=e=>{let t=e.files[0]?.errors[0];i(t?vc(t):`Select a trace ZIP file.`)},l=()=>{let n=t().trim();if(!n){o(`Enter a trace API URL or trace ZIP URL.`);return}let r=ac(n,rc());if(!r){o(`Enter a trace API URL or trace ZIP URL.`);return}o(``),i(``),e.onLoadSource(r)},u=e=>{e.key===`Enter`&&l()};return(()=>{var i=mc(),d=i.firstChild,f=d.firstChild.nextSibling;return H(d,F(R,{get when(){return e.status.kind===`loading`},get children(){var t=uc(),n=t.firstChild.nextSibling;return H(n,()=>bc(e.status)),t}}),f),H(d,F(R,{get when(){return e.status.kind===`error`},get children(){var t=dc(),n=t.firstChild.nextSibling;return H(n,()=>xc(e.status)),t}}),f),H(d,F(uo.Root,{get invalid(){return!!a()},get children(){return[F(uo.Label,{class:`sr-only`,children:`Trace API or ZIP URL`}),(()=>{var r=fc(),i=r.firstChild;return H(r,F(uo.Input,{type:`text`,placeholder:`Enter API URL...`,class:`min-w-0 flex-1 px-3 py-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-gray-900 data-[invalid]:border-red-500`,get value(){return t()},onInput:e=>{n(e.currentTarget.value),a()&&o(``)},onKeyDown:u}),i),i.$$click=l,E(()=>i.disabled=!t().trim()||e.status.kind===`loading`),r})(),F(uo.HelperText,{class:`mt-2 block text-sm text-gray-500`,children:`Enter a trace API URL, or a URL ending in .zip.`}),F(R,{get when(){return a()},get children(){return F(uo.ErrorText,{class:`mt-2 block text-sm text-red-400`,get children(){return a()}})}})]}}),f),H(d,F(uo.Root,{get invalid(){return!!r()},get children(){return[F(Xs.Root,{accept:hc,maxFiles:1,get invalid(){return!!r()},onFileAccept:s,onFileReject:c,validate:e=>_c(e)?null:[`FILE_INVALID_TYPE`],get children(){return[F(Xs.Label,{class:`sr-only`,children:`Trace ZIP file`}),F(Xs.Dropzone,{disableClick:!0,class:`rounded-lg border border-dashed border-gray-300 bg-gray-50 px-6 py-8 text-gray-600 transition-colors data-[dragging]:border-blue-400 data-[dragging]:bg-blue-50 data-[invalid]:border-red-500 data-[invalid]:bg-red-50`,get children(){var e=pc();return e.firstChild.nextSibling,H(e,F(Xs.Trigger,{class:`inline-flex px-4 py-2 bg-blue-600 hover:bg-blue-700 rounded cursor-pointer transition-colors text-white`,children:`Select file`}),null),e}}),F(Xs.HiddenInput,{})]}}),F(uo.HelperText,{class:`mt-2 block text-sm text-gray-500`,children:`Upload a local Playwright OpenTelemetry trace ZIP.`}),F(uo.ErrorText,{class:`mt-2 block text-sm text-red-400`,get children(){return r()}})]}}),null),i})()}function bc(e){return e.kind===`loading`?e.message:``}function xc(e){return e.kind===`error`?e.message:``}ot([`click`]);var Sc=`playwright-tests`,Cc=`playwright-browser`;function wc(e){let t=[],n=[],r=[];for(let i of e)i.serviceName===Sc?t.push(i):i.serviceName===Cc?n.push(i):r.push(i);return{steps:t,browserSpans:n,externalSpans:r}}function Tc(e){return e.status?.code===2}function Ec(e,t){let n=[];for(let r of e.resourceSpans){let e=Dc(r.resource.attributes);for(let i of r.scopeSpans)for(let r of i.spans)n.push(Oc(r,t,e))}return n.sort((e,t)=>e.startOffsetMs-t.startOffsetMs),n}function Dc(e){for(let t of e)if(t.key===`service.name`&&t.value.stringValue)return t.value.stringValue;return`unknown`}function Oc(e,t,n){let r=Nc(e.attributes),i=Ic(e.startTimeUnixNano),a=Ic(e.endTimeUnixNano);return{id:e.spanId,parentId:e.parentSpanId??null,traceId:e.traceId,name:e.name,title:Fc(r,e.name),startOffsetMs:i-t,durationMs:a-i,kind:jc(e.kind),attributes:r,events:e.events.map(e=>kc(e,i)),status:e.status,serviceName:n}}function kc(e,t){return{name:e.name,timeOffsetMs:Ic(e.timeUnixNano)-t,attributes:Nc(e.attributes)}}var Ac={UNSPECIFIED:0,INTERNAL:1,SERVER:2,CLIENT:3,PRODUCER:4,CONSUMER:5};function jc(e){switch(e){case Ac.SERVER:return`server`;case Ac.CLIENT:return`client`;case Ac.PRODUCER:return`producer`;case Ac.CONSUMER:return`consumer`;default:return`internal`}}var Mc=[`test.step.title`,`test.case.title`];function Nc(e){let t={};for(let n of e){let e=Pc(n);e!==void 0&&(t[n.key]=e)}return t}function Pc(e){let{value:t}=e;if(t.stringValue!==void 0)return t.stringValue;if(t.intValue!==void 0)return t.intValue;if(t.doubleValue!==void 0)return t.doubleValue;if(t.boolValue!==void 0)return t.boolValue;if(t.arrayValue!==void 0)return t.arrayValue.values.flatMap(e=>e.stringValue===void 0?[]:[e.stringValue])}function Fc(e,t){let n=e[`browser.resource.type`],r=e[`url.path`];if((n===`page`||n===`route`)&&typeof r==`string`&&r.length>0)return r;for(let t of Mc){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return t}function Ic(e){let t=BigInt(e);return Number(t/BigInt(1e6))}var Lc,Rc={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function zc(e){return!e&&!Lc?Rc:{lang:e?.lang??Lc?.lang,message:e?.message,abortEarly:e?.abortEarly??Lc?.abortEarly,abortPipeEarly:e?.abortPipeEarly??Lc?.abortPipeEarly}}var Bc;function Vc(e){return Bc?.get(e)}var Hc;function Uc(e){return Hc?.get(e)}var Wc;function Gc(e,t){return Wc?.get(e)?.get(t)}function Kc(e){let t=typeof e;return t===`string`?`"${e}"`:t===`number`||t===`bigint`||t===`boolean`?`${e}`:t===`object`||t===`function`?(e&&Object.getPrototypeOf(e)?.constructor?.name)??`null`:t}function qc(e,t,n,r,i){let a=i&&`input`in i?i.input:n.value,o=i?.expected??e.expects??null,s=i?.received??Kc(a),c={kind:e.kind,type:e.type,input:a,expected:o,received:s,message:`Invalid ${t}: ${o?`Expected ${o} but r`:`R`}eceived ${s}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},l=e.kind===`schema`,u=i?.message??e.message??Gc(e.reference,c.lang)??(l?Uc(c.lang):null)??r.message??Vc(c.lang);u!==void 0&&(c.message=typeof u==`function`?u(c):u),l&&(n.typed=!1),n.issues?n.issues.push(c):n.issues=[c]}var Jc=new WeakMap;function Yc(e){let t=Jc.get(e);return t||(t={version:1,vendor:`valibot`,validate(t){return e[`~run`]({value:t},zc())}},Jc.set(e,t)),t}var Xc=class extends Error{constructor(e){super(e[0].message),this.name=`ValiError`,this.issues=e}};function Zc(e,t,n){return typeof e.fallback==`function`?e.fallback(t,n):e.fallback}function Qc(e,t){return{...e,fallback:t,get"~standard"(){return Yc(this)},"~run"(t,n){let r=e[`~run`](t,n);return r.issues?{typed:!0,value:Zc(this,r,n)}:r}}}function $c(e,t,n){return typeof e.default==`function`?e.default(t,n):e.default}function el(e,t){return{kind:`schema`,type:`array`,reference:el,expects:`Array`,async:!1,item:e,message:t,get"~standard"(){return Yc(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<n.length;r++){let i=n[r],a=this.item[`~run`]({value:i},t);if(a.issues){let o={type:`array`,origin:`value`,input:n,key:r,value:i};for(let t of a.issues)t.path?t.path.unshift(o):t.path=[o],e.issues?.push(t);if(e.issues||=a.issues,t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}}else qc(this,`type`,e,t);return e}}}function tl(e){return{kind:`schema`,type:`boolean`,reference:tl,expects:`boolean`,async:!1,message:e,get"~standard"(){return Yc(this)},"~run"(e,t){return typeof e.value==`boolean`?e.typed=!0:qc(this,`type`,e,t),e}}}function nl(e){return{kind:`schema`,type:`number`,reference:nl,expects:`number`,async:!1,message:e,get"~standard"(){return Yc(this)},"~run"(e,t){return typeof e.value==`number`&&!isNaN(e.value)?e.typed=!0:qc(this,`type`,e,t),e}}}function rl(e,t){return{kind:`schema`,type:`object`,reference:rl,expects:`Object`,async:!1,entries:e,message:t,get"~standard"(){return Yc(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};for(let r in this.entries){let i=this.entries[r];if(r in n||(i.type===`exact_optional`||i.type===`optional`||i.type===`nullish`)&&i.default!==void 0){let a=r in n?n[r]:$c(i),o=i[`~run`]({value:a},t);if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||=o.issues,t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}else if(i.fallback!==void 0)e.value[r]=Zc(i);else if(i.type!==`exact_optional`&&i.type!==`optional`&&i.type!==`nullish`&&(qc(this,`key`,e,t,{input:void 0,expected:`"${r}"`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]}),t.abortEarly))break}}else qc(this,`type`,e,t);return e}}}function il(e,t){return{kind:`schema`,type:`optional`,reference:il,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return Yc(this)},"~run"(e,t){return e.value===void 0&&(this.default!==void 0&&(e.value=$c(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function al(e){return{kind:`schema`,type:`string`,reference:al,expects:`string`,async:!1,message:e,get"~standard"(){return Yc(this)},"~run"(e,t){return typeof e.value==`string`?e.typed=!0:qc(this,`type`,e,t),e}}}function ol(){return{kind:`schema`,type:`unknown`,reference:ol,expects:`unknown`,async:!1,get"~standard"(){return Yc(this)},"~run"(e){return e.typed=!0,e}}}function sl(e,t,n){let r=e[`~run`]({value:t},zc(n));if(r.issues)throw new Xc(r.issues);return r.value}var cl=rl({key:al(),value:rl({stringValue:il(al()),intValue:il(nl()),doubleValue:il(nl()),boolValue:il(tl()),arrayValue:il(rl({values:el(rl({stringValue:il(al()),intValue:il(nl()),doubleValue:il(nl()),boolValue:il(tl())}))}))})}),ll=rl({resourceSpans:el(rl({resource:rl({attributes:el(cl)}),scopeSpans:el(rl({scope:rl({name:al(),version:al()}),spans:el(rl({traceId:al(),spanId:al(),parentSpanId:il(al()),name:al(),kind:nl(),startTimeUnixNano:al(),endTimeUnixNano:al(),attributes:el(cl),droppedAttributesCount:Qc(nl(),0),events:el(rl({name:al(),timeUnixNano:al(),attributes:el(cl),droppedAttributesCount:Qc(nl(),0)})),droppedEventsCount:Qc(nl(),0),status:il(rl({code:nl(),message:il(al())})),links:el(ol()),droppedLinksCount:Qc(nl(),0)}))}))}))});function ul(e){return sl(ll,e)}var dl=Symbol(`store-raw`),fl=Symbol(`store-node`),pl=Symbol(`store-has`),ml=Symbol(`store-self`);function hl(e){let t=e[a];if(!t&&(Object.defineProperty(e,a,{value:t=new Proxy(e,Cl)}),!Array.isArray(e))){let n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),i=Object.getPrototypeOf(e),a=i!==null&&typeof e==`object`&&!!e&&!Array.isArray(e)&&i!==Object.prototype;if(a){let e=Object.getOwnPropertyDescriptors(i);n.push(...Object.keys(e)),Object.assign(r,e)}for(let i=0,o=n.length;i<o;i++){let o=n[i];a&&o===`constructor`||r[o].get&&Object.defineProperty(e,o,{configurable:!0,enumerable:r[o].enumerable,get:r[o].get.bind(t)})}}return t}function gl(e){let t;return typeof e==`object`&&!!e&&(e[a]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function _l(e,t=new Set){let n,r,i,a;if(n=e!=null&&e[dl])return n;if(!gl(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,a=e.length;n<a;n++)i=e[n],(r=_l(i,t))!==i&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let s=0,c=n.length;s<c;s++)a=n[s],!o[a].get&&(i=e[a],(r=_l(i,t))!==i&&(e[a]=r))}return e}function vl(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function yl(e,t,n){if(e[t])return e[t];let[r,i]=w(n,{equals:!1,internal:!0});return r.$=i,e[t]=r}function bl(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===a||t===fl?n:(delete n.value,delete n.writable,n.get=()=>e[a][t],n)}function xl(e){re()&&yl(vl(e,fl),ml)()}function Sl(e){return xl(e),Reflect.ownKeys(e)}var Cl={get(e,t,n){if(t===dl)return e;if(t===a)return n;if(t===s)return xl(e),n;let r=vl(e,fl),i=r[t],o=i?i():e[t];if(t===fl||t===pl||t===`__proto__`)return o;if(!i){let n=Object.getOwnPropertyDescriptor(e,t);re()&&(typeof o!=`function`||e.hasOwnProperty(t))&&!(n&&n.get)&&(o=yl(r,t,o)())}return gl(o)?hl(o):o},has(e,t){return t===dl||t===a||t===s||t===fl||t===pl||t===`__proto__`?!0:(re()&&yl(vl(e,pl),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Sl,getOwnPropertyDescriptor:bl};function wl(e,t,n,r=!1){if(t===`__proto__`||!r&&e[t]===n)return;let i=e[t],a=e.length;n===void 0?(delete e[t],e[pl]&&e[pl][t]&&i!==void 0&&e[pl][t].$()):(e[t]=n,e[pl]&&e[pl][t]&&i===void 0&&e[pl][t].$());let o=vl(e,fl),s;if((s=yl(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let t=e.length;t<a;t++)(s=o[t])&&s.$();(s=yl(o,`length`,a))&&s.$(e.length)}(s=o[ml])&&s.$()}function Tl(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];El(i)||wl(e,i,t[i])}}function El(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function Dl(e,t){if(typeof t==`function`&&(t=t(e)),t=_l(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let r=t[n];e[n]!==r&&wl(e,n,r)}wl(e,`length`,r)}else Tl(e,t)}function Ol(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();let a=typeof r,o=Array.isArray(e);if(a===`string`&&(r===`__proto__`||t.length>1&&El(r)))return;if(Array.isArray(r)){for(let i=0;i<r.length;i++)Ol(e,[r[i]].concat(t),n);return}else if(o&&a===`function`){for(let i=0;i<e.length;i++)r(e[i],i)&&Ol(e,[i].concat(t),n);return}else if(o&&a===`object`){let{from:i=0,to:a=e.length-1,by:o=1}=r;for(let r=i;r<=a;r+=o)Ol(e,[r].concat(t),n);return}else if(t.length>1){Ol(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a==`function`&&(a=a(i,n),a===i)||r===void 0&&a==null||(a=_l(a),r===void 0||gl(i)&&gl(a)&&!Array.isArray(a)?Tl(i,a):wl(e,r,a))}function kl(...[e,t]){let n=_l(e||{}),r=Array.isArray(n),i=hl(n);function a(...e){A(()=>{r&&e.length===1?Dl(n,e[0]):Ol(n,e)})}return[i,a]}var Al=new WeakMap,jl={get(e,t){if(t===dl)return e;let n=e[t];if(t===a||t===s||t===fl||t===pl||t===`__proto__`)return n;let r;return gl(n)?Al.get(n)||(Al.set(n,r=new Proxy(n,jl)),r):n},set(e,t,n){return wl(e,t,_l(n)),!0},deleteProperty(e,t){return wl(e,t,void 0,!0),!0}};function Ml(e){return t=>{if(gl(t)){let n;(n=Al.get(t))||Al.set(t,n=new Proxy(t,jl)),e(n)}return t}}function Nl(e){let[t,n]=kl(Fl()),r=null;return D(M(e,e=>{if(r&&r.abort(),!e){n(Fl());return}r=new AbortController;let t=r.signal,i=Il(e.testInfo.startTimeUnixNano);n({status:`loading`,steps:[],browserSpans:[],externalSpans:[],totalDurationMs:Ll(e),error:void 0}),Pl(e,i,t,n)})),N(()=>{r&&r.abort()}),{status:()=>t.status,isLoading:()=>t.status===`loading`,steps:()=>t.steps,browserSpans:()=>t.browserSpans,externalSpans:()=>t.externalSpans,totalDurationMs:()=>t.totalDurationMs,error:()=>t.error}}async function Pl(e,t,n,r){try{if(n.aborted)return;let i=wc(Ec(e.traceData,t));if(n.aborted)return;r(Ml(e=>{e.steps=i.steps,e.browserSpans=i.browserSpans,e.externalSpans=i.externalSpans,e.status=`loaded`}))}catch(e){if(n.aborted)return;throw r(Ml(t=>{t.status=`error`,t.error=e instanceof Error?e:Error(String(e))})),e}}function Fl(){return{status:`idle`,steps:[],browserSpans:[],externalSpans:[],totalDurationMs:0}}function Il(e){let t=BigInt(e);return Number(t/BigInt(1e6))}function Ll(e){let t=Il(e.testInfo.startTimeUnixNano);return Il(e.testInfo.endTimeUnixNano)-t}var Rl=`playwright.test`;function zl(e){let t=Vl(Bl(e));if(!t)throw Error(`Unable to derive test info: no ${Rl} span found in OTLP trace data`);let n=Hl(t.attributes??[]);return{name:Wl(n,`test.case.title`)??t.name,describes:Kl(n,`playwright.test.describes`),file:Wl(n,`code.file.path`)??``,line:Gl(n,`code.line.number`)??0,status:ql(Wl(n,`playwright.test.status`)),traceId:t.traceId,startTimeUnixNano:t.startTimeUnixNano,endTimeUnixNano:t.endTimeUnixNano}}function Bl(e){return e.resourceSpans.flatMap(e=>e.scopeSpans.flatMap(e=>e.spans.filter(e=>e.name===Rl)))}function Vl(e){let t=e.filter(e=>!e.parentSpanId);return(t.length>0?t:e).sort((e,t)=>e.startTimeUnixNano.localeCompare(t.startTimeUnixNano))[0]}function Hl(e){let t={};for(let n of e){let e=Ul(n);e!==void 0&&(t[n.key]=e)}return t}function Ul(e){let{value:t}=e;if(t.stringValue!==void 0)return t.stringValue;if(t.intValue!==void 0)return t.intValue;if(t.doubleValue!==void 0)return t.doubleValue;if(t.boolValue!==void 0)return t.boolValue;if(t.arrayValue!==void 0)return t.arrayValue.values.flatMap(e=>e.stringValue===void 0?[]:[e.stringValue])}function Wl(e,t){let n=e[t];return typeof n==`string`?n:void 0}function Gl(e,t){let n=e[t];return typeof n==`number`?n:void 0}function Kl(e,t){let n=e[t];return Array.isArray(n)?n:[]}function ql(e){switch(e){case`failed`:case`skipped`:case`timedOut`:case`interrupted`:return e;default:return`passed`}}function Jl(){return`/`.endsWith(`/`)?`/`:`//`}function Yl(e){let t=Jl();return`${t.endsWith(`/`)?t:`${t}/`}${e.startsWith(`/`)?e.slice(1):e}`}async function Xl(){if(!(`serviceWorker`in navigator))throw Error(`Service Workers are not supported in this browser`);let e=Jl(),t=ou(),n=await navigator.serviceWorker.register(t,{scope:e,type:`module`});return await navigator.serviceWorker.ready,await Ql(n),await $l(await Zl()),n}async function Zl(){return navigator.serviceWorker.controller?navigator.serviceWorker.controller:new Promise((e,t)=>{let n=setTimeout(()=>{navigator.serviceWorker.removeEventListener(`controllerchange`,r),t(Error(`Timeout waiting for service worker to control page`))},1e4),r=()=>{let t=navigator.serviceWorker.controller;t&&(clearTimeout(n),navigator.serviceWorker.removeEventListener(`controllerchange`,r),e(t))};navigator.serviceWorker.addEventListener(`controllerchange`,r)})}async function Ql(e){return e.active?e.active:new Promise((t,n)=>{let r=setTimeout(()=>{n(Error(`Timeout waiting for service worker to activate`))},1e4),i=()=>{e.active&&(clearTimeout(r),e.installing?.removeEventListener(`statechange`,i),e.waiting?.removeEventListener(`statechange`,i),t(e.active))};e.installing?.addEventListener(`statechange`,i),e.waiting?.addEventListener(`statechange`,i),e.active&&(clearTimeout(r),t(e.active))})}async function $l(e){return new Promise((t,n)=>{let r=setTimeout(()=>{n(Error(`Service worker did not respond to ping`))},5e3),i=e=>{e.data?.type===`PONG`&&(clearTimeout(r),navigator.serviceWorker.removeEventListener(`message`,i),t())};navigator.serviceWorker.addEventListener(`message`,i),e.postMessage({type:`PING`})})}async function eu(e){return ru({type:`LOAD_TRACE`,data:e},`TRACE_LOADED`,`TRACE_LOAD_ERROR`,`Timeout loading trace in service worker`)}async function tu(e){return ru({type:`LOAD_TRACE_ZIP_URL`,data:e},`TRACE_LOADED`,`TRACE_LOAD_ERROR`,`Timeout loading trace ZIP in service worker`)}async function nu(e){return(await ru({type:`LOAD_SCREENSHOTS`,data:e},`SCREENSHOTS_LOADED`,`SCREENSHOTS_LOAD_ERROR`,`Timeout loading screenshots in service worker`)).screenshotMetas}async function ru(e,t,n,r){await navigator.serviceWorker.ready;let i=await Zl(),a=crypto.randomUUID(),o={...e,requestId:a};return new Promise((e,s)=>{let c=setTimeout(()=>{navigator.serviceWorker.removeEventListener(`message`,l),s(Error(r))},3e4),l=r=>{r.data?.requestId===a&&(r.data?.type===t?(clearTimeout(c),navigator.serviceWorker.removeEventListener(`message`,l),e(r.data.data)):r.data?.type===n&&(clearTimeout(c),navigator.serviceWorker.removeEventListener(`message`,l),s(Error(`Service worker error: ${r.data.error||`Unknown error`}`))))};navigator.serviceWorker.addEventListener(`message`,l),i.postMessage(o)})}async function iu(){let e=(await navigator.serviceWorker.ready).active;e&&e.postMessage({type:`UNLOAD_TRACE`})}function au(e){return Yl(`playwright-otel-trace-viewer/v1/${e}`)}function ou(){return Yl(`sw.js`)}var su=null,cu=0;async function lu(e){return await vu(),await _u(),du(e)}async function uu(e){return await vu(),await _u(),fu(await tu({zipUrl:e}),{traceZip:e})}async function du(e){let t=gu();return fu(await eu({zip:e,sourceId:t}),{traceSource:t})}function fu(e,t){let n=au(e.traceId),r=e.screenshotMetas.map(e=>({timestamp:e.timestamp,url:mu(n,e.file,t),pageId:e.pageId}));return{testInfo:zl(e.traceData),traceData:e.traceData,loadScreenshots:async()=>r}}async function pu(e,t){let n=await nu({traceId:e,screenshotsZipUrl:t}),r=au(e);return n.map(e=>({timestamp:e.timestamp,url:mu(r,e.file,{screenshotsZip:t}),pageId:e.pageId}))}function mu(e,t,n){let r=n?`?${hu(n)}`:``;return`${e}/screenshots/${encodeURIComponent(t)}${r}`}function hu(e){return`screenshotsZip`in e?`screenshotsZip=${encodeURIComponent(e.screenshotsZip)}`:`traceZip`in e?`traceZip=${encodeURIComponent(e.traceZip)}`:`traceSource=${encodeURIComponent(e.traceSource)}`}function gu(){return cu+=1,`local-zip-${Date.now()}-${cu}`}async function _u(){await iu()}async function vu(){return su||=Xl(),su}var yu=`traces`,bu=`screenshots.zip`;async function xu(e,t){let n=e.replace(/\/$/,``),r=Su(`${n}/${yu}`,t),i=await fetch(r);if(!i.ok){let e=await i.text();throw Error(`Failed to fetch trace data from ${r}: ${i.status} ${e}`)}let a=ul(await i.json()),o=zl(a),s=Su(`${n}/${bu}`,t);return{testInfo:o,traceData:a,loadScreenshots:()=>Cu({traceId:o.traceId,screenshotsZipUrl:s})}}function Su(e,t){return t===null?e:`${e}?traceToken=${encodeURIComponent(t)}`}async function Cu({traceId:e,screenshotsZipUrl:t}){try{return await vu(),await pu(e,t)}catch(e){return console.warn(`Failed to load screenshots ZIP: ${e instanceof Error?e.message:String(e)}`),[]}}function wu(e){let[t]=k(e,async e=>{if(e)return Tu(e)}),[n]=k(()=>t.state===`ready`?t()?.loadScreenshots:void 0,e=>e(),{initialValue:[]});return N(()=>{_u()}),{traceInfoData:t,traceInfo:()=>{if(t.state!==`ready`)return;let e=t();if(e)return{testInfo:e.testInfo,traceData:e.traceData,screenshots:n}}}}async function Tu(e){switch(e.kind){case`local-zip`:return lu(e.file);case`remote-zip`:return uu(e.url);case`remote-api`:return xu(e.url,e.traceToken)}}var Eu=1,Du=100,Ou=10;function ku(e,t,n){let r=Fu(e),i=1+n,a=Math.max(Eu,Math.min(Du,r*i)),o=e.totalDurationMs/a;o=Math.max(Ou,o);let s=Lu(t,e)-t*o;return Vu({visibleStartMs:s,visibleEndMs:s+o,totalDurationMs:e.totalDurationMs})}function Au(e,t){return Vu({visibleStartMs:e.visibleStartMs+t,visibleEndMs:e.visibleEndMs+t,totalDurationMs:e.totalDurationMs})}function ju(e){return Nu(e.totalDurationMs)}function Mu(e,t,n,r=.1){let i=(n-t)*r;return Vu({visibleStartMs:t-i,visibleEndMs:n+i,totalDurationMs:e.totalDurationMs})}function Nu(e){return{visibleStartMs:0,visibleEndMs:e,totalDurationMs:e}}function Pu(e){return e.visibleEndMs-e.visibleStartMs}function Fu(e){let t=Pu(e);return t<=0?1:e.totalDurationMs/t}function Iu(e,t){let n=Pu(t);return n<=0?0:(e-t.visibleStartMs)/n}function Lu(e,t){let n=Pu(t);return t.visibleStartMs+e*n}function Ru(e,t){return t.totalDurationMs<=0?0:e/t.totalDurationMs}function zu(e,t,n){return t>n.visibleStartMs&&e<n.visibleEndMs}function Bu(e){return e.visibleStartMs<=0&&e.visibleEndMs>=e.totalDurationMs}function Vu(e){let t=Pu(e),n=Math.min(t,e.totalDurationMs),r=e.visibleStartMs,i=e.visibleEndMs;return n<t&&(i=r+n),r<0&&(r=0,i=n),i>e.totalDurationMs&&(i=e.totalDurationMs,r=Math.max(0,i-n)),{visibleStartMs:r,visibleEndMs:i,totalDurationMs:e.totalDurationMs}}var Hu=le();function Uu(e){let[t,n]=w(Nu(e.durationMs()||1e3)),[r,i]=w(null);O(()=>{let t=e.durationMs();t>0&&n(Nu(t))});let a={viewport:t,durationMs:e.durationMs,testStartTimeMs:e.testStartTimeMs,setViewport:n,pan:e=>{n(t=>Au(t,e))},zoom:(e,t)=>{n(n=>ku(n,e,t))},zoomToRange:(e,t)=>{n(n=>Mu(n,e,t))},reset:()=>{n(e=>ju(e))},selectionState:r,startSelection:e=>{i({startPosition:e,currentPosition:e})},updateSelection:e=>{i(t=>t?{startPosition:t.startPosition,currentPosition:e}:null)},endSelection:()=>{let e=r();return i(null),e}};return F(Hu.Provider,{value:a,get children(){return e.children}})}function Wu(){let e=ue(Hu);if(!e)throw Error(`useViewportContext must be used within a ViewportProvider`);return e}function Gu(e,t){let n=e.startOffset+e.duration,r=t.startOffset+t.duration;return!(n<=t.startOffset||r<=e.startOffset)}function Ku(e,t,n){for(let r=n;r<t.length;r++)if(!t[r].some(t=>Gu(e,t)))return r;return t.length}function qu(e){if(e.length===0)return{spans:[],totalRows:0};let t=Ju(e),n=new Map,r=[],i=[];for(let e of t){let t=0;if(e.parentId!==null){let r=n.get(e.parentId);r!==void 0&&(t=r+1)}let a=Ku(e,r,t);for(;r.length<=a;)r.push([]);r[a].push({startOffset:e.startOffset,duration:e.duration}),n.set(e.id,a),i.push({...e,row:a})}return{spans:i,totalRows:r.length}}function Ju(e){let t=new Map(e.map(e=>[e.id,e])),n=new Map,r=[];for(let i of e){if(i.parentId===null||!t.has(i.parentId)){r.push(i);continue}let e=n.get(i.parentId)??[];e.push(i),n.set(i.parentId,e)}let i=[],a=new Set,o=new Set,s=e=>{if(!a.has(e.id)&&!o.has(e.id)){o.add(e.id),i.push(e),a.add(e.id);for(let t of n.get(e.id)??[])s(t);o.delete(e.id)}};for(let e of r)s(e);for(let t of e)s(t);return i}var Yu={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},Xu=le({size:24,color:`currentColor`,strokeWidth:2,absoluteStrokeWidth:!1,class:``}),Zu=z(`<svg>`),Qu=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},$u=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ed=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),td=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),nd=e=>{let t=ed(e);return t.charAt(0).toUpperCase()+t.slice(1)},rd=e=>{let[t,n]=Be(e,[`color`,`size`,`strokeWidth`,`children`,`class`,`name`,`iconNode`,`absoluteStrokeWidth`]),r=ue(Xu);return(()=>{var e=Zu();return pt(e,I(Yu,{get width(){return t.size??r.size??Yu.width},get height(){return t.size??r.size??Yu.height},get stroke(){return t.color??r.color??Yu.stroke},get"stroke-width"(){return nt(()=>(t.absoluteStrokeWidth??r.absoluteStrokeWidth)===!0)()?Number(t.strokeWidth??r.strokeWidth??Yu[`stroke-width`])*24/Number(t.size??r.size):Number(t.strokeWidth??r.strokeWidth??Yu[`stroke-width`])},get class(){return $u(`lucide`,`lucide-icon`,r.class,...t.name==null?[]:[`lucide-${td(nd(t.name))}`,`lucide-${td(t.name)}`],t.class)},get"aria-hidden"(){return!t.children&&!Qu(n)?`true`:void 0}},n),!0,!0),H(e,F(L,{get each(){return t.iconNode},children:([e,t])=>F(jt,I({component:e},t))})),e})()},id=[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],ad=e=>F(rd,I(e,{iconNode:id,name:`braces`})),od=[[`path`,{d:`m11 10 3 3`,key:`fzmg1i`}],[`path`,{d:`M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z`,key:`p4q2r7`}],[`path`,{d:`M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031`,key:`wy6l02`}]],sd=e=>F(rd,I(e,{iconNode:od,name:`brush`})),cd=[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]],ld=e=>F(rd,I(e,{iconNode:cd,name:`code`})),ud=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]],dd=e=>F(rd,I(e,{iconNode:ud,name:`file`})),fd=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]],pd=e=>F(rd,I(e,{iconNode:fd,name:`file-text`})),md=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]],hd=e=>F(rd,I(e,{iconNode:md,name:`film`})),gd=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]],_d=e=>F(rd,I(e,{iconNode:gd,name:`image`})),vd=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]],yd=e=>F(rd,I(e,{iconNode:vd,name:`panel-top`})),bd=[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]],xd=e=>F(rd,I(e,{iconNode:bd,name:`type`}));function Sd(e){let t=e.attributes[`url.path`];if(typeof t==`string`){if(Cd(e)===`page`||Cd(e)===`route`)return t;let n=t.split(`/`).filter(Boolean);return n[n.length-1]||t}return e.title}function Cd(e){if(e.attributes[`browser.resource.type`]===`page`)return`page`;if(e.attributes[`browser.resource.type`]===`route`)return`route`;let t=e.attributes[`http.resource.type`];if(typeof t==`string`)switch(t){case`document`:return`document`;case`stylesheet`:return`stylesheet`;case`image`:return`image`;case`script`:return`script`;case`fetch`:case`xhr`:return`fetch`;case`font`:return`font`;case`media`:return`media`;default:return`other`}return`other`}function wd(e){return{page:`#7484f5`,route:`#5b6ee1`,document:`#4285f4`,stylesheet:`#34a853`,image:`#9c27b0`,script:`#e2b429`,fetch:`#eb7820`,font:`#0fa599`,media:`#09a1c7`,other:`#808080`}[e]}function Td(e,t=14){let n={size:t,class:`flex-shrink-0`};switch(e){case`page`:case`route`:return F(yd,n);case`document`:return F(pd,n);case`stylesheet`:return F(sd,n);case`image`:return F(_d,n);case`script`:return F(ld,n);case`fetch`:return F(ad,n);case`font`:return F(xd,n);case`media`:return F(hd,n);case`other`:return F(dd,n)}}function Ed(e){if(e.name===`exception`)return`error`;let t=e.attributes[`severity.text`];if(typeof t!=`string`)return`default`;switch(t.toUpperCase()){case`ERROR`:case`FATAL`:return`error`;case`WARN`:case`WARNING`:return`warning`;default:return`default`}}var Dd=z(`<span class="truncate select-none">`),Od=z(`<div role=listitem class="absolute h-6 rounded-xs border-r border-gray-50 text-xs flex items-center gap-1.5 text-white truncate cursor-pointer hover:brightness-110 select-none">`),kd=z(`<div data-testid=span-event-marker class="absolute top-1 bottom-1 w-2 rounded-full border pointer-events-auto shadow-sm"style=margin-left:-4px>`),Ad=2;function jd(e,t,n){let r=Iu(e,n)*100,i=Iu(e+t,n)*100-r;return{leftPercent:r,widthPercent:i,shouldShowContent:i>Ad}}function Md(e,t,n){return n?e===n:t?.has(e)??!1}function Nd(e){let{viewport:t}=Wu(),n=()=>jd(e.startOffset,e.duration,t()),r=()=>Md(e.id,e.matchedSpanIds,e.hoveredSearchSpanId),i=()=>n().shouldShowContent?[nt(()=>e.icon),(()=>{var t=Dd();return H(t,()=>e.name),t})()]:null,a=r=>{let i=Iu(e.startOffset+r.timeOffsetMs,t())*100,a=n(),o=(i-a.leftPercent)/a.widthPercent*100;return Math.max(0,Math.min(100,o))};return(()=>{var t=Od();return t.addEventListener(`mouseleave`,()=>e.onHover?.(null)),t.addEventListener(`mouseenter`,()=>e.onHover?.(e.id)),H(t,i,null),H(t,F(L,{get each(){return e.events??[]},children:(e,t)=>(()=>{var n=kd();return E(r=>{var i=e.name,o=t(),s=Ed(e)===`error`?`true`:void 0,c={"bg-red-200/95 border-red-700/70":Ed(e)===`error`,"bg-amber-200/95 border-amber-700/70":Ed(e)===`warning`,"bg-white/75 border-black/20":Ed(e)==="default"},l=`${a(e)}%`,u=Pd(e);return i!==r.e&&B(n,`data-span-event-name`,r.e=i),o!==r.t&&B(n,`data-span-event-index`,r.t=o),s!==r.a&&B(n,`data-span-event-error`,r.a=s),r.o=dt(n,c,r.o),l!==r.i&&V(n,`left`,r.i=l),u!==r.n&&B(n,`title`,r.n=u),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),n})()}),null),E(i=>{var a=e.name,o=e.id,s=e.name,c=e.startOffset,l=e.duration,u=e.startOffset+e.duration,d=e.row,f=e.isError?`true`:void 0,p={"ring-2 ring-yellow-400 ring-offset-1":r(),"px-2":n().shouldShowContent},m=`${n().leftPercent}%`,h=`${n().widthPercent}%`,g=`${e.row*28}px`,_=e.color,v=`${e.name} (${e.duration}ms)`;return a!==i.e&&B(t,`aria-label`,i.e=a),o!==i.t&&B(t,`data-span-id`,i.t=o),s!==i.a&&B(t,`data-span-name`,i.a=s),c!==i.o&&B(t,`data-span-start-ms`,i.o=c),l!==i.i&&B(t,`data-span-duration-ms`,i.i=l),u!==i.n&&B(t,`data-span-end-ms`,i.n=u),d!==i.s&&B(t,`data-span-row`,i.s=d),f!==i.h&&B(t,`data-span-error`,i.h=f),i.r=dt(t,p,i.r),m!==i.d&&V(t,`left`,i.d=m),h!==i.l&&V(t,`width`,i.l=h),g!==i.u&&V(t,`top`,i.u=g),_!==i.c&&V(t,`background-color`,i.c=_),v!==i.w&&B(t,`title`,i.w=v),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0}),t})()}function Pd(e){let t=e.attributes[`exception.message`]??e.attributes.message;return typeof t==`string`&&t.length>0?t:e.name}var Fd=z(`<div class="flex-1 min-h-0 overflow-y-auto overflow-x-hidden py-3"role=list><div class=relative style=margin-left:var(--timeline-plot-inset);width:var(--timeline-plot-width)>`),Id=z(`<div class="h-full flex flex-col bg-gray-50 overflow-hidden"role=region aria-label="Browser Spans"><div class="flex-shrink-0 px-3 py-2 border-b border-gray-200 text-xs font-semibold text-gray-500 uppercase tracking-wide">Browser Spans`),Ld=z(`<div class="flex-1 flex items-center justify-center text-sm text-gray-400">No browser spans`),Rd=`#dc2626`;function zd(e){return e.map(e=>({id:e.id,name:Sd(e),startOffset:e.startOffsetMs,duration:e.durationMs,parentId:e.parentId}))}function Bd(e){let{viewport:t}=Wu(),n=O(()=>qu(zd(e.spans))),r=O(()=>{let t=new Map;for(let n of e.spans)t.set(n.id,Cd(n));return t}),i=O(()=>new Set(e.spans.filter(Tc).map(e=>e.id))),a=O(()=>new Map(e.spans.map(e=>[e.id,e.events]))),o=O(()=>n().spans.filter(e=>zu(e.startOffset,e.startOffset+e.duration,t()))),s=()=>n().totalRows*28,c=()=>e.spans.length===0;return(()=>{var t=Id();return t.firstChild,H(t,F(R,{get when(){return!c()},get fallback(){return Ld()},get children(){var t=Fd(),n=t.firstChild;return H(n,F(L,{get each(){return o()},children:t=>{let n=r().get(t.id)??`other`,o=i().has(t.id);return F(Nd,{get id(){return t.id},get name(){return t.name},get startOffset(){return t.startOffset},get duration(){return t.duration},get row(){return t.row},get color(){return o?Rd:wd(n)},isError:o,get events(){return a().get(t.id)},get icon(){return Td(n)},get onHover(){return e.onSpanHover},get matchedSpanIds(){return e.matchedSpanIds},get hoveredSearchSpanId(){return e.hoveredSearchSpanId}})}})),E(e=>V(n,`height`,`${s()}px`)),t}}),null),t})()}function Vd(e,t){let n=null;for(let r of e)r.timestamp<=t&&(!n||r.timestamp>n.timestamp)&&(n=r);return n}function Hd(e,t){return e.pageId===t.pageId}function Ud(e,t,n,r,i,a){return{screenshot:Vd(r,i+e),steps:Wd(e,t,a),spans:Wd(e,n,a)}}function Wd(e,t,n){let r=t.filter(t=>{let r=t.startOffsetMs,i=t.startOffsetMs+t.durationMs;return t.id===n||e>=r&&e<=i});if(r.length===0)return[];let i=new Map;for(let e of r)i.set(e.id,e);let a=new Map;for(let e of r){let t=e.parentId&&i.has(e.parentId)?e.parentId:null,n=a.get(t)||[];n.push(e),a.set(t,n)}function o(e,t,n){let r=a.get(e)||[];return r.sort((e,t)=>e.startOffsetMs-t.startOffsetMs),r.map(e=>{let r={span:e,depth:t,parent:n,children:[]};return r.children=o(e.id,t+1,r),r})}return o(null,0,null)}function Gd(e){let t=[];function n(e){for(let r of e)t.push(r),n(r.children)}return n(e),t}var Kd=[[`path`,{d:`m5 9 7-7 7 7`,key:`1hw5ic`}],[`path`,{d:`M12 16V2`,key:`ywoabb`}],[`circle`,{cx:`12`,cy:`21`,r:`1`,key:`o0uj5v`}]],qd=e=>F(rd,I(e,{iconNode:Kd,name:`arrow-up-from-dot`})),Jd=[[`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`}]],Yd=e=>F(rd,I(e,{iconNode:Jd,name:`circle-alert`})),Xd=[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]],Zd=e=>F(rd,I(e,{iconNode:Xd,name:`search`})),Qd=[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]],$d=e=>F(rd,I(e,{iconNode:Qd,name:`x`})),ef=[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]],tf=e=>F(rd,I(e,{iconNode:ef,name:`zoom-in`}));function nf(e){return e<1?`${(e*1e3).toFixed(0)}µs`:e<1e3?`${e.toFixed(1)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${Math.floor(e/6e4)}m ${(e%6e4/1e3).toFixed(1)}s`}function rf(e){return Array.isArray(e)?e.join(`, `):typeof e==`boolean`?e?`true`:`false`:typeof e==`number`?String(e):e.length>200?`${e.slice(0,200)}...`:e}var af=z(`<div class="rounded border border-red-200 bg-red-50 px-2 py-1.5 text-red-800"><div class=font-semibold>Error`),of=z(`<div class="flex items-center gap-1.5 ml-auto"><span class=text-gray-500>Parent:</span><button type=button class="flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium transition-opacity hover:opacity-80"style=color:white><span class="truncate max-w-[150px]">`),sf=z(`<div class="grid grid-cols-[auto,1fr] gap-x-3 gap-y-1"><span class=text-gray-500>Span Name:</span><span class="font-mono text-gray-900">`),cf=z(`<div class="border-t border-gray-200 pt-2 mt-2"><div class="text-gray-500 mb-1">Events:</div><div class="space-y-2 pl-2">`),lf=z(`<div class="border-t border-gray-200 pt-2 mt-2"><div class="text-gray-500 mb-1">Attributes:</div><div class="grid grid-cols-[auto,1fr] gap-x-3 gap-y-1 pl-2">`),uf=z(`<div class="rounded-md border-2 overflow-hidden transition-all duration-150"><div class="px-3 py-2 text-white text-sm font-medium flex items-center gap-2"><span class=truncate></span></div><div class="bg-gray-50 px-3 py-2 space-y-2 text-xs"><div class="flex flex-wrap items-baseline gap-x-4 gap-y-1"><span><span class=text-gray-500>Duration: </span><span class="font-mono text-gray-900"></span></span><span class=cursor-help><span class=text-gray-500>Time: </span><span class="font-mono text-gray-500"></span></span></div><div class="flex flex-wrap items-start gap-x-4 gap-y-2"><div class="flex gap-x-3 items-baseline"><span class=text-gray-500>Kind:</span><span class="text-gray-900 capitalize"></span></div><div class="flex gap-x-3 items-baseline"><span class=text-gray-500>Status:</span><span class=capitalize>`),df=z(`<div class="mt-0.5 whitespace-pre-wrap break-words font-mono"data-testid=span-error-message>`),ff=z(`<div class="mt-1 grid grid-cols-[auto,1fr] gap-x-3 gap-y-1">`),pf=z(`<div data-testid=span-event-card class="rounded border px-2 py-1.5"><div class="flex items-baseline justify-between gap-2"><div class="font-semibold text-gray-800"></div><div class="font-mono text-gray-500">`),mf=z(`<div class="mt-1 whitespace-pre-wrap break-words font-mono text-gray-900">`),hf=z(`<span class="text-gray-500 truncate">:`),gf=z(`<span class="font-mono text-gray-900 break-all">`);function _f(e){let{span:t,depth:n,parent:r}=e.hoveredSpan,i=()=>Tc(t)?`#dc2626`:e.colorFn(n,t),a=()=>r?e.colorFn(r.depth,r.span):``,o=t=>{let n=e.testStartTimeMs+t;return`${new Date(n).toLocaleTimeString(`en-US`,{hour12:!1,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}.${String(n%1e3).padStart(3,`0`)}`},s=()=>t.startOffsetMs+t.durationMs,c=()=>`${nf(t.startOffsetMs)} → ${nf(s())}`,l=()=>`Start: ${o(t.startOffsetMs)}\nEnd: ${o(s())}`,u=()=>Object.entries(t.attributes).filter(([e])=>e!==`test.step.title`&&e!==`test.case.title`),d=()=>Tc(t)?`Error`:`OK`,f=e=>t.startOffsetMs+e.timeOffsetMs,p=()=>{r&&e.onNavigateToSpan&&e.onNavigateToSpan(r.span.id)};return(()=>{var n=uf(),o=n.firstChild,s=o.firstChild,m=o.nextSibling,h=m.firstChild,g=h.firstChild,_=g.firstChild.nextSibling,v=g.nextSibling,y=v.firstChild.nextSibling,b=h.nextSibling,x=b.firstChild,S=x.firstChild.nextSibling,C=x.nextSibling.firstChild.nextSibling;return H(o,()=>e.icon,s),H(s,()=>e.displayTitle??t.title),H(m,F(R,{get when(){return Tc(t)},get children(){var e=af();return e.firstChild,H(e,F(R,{get when(){return t.status?.message},children:e=>(()=>{var t=df();return H(t,e),t})()}),null),e}}),h),H(_,()=>nf(t.durationMs)),H(y,c),H(S,()=>t.kind),H(C,d),H(b,F(R,{when:r,get children(){var e=of(),t=e.firstChild.nextSibling,n=t.firstChild;return t.$$click=p,H(t,F(qd,{size:12}),n),H(n,()=>r.span.title),E(e=>{var n=r.span.id,i=a(),o=`Go to parent: ${r.span.title}`;return n!==e.e&&B(t,`data-parent-span-id`,e.e=n),i!==e.t&&V(t,`background-color`,e.t=i),o!==e.a&&B(t,`title`,e.a=o),e},{e:void 0,t:void 0,a:void 0}),e}}),null),H(m,F(R,{get when(){return t.name!==t.title},get children(){var e=sf(),n=e.firstChild.nextSibling;return H(n,()=>t.name),e}}),null),H(m,F(R,{get when(){return(t.events??[]).length>0},get children(){var e=cf(),n=e.firstChild.nextSibling;return H(n,F(L,{get each(){return t.events??[]},children:(e,t)=>(()=>{var n=pf(),r=n.firstChild.firstChild,i=r.nextSibling;return H(r,()=>e.name),H(i,()=>nf(f(e))),H(n,F(R,{get when(){return vf(e)},children:e=>(()=>{var t=mf();return H(t,e),t})()}),null),H(n,F(R,{get when(){return yf(e).length>0},get children(){var t=ff();return H(t,F(L,{get each(){return yf(e)},children:([e,t])=>[(()=>{var t=hf(),n=t.firstChild;return B(t,`title`,e),H(t,e,n),t})(),(()=>{var e=gf();return H(e,()=>rf(t)),E(()=>B(e,`title`,String(t))),e})()]})),t}}),null),E(r=>{var i=e.name,a=t(),o=Ed(e)===`error`?`true`:void 0,s={"border-red-200 bg-red-50":Ed(e)===`error`,"border-amber-200 bg-amber-50":Ed(e)===`warning`,"border-gray-200 bg-white":Ed(e)==="default"};return i!==r.e&&B(n,`data-span-event-name`,r.e=i),a!==r.t&&B(n,`data-span-event-index`,r.t=a),o!==r.a&&B(n,`data-span-event-error`,r.a=o),r.o=dt(n,s,r.o),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n})()})),e}}),null),H(m,F(R,{get when(){return u().length>0},get children(){var e=lf(),t=e.firstChild.nextSibling;return H(t,F(L,{get each(){return u()},children:([e,t])=>[(()=>{var t=hf(),n=t.firstChild;return B(t,`title`,e),H(t,e,n),t})(),(()=>{var e=gf();return H(e,()=>rf(t)),E(()=>B(e,`title`,String(t))),e})()]})),e}}),null),E(r=>{var a=t.id,s={"ring-2 ring-blue-200":e.isFocused},c=e.isFocused?`#3b82f6`:i(),u=i(),d=l(),f={"text-red-700 font-semibold":Tc(t),"text-gray-900":!Tc(t)};return a!==r.e&&B(n,`data-span-id`,r.e=a),r.t=dt(n,s,r.t),c!==r.a&&V(n,`border-color`,r.a=c),u!==r.o&&V(o,`background-color`,r.o=u),d!==r.i&&B(v,`title`,r.i=d),r.n=dt(C,f,r.n),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),n})()}function vf(e){let t=e.attributes[`exception.message`]??e.attributes.message;return typeof t==`string`&&t.length>0?t:void 0}function yf(e){return Object.entries(e.attributes).filter(([e])=>e!==`exception.message`&&e!==`message`)}ot([`click`]);var bf=wd(`other`);function xf(e){return`hsl(${210+e*30}, 70%, ${55+e*5}%)`}function Sf(e){return e.name===`playwright.test`||e.name===`playwright.test.step`}function Cf(e,t){return Sf(e)?xf(t):Cd(e)===`fetch`?wd(`fetch`):bf}var wf=z(`<div data-testid=trace-details-panel class="h-full overflow-auto bg-white">`),Tf=z(`<div class="h-full flex items-center justify-center text-gray-400 text-sm">Hover over the timeline to see details`),Ef=z(`<div><div class="text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">Steps (<!>)</div><div class=space-y-2>`),Df=z(`<div><div class="text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">Browser Spans (<!>)</div><div class=space-y-2>`),Of=z(`<div><div class="text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2">External Spans (<!>)</div><div class=space-y-2>`),kf=z(`<div class="text-gray-400 text-sm text-center py-4">No active steps or spans at this time`),Af=z(`<div aria-hidden=true>`),jf=z(`<div class="p-4 space-y-6">`),Mf=z(`<div data-screenshot class="bg-gray-100 rounded-md overflow-hidden border-2 transition-colors duration-150"><img alt="Screenshot at hover time"class="w-full h-auto">`),Nf=16;function Pf(e){let t={server:{h:200,s:70,l:50},client:{h:280,s:60,l:55},producer:{h:160,s:60,l:45},consumer:{h:35,s:70,l:50},internal:{h:100,s:50,l:45}}[e];return`hsl(${t.h}, ${t.s}%, ${t.l}%)`}function Ff(e){let t,n,r,[i,a]=w(0),o=O(()=>e.hoveredElements?Gd(e.hoveredElements.steps):[]),s=O(()=>e.hoveredElements?Gd(e.hoveredElements.spans):[]),c=O(()=>s().filter(e=>e.span.serviceName===`playwright-browser`)),l=O(()=>s().filter(e=>e.span.serviceName!==`playwright-browser`)),u=t=>{let n=e.focusedElement;return!!(n&&(n.type===`step`||n.type===`span`)&&n.id===t)},d=()=>e.focusedElement?.type===`screenshot`,f=e=>e.type===`screenshot`?`[data-screenshot]`:`[data-span-id="${e.id}"]`,p=O(()=>{let t=e.hoveredElements;return t?[t.screenshot?.url??``,...o().map(e=>e.span.id),...c().map(e=>e.span.id),...l().map(e=>e.span.id)].join(`|`):``}),m=()=>{n!==void 0&&(cancelAnimationFrame(n),n=void 0)};N(m);let h=()=>{m(),n=requestAnimationFrame(()=>{n=void 0;let i=e.focusedElement;if(!i||!t)return;let o=f(i),s=t.querySelector(o);if(!s){r=void 0,a(0);return}r=p(),a(Math.max(0,t.clientHeight-Nf-s.offsetHeight));let c=s.getBoundingClientRect(),l=t.getBoundingClientRect(),u=c.top-l.top+t.scrollTop;t.scrollTo({top:Math.max(0,u-Nf),behavior:`auto`})})};return D(M([()=>e.focusedElement,p],([e,t])=>{if(!e){m(),r!==void 0&&r!==t&&(r=void 0,a(0));return}h()})),(()=>{var n=wf(),r=t;return typeof r==`function`?mt(r,n):t=n,H(n,F(R,{get when(){return e.hoveredElements},get fallback(){return Tf()},children:t=>(()=>{var n=jf();return H(n,F(R,{get when(){return t().screenshot},children:e=>(()=>{var t=Mf(),n=t.firstChild;return n.addEventListener(`load`,h),E(r=>{var i=e().timestamp,a=e().pageId,o={"border-blue-500 ring-2 ring-blue-200":d(),"border-gray-200":!d()},s=e().url;return i!==r.e&&B(t,`data-screenshot-timestamp`,r.e=i),a!==r.t&&B(t,`data-screenshot-page-id`,r.t=a),r.a=dt(t,o,r.a),s!==r.o&&B(n,`src`,r.o=s),r},{e:void 0,t:void 0,a:void 0,o:void 0}),t})()}),null),H(n,F(R,{get when(){return o().length>0},get children(){var t=Ef(),n=t.firstChild,r=n.firstChild.nextSibling;r.nextSibling;var i=n.nextSibling;return H(n,()=>o().length,r),H(i,F(L,{get each(){return o()},children:t=>F(_f,{hoveredSpan:t,get testStartTimeMs(){return e.testStartTimeMs},colorFn:(e,t)=>Cf(t,e),get isFocused(){return u(t.span.id)},get onNavigateToSpan(){return e.onNavigateToSpan}})})),t}}),null),H(n,F(R,{get when(){return c().length>0},get children(){var t=Df(),n=t.firstChild,r=n.firstChild.nextSibling;r.nextSibling;var i=n.nextSibling;return H(n,()=>c().length,r),H(i,F(L,{get each(){return c()},children:t=>{let n=Cd(t.span);return F(_f,{hoveredSpan:t,get testStartTimeMs(){return e.testStartTimeMs},colorFn:(e,t)=>wd(Cd(t)),get isFocused(){return u(t.span.id)},get icon(){return Td(n,16)},get displayTitle(){return Sd(t.span)},get onNavigateToSpan(){return e.onNavigateToSpan}})}})),t}}),null),H(n,F(R,{get when(){return l().length>0},get children(){var t=Of(),n=t.firstChild,r=n.firstChild.nextSibling;r.nextSibling;var i=n.nextSibling;return H(n,()=>l().length,r),H(i,F(L,{get each(){return l()},children:t=>F(_f,{hoveredSpan:t,get testStartTimeMs(){return e.testStartTimeMs},colorFn:(e,t)=>Pf(t.kind),get isFocused(){return u(t.span.id)},get onNavigateToSpan(){return e.onNavigateToSpan}})})),t}}),null),H(n,F(R,{get when(){return nt(()=>o().length===0&&c().length===0)()&&l().length===0},get children(){return kf()}}),null),H(n,F(R,{get when(){return i()>0},get children(){var e=Af();return E(t=>V(e,`height`,`${i()}px`)),e}}),null),n})()})),n})()}var If=z(`<div class="flex-1 min-h-0 overflow-y-auto overflow-x-hidden py-3"role=list><div class=relative style=margin-left:var(--timeline-plot-inset);width:var(--timeline-plot-width)>`),Lf=z(`<div class="h-full flex flex-col bg-gray-50 overflow-hidden"role=region aria-label="External Spans"><div class="flex-shrink-0 px-3 py-2 border-b border-gray-200 text-xs font-semibold text-gray-500 uppercase tracking-wide">External Spans`),Rf=z(`<div class="flex-1 flex items-center justify-center text-sm text-gray-400">No external spans`),zf=`#dc2626`;function Bf(e){return e.map(e=>({id:e.id,name:e.title,startOffset:e.startOffsetMs,duration:e.durationMs,parentId:e.parentId}))}function Vf(e){let t={server:{h:200,s:70,l:50},client:{h:280,s:60,l:55},producer:{h:160,s:60,l:45},consumer:{h:35,s:70,l:50},internal:{h:100,s:50,l:45}}[e];return`hsl(${t.h}, ${t.s}%, ${t.l}%)`}function Hf(e){let{viewport:t}=Wu(),n=O(()=>qu(Bf(e.spans))),r=O(()=>{let t=new Map;for(let n of e.spans)t.set(n.id,n.kind);return t}),i=O(()=>new Set(e.spans.filter(Tc).map(e=>e.id))),a=O(()=>new Map(e.spans.map(e=>[e.id,e.events]))),o=O(()=>n().spans.filter(e=>zu(e.startOffset,e.startOffset+e.duration,t()))),s=()=>n().totalRows*28,c=()=>e.spans.length===0;return(()=>{var t=Lf();return t.firstChild,H(t,F(R,{get when(){return!c()},get fallback(){return Rf()},get children(){var t=If(),n=t.firstChild;return H(n,F(L,{get each(){return o()},children:t=>{let n=r().get(t.id)??`internal`,o=i().has(t.id);return F(Nd,{get id(){return t.id},get name(){return t.name},get startOffset(){return t.startOffset},get duration(){return t.duration},get row(){return t.row},get color(){return o?zf:Vf(n)},isError:o,get events(){return a().get(t.id)},get onHover(){return e.onSpanHover},get matchedSpanIds(){return e.matchedSpanIds},get hoveredSearchSpanId(){return e.hoveredSearchSpanId}})}})),E(e=>V(n,`height`,`${s()}px`)),t}}),null),t})()}var Uf=z(`<div class="absolute inset-0 bg-white/80 flex items-center justify-center z-50"><div class=text-center><div class="text-gray-600 mb-2">Loading trace data...</div><div class="mx-auto mt-3 h-6 w-6 rounded-full border-2 border-gray-300 border-t-blue-500 animate-spin">`);function Wf(){return Uf()}var Gf=z(`<div>`);function Kf(e){return(()=>{var t=Gf();return H(t,()=>e.title),E(n=>{var r=`flex-shrink-0 px-3 py-2 border-b border-gray-200 text-xs font-semibold uppercase tracking-wide ${e.disabled?`text-gray-400 bg-gray-100 cursor-not-allowed`:`text-gray-500`}`,i=e.disabled?e.disabledTooltip:void 0;return r!==n.e&<(t,n.e=r),i!==n.t&&B(t,`title`,n.t=i),n},{e:void 0,t:void 0}),t})()}var qf=z(`<div class="h-full flex flex-col bg-gray-50 overflow-hidden"role=region aria-label="Steps Timeline"><div class="flex-shrink-0 px-3 py-2 border-b border-gray-200 text-xs font-semibold text-gray-500 uppercase tracking-wide">Steps Timeline</div><div class="flex-1 min-h-0 overflow-y-auto overflow-x-hidden py-3"role=list><div class=relative style=margin-left:var(--timeline-plot-inset);width:var(--timeline-plot-width)>`);function Jf(e){return e.map(e=>({id:e.id,name:e.title,startOffset:e.startOffsetMs,duration:e.durationMs,parentId:e.parentId}))}function Yf(e){let t=new Map,n=new Map;for(let t of e)n.set(t.id,t);let r=e=>{if(t.has(e.id))return t.get(e.id);if(e.parentId===null)return t.set(e.id,0),0;let i=n.get(e.parentId);if(!i)return t.set(e.id,0),0;let a=r(i)+1;return t.set(e.id,a),a};for(let t of e)r(t);return t}var Xf=`#dc2626`;function Zf(e){let{viewport:t}=Wu(),n=O(()=>qu(Jf(e.steps))),r=O(()=>Yf(e.steps)),i=O(()=>new Map(e.steps.map(e=>[e.id,e]))),a=O(()=>new Set(e.steps.filter(Tc).map(e=>e.id))),o=O(()=>n().spans.filter(e=>zu(e.startOffset,e.startOffset+e.duration,t()))),s=()=>n().totalRows*28;return(()=>{var t=qf(),n=t.firstChild.nextSibling.firstChild;return H(n,F(L,{get each(){return o()},children:t=>{let n=r().get(t.id)??0,o=i().get(t.id),s=a().has(t.id);return F(Nd,{get id(){return t.id},get name(){return t.name},get startOffset(){return t.startOffset},get duration(){return t.duration},get row(){return t.row},get color(){return s?Xf:o?Cf(o,n):bf},isError:s,get onHover(){return e.onStepHover},get matchedSpanIds(){return e.matchedSpanIds},get hoveredSearchSpanId(){return e.hoveredSearchSpanId}})}})),E(e=>V(n,`height`,`${s()}px`)),t})()}var Qf=le();function $f(e){let{viewport:t}=Wu(),[n,r]=w(`hover`),[i,a]=w(null),[o,s]=w(null),[c,l]=w(null,{equals:(e,t)=>e?.type===t?.type&&e?.id===t?.id}),[u,d]=w(null),f=()=>{let e=i();return e===null?null:Lu(e,t())},p=()=>{let e=o();return e===null?null:Iu(e,t())},m=O(()=>{let t=f();return t===null?null:Ud(t,e.steps(),e.spans(),e.screenshots(),e.testStartTimeMs(),c()?.type===`screenshot`?void 0:c()?.id)}),h=O(()=>{let t=o();return t===null?null:Ud(t,e.steps(),e.spans(),e.screenshots(),e.testStartTimeMs(),u()?.type===`screenshot`?void 0:u()?.id)}),g=()=>{switch(n()){case`hover`:return f();case`locked`:return o();case`search-override`:return f()}},_=()=>{switch(n()){case`hover`:return ep(m(),c(),e.screenshots(),f(),e.testStartTimeMs());case`locked`:return ep(h(),u(),e.screenshots(),o(),e.testStartTimeMs());case`search-override`:return ep(m(),c(),e.screenshots(),f(),e.testStartTimeMs())}},v={mode:n,hoverPosition:i,setHoverPosition:a,lockedPosition:p,lockedTimeMs:o,lock:(e,t)=>{r(`locked`),s(e),d(t)},unlock:()=>{r(`hover`),s(null),d(null)},enterSearchOverride:()=>{n()===`locked`&&r(`search-override`)},exitSearchOverride:()=>{n()===`search-override`&&r(`locked`)},hoveredElement:c,setHoveredElement:l,lockedElement:u,displayTimeMs:g,displayElements:_,displayFocusedElement:()=>{let t;switch(n()){case`hover`:t=c();break;case`locked`:t=u();break;case`search-override`:t=c();break}if(t?.type!==`screenshot`)return t;let r=_()?.screenshot,i=e.screenshots().find(e=>e.url===t.id);return r&&i&&Hd(r,i)?t:null}};return F(Qf.Provider,{value:v,get children(){return e.children}})}function ep(e,t,n,r,i){if(!e||t?.type!==`screenshot`||r===null)return e;let a=n.find(e=>e.url===t.id);if(!a)return e;let o=i+r,s=Vd(n.filter(e=>Hd(e,a)),o);return{...e,screenshot:s??e.screenshot}}function tp(){let e=ue(Qf);if(!e)throw Error(`useHoverContext must be used within a HoverProvider`);return e}function np(e){return e.replace(/[._]/g,` `).toLowerCase()}function rp(e){return e.replace(/:/g,``).replace(/\s+/g,` `).trim().toLowerCase()}var ip=(e,t)=>e>t?1:e<t?-1:0,ap=1/0,op=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),sp=`eexxaacctt`,cp=/\p{P}/gu,lp=`A-Z`,up=`a-z`,dp=[`en`,{numeric:!0,sensitivity:`base`}],fp=(e,t,n)=>e.replace(lp,t).replace(up,n),pp={unicode:!1,alpha:null,interSplit:`[^A-Za-z\\d']+`,intraSplit:`[a-z][A-Z]`,interBound:`[^A-Za-z\\d]`,intraBound:`[A-Za-z]\\d|\\d[A-Za-z]|[a-z][A-Z]`,interLft:0,interRgt:0,interChars:`.`,interIns:ap,intraChars:`[a-z\\d']`,intraIns:null,intraContr:`'[a-z]{1,2}\\b`,intraMode:0,intraSlice:[1,ap],intraSub:null,intraTrn:null,intraDel:null,intraFilt:(e,t,n)=>!0,toUpper:e=>e.toLocaleUpperCase(),toLower:e=>e.toLocaleLowerCase(),compare:null,sort:(e,t,n,r=ip)=>{let{idx:i,chars:a,terms:o,interLft2:s,interLft1:c,start:l,intraIns:u,interIns:d,cases:f}=e;return i.map((e,t)=>t).sort((e,n)=>a[n]-a[e]||u[e]-u[n]||o[n]+s[n]+.5*c[n]-(o[e]+s[e]+.5*c[e])||d[e]-d[n]||l[e]-l[n]||f[n]-f[e]||r(t[i[e]],t[i[n]]))}},mp=(e,t)=>t==0?``:t==1?e+`??`:t==ap?e+`*?`:e+`{0,${t}}?`,hp=`(?:\\b|_)`;function gp(e){e=Object.assign({},pp,e);let{unicode:t,interLft:n,interRgt:r,intraMode:i,intraSlice:a,intraIns:o,intraSub:s,intraTrn:c,intraDel:l,intraContr:u,intraSplit:d,interSplit:f,intraBound:p,interBound:m,intraChars:h,toUpper:g,toLower:_,compare:v}=e;o??=i,s??=i,c??=i,l??=i,v??=typeof Intl>`u`?ip:new Intl.Collator(...dp).compare;let y=e.letters??e.alpha;if(y!=null){let e=g(y),t=_(y);f=fp(f,e,t),d=fp(d,e,t),m=fp(m,e,t),p=fp(p,e,t),h=fp(h,e,t),u=fp(u,e,t)}let b=t?`u`:``,x=`".+?"`,S=RegExp(x,`gi`+b),C=RegExp(`(?:\\s+|^)-(?:${h}+|${x})`,`gi`+b),{intraRules:w}=e;w??=e=>{let t=pp.intraSlice,n=0,r=0,i=0,u=0;if(/[^\d]/.test(e)){let d=e.length;d<=4?d>=3&&(i=Math.min(c,1),d==4&&(n=Math.min(o,1))):(t=a,n=o,r=s,i=c,u=l)}return{intraSlice:t,intraIns:n,intraSub:r,intraTrn:i,intraDel:u}};let T=!!d,E=new RegExp(d,`g`+b),D=new RegExp(f,`g`+b),O=RegExp(`^`+f+`|`+f+`$`,`g`+b),ee=new RegExp(u,`gi`+b),k=(e,t=!1)=>{let n=[];e=e.replace(S,e=>(n.push(e),sp)),e=e.replace(O,``),t||(e=_(e)),T&&(e=e.replace(E,e=>e[0]+` `+e[1]));let r=0;return e.split(D).filter(e=>e!=``).map(e=>e===sp?n[r++]:e)},A=/[^\d]+|\d+/g,j=(t,a=0,s=!1)=>{let c=k(t);if(c.length==0)return[];let l=Array(c.length).fill(``);c=c.map((e,t)=>e.replace(ee,e=>(l[t]=e,``)));let u;if(i==1)u=c.map((e,t)=>{if(e[0]===`"`)return op(e.slice(1,-1));let n=``;for(let r of e.matchAll(A)){let e=r[0],{intraSlice:i,intraIns:a,intraSub:o,intraTrn:s,intraDel:c}=w(e);if(a+o+s+c==0)n+=e+l[t];else{let[r,u]=i,d=e.slice(0,r),f=e.slice(u),p=e.slice(r,u);a==1&&d.length==1&&d!=p[0]&&(d+=`(?!`+d+`)`);let m=p.length,g=[e];if(o)for(let e=0;e<m;e++)g.push(d+p.slice(0,e)+h+p.slice(e+1)+f);if(s)for(let e=0;e<m-1;e++)p[e]!=p[e+1]&&g.push(d+p.slice(0,e)+p[e+1]+p[e]+p.slice(e+2)+f);if(c)for(let e=0;e<m;e++)g.push(d+p.slice(0,e+1)+`?`+p.slice(e+1)+f);if(a){let e=mp(h,1);for(let t=0;t<m;t++)g.push(d+p.slice(0,t)+e+p.slice(t)+f)}n+=`(?:`+g.join(`|`)+`)`+l[t]}}return n});else{let e=mp(h,o);a==2&&o>0&&(e=`)(`+e+`)(`),u=c.map((t,n)=>t[0]===`"`?op(t.slice(1,-1)):t.split(``).map((e,t,n)=>(o==1&&t==0&&n.length>1&&e!=n[t+1]&&(e+=`(?!`+e+`)`),e)).join(e)+l[n])}let d=n==2?hp:``,f=r==2?hp:``,p=f+mp(e.interChars,e.interIns)+d;return a>0?s?u=d+`(`+u.join(`)`+f+`|`+d+`(`)+`)`+f:(u=`(`+u.join(`)(`+p+`)(`)+`)`,u=`(.??`+d+`)`+u+`(`+f+`.*)`):(u=u.join(p),u=d+u+f),[new RegExp(u,`i`+b),c,l]},M=(e,t,n)=>{let[r]=j(t);if(r==null)return null;let i=[];if(n!=null)for(let t=0;t<n.length;t++){let a=n[t];r.test(e[a])&&i.push(a)}else for(let t=0;t<e.length;t++)r.test(e[t])&&i.push(t);return i},te=!!p,N=new RegExp(m,b),ne=new RegExp(p,b),re=(t,i,a)=>{let[o,s,c]=j(a,1),l=k(a,!0),[u]=j(a,2),d=s.length,f=Array(d),p=Array(d);for(let e=0;e<d;e++){let t=s[e],n=l[e],r=t[0]==`"`?t.slice(1,-1):t+c[e],i=n[0]==`"`?n.slice(1,-1):n+c[e];f[e]=r,p[e]=i}let m=t.length,h=Array(m).fill(0),g={idx:Array(m),start:h.slice(),chars:h.slice(),cases:h.slice(),terms:h.slice(),interIns:h.slice(),intraIns:h.slice(),interLft2:h.slice(),interRgt2:h.slice(),interLft1:h.slice(),interRgt1:h.slice(),ranges:Array(m)},v=n==1||r==1,y=0;for(let a=0;a<t.length;a++){let s=i[t[a]],c=s.match(o),l=c.index+c[1].length,m=l,h=!1,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,ee=0,k=[];for(let t=0,i=2;t<d;t++,i+=2){let a=_(c[i]),o=f[t],u=p[t],g=o.length,y=a.length,A=a==o;if(c[i]==u&&D++,!A&&c[i+1].length>=g){let e=_(c[i+1]).indexOf(o);e>-1&&(k.push(m,y,e,g),m+=ie(c,i,e,g),a=o,y=g,A=!0,t==0&&(l=m))}if(v||A){let e=m-1,u=m+y,d=!1,f=!1;if(e==-1||N.test(s[e]))A&&x++,d=!0;else{if(n==2){h=!0;break}if(te&&ne.test(s[e]+s[e+1]))A&&S++,d=!0;else if(n==1){let e=c[i+1],n=m+y;if(e.length>=g){let r=0,u=!1,f=new RegExp(o,`ig`+b),p;for(;p=f.exec(e);){r=p.index;let e=n+r,t=e-1;if(t==-1||N.test(s[t])){x++,u=!0;break}else if(ne.test(s[t]+s[e])){S++,u=!0;break}}u&&(d=!0,k.push(m,y,r,g),m+=ie(c,i,r,g),a=o,y=g,A=!0,t==0&&(l=m))}if(!d){h=!0;break}}}if(u==s.length||N.test(s[u]))A&&C++,f=!0;else{if(r==2){h=!0;break}if(te&&ne.test(s[u-1]+s[u]))A&&w++,f=!0;else if(r==1){h=!0;break}}A&&(T+=g,d&&f&&E++)}if(y>g&&(ee+=y-g),t>0&&(O+=c[i-1].length),!e.intraFilt(o,a,m)){h=!0;break}t<d-1&&(m+=y+c[i+1].length)}if(!h){g.idx[y]=t[a],g.interLft2[y]=x,g.interLft1[y]=S,g.interRgt2[y]=C,g.interRgt1[y]=w,g.chars[y]=T,g.terms[y]=E,g.cases[y]=D,g.interIns[y]=O,g.intraIns[y]=ee,g.start[y]=l;let e=s.match(u),n=e.index+e[1].length,r=k.length,i=r>0?0:1/0,o=r-4;for(let t=2;t<e.length;){let r=e[t].length;if(i<=o&&k[i]==n){let r=k[i+1],a=k[i+2],o=k[i+3],s=t,c=``;for(let t=0;t<r;s++)c+=e[s],t+=e[s].length;e.splice(t,s-t,c),n+=ie(e,t,a,o),i+=4}else n+=r,t++}n=e.index+e[1].length;let c=g.ranges[y]=[],d=n,f=n;for(let t=2;t<e.length;t++){let r=e[t].length;n+=r,t%2==0?f=n:r>0&&(c.push(d,f),d=f=n)}f>d&&c.push(d,f),y++}}if(y<t.length)for(let e in g)g[e]=g[e].slice(0,y);return g},ie=(e,t,n,r)=>{let i=e[t]+e[t+1].slice(0,n);return e[t-1]+=i,e[t]=e[t+1].slice(n,n+r),e[t+1]=e[t+1].slice(n+r),i.length},ae=(t,n,r,i=1e3,a)=>{r=r?r===!0?5:r:0;let o=null,s=null,c=[];n=n.replace(C,e=>{let t=e.trim().slice(1);return t=t[0]===`"`?op(t.slice(1,-1)):t.replace(cp,``),t!=``&&c.push(t),``});let l=k(n),u;if(c.length>0){if(u=new RegExp(c.join(`|`),`i`+b),l.length==0){let e=[];for(let n=0;n<t.length;n++)u.test(t[n])||e.push(n);return[e,null,null]}}else if(l.length==0)return[null,null,null];if(r>0){let e=k(n);if(e.length>1){let n=e.slice().sort((e,t)=>t.length-e.length);for(let e=0;e<n.length;e++){if(a?.length==0)return[[],null,null];a=M(t,n[e],a)}if(e.length>r)return[a,null,null];o=vp(e).map(e=>e.join(` `)),s=[];let i=new Set;for(let e=0;e<o.length;e++)if(i.size<a.length){let n=a.filter(e=>!i.has(e)),r=M(t,o[e],n);for(let e=0;e<r.length;e++)i.add(r[e]);s.push(r)}else s.push([])}}o??(o=[n],s=[a?.length>0?a:M(t,n)]);let d=null,f=null;if(c.length>0&&(s=s.map(e=>e.filter(e=>!u.test(t[e])))),s.reduce((e,t)=>e+t.length,0)<=i){d={},f=[];for(let n=0;n<s.length;n++){let r=s[n];if(r==null||r.length==0)continue;let i=o[n],a=re(r,t,i),c=e.sort(a,t,i,v);if(n>0)for(let e=0;e<c.length;e++)c[e]+=f.length;for(let e in a)d[e]=(d[e]??[]).concat(a[e]);f=f.concat(c)}}return[[].concat(...s),d,f]};return{search:(...e)=>ae(...e),split:k,filter:M,info:re,sort:e.sort}}var _p=(()=>{let e={A:`ÁÀÃÂÄĄĂÅ`,a:`áàãâäąăå`,E:`ÉÈÊËĖĚ`,e:`éèêëęě`,I:`ÍÌÎÏĮİ`,i:`íìîïįı`,O:`ÓÒÔÕÖ`,o:`óòôõö`,U:`ÚÙÛÜŪŲŮŰ`,u:`úùûüūųůű`,C:`ÇČĆ`,c:`çčć`,D:`Ď`,d:`ď`,G:`Ğ`,g:`ğ`,L:`Ł`,l:`ł`,N:`ÑŃŇ`,n:`ñńň`,S:`ŠŚȘŞ`,s:`šśșş`,T:`ŢȚŤ`,t:`ţțť`,Y:`Ý`,y:`ý`,Z:`ŻŹŽ`,z:`żźž`},t={},n=``;for(let r in e)e[r].split(``).forEach(e=>{n+=e,t[e]=r});let r=RegExp(`[${n}]`,`g`),i=e=>t[e];return e=>{if(typeof e==`string`)return e.replace(r,i);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=e[n].replace(r,i);return t}})();function vp(e){e=e.slice();let t=e.length,n=[e.slice()],r=Array(t).fill(0),i=1,a,o;for(;i<t;)r[i]<i?(a=i%2&&r[i],o=e[i],e[i]=e[a],e[a]=o,++r[i],i=1,n.push(e.slice())):(r[i]=0,++i);return n}var yp=(e,t)=>t?`<mark>${e}</mark>`:e,bp=(e,t)=>e+t;function xp(e,t,n=yp,r=``,i=bp){r=i(r,n(e.substring(0,t[0]),!1))??r;for(let a=0;a<t.length;a+=2){let o=t[a],s=t[a+1];r=i(r,n(e.substring(o,s),!0))??r,a<t.length-3&&(r=i(r,n(e.substring(t[a+1],t[a+2]),!1))??r)}return r=i(r,n(e.substring(t[t.length-1]),!1))??r,r}gp.latinize=_p,gp.permute=e=>vp([...Array(e.length).keys()]).sort((e,t)=>{for(let n=0;n<e.length;n++)if(e[n]!=t[n])return e[n]-t[n];return 0}).map(t=>t.map(t=>e[t])),gp.highlight=xp;function Sp(e){let t=[];for(let n of e){for(let[e,r]of Object.entries(n.attributes)){let i=np(e),a=String(r),o=`${i} ${a}`.toLowerCase();t.push({spanId:n.id,key:e,value:a,searchText:o})}let e=[{key:`kind`,value:n.kind},{key:`name`,value:n.name},{key:`title`,value:n.title},{key:`serviceName`,value:n.serviceName}];for(let{key:r,value:i}of e){let e=`${np(r)} ${i}`.toLowerCase();t.push({spanId:n.id,key:r,value:i,searchText:e})}}return t}function Cp(e,t,n,r){let i=rp(n);if(!i)return[];let a=new gp({intraMode:1,intraIns:1,intraSub:1,intraTrn:1,intraDel:1}),o=a.filter(t,i);if(!o||o.length===0)return[];let s=a.info(o,t,i),c=a.sort(s,t,i),l=new Map(r.map(e=>[e.id,e])),u=[];for(let t of c){let n=e[o[t]],r=l.get(n.spanId);if(!r)continue;let i=s.ranges[t],a=[];for(let e=0;e<i.length;e+=2)a.push([i[e],i[e+1]]);u.push({spanId:n.spanId,spanName:r.name,spanTitle:r.title,key:n.key,value:n.value,searchText:n.searchText,ranges:a})}return u}function wp(e){return e.map(e=>e.searchText)}var Tp=le(),Ep=e=>{let[t,n]=w(``),r=O(()=>Sp(e.spans())),i=O(()=>wp(r())),a=O(()=>{let n=t();return n?Cp(r(),i(),n,e.spans()):[]}),o={query:t,setQuery:n,clearSearch:()=>{n(``)},results:a,matchedSpanIds:O(()=>{let e=a();return new Set(e.map(e=>e.spanId))}),matchedAttributes:O(()=>{let e=a(),t=new Map;for(let n of e){let e=t.get(n.spanId);e?e.add(n.key):t.set(n.spanId,new Set([n.key]))}return t})};return F(Tp.Provider,{value:o,get children(){return e.children}})};function Dp(){let e=ue(Tp);if(!e)throw Error(`useSearch must be used within a SearchProvider`);return e}function Op(e){if(e.length===0)return null;let t=e.find(t=>t.name===`playwright.test`&&!e.some(e=>e.id===t.parentId));if(!t)return null;let n=e.filter(e=>e.parentId===t.id),r=n.find(e=>e.title.toLowerCase()===`before hooks`),i=n.find(e=>e.title.toLowerCase()===`after hooks`);if(!r&&!i)return null;let a=[],o=t.startOffsetMs,s=t.startOffsetMs+t.durationMs;r&&a.push({type:`before-hooks`,startMs:r.startOffsetMs,endMs:r.startOffsetMs+r.durationMs,label:`Before Hooks`});let c=r?r.startOffsetMs+r.durationMs:o,l=i?i.startOffsetMs:s;return l>c&&a.push({type:`test-body`,startMs:c,endMs:l,label:`Test Body`}),i&&a.push({type:`after-hooks`,startMs:i.startOffsetMs,endMs:i.startOffsetMs+i.durationMs,label:`After Hooks`}),a}function kp(e){return e?e.find(e=>e.type===`test-body`)??null:null}var Ap=z(`<div style=height:100%;width:100%>`),jp=z(`<div style=flex-shrink:0;overflow:hidden>`),Mp=z(`<div role=separator tabindex=0>`);function Np(e){let[t,n]=w((()=>{let t={};for(let n of e.panels)t[n.id]=n.initialSize;return t})()),[r,i]=w(null),a,o=()=>e.direction===`horizontal`,s=t=>r=>{r.preventDefault(),i(t);let s=r=>{if(!a)return;let i=a.getBoundingClientRect(),s=o()?i.width:i.height,c=(o()?r.clientX-i.left:r.clientY-i.top)/s*100;n(n=>{let r=e.panels,i={...n},a=0;for(let e=0;e<=t;e++)a+=n[r[e].id];let o=0;for(let e=0;e<=t+1;e++)o+=n[r[e].id];let s=c-a,l=r[t],u=r[t+1],d=l.minSize??5,f=u.minSize??5,p=n[l.id]+s,m=n[u.id]-s;return p<d&&(m-=d-p,p=d),m<f&&(p-=f-m,m=f),p=Math.max(d,p),m=Math.max(f,m),i[l.id]=p,i[u.id]=m,i})},c=()=>{i(null),document.removeEventListener(`mousemove`,s),document.removeEventListener(`mouseup`,c)};document.addEventListener(`mousemove`,s),document.addEventListener(`mouseup`,c)};return(()=>{var n=Ap(),i=a;return typeof i==`function`?mt(i,n):a=n,H(n,F(L,{get each(){return e.panels},children:(n,i)=>[(()=>{var e=jp();return H(e,()=>n.content),E(r=>ft(e,{[o()?`width`:`height`]:`${t()[n.id]}%`},r)),e})(),nt(()=>nt(()=>i()<e.panels.length-1)()&&(()=>{var e=Mp();return ut(e,`mousedown`,s(i()),!0),E(a=>{var s=o()?`vertical`:`horizontal`,c=Math.round(t()[n.id]),l=`
|
|
3
|
-
${o()?`w-1 cursor-col-resize hover:bg-blue-400/50`:`h-1 cursor-row-resize hover:bg-blue-400/50`}
|
|
4
|
-
${r()===i()?`bg-blue-500`:`bg-gray-300`}
|
|
5
|
-
flex-shrink-0 transition-colors
|
|
6
|
-
`;return s!==a.e&&B(e,`aria-orientation`,a.e=s),c!==a.t&&B(e,`aria-valuenow`,a.t=c),l!==a.a&<(e,a.a=l),a},{e:void 0,t:void 0,a:void 0}),e})())]})),E(()=>lt(n,`flex ${o()?`flex-row`:`flex-col`} ${e.class??``}`)),n})()}ot([`mousedown`]);var Pp=[`steps`,`browser`,`external`];function Fp(e){let t=Pp.filter(t=>e[t]);return t.length===0?{}:t.length===1?{[t[0]]:100}:t.length===3?{steps:100/3,browser:100/3,external:100/3}:e.steps&&e.browser?{steps:40,browser:60}:{[t[0]]:50,[t[1]]:50}}var Ip=z(`<div style=height:100%;width:100%><div style=flex-shrink:0;overflow:hidden></div><div role=separator tabindex=0></div><div style=flex-shrink:0;overflow:hidden>`);function Lp(e){let t=()=>e.initialFirstPanelSize??50,n=e.minFirstPanelSize??10,r=e.maxFirstPanelSize??90,[i,a]=w(),o=()=>i()??t(),[s,c]=w(!1),l,u=t=>{t.preventDefault(),c(!0);let i=t=>{if(!l)return;let i=l.getBoundingClientRect(),o;o=e.direction===`horizontal`?(t.clientX-i.left)/i.width*100:(t.clientY-i.top)/i.height*100,o=Math.max(n,Math.min(r,o)),a(o)},o=()=>{c(!1),document.removeEventListener(`mousemove`,i),document.removeEventListener(`mouseup`,o)};document.addEventListener(`mousemove`,i),document.addEventListener(`mouseup`,o)},d=()=>e.direction===`horizontal`;return(()=>{var t=Ip(),i=t.firstChild,a=i.nextSibling,c=a.nextSibling,f=l;return typeof f==`function`?mt(f,t):l=t,H(i,()=>e.firstPanel),a.$$mousedown=u,B(a,`aria-valuemin`,n),B(a,`aria-valuemax`,r),H(c,()=>e.secondPanel),E(n=>{var r=`flex ${d()?`flex-row`:`flex-col`} ${e.class??``}`,l={[d()?`width`:`height`]:`${o()}%`},u=d()?`vertical`:`horizontal`,f=Math.round(o()),p=`
|
|
7
|
-
${d()?`w-1 cursor-col-resize hover:bg-blue-400/50`:`h-1 cursor-row-resize hover:bg-blue-400/50`}
|
|
8
|
-
${s()?`bg-blue-500`:`bg-gray-300`}
|
|
9
|
-
flex-shrink-0 transition-colors
|
|
10
|
-
`,m={[d()?`width`:`height`]:`${100-o()}%`};return r!==n.e&<(t,n.e=r),n.t=ft(i,l,n.t),u!==n.a&&B(a,`aria-orientation`,n.a=u),f!==n.o&&B(a,`aria-valuenow`,n.o=f),p!==n.i&<(a,n.i=p),n.n=ft(c,m,n.n),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})()}ot([`mousedown`]);function Rp(e,t,n){if(t<=0)return[];if(e.length===0)return Array(t).fill(null);let r=[...e].sort((e,t)=>e.timestamp-t.timestamp),i=n??{startMs:r[0].timestamp,endMs:r[r.length-1].timestamp},a=Math.max(0,i.endMs-i.startMs)/t,o=[],s=0,c=null;for(let e=0;e<t;e++){let t=i.startMs+e*a;for(;s<r.length&&r[s].timestamp<=t;)c=r[s++];o.push(c)}return o}function zp(e){return{startMs:e.visibleStartMs,endMs:e.visibleEndMs}}var Bp=z(`<div class="flex gap-2 h-full">`),Vp=z(`<div class="h-full bg-gray-50 overflow-y-auto overflow-x-hidden p-2"role=region aria-label=Screenshots><div class="flex flex-col gap-2 h-full">`),Hp=z(`<div aria-hidden=true data-testid=screenshot-hover-preview class="fixed z-50 pointer-events-none rounded-lg ring-1 ring-gray-300 bg-white shadow-xl overflow-hidden"><img alt class="w-full h-full object-contain">`),Up=z(`<div class="flex items-center justify-center w-full text-gray-400 text-sm">Loading screenshots...`),Wp=z(`<div class="flex-shrink-0 h-full aspect-video bg-white rounded border border-gray-200 overflow-hidden shadow-sm"><div class="h-full w-full animate-pulse bg-gradient-to-br from-gray-100 via-gray-200 to-gray-100">`),Gp=z(`<div class="flex items-center justify-center w-full text-gray-400 text-sm">Resize panel to view screenshots`),Kp=z(`<div class="flex items-center justify-center w-full text-gray-400 text-sm">`),qp=z(`<div class="flex items-center justify-center w-full text-gray-400 text-sm">No screenshots in this time range`),Jp=z(`<div class="flex gap-2 flex-shrink-0 min-h-0"data-testid=screenshot-row>`),Yp=z(`<div class="flex-shrink-0 h-full aspect-video">`),Xp=z(`<div class="flex-shrink-0 h-full aspect-video bg-white rounded border border-gray-200 overflow-hidden shadow-sm"><img class="w-full h-full object-contain select-none"loading=lazy>`,!0,!1,!1),Zp=8,Qp=16,$p=16/9;function em(e){let t,[n,r]=w(null),i=()=>r(null),a=new Map,o=new Map;D(()=>{e.previewEnabled||i()});let s=(s,c)=>{if(!e.previewEnabled)return i();let l=t?.closest(`main`),u=l?.getBoundingClientRect(),d=Math.max(0,u?.left??0)+12,f=Math.min(window.innerWidth,u?.right??window.innerWidth)-12,p=Math.min(window.innerHeight,u?.bottom??window.innerHeight)-12,m=(l?.querySelector(`[role="region"][aria-label="Steps Timeline"]`))?.getBoundingClientRect().top??t?.getBoundingClientRect().bottom;if(m===void 0)return i();let h=n(),g=a.get(c.url)??(h?.screenshot.pageId===c.pageId?h.width/h.height:o.get(c.pageId))??$p,_=Math.min(480,f-d,(p-m)*g);if(_<=0)return i();r({screenshot:c,left:Math.max(d,Math.min(s-_/2,f-_)),top:m,width:_,height:_/g,clientX:s})},c=(e,t)=>{if(e.getAttribute(`src`)!==t.url||!e.naturalWidth||!e.naturalHeight)return;let r=e.naturalWidth/e.naturalHeight;a.set(t.url,r),o.set(t.pageId,r);let i=n();i?.screenshot.url===t.url&&s(i.clientX,i.screenshot)};D(()=>{let e=e=>{e.key===`Escape`&&i()},n=e=>{(e.target===document||e.target instanceof Element&&t&&e.target.contains(t))&&i()};window.addEventListener(`resize`,i),window.addEventListener(`scroll`,n,!0),window.addEventListener(`blur`,i),window.addEventListener(`keydown`,e),N(()=>{window.removeEventListener(`resize`,i),window.removeEventListener(`scroll`,n,!0),window.removeEventListener(`blur`,i),window.removeEventListener(`keydown`,e)})});let[l,u]=w(0),[d,f]=w(null),[p,m]=w(),[h,g]=w(!0),[_,v]=w(0),y=()=>e.screenshots()??[],b=O(()=>tm(y())),x=O(()=>b().map(e=>e.pageId).join(`|`)),S=O(()=>y().map(t=>({timestamp:t.timestamp-e.testStartTimeMs,original:t}))),C=O(()=>Array.from({length:Math.max(1,l())}));D(()=>{x(),m(void 0),g(!0);let e=requestAnimationFrame(()=>{if(t){let e=t.getBoundingClientRect();f({width:e.width,height:e.height})}g(!1)});N(()=>cancelAnimationFrame(e))}),D(()=>{if(!t)return;let e=new ResizeObserver(e=>{for(let t of e){let e=t.target.getBoundingClientRect();f({width:e.width,height:e.height})}});e.observe(t),N(()=>{e.disconnect()})}),D(()=>{let e=d();if(!e||e.height<=0||e.width<=0||p()===void 0&&h())return;let t=Math.max(1,b().length),n=Math.max(0,e.height-Qp),r=p()??rm(n,t);p()===void 0&&m(r);let i=im(n,t,r);if(v(i),i<=0){u(0);return}let a=i*$p,o=Math.floor((e.width+Zp)/(a+Zp));u(Math.max(0,o))});let T=O(()=>{let t=zp(e.viewport);return b().map(e=>{let n=Rp(S().filter(t=>t.original.pageId===e.pageId),l(),t);return{...e,selectedScreenshots:n.map(e=>e?e.original:null)}})}),ee=O(()=>T().some(e=>e.selectedScreenshots.some(e=>e!==null))),k=(n,r)=>{let a=t?.closest(`[aria-label="Trace timeline"]`)?.querySelector(`[data-timeline-plot]`)?.getBoundingClientRect();if(!a||a.width<=0)return i();let o=Math.max(0,Math.min(1,(n.clientX-a.left)/a.width)),c=Vd(r.screenshots,e.testStartTimeMs+Lu(o,e.viewport));e.onScreenshotHover?.(c?.url??r.screenshots[0]?.url??null),c&&e.previewEnabled&&n.buttons===0?s(n.clientX,c):i()},A=()=>{i(),e.onScreenshotHover?.(null)};return(()=>{var r=Vp(),a=r.firstChild;r.$$mousedown=i,r.addEventListener(`mouseleave`,A);var o=t;return typeof o==`function`?mt(o,r):t=r,H(r,F(R,{get when(){return n()},children:e=>F(kt,{get children(){var t=Hp(),n=t.firstChild;return n.addEventListener(`load`,t=>c(t.currentTarget,e().screenshot)),E(r=>{var i=e().screenshot.timestamp,a=e().screenshot.pageId,o=`${e().left}px`,s=`${e().top}px`,c=`${e().width}px`,l=`${e().height}px`,u=e().screenshot.url;return i!==r.e&&B(t,`data-screenshot-timestamp`,r.e=i),a!==r.t&&B(t,`data-screenshot-page-id`,r.t=a),o!==r.a&&V(t,`left`,r.a=o),s!==r.o&&V(t,`top`,r.o=s),c!==r.i&&V(t,`width`,r.i=c),l!==r.n&&V(t,`height`,r.n=l),u!==r.s&&B(n,`src`,r.s=u),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),t}})}),a),H(a,F(R,{get when(){return nt(()=>!!e.screenshots.loading)()&&y().length===0},get children(){return F(R,{get when(){return l()>0},get fallback(){return Up()},get children(){var e=Bp();return H(e,F(L,{get each(){return C()},children:()=>Wp()})),e}})}}),null),H(a,F(R,{get when(){return!e.screenshots.loading||y().length>0},get children(){return F(R,{get when(){return l()>0},get fallback(){return F(R,{get when(){return y().length>0},get fallback(){return(()=>{var t=Kp();return H(t,()=>e.screenshots.error?`Failed to load screenshots`:`No screenshots available`),t})()},get children(){return Gp()}})},get children(){return F(R,{get when(){return ee()},get fallback(){return qp()},get children(){return F(L,{get each(){return T()},children:(e,t)=>(()=>{var n=Jp();return n.addEventListener(`mouseleave`,i),n.$$mousemove=t=>k(t,e),n.addEventListener(`mouseenter`,t=>k(t,e)),H(n,F(L,{get each(){return e.selectedScreenshots},children:e=>F(R,{when:e,get fallback(){return Yp()},children:e=>(()=>{var t=Xp(),n=t.firstChild;return n.addEventListener(`load`,t=>c(t.currentTarget,e())),B(n,`draggable`,!1),E(r=>{var i=e().timestamp,a=e().pageId,o=e().url,s=`Screenshot at ${e().timestamp}`;return i!==r.e&&B(t,`data-screenshot-timestamp`,r.e=i),a!==r.t&&B(t,`data-screenshot-page-id`,r.t=a),o!==r.a&&B(n,`src`,r.a=o),s!==r.o&&B(n,`alt`,r.o=s),r},{e:void 0,t:void 0,a:void 0,o:void 0}),t})()})})),E(r=>{var i=`${_()}px`,a=t(),o=e.pageId,s=e.screenshots.length;return i!==r.e&&V(n,`height`,r.e=i),a!==r.t&&B(n,`data-screenshot-row-index`,r.t=a),o!==r.a&&B(n,`data-screenshot-page-id`,r.a=o),s!==r.o&&B(n,`data-screenshot-source-count`,r.o=s),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n})()})}})}})}}),null),r})()}function tm(e){let t=new Map;for(let n of e){let e=t.get(n.pageId)??{pageId:n.pageId,screenshots:[]};e.screenshots.push(n),t.set(n.pageId,e)}return Array.from(t.values()).map(e=>({...e,screenshots:e.screenshots.sort((e,t)=>e.timestamp-t.timestamp)}))}function nm(e){return e<=1?1:e===2?2:2.5}function rm(e,t){let n=nm(t),r=Math.max(0,Math.ceil(n)-1);return Math.max(0,(e-r*Zp)/n)}function im(e,t,n){let r=n*t+Zp*(t-1);return e<n?e:e>r?Math.max(0,(e-Zp*(t-1))/t):n}ot([`mousedown`,`mousemove`]);function am(e,t){switch(t){case`start`:return e.startOffsetMs;case`end`:return e.startOffsetMs+e.durationMs}}var[om,sm]=Z({hookName:`useRenderStrategyContext`,providerName:`<RenderStrategyProvider />`}),cm=e=>U()(e,[`lazyMount`,`unmountOnExit`]);function lm(e,t){let{state:n,send:r,context:i}=e,a=n.matches(`mounted`,`unmountSuspended`);return{skip:!i.get(`initial`),present:a,setNode(e){e&&r({type:`NODE.SET`,node:e})},unmount(){r({type:`UNMOUNT`})}}}var um=sr({props({props:e}){return{...e,present:!!e.present}},initialState({prop:e}){return e(`present`)?`mounted`:`unmounted`},refs(){return{node:null,styles:null}},context({bindable:e}){return{unmountAnimationName:e(()=>({defaultValue:null})),prevAnimationName:e(()=>({defaultValue:null})),present:e(()=>({defaultValue:!1})),initial:e(()=>({sync:!0,defaultValue:!1}))}},exit:[`cleanupNode`],watch({track:e,prop:t,send:n}){e([()=>t(`present`)],()=>{n({type:`PRESENCE.CHANGED`})})},on:{"NODE.SET":{actions:[`setupNode`]},"PRESENCE.CHANGED":{actions:[`setInitial`,`syncPresence`]}},states:{mounted:{on:{UNMOUNT:{target:`unmounted`,actions:[`clearPrevAnimationName`,`invokeOnExitComplete`]},"UNMOUNT.SUSPEND":{target:`unmountSuspended`}}},unmountSuspended:{effects:[`trackAnimationEvents`],on:{MOUNT:{target:`mounted`,actions:[`setPrevAnimationName`]},UNMOUNT:{target:`unmounted`,actions:[`clearPrevAnimationName`,`invokeOnExitComplete`]}}},unmounted:{on:{MOUNT:{target:`mounted`,actions:[`setPrevAnimationName`]}}}},implementations:{actions:{setInitial:({context:e})=>{e.get(`initial`)||queueMicrotask(()=>{e.set(`initial`,!0)})},invokeOnExitComplete:({prop:e,refs:t})=>{e(`onExitComplete`)?.();let n=t.get(`node`);if(!n)return;let r=new(K(n)).CustomEvent(`exitcomplete`,{bubbles:!1});n.dispatchEvent(r)},setupNode:({refs:e,event:t})=>{e.get(`node`)!==t.node&&(e.set(`node`,t.node),e.set(`styles`,Vr(t.node)))},cleanupNode:({refs:e})=>{e.set(`node`,null),e.set(`styles`,null)},syncPresence:({context:e,refs:t,send:n,prop:r})=>{let i=r(`present`);if(i)return n({type:`MOUNT`,src:`presence.changed`});let a=t.get(`node`);if(!i&&a?.ownerDocument.visibilityState===`hidden`)return n({type:`UNMOUNT`,src:`visibilitychange`});J(()=>{if(r(`present`))return;let i=dm(t.get(`styles`));e.set(`unmountAnimationName`,i),i===`none`||i===e.get(`prevAnimationName`)||t.get(`styles`)?.display===`none`||t.get(`styles`)?.animationDuration===`0s`?n({type:`UNMOUNT`,src:`presence.changed`}):n({type:`UNMOUNT.SUSPEND`})})},setPrevAnimationName:({context:e,refs:t})=>{J(()=>{e.set(`prevAnimationName`,dm(t.get(`styles`)))})},clearPrevAnimationName:({context:e})=>{e.set(`prevAnimationName`,null)}},effects:{trackAnimationEvents:({context:e,refs:t,send:n,prop:r})=>{let i=t.get(`node`);if(!i)return;let a=n=>{(n.composedPath?.()?.[0]??n.target)===i&&e.set(`prevAnimationName`,dm(t.get(`styles`)))},o=a=>{let o=dm(t.get(`styles`));q(a)===i&&o===e.get(`unmountAnimationName`)&&!r(`present`)&&n({type:`UNMOUNT`,src:`animationend`})},s=e=>{q(e)===i&&!r(`present`)&&n({type:`UNMOUNT`,src:`animationcancel`})};i.addEventListener(`animationstart`,a),i.addEventListener(`animationcancel`,s),i.addEventListener(`animationend`,o);let c=ia(i,{animationFillMode:`forwards`});return()=>{i.removeEventListener(`animationstart`,a),i.removeEventListener(`animationcancel`,s),i.removeEventListener(`animationend`,o),Li(()=>c())}}}}});function dm(e){return e?.animationName||`none`}var fm=e=>{let[t,n]=cm(Bt(e)),[r,i]=w(!1),a=_a(um,e),o=O(()=>lm(a,Ta));D(()=>{o().present&&i(!0)});let s=e=>{e&&a.send({type:`NODE.SET`,node:e})};return O(()=>({unmounted:!o().present&&!r()&&t.lazyMount||t.unmountOnExit&&!o().present&&r(),present:o().present,ref:s,presenceProps:{hidden:!o().present,"data-state":o().skip&&n.skipAnimationOnMount?void 0:n.present?`open`:`closed`}}))},pm=e=>U()(e,[`immediate`,`lazyMount`,`onExitComplete`,`present`,`skipAnimationOnMount`,`unmountOnExit`]),[mm,hm]=Z({hookName:`usePresenceContext`,providerName:`<PresenceProvider />`}),gm=Ft(`tooltip`).parts(`trigger`,`arrow`,`arrowTip`,`positioner`,`content`).build(),_m=[`top`,`right`,`bottom`,`left`],vm=Math.min,ym=Math.max,bm=Math.round,xm=Math.floor,Sm=e=>({x:e,y:e}),Cm={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function wm(e,t,n){return ym(e,vm(t,n))}function Tm(e,t){return typeof e==`function`?e(t):e}function Em(e){return e.split(`-`)[0]}function Dm(e){return e.split(`-`)[1]}function Om(e){return e===`x`?`y`:`x`}function km(e){return e===`y`?`height`:`width`}function Am(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function jm(e){return Om(Am(e))}function Mm(e,t,n){n===void 0&&(n=!1);let r=Dm(e),i=jm(e),a=km(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Vm(o)),[o,Vm(o)]}function Nm(e){let t=Vm(e);return[Pm(e),t,Pm(t)]}function Pm(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Fm=[`left`,`right`],Im=[`right`,`left`],Lm=[`top`,`bottom`],Rm=[`bottom`,`top`];function zm(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Im:Fm:t?Fm:Im;case`left`:case`right`:return t?Lm:Rm;default:return[]}}function Bm(e,t,n,r){let i=Dm(e),a=zm(Em(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Pm)))),a}function Vm(e){let t=Em(e);return Cm[t]+e.slice(t.length)}function Hm(e){return{top:0,right:0,bottom:0,left:0,...e}}function Um(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Hm(e)}function Wm(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Gm(e,t,n){let{reference:r,floating:i}=e,a=Am(t),o=jm(t),s=km(o),c=Em(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Dm(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Km(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Tm(t,e),p=Um(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Wm(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Wm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var qm=50,Jm=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Km},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Gm(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<qm&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Gm(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ym=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Tm(e,t)||{};if(l==null)return{};let d=Um(u),f={x:n,y:r},p=jm(i),m=km(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=vm(d[_],T),D=vm(d[v],T),O=E,ee=C-h[m]-D,k=C/2-h[m]/2+w,A=wm(O,k,ee),j=!c.arrow&&Dm(i)!=null&&k!==A&&a.reference[m]/2-(k<O?E:D)-h[m]/2<0,M=j?k<O?k-O:k-ee:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Xm=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Tm(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Em(r),_=Am(o),v=Em(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Vm(o)]:Nm(o)),x=p!==`none`;!d&&x&&b.push(...Bm(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Mm(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Am(t))||T.every(e=>Am(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Am(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Zm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Qm(e){return _m.some(t=>e[t]>=0)}var $m=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Tm(e,t);switch(i){case`referenceHidden`:{let e=Zm(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Qm(e)}}}case`escaped`:{let e=Zm(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Qm(e)}}}default:return{}}}}},eh=new Set([`left`,`top`]);async function th(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Em(n),s=Dm(n),c=Am(n)===`y`,l=eh.has(o)?-1:1,u=a&&c?-1:1,d=Tm(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var nh=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await th(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},rh=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Tm(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Am(Em(i)),p=Om(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=wm(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=wm(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},ih=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Tm(e,t),u={x:n,y:r},d=Am(i),f=Om(d),p=u[f],m=u[d],h=Tm(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=eh.has(Em(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ah=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Tm(e,t),u=await o.detectOverflow(t,l),d=Em(i),f=Dm(i),p=Am(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=vm(h-u[g],v),x=vm(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=ym(u.left,0),t=ym(u.right,0),n=ym(u.top,0),r=ym(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:ym(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:ym(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function oh(){return typeof window<`u`}function sh(e){return uh(e)?(e.nodeName||``).toLowerCase():`#document`}function ch(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function lh(e){return((uh(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function uh(e){return oh()?e instanceof Node||e instanceof ch(e).Node:!1}function dh(e){return oh()?e instanceof Element||e instanceof ch(e).Element:!1}function fh(e){return oh()?e instanceof HTMLElement||e instanceof ch(e).HTMLElement:!1}function ph(e){return!oh()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ch(e).ShadowRoot}function mh(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Th(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function hh(e){return/^(table|td|th)$/.test(sh(e))}function gh(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var _h=/transform|translate|scale|rotate|perspective|filter/,vh=/paint|layout|strict|content/,yh=e=>!!e&&e!==`none`,bh;function xh(e){let t=dh(e)?Th(e):e;return yh(t.transform)||yh(t.translate)||yh(t.scale)||yh(t.rotate)||yh(t.perspective)||!Ch()&&(yh(t.backdropFilter)||yh(t.filter))||_h.test(t.willChange||``)||vh.test(t.contain||``)}function Sh(e){let t=Dh(e);for(;fh(t)&&!wh(t);){if(xh(t))return t;if(gh(t))return null;t=Dh(t)}return null}function Ch(){return bh??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),bh}function wh(e){return/^(html|body|#document)$/.test(sh(e))}function Th(e){return ch(e).getComputedStyle(e)}function Eh(e){return dh(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Dh(e){if(sh(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ph(e)&&e.host||lh(e);return ph(t)?t.host:t}function Oh(e){let t=Dh(e);return wh(t)?e.ownerDocument?e.ownerDocument.body:e.body:fh(t)&&mh(t)?t:Oh(t)}function kh(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Oh(e),i=r===e.ownerDocument?.body,a=ch(r);if(i){let e=Ah(a);return t.concat(a,a.visualViewport||[],mh(r)?r:[],e&&n?kh(e):[])}else return t.concat(r,kh(r,[],n))}function Ah(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jh(e){let t=Th(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=fh(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=bm(n)!==a||bm(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Mh(e){return dh(e)?e:e.contextElement}function Nh(e){let t=Mh(e);if(!fh(t))return Sm(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=jh(t),o=(a?bm(n.width):n.width)/r,s=(a?bm(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ph=Sm(0);function Fh(e){let t=ch(e);return!Ch()||!t.visualViewport?Ph:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ih(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ch(e)?!1:t}function Lh(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Mh(e),o=Sm(1);t&&(r?dh(r)&&(o=Nh(r)):o=Nh(e));let s=Ih(a,n,r)?Fh(a):Sm(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=ch(a),t=r&&dh(r)?ch(r):r,n=e,i=Ah(n);for(;i&&r&&t!==n;){let e=Nh(i),t=i.getBoundingClientRect(),r=Th(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ch(i),i=Ah(n)}}return Wm({width:u,height:d,x:c,y:l})}function Rh(e,t){let n=Eh(e).scrollLeft;return t?t.left+n:Lh(lh(e)).left+n}function zh(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Rh(e,n),y:n.top+t.scrollTop}}function Bh(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=lh(r),s=t?gh(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Sm(1),u=Sm(0),d=fh(r);if((d||!d&&!a)&&((sh(r)!==`body`||mh(o))&&(c=Eh(r)),d)){let e=Lh(r);l=Nh(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?zh(o,c):Sm(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Vh(e){return Array.from(e.getClientRects())}function Hh(e){let t=lh(e),n=Eh(e),r=e.ownerDocument.body,i=ym(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ym(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Rh(e),s=-n.scrollTop;return Th(r).direction===`rtl`&&(o+=ym(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Uh=25;function Wh(e,t){let n=ch(e),r=lh(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ch();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Rh(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Uh&&(a-=o)}else l<=Uh&&(a+=l);return{width:a,height:o,x:s,y:c}}function Gh(e,t){let n=Lh(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=fh(e)?Nh(e):Sm(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Kh(e,t,n){let r;if(t===`viewport`)r=Wh(e,n);else if(t===`document`)r=Hh(lh(e));else if(dh(t))r=Gh(t,n);else{let n=Fh(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Wm(r)}function qh(e,t){let n=Dh(e);return n===t||!dh(n)||wh(n)?!1:Th(n).position===`fixed`||qh(n,t)}function Jh(e,t){let n=t.get(e);if(n)return n;let r=kh(e,[],!1).filter(e=>dh(e)&&sh(e)!==`body`),i=null,a=Th(e).position===`fixed`,o=a?Dh(e):e;for(;dh(o)&&!wh(o);){let t=Th(o),n=xh(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||mh(o)&&!n&&qh(e,o))?r=r.filter(e=>e!==o):i=t,o=Dh(o)}return t.set(e,r),r}function Yh(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?gh(t)?[]:Jh(t,this._c):[].concat(n),r],o=Kh(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Kh(t,a[e],i);s=ym(n.top,s),c=vm(n.right,c),l=vm(n.bottom,l),u=ym(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Xh(e){let{width:t,height:n}=jh(e);return{width:t,height:n}}function Zh(e,t,n){let r=fh(t),i=lh(t),a=n===`fixed`,o=Lh(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Sm(0);function l(){c.x=Rh(i)}if(r||!r&&!a)if((sh(t)!==`body`||mh(i))&&(s=Eh(t)),r){let e=Lh(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?zh(i,s):Sm(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Qh(e){return Th(e).position===`static`}function $h(e,t){if(!fh(e)||Th(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return lh(e)===n&&(n=n.ownerDocument.body),n}function eg(e,t){let n=ch(e);if(gh(e))return n;if(!fh(e)){let t=Dh(e);for(;t&&!wh(t);){if(dh(t)&&!Qh(t))return t;t=Dh(t)}return n}let r=$h(e,t);for(;r&&hh(r)&&Qh(r);)r=$h(r,t);return r&&wh(r)&&Qh(r)&&!xh(r)?n:r||Sh(e)||n}var tg=async function(e){let t=this.getOffsetParent||eg,n=this.getDimensions,r=await n(e.floating);return{reference:Zh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ng(e){return Th(e).direction===`rtl`}var rg={convertOffsetParentRelativeRectToViewportRelativeRect:Bh,getDocumentElement:lh,getClippingRect:Yh,getOffsetParent:eg,getElementRects:tg,getClientRects:Vh,getDimensions:Xh,getScale:Nh,isElement:dh,isRTL:ng};function ig(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ag(e,t){let n=null,r,i=lh(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=xm(d),h=xm(i.clientWidth-(u+f)),g=xm(i.clientHeight-(d+p)),_=xm(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ym(0,vm(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!ig(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function og(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Mh(e),u=i||a?[...l?kh(l):[],...t?kh(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?ag(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Lh(e):null;c&&g();function g(){let t=Lh(e);h&&!ig(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var sg=nh,cg=rh,lg=Xm,ug=ah,dg=$m,fg=Ym,pg=ih,mg=(e,t,n)=>{let r=new Map,i={platform:rg,...n},a={...i.platform,_c:r};return Jm(e,t,{...i,platform:a})};function hg(e=0,t=0,n=0,r=0){if(typeof DOMRect==`function`)return new DOMRect(e,t,n,r);let i={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...i,toJSON:()=>i}}function gg(e){if(!e)return hg();let{x:t,y:n,width:r,height:i}=e;return hg(t,n,r,i)}function _g(e,t){return{contextElement:G(e)?e:e?.contextElement,getBoundingClientRect:()=>{let n=e,r=t?.(n);return r||!n?gg(r):n.getBoundingClientRect()}}}var vg=e=>({variable:e,reference:`var(${e})`}),yg={arrowSize:vg(`--arrow-size`),arrowSizeHalf:vg(`--arrow-size-half`),arrowBg:vg(`--arrow-background`),transformOrigin:vg(`--transform-origin`),arrowOffset:vg(`--arrow-offset`)},bg=e=>e===`top`||e===`bottom`?`y`:`x`;function xg(e,t){return{name:`transformOrigin`,fn(n){let{elements:r,middlewareData:i,placement:a,rects:o,y:s}=n,c=a.split(`-`)[0],l=bg(c),u=i.arrow?.x||0,d=i.arrow?.y||0,f=t?.clientWidth||0,p=t?.clientHeight||0,m=u+f/2,h=d+p/2,g=Math.abs(i.shift?.y||0),_=o.reference.height/2,v=p/2,y=e.offset?.mainAxis??e.gutter,b=typeof y==`number`?y+v:y??v,x=g>b,S={top:`${m}px calc(100% + ${b}px)`,bottom:`${m}px ${-b}px`,left:`calc(100% + ${b}px) ${h}px`,right:`${-b}px ${h}px`}[c],C=`${m}px ${o.reference.y+_-s}px`,w=!!e.overlap&&l===`y`&&x;return r.floating.style.setProperty(yg.transformOrigin.variable,w?C:S),{data:{transformOrigin:w?C:S}}}}}var Sg={name:`rects`,fn({rects:e}){return{data:e}}},Cg=e=>{if(e)return{name:`shiftArrow`,fn({placement:t,middlewareData:n}){if(!n.arrow)return{};let{x:r,y:i}=n.arrow,a=t.split(`-`)[0];return Object.assign(e.style,{left:r==null?``:`${r}px`,top:i==null?``:`${i}px`,[a]:`calc(100% + ${yg.arrowOffset.reference})`}),{}}}};function wg(e){let[t,n]=e.split(`-`);return{side:t,align:n,hasAlign:n!=null}}function Tg(e){return e.split(`-`)[0]}var Eg={strategy:`absolute`,placement:`bottom`,listeners:!0,restoreStyles:!1,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function Dg(e,t){let n=e.devicePixelRatio||1;return Math.round(t*n)/n}function Og(e,t){return e!=null&&Math.abs(e-t)<.5}function kg(e){return typeof e==`function`?e():e===`clipping-ancestors`?`clippingAncestors`:e}function Ag(e,t,n){return fg({element:e||t.createElement(`div`),padding:n.arrowPadding})}function jg(e,t){if(!un(t.offset??t.gutter))return sg(({placement:n})=>{let r=(e?.clientHeight||0)/2,i=t.offset?.mainAxis??t.gutter,a=typeof i==`number`?i+r:i??r,{hasAlign:o}=wg(n),s=o?void 0:t.shift;return Dn({crossAxis:t.offset?.crossAxis??s,mainAxis:a,alignmentAxis:t.shift})})}function Mg(e){if(e.flip)return lg(()=>{let t=kg(e.boundary);return{...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}})}function Ng(e){if(!(!e.slide&&!e.overlap))return cg(()=>{let t=kg(e.boundary);return{...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:pg()}})}function Pg(e){if(e.sizeMiddleware===!1&&!e.sameWidth&&!e.fitViewport)return;let t,n,r,i;return ug(()=>{let a=kg(e.boundary);return{padding:e.overflowPadding,...a?{boundary:a}:void 0,apply({elements:e,rects:a,availableHeight:o,availableWidth:s}){let c=e.floating,l=Math.round(a.reference.width),u=Math.round(a.reference.height);s=Math.floor(s),o=Math.floor(o),Og(t,l)||(c.style.setProperty(`--reference-width`,`${l}px`),t=l),Og(n,u)||(c.style.setProperty(`--reference-height`,`${u}px`),n=u),Og(r,s)||(c.style.setProperty(`--available-width`,`${s}px`),r=s),Og(i,o)||(c.style.setProperty(`--available-height`,`${o}px`),i=o)}}})}function Fg(e){if(e.hideWhenDetached)return dg(()=>({strategy:`referenceHidden`,boundary:kg(e.boundary)??`clippingAncestors`}))}function Ig(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}var Lg=[`transform`,`visibility`,`pointer-events`,`--x`,`--y`,`--z-index`,`--reference-width`,`--reference-height`,`--available-width`,`--available-height`,`--transform-origin`],Rg=[`top`,`right`,`bottom`,`left`];function zg(e,t){if(!e)return bn;let n=new Map(t.map(t=>[t,e.style.getPropertyValue(t)]));return()=>{n.forEach((t,n)=>{t?e.style.setProperty(n,t):e.style.removeProperty(n)}),e.style.length===0&&e.removeAttribute(`style`)}}function Bg(e){return e==null?null:G(e)?e:typeof e==`object`&&e&&`contextElement`in e&&e.contextElement?e.contextElement:e}function Vg(e,t,n={}){let r=()=>(typeof t==`function`?t():t)??null,i=()=>{let t=typeof e==`function`?e():e;return n.getAnchorElement?.()??t},a=()=>{let e=i();return!e&&!n.getAnchorRect?null:_g(e,n.getAnchorRect)},o=Object.assign({},Eg,n),s=[],c=null,l,u;function d(e){l?.(),u?.(),c=e,l=o.restoreStyles?zg(e,Lg):void 0;let t=e.querySelector(`[data-part=arrow]`);u=o.restoreStyles?zg(t,Rg):void 0,s=[jg(t,o),Mg(o),Ng(o),Ag(t,e.ownerDocument,o),Cg(t),xg({gutter:o.gutter,offset:o.offset,overlap:o.overlap},t),Pg(o),Fg(o),Sg]}let{placement:f,strategy:p,onComplete:m,onPositioned:h}=o,g,_,v=!1,y,b,x=bn,S=Ig(o.listeners);function C(){if(!o.listeners)return;let e=i(),t=a(),n=r();!t||!n||(Bg(e)!==Bg(y)||n!==b)&&(x(),y=e,b=n,x=og(t,n,T,S))}async function w(){C();let e=r();if(!e)return;e!==c&&(d(e),v=!1);let t=a();if(!t)return;let n=await mg(t,e,{placement:f,middleware:s,strategy:p});m?.(n);let i=K(e),l=Dg(i,n.x),u=Dg(i,n.y);if(Og(g,l)||(e.style.setProperty(`--x`,`${l}px`),g=l),Og(_,u)||(e.style.setProperty(`--y`,`${u}px`),_=u),o.hideWhenDetached&&(n.middlewareData.hide?.referenceHidden?(e.style.setProperty(`visibility`,`hidden`),e.style.setProperty(`pointer-events`,`none`)):(e.style.removeProperty(`visibility`),e.style.removeProperty(`pointer-events`))),!v){let t=e.firstElementChild;t&&(e.style.setProperty(`--z-index`,Vr(t).zIndex),v=!0)}}async function T(){n.updatePosition?(await n.updatePosition({updatePosition:w,floatingElement:r()}),h?.({placed:!0})):await w()}return T(),()=>{x(),u?.(),l?.(),h?.({placed:!1})}}function Hg(e,t,n={}){let{defer:r,...i}=n,a=r?J:e=>e(),o=[];return o.push(a(()=>{o.push(Vg(e,t,i))})),()=>{o.forEach(e=>e?.())}}var Ug={bottom:`rotate(45deg)`,left:`rotate(135deg)`,top:`rotate(225deg)`,right:`rotate(315deg)`};function Wg(e={}){let{placement:t,sameWidth:n,fitViewport:r,strategy:i=`absolute`}=e;return{arrow:{position:`absolute`,width:yg.arrowSize.reference,height:yg.arrowSize.reference,[yg.arrowSizeHalf.variable]:`calc(${yg.arrowSize.reference} / 2)`,[yg.arrowOffset.variable]:`calc(${yg.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?Ug[t.split(`-`)[0]]:void 0,background:yg.arrowBg.reference,top:`0`,left:`0`,width:`100%`,height:`100%`,position:`absolute`,zIndex:`inherit`},floating:{position:i,isolation:`isolate`,minWidth:n?void 0:`max-content`,width:n?`var(--reference-width)`:void 0,maxWidth:r?`var(--available-width)`:void 0,maxHeight:r?`var(--available-height)`:void 0,pointerEvents:t?void 0:`none`,top:`0px`,left:`0px`,transform:t?`translate3d(var(--x), var(--y), 0)`:`translate3d(0, -100vh, 0)`,zIndex:`var(--z-index)`}}}var Gg=(e,t)=>{let n=e.ids?.trigger;return n==null?t?`tooltip:${e.id}:trigger:${t}`:`tooltip:${e.id}:trigger`:ln(n)?n(t):n},Kg=e=>e.ids?.content??`tooltip:${e.id}:content`,qg=e=>e.ids?.arrow??`tooltip:${e.id}:arrow`,Jg=e=>e.ids?.positioner??`tooltip:${e.id}:popper`,Yg=e=>e.getById(Gg(e)),Xg=e=>e.getById(Jg(e)),Zg=e=>qi(e.getRootNode(),`[data-scope="tooltip"][data-part="trigger"][data-ownedby="${e.id}"]`),Qg=(e,t)=>t==null?Yg(e)??Zg(e)[0]:e.getById(Gg(e,t)),$g=On({id:null,prevId:null,instant:!1});function e_(e,t){let{state:n,context:r,send:i,scope:a,prop:o,event:s}=e,c=o(`id`),l=!!o(`aria-label`),u=n.matches(`open`,`closing`),d=r.get(`triggerValue`),f=r.get(`currentPlacement`),p=f?Tg(f):void 0,m=Kg(a),h=o(`disabled`),g=Wg({...o(`positioning`),placement:f});return{open:u,setOpen(e){n.matches(`open`,`closing`)!==e&&i({type:e?`open`:`close`})},triggerValue:d,setTriggerValue(e){i({type:`triggerValue.set`,value:e??void 0})},reposition(e={}){i({type:`positioning.set`,options:e})},getTriggerProps(e={}){let{value:n}=e,r=n==null?!1:d===n,s=Gg(a,n);return t.button({...gm.trigger.attrs,id:s,"data-ownedby":a.id,"data-value":n,"data-current":W(r),dir:o(`dir`),"data-expanded":W(u),"data-state":u?`open`:`closed`,"aria-describedby":u?m:void 0,onClick(e){e.defaultPrevented||h||o(`closeOnClick`)&&i({type:u&&n!=null&&!r?`triggerValue.set`:`close`,src:`trigger.click`,value:n,triggerId:s})},onFocus(e){e.defaultPrevented||h||jo()&&i({type:u&&n!=null&&!r?`triggerValue.set`:`open`,src:`trigger.focus`,value:n,triggerId:s})},onBlur(e){e.defaultPrevented||h||c===$g.get(`id`)&&((e.relatedTarget??a.getDoc().activeElement)?.closest(`[data-ownedby="${a.id}"]`)??i({type:`close`,src:`trigger.blur`,value:n,triggerId:s}))},onPointerDown(e){e.defaultPrevented||h||fi(e)&&o(`closeOnPointerDown`)&&c===$g.get(`id`)&&i({type:`close`,src:`trigger.pointerdown`,value:n,triggerId:s})},onPointerMove(e){e.defaultPrevented||h||e.pointerType!==`touch`&&i({type:u&&n!=null&&!r?`triggerValue.set`:`pointer.move`,value:n,triggerId:s})},onPointerOver(e){e.defaultPrevented||h||e.pointerType!==`touch`&&i({type:`pointer.move`,value:n,triggerId:s})},onPointerLeave(){h||i({type:`pointer.leave`})},onPointerCancel(){h||i({type:`pointer.leave`})}})},getArrowProps(){return t.element({id:qg(a),...gm.arrow.attrs,dir:o(`dir`),style:g.arrow})},getArrowTipProps(){return t.element({...gm.arrowTip.attrs,dir:o(`dir`),style:g.arrowTip})},getPositionerProps(){return t.element({id:Jg(a),...gm.positioner.attrs,dir:o(`dir`),style:g.floating})},getContentProps(){let e=$g.get(`id`)===c,n=$g.get(`prevId`)===c,r=$g.get(`instant`)&&(u&&e||n);return t.element({...gm.content.attrs,dir:o(`dir`),hidden:!u,"data-state":u?`open`:`closed`,"data-instant":W(r),role:l?void 0:`tooltip`,id:l?void 0:m,"data-placement":f,"data-side":p,onPointerEnter(){i({type:`content.pointer.move`})},onPointerLeave(){i({type:`content.pointer.leave`})},style:{pointerEvents:o(`interactive`)?`auto`:`none`}})}}}var{and:t_,not:n_}=or(),r_=sr({initialState:({prop:e})=>e(`open`)||e(`defaultOpen`)?`open`:`closed`,props({props:e}){Mn(e,[`id`]);let t=e.closeOnClick??!0,n=e.closeOnPointerDown??t;return{openDelay:400,closeDelay:150,closeOnEscape:!0,interactive:!1,closeOnScroll:!0,disabled:!1,...e,closeOnPointerDown:n,closeOnClick:t,positioning:{placement:`bottom`,...e.positioning}}},effects:[`trackFocusVisible`,`trackStore`],context:({bindable:e,prop:t,scope:n})=>({currentPlacement:e(()=>({defaultValue:void 0})),hasPointerMoveOpened:e(()=>({defaultValue:null})),triggerValue:e(()=>({defaultValue:t(`defaultTriggerValue`)??null,value:t(`triggerValue`),onChange(e){let r=t(`onTriggerValueChange`);r&&r({value:e,triggerElement:Qg(n,e)})}}))}),watch({track:e,action:t,prop:n}){e([()=>n(`disabled`)],()=>{t([`closeIfDisabled`])}),e([()=>n(`open`)],()=>{t([`toggleVisibility`])}),e([()=>n(`triggerValue`)],()=>{t([`repositionImmediate`])})},on:{"triggerValue.set":{actions:[`setTriggerValue`,`repositionImmediate`]}},states:{closed:{entry:[`clearGlobalId`],on:{"controlled.open":{target:`open`},open:[{guard:`isOpenControlled`,actions:[`setTriggerValue`,`invokeOnOpen`]},{target:`open`,actions:[`setTriggerValue`,`invokeOnOpen`]}],"pointer.leave":{actions:[`clearPointerMoveOpened`]},"pointer.move":[{guard:t_(`noVisibleTooltip`,n_(`hasPointerMoveOpened`)),target:`opening`,actions:[`setTriggerValue`]},{guard:n_(`hasPointerMoveOpened`),target:`open`,actions:[`setPointerMoveOpened`,`invokeOnOpen`,`setTriggerValue`]}]}},opening:{effects:[`trackScroll`,`trackPointerlockChange`,`waitForOpenDelay`],on:{"after.openDelay":[{guard:`isOpenControlled`,actions:[`setPointerMoveOpened`,`invokeOnOpen`]},{target:`open`,actions:[`setPointerMoveOpened`,`invokeOnOpen`]}],"controlled.open":{target:`open`},"controlled.close":{target:`closed`},open:[{guard:`isOpenControlled`,actions:[`setTriggerValue`,`invokeOnOpen`]},{target:`open`,actions:[`setTriggerValue`,`invokeOnOpen`]}],"pointer.leave":[{guard:`isOpenControlled`,actions:[`clearPointerMoveOpened`,`invokeOnClose`,`toggleVisibility`]},{target:`closed`,actions:[`clearPointerMoveOpened`,`invokeOnClose`]}],close:[{guard:`isOpenControlled`,actions:[`invokeOnClose`,`toggleVisibility`]},{target:`closed`,actions:[`invokeOnClose`]}]}},open:{effects:[`trackEscapeKey`,`trackScroll`,`trackPointerlockChange`,`trackPositioning`],entry:[`setGlobalId`],on:{"controlled.close":{target:`closed`},close:[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`closed`,actions:[`invokeOnClose`]}],"pointer.leave":[{guard:`isVisible`,target:`closing`,actions:[`clearPointerMoveOpened`]},{guard:`isOpenControlled`,actions:[`clearPointerMoveOpened`,`invokeOnClose`]},{target:`closed`,actions:[`clearPointerMoveOpened`,`invokeOnClose`]}],"content.pointer.leave":{guard:`isInteractive`,target:`closing`},"positioning.set":{actions:[`reposition`]},"triggerValue.set":{target:`closing`,actions:[`setTriggerValue`,`immediateReopen`]}}},closing:{effects:[`trackPositioning`,`waitForCloseDelay`],on:{"after.closeDelay":[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`closed`,actions:[`invokeOnClose`]}],"controlled.close":{target:`closed`},"controlled.open":{target:`open`},close:[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`closed`,actions:[`invokeOnClose`]}],"pointer.move":[{guard:`isOpenControlled`,actions:[`setPointerMoveOpened`,`setTriggerValue`,`invokeOnOpen`,`toggleVisibility`]},{target:`open`,actions:[`setPointerMoveOpened`,`setTriggerValue`,`invokeOnOpen`]}],"triggerValue.set":{target:`open`,actions:[`setTriggerValue`,`repositionImmediate`]},reopen:{target:`open`},"content.pointer.move":{guard:`isInteractive`,target:`open`},"positioning.set":{actions:[`reposition`]}}}},implementations:{guards:{noVisibleTooltip:()=>$g.get(`id`)===null,isVisible:({prop:e})=>e(`id`)===$g.get(`id`),isInteractive:({prop:e})=>!!e(`interactive`),hasPointerMoveOpened:({context:e})=>!!e.get(`hasPointerMoveOpened`),isOpenControlled:({prop:e})=>e(`open`)!==void 0},actions:{setGlobalId:({prop:e})=>{let t=$g.get(`id`),n=t!==null&&t!==e(`id`);$g.update({id:e(`id`),prevId:n?t:null,instant:n})},clearGlobalId:({prop:e})=>{e(`id`)===$g.get(`id`)&&$g.update({id:null,prevId:null,instant:!1})},invokeOnOpen:({prop:e})=>{e(`onOpenChange`)?.({open:!0})},invokeOnClose:({prop:e})=>{e(`onOpenChange`)?.({open:!1})},closeIfDisabled:({prop:e,send:t})=>{e(`disabled`)&&t({type:`close`,src:`disabled.change`})},reposition:({context:e,event:t,prop:n,scope:r})=>{t.type===`positioning.set`&&Hg(()=>Qg(r,e.get(`triggerValue`)),()=>Xg(r),{...n(`positioning`),...t.options,listeners:!1,onComplete(t){e.set(`currentPlacement`,t.placement)}})},repositionImmediate:({context:e,event:t,prop:n,scope:r})=>{let i=t.value??e.get(`triggerValue`);return Hg(()=>Qg(r,i),()=>Xg(r),{...n(`positioning`),onComplete(t){e.set(`currentPlacement`,t.placement)}})},toggleVisibility:({prop:e,event:t,send:n})=>{queueMicrotask(()=>{n({type:e(`open`)?`controlled.open`:`controlled.close`,previousEvent:t})})},setPointerMoveOpened:({context:e,event:t})=>{let n=t.triggerId??t.previousEvent?.triggerId;e.set(`hasPointerMoveOpened`,n??null)},clearPointerMoveOpened:({context:e})=>{e.set(`hasPointerMoveOpened`,null)},setTriggerValue:({context:e,event:t})=>{t.value!==void 0&&e.set(`triggerValue`,t.value)},immediateReopen:({send:e})=>{queueMicrotask(()=>{e({type:`reopen`})})}},effects:{trackFocusVisible:({scope:e})=>Mo({root:e.getRootNode?.()}),trackPositioning:({context:e,prop:t,scope:n})=>(e.get(`currentPlacement`)||e.set(`currentPlacement`,t(`positioning`).placement),Hg(()=>Qg(n,e.get(`triggerValue`)),()=>Xg(n),{...t(`positioning`),defer:!0,onComplete(t){e.set(`currentPlacement`,t.placement)}})),trackPointerlockChange:({send:e,scope:t})=>xi(t.getDoc(),`pointerlockchange`,()=>e({type:`close`,src:`pointerlock:change`}),!1),trackScroll:({send:e,prop:t,scope:n,context:r})=>{if(!t(`closeOnScroll`))return;let i=Qg(n,r.get(`triggerValue`));if(!i)return;let a=Ui(i).map(t=>xi(t,`scroll`,()=>{e({type:`close`,src:`scroll`})},{passive:!0,capture:!0}));return()=>{a.forEach(e=>e?.())}},trackStore:({prop:e,send:t})=>{let n;return queueMicrotask(()=>{n=$g.subscribe(()=>{$g.get(`id`)!==e(`id`)&&t({type:`close`,src:`id.change`})})}),()=>n?.()},trackEscapeKey:({send:e,prop:t})=>t(`closeOnEscape`)?xi(document,`keydown`,t=>{ci(t)||t.key===`Escape`&&(t.stopPropagation(),e({type:`close`,src:`keydown.escape`}))},!0):void 0,waitForOpenDelay:({send:e,prop:t,event:n})=>{let r=setTimeout(()=>{e({type:`after.openDelay`,previousEvent:n})},t(`openDelay`));return()=>clearTimeout(r)},waitForCloseDelay:({send:e,prop:t,event:n})=>{let r=setTimeout(()=>{e({type:`after.closeDelay`,previousEvent:n})},t(`closeDelay`));return()=>clearTimeout(r)}}}}),[i_,a_]=Z({hookName:`useTooltipContext`,providerName:`<TooltipProvider />`}),o_=e=>{let t=a_(),n=Y(()=>t().getArrowProps(),e);return F(X.div,n)},s_=e=>{let t=a_(),n=Y(()=>t().getArrowTipProps(),e);return F(X.div,n)},c_=e=>{let t=a_(),n=hm(),r=Y(()=>t().getContentProps(),()=>n().presenceProps,e);return F(R,{get when(){return!n().unmounted},get children(){return F(X.div,I(r,{ref(t){var r=Pt(n().ref,e.ref);typeof r==`function`&&r(t)}}))}})},l_=e=>e.children(a_()),u_=e=>{let t=a_(),n=hm(),r=Y(()=>t().getPositionerProps(),e);return F(R,{get when(){return!n().unmounted},get children(){return F(X.div,r)}})},d_=e=>{let t=He(),n=Bo(),r=Ia(),i=_a(r_,O(()=>({id:t,dir:n().dir,getRootNode:r().getRootNode,...Bt(e)})));return O(()=>e_(i,Ta))},f_=e=>{let[t,n]=pm(e),[r,i]=U()(n,[`aria-label`,`closeDelay`,`closeOnClick`,`closeOnEscape`,`closeOnPointerDown`,`closeOnScroll`,`defaultOpen`,`disabled`,`id`,`ids`,`interactive`,`onOpenChange`,`open`,`openDelay`,`positioning`,`triggerValue`,`defaultTriggerValue`,`onTriggerValueChange`]),a=d_(r),o=fm(Y(t,()=>({present:a().open})));return F(i_,{value:a,get children(){return F(mm,{value:o,get children(){return i.children}})}})},p_=e=>{let[t,n]=pm(e),r=fm(Y(t,()=>({present:n.value().open})));return F(i_,{get value(){return n.value},get children(){return F(mm,{value:r,get children(){return n.children}})}})},m_=e=>{let[t,n]=U()(e,[`value`]),r=a_(),i=Y(()=>r().getTriggerProps(t),n);return F(X.button,i)},h_={};Ra(h_,{Arrow:()=>o_,ArrowTip:()=>s_,Content:()=>c_,Context:()=>l_,Positioner:()=>u_,Root:()=>f_,RootProvider:()=>p_,Trigger:()=>m_});var g_=[100,200,250,500,1e3,2e3,5e3,1e4,15e3,3e4,6e4,12e4,3e5,6e5];function __(e){if(e===0)return`0s`;let t=e/1e3;if(t<1)return`${Math.round(e)}ms`;if(t<60)return t===Math.floor(t)?`${t}s`:`${Math.round(t*10)/10}s`;let n=Math.floor(t/60),r=Math.round(t%60);return r===0?`${n}m`:`${n}m ${r}s`}function v_(e,t=60){if(e<=0)return 0;let n=Math.floor(e/t)+1;return Math.max(2,n)}function y_(e,t){if(e<=0||t<2)return e>0?e:1e3;for(let n of g_)if(Math.floor(e/n)+1<=t)return n;let n=e/(t-1),r=10**Math.floor(Math.log10(n));return Math.ceil(n/r)*r}function b_(e,t){if(e<=0)return[{position:0,timeMs:0,label:`0s`}];let n=[];for(let r=0;r<=e;r+=t)n.push({position:r/e,timeMs:r,label:__(r)});let r=n[n.length-1];return r&&r.timeMs<e&&(e-r.timeMs<=t*.5&&n.pop(),n.push({position:1,timeMs:e,label:__(e)})),n}function x_(e,t,n=60){let r=y_(e,v_(t,n));return{intervalMs:r,ticks:b_(e,r)}}var S_=z(`<div class="absolute top-0 bottom-0 bg-gray-300/30 pointer-events-none"style=left:0%>`),C_=z(`<div class="absolute top-0 bottom-0 bg-gray-300/30 pointer-events-none"style=right:0%>`),w_=z(`<div class="absolute top-0 bottom-0 bg-blue-500/10 border-y border-blue-400/50">`),T_=z(`<div class="absolute top-0 bottom-0 w-1.5 bg-blue-500 hover:bg-blue-600 cursor-ew-resize z-10 transition-colors"style=transform:translateX(-50%)><div class="absolute inset-y-1 left-0.5 w-px bg-blue-300">`),E_=z(`<div class="relative h-1.5 bg-gray-100 border-b border-gray-200"><div class="absolute inset-y-0">`),D_=z(`<div class="flex-shrink-0 select-none"><div class="relative h-6 bg-gray-50"><div class="absolute inset-y-0">`),O_=z(`<div class="absolute top-0 bottom-0 flex items-center pointer-events-none"><div class="w-px h-5 bg-gray-300"></div><span class="text-[10px] text-gray-500 whitespace-nowrap pl-1">`),k_=z(`<div class="absolute top-0 bottom-0 w-px bg-blue-500 pointer-events-none z-50">`),A_={left:`var(--timeline-plot-inset)`,width:`var(--timeline-plot-width)`},j_=.01;function M_(e){let t,[n,r]=w([]),[i,a]=w(null);D(()=>{if(!t)return;let n=new ResizeObserver(t=>{for(let n of t){let t=n.contentRect.width;t>0&&r(x_(e.durationMs,t).ticks)}});n.observe(t),N(()=>{n.disconnect()})}),D(()=>{if(t){let n=t.getBoundingClientRect().width;n>0&&r(x_(e.durationMs,n).ticks)}});let o=()=>Ru(e.viewport.visibleStartMs,e.viewport)*100,s=()=>Ru(e.viewport.visibleEndMs,e.viewport)*100,c=()=>s()-o(),l=()=>e.hoverPosition===null?null:Ru(Lu(e.hoverPosition,e.viewport),e.viewport)*100,u=n=>r=>{if(r.preventDefault(),r.stopPropagation(),!t)return;let i=t.getBoundingClientRect().width;a({mode:n,startMouseX:r.clientX,containerWidth:i,initialViewport:{...e.viewport}})},d=t=>{let n=i();if(!n||!e.onViewportChange)return;let r=(t.clientX-n.startMouseX)/n.containerWidth*n.initialViewport.totalDurationMs,a;switch(n.mode){case`left-handle`:{let e=n.initialViewport.visibleStartMs+r,t=n.initialViewport.visibleEndMs-n.initialViewport.totalDurationMs*j_;a={...n.initialViewport,visibleStartMs:Math.max(0,Math.min(t,e))};break}case`right-handle`:{let e=n.initialViewport.visibleEndMs+r,t=n.initialViewport.visibleStartMs+n.initialViewport.totalDurationMs*j_,i=n.initialViewport.totalDurationMs;a={...n.initialViewport,visibleEndMs:Math.max(t,Math.min(i,e))};break}case`pan`:{let e=n.initialViewport.visibleEndMs-n.initialViewport.visibleStartMs,t=n.initialViewport.visibleStartMs+r,i=n.initialViewport.visibleEndMs+r;t<0&&(t=0,i=e),i>n.initialViewport.totalDurationMs&&(i=n.initialViewport.totalDurationMs,t=i-e),a={...n.initialViewport,visibleStartMs:t,visibleEndMs:i};break}}e.onViewportChange(Vu(a))},f=()=>{a(null)};te(()=>{let e=e=>d(e),t=()=>f();document.addEventListener(`mousemove`,e),document.addEventListener(`mouseup`,t),N(()=>{document.removeEventListener(`mousemove`,e),document.removeEventListener(`mouseup`,t)})});let p=()=>{let e=i();if(e)return e.mode===`pan`?`grabbing`:`ew-resize`},m=e=>{switch(e){case`before-hooks`:return`bg-amber-300/60 hover:bg-amber-300/80`;case`test-body`:return`bg-green-300/60 hover:bg-green-300/80`;case`after-hooks`:return`bg-amber-300/60 hover:bg-amber-300/80`}},h=t=>{let n=t.startMs/e.durationMs*100;return{left:n,width:t.endMs/e.durationMs*100-n}},g=()=>e.testPhases&&e.testPhases.length>0,_=t=>{t.stopPropagation(),e.onDoubleClick?.()};return(()=>{var r=D_(),a=r.firstChild,d=a.firstChild;r.$$dblclick=_;var f=t;return typeof f==`function`?mt(f,d):t=d,H(d,F(R,{get when(){return!Bu(e.viewport)},get children(){return[(()=>{var e=S_();return E(t=>V(e,`width`,`${o()}%`)),e})(),(()=>{var e=C_();return E(t=>V(e,`left`,`${s()}%`)),e})(),(()=>{var e=w_();return ut(e,`mousedown`,u(`pan`),!0),E(t=>{var n=`${o()}%`,r=`${c()}%`,a=i()?.mode===`pan`?`grabbing`:`grab`;return n!==t.e&&V(e,`left`,t.e=n),r!==t.t&&V(e,`width`,t.t=r),a!==t.a&&V(e,`cursor`,t.a=a),t},{e:void 0,t:void 0,a:void 0}),e})(),(()=>{var e=T_();return ut(e,`mousedown`,u(`left-handle`),!0),E(t=>V(e,`left`,`${o()}%`)),e})(),(()=>{var e=T_();return ut(e,`mousedown`,u(`right-handle`),!0),E(t=>V(e,`left`,`${s()}%`)),e})()]}}),null),H(d,F(L,{get each(){return n()},children:(e,t)=>{let r=()=>t()===n().length-1;return(()=>{var t=O_(),n=t.firstChild.nextSibling;return H(n,()=>e.label),E(i=>{var a=`${e.position*100}%`,o=r()?`absolute`:`relative`,s=r()?`1px`:void 0;return a!==i.e&&V(t,`left`,i.e=a),o!==i.t&&V(n,`position`,i.t=o),s!==i.a&&V(n,`right`,i.a=s),i},{e:void 0,t:void 0,a:void 0}),t})()}}),null),H(d,F(R,{get when(){return l()},keyed:!0,children:e=>(()=>{var t=k_();return V(t,`left`,`${e}%`),t})()}),null),H(r,F(R,{get when(){return g()},get children(){var t=E_(),n=t.firstChild;return H(n,F(L,{get each(){return e.testPhases},children:t=>{let n=h(t);return F(h_.Root,{openDelay:300,closeDelay:0,get children(){return[F(h_.Trigger,{get class(){return`absolute top-0 bottom-0 cursor-pointer transition-colors ${m(t.type)}`},get style(){return{left:`${n.left}%`,width:`${n.width}%`}},onClick:()=>{e.onPhaseClick?.(t)}}),F(kt,{get children(){return F(h_.Positioner,{get children(){return F(h_.Content,{class:`bg-gray-900 text-white text-xs px-2 py-1 rounded shadow-lg z-50 flex items-center gap-1.5`,get children(){return[F(tf,{size:12}),nt(()=>t.label)]}})}})}})]}})}})),E(e=>ft(n,A_,e)),t}}),null),E(e=>{var t={"border-b border-gray-200":!g()},n=p(),r=A_;return e.e=dt(a,t,e.e),n!==e.t&&V(a,`cursor`,e.t=n),e.a=ft(d,r,e.a),e},{e:void 0,t:void 0,a:void 0}),r})()}ot([`dblclick`,`mousedown`]);var N_=Ft(`menu`).parts(`arrow`,`arrowTip`,`content`,`contextTrigger`,`indicator`,`item`,`itemGroup`,`itemGroupLabel`,`itemIndicator`,`itemText`,`positioner`,`separator`,`trigger`,`triggerItem`).build(),P_=(e,t)=>{let n=e.ids?.trigger;return n==null?t?`menu:${e.id}:trigger:${t}`:`menu:${e.id}:trigger`:ln(n)?n(t):n},F_=(e,t)=>{let n=e.ids?.contextTrigger;return n==null?t?`menu:${e.id}:ctx-trigger:${t}`:`menu:${e.id}:ctx-trigger`:ln(n)?n(t):n},I_=e=>e.ids?.content??`menu:${e.id}:content`,L_=e=>e.ids?.arrow??`menu:${e.id}:arrow`,R_=e=>e.ids?.positioner??`menu:${e.id}:popper`,z_=(e,t)=>e.ids?.group?.(t)??`menu:${e.id}:group:${t}`,B_=(e,t)=>`${e.id}/${t}`,V_=e=>e?.dataset.value??null,H_=(e,t)=>e.ids?.groupLabel?.(t)??`menu:${e.id}:group-label:${t}`,U_=e=>e.getById(I_(e)),W_=e=>e.getById(R_(e)),G_=e=>e.getById(P_(e)),K_=(e,t)=>t?e.getById(B_(e,t)):null,q_=e=>e.getById(F_(e)),J_=e=>qi(e.getRootNode(),`[data-scope="menu"][data-part="trigger"][data-ownedby="${e.id}"]`),Y_=e=>qi(e.getRootNode(),`[data-scope="menu"][data-part="context-trigger"][data-ownedby="${e.id}"]`),X_=(e,t)=>t==null?G_(e)??J_(e)[0]:e.getById(P_(e,t)),Z_=e=>{let t=`[role^="menuitem"][data-ownedby=${CSS.escape(I_(e))}]:not([data-disabled])`;return qi(U_(e),t)},Q_=e=>Ht(Z_(e)),$_=e=>Ut(Z_(e)),ev=(e,t)=>t?e.id===t||e.dataset.value===t:!1,tv=(e,t)=>{let n=Z_(e);return Yt(n,n.findIndex(e=>ev(e,t.value)),{loop:t.loop??t.loopFocus})},nv=(e,t)=>{let n=Z_(e);return Zt(n,n.findIndex(e=>ev(e,t.value)),{loop:t.loop??t.loopFocus})},rv=(e,t)=>{let n=Z_(e),r=n.find(e=>ev(e,t.value));return sa(n,{state:t.typeaheadState,key:t.key,activeId:r?.id??null})},iv=e=>G(e)&&(e.dataset.disabled===``||e.hasAttribute(`disabled`)),av=e=>!!e?.getAttribute(`role`)?.startsWith(`menuitem`)&&!!e?.hasAttribute(`data-controls`),ov=`menu:select`;function sv(e,t){if(!e)return;let n=new(K(e)).CustomEvent(ov,{detail:{value:t}});e.dispatchEvent(n)}function cv(e){let t=I_(e);return U_(e)??e.getDoc().getElementById(t)}function lv(e,t){if(!G(e))return!1;for(let n in t){let r=t[n],i=cv(r.scope);if(i&&Pr(i,e))return!0;let a=r.refs.get(`children`);if(Object.keys(a).length>0&&lv(e,a))return!0}return!1}var uv=(e,t)=>({x:e,y:t});function dv(e){let{x:t,y:n,width:r,height:i}=e,a=t+r/2,o=n+i/2;return{x:t,y:n,width:r,height:i,minX:t,minY:n,maxX:t+r,maxY:n+i,midX:a,midY:o,center:uv(a,o)}}function fv(e){return{top:uv(e.minX,e.minY),right:uv(e.maxX,e.minY),bottom:uv(e.maxX,e.maxY),left:uv(e.minX,e.maxY)}}function pv(e,t){let{top:n,right:r,left:i,bottom:a}=fv(dv(e)),[o]=t.split(`-`);return{top:[i,n,r,a],right:[n,r,a,i],bottom:[n,i,a,r],left:[r,n,i,a]}[o]}function mv(e,t){let{x:n,y:r}=t,i=!1;for(let t=0,a=e.length-1;t<e.length;a=t++){let o=e[t].x,s=e[t].y,c=e[a].x,l=e[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function hv(e){let t=e.parent;for(;t&&t.context.get(`isSubmenu`);)t=t.refs.get(`parent`);t?.send({type:`CLOSE`})}function gv(e,t){return e?mv(e,t):!1}function _v(e,t,n){let r=Object.keys(e).length>0;if(!t)return null;if(!r)return B_(n,t);for(let n in e){let r=e[n],i=P_(r.scope);if(i===t)return i}return B_(n,t)}function vv(e,t){e&&(e.refs.set(`pointerRoutingLocked`,t),e.context.set(`pointerRoutingMode`,t?`locked`:`interactive`))}function yv(e){let t=e.context.get(`highlightedValue`);if(!t)return!1;let n=e.refs.get(`children`);for(let e in n){let r=n[e];if(r.state.hasTag(`open`)&&P_(r.scope)===t)return!0}return!1}function bv(e,t){e&&(e.refs.get(`pointerRoutingLocked`)||t&&yv(e)||vv(e,!1))}function xv(e){e&&(yv(e)||vv(e,!1))}function Sv(e,t){let{context:n,send:r,state:i,computed:a,prop:o,scope:s}=e,c=i.hasTag(`open`),l=n.get(`isSubmenu`),u=a(`isTypingAhead`),d=o(`composite`),f=n.get(`currentPlacement`),p=f?Tg(f):void 0,m=n.get(`anchorPoint`),h=n.get(`highlightedValue`),g=n.get(`triggerValue`),_=Wg({...o(`positioning`),placement:m?`bottom`:f});function v(e){return{id:B_(s,e.value),disabled:!!e.disabled,highlighted:h===e.value}}function y(e){let t=e.valueText??e.value;return{...e,id:e.value,valueText:t}}function b(e){return{...v(y(e)),checked:!!e.checked}}function x(n){let{closeOnSelect:i,valueText:a,value:o}=n,c=v(n),l=B_(s,o);return t.element({...N_.item.attrs,id:l,role:`menuitem`,"aria-disabled":vr(c.disabled),"data-disabled":W(c.disabled),"data-ownedby":I_(s),"data-highlighted":W(c.highlighted),"data-value":o,"data-valuetext":a,onDragStart(e){e.currentTarget.matches(`a[href]`)&&e.preventDefault()},onPointerMove(e){if(c.disabled||e.pointerType!==`mouse`)return;let t=e.currentTarget;c.highlighted||r({type:`ITEM_POINTERMOVE`,id:l,target:t,closeOnSelect:i,point:bi(e)})},onPointerLeave(t){if(c.disabled||t.pointerType!==`mouse`||!e.event.previous()?.type.includes(`POINTER`))return;let n=t.currentTarget;r({type:`ITEM_POINTERLEAVE`,id:l,target:n,closeOnSelect:i})},onPointerDown(e){if(c.disabled)return;let t=e.currentTarget;r({type:`ITEM_POINTERDOWN`,target:t,id:l,closeOnSelect:i})},onClick(e){if(si(e)||oi(e)||c.disabled)return;let t=e.currentTarget;r({type:`ITEM_CLICK`,target:t,id:l,closeOnSelect:i})}})}return{highlightedValue:h,open:c,setOpen(e){i.hasTag(`open`)!==e&&r({type:e?`OPEN`:`CLOSE`})},triggerValue:g,setTriggerValue(e){r({type:`TRIGGER_VALUE.SET`,value:e})},setHighlightedValue(e){r({type:`HIGHLIGHTED.SET`,value:e})},setParent(e){r({type:`PARENT.SET`,value:e,id:e.prop(`id`)})},setChild(e){r({type:`CHILD.SET`,value:e,id:e.prop(`id`)})},reposition(e={}){r({type:`POSITIONING.SET`,options:e})},addItemListener(e){let t=s.getById(e.id);if(!t)return;let n=()=>e.onSelect?.();return t.addEventListener(ov,n),()=>t.removeEventListener(ov,n)},getContextTriggerProps(e={}){let{value:n}=e,i=n==null?!1:g===n,a=F_(s,n);return t.element({...N_.contextTrigger.attrs,dir:o(`dir`),id:a,"data-ownedby":s.id,"data-value":n,"data-current":W(i),"data-state":c?`open`:`closed`,onPointerDown(e){e.pointerType!==`mouse`&&r({type:`CONTEXT_MENU_START`,point:bi(e),value:n})},onPointerCancel(e){e.pointerType!==`mouse`&&r({type:`CONTEXT_MENU_CANCEL`})},onPointerMove(e){e.pointerType!==`mouse`&&r({type:`CONTEXT_MENU_CANCEL`})},onPointerUp(e){e.pointerType!==`mouse`&&r({type:`CONTEXT_MENU_CANCEL`})},onContextMenu(e){let t=bi(e);r({type:c&&n!=null&&!i?`TRIGGER_VALUE.SET`:`CONTEXT_MENU`,point:t,value:n}),e.preventDefault()},style:{WebkitTouchCallout:`none`,WebkitUserSelect:`none`,userSelect:`none`}})},getTriggerItemProps(e){let t=e.getTriggerProps();return Ln(x({value:t.id}),t)},getTriggerProps(n={}){let{value:i}=n,a=i==null?!1:g===i,u=P_(s,i);return t.button({...l?N_.triggerItem.attrs:N_.trigger.attrs,"data-placement":f,"data-side":p,type:`button`,dir:o(`dir`),id:u,...i!=null&&{"data-ownedby":s.id,"data-value":i,"data-current":W(a)},"data-uid":o(`id`),"aria-haspopup":d?`menu`:`dialog`,"aria-controls":I_(s),"data-controls":I_(s),"aria-expanded":i==null?c:c&&a,"data-state":c?`open`:`closed`,onPointerMove(e){if(e.pointerType!==`mouse`||iv(e.currentTarget)||!l)return;let t=bi(e);r({type:`TRIGGER_POINTERMOVE`,target:e.currentTarget,point:t})},onPointerLeave(t){if(iv(t.currentTarget)||t.pointerType!==`mouse`||!l)return;vv(e.refs.get(`parent`),!0);let n=bi(t);r({type:`TRIGGER_POINTERLEAVE`,target:t.currentTarget,point:n})},onPointerDown(e){iv(e.currentTarget)||pi(e)||e.preventDefault()},onClick(e){e.defaultPrevented||iv(e.currentTarget)||r({type:c&&i!=null&&!a?`TRIGGER_VALUE.SET`:`TRIGGER_CLICK`,target:e.currentTarget,value:i})},onBlur(){r({type:`TRIGGER_BLUR`})},onFocus(){r({type:`TRIGGER_FOCUS`})},onKeyDown(e){if(e.defaultPrevented)return;let t={ArrowDown(){r({type:`ARROW_DOWN`,value:i})},ArrowUp(){r({type:`ARROW_UP`,value:i})},Enter(){r({type:`ARROW_DOWN`,src:`enter`,value:i})},Space(){r({type:`ARROW_DOWN`,src:`space`,value:i})}}[vi(e,{orientation:`vertical`,dir:o(`dir`)})];t&&(e.preventDefault(),t(e))}})},getIndicatorProps(){return t.element({...N_.indicator.attrs,dir:o(`dir`),"data-state":c?`open`:`closed`})},getPositionerProps(){return t.element({...N_.positioner.attrs,dir:o(`dir`),id:R_(s),style:_.floating})},getArrowProps(){return t.element({id:L_(s),...N_.arrow.attrs,dir:o(`dir`),style:_.arrow})},getArrowTipProps(){return t.element({...N_.arrowTip.attrs,dir:o(`dir`),style:_.arrowTip})},getContentProps(){return t.element({...N_.content.attrs,id:I_(s),"aria-label":o(`aria-label`),hidden:!c,"data-state":c?`open`:`closed`,role:d?`menu`:`dialog`,tabIndex:0,dir:o(`dir`),"aria-activedescendant":a(`highlightedId`)||void 0,"aria-labelledby":m?F_(s,g??void 0):P_(s,g??void 0),"data-placement":f,"data-side":p,onPointerEnter(e){e.pointerType===`mouse`&&r({type:`MENU_POINTERENTER`})},onKeyDown(e){if(e.defaultPrevented||!Pr(e.currentTarget,q(e)))return;let t=q(e);if(!(t?.closest(`[role=menu]`)===e.currentTarget||t===e.currentTarget))return;if(e.key===`Tab`&&!Fi(e)){e.preventDefault();return}let n={ArrowDown(){r({type:`ARROW_DOWN`})},ArrowUp(){r({type:`ARROW_UP`})},ArrowLeft(){r({type:`ARROW_LEFT`})},ArrowRight(){r({type:`ARROW_RIGHT`})},Enter(){r({type:`ENTER`})},Space(e){u?r({type:`TYPEAHEAD`,key:e.key}):n.Enter?.(e)},Home(){r({type:`HOME`})},End(){r({type:`END`})}},i=n[vi(e,{dir:o(`dir`)})];if(i){i(e),e.stopPropagation(),e.preventDefault();return}o(`typeahead`)&&ui(e)&&(mi(e)||Nr(t)||(r({type:`TYPEAHEAD`,key:e.key}),e.preventDefault()))}})},getSeparatorProps(){return t.element({...N_.separator.attrs,role:`separator`,dir:o(`dir`),"aria-orientation":`horizontal`})},getItemState:v,getItemProps:x,getOptionItemState:b,getOptionItemProps(e){let{type:n,disabled:i,closeOnSelect:a}=e,s=y(e),c=b(e);return{...x(s),...t.element({"data-type":n,...N_.item.attrs,dir:o(`dir`),"data-value":s.value,role:`menuitem${n}`,"aria-checked":!!c.checked,"data-state":c.checked?`checked`:`unchecked`,onClick(e){if(i||si(e)||oi(e))return;let t=e.currentTarget;r({type:`ITEM_CLICK`,target:t,option:s,closeOnSelect:a})}})}},getItemIndicatorProps(e){let n=b(yn(e)),r=n.checked?`checked`:`unchecked`;return t.element({...N_.itemIndicator.attrs,dir:o(`dir`),"data-disabled":W(n.disabled),"data-highlighted":W(n.highlighted),"data-state":dn(e,`checked`)?r:void 0,hidden:dn(e,`checked`)?!n.checked:void 0})},getItemTextProps(e){let n=b(yn(e)),r=n.checked?`checked`:`unchecked`;return t.element({...N_.itemText.attrs,dir:o(`dir`),"data-disabled":W(n.disabled),"data-highlighted":W(n.highlighted),"data-state":dn(e,`checked`)?r:void 0})},getItemGroupLabelProps(e){return t.element({...N_.itemGroupLabel.attrs,id:H_(s,e.htmlFor),dir:o(`dir`)})},getItemGroupProps(e){return t.element({id:z_(s,e.id),...N_.itemGroup.attrs,dir:o(`dir`),"aria-labelledby":H_(s,e.id),role:`group`})}}}function Cv(e){let t={each(t){for(let n=0;n<e.frames?.length;n+=1){let r=e.frames[n];r&&t(r)}},addEventListener(e,n,r){return t.each(t=>{try{t.document.addEventListener(e,n,r)}catch{}}),()=>{try{t.removeEventListener(e,n,r)}catch{}}},removeEventListener(e,n,r){t.each(t=>{try{t.document.removeEventListener(e,n,r)}catch{}})}};return t}function wv(e){let t=e.frameElement==null?null:e.parent;return{addEventListener:(e,n,r)=>{try{t?.addEventListener(e,n,r)}catch{}return()=>{try{t?.removeEventListener(e,n,r)}catch{}}},removeEventListener:(e,n,r)=>{try{t?.removeEventListener(e,n,r)}catch{}}}}var Tv=`pointerdown.outside`,Ev=`focus.outside`;function Dv(e){for(let t of e)if(G(t)&&Ai(t))return!0;return!1}var Ov=e=>`clientY`in e;function kv(e,t){if(!Ov(t)||!e)return!1;let n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function Av(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function jv(e,t){if(!t||!Ov(e))return!1;let n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,i=t.scrollWidth>t.clientWidth,a=i&&e.clientY>t.offsetTop+t.clientHeight;return Av({x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(i?16:0)},{x:e.clientX,y:e.clientY})?r||a:!1}function Mv(e,t){let{exclude:n,onFocusOutside:r,onPointerDownOutside:i,onInteractOutside:a,defer:o,followControlledElements:s=!0}=t;if(!e)return;let c=Fr(e),l=K(e),u=Cv(l),d=wv(l);function f(t,r){if(!G(r)||!r.isConnected||Pr(e,r)||kv(e,t)||s&&Gr(e,r))return!1;let i=c.querySelector(`[aria-controls="${e.id}"]`);return i&&jv(t,Hi(i))||jv(t,Hi(e))?!1:!n?.(r)}let p=new Set,m=Dr(e?.getRootNode()),h=!1;function g(t){h=!0;let n=()=>{h=!1};c.addEventListener(`pointerup`,n,{once:!0}),l.addEventListener(`pointerup`,n,{once:!0});function r(n){let r=o&&!Zr()?J:e=>e(),s=n??t,c=s?.composedPath?.()??[s?.target];r(()=>{let n=m?c[0]:q(t);if(!(!e||!f(t,n))){if(i||a){let t=xn(i,a);e.addEventListener(Tv,t,{once:!0})}Pv(e,Tv,{bubbles:!1,cancelable:!0,detail:{originalEvent:s,contextmenu:pi(s),focusable:Dv(c),target:n}})}})}t.pointerType===`touch`?(p.forEach(e=>e()),p.add(xi(c,`click`,r,{once:!0})),p.add(d.addEventListener(`click`,r,{once:!0})),p.add(u.addEventListener(`click`,r,{once:!0}))):r()}let _=new Set,v=setTimeout(()=>{_.add(xi(c,`pointerdown`,g,!0)),_.add(d.addEventListener(`pointerdown`,g,!0)),_.add(u.addEventListener(`pointerdown`,g,!0))},0);function y(t){h||(o?J:e=>e())(()=>{let n=t?.composedPath?.()??[t?.target],i=m?n[0]:q(t);if(!(!e||!f(t,i))){if(r||a){let t=xn(r,a);e.addEventListener(Ev,t,{once:!0})}Pv(e,Ev,{bubbles:!1,cancelable:!0,detail:{originalEvent:t,contextmenu:!1,focusable:Ai(i),target:i}})}})}return Zr()||(_.add(xi(c,`focusin`,y,!0)),_.add(d.addEventListener(`focusin`,y,!0)),_.add(u.addEventListener(`focusin`,y,!0))),()=>{clearTimeout(v),p.forEach(e=>e()),_.forEach(e=>e())}}function Nv(e,t){let{defer:n}=t,r=n?J:e=>e(),i=[];return i.push(r(()=>{let n=typeof e==`function`?e():e;i.push(Mv(n,t))})),()=>{i.forEach(e=>e?.())}}function Pv(e,t,n){let r=new(e.ownerDocument.defaultView||window).CustomEvent(t,n);return e.dispatchEvent(r)}function Fv(e,t){return xi(Fr(e),`keydown`,e=>{e.key===`Escape`&&(e.isComposing||t?.(e))},{capture:!0})}var Iv=`layer:request-dismiss`,Lv={layers:[],branches:[],recentlyRemoved:new Set,count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){return this.indexOf(e)<(this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1)},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){let n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(e=>e.type===t)},getParentLayerOfType(e,t){let n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(e=>e.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return!!(this.getNestedLayers(e).some(e=>Pr(e.node,t))||this.recentlyRemoved.size>0)},isInBranch(e){return Array.from(this.branches).some(t=>Pr(t,e))},add(e){let t=this.indexOf(e.node);t!==-1&&this.layers.splice(t,1),this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){let t=this.indexOf(e);t<0||(this.layers[t].styleTargets?.forEach(e=>{let t=e();t&&zv(t)}),this.recentlyRemoved.add(e),Li(()=>this.recentlyRemoved.delete(e)),t<this.count()-1&&this.getNestedLayers(e).forEach(t=>Lv.dismiss(t.node,e)),this.layers.splice(t,1),this.syncLayers())},removeBranch(e){let t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{Rv(e,t,e.node),e.styleTargets?.forEach(n=>{let r=n();if(!r||r===e.node)return;Rv(e,t,r);let{zIndex:i}=Vr(e.node);r.style.setProperty(`--z-index`,i)})})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){let n=this.indexOf(e);if(n===-1)return;let r=this.layers[n];Vv(e,Iv,e=>{r.requestDismiss?.(e),e.defaultPrevented||r?.dismiss()}),Bv(e,Iv,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function Rv(e,t,n){n.style.setProperty(`--layer-index`,`${t}`),n.removeAttribute(`data-nested`),n.removeAttribute(`data-has-nested`),Lv.getParentLayerOfType(e.node,e.type)&&n.setAttribute(`data-nested`,e.type);let r=Lv.countNestedLayersOfType(e.node,e.type);r>0&&n.setAttribute(`data-has-nested`,e.type),n.style.setProperty(`--nested-layer-count`,`${r}`)}function zv(e){e.style.removeProperty(`--layer-index`),e.style.removeProperty(`--nested-layer-count`),e.style.removeProperty(`--z-index`),e.removeAttribute(`data-nested`),e.removeAttribute(`data-has-nested`)}function Bv(e,t,n){let r=new(e.ownerDocument.defaultView||window).CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(r)}function Vv(e,t,n){e.addEventListener(t,n,{once:!0})}var Hv=new WeakMap,Uv=new WeakMap;function Wv(e){return Lv.isBelowPointerBlockingLayer(e)?`none`:`auto`}function Gv(e){let t=Wv(e);e.style.pointerEvents!==t&&(e.style.pointerEvents=t)}function Kv(e){if(Uv.has(e))return;let t=K(e);if(t.MutationObserver===void 0)return;let n=new t.MutationObserver(()=>{Uv.has(e)&&Gv(e)});n.observe(e,{attributes:!0,attributeFilter:[`style`]}),Uv.set(e,n)}function qv(){Lv.layers.forEach(({node:e})=>{Gv(e),Kv(e)})}function Jv(e){let t=Uv.get(e);t&&(t.disconnect(),Uv.delete(e)),e.style.pointerEvents=``}function Yv(e,t){let n=Fr(e),r=[];return Lv.hasPointerBlockingLayer()&&!n.body.hasAttribute(`data-inert`)&&(Hv.set(n.body,n.body.style.pointerEvents),queueMicrotask(()=>{let e=n.body;e&&(e.style.pointerEvents=`none`,e.setAttribute(`data-inert`,``))})),t?.forEach(e=>{let[t,n]=da(()=>{let t=e();return G(t)?t:null},{timeout:1e3});t.then(e=>r.push(ia(e,{pointerEvents:`auto`}))),r.push(n)}),()=>{Lv.hasPointerBlockingLayer()||(queueMicrotask(()=>{let e=n.body;if(!e)return;let t=Hv.get(e);t!==void 0&&(e.style.pointerEvents=t,Hv.delete(e)),e.removeAttribute(`data-inert`),e.style.length===0&&e.removeAttribute(`style`)}),r.forEach(e=>e()))}}function Xv(e,t){let{warnOnMissingNode:n=!0}=t;if(n&&!e){kn("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!e)return;let{onDismiss:r,onRequestDismiss:i,pointerBlocking:a,exclude:o,debug:s,type:c=`dialog`,layerStyleTargets:l}=t,u={dismiss:r,node:e,type:c,pointerBlocking:a,requestDismiss:i,styleTargets:l};Lv.add(u),qv();function d(n){let i=q(n.detail.originalEvent);Lv.isBelowPointerBlockingLayer(e)||Lv.isInBranch(i)||(t.onPointerDownOutside?.(n),t.onInteractOutside?.(n),!n.defaultPrevented&&(s&&console.log(`onPointerDownOutside:`,n.detail.originalEvent),r?.()))}function f(e){let n=q(e.detail.originalEvent);Lv.isInBranch(n)||(t.onFocusOutside?.(e),t.onInteractOutside?.(e),!e.defaultPrevented&&(s&&console.log(`onFocusOutside:`,e.detail.originalEvent),r?.()))}function p(n){Lv.isTopMost(e)&&(t.onEscapeKeyDown?.(n),!n.defaultPrevented&&r&&(n.preventDefault(),r()))}function m(n){if(!e)return!1;let r=typeof o==`function`?o():o,i=Array.isArray(r)?r:[r],a=t.persistentElements?.map(e=>e()).filter(G);return a&&i.push(...a),i.some(e=>Pr(e,n))||Lv.isInNestedLayer(e,n)}let h=[a?Yv(e,t.persistentElements):void 0,Fv(e,p),Nv(e,{exclude:m,onFocusOutside:f,onPointerDownOutside:d,defer:t.defer})];return()=>{Lv.remove(e),qv(),Jv(e),h.forEach(e=>e?.())}}function Zv(e,t){let{defer:n}=t,r=n?J:e=>e(),i=[];return i.push(r(()=>{let n=ln(e)?e():e;i.push(Xv(n,t))})),()=>{i.forEach(e=>e?.())}}var{not:Qv,and:$v,or:ey}=or(),ty=sr({props({props:e}){return{closeOnSelect:!0,typeahead:!0,composite:!0,loopFocus:!1,navigate(e){Vi(e.node)},...e,positioning:{placement:`bottom-start`,gutter:8,...e.positioning}}},initialState({prop:e}){return e(`open`)||e(`defaultOpen`)?`open`:`idle`},context({bindable:e,prop:t,scope:n}){return{highlightedValue:e(()=>({defaultValue:t(`defaultHighlightedValue`)||null,value:t(`highlightedValue`),onChange(e){t(`onHighlightChange`)?.({highlightedValue:e})}})),lastHighlightedValue:e(()=>({defaultValue:null})),currentPlacement:e(()=>({defaultValue:void 0})),intentPolygon:e(()=>({defaultValue:null})),anchorPoint:e(()=>({defaultValue:null,hash(e){return`x: ${e?.x}, y: ${e?.y}`}})),isSubmenu:e(()=>({defaultValue:!1})),triggerValue:e(()=>({defaultValue:t(`defaultTriggerValue`)??null,value:t(`triggerValue`),onChange(e){let r=t(`onTriggerValueChange`);r&&r({value:e,triggerElement:X_(n,e)})}})),pointerRoutingMode:e(()=>({defaultValue:`interactive`}))}},refs(){return{parent:null,children:{},pointerRoutingLocked:!1,typeaheadState:{...sa.defaultOptions},positioningOverride:{}}},computed:{isRtl:({prop:e})=>e(`dir`)===`rtl`,isTypingAhead:({refs:e})=>e.get(`typeaheadState`).keysSoFar!==``,highlightedId:({context:e,scope:t,refs:n})=>_v(n.get(`children`),e.get(`highlightedValue`),t)},watch({track:e,action:t,context:n,prop:r}){e([()=>n.get(`isSubmenu`)],()=>{t([`setSubmenuPlacement`])}),e([()=>n.hash(`anchorPoint`)],()=>{n.get(`anchorPoint`)&&t([`reposition`])}),e([()=>r(`open`)],()=>{t([`toggleVisibility`])})},on:{"TRIGGER_VALUE.SET":{actions:[`setTriggerValue`,`setAnchorPoint`,`reposition`,`focusMenu`]},"PARENT.SET":{actions:[`setParentMenu`]},"CHILD.SET":{actions:[`setChildMenu`]},OPEN:[{guard:`isOpenControlled`,actions:[`setTriggerValue`,`invokeOnOpen`]},{target:`open`,actions:[`setTriggerValue`,`invokeOnOpen`]}],OPEN_AUTOFOCUS:[{guard:`isOpenControlled`,actions:[`setTriggerValue`,`invokeOnOpen`]},{target:`open`,actions:[`setTriggerValue`,`highlightFirstItem`,`invokeOnOpen`]}],CLOSE:[{guard:`isOpenControlled`,actions:[`invokeOnClose`,`releaseParentRoutingLock`]},{target:`closed`,actions:[`invokeOnClose`,`releaseParentRoutingLock`,`focusTrigger`]}],"HIGHLIGHTED.RESTORE":{actions:[`restoreHighlightedItem`]},"HIGHLIGHTED.SET":{actions:[`setHighlightedItem`]},"HIGHLIGHTED.SUGGEST":{actions:[`suggestHighlightedItem`]}},states:{idle:{tags:[`closed`],on:{"CONTROLLED.OPEN":{target:`open`},"CONTROLLED.CLOSE":{target:`closed`},CONTEXT_MENU_START:{target:`opening:contextmenu`,actions:[`setAnchorPoint`,`setTriggerValue`]},CONTEXT_MENU:[{guard:`isOpenControlled`,actions:[`setAnchorPoint`,`setTriggerValue`,`invokeOnOpen`]},{target:`open`,actions:[`setAnchorPoint`,`setTriggerValue`,`invokeOnOpen`]}],TRIGGER_CLICK:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`,`setTriggerValue`]},{target:`open`,actions:[`invokeOnOpen`,`setTriggerValue`]}],TRIGGER_FOCUS:{guard:Qv(`isSubmenu`),target:`closed`},TRIGGER_POINTERMOVE:{guard:`isSubmenu`,target:`opening`}}},"opening:contextmenu":{tags:[`closed`],effects:[`waitForLongPress`],on:{"CONTROLLED.OPEN":{target:`open`},"CONTROLLED.CLOSE":{target:`closed`,actions:[`focusTrigger`]},CONTEXT_MENU_CANCEL:[{guard:`isOpenControlled`,actions:[`invokeOnClose`,`releaseParentRoutingLock`]},{target:`closed`,actions:[`invokeOnClose`,`releaseParentRoutingLock`,`focusTrigger`]}],"LONG_PRESS.OPEN":[{guard:`isOpenControlled`,actions:[`setTriggerValue`,`invokeOnOpen`]},{target:`open`,actions:[`setTriggerValue`,`invokeOnOpen`]}]}},opening:{tags:[`closed`],effects:[`waitForOpenDelay`],on:{"CONTROLLED.OPEN":{target:`open`},"CONTROLLED.CLOSE":{target:`closed`,actions:[`focusTrigger`]},BLUR:[{guard:`isOpenControlled`,actions:[`invokeOnClose`,`releaseParentRoutingLock`]},{target:`closed`,actions:[`invokeOnClose`,`releaseParentRoutingLock`,`focusTrigger`]}],TRIGGER_POINTERLEAVE:[{guard:`isOpenControlled`,actions:[`invokeOnClose`,`releaseParentRoutingLock`]},{target:`closed`,actions:[`invokeOnClose`,`releaseParentRoutingLock`,`focusTrigger`]}],"DELAY.OPEN":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`invokeOnOpen`]}]}},closing:{tags:[`open`],effects:[`trackPointerMove`,`trackInteractOutside`,`waitForCloseDelay`],on:{"CONTROLLED.OPEN":{target:`open`},"CONTROLLED.CLOSE":{target:`closed`,actions:[`focusParentMenu`,`restoreParentHighlightedItem`]},MENU_POINTERENTER:{target:`open`,actions:[`clearIntentPolygon`]},POINTER_MOVED_AWAY_FROM_SUBMENU:[{guard:`isOpenControlled`,actions:[`invokeOnClose`,`releaseParentRoutingLock`]},{target:`closed`,actions:[`focusParentMenu`,`restoreParentHighlightedItem`]}],"DELAY.CLOSE":[{guard:`isOpenControlled`,actions:[`invokeOnClose`,`releaseParentRoutingLock`]},{target:`closed`,actions:[`focusParentMenu`,`restoreParentHighlightedItem`,`invokeOnClose`,`releaseParentRoutingLock`]}]}},closed:{tags:[`closed`],entry:[`clearHighlightedItem`,`unlockParentOnClose`,`clearAnchorPoint`],on:{"CONTROLLED.OPEN":[{guard:ey(`isOpenAutoFocusEvent`,`isArrowDownEvent`),target:`open`,actions:[`highlightFirstItem`]},{guard:`isArrowUpEvent`,target:`open`,actions:[`highlightLastItem`]},{target:`open`}],CONTEXT_MENU_START:{target:`opening:contextmenu`,actions:[`setAnchorPoint`,`setTriggerValue`]},CONTEXT_MENU:[{guard:`isOpenControlled`,actions:[`setAnchorPoint`,`setTriggerValue`,`invokeOnOpen`]},{target:`open`,actions:[`setAnchorPoint`,`setTriggerValue`,`invokeOnOpen`]}],TRIGGER_CLICK:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`,`setTriggerValue`]},{target:`open`,actions:[`invokeOnOpen`,`setTriggerValue`]}],TRIGGER_POINTERMOVE:{guard:`isTriggerItem`,target:`opening`},TRIGGER_BLUR:{target:`idle`},ARROW_DOWN:[{guard:`isOpenControlled`,actions:[`setTriggerValue`,`invokeOnOpen`]},{target:`open`,actions:[`setTriggerValue`,`highlightFirstItem`,`invokeOnOpen`]}],ARROW_UP:[{guard:`isOpenControlled`,actions:[`setTriggerValue`,`invokeOnOpen`]},{target:`open`,actions:[`setTriggerValue`,`highlightLastItem`,`invokeOnOpen`]}]}},open:{tags:[`open`],effects:[`trackInteractOutside`,`trackFocusVisible`,`trackPositioning`,`scrollToHighlightedItem`],entry:[`focusMenu`,`unlockParentOnOpen`],on:{"CONTROLLED.CLOSE":[{target:`closed`,guard:`isArrowLeftEvent`,actions:[`focusParentMenu`]},{target:`closed`,actions:[`focusTrigger`]}],TRIGGER_CLICK:[{guard:$v(Qv(`isTriggerItem`),`isOpenControlled`),actions:[`invokeOnClose`,`releaseParentRoutingLock`]},{guard:Qv(`isTriggerItem`),target:`closed`,actions:[`invokeOnClose`,`releaseParentRoutingLock`,`focusTrigger`]}],CONTEXT_MENU:{actions:[`setAnchorPoint`,`setTriggerValue`,`focusMenu`]},ARROW_UP:{actions:[`highlightPrevItem`,`focusMenu`]},ARROW_DOWN:{actions:[`highlightNextItem`,`focusMenu`]},ARROW_LEFT:[{guard:$v(`isSubmenu`,`isOpenControlled`),actions:[`invokeOnClose`,`releaseParentRoutingLock`]},{guard:`isSubmenu`,target:`closed`,actions:[`focusParentMenu`,`invokeOnClose`,`releaseParentRoutingLock`]}],HOME:{actions:[`highlightFirstItem`,`focusMenu`]},END:{actions:[`highlightLastItem`,`focusMenu`]},ARROW_RIGHT:{guard:`isTriggerItemHighlighted`,actions:[`openSubmenu`]},ENTER:[{guard:`isTriggerItemHighlighted`,actions:[`openSubmenu`]},{actions:[`clickHighlightedItem`]}],ITEM_POINTERMOVE:[{guard:Qv(`isPointerRoutingLocked`),actions:[`setHighlightedItem`,`focusMenu`,`closeSiblingMenus`]},{actions:[`setLastHighlightedItem`,`closeSiblingMenus`]}],ITEM_POINTERLEAVE:{guard:$v(Qv(`isPointerRoutingLocked`),Qv(`isTriggerItem`)),actions:[`clearHighlightedItem`]},ITEM_CLICK:[{guard:$v(Qv(`isTriggerItemHighlighted`),Qv(`isHighlightedItemEditable`),`closeOnSelect`,`isOpenControlled`),actions:[`invokeOnSelect`,`setOptionState`,`closeRootMenu`,`invokeOnClose`,`releaseParentRoutingLock`]},{guard:$v(Qv(`isTriggerItemHighlighted`),Qv(`isHighlightedItemEditable`),`closeOnSelect`),target:`closed`,actions:[`invokeOnSelect`,`setOptionState`,`closeRootMenu`,`invokeOnClose`,`releaseParentRoutingLock`,`focusTrigger`]},{guard:$v(Qv(`isTriggerItemHighlighted`),Qv(`isHighlightedItemEditable`)),actions:[`invokeOnSelect`,`setOptionState`]},{actions:[`setHighlightedItem`]}],TRIGGER_POINTERMOVE:{guard:`isTriggerItem`,actions:[`setIntentPolygon`]},TRIGGER_POINTERLEAVE:{target:`closing`,actions:[`setIntentPolygon`]},ITEM_POINTERDOWN:{actions:[`setHighlightedItem`]},TYPEAHEAD:{actions:[`highlightMatchedItem`]},FOCUS_MENU:{actions:[`focusMenu`]},"POSITIONING.SET":{actions:[`reposition`]}}}},implementations:{guards:{closeOnSelect:({prop:e,event:t})=>!!(t?.closeOnSelect??e(`closeOnSelect`)),isTriggerItem:({event:e})=>av(e.target),isTriggerItemHighlighted:({event:e,scope:t,computed:n})=>!!(e.target??t.getById(n(`highlightedId`)))?.hasAttribute(`data-controls`),isSubmenu:({context:e})=>e.get(`isSubmenu`),isPointerRoutingLocked:({refs:e})=>e.get(`pointerRoutingLocked`),isHighlightedItemEditable:({scope:e,computed:t})=>Nr(e.getById(t(`highlightedId`))),isOpenControlled:({prop:e})=>e(`open`)!==void 0,isArrowLeftEvent:({event:e})=>e.previousEvent?.type===`ARROW_LEFT`,isArrowUpEvent:({event:e})=>e.previousEvent?.type===`ARROW_UP`,isArrowDownEvent:({event:e})=>e.previousEvent?.type===`ARROW_DOWN`,isOpenAutoFocusEvent:({event:e})=>e.previousEvent?.type===`OPEN_AUTOFOCUS`},effects:{waitForOpenDelay({send:e}){let t=setTimeout(()=>{e({type:`DELAY.OPEN`})},200);return()=>clearTimeout(t)},waitForCloseDelay({send:e}){let t=setTimeout(()=>{e({type:`DELAY.CLOSE`})},100);return()=>clearTimeout(t)},waitForLongPress({send:e}){let t=setTimeout(()=>{e({type:`LONG_PRESS.OPEN`})},700);return()=>clearTimeout(t)},trackFocusVisible({scope:e}){return Mo({root:e.getRootNode?.()})},trackPositioning({context:e,prop:t,scope:n,refs:r}){if(q_(n)||Y_(n).length>0)return;let i={...t(`positioning`),...r.get(`positioningOverride`)};return e.set(`currentPlacement`,i.placement),Hg(()=>X_(n,e.get(`triggerValue`)),()=>W_(n),{...i,defer:!0,onComplete(t){e.set(`currentPlacement`,t.placement)}})},trackInteractOutside({refs:e,scope:t,prop:n,context:r,send:i}){let a=()=>U_(t),o=!0,s=e=>Y_(t).some(t=>Pr(t,e));return Zv(a,{type:`menu`,defer:!0,exclude:[G_(t),...J_(t)].filter(Boolean),onInteractOutside:n(`onInteractOutside`),onRequestDismiss:n(`onRequestDismiss`),onFocusOutside(t){n(`onFocusOutside`)?.(t);let r=q(t.detail.originalEvent);if(s(r)){t.preventDefault();return}if(lv(r,e.get(`children`))){t.preventDefault();return}},onEscapeKeyDown(t){n(`onEscapeKeyDown`)?.(t),r.get(`isSubmenu`)&&t.preventDefault(),hv({parent:e.get(`parent`)})},onPointerDownOutside(e){if(n(`onPointerDownOutside`)?.(e),s(q(e.detail.originalEvent))&&e.detail.contextmenu){e.preventDefault();return}o=!e.detail.focusable},onDismiss(){i({type:`CLOSE`,src:`interact-outside`,restoreFocus:o})}})},trackPointerMove({context:e,scope:t,send:n,refs:r}){let i=r.get(`parent`);if(i)return vv(i,!0),xi(t.getDoc(),`pointermove`,t=>{gv(e.get(`intentPolygon`),{x:t.clientX,y:t.clientY})||(n({type:`POINTER_MOVED_AWAY_FROM_SUBMENU`}),vv(i,!1))})},scrollToHighlightedItem({scope:e,computed:t}){let n=()=>{ko()!==`pointer`&&$i(e.getById(t(`highlightedId`)),{rootEl:U_(e),block:`nearest`})};return J(()=>{Ao(`virtual`),n()}),Bi(()=>U_(e),{defer:!0,attributes:[`aria-activedescendant`],callback:n})}},actions:{setAnchorPoint({context:e,event:t}){e.set(`anchorPoint`,e=>tn(e,t.point)?e:t.point)},setSubmenuPlacement({context:e,computed:t,refs:n}){if(!e.get(`isSubmenu`))return;let r=t(`isRtl`)?`left-start`:`right-start`;n.set(`positioningOverride`,{placement:r,gutter:0})},reposition({context:e,scope:t,prop:n,event:r,refs:i}){let a=()=>W_(t),o=r.point??e.get(`anchorPoint`),s=o?()=>({width:0,height:0,...o}):void 0,c={...n(`positioning`),...i.get(`positioningOverride`)},l=r.value??e.get(`triggerValue`);Hg(()=>X_(t,l),a,{...c,defer:!0,getAnchorRect:s,...r.options??{},listeners:!1,onComplete(t){e.set(`currentPlacement`,t.placement)}})},setOptionState({event:e}){if(!e.option)return;let{checked:t,onCheckedChange:n,type:r}=e.option;r===`radio`?n?.(!0):r===`checkbox`&&n?.(!t)},clickHighlightedItem({scope:e,computed:t,prop:n,context:r}){let i=e.getById(t(`highlightedId`));if(!i||i.dataset.disabled)return;let a=r.get(`highlightedValue`);kr(i)?n(`navigate`)?.({value:a,node:i,href:i.href}):queueMicrotask(()=>i.click())},setIntentPolygon({context:e,scope:t,event:n}){let r=U_(t),i=e.get(`currentPlacement`);if(!r||!i)return;let a=pv(r.getBoundingClientRect(),i);if(!a)return;let o=Tg(i)===`right`?-5:5;e.set(`intentPolygon`,[{...n.point,x:n.point.x+o},...a])},clearIntentPolygon({context:e}){e.set(`intentPolygon`,null)},clearAnchorPoint({context:e}){e.set(`anchorPoint`,null)},unlockParentOnOpen({refs:e,context:t,scope:n}){let r=e.get(`parent`);if(t.get(`isSubmenu`)){let e=P_(n);r?.send({type:`HIGHLIGHTED.SUGGEST`,value:e})}vv(r,!1)},unlockParentOnClose({refs:e,context:t}){bv(e.get(`parent`),t.get(`isSubmenu`))},setHighlightedItem({context:e,event:t}){let n=t.value||V_(t.target);e.set(`highlightedValue`,n)},clearHighlightedItem({context:e}){e.set(`highlightedValue`,null)},focusMenu({scope:e}){J(()=>{let t=U_(e);Pi({root:t,enabled:!Pr(t,e.getActiveElement()),filter(e){return!e.role?.startsWith(`menuitem`)}})?.focus({preventScroll:!0})})},highlightFirstItem({context:e,scope:t}){(U_(t)?queueMicrotask:J)(()=>{let n=Q_(t);n&&e.set(`highlightedValue`,V_(n))})},highlightLastItem({context:e,scope:t}){(U_(t)?queueMicrotask:J)(()=>{let n=$_(t);n&&e.set(`highlightedValue`,V_(n))})},highlightNextItem({context:e,scope:t,event:n,prop:r}){let i=tv(t,{loop:n.loop,value:e.get(`highlightedValue`),loopFocus:r(`loopFocus`)});e.set(`highlightedValue`,V_(i))},highlightPrevItem({context:e,scope:t,event:n,prop:r}){let i=nv(t,{loop:n.loop,value:e.get(`highlightedValue`),loopFocus:r(`loopFocus`)});e.set(`highlightedValue`,V_(i))},invokeOnSelect({context:e,prop:t,scope:n}){let r=e.get(`highlightedValue`);r!=null&&(sv(K_(n,r),r),t(`onSelect`)?.({value:r}))},focusTrigger({scope:e,context:t,event:n}){t.get(`isSubmenu`)||t.get(`anchorPoint`)||n.restoreFocus===!1||queueMicrotask(()=>{X_(e,t.get(`triggerValue`))?.focus({preventScroll:!0})})},highlightMatchedItem({scope:e,context:t,event:n,refs:r}){let i=rv(e,{key:n.key,value:t.get(`highlightedValue`),typeaheadState:r.get(`typeaheadState`)});i&&t.set(`highlightedValue`,V_(i))},setParentMenu({refs:e,event:t,context:n}){e.set(`parent`,t.value),n.set(`isSubmenu`,!0)},setChildMenu({refs:e,event:t}){let n=e.get(`children`);n[t.id]=t.value,e.set(`children`,n)},closeSiblingMenus({refs:e,event:t,scope:n}){let r=t.target;if(!av(r))return;let i=r?.getAttribute(`data-uid`),a=e.get(`children`);for(let e in a){if(e===i)continue;let r=a[e],o=r.context.get(`intentPolygon`);o&&t.point&&mv(o,t.point)||(U_(n)?.focus({preventScroll:!0}),r.send({type:`CLOSE`}))}},closeRootMenu({refs:e}){hv({parent:e.get(`parent`)})},openSubmenu({refs:e,scope:t,computed:n}){let r=t.getById(n(`highlightedId`))?.getAttribute(`data-uid`),i=e.get(`children`);(r?i[r]:null)?.send({type:`OPEN_AUTOFOCUS`})},focusParentMenu({refs:e}){e.get(`parent`)?.send({type:`FOCUS_MENU`})},setLastHighlightedItem({context:e,event:t}){e.set(`lastHighlightedValue`,V_(t.target))},suggestHighlightedItem({context:e,event:t}){let n=t.value;if(n){if(e.get(`highlightedValue`)!=null){e.set(`lastHighlightedValue`,n);return}e.set(`highlightedValue`,n)}},restoreHighlightedItem({context:e}){let t=e.get(`lastHighlightedValue`);e.set(`lastHighlightedValue`,null),t&&e.set(`highlightedValue`,t)},restoreParentHighlightedItem({refs:e}){e.get(`parent`)?.send({type:`HIGHLIGHTED.RESTORE`})},invokeOnOpen({prop:e}){e(`onOpenChange`)?.({open:!0})},invokeOnClose({prop:e}){e(`onOpenChange`)?.({open:!1})},releaseParentRoutingLock({refs:e,context:t}){t.get(`isSubmenu`)&&xv(e.get(`parent`))},toggleVisibility({prop:e,event:t,send:n}){n({type:e(`open`)?`CONTROLLED.OPEN`:`CONTROLLED.CLOSE`,previousEvent:t})},setTriggerValue({context:e,event:t}){t.value!==void 0&&e.set(`triggerValue`,t.value)}}}}),[ny,Q]=Z({hookName:`useMenuContext`,providerName:`<MenuProvider />`,strict:!1}),ry=e=>{let t=Q(),n=Y(()=>t().getArrowProps(),e);return F(X.div,n)},iy=e=>{let t=Q(),n=Y(()=>t().getArrowTipProps(),e);return F(X.div,n)},[ay,oy]=Z({hookName:`useMenuItemContext`,providerName:`<MenuItemProvider />`}),[sy,cy]=Z({hookName:`useMenuItemPropsContext`,providerName:`<MenuItemPropsProvider />`}),ly=e=>{let[t,n]=U()(e,[`checked`,`closeOnSelect`,`disabled`,`onCheckedChange`,`value`,`valueText`]),r=Y(t,{type:`checkbox`}),i=Q(),a=Y(()=>i().getOptionItemProps(r),n),o=O(()=>i().getOptionItemState(r));return F(sy,{value:r,get children(){return F(ay,{value:o,get children(){return F(X.div,a)}})}})},uy=e=>{let t=Q(),n=hm(),r=Y(()=>t().getContentProps(),()=>n().presenceProps,e);return F(R,{get when(){return!n().unmounted},get children(){return F(X.div,I(r,{ref(t){var r=Pt(n().ref,e.ref);typeof r==`function`&&r(t)}}))}})},dy=e=>e.children(Q()),fy=e=>{let t=Q(),n=Y(()=>t().getContextTriggerProps(),e);return F(X.button,n)},py=e=>{let t=Q(),n=Y(()=>t().getIndicatorProps(),e);return F(X.div,n)},my=e=>{let[t,n]=U()(e,[`closeOnSelect`,`disabled`,`value`,`valueText`,`onSelect`]),r=Q(),i=Y(()=>r().getItemProps(t),n),a=O(()=>r().getItemState(t));return D(()=>{let e=r().addItemListener({id:a().id,onSelect:t.onSelect});N(()=>e?.())}),F(sy,{value:t,get children(){return F(ay,{value:a,get children(){return F(X.div,i)}})}})},hy=e=>e.children(oy()),[gy,_y]=Z({hookName:`useMenuItemGroupContext`,providerName:`<MenuItemGroupProvider />`}),vy=e=>{let[t,n]=U()(e,[`id`]),r=Y({id:He()},t),i=Q(),a=Y(()=>i().getItemGroupProps(r),n);return F(gy,{value:r,get children(){return F(X.div,a)}})},yy=e=>{let t=Q(),n=_y(),r=Y(t().getItemGroupLabelProps({htmlFor:n.id}),e);return F(X.div,r)},by=e=>{let t=Q(),n=cy(),r=Y(()=>t().getItemIndicatorProps(n),e);return F(X.div,r)},xy=e=>{let t=Q(),n=cy(),r=Y(()=>t().getItemTextProps(n),e);return F(X.div,r)},Sy=e=>{let t=Q(),n=hm(),r=Y(()=>t().getPositionerProps(),e);return F(R,{get when(){return!n().unmounted},get children(){return F(X.div,r)}})},Cy=e=>{let[t,n]=U()(e,[`closeOnSelect`,`disabled`,`value`,`valueText`]),r=Q(),i=_y(),a=Y(t,()=>({type:`radio`,checked:i.value===t.value,onCheckedChange:()=>i.onValueChange?.({value:t.value})})),o=Y(()=>r().getOptionItemProps(a),n),s=O(()=>r().getOptionItemState(a));return F(sy,{value:a,get children(){return F(ay,{value:s,get children(){return F(X.div,o)}})}})},wy=e=>{let[t,n]=U()(e,[`id`,`onValueChange`,`value`]),r=Q(),i=Y({id:He()},t),a=Y(()=>r().getItemGroupProps(i),n);return F(gy,{value:i,get children(){return F(X.div,a)}})},Ty=e=>{let t=He(),n=Bo(),r=Ia(),i=_a(ty,O(()=>({id:t,dir:n().dir,getRootNode:r().getRootNode,...Bt(e)})));return{api:O(()=>Sv(i,Ta)),service:i}},[Ey,Dy]=Z({hookName:`useMenuMachineContext`,providerName:`<MenuMachineProvider />`,strict:!1}),[Oy,ky]=Z({hookName:`useMenuMachineContext`,providerName:`<MenuMachineProvider />`,strict:!1}),Ay=e=>{let[t,n]=pm(e),[r,i]=U()(n,[`anchorPoint`,`aria-label`,`closeOnSelect`,`composite`,`defaultHighlightedValue`,`defaultOpen`,`highlightedValue`,`id`,`ids`,`loopFocus`,`navigate`,`onEscapeKeyDown`,`onFocusOutside`,`onHighlightChange`,`onInteractOutside`,`onOpenChange`,`onPointerDownOutside`,`onRequestDismiss`,`onSelect`,`open`,`positioning`,`typeahead`,`triggerValue`,`defaultTriggerValue`,`onTriggerValueChange`]),a=Q(),o=Dy(),s=Ty(r),c=fm(Y(t,()=>({present:s.api().open})));return te(()=>{o&&(a?.().setChild(s.service),s.api().setParent(o))}),F(Oy,{value:()=>a?.().getTriggerItemProps(s.api()),get children(){return F(Ey,{get value(){return s.service},get children(){return F(ny,{get value(){return s.api},get children(){return F(mm,{value:c,get children(){return i.children}})}})}})}})},jy=e=>{let t=Q(),n=Dy(),[r,i]=pm(e),a=fm(Y(r,()=>({present:i.value.api().open})));return D(()=>{n&&(t?.().setChild(i.value.service),i.value.api().setParent(n))}),F(Oy,{value:()=>t?.().getTriggerItemProps(i.value.api()),get children(){return F(Ey,{get value(){return i.value.service},get children(){return F(ny,{get value(){return i.value.api},get children(){return F(mm,{value:a,get children(){return i.children}})}})}})}})},My=e=>{let t=Q(),n=Y(()=>t().getSeparatorProps(),e);return F(X.hr,n)},Ny=e=>{let[t,n]=U()(e,[`value`]),r=Q(),i=hm(),a=Y(()=>r().getTriggerProps(t),()=>({"aria-controls":i().unmounted&&null}),n);return F(X.button,a)},Py=e=>{let t=ky(),n=Y(()=>t?.(),e);return F(sy,{get value(){return{value:n[`data-value`]}},get children(){return F(X.div,n)}})},Fy={};Ra(Fy,{Arrow:()=>ry,ArrowTip:()=>iy,CheckboxItem:()=>ly,Content:()=>uy,Context:()=>dy,ContextTrigger:()=>fy,Indicator:()=>py,Item:()=>my,ItemContext:()=>hy,ItemGroup:()=>vy,ItemGroupLabel:()=>yy,ItemIndicator:()=>by,ItemText:()=>xy,Positioner:()=>Sy,RadioItem:()=>Cy,RadioItemGroup:()=>wy,Root:()=>Ay,RootProvider:()=>jy,Separator:()=>My,Trigger:()=>Ny,TriggerItem:()=>Py});var Iy=z(`<span class="text-xs leading-none tabular-nums"data-testid=error-spans-count>`),Ly=z(`<div class="flex items-baseline gap-2"><span class="min-w-0 flex-1 truncate font-mono text-sm font-semibold text-gray-900"></span><span class="shrink-0 font-mono text-xs text-gray-500">`),Ry=z(`<div class="mt-1 flex items-center gap-2 text-xs text-gray-500"><span>`),zy=z(`<div class="mt-1 max-h-16 overflow-hidden whitespace-pre-wrap text-xs text-red-700"data-testid=error-spans-item-message>`),By=z(`<span class=text-gray-300>|`),Vy=z(`<span class="truncate font-mono">`);function Hy(e){let t=()=>e.spans.length,n=t=>{t.open||e.onSpanHover?.(null)},r=t=>{e.onSpanHover?.(t.highlightedValue)},i=t=>()=>{e.onSpanSelect(t.id),e.onSpanHover?.(null)};return F(Fy.Root,{onOpenChange:n,onHighlightChange:r,positioning:{placement:`bottom-end`,gutter:4,overflowPadding:8},loopFocus:!0,get children(){return[F(Fy.Trigger,{type:`button`,class:`inline-flex h-8 min-w-8 items-center justify-center gap-1.5 rounded-full border px-2.5 text-sm font-semibold leading-none transition-colors`,get classList(){return{"border-red-300 bg-red-50 text-red-700 hover:bg-red-100":t()>0,"border-gray-200 bg-gray-50 text-gray-300":t()===0}},get disabled(){return t()===0},get"aria-label"(){return`${t()} error spans`},"data-testid":`error-spans-button`,get title(){return t()>0?`Show error spans`:`No error spans`},get children(){return[F(Yd,{size:15,strokeWidth:2.4,"aria-hidden":`true`}),F(R,{get when(){return t()>0},get children(){var e=Iy();return H(e,t),e}})]}}),F(kt,{get children(){return F(Fy.Positioner,{get children(){return F(Fy.Content,{class:`mt-1 max-h-96 w-[min(24rem,calc(100vw-1rem))] overflow-y-auto rounded-md border border-red-200 bg-white shadow-lg z-50`,"data-testid":`error-spans-dropdown`,get children(){return F(Fy.ItemGroup,{id:`error-spans`,get children(){return[F(Fy.ItemGroupLabel,{class:`border-b border-red-100 bg-red-50 px-4 py-2 text-xs font-semibold uppercase tracking-wide text-red-700`,get children(){return[`Error Spans (`,nt(()=>t()),`)`]}}),F(L,{get each(){return e.spans},children:e=>F(Fy.Item,{get value(){return e.id},get valueText(){return e.title},class:`block w-full cursor-pointer border-b border-gray-100 px-4 py-3 text-left last:border-b-0 data-[highlighted]:bg-red-50`,"data-testid":`error-spans-item`,get onSelect(){return i(e)},get children(){return[(()=>{var t=Ly(),n=t.firstChild,r=n.nextSibling;return H(n,()=>e.title),H(r,()=>nf(e.startOffsetMs)),t})(),F(R,{get when(){return e.status?.message},children:e=>(()=>{var t=zy();return H(t,e),t})()}),(()=>{var t=Ry(),n=t.firstChild;return H(n,()=>e.serviceName),H(t,F(R,{get when(){return Uy(e)},children:e=>[By(),(()=>{var t=Vy();return H(t,e),t})()]}),null),t})()]}})})]}})}})}})}})]}})}function Uy(e){let t=e.attributes[`code.file.path`],n=e.attributes[`code.line.number`];return typeof t==`string`?typeof n==`number`?`${t}:${n}`:t:null}var Wy=Ft(`combobox`).parts(`root`,`clearTrigger`,`content`,`control`,`input`,`item`,`itemGroup`,`itemGroupLabel`,`itemIndicator`,`itemText`,`label`,`list`,`positioner`,`trigger`),Gy=Wy.build(),Ky=Object.defineProperty,qy=(e,t,n)=>t in e?Ky(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$=(e,t,n)=>qy(e,typeof t==`symbol`?t:t+``,n),Jy={itemToValue(e){return typeof e==`string`?e:on(e)&&dn(e,`value`)?e.value:``},itemToString(e){return typeof e==`string`?e:on(e)&&dn(e,`label`)?e.label:Jy.itemToValue(e)},isItemDisabled(e){return on(e)&&dn(e,`disabled`)?!!e.disabled:!1}},Yy=class e{constructor(t){$(this,`options`,t),$(this,`items`),$(this,`indexMap`,null),$(this,`copy`,t=>new e({...this.options,items:t??[...this.items]})),$(this,`isEqual`,e=>tn(this.items,e.items)),$(this,`setItems`,e=>this.copy(e)),$(this,`getValues`,(e=this.items)=>{let t=[];for(let n of e){let e=this.getItemValue(n);e!=null&&t.push(e)}return t}),$(this,`find`,e=>{if(e==null)return null;let t=this.indexOf(e);return t===-1?null:this.at(t)}),$(this,`findMany`,e=>{let t=[];for(let n of e){let e=this.find(n);e!=null&&t.push(e)}return t}),$(this,`at`,e=>{if(!this.options.groupBy&&!this.options.groupSort)return this.items[e]??null;let t=0,n=this.group();for(let[,r]of n)for(let n of r){if(t===e)return n;t++}return null}),$(this,`sortFn`,(e,t)=>{let n=this.indexOf(e),r=this.indexOf(t);return(n??0)-(r??0)}),$(this,`sort`,e=>[...e].sort(this.sortFn.bind(this))),$(this,`getItemValue`,e=>e==null?null:this.options.itemToValue?.(e)??Jy.itemToValue(e)),$(this,`getItemDisabled`,e=>e==null?!1:this.options.isItemDisabled?.(e)??Jy.isItemDisabled(e)),$(this,`stringifyItem`,e=>e==null?null:this.options.itemToString?.(e)??Jy.itemToString(e)),$(this,`stringify`,e=>e==null?null:this.stringifyItem(this.find(e))),$(this,`stringifyItems`,(e,t=`, `)=>{let n=[];for(let t of e){let e=this.stringifyItem(t);e!=null&&n.push(e)}return n.join(t)}),$(this,`stringifyMany`,(e,t)=>this.stringifyItems(this.findMany(e),t)),$(this,`has`,e=>this.indexOf(e)!==-1),$(this,`hasItem`,e=>e==null?!1:this.has(this.getItemValue(e))),$(this,`group`,()=>{let{groupBy:e,groupSort:t}=this.options;if(!e)return[[``,[...this.items]]];let n=new Map;this.items.forEach((t,r)=>{let i=e(t,r);n.has(i)||n.set(i,[]),n.get(i).push(t)});let r=Array.from(n.entries());return t&&r.sort(([e],[n])=>{if(typeof t==`function`)return t(e,n);if(Array.isArray(t)){let r=t.indexOf(e),i=t.indexOf(n);return r===-1?1:i===-1?-1:r-i}return t===`asc`?e.localeCompare(n):t===`desc`?n.localeCompare(e):0}),r}),$(this,`getNextValue`,(e,t=1,n=!1)=>{let r=this.indexOf(e);if(r===-1)return null;for(r=n?Math.min(r+t,this.size-1):r+t;r<=this.size&&this.getItemDisabled(this.at(r));)r++;return this.getItemValue(this.at(r))}),$(this,`getPreviousValue`,(e,t=1,n=!1)=>{let r=this.indexOf(e);if(r===-1)return null;for(r=n?Math.max(r-t,0):r-t;r>=0&&this.getItemDisabled(this.at(r));)r--;return this.getItemValue(this.at(r))}),$(this,`indexOf`,e=>{if(e==null)return-1;if(!this.options.groupBy&&!this.options.groupSort)return this.items.findIndex(t=>this.getItemValue(t)===e);if(!this.indexMap){this.indexMap=new Map;let e=0,t=this.group();for(let[,n]of t)for(let t of n){let n=this.getItemValue(t);n!=null&&this.indexMap.set(n,e),e++}}return this.indexMap.get(e)??-1}),$(this,`getByText`,(e,t)=>{let n=t==null?-1:this.indexOf(t),r=e.length===1;for(let i=0;i<this.items.length;i++){let a=this.items[(n+i+1)%this.items.length];if(!(r&&this.getItemValue(a)===t)&&!this.getItemDisabled(a)&&Xy(this.stringifyItem(a),e))return a}}),$(this,`search`,(e,t)=>{let{state:n,currentValue:r,timeout:i=350}=t,a=n.keysSoFar+e,o=a.length>1&&Array.from(a).every(e=>e===a[0])?a[0]:a,s=this.getByText(o,r),c=this.getItemValue(s);function l(){clearTimeout(n.timer),n.timer=-1}function u(e){n.keysSoFar=e,l(),e!==``&&(n.timer=+setTimeout(()=>{u(``),l()},i))}return u(a),c}),$(this,`update`,(e,t)=>{let n=this.indexOf(e);return n===-1?this:this.copy([...this.items.slice(0,n),t,...this.items.slice(n+1)])}),$(this,`upsert`,(e,t,n=`append`)=>{let r=this.indexOf(e);return r===-1?(n===`append`?this.append:this.prepend)(t):this.copy([...this.items.slice(0,r),t,...this.items.slice(r+1)])}),$(this,`insert`,(e,...t)=>this.copy(Zy(this.items,e,...t))),$(this,`insertBefore`,(e,...t)=>{let n=this.indexOf(e);if(n===-1)if(this.items.length===0)n=0;else return this;return this.copy(Zy(this.items,n,...t))}),$(this,`insertAfter`,(e,...t)=>{let n=this.indexOf(e);if(n===-1)if(this.items.length===0)n=0;else return this;return this.copy(Zy(this.items,n+1,...t))}),$(this,`prepend`,(...e)=>this.copy(Zy(this.items,0,...e))),$(this,`append`,(...e)=>this.copy(Zy(this.items,this.items.length,...e))),$(this,`filter`,e=>{let t=this.items.filter((t,n)=>e(this.stringifyItem(t),n,t));return this.copy(t)}),$(this,`remove`,(...e)=>{let t=e.map(e=>typeof e==`string`?e:this.getItemValue(e));return this.copy(this.items.filter(e=>{let n=this.getItemValue(e);return n==null?!1:!t.includes(n)}))}),$(this,`move`,(e,t)=>{let n=this.indexOf(e);return n===-1?this:this.copy(Qy(this.items,[n],t))}),$(this,`moveBefore`,(e,...t)=>{let n=this.items.findIndex(t=>this.getItemValue(t)===e);if(n===-1)return this;let r=t.map(e=>this.items.findIndex(t=>this.getItemValue(t)===e)).sort((e,t)=>e-t);return this.copy(Qy(this.items,r,n))}),$(this,`moveAfter`,(e,...t)=>{let n=this.items.findIndex(t=>this.getItemValue(t)===e);if(n===-1)return this;let r=t.map(e=>this.items.findIndex(t=>this.getItemValue(t)===e)).sort((e,t)=>e-t);return this.copy(Qy(this.items,r,n+1))}),$(this,`reorder`,(e,t)=>this.copy(Qy(this.items,[e],t))),$(this,`compareValue`,(e,t)=>{let n=this.indexOf(e),r=this.indexOf(t);return n<r?-1:+(n>r)}),$(this,`range`,(e,t)=>{let n=[],r=e;for(;r!=null;){if(this.find(r)&&n.push(r),r===t)return n;r=this.getNextValue(r)}return[]}),$(this,`getValueRange`,(e,t)=>e&&t?this.compareValue(e,t)<=0?this.range(e,t):this.range(t,e):[]),$(this,`toString`,()=>{let e=``;for(let t of this.items){let n=[this.getItemValue(t),this.stringifyItem(t),this.getItemDisabled(t)].filter(Boolean).join(`:`);e+=n+`,`}return e}),$(this,`toJSON`,()=>({size:this.size,first:this.firstValue,last:this.lastValue})),this.items=[...t.items]}get size(){return this.items.length}get firstValue(){let e=0;for(;this.getItemDisabled(this.at(e));)e++;return this.getItemValue(this.at(e))}get lastValue(){let e=this.size-1;for(;this.getItemDisabled(this.at(e));)e--;return this.getItemValue(this.at(e))}*[Symbol.iterator](){yield*this.items}},Xy=(e,t)=>!!e?.toLowerCase().startsWith(t.toLowerCase());function Zy(e,t,...n){return[...e.slice(0,t),...n,...e.slice(t)]}function Qy(e,t,n){t=[...t].sort((e,t)=>e-t);let r=t.map(t=>e[t]);for(let n=t.length-1;n>=0;n--)e=[...e.slice(0,t[n]),...e.slice(t[n]+1)];return n=Math.max(0,n-t.filter(e=>e<n).length),[...e.slice(0,n),...r,...e.slice(n)]}function $y({values:e,collection:t,selectedItemMap:n}){let r=[];for(let i of e){let e=t.find(i)??n.get(i);e!=null&&r.push(e)}return r}function eb({selectedItemMap:e,values:t,selectedItems:n,collection:r}){let i=new Map(e);for(let e of n){let t=r.getItemValue(e);t!=null&&i.set(t,e)}let a=new Set(t);for(let e of i.keys())a.has(e)||i.delete(e);return i}function tb({values:e,collection:t,selectedItemMap:n}){let r=$y({values:e,collection:t,selectedItemMap:n});return{selectedItems:r,nextSelectedItemMap:eb({selectedItemMap:n,values:e,selectedItems:r,collection:t})}}function nb({selectedItems:e,collection:t}){return eb({selectedItemMap:new Map,values:e.map(e=>t.getItemValue(e)).filter(Boolean),selectedItems:e,collection:t})}var rb=e=>new Yy(e);rb.empty=()=>new Yy({items:[]});var ib=e=>e.ids?.root??`combobox:${e.id}`,ab=e=>e.ids?.label??`combobox:${e.id}:label`,ob=e=>e.ids?.control??`combobox:${e.id}:control`,sb=e=>e.ids?.input??`combobox:${e.id}:input`,cb=e=>e.ids?.content??`combobox:${e.id}:content`,lb=e=>e.ids?.positioner??`combobox:${e.id}:popper`,ub=e=>e.ids?.trigger??`combobox:${e.id}:toggle-btn`,db=e=>e.ids?.clearTrigger??`combobox:${e.id}:clear-btn`,fb=(e,t)=>e.ids?.itemGroup?.(t)??`combobox:${e.id}:optgroup:${t}`,pb=(e,t)=>e.ids?.itemGroupLabel?.(t)??`combobox:${e.id}:optgroup-label:${t}`,mb=(e,t)=>e.ids?.item?.(t)??`combobox:${e.id}:option:${t}`,hb=e=>e.getById(cb(e)),gb=e=>e.getById(sb(e)),_b=e=>e.getById(lb(e)),vb=e=>e.getById(ob(e)),yb=e=>e.getById(ub(e)),bb=e=>e.getById(db(e)),xb=(e,t)=>{if(t==null)return null;let n=`[role=option][data-value="${CSS.escape(t)}"]`;return Ji(hb(e),n)},Sb=e=>{let t=gb(e);e.isActiveElement(t)||t?.focus({preventScroll:!0}),mr(t)},Cb=e=>{let t=yb(e);e.isActiveElement(t)||t?.focus({preventScroll:!0})};function wb(e,t){let{context:n,prop:r,state:i,send:a,scope:o,computed:s,event:c}=e,l=r(`translations`),u=r(`collection`),d=!!r(`disabled`),f=s(`isInteractive`),p=!!r(`invalid`),m=!!r(`required`),h=!!r(`readOnly`),g=i.hasTag(`open`),_=i.hasTag(`focused`),v=r(`composite`),y=n.get(`highlightedValue`),b=n.get(`currentPlacement`),x=b?Tg(b):void 0,S=Wg({...r(`positioning`),placement:b});function C(e){let t=u.getItemDisabled(e.item),r=u.getItemValue(e.item);return jn(r,()=>`[zag-js] No value found for item ${JSON.stringify(e.item)}`),{value:r,disabled:!!(d||t),highlighted:y===r,selected:n.get(`value`).includes(r)}}return{focused:_,open:g,inputValue:n.get(`inputValue`),highlightedValue:y,highlightedItem:n.get(`highlightedItem`),value:n.get(`value`),valueAsString:s(`valueAsString`),hasSelectedItems:s(`hasSelectedItems`),selectedItems:s(`selectedItems`),collection:r(`collection`),multiple:!!r(`multiple`),disabled:!!d,syncSelectedItems(){a({type:`SELECTED_ITEMS.SYNC`})},reposition(e={}){a({type:`POSITIONING.SET`,options:e})},setHighlightValue(e){a({type:`HIGHLIGHTED_VALUE.SET`,value:e})},clearHighlightValue(){a({type:`HIGHLIGHTED_VALUE.CLEAR`})},selectValue(e){a({type:`ITEM.SELECT`,value:e})},setValue(e){a({type:`VALUE.SET`,value:e})},setInputValue(e,t=`script`){a({type:`INPUT_VALUE.SET`,value:e,src:t})},clearValue(e){a(e==null?{type:`VALUE.CLEAR`}:{type:`ITEM.CLEAR`,value:e})},focus(){gb(o)?.focus()},setOpen(e,t=`script`){i.hasTag(`open`)!==e&&a({type:e?`OPEN`:`CLOSE`,src:t})},getRootProps(){return t.element({...Gy.root.attrs,dir:r(`dir`),id:ib(o),"data-invalid":W(p),"data-readonly":W(h)})},getLabelProps(){return t.label({...Gy.label.attrs,dir:r(`dir`),htmlFor:sb(o),id:ab(o),"data-readonly":W(h),"data-disabled":W(d),"data-invalid":W(p),"data-required":W(m),"data-focus":W(_),onClick(e){v||(e.preventDefault(),yb(o)?.focus({preventScroll:!0}))}})},getControlProps(){return t.element({...Gy.control.attrs,dir:r(`dir`),id:ob(o),"data-state":g?`open`:`closed`,"data-focus":W(_),"data-disabled":W(d),"data-invalid":W(p)})},getPositionerProps(){return t.element({...Gy.positioner.attrs,dir:r(`dir`),id:lb(o),style:S.floating})},getInputProps(){return t.input({...Gy.input.attrs,dir:r(`dir`),"aria-invalid":vr(p),"data-invalid":W(p),"data-autofocus":W(r(`autoFocus`)),name:r(`name`),form:r(`form`),disabled:d,required:r(`required`),autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:`false`,readOnly:h,placeholder:r(`placeholder`),id:sb(o),type:`text`,role:`combobox`,defaultValue:n.get(`inputValue`),"aria-autocomplete":s(`autoComplete`)?`both`:`list`,"aria-controls":cb(o),"aria-expanded":g,"data-state":g?`open`:`closed`,"aria-activedescendant":y?mb(o,y):void 0,onClick(e){e.defaultPrevented||r(`openOnClick`)&&f&&a({type:`INPUT.CLICK`,src:`input-click`})},onFocus(){d||a({type:`INPUT.FOCUS`})},onBlur(){d||a({type:`INPUT.BLUR`})},onChange(e){a({type:`INPUT.CHANGE`,value:e.currentTarget.value,src:`input-change`})},onKeyDown(e){if(e.defaultPrevented||!f||e.ctrlKey||e.shiftKey||ci(e))return;let t=r(`openOnKeyPress`),n=e.ctrlKey||e.metaKey||e.shiftKey,i={ArrowDown(e){!t&&!g||(a({type:e.altKey?`OPEN`:`INPUT.ARROW_DOWN`,keypress:!0,src:`arrow-key`}),e.preventDefault())},ArrowUp(){!t&&!g||(a({type:e.altKey?`CLOSE`:`INPUT.ARROW_UP`,keypress:!0,src:`arrow-key`}),e.preventDefault())},Home(e){n||(a({type:`INPUT.HOME`,keypress:!0}),g&&e.preventDefault())},End(e){n||(a({type:`INPUT.END`,keypress:!0}),g&&e.preventDefault())},Enter(e){a({type:`INPUT.ENTER`,keypress:!0,src:`item-select`});let t=y!=null,n=r(`alwaysSubmitOnEnter`),i=s(`isCustomValue`)&&!r(`allowCustomValue`);if(g&&!n&&(t||i)&&e.preventDefault(),y==null)return;let c=xb(o,y);kr(c)&&r(`navigate`)?.({value:y,node:c,href:c.href})},Escape(){a({type:`INPUT.ESCAPE`,keypress:!0,src:`escape-key`}),e.preventDefault()}}[vi(e,{dir:r(`dir`)})];i?.(e)}})},getTriggerProps(e={}){return t.button({...Gy.trigger.attrs,dir:r(`dir`),id:ub(o),"aria-haspopup":v?`listbox`:`dialog`,type:`button`,tabIndex:e.focusable?void 0:-1,"aria-label":l.triggerLabel,"aria-expanded":g,"data-state":g?`open`:`closed`,"aria-controls":g?cb(o):void 0,disabled:d,"data-invalid":W(p),"data-focusable":W(e.focusable),"data-readonly":W(h),"data-disabled":W(d),onFocus(){e.focusable&&a({type:`INPUT.FOCUS`,src:`trigger`})},onClick(e){e.defaultPrevented||f&&fi(e)&&a({type:`TRIGGER.CLICK`,src:`trigger-click`})},onPointerDown(e){f&&e.pointerType!==`touch`&&fi(e)&&(e.preventDefault(),queueMicrotask(()=>{Sb(o)}))},onKeyDown(e){if(e.defaultPrevented||v)return;let t={ArrowDown(){a({type:`INPUT.ARROW_DOWN`,src:`arrow-key`})},ArrowUp(){a({type:`INPUT.ARROW_UP`,src:`arrow-key`})}}[vi(e,{dir:r(`dir`)})];t&&(t(e),e.preventDefault())}})},getContentProps(){return t.element({...Gy.content.attrs,dir:r(`dir`),id:cb(o),role:v?`listbox`:`dialog`,tabIndex:-1,hidden:!g,"data-state":g?`open`:`closed`,"data-placement":b,"data-side":x,"aria-labelledby":ab(o),"aria-multiselectable":r(`multiple`)&&v?!0:void 0,"data-empty":W(u.size===0),onPointerDown(e){fi(e)&&e.preventDefault()}})},getListProps(){return t.element({...Gy.list.attrs,role:v?void 0:`listbox`,"data-empty":W(u.size===0),"aria-labelledby":ab(o),"aria-multiselectable":r(`multiple`)&&!v?!0:void 0})},getClearTriggerProps(){return t.button({...Gy.clearTrigger.attrs,dir:r(`dir`),id:db(o),type:`button`,tabIndex:-1,disabled:d,"data-invalid":W(p),"aria-label":l.clearTriggerLabel,"aria-controls":sb(o),hidden:!n.get(`value`).length,onPointerDown(e){fi(e)&&e.preventDefault()},onClick(e){e.defaultPrevented||f&&a({type:`VALUE.CLEAR`,src:`clear-trigger`})}})},getItemState:C,getItemProps(e){let n=C(e),i=n.value;return t.element({...Gy.item.attrs,dir:r(`dir`),id:mb(o,i),role:`option`,tabIndex:-1,"data-highlighted":W(n.highlighted),"data-state":n.selected?`checked`:`unchecked`,"aria-selected":vr(n.selected),"aria-disabled":vr(n.disabled),"data-disabled":W(n.disabled),"data-value":n.value,onPointerMove(){n.disabled||n.highlighted||a({type:`ITEM.POINTER_MOVE`,value:i})},onPointerLeave(){e.persistFocus||n.disabled||c.previous()?.type.includes(`POINTER`)&&a({type:`ITEM.POINTER_LEAVE`,value:i})},onClick(e){si(e)||oi(e)||pi(e)||n.disabled||a({type:`ITEM.CLICK`,src:`item-select`,value:i})}})},getItemTextProps(e){let n=C(e);return t.element({...Gy.itemText.attrs,dir:r(`dir`),"data-state":n.selected?`checked`:`unchecked`,"data-disabled":W(n.disabled),"data-highlighted":W(n.highlighted)})},getItemIndicatorProps(e){let n=C(e);return t.element({"aria-hidden":!0,...Gy.itemIndicator.attrs,dir:r(`dir`),"data-state":n.selected?`checked`:`unchecked`,hidden:!n.selected})},getItemGroupProps(e){let{id:n}=e;return t.element({...Gy.itemGroup.attrs,dir:r(`dir`),id:fb(o,n),"aria-labelledby":pb(o,n),"data-empty":W(u.size===0),role:`group`})},getItemGroupLabelProps(e){let{htmlFor:n}=e;return t.element({...Gy.itemGroupLabel.attrs,dir:r(`dir`),id:pb(o,n),role:`presentation`})}}}var Tb=`__live-region__`,Eb=`__live-region-debug__`,Db=`position:fixed;inset-inline:0;bottom:0;z-index:2147483647;padding:12px 16px;background:black;color:white;font-size:14px;line-height:20px;text-align:center;pointer-events:none;`;function Ob(e={}){let{level:t=`polite`,document:n=document,root:r,delay:i=0,debug:a=!1}=e,o=n.defaultView??window,s=r??n.body;function c(){if(!a)return;let e=n.getElementById(Eb);return e||(e=n.createElement(`div`),e.id=Eb,e.dataset.liveAnnouncerDebug=`true`,e.setAttribute(`aria-hidden`,`true`),e.style.cssText=Db,s.appendChild(e),e)}function l(e,r){n.getElementById(Tb)?.remove(),r??=i;let a=n.createElement(`span`);a.id=Tb,a.dataset.liveAnnouncer=`true`;let l=t===`assertive`?`alert`:`status`;a.setAttribute(`aria-live`,t),a.setAttribute(`role`,l),Object.assign(a.style,{border:`0`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`}),s.appendChild(a),o.setTimeout(()=>{if(!a.isConnected)return;a.textContent=e;let t=c();t&&(t.textContent=e)},r)}function u(){n.getElementById(Tb)?.remove(),n.getElementById(Eb)?.remove()}return{announce:l,destroy:u,toJSON(){return Tb}}}var{guards:kb,createMachine:Ab,choose:jb}=cr(),{and:Mb,not:Nb}=kb,Pb=Ab({props({props:e}){return{loopFocus:!0,openOnClick:!1,defaultValue:[],defaultInputValue:``,closeOnSelect:!e.multiple,allowCustomValue:!1,alwaysSubmitOnEnter:!1,inputBehavior:`none`,selectionBehavior:e.multiple?`clear`:`replace`,openOnKeyPress:!0,openOnChange:!0,composite:!0,navigate({node:e}){Vi(e)},collection:rb.empty(),...e,positioning:{placement:`bottom`,sameWidth:!0,...e.positioning},translations:{triggerLabel:`Toggle suggestions`,clearTriggerLabel:`Clear value`,...e.translations}}},initialState({prop:e}){return e(`open`)||e(`defaultOpen`)?`open.suggesting`:`closed.idle`},context({prop:e,bindable:t,getContext:n,getEvent:r}){let i=e(`value`)??e(`defaultValue`)??[],a=e(`collection`).findMany(i);return{currentPlacement:t(()=>({defaultValue:void 0})),value:t(()=>({defaultValue:e(`defaultValue`),value:e(`value`),isEqual:tn,hash(e){return e.join(`,`)},onChange(t){let r=n(),i=e(`collection`),a=tb({values:t,collection:i,selectedItemMap:r.get(`selectedItemMap`)}),o=e(`value`)??t,s=o===t?a:tb({values:o,collection:i,selectedItemMap:a.nextSelectedItemMap});r.set(`selectedItemMap`,s.nextSelectedItemMap),e(`onValueChange`)?.({value:t,items:a.selectedItems})}})),highlightedValue:t(()=>({defaultValue:e(`defaultHighlightedValue`)||null,value:e(`highlightedValue`),onChange(t){let n=e(`collection`).find(t);e(`onHighlightChange`)?.({highlightedValue:t,highlightedItem:n})}})),inputValue:t(()=>{let t=e(`inputValue`)||e(`defaultInputValue`),n=e(`value`)||e(`defaultValue`);if(!t.trim()&&!e(`multiple`)){let r=e(`collection`).stringifyMany(n);t=Sn(e(`selectionBehavior`),{preserve:t||r,replace:r,clear:``})}return{defaultValue:t,value:e(`inputValue`),onChange(t){let n=r(),i=(n.previousEvent||n).src;e(`onInputValueChange`)?.({inputValue:t,reason:i})}}}),highlightedItem:t(()=>{let t=e(`highlightedValue`);return{defaultValue:e(`collection`).find(t)}}),selectedItemMap:t(()=>({defaultValue:nb({selectedItems:a,collection:e(`collection`)})}))}},computed:{isInputValueEmpty:({context:e})=>e.get(`inputValue`).length===0,isInteractive:({prop:e})=>!(e(`readOnly`)||e(`disabled`)),autoComplete:({prop:e})=>e(`inputBehavior`)===`autocomplete`,autoHighlight:({prop:e})=>e(`inputBehavior`)===`autohighlight`,hasSelectedItems:({context:e})=>e.get(`value`).length>0,selectedItems:({context:e,prop:t})=>$y({values:e.get(`value`),collection:t(`collection`),selectedItemMap:e.get(`selectedItemMap`)}),valueAsString:({computed:e,prop:t})=>t(`collection`).stringifyItems(e(`selectedItems`)),isCustomValue:({context:e,computed:t})=>e.get(`inputValue`)!==t(`valueAsString`)},watch({context:e,prop:t,track:n,action:r,send:i}){n([()=>e.hash(`value`)],()=>{r([`syncSelectedItems`])}),n([()=>e.get(`inputValue`)],()=>{r([`syncInputValue`])}),n([()=>e.get(`highlightedValue`)],()=>{r([`syncHighlightedItem`,`autofillInputValue`,`announceHighlightedItem`])}),n([()=>t(`open`)],()=>{r([`toggleVisibility`])}),n([()=>t(`collection`).toString()],()=>{i({type:`CHILDREN_CHANGE`})})},on:{"SELECTED_ITEMS.SYNC":{actions:[`syncSelectedItems`]},"HIGHLIGHTED_VALUE.SET":{actions:[`setHighlightedValue`]},"HIGHLIGHTED_VALUE.CLEAR":{actions:[`clearHighlightedValue`]},"ITEM.SELECT":{actions:[`selectItem`]},"ITEM.CLEAR":{actions:[`clearItem`]},"VALUE.SET":{actions:[`setValue`]},"INPUT_VALUE.SET":{actions:[`setInputValue`]},"POSITIONING.SET":{actions:[`reposition`]}},entry:jb([{guard:`autoFocus`,actions:[`setInitialFocus`]}]),states:{closed:{tags:[`closed`],initial:`idle`,states:{idle:{tags:[`idle`],entry:[`scrollContentToTop`,`clearHighlightedValue`],on:{"CONTROLLED.OPEN":{target:`open.interacting`},"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`setInitialFocus`,`highlightFirstSelectedItem`,`invokeOnOpen`]},{target:`open.interacting`,actions:[`setInitialFocus`,`highlightFirstSelectedItem`,`invokeOnOpen`]}],"INPUT.CLICK":[{guard:`isOpenControlled`,actions:[`highlightFirstSelectedItem`,`invokeOnOpen`]},{target:`open.interacting`,actions:[`highlightFirstSelectedItem`,`invokeOnOpen`]}],"INPUT.FOCUS":{target:`focused`},OPEN:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open.interacting`,actions:[`invokeOnOpen`]}],"VALUE.CLEAR":{target:`focused`,actions:[`clearInputValue`,`clearSelectedItems`,`setInitialFocus`]}}},focused:{tags:[`focused`],entry:[`scrollContentToTop`,`clearHighlightedValue`],on:{"CONTROLLED.OPEN":[{guard:`isChangeEvent`,target:`open.suggesting`},{target:`open.interacting`}],"INPUT.CHANGE":[{guard:Mb(`isOpenControlled`,`openOnChange`),actions:[`setInputValue`,`invokeOnOpen`,`highlightFirstItemIfNeeded`]},{guard:`openOnChange`,target:`open.suggesting`,actions:[`setInputValue`,`invokeOnOpen`,`highlightFirstItemIfNeeded`]},{actions:[`setInputValue`]}],"LAYER.INTERACT_OUTSIDE":{target:`idle`},"INPUT.ESCAPE":{guard:Mb(`isCustomValue`,Nb(`allowCustomValue`)),actions:[`revertInputValue`]},"INPUT.BLUR":{target:`idle`},"INPUT.CLICK":[{guard:`isOpenControlled`,actions:[`highlightFirstSelectedItem`,`invokeOnOpen`]},{target:`open.interacting`,actions:[`highlightFirstSelectedItem`,`invokeOnOpen`]}],"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`setInitialFocus`,`highlightFirstSelectedItem`,`invokeOnOpen`]},{target:`open.interacting`,actions:[`setInitialFocus`,`highlightFirstSelectedItem`,`invokeOnOpen`]}],"INPUT.ARROW_DOWN":[{guard:Mb(`isOpenControlled`,`autoComplete`),actions:[`invokeOnOpen`]},{guard:`autoComplete`,target:`open.interacting`,actions:[`invokeOnOpen`]},{guard:`isOpenControlled`,actions:[`highlightFirstOrSelectedItem`,`invokeOnOpen`]},{target:`open.interacting`,actions:[`highlightFirstOrSelectedItem`,`invokeOnOpen`]}],"INPUT.ARROW_UP":[{guard:Mb(`isOpenControlled`,`autoComplete`),actions:[`invokeOnOpen`]},{guard:`autoComplete`,target:`open.interacting`,actions:[`invokeOnOpen`]},{guard:`isOpenControlled`,actions:[`highlightLastOrSelectedItem`,`invokeOnOpen`]},{target:`open.interacting`,actions:[`highlightLastOrSelectedItem`,`invokeOnOpen`]}],OPEN:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open.interacting`,actions:[`invokeOnOpen`]}],"VALUE.CLEAR":{actions:[`clearInputValue`,`clearSelectedItems`]}}}}},open:{tags:[`open`,`focused`],entry:[`setInitialFocus`],effects:[`trackFocusVisible`,`scrollToHighlightedItem`,`trackDismissableLayer`,`trackPlacement`,`trackLiveRegion`],on:{"CONTROLLED.CLOSE":[{guard:`restoreFocus`,target:`closed.focused`,actions:[`setFinalFocus`]},{target:`closed.idle`}],"INPUT.ENTER":[{guard:Mb(`isOpenControlled`,`isCustomValue`,Nb(`hasHighlightedItem`),Nb(`allowCustomValue`)),actions:[`revertInputValue`,`invokeOnClose`]},{guard:Mb(`isCustomValue`,Nb(`hasHighlightedItem`),Nb(`allowCustomValue`)),target:`closed.focused`,actions:[`revertInputValue`,`invokeOnClose`]},{guard:Mb(`isOpenControlled`,`closeOnSelect`),actions:[`selectHighlightedItem`,`invokeOnClose`]},{guard:`closeOnSelect`,target:`closed.focused`,actions:[`selectHighlightedItem`,`invokeOnClose`,`setFinalFocus`]},{actions:[`selectHighlightedItem`]}],"ITEM.CLICK":[{guard:Mb(`isOpenControlled`,`closeOnSelect`),actions:[`selectItem`,`invokeOnClose`]},{guard:`closeOnSelect`,target:`closed.focused`,actions:[`selectItem`,`invokeOnClose`,`setFinalFocus`]},{actions:[`selectItem`]}],"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`closed.focused`,actions:[`invokeOnClose`]}],"LAYER.INTERACT_OUTSIDE":[{guard:Mb(`isOpenControlled`,`isCustomValue`,Nb(`allowCustomValue`)),actions:[`revertInputValue`,`invokeOnClose`]},{guard:Mb(`isCustomValue`,Nb(`allowCustomValue`)),target:`closed.idle`,actions:[`revertInputValue`,`invokeOnClose`]},{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`closed.idle`,actions:[`invokeOnClose`]}],CLOSE:[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`closed.focused`,actions:[`invokeOnClose`,`setFinalFocus`]}],"VALUE.CLEAR":[{guard:`isOpenControlled`,actions:[`clearInputValue`,`clearSelectedItems`,`invokeOnClose`]},{target:`closed.focused`,actions:[`clearInputValue`,`clearSelectedItems`,`invokeOnClose`,`setFinalFocus`]}]},initial:`interacting`,states:{interacting:{on:{CHILDREN_CHANGE:[{guard:`isHighlightedItemRemoved`,actions:[`clearHighlightedValue`]},{actions:[`scrollToHighlightedItem`]}],"INPUT.HOME":{actions:[`highlightFirstItem`]},"INPUT.END":{actions:[`highlightLastItem`]},"INPUT.ARROW_DOWN":[{guard:Mb(`autoComplete`,`isLastItemHighlighted`),actions:[`clearHighlightedValue`,`scrollContentToTop`]},{actions:[`highlightNextItem`]}],"INPUT.ARROW_UP":[{guard:Mb(`autoComplete`,`isFirstItemHighlighted`),actions:[`clearHighlightedValue`]},{actions:[`highlightPrevItem`]}],"INPUT.CHANGE":[{guard:`autoComplete`,target:`suggesting`,actions:[`setInputValue`]},{target:`suggesting`,actions:[`clearHighlightedValue`,`setInputValue`]}],"ITEM.POINTER_MOVE":{actions:[`setHighlightedValue`]},"ITEM.POINTER_LEAVE":{actions:[`clearHighlightedValue`]},"LAYER.ESCAPE":[{guard:Mb(`isOpenControlled`,`autoComplete`),actions:[`syncInputValue`,`invokeOnClose`]},{guard:`autoComplete`,target:`closed.focused`,actions:[`syncInputValue`,`invokeOnClose`]},{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`closed.focused`,actions:[`invokeOnClose`,`setFinalFocus`]}]}},suggesting:{on:{CHILDREN_CHANGE:[{guard:Mb(`isHighlightedItemRemoved`,`hasCollectionItems`,`autoHighlight`),actions:[`clearHighlightedValue`,`highlightFirstItem`]},{guard:`isHighlightedItemRemoved`,actions:[`clearHighlightedValue`]},{guard:`autoHighlight`,actions:[`highlightFirstItem`]}],"INPUT.ARROW_DOWN":{target:`interacting`,actions:[`highlightNextItem`]},"INPUT.ARROW_UP":{target:`interacting`,actions:[`highlightPrevItem`]},"INPUT.HOME":{target:`interacting`,actions:[`highlightFirstItem`]},"INPUT.END":{target:`interacting`,actions:[`highlightLastItem`]},"INPUT.CHANGE":{actions:[`setInputValue`]},"LAYER.ESCAPE":[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`closed.focused`,actions:[`invokeOnClose`]}],"ITEM.POINTER_MOVE":{target:`interacting`,actions:[`setHighlightedValue`]},"ITEM.POINTER_LEAVE":{actions:[`clearHighlightedValue`]}}}}}},implementations:{guards:{isInputValueEmpty:({computed:e})=>e(`isInputValueEmpty`),autoComplete:({computed:e,prop:t})=>e(`autoComplete`)&&!t(`multiple`),autoHighlight:({computed:e})=>e(`autoHighlight`),isFirstItemHighlighted:({prop:e,context:t})=>e(`collection`).firstValue===t.get(`highlightedValue`),isLastItemHighlighted:({prop:e,context:t})=>e(`collection`).lastValue===t.get(`highlightedValue`),isCustomValue:({computed:e})=>e(`isCustomValue`),allowCustomValue:({prop:e})=>!!e(`allowCustomValue`),hasHighlightedItem:({context:e})=>e.get(`highlightedValue`)!=null,closeOnSelect:({prop:e})=>!!e(`closeOnSelect`),isOpenControlled:({prop:e})=>e(`open`)!=null,openOnChange:({prop:e,context:t})=>{let n=e(`openOnChange`);return rn(n)?n:!!n?.({inputValue:t.get(`inputValue`)})},restoreFocus:({event:e})=>{let t=e.restoreFocus??e.previousEvent?.restoreFocus;return t==null?!0:!!t},isChangeEvent:({event:e})=>e.previousEvent?.type===`INPUT.CHANGE`,autoFocus:({prop:e})=>!!e(`autoFocus`),isHighlightedItemRemoved:({prop:e,context:t})=>!e(`collection`).has(t.get(`highlightedValue`)),hasCollectionItems:({prop:e})=>e(`collection`).size>0},effects:{trackFocusVisible({scope:e}){return Mo({root:e.getRootNode?.()})},trackDismissableLayer({send:e,prop:t,scope:n}){return t(`disableLayer`)?void 0:Zv(()=>hb(n),{type:`listbox`,defer:!0,exclude:()=>[gb(n),yb(n),bb(n)],onFocusOutside:t(`onFocusOutside`),onPointerDownOutside:t(`onPointerDownOutside`),onInteractOutside:t(`onInteractOutside`),onEscapeKeyDown(t){t.preventDefault(),t.stopPropagation(),e({type:`LAYER.ESCAPE`,src:`escape-key`})},onDismiss(){e({type:`LAYER.INTERACT_OUTSIDE`,src:`interact-outside`,restoreFocus:!1})}})},trackLiveRegion({refs:e,scope:t}){let n=Ob({level:`assertive`,document:t.getDoc()});return e.set(`liveRegion`,n),()=>n.destroy()},trackPlacement({context:e,prop:t,scope:n}){return e.set(`currentPlacement`,t(`positioning`).placement),Hg(()=>vb(n)||yb(n),()=>_b(n),{...t(`positioning`),defer:!0,onComplete(t){e.set(`currentPlacement`,t.placement)}})},scrollToHighlightedItem({context:e,prop:t,scope:n}){let r=gb(n),i=[],a=r=>{if(ko()===`pointer`)return;let a=e.get(`highlightedValue`);if(!a)return;let o=hb(n),s=t(`scrollToIndexFn`);if(s){s({index:t(`collection`).indexOf(a),immediate:r,getElement:()=>xb(n,a)});return}let c=xb(n,a),l=J(()=>{$i(c,{rootEl:o,block:`nearest`})});i.push(l)},o=J(()=>{Ao(`virtual`),a(!0)});i.push(o);let s=Bi(r,{attributes:[`aria-activedescendant`],callback:()=>a(!1)});return i.push(s),()=>{i.forEach(e=>e())}}},actions:{reposition({context:e,prop:t,scope:n,event:r}){Hg(()=>vb(n),()=>_b(n),{...t(`positioning`),...r.options,defer:!0,listeners:!1,onComplete(t){e.set(`currentPlacement`,t.placement)}})},setHighlightedValue({context:e,event:t}){t.value!=null&&e.set(`highlightedValue`,t.value)},clearHighlightedValue({context:e}){e.set(`highlightedValue`,null)},selectHighlightedItem(e){let{context:t,prop:n}=e,r=n(`collection`),i=t.get(`highlightedValue`);if(!i||!r.has(i))return;let a=n(`multiple`)?qt(t.get(`value`),i):[i];n(`onSelect`)?.({value:a,itemValue:i}),t.set(`value`,a);let o=Sn(n(`selectionBehavior`),{preserve:t.get(`inputValue`),replace:r.stringifyMany(a),clear:``});t.set(`inputValue`,o)},scrollToHighlightedItem({context:e,prop:t,scope:n}){Li(()=>{let r=e.get(`highlightedValue`);if(r==null)return;let i=xb(n,r),a=hb(n),o=t(`scrollToIndexFn`);if(o){o({index:t(`collection`).indexOf(r),immediate:!0,getElement:()=>xb(n,r)});return}$i(i,{rootEl:a,block:`nearest`})})},selectItem(e){let{context:t,event:n,flush:r,prop:i}=e;n.value!=null&&r(()=>{let e=i(`multiple`)?qt(t.get(`value`),n.value):[n.value];i(`onSelect`)?.({value:e,itemValue:n.value}),t.set(`value`,e);let r=Sn(i(`selectionBehavior`),{preserve:t.get(`inputValue`),replace:i(`collection`).stringifyMany(e),clear:``});t.set(`inputValue`,r)})},clearItem(e){let{context:t,event:n,flush:r,prop:i}=e;n.value!=null&&r(()=>{let e=Kt(t.get(`value`),n.value);t.set(`value`,e);let r=Sn(i(`selectionBehavior`),{preserve:t.get(`inputValue`),replace:i(`collection`).stringifyMany(e),clear:``});t.set(`inputValue`,r)})},setInitialFocus({scope:e}){J(()=>{Sb(e)})},setFinalFocus({scope:e}){J(()=>{yb(e)?.dataset.focusable==null?Sb(e):Cb(e)})},syncInputValue({context:e,scope:t,event:n}){let r=gb(t);r&&(r.value=e.get(`inputValue`),queueMicrotask(()=>{n.current().type!==`INPUT.CHANGE`&&mr(r)}))},setInputValue({context:e,event:t}){e.set(`inputValue`,t.value)},clearInputValue({context:e}){e.set(`inputValue`,``)},revertInputValue({context:e,prop:t,computed:n}){let r=Sn(t(`selectionBehavior`),{replace:n(`hasSelectedItems`)?n(`valueAsString`):``,preserve:e.get(`inputValue`),clear:``});e.set(`inputValue`,r)},setValue(e){let{context:t,flush:n,event:r,prop:i}=e;n(()=>{t.set(`value`,r.value);let e=Sn(i(`selectionBehavior`),{preserve:t.get(`inputValue`),replace:i(`collection`).stringifyMany(r.value),clear:``});t.set(`inputValue`,e)})},clearSelectedItems(e){let{context:t,flush:n,prop:r}=e;n(()=>{t.set(`value`,[]);let e=Sn(r(`selectionBehavior`),{preserve:t.get(`inputValue`),replace:r(`collection`).stringifyMany([]),clear:``});t.set(`inputValue`,e)})},scrollContentToTop({prop:e,scope:t}){let n=e(`scrollToIndexFn`);if(n){let r=e(`collection`).firstValue;n({index:0,immediate:!0,getElement:()=>xb(t,r)})}else{let e=hb(t);if(!e)return;e.scrollTop=0}},invokeOnOpen({prop:e,event:t,context:n}){let r=Fb(t);e(`onOpenChange`)?.({open:!0,reason:r,value:n.get(`value`)})},invokeOnClose({prop:e,event:t,context:n}){let r=Fb(t);e(`onOpenChange`)?.({open:!1,reason:r,value:n.get(`value`)})},highlightFirstItem({context:e,prop:t,scope:n}){(hb(n)?queueMicrotask:J)(()=>{let n=t(`collection`).firstValue;n&&e.set(`highlightedValue`,n)})},highlightFirstItemIfNeeded({computed:e,action:t}){e(`autoHighlight`)&&t([`highlightFirstItem`])},highlightLastItem({context:e,prop:t,scope:n}){(hb(n)?queueMicrotask:J)(()=>{let n=t(`collection`).lastValue;n&&e.set(`highlightedValue`,n)})},highlightNextItem({context:e,prop:t}){let n=null,r=e.get(`highlightedValue`),i=t(`collection`);r?(n=i.getNextValue(r),!n&&t(`loopFocus`)&&(n=i.firstValue)):n=i.firstValue,n&&e.set(`highlightedValue`,n)},highlightPrevItem({context:e,prop:t}){let n=null,r=e.get(`highlightedValue`),i=t(`collection`);r?(n=i.getPreviousValue(r),!n&&t(`loopFocus`)&&(n=i.lastValue)):n=i.lastValue,n&&e.set(`highlightedValue`,n)},highlightFirstSelectedItem({context:e,prop:t}){J(()=>{let[n]=t(`collection`).sort(e.get(`value`));n&&e.set(`highlightedValue`,n)})},highlightFirstOrSelectedItem({context:e,prop:t,computed:n}){J(()=>{let r=null;r=n(`hasSelectedItems`)?t(`collection`).sort(e.get(`value`))[0]:t(`collection`).firstValue,r&&e.set(`highlightedValue`,r)})},highlightLastOrSelectedItem({context:e,prop:t,computed:n}){J(()=>{let r=t(`collection`),i=null;i=n(`hasSelectedItems`)?r.sort(e.get(`value`))[0]:r.lastValue,i&&e.set(`highlightedValue`,i)})},autofillInputValue({context:e,computed:t,prop:n,event:r,scope:i}){let a=gb(i),o=n(`collection`);if(!t(`autoComplete`)||!a||!r.keypress)return;let s=o.stringify(e.get(`highlightedValue`));J(()=>{a.value=s||e.get(`inputValue`)})},syncSelectedItems(e){queueMicrotask(()=>{let{context:t,prop:n}=e,r=n(`collection`),i=t.get(`value`),a=tb({values:i,collection:r,selectedItemMap:t.get(`selectedItemMap`)});t.set(`selectedItemMap`,a.nextSelectedItemMap);let o=Sn(n(`selectionBehavior`),{preserve:t.get(`inputValue`),replace:r.stringifyMany(i),clear:``});t.set(`inputValue`,o)})},syncHighlightedItem({context:e,prop:t}){let n=t(`collection`).find(e.get(`highlightedValue`));e.set(`highlightedItem`,n)},announceHighlightedItem({context:e,prop:t,refs:n}){if(!ti())return;let r=e.get(`highlightedValue`),i=r?t(`collection`).stringifyItem(t(`collection`).find(r)):null;if(!i)return;let a=r?e.get(`value`).includes(r):!1;n.get(`liveRegion`)?.announce(a?`${i}, selected`:i)},toggleVisibility({event:e,send:t,prop:n}){t({type:n(`open`)?`CONTROLLED.OPEN`:`CONTROLLED.CLOSE`,previousEvent:e})}}}});function Fb(e){return(e.previousEvent||e).src}var Ib=Wy.extendWith(`empty`),[Lb,Rb]=Z({hookName:`useComboboxContext`,providerName:`<ComboboxProvider />`}),zb=e=>{let t=Rb(),n=Y(()=>t().getClearTriggerProps(),e);return F(X.button,n)},Bb=e=>{let t=Rb(),n=hm(),r=Y(()=>t().getContentProps(),()=>n().presenceProps,e);return F(R,{get when(){return!n().unmounted},get children(){return F(X.div,I(r,{ref(t){var r=Pt(n().ref,e.ref);typeof r==`function`&&r(t)}}))}})},Vb=Ib.build(),Hb=e=>{let t=Rb(),n=O(()=>t().collection.size);return F(R,{get when(){return n()===0},get children(){return F(X.div,I(()=>Vb.empty.attrs,e,{role:`presentation`}))}})},Ub=e=>e.children(Rb()),Wb=e=>{let t=Rb(),n=Y(()=>t().getControlProps(),e);return F(X.div,n)},Gb=e=>{let t=Rb(),n=Y(()=>t().getInputProps(),e),r=Za();return F(X.input,I({get"aria-describedby"(){return r?.().ariaDescribedby}},n))},[Kb,qb]=Z({hookName:`useComboboxItemContext`,providerName:`<ComboboxItemProvider />`}),[Jb,Yb]=Z({hookName:`useComboboxItemPropsContext`,providerName:`<ComboboxItemPropsProvider />`}),Xb=e=>{let[t,n]=U()(e,[`item`,`persistFocus`]),r=Rb(),i=Y(()=>r().getItemProps(t),n),a=O(()=>r().getItemState(t));return F(Jb,{value:t,get children(){return F(Kb,{value:a,get children(){return F(X.div,i)}})}})},Zb=e=>e.children(qb()),[Qb,$b]=Z({hookName:`useComboboxItemGroupPropsContext`,providerName:`<ComboboxItemGroupPropsProvider />`}),ex=e=>{let[t,n]=U()(e,[`id`]),r=Rb(),i=Y({id:He()},t),a=Y(()=>r().getItemGroupProps(i),n);return F(Qb,{value:i,get children(){return F(X.div,a)}})},tx=e=>{let t=Rb(),n=$b(),r=Y(()=>t().getItemGroupLabelProps({htmlFor:n.id}),e);return F(X.div,r)},nx=e=>{let t=Rb(),n=Yb(),r=Y(()=>t().getItemIndicatorProps(n),e);return F(X.div,r)},rx=e=>{let t=Rb(),n=Yb(),r=Y(()=>t().getItemTextProps(n),e);return F(X.span,r)},ix=e=>{let t=Rb(),n=Y(()=>t().getLabelProps(),e);return F(X.label,n)},ax=e=>{let t=Rb(),n=Y(()=>t().getListProps(),e);return F(X.div,n)},ox=e=>{let t=Rb(),n=hm(),r=Y(()=>t().getPositionerProps(),e);return F(R,{get when(){return!n().unmounted},get children(){return F(X.div,r)}})},sx=e=>{let t=Bo(),n=Ia(),r=He(),i=Za(),a=_a(Pb,O(()=>({id:r,ids:{label:i?.().ids.label,input:i?.().ids.control},disabled:i?.().disabled,readOnly:i?.().readOnly,required:i?.().required,invalid:i?.().invalid,dir:t().dir,getRootNode:n().getRootNode,...Bt(e)})));return O(()=>wb(a,Ta))},cx=e=>{let[t,n]=pm(e),[r,i]=U()(n,`allowCustomValue.alwaysSubmitOnEnter.autoFocus.closeOnSelect.collection.composite.defaultHighlightedValue.defaultInputValue.defaultOpen.defaultValue.disabled.disableLayer.form.highlightedValue.id.ids.inputBehavior.inputValue.invalid.loopFocus.multiple.name.navigate.onFocusOutside.onHighlightChange.onInputValueChange.onInteractOutside.onOpenChange.onPointerDownOutside.onValueChange.onSelect.open.openOnChange.openOnClick.openOnKeyPress.placeholder.positioning.readOnly.required.scrollToIndexFn.selectionBehavior.translations.value`.split(`.`)),a=sx(r),o=fm(Y(t,()=>({present:a().open}))),s=Y(()=>a().getRootProps(),i);return F(Lb,{value:a,get children(){return F(mm,{value:o,get children(){return F(X.div,s)}})}})},lx=e=>{let[t,n]=pm(e),[{value:r},i]=U()(n,[`value`]),a=fm(Y(t,()=>({present:r().open}))),o=Y(()=>r().getRootProps(),i);return F(Lb,{value:r,get children(){return F(mm,{value:a,get children(){return F(X.div,o)}})}})},ux=e=>{let[t,n]=U()(e,[`focusable`]),r=Rb(),i=Y(()=>r().getTriggerProps(t),n);return F(X.button,i)},dx={};Ra(dx,{ClearTrigger:()=>zb,Content:()=>Bb,Context:()=>Ub,Control:()=>Wb,Empty:()=>Hb,Input:()=>Gb,Item:()=>Xb,ItemContext:()=>Zb,ItemGroup:()=>ex,ItemGroupLabel:()=>tx,ItemIndicator:()=>nx,ItemText:()=>rx,Label:()=>ix,List:()=>ax,Positioner:()=>ox,Root:()=>cx,RootProvider:()=>lx,Trigger:()=>ux});var fx=e=>new Yy(e);function px(e){let t=O(()=>Be(typeof e==`function`?e():e,[`initialItems`,`filter`,`limit`])),[n,r]=w((()=>{let[e]=t();return e.initialItems})()),[i,a]=w(``),o=e=>{r(e),a(``)},s=e=>{let[,n]=t();return fx({...n,items:e})};return{collection:O(()=>{let[e,r]=t(),a=e.filter,o=n();i()&&a&&(o=s(n()).filter((e,t,n)=>a(e,i(),n)).items);let c=e.limit==null?o:o.slice(0,e.limit);return fx({...r,items:c})}),filter:(e=``)=>{a(e)},set:e=>{o(e)},reset:()=>{let[e]=t();o(e.initialItems)},clear:()=>{o([])},insert:(e,...t)=>{let r=s(n()).insert(e,...t).items;o(r)},insertBefore:(e,...t)=>{let r=s(n()).insertBefore(e,...t).items;o(r)},insertAfter:(e,...t)=>{let r=s(n()).insertAfter(e,...t).items;o(r)},remove:(...e)=>{let t=s(n()).remove(...e).items;o(t)},move:(e,t)=>{let r=s(n()).move(e,t).items;o(r)},moveBefore:(e,...t)=>{let r=s(n()).moveBefore(e,...t).items;o(r)},moveAfter:(e,...t)=>{let r=s(n()).moveAfter(e,...t).items;o(r)},reorder:(e,t)=>{let r=s(n()).reorder(e,t).items;o(r)},append:(...e)=>{let t=s(n()).append(...e).items;o(t)},upsert:(e,t,r=`append`)=>{let i=s(n()).upsert(e,t,r).items;o(i)},prepend:(...e)=>{let t=s(n()).prepend(...e).items;o(t)},update:(e,t)=>{let r=s(n()).update(e,t).items;o(r)}}}var mx=z(`<span>`),hx=z(`<span class="bg-yellow-200 font-semibold">`),gx=z(`<div class="absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none">`),_x=z(`<div class="absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none"><kbd class="px-1.5 py-0.5 text-xs font-mono text-gray-400 bg-gray-100 border border-gray-300 rounded">/`),vx=z(`<button type=button class="absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-gray-200 rounded"aria-label="Clear search"title="Clear search">`),yx=z(`<div class="px-4 py-2 text-xs text-gray-400 bg-gray-50 border-t border-gray-200">Showing 50 of <!> results`),bx=z(`<div class="px-4 py-3 text-sm text-gray-500">No results found`),xx=z(`<div class="text-xs text-gray-500 mt-0.5 truncate">`),Sx=50;function Cx(e,t){if(t.length===0)return(()=>{var t=mx();return H(t,e),t})();let n=[],r=0;for(let[i,a]of t)i>r&&n.push((()=>{var t=mx();return H(t,()=>e.slice(r,i)),t})()),n.push((()=>{var t=hx();return H(t,()=>e.slice(i,a+1)),t})()),r=a+1;return r<e.length&&n.push((()=>{var t=mx();return H(t,()=>e.slice(r)),t})()),n}function wx(e,t){return new Set([`kind`,`name`,`title`,`serviceName`]).has(e)?t:`${e}: ${t}`}function Tx(e){let[t,n]=w(e.query),[r,i]=w(!1),[a,o]=w(!1),s,c;D(()=>n(e.query)),D(()=>{t().length>0?i(!0):i(!1)});let{collection:l,set:u}=px({initialItems:[],itemToString:e=>wx(e.key,e.value),itemToValue:e=>`${e.spanId}-${e.key}`});D(()=>u(e.results.slice(0,Sx)));let d=t=>{t.reason===`input-change`&&(n(t.inputValue),s&&clearTimeout(s),s=window.setTimeout(()=>{e.onQueryChange(t.inputValue)},200))},f=t=>{t.open||(i(!1),e.onResultHover?.(null))},p=t=>{let n=t.items[0];n&&(e.onResultSelect(n.spanId),i(!1),e.onResultHover?.(null))},m=t=>{e.onResultHover?.(t.highlightedItem?.spanId??null)},h=()=>{n(``),i(!1),s&&clearTimeout(s),e.onClear(),e.onResultHover?.(null)};return te(()=>{let e=e=>{e.key===`/`&&!a()&&!(e.target instanceof HTMLInputElement)&&!(e.target instanceof HTMLTextAreaElement)&&(e.preventDefault(),c?.focus())};document.addEventListener(`keydown`,e),N(()=>document.removeEventListener(`keydown`,e))}),N(()=>{s&&clearTimeout(s)}),F(dx.Root,{get collection(){return l()},get inputValue(){return t()},onInputValueChange:d,onOpenChange:f,onValueChange:p,onHighlightChange:m,get open(){return r()},allowCustomValue:!0,selectionBehavior:`preserve`,multiple:!1,get children(){return[F(dx.Control,{class:`relative flex items-center`,get children(){return[(()=>{var e=gx();return H(e,F(Zd,{size:16,class:`text-gray-400`})),e})(),F(dx.Input,{ref(e){var t=c;typeof t==`function`?t(e):c=e},onFocus:()=>o(!0),onBlur:()=>o(!1),class:`w-full pl-9 pr-8 py-1.5 text-sm border border-gray-300 rounded-md
|
|
11
|
-
bg-gray-50 focus:bg-white
|
|
12
|
-
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent`,get placeholder(){return e.placeholder||`Search spans...`}}),F(R,{get when(){return nt(()=>!a())()&&!t()},get children(){return _x()}}),F(R,{get when(){return t()},get children(){var e=vx();return e.$$click=h,H(e,F($d,{size:14,class:`text-gray-500`})),e}})]}}),F(kt,{get children(){return F(dx.Positioner,{get children(){return F(dx.Content,{class:`mt-1 bg-white border border-gray-300 rounded-md shadow-lg max-h-96 overflow-y-auto z-50`,get children(){return F(R,{get when(){return l().items.length>0},get fallback(){return F(R,{get when(){return t()},get children(){return bx()}})},get children(){return[F(L,{get each(){return l().items},children:e=>F(dx.Item,{item:e,class:`w-full text-left px-4 py-2 border-b border-gray-100 last:border-b-0
|
|
13
|
-
data-[highlighted]:bg-blue-50 cursor-pointer`,get children(){return[F(dx.ItemText,{class:`text-sm font-mono`,get children(){return Cx(wx(e.key,e.value),e.ranges)}}),(()=>{var t=xx();return H(t,()=>e.spanTitle),t})()]}})}),F(R,{get when(){return e.results.length>Sx},get children(){var t=yx(),n=t.firstChild.nextSibling;return n.nextSibling,H(t,()=>e.results.length,n),t}})]}})}})}})}})]}})}ot([`click`]);var Ex=z(`<header class="flex-shrink-0 border-b border-gray-200 bg-white px-4 py-3"data-testid=trace-viewer-header><div class="flex items-center gap-4"><span></span><div class="flex-1 min-w-0"><div class="flex items-baseline gap-2"><span class="font-semibold text-gray-900 truncate"data-testid=test-name></span></div><div class="flex items-center gap-3 text-xs text-gray-500"><span class="font-mono truncate"data-testid=test-file-location>:</span><span class=text-gray-300>|</span><span class=font-mono>ms</span><span data-testid=test-status></span></div></div><div class=w-80></div><div class="flex-shrink-0 text-right min-w-[140px]">`),Dx=z(`<span class="text-gray-500 text-sm truncate"data-testid=test-describes> <span class=text-gray-400>›`),Ox=z(`<div><div class="text-sm font-mono text-gray-300">--</div><div class="text-xs font-mono text-gray-200">--`),kx=z(`<div><div class="text-sm font-mono text-blue-600">ms</div><div class="text-xs font-mono text-gray-400">`);function Ax(e){let{testInfo:t}=e,n=Dp(),r=()=>{let e=BigInt(t.startTimeUnixNano),n=BigInt(t.endTimeUnixNano);return Number((n-e)/BigInt(1e6))},i=()=>{switch(t.status){case`passed`:return`text-green-600`;case`failed`:return`text-red-600`;case`skipped`:return`text-yellow-600`;case`timedOut`:return`text-orange-600`;case`interrupted`:return`text-orange-600`;default:return`text-gray-500`}},a=()=>{switch(t.status){case`passed`:return`✓`;case`failed`:return`✗`;case`skipped`:return`○`;case`timedOut`:return`⏱`;case`interrupted`:return`⚠`;default:return`?`}},o=()=>{let e=BigInt(t.startTimeUnixNano),n=Number(e/BigInt(1e6));return new Date(n)},s=e=>{let t=new Date(o().getTime()+e);return`${t.toLocaleDateString(void 0,{month:`short`,day:`numeric`})}, ${t.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}.${t.getMilliseconds().toString().padStart(3,`0`)}`},c=t=>{e.onSpanSelect?.(t,`start`)},l=t=>{e.onSpanSelect?.(t,`end`)};return(()=>{var o=Ex(),u=o.firstChild,d=u.firstChild,f=d.nextSibling,p=f.firstChild,m=p.firstChild,h=p.nextSibling.firstChild,g=h.firstChild,_=h.nextSibling.nextSibling,v=_.firstChild,y=_.nextSibling,b=f.nextSibling,x=b.nextSibling;return H(d,a),H(p,(()=>{var e=nt(()=>t.describes.length>0);return()=>e()&&(()=>{var e=Dx(),n=e.firstChild;return H(e,()=>t.describes.join(` › `),n),e})()})(),m),H(m,()=>t.name),H(h,()=>t.file,g),H(h,()=>t.line,null),H(_,r,v),H(y,()=>t.status),H(u,F(Hy,{get spans(){return e.errorSpans},onSpanSelect:l,get onSpanHover(){return e.onSpanHover}}),b),H(b,F(Tx,{get results(){return n.results()},get query(){return n.query()},get onQueryChange(){return n.setQuery},get onClear(){return n.clearSearch},onResultSelect:c,get onResultHover(){return e.onSpanHover}})),H(x,F(R,{get when(){return e.hoverTimeMs()},get fallback(){return Ox()},children:e=>(()=>{var t=kx(),n=t.firstChild,r=n.firstChild,i=n.nextSibling;return H(n,()=>Math.round(e()),r),H(i,()=>s(e())),t})()})),E(e=>{var t=`text-xl ${i()}`,n=i();return t!==e.e&<(d,e.e=t),n!==e.t&<(y,e.t=n),e},{e:void 0,t:void 0}),o})()}var jx=z(`<div class="h-full min-h-0 overflow-hidden">`),Mx=z(`<div class="flex-shrink-0 border-t border-gray-300">`),Nx=z(`<div class="absolute top-0 bottom-0 bg-blue-500/20 border-x-2 border-blue-500 pointer-events-none z-40">`),Px=z(`<div class="absolute top-0 bottom-0 w-px bg-blue-500 pointer-events-none z-50">`),Fx=z(`<div class="absolute top-0 bottom-0 bg-blue-600 pointer-events-none z-50"style=width:3px;margin-left:-1px>`),Ix=z(`<div class="absolute top-0 bottom-0 w-px bg-blue-400 pointer-events-none z-45">`),Lx=z(`<div class="flex flex-col h-full relative"style=container-type:inline-size;--timeline-plot-inset:12px><div class="flex-1 min-h-0 relative flex flex-col"role=region aria-label="Trace timeline"><div class="flex-1 min-h-0 overflow-hidden"></div><div data-timeline-plot class="absolute inset-y-0 pointer-events-none"style=left:var(--timeline-plot-inset);width:var(--timeline-plot-width)>`),Rx=z(`<main class="flex flex-col h-full w-full bg-white text-gray-900"aria-label="Trace viewer"><div class="flex-1 min-h-0">`),zx={screenshots:`Screenshots`,steps:`Steps Timeline`,browser:`Browser Spans`,external:`External Spans`},Bx={screenshots:`No screenshots were captured during this test`,steps:`No test steps were recorded`,browser:`No browser spans were captured`,external:`No external spans were captured`},Vx=.2,Hx=.005,Ux=1,Wx=12,Gx=12;function Kx(e){return e.length===0?1:new Set(e.map(e=>e.pageId)).size}function qx(e){return e<=1?1:e===2?2:2.5}function Jx(e){let t=Nl(()=>e.traceInfo),n=()=>t.totalDurationMs(),r=()=>{let t=BigInt(e.traceInfo.testInfo.startTimeUnixNano);return Number(t/BigInt(1e6))};return F(Uu,{durationMs:n,testStartTimeMs:r,get children(){return F(Ep,{spans:()=>[...t.steps(),...t.browserSpans(),...t.externalSpans()],get children(){return F($f,{steps:()=>t.steps(),spans:()=>[...t.browserSpans(),...t.externalSpans()],screenshots:()=>e.traceInfo.screenshots.loading?[]:e.traceInfo.screenshots()??[],testStartTimeMs:r,get children(){return F(Yx,{get traceInfo(){return e.traceInfo},traceData:t,testStartTimeMs:r})}})}})}})}function Yx(e){let{viewport:t,setViewport:n,zoomToRange:r,pan:i,zoom:a,reset:o}=Wu(),{mode:s,hoverPosition:c,setHoverPosition:l,lockedPosition:u,lockedTimeMs:d,lock:f,unlock:p,enterSearchOverride:m,exitSearchOverride:h,setHoveredElement:g,lockedElement:_,displayTimeMs:v,displayElements:y,displayFocusedElement:b}=tp(),[x,S]=w(null),[C,T]=w(null),ee=O(()=>[...e.traceData.steps(),...e.traceData.browserSpans(),...e.traceData.externalSpans()]),k=O(()=>ee().filter(Tc).sort((e,t)=>e.startOffsetMs-t.startOffsetMs)),A,j=null,M=null,ne=e=>{j=e,s()===`hover`&&g(e)},[re,ie]=w(0);te(()=>{let e=document.createElement(`div`);e.style.cssText=`position:absolute;visibility:hidden;width:100px;height:100px;overflow:scroll`,document.body.append(e),ie(e.offsetWidth-e.clientWidth),e.remove()});let ae=()=>(e.traceInfo.screenshots()??[]).length>0,oe=()=>e.traceInfo.screenshots.loading||ae(),se=O(()=>Kx(e.traceInfo.screenshots()??[])),ce=O(()=>Wx*qx(se())),le=()=>e.traceData.steps().length>0,ue=()=>e.traceData.browserSpans().length>0,de=()=>e.traceData.externalSpans().length>0,fe=O(()=>{let t=[];return!e.traceInfo.screenshots.loading&&!ae()&&t.push({id:`screenshots`,title:zx.screenshots,tooltip:Bx.screenshots}),le()||t.push({id:`steps`,title:zx.steps,tooltip:Bx.steps}),ue()||t.push({id:`browser`,title:zx.browser,tooltip:Bx.browser}),de()||t.push({id:`external`,title:zx.external,tooltip:Bx.external}),t}),pe=O(()=>Op(e.traceData.steps())),[me,he]=w(!1);D(()=>{if(e.traceData.isLoading()||me())return;let t=pe();if(!t)return;let n=kp(t);n&&(r(n.startMs,n.endMs),he(!0))});let ge=e=>{r(e.startMs,e.endMs)},_e=O(()=>{let e=Fp({steps:le(),browser:ue(),external:de()}),t=[];return le()&&e.steps!==void 0&&t.push({id:`steps`,initialSize:e.steps,minSize:15}),ue()&&e.browser!==void 0&&t.push({id:`browser`,initialSize:e.browser,minSize:15}),de()&&e.external!==void 0&&t.push({id:`external`,initialSize:e.external,minSize:15}),t}),ve=()=>_e().length>0,P=e=>{if(e.button!==0||!A)return;let t=e.target,n=window.getComputedStyle(t);if(n.cursor===`col-resize`||n.cursor===`row-resize`)return;let r=A.getBoundingClientRect(),i=(e.clientX-r.left)/r.width;i>=0&&i<=1&&S({startPosition:i,currentPosition:i,element:j})},ye=e=>{if(!A)return;let t=A.getBoundingClientRect(),n=(e.clientX-t.left)/t.width,r=x();if(r){let e=Math.max(0,Math.min(1,n));S({...r,currentPosition:e})}let i=window.getComputedStyle(e.target);M=!(i.cursor===`col-resize`||i.cursor===`row-resize`)&&n>=0&&n<=1?n:null,s()===`hover`&&l(M)},be=()=>{let e=x();if(e){let n=Lu(Math.min(e.startPosition,e.currentPosition),t()),i=Lu(Math.max(e.startPosition,e.currentPosition),t()),a=(t().visibleEndMs-t().visibleStartMs)*.02;if(i-n>a)r(n,i);else switch(s()){case`hover`:f(Lu(e.startPosition,t()),e.element);break;case`locked`:case`search-override`:l(e.startPosition),p(),g(j);break}S(null)}},xe=()=>{M=null,ne(null),s()===`hover`&&l(null)};te(()=>{let e=()=>be();document.addEventListener(`mouseup`,e);let t=e=>{let t=s();e.key===`Escape`&&t!==`hover`&&(p(),l(M),g(j))};document.addEventListener(`keydown`,t),N(()=>{document.removeEventListener(`mouseup`,e),document.removeEventListener(`keydown`,t)})});let Se=e=>{n(e)},Ce=e=>{if(A){if((e.metaKey||e.ctrlKey||e.shiftKey)&&e.deltaY!==0){e.preventDefault();let t=A.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width)),r=s()===`hover`?null:u();a(r!==null&&r>=0&&r<=1?r:n,-e.deltaY*Hx);return}if(Math.abs(e.deltaX)>Math.abs(e.deltaY)){e.preventDefault();let n=t().visibleEndMs-t().visibleStartMs;i(e.deltaX*Vx*n/100)}}},we=()=>{p(),o()},Te=e=>{ne(e?{type:`screenshot`,id:e}:null)},Ee=e=>{ne(e?{type:`step`,id:e}:null)},De=e=>{ne(e?{type:`span`,id:e}:null)},Oe=(e,r)=>{let i=ee().find(t=>t.id===e);if(i){let a=am(i,r),o=t(),s=zu(i.startOffsetMs,i.startOffsetMs+i.durationMs,o)?o:{visibleStartMs:0,visibleEndMs:o.totalDurationMs,totalDurationMs:o.totalDurationMs};s!==o&&n(s),f(a,{type:i.name===`playwright.test`||i.name===`playwright.test.step`?`step`:`span`,id:e})}},ke=e=>{let t=ee().find(t=>t.id===e);if(t){let n=t.name===`playwright.test`||t.name===`playwright.test.step`,r=s();if(r===`locked`||r===`search-override`){let t=d();t!==null&&f(t,{type:n?`step`:`span`,id:e})}}},Ae=e=>{if(T(e),!e){s()===`search-override`&&h(),l(null),g(null);return}s()===`locked`&&m();let n=ee().find(t=>t.id===e);if(n){if(zu(n.startOffsetMs,n.startOffsetMs+n.durationMs,t())){let e=Iu(n.startOffsetMs,t());l(Math.max(0,Math.min(1,e)))}g({type:n.name===`playwright.test`||n.name===`playwright.test.step`?`step`:`span`,id:e})}},je=()=>{let e=x();return e?Math.min(e.startPosition,e.currentPosition)*100:0},Me=()=>{let e=x();return e?Math.abs(e.currentPosition-e.startPosition)*100:0},Ne=()=>{let t=Dp(),n=n=>{switch(n){case`steps`:return F(Zf,{get steps(){return e.traceData.steps()},onStepHover:Ee,get matchedSpanIds(){return t.matchedSpanIds()},get hoveredSearchSpanId(){return C()}});case`browser`:return F(Bd,{get spans(){return e.traceData.browserSpans()},onSpanHover:De,get matchedSpanIds(){return t.matchedSpanIds()},get hoveredSearchSpanId(){return C()}});case`external`:return F(Hf,{get spans(){return e.traceData.externalSpans()},onSpanHover:De,get matchedSpanIds(){return t.matchedSpanIds()},get hoveredSearchSpanId(){return C()}});default:return null}},r=_e().map(e=>({...e,content:n(e.id)}));return r.length===0?null:r.length===1?(()=>{var e=jx();return H(e,()=>r[0].content),e})():F(Np,{direction:`vertical`,panels:r})},Pe=()=>(()=>{var n=Lx(),r=n.firstChild,i=r.firstChild,a=i.nextSibling;H(n,F(R,{get when(){return e.traceData.isLoading()},get children(){return F(Wf,{})}}),r),H(n,F(M_,{get durationMs(){return e.traceData.totalDurationMs()},get viewport(){return t()},get hoverPosition(){return c()},onViewportChange:Se,get testPhases(){return pe()},onPhaseClick:ge,onDoubleClick:we}),r),r.$$dblclick=we,r.addEventListener(`wheel`,Ce),r.addEventListener(`mouseleave`,xe),r.$$mousemove=ye,r.$$mousedown=P,H(i,F(R,{get when(){return nt(()=>!!oe())()&&ve()},get fallback(){return F(R,{get when(){return oe()},get fallback(){return F(R,{get when(){return ve()},get children(){return F(Ne,{})}})},get children(){return F(em,{get screenshots(){return e.traceInfo.screenshots},get viewport(){return t()},get testStartTimeMs(){return e.testStartTimeMs()},onScreenshotHover:Te,get previewEnabled(){return s()===`hover`}})}})},get children(){return F(Lp,{direction:`vertical`,get initialFirstPanelSize(){return ce()},minFirstPanelSize:7,maxFirstPanelSize:80,get firstPanel(){return F(em,{get screenshots(){return e.traceInfo.screenshots},get viewport(){return t()},get testStartTimeMs(){return e.testStartTimeMs()},onScreenshotHover:Te,get previewEnabled(){return s()===`hover`}})},get secondPanel(){return F(Ne,{})}})}})),H(r,F(R,{get when(){return fe().length>0},get children(){var e=Mx();return H(e,F(L,{get each(){return fe()},children:e=>F(Kf,{get title(){return e.title},disabled:!0,get disabledTooltip(){return e.tooltip}})})),e}}),a);var o=A;return typeof o==`function`?mt(o,a):A=a,H(a,F(R,{get when(){return nt(()=>!!x())()&&Me()>Ux},get children(){var e=Nx();return E(t=>{var n=`${je()}%`,r=`${Me()}%`;return n!==t.e&&V(e,`left`,t.e=n),r!==t.t&&V(e,`width`,t.t=r),t},{e:void 0,t:void 0}),e}}),null),H(a,F(R,{get when(){return nt(()=>s()===`hover`)()&&c()!==null},get children(){var e=Px();return E(t=>V(e,`left`,`${c()*100}%`)),e}}),null),H(a,F(R,{get when(){return nt(()=>s()===`locked`)()&&u()!==null},get children(){var e=Fx();return E(t=>V(e,`left`,`${u()*100}%`)),e}}),null),H(a,F(R,{get when(){return s()===`search-override`},get children(){return[F(R,{get when(){return u()!==null},get children(){var e=Fx();return E(t=>V(e,`left`,`${u()*100}%`)),e}}),F(R,{get when(){return c()!==null},get children(){var e=Ix();return E(t=>V(e,`left`,`${c()*100}%`)),e}})]}}),null),E(e=>{var t=`calc(100cqw - ${2*Gx+re()}px)`,i=x()?`crosshair`:void 0;return t!==e.e&&V(n,`--timeline-plot-width`,e.e=t),i!==e.t&&V(r,`cursor`,e.t=i),e},{e:void 0,t:void 0}),n})();return(()=>{var t=Rx(),n=t.firstChild;return H(t,F(Ax,{get testInfo(){return e.traceInfo.testInfo},get errorSpans(){return k()},hoverTimeMs:v,onSpanSelect:Oe,onSpanHover:Ae}),n),H(n,F(Lp,{direction:`horizontal`,initialFirstPanelSize:75,minFirstPanelSize:50,maxFirstPanelSize:90,get firstPanel(){return F(Pe,{})},get secondPanel(){return F(Ff,{get traceInfo(){return e.traceInfo},get hoveredElements(){return y()},get testStartTimeMs(){return e.testStartTimeMs()},get focusedElement(){return b()},onNavigateToSpan:ke})}})),t})()}ot([`mousedown`,`mousemove`,`dblclick`]);var Xx=z(`<div class="flex h-screen w-screen">`),Zx=z(`<div><h1>Error</h1><p></p><button type=button>Try Again`),Qx=z(`<div class="flex flex-1 items-center justify-center"><div class=text-center><div class=mb-2>Loading trace...</div><div class="text-sm text-gray-500">`);function $x(){let[e,t]=ec(),{traceInfoData:n,traceInfo:r}=wu(()=>e()?.source??null),i=()=>e()?r():void 0,a=()=>{let t=e();if(!(t?.origin!==`url`||!n.loading))return t.source},o=()=>{let t=e();return t?t.origin===`ui`&&n.loading?{kind:`loading`,message:tS(t.source)}:n.error?{kind:`error`,message:String(n.error)}:{kind:`idle`}:{kind:`idle`}},s=()=>nS(e()?.source);return F(qe,{fallback:(e,t)=>(()=>{var n=Zx(),r=n.firstChild.nextSibling,i=r.nextSibling;return H(r,()=>e.message),ut(i,`click`,t,!0),n})(),get children(){var e=Xx();return H(e,F(We,{get fallback(){return F(yc,{get initialApiUrl(){return s()},get status(){return o()},onLoadSource:e=>t(e,`ui`)})},get children(){return[F(Ge,{get when(){return i()},children:e=>F(Jx,{get traceInfo(){return e()}})}),F(Ge,{get when(){return a()},children:e=>F(eS,{get source(){return e()}})})]}})),e}})}function eS(e){return(()=>{var t=Qx(),n=t.firstChild.firstChild.nextSibling;return H(n,()=>tS(e.source)),t})()}function tS(e){switch(e.kind){case`local-zip`:return`Extracting ZIP file...`;case`remote-zip`:return`Downloading and extracting ZIP...`;case`remote-api`:return`Fetching trace data...`}}function nS(e){if(e)switch(e.kind){case`remote-api`:case`remote-zip`:return e.url;case`local-zip`:return}}ot([`click`]);var rS=document.getElementById(`root`);if(!rS)throw Error(`Root element not found`);at(()=>F($x,{}),rS);
|