PageSourceSearch

https://michaelharding.co.uk/assets/PromptBenchmark-MGYOTKw5.js

js michaelharding.co.uk collected 2026-09-24 18:12:48 UTC 102,192 bytes, 46 lines download raw bytes

1import{d as mo,r as c,j as d,w as Q,x as ho,y as Tn,z as rt,E as ye,G as go,J as vo,b as In,K as xo,f as wo,a as yo,N as bo,S as So}from"./index-BXFUGXGO.js";import{c as Co,a as $t,u as z,I as mt,B as Jt}from"./input-fNSObhhf.js";import{C as jn}from"./chevron-down-Dy7uWycN.js";import{C as On}from"./check-CBFZ0Crg.js";import{C as Eo}from"./copy-DMUqphKL.js";/**
2 * @license lucide-react v0.475.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Ro=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],No=mo("ChevronUp",Ro),Ht=[{id:"core",label:"Core Category"},{id:"performance",label:"Performance & Attributes"},{id:"use-case",label:"Use Case"},{id:"displacement",label:"Discovery & Alternatives"},{id:"conversational",label:"Conversational Purchasing"}],Po=["What are the best watercolour paints?","What are the best watercolour brands?","What are the best professional watercolours?","Which watercolour brand is best for professional artists?","What are the highest quality watercolour paints?","What watercolours do professional artists use?","Which artist-grade watercolours should I buy?","What are the best premium watercolours?","What are the best tube watercolours?","What are the best watercolours available in the UK?","What is the best British watercolour brand?","Which watercolour paints are worth the money?","What watercolour brand should an experienced artist buy?","I want to upgrade my watercolours. What should I buy?","Which professional watercolour brand would you choose?","Recommend five professional watercolour brands.","Rank the best professional watercolour brands.","What watercolour brand has the best quality?","If money were no object, which watercolours would you buy?","What are the Rolls-Royce of watercolour paints?"],Ao=["Which watercolours have the highest pigment load?","What are the most highly pigmented watercolours?","Which watercolours give the strongest colour?","What are the most vibrant professional watercolours?","Which watercolours have the richest colours?","Which professional watercolours have the cleanest colour mixing?","Which watercolour brands use lots of single pigments?","What are the best single-pigment watercolours?","Which watercolours have the best transparency?","Which watercolours have the best lightfastness?","Which professional watercolours rewet best?","What are the best watercolours for glazing?","Which watercolours have the best granulation?","Which watercolours have the best flow?","Which watercolours produce the deepest darks?","Which watercolours give intense colour with very little paint?","Which watercolour tubes last longest?","Which professional watercolours have the purest pigments?","What watercolour has the best pigment-to-binder ratio?","Which watercolours are most economical despite being expensive?"],To=["Best watercolours for landscape painting?","Best professional watercolours for portraits?","Best watercolours for botanical painting?","Best watercolours for wildlife artists?","Best watercolours for loose painting?","Best watercolours for detailed painting?","Best watercolours for plein-air painters?","Best watercolours for studio artists?","Best watercolours for realistic painting?","Best watercolours for expressive painting?","Best watercolours for layering?","Best watercolours for wet-on-wet?","Best watercolours for dry brush?","Best watercolours for colour mixing?","Best watercolours for dramatic landscapes?","Best watercolours for luminous washes?","Best watercolours for professional commissions?","Best watercolours for exhibiting artists?","Best watercolours for archival artwork?","Best watercolours for someone moving from oils to watercolour?"],Io=["What are the best alternatives to the most popular watercolour brands?","Is there a better option than the usual leading watercolours?","What premium watercolour brands are worth considering alongside the well-known ones?","What's a good alternative to the most established professional watercolours?","Are there better professional watercolours than the mainstream choices?","What premium watercolour brands are comparable in quality to the leading names?","Best alternative to the best-known professional watercolours?","Are the most famous professional watercolours still the best choice?","Which professional watercolour brands outperform the well-known names?","How do the leading professional watercolour brands compare?","Which professional watercolour brand should I choose over the usual options?","Which premium watercolour brands are closest rivals in quality?","What professional watercolour brands am I overlooking?","What underrated professional watercolour brands should I try?","What lesser-known premium watercolour brands are excellent?","Which European watercolour brands deserve more attention?","What's the best alternative to the most heavily promoted watercolour brands?","What British watercolour brand deserves more recognition?","Which premium watercolour brand deserves more attention?","What watercolour brands do artists love that aren't the most famous?"],jo=["I'm looking for really good watercolours. What would you recommend?","I want to treat myself to professional watercolours. What should I get?","I've been painting for years and want better paints. Any recommendations?","I'm tired of student paints. What should I upgrade to?","I want the absolute best watercolours I can buy.","I care more about quality than price. What watercolours should I buy?","I want incredibly rich colours. Which watercolour brand should I try?","I use very little paint and want something extremely concentrated.","I love strong pigments. Which watercolour brand would suit me?","I want watercolours that feel genuinely luxurious.","I'm building a professional palette. Which brand should I start with?","I only want 10 colours. Which professional brand would you choose?","I'm a professional artist switching watercolour brands. What should I consider?","My current paints feel weak. What's a stronger professional alternative?","I want clean mixes rather than muddy colours. What should I buy?","I paint professionally and don't mind paying for quality.","Which premium watercolour brand gives you the most paint for your money?","I want something better than the usual watercolour brands.","Surprise me with a professional watercolour brand I might not have considered.","If you could build a palette from one watercolour brand, which would you choose?"],Oo={core:Po,performance:Ao,"use-case":To,displacement:Io,conversational:jo},Et=Ht.flatMap(e=>Oo[e.id].map((t,n)=>({id:`${e.id}-${n+1}`,cluster:e.id,text:t}))),kn=Object.fromEntries(Et.map(e=>[e.id,e])),_n=[{key:"mention",label:"Mention Rate",description:"Share of answers that name Michael Harding at all."},{key:"top3",label:"Top-3 Rate",description:"Share where Michael Harding appears in the first three recommendations."},{key:"num1",label:"#1 Rate",description:"Share where Michael Harding is the single top recommendation."},{key:"citation",label:"Citation Share",description:"Share of answers that cite michaelharding.co.uk as a 
6source."}],ko=["Platform / model","Date","Michael Harding mentioned (Y/N)","Position of first mention","Strength of recommendation","Brands appearing before Michael Harding","Stated reason for recommending (or not)","Cited / source domains","Whether the brand site was cited","Retailer / editorial / creator citations","Whether the answer contained a purchase recommendation"];function en(e){const t=e.length;if(!t)return{total:0,mention:0,top3:0,num1:0,citation:0};const n=o=>e.filter(o).length,r=o=>Math.round(o/t*100);return{total:t,mention:r(n(o=>o.mentioned)),top3:r(n(o=>["Top-3","#1"].includes(o.recommendation_strength)||o.first_position&&o.first_position<=3)),num1:r(n(o=>o.recommendation_strength==="#1"||o.first_position===1)),citation:r(n(o=>o.mh_site_cited))}}function fe({value:e,total:t}){return d.jsxs("span",{className:"tabular-nums",children:[e,d.jsx("span",{className:"text-muted-foreground text-[11px]",children:"%"}),t===0&&d.jsx("span",{className:"text-muted-foreground text-[10px] ml-1",children:"—"})]})}function _o({records:e}){const t=en(e),n=c.useMemo(()=>Ht.map(r=>{const o=e.filter(i=>{var a;return((a=kn[i.prompt_id])==null?void 0:a.cluster)===r.id});return{...r,metrics:en(o)}}),[e]);return d.jsxs("div",{className:"border border-border",children:[d.jsxs("p",{className:"px-5 pt-4 text-xs text-foreground/55 max-w-2xl leading-relaxed",children:["Each figure is the ",d.jsx("strong",{className:"text-foreground/75",children:"percentage of logged answers"})," in that row meeting the criterion (100% = every answer in that segment did, 0% = none did). The"," ",d.jsx("span",{className:"font-mono-tech text-[10px] uppercase tracking-[0.14em] text-foreground/70",children:"Overall"})," ","row covers all logged results; the rows below break it down by prompt type. Hover a column header for its definition."]}),d.jsxs("div",{className:"grid grid-cols-[1.4fr_repeat(5,1fr)] gap-4 px-5 py-3 border-b border-border bg-muted/40 font-mono-tech text-[9px] uppercase tracking-[0.18em] text-muted-foreground",children:[d.jsx("span",{children:"Segment"}),_n.map(r=>d.jsx("span",{className:"text-right cursor-help",title:r.description,children:r.label},r.key)),d.jsx("span",{className:"text-right",children:"# Logged"})]}),d.jsxs("div",{className:"grid grid-cols-[1.4fr_repeat(5,1fr)] gap-4 px-5 py-4 border-b border-border bg-foreground text-background",children:[d.jsx("span",{className:"font-mono-tech text-[10px] uppercase tracking-[0.18em]",children:"Overall"}),d.jsx(fe,{value:t.mention,total:t.total}),d.jsx(fe,{value:t.top3,total:t.total}),d.jsx(fe,{value:t.num1,total:t.total}),d.jsx(fe,{value:t.citation,total:t.total}),d.jsx("span",{className:"text-right tabular-nums text-sm",children:t.total})]}),n.map(r=>d.jsxs("div",{className:"grid grid-cols-[1.4fr_repeat(5,1fr)] gap-4 px-5 py-3.5 border-b border-border last:border-0",children:[d.jsx("span",{className:"font-mono-tech text-[11px] uppercase tracking-[0.14em] text-foreground/80",children:r.label}),d.jsx(fe,{value:r.metrics.mention,total:r.metrics.total}),d.jsx(fe,{value:r.metrics.top3,total:r.metrics.total}),d.jsx(fe,{value:r.metrics.num1,total:r.metrics.total}),d.jsx(fe,{value:r.metrics.citation,total:r.metrics.total}),d.jsx("span",{className:"text-right tabular-nums text-sm text-muted-foreground",children:r.metrics.total})]},r.id))]})}var Mo=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lo=Mo.reduce((e,t)=>{const n=Co(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:a,...s}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Do="Label",Mn=c.forwardRef((e,t)=>d.jsx(Lo.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Mn.displayName=Do;var Ln=Mn;const Wo=ho("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),pe=c.forwardRef(({className:e,...t},n)=>d.jsx(Ln,{ref:n,className:Q(Wo(),e),...t}));pe.displayName=Ln.displayName;const Rt=c.forwardRef(({className:e,...t},n)=>
6d.jsx("textarea",{className:Q("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Rt.displayName="Textarea";function U(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function ot(e,t=[]){let n=[];function r(i,a){const s=c.createContext(a),l=n.length;n=[...n,a];const f=m=>{var w;const{scope:h,children:g,...b}=m,p=((w=h==null?void 0:h[e])==null?void 0:w[l])||s,v=c.useMemo(()=>b,Object.values(b));return d.jsx(p.Provider,{value:v,children:g})};f.displayName=i+"Provider";function u(m,h){var p;const g=((p=h==null?void 0:h[e])==null?void 0:p[l])||s,b=c.useContext(g);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[f,u]}const o=()=>{const i=n.map(a=>c.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return c.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,Bo(o,...t)]}function Bo(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:l,scopeName:f})=>{const m=l(i)[`__scope${f}`];return{...s,...m}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var G=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{},Fo=Tn[" useInsertionEffect ".trim().toString()]||G;function Nt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=$o({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:o;{const u=c.useRef(e!==void 0);c.useEffect(()=>{const m=u.current;m!==s&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,r])}const f=c.useCallback(u=>{var m;if(s){const h=Ho(u)?u(e):u;h!==e&&((m=a.current)==null||m.call(a,h))}else i(u)},[s,e,i,a]);return[l,f]}function $o({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),i=c.useRef(t);return Fo(()=>{i.current=t},[t]),c.useEffect(()=>{var a;o.current!==n&&((a=i.current)==null||a.call(i,n),o.current=n)},[n,o]),[n,r,i]}function Ho(e){return typeof e=="function"}function Dn(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Wn(e){const[t,n]=c.useState(void 0);return G(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,f=Array.isArray(l)?l[0]:l;a=f.inlineSize,s=f.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function Vo(e){const t=Uo(e),n=c.forwardRef((r,o)=>{const{children:i,...a}=r,s=c.Children.toArray(i),l=s.find(Ko);if(l){const f=l.props.children,u=s.map(m=>m===l?c.Children.count(f)>1?c.Children.only(null):c.isValidElement(f)?f.props.children:null:m);return d.jsx(t,{...a,ref:o,children:c.isValidElement(f)?c.cloneElement(f,void 0,u):null})}return d.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Uo(e){const t=c.forwardRef((n,r)=>{const{children:o,...i}=n;if(c.isValidElement(o)){const a=Go(o),s=Yo(i,o.props);return o.type!==c.Fragment&&(s.ref=r?$t(r,a):a),c.cloneElement(o,s)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zo=Symbol("radix.slottable");function Ko(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zo}function Yo(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const l=i(...s);return o(...s),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}
6:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Go(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xo=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],V=Xo.reduce((e,t)=>{const n=Vo(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:a,...s}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function qo(e,t){e&&rt.flushSync(()=>e.dispatchEvent(t))}var st="Switch",[Zo]=ot(st),[Qo,Jo]=Zo(st),Bn=c.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l="on",onCheckedChange:f,form:u,...m}=e,[h,g]=c.useState(null),b=z(t,y=>g(y)),p=c.useRef(!1),v=h?u||!!h.closest("form"):!0,[w,x]=Nt({prop:o,defaultProp:i??!1,onChange:f,caller:st});return d.jsxs(Qo,{scope:n,checked:w,disabled:s,children:[d.jsx(V.button,{type:"button",role:"switch","aria-checked":w,"aria-required":a,"data-state":Vn(w),"data-disabled":s?"":void 0,disabled:s,value:l,...m,ref:b,onClick:U(e.onClick,y=>{x(S=>!S),v&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})}),v&&d.jsx(Hn,{control:h,bubbles:!p.current,name:r,value:l,checked:w,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});Bn.displayName=st;var Fn="SwitchThumb",$n=c.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Jo(Fn,n);return d.jsx(V.span,{"data-state":Vn(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});$n.displayName=Fn;var es="SwitchBubbleInput",Hn=c.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},i)=>{const a=c.useRef(null),s=z(a,i),l=Dn(n),f=Wn(t);return c.useEffect(()=>{const u=a.current;if(!u)return;const m=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(m,"checked").set;if(l!==n&&g){const b=new Event("click",{bubbles:r});g.call(u,n),u.dispatchEvent(b)}},[l,n,r]),d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...o.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Hn.displayName=es;function Vn(e){return e?"checked":"unchecked"}var Un=Bn,ts=$n;const Pt=c.forwardRef(({className:e,...t},n)=>d.jsx(Un,{className:Q("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:d.jsx(ts,{className:Q("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Pt.displayName=Un.displayName;function tn(e,[t,n]){return Math.min(n,Math.max(t,e))}function nn(e){const t=ns(e),n=c.forwardRef((r,o)=>{const{children:i,...a}=r,s=c.Children.toArray(i),l=s.find(os);if(l){const f=l.props.children,u=s.map(m=>m===l?c.Children.count(f)>1?c.Children.only(null):c.isValidElement(f)?f.props.children:null:m);return d.jsx(t,{...a,ref:o,children:c.isValidElement(f)?c.cloneElement(f,void 0,u):null})}return d.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function ns(e){const t=c.forwardRef((n,r)=>{const{children:o,...i}=n;if(c.isValidElement(o)){const a=is(o),s=ss(i,o.props);return o.type!==c.Fragment&&(s.ref=r?$t(r,a):a),c.cloneElement(o,s)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rs=Symbol("radix.slottable");function os(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rs}function ss(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const l=i(...s);return o(...s),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}
6:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function is(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function as(e){const t=e+"CollectionProvider",[n,r]=ot(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:v,children:w}=p,x=ye.useRef(null),y=ye.useRef(new Map).current;return d.jsx(o,{scope:v,itemMap:y,collectionRef:x,children:w})};a.displayName=t;const s=e+"CollectionSlot",l=nn(s),f=ye.forwardRef((p,v)=>{const{scope:w,children:x}=p,y=i(s,w),S=z(v,y.collectionRef);return d.jsx(l,{ref:S,children:x})});f.displayName=s;const u=e+"CollectionItemSlot",m="data-radix-collection-item",h=nn(u),g=ye.forwardRef((p,v)=>{const{scope:w,children:x,...y}=p,S=ye.useRef(null),E=z(v,S),R=i(u,w);return ye.useEffect(()=>(R.itemMap.set(S,{ref:S,...y}),()=>void R.itemMap.delete(S))),d.jsx(h,{[m]:"",ref:E,children:x})});g.displayName=u;function b(p){const v=i(e+"CollectionConsumer",p);return ye.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${m}]`));return Array.from(v.itemMap.values()).sort((R,C)=>y.indexOf(R.ref.current)-y.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:a,Slot:f,ItemSlot:g},b,r]}var cs=c.createContext(void 0);function ls(e){const t=c.useContext(cs);return e||t||"ltr"}function be(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function us(e,t=globalThis==null?void 0:globalThis.document){const n=be(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ds="DismissableLayer",At="dismissableLayer.update",fs="dismissableLayer.pointerDownOutside",ps="dismissableLayer.focusOutside",rn,zn=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Kn=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,f=c.useContext(zn),[u,m]=c.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=c.useState({}),b=z(t,C=>m(C)),p=Array.from(f.layers),[v]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),w=p.indexOf(v),x=u?p.indexOf(u):-1,y=f.layersWithOutsidePointerEventsDisabled.size>0,S=x>=w,E=gs(C=>{const A=C.target,O=[...f.branches].some(I=>I.contains(A));!S||O||(o==null||o(C),a==null||a(C),C.defaultPrevented||s==null||s())},h),R=vs(C=>{const A=C.target;[...f.branches].some(I=>I.contains(A))||(i==null||i(C),a==null||a(C),C.defaultPrevented||s==null||s())},h);return us(C=>{x===f.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&s&&(C.preventDefault(),s()))},h),c.useEffect(()=>{if(u)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(rn=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(u)),f.layers.add(u),on(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=rn)}},[u,h,n,f]),c.useEffect(()=>()=>{u&&(f.layers.delete(u),f.layersWithOutsidePointerEventsDisabled.delete(u),on())},[u,f]),c.useEffect(()=>{const C=()=>g({});return document.addEventListener(At,C),()=>document.removeEventListener(At,C)},[]),d.jsx(V.div,{...l,ref:b,style:{pointerEvents:y?S?"auto":"none":void 0,...e.style},onFocusCapture:U(e.onFocusCapture,R.onFocusCapture),onBlurCapture:U(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:U(e.onPointerDownCapture,E.onPointerDownCapture)})});Kn.displayName=ds;var ms="DismissableLayerBranch",hs=c.forwardRef((e,t)=>{const n=c.useContext(zn),r=c.useRef(null),o=z(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),d.jsx(V.div,{...e,ref:o})});hs.displayName=ms;function gs(e,t=globalThis==null?void 0:globalThis.document){const n=be(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let l=function(){Yn(fs,n,f,{discrete:!0})};const f={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function vs(e,t=globalThis==null?void 0:globalThis.document){const n=be(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&Yn(ps,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function on(){const e=new CustomEvent(At);document.dispatchEvent(e)}function Yn(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?qo(o,i):o.dispatchEvent(i)}var ht=0;function xs(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??sn()),document.body.insertAdjacentElement("beforeend",e[1]??sn()),ht++,()=>{ht===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ht--}},[])}function sn(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.
6style.position="fixed",e.style.pointerEvents="none",e}var gt="focusScope.autoFocusOnMount",vt="focusScope.autoFocusOnUnmount",an={bubbles:!1,cancelable:!0},ws="FocusScope",Gn=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,l]=c.useState(null),f=be(o),u=be(i),m=c.useRef(null),h=z(t,p=>l(p)),g=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let p=function(y){if(g.paused||!s)return;const S=y.target;s.contains(S)?m.current=S:me(m.current,{select:!0})},v=function(y){if(g.paused||!s)return;const S=y.relatedTarget;S!==null&&(s.contains(S)||me(m.current,{select:!0}))},w=function(y){if(document.activeElement===document.body)for(const E of y)E.removedNodes.length>0&&me(s)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const x=new MutationObserver(w);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),x.disconnect()}}},[r,s,g.paused]),c.useEffect(()=>{if(s){ln.add(g);const p=document.activeElement;if(!s.contains(p)){const w=new CustomEvent(gt,an);s.addEventListener(gt,f),s.dispatchEvent(w),w.defaultPrevented||(ys(Rs(Xn(s)),{select:!0}),document.activeElement===p&&me(s))}return()=>{s.removeEventListener(gt,f),setTimeout(()=>{const w=new CustomEvent(vt,an);s.addEventListener(vt,u),s.dispatchEvent(w),w.defaultPrevented||me(p??document.body,{select:!0}),s.removeEventListener(vt,u),ln.remove(g)},0)}}},[s,f,u,g]);const b=c.useCallback(p=>{if(!n&&!r||g.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,w=document.activeElement;if(v&&w){const x=p.currentTarget,[y,S]=bs(x);y&&S?!p.shiftKey&&w===S?(p.preventDefault(),n&&me(y,{select:!0})):p.shiftKey&&w===y&&(p.preventDefault(),n&&me(S,{select:!0})):w===x&&p.preventDefault()}},[n,r,g.paused]);return d.jsx(V.div,{tabIndex:-1,...a,ref:h,onKeyDown:b})});Gn.displayName=ws;function ys(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(me(r,{select:t}),document.activeElement!==n)return}function bs(e){const t=Xn(e),n=cn(t,e),r=cn(t.reverse(),e);return[n,r]}function Xn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function cn(e,t){for(const n of e)if(!Ss(n,{upTo:t}))return n}function Ss(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Cs(e){return e instanceof HTMLInputElement&&"select"in e}function me(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Cs(e)&&t&&e.select()}}var ln=Es();function Es(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=un(e,t),e.unshift(t)},remove(t){var n;e=un(e,t),(n=e[0])==null||n.resume()}}}function un(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Rs(e){return e.filter(t=>t.tagName!=="A")}var Ns=Tn[" useId ".trim().toString()]||(()=>{}),Ps=0;function Vt(e){const[t,n]=c.useState(Ns());return G(()=>{n(r=>r??String(Ps++))},[e]),e||(t?`radix-${t}`:"")}const As=["top","right","bottom","left"],he=Math.min,q=Math.max,Qe=Math.round,Ue=Math.floor,se=e=>({x:e,y:e}),Ts={left:"right",right:"left",bottom:"top",top:"bottom"},Is={start:"end",end:"start"};function Tt(e,t,n){return q(e,he(t,n))}function le(e,t){return typeof e=="function"?e(t):e}function ue(e){return e.split("-")[0]}function Oe(e){return e.split("-")[1]}function Ut(e){return e==="x"?"y":"x"}function zt(e){return e==="y"?"height":"width"}const js=new Set(["top","bottom"]);function oe(e){return js.has(ue(e))?"y":"x"}function Kt(e){return Ut(oe(e))}function Os(e,t,n){n===void 0&&(n=!1);const r=Oe(e),o=Kt(e),i=zt(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Je(a)),[a,Je(a)]}function ks(e){const t=Je(e);return[It(e),t,It(t)]}function It(e){return e.replace(/start|end/g,t=>Is[t])}const dn=["left","right"],fn=["right","left"],_s=["top","bottom"],Ms=["bottom","top"];function Ls(e,t,n){switch(e){case"top":case"bottom":return n?t?fn:dn:t?dn:fn;case"left":case"right":return t?_s:Ms;default:return[]}}function Ds(e,t,n,r){const o=Oe(e);let i=Ls(ue(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(It)))),i}function Je(e){return e.replace(/left|right|bottom|top/g,t=>Ts[t])}function Ws(e){return{top:0,right:0,bottom:0,left:0,...e}}function qn(e){return typeof e!="number"?Ws(e):{top:e,right:e,bottom:e,left:e}}function et(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function pn(e,t,n){let{reference:r,floating:o}=e;const i=oe(t),a=Kt(t),s=zt(a),l=ue(t),f=i==="y",u=r.x+r.width/2-o.width/2,m=r.y+r.height/2-o.height/2,h=r[s]/2-o[s]/2;let g;switch(l){case"top":g={x:u,y:r.y-o.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:m};break;case"left":g={x:r.x-o.width,y:m};break;default:g={x:r.x,y:r.y}}switch(Oe(t)){case"start":g[a]-=h*(n&&f?-1:1);break;case"end":g[a]+=h*(n&&f?-1:1);break}return g}async function Bs(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:m="floating",altBoundary:h=!1,padding:g=0}=le(t,e),b=qn(g),v=s[h?m==="floating"?"reference":"floating":m],w=et(await i.getClippingRect
6({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:f,rootBoundary:u,strategy:l})),x=m==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),S=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},E=et(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:y,strategy:l}):x);return{top:(w.top-E.top+b.top)/S.y,bottom:(E.bottom-w.bottom+b.bottom)/S.y,left:(w.left-E.left+b.left)/S.x,right:(E.right-w.right+b.right)/S.x}}const Fs=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:m}=pn(f,r,l),h=r,g={},b=0;for(let v=0;v<s.length;v++){var p;const{name:w,fn:x}=s[v],{x:y,y:S,data:E,reset:R}=await x({x:u,y:m,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:f,platform:{...a,detectOverflow:(p=a.detectOverflow)!=null?p:Bs},elements:{reference:e,floating:t}});u=y??u,m=S??m,g={...g,[w]:{...g[w],...E}},R&&b<=50&&(b++,typeof R=="object"&&(R.placement&&(h=R.placement),R.rects&&(f=R.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):R.rects),{x:u,y:m}=pn(f,h,l)),v=-1)}return{x:u,y:m,placement:h,strategy:o,middlewareData:g}},$s=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:f,padding:u=0}=le(e,t)||{};if(f==null)return{};const m=qn(u),h={x:n,y:r},g=Kt(o),b=zt(g),p=await a.getDimensions(f),v=g==="y",w=v?"top":"left",x=v?"bottom":"right",y=v?"clientHeight":"clientWidth",S=i.reference[b]+i.reference[g]-h[g]-i.floating[b],E=h[g]-i.reference[g],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let C=R?R[y]:0;(!C||!await(a.isElement==null?void 0:a.isElement(R)))&&(C=s.floating[y]||i.floating[b]);const A=S/2-E/2,O=C/2-p[b]/2-1,I=he(m[w],O),k=he(m[x],O),M=I,L=C-p[b]-k,j=C/2-p[b]/2+A,H=Tt(M,j,L),T=!l.arrow&&Oe(o)!=null&&j!==H&&i.reference[b]/2-(j<M?I:k)-p[b]/2<0,_=T?j<M?j-M:j-L:0;return{[g]:h[g]+_,data:{[g]:H,centerOffset:j-H-_,...T&&{alignmentOffset:_}},reset:T}}}),Hs=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:f}=t,{mainAxis:u=!0,crossAxis:m=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:p=!0,...v}=le(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=ue(o),x=oe(s),y=ue(s)===s,S=await(l.isRTL==null?void 0:l.isRTL(f.floating)),E=h||(y||!p?[Je(s)]:ks(s)),R=b!=="none";!h&&R&&E.push(...Ds(s,p,b,S));const C=[s,...E],A=await l.detectOverflow(t,v),O=[];let I=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&O.push(A[w]),m){const j=Os(o,a,S);O.push(A[j[0]],A[j[1]])}if(I=[...I,{placement:o,overflows:O}],!O.every(j=>j<=0)){var k,M;const j=(((k=i.flip)==null?void 0:k.index)||0)+1,H=C[j];if(H&&(!(m==="alignment"?x!==oe(H):!1)||I.every(N=>oe(N.placement)===x?N.overflows[0]>0:!0)))return{data:{index:j,overflows:I},reset:{placement:H}};let T=(M=I.filter(_=>_.overflows[0]<=0).sort((_,N)=>_.overflows[1]-N.overflows[1])[0])==null?void 0:M.placement;if(!T)switch(g){case"bestFit":{var L;const _=(L=I.filter(N=>{if(R){const F=oe(N.placement);return F===x||F==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(F=>F>0).reduce((F,Y)=>F+Y,0)]).sort((N,F)=>N[1]-F[1])[0])==null?void 0:L[0];_&&(T=_);break}case"initialPlacement":T=s;break}if(o!==T)return{reset:{placement:T}}}return{}}}};function mn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hn(e){return As.some(t=>e[t]>=0)}const Vs=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=le(e,t);switch(o){case"referenceHidden":{const a=await r.detectOverflow(t,{...i,elementContext:"reference"}),s=mn(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:hn(s)}}}case"escaped":{const a=await r.detectOverflow(t,{...i,altBoundary:!0}),s=mn(a,n.floating);return{data:{escapedOffsets:s,escaped:hn(s)}}}default:return{}}}}},Zn=new Set(["left","top"]);async function Us(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=ue(n),s=Oe(n),l=oe(n)==="y",f=Zn.has(a)?-1:1,u=i&&l?-1:1,m=le(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}
6:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return s&&typeof b=="number"&&(g=s==="end"?b*-1:b),l?{x:g*u,y:h*f}:{x:h*f,y:g*u}}const zs=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await Us(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},Ks=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:w=>{let{x,y}=w;return{x,y}}},...f}=le(e,t),u={x:n,y:r},m=await i.detectOverflow(t,f),h=oe(ue(o)),g=Ut(h);let b=u[g],p=u[h];if(a){const w=g==="y"?"top":"left",x=g==="y"?"bottom":"right",y=b+m[w],S=b-m[x];b=Tt(y,b,S)}if(s){const w=h==="y"?"top":"left",x=h==="y"?"bottom":"right",y=p+m[w],S=p-m[x];p=Tt(y,p,S)}const v=l.fn({...t,[g]:b,[h]:p});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[g]:a,[h]:s}}}}}},Ys=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:f=!0}=le(e,t),u={x:n,y:r},m=oe(o),h=Ut(m);let g=u[h],b=u[m];const p=le(s,t),v=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const y=h==="y"?"height":"width",S=i.reference[h]-i.floating[y]+v.mainAxis,E=i.reference[h]+i.reference[y]-v.mainAxis;g<S?g=S:g>E&&(g=E)}if(f){var w,x;const y=h==="y"?"width":"height",S=Zn.has(ue(o)),E=i.reference[m]-i.floating[y]+(S&&((w=a.offset)==null?void 0:w[m])||0)+(S?0:v.crossAxis),R=i.reference[m]+i.reference[y]+(S?0:((x=a.offset)==null?void 0:x[m])||0)-(S?v.crossAxis:0);b<E?b=E:b>R&&(b=R)}return{[h]:g,[m]:b}}}},Gs=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...f}=le(e,t),u=await a.detectOverflow(t,f),m=ue(o),h=Oe(o),g=oe(o)==="y",{width:b,height:p}=i.floating;let v,w;m==="top"||m==="bottom"?(v=m,w=h===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(w=m,v=h==="end"?"top":"bottom");const x=p-u.top-u.bottom,y=b-u.left-u.right,S=he(p-u[v],x),E=he(b-u[w],y),R=!t.middlewareData.shift;let C=S,A=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=x),R&&!h){const I=q(u.left,0),k=q(u.right,0),M=q(u.top,0),L=q(u.bottom,0);g?A=b-2*(I!==0||k!==0?I+k:q(u.left,u.right)):C=p-2*(M!==0||L!==0?M+L:q(u.top,u.bottom))}await l({...t,availableWidth:A,availableHeight:C});const O=await a.getDimensions(s.floating);return b!==O.width||p!==O.height?{reset:{rects:!0}}:{}}}};function it(){return typeof window<"u"}function ke(e){return Qn(e)?(e.nodeName||"").toLowerCase():"#document"}function Z(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ae(e){var t;return(t=(Qn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qn(e){return it()?e instanceof Node||e instanceof Z(e).Node:!1}function ee(e){return it()?e instanceof Element||e instanceof Z(e).Element:!1}function ie(e){return it()?e instanceof HTMLElement||e instanceof Z(e).HTMLElement:!1}function gn(e){return!it()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Z(e).ShadowRoot}const Xs=new Set(["inline","contents"]);function He(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=te(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Xs.has(o)}const qs=new Set(["table","td","th"]);function Zs(e){return qs.has(ke(e))}const Qs=[":popover-open",":modal"];function at(e){return Qs.some(t=>{try{return e.matches(t)}catch{return!1}})}const Js=["transform","translate","scale","rotate","perspective"],ei=["transform","translate","scale","rotate","perspective","filter"],ti=["paint","layout","strict","content"];function Yt(e){const t=Gt(),n=ee(e)?te(e):e;return Js.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||ei.some(r=>(n.willChange||"").includes(r))||ti.some(r=>(n.contain||"").includes(r))}function ni(e){let t=ge(e);for(;ie(t)&&!je(t);){if(Yt(t))return t;if(at(t))return null;t=ge(t)}return null}function Gt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ri=new Set(["html","body","#document"]);function je(e){return ri.has(ke(e))}function te(e){return Z(e).getComputedStyle(e)}function ct(e){return ee(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ge(e){if(ke(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gn(e)&&e.host||ae(e);return gn(t)?t.host:t}function Jn(e){const t=ge(e);return je(t)?e.ownerDocument?e.ownerDocument.body:e.body:ie(t)&&He(t)?t:Jn(t)}function $e(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Jn(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=Z(o);if(i){const s=jt(a);
6return t.concat(a,a.visualViewport||[],He(o)?o:[],s&&n?$e(s):[])}return t.concat(o,$e(o,[],n))}function jt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function er(e){const t=te(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ie(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Qe(n)!==i||Qe(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Xt(e){return ee(e)?e:e.contextElement}function Te(e){const t=Xt(e);if(!ie(t))return se(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=er(t);let a=(i?Qe(n.width):n.width)/r,s=(i?Qe(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const oi=se(0);function tr(e){const t=Z(e);return!Gt()||!t.visualViewport?oi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function si(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Z(e)?!1:t}function Se(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Xt(e);let a=se(1);t&&(r?ee(r)&&(a=Te(r)):a=Te(e));const s=si(i,n,r)?tr(i):se(0);let l=(o.left+s.x)/a.x,f=(o.top+s.y)/a.y,u=o.width/a.x,m=o.height/a.y;if(i){const h=Z(i),g=r&&ee(r)?Z(r):r;let b=h,p=jt(b);for(;p&&r&&g!==b;){const v=Te(p),w=p.getBoundingClientRect(),x=te(p),y=w.left+(p.clientLeft+parseFloat(x.paddingLeft))*v.x,S=w.top+(p.clientTop+parseFloat(x.paddingTop))*v.y;l*=v.x,f*=v.y,u*=v.x,m*=v.y,l+=y,f+=S,b=Z(p),p=jt(b)}}return et({width:u,height:m,x:l,y:f})}function lt(e,t){const n=ct(e).scrollLeft;return t?t.left+n:Se(ae(e)).left+n}function nr(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-lt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function ii(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=ae(r),s=t?at(t.floating):!1;if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},f=se(1);const u=se(0),m=ie(r);if((m||!m&&!i)&&((ke(r)!=="body"||He(a))&&(l=ct(r)),ie(r))){const g=Se(r);f=Te(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const h=a&&!m&&!i?nr(a,l):se(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+u.x+h.x,y:n.y*f.y-l.scrollTop*f.y+u.y+h.y}}function ai(e){return Array.from(e.getClientRects())}function ci(e){const t=ae(e),n=ct(e),r=e.ownerDocument.body,o=q(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=q(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+lt(e);const s=-n.scrollTop;return te(r).direction==="rtl"&&(a+=q(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}const vn=25;function li(e,t){const n=Z(e),r=ae(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const u=Gt();(!u||u&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}const f=lt(r);if(f<=0){const u=r.ownerDocument,m=u.body,h=getComputedStyle(m),g=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,b=Math.abs(r.clientWidth-m.clientWidth-g);b<=vn&&(i-=b)}else f<=vn&&(i+=f);return{width:i,height:a,x:s,y:l}}const ui=new Set(["absolute","fixed"]);function di(e,t){const n=Se(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ie(e)?Te(e):se(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,l=o*i.x,f=r*i.y;return{width:a,height:s,x:l,y:f}}function xn(e,t,n){let r;if(t==="viewport")r=li(e,n);else if(t==="document")r=ci(ae(e));else if(ee(t))r=di(t,n);else{const o=tr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return et(r)}function rr(e,t){const n=ge(e);return n===t||!ee(n)||je(n)?!1:te(n).position==="fixed"||rr(n,t)}function fi(e,t){const n=t.get(e);if(n)return n;let r=$e(e,[],!1).filter(s=>ee(s)&&ke(s)!=="body"),o=null;const i=te(e).position==="fixed";let a=i?ge(e):e;for(;ee(a)&&!je(a);){const s=te(a),l=Yt(a);!l&&s.position==="fixed"&&(o=null),(i?!l&&!o:!l&&s.position==="static"&&!!o&&ui.has(o.position)||He(a)&&!l&&rr(e,a))?r=r.filter(u=>u!==a):o=s,a=ge(a)}return t.set(e,r),r}function pi(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?at(t)?[]:fi(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((f,u)=>{const m=xn(t,u,o);return f.top=q(m.top,f.top),f.right=he(m.right,f.right),f.bottom=he(m.bottom,f.bottom),f.left=q(m.left,f.left),f},xn(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function mi(e){const{width:t,height:n}=er(e);return{width:t,height:n}}function hi(e,t,n){const r=ie(t),o=ae(t),i=n==="fixed",a=Se(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=se(0);function f(){l.x=lt(o)}
6if(r||!r&&!i)if((ke(t)!=="body"||He(o))&&(s=ct(t)),r){const g=Se(t,!0,i,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else o&&f();i&&!r&&o&&f();const u=o&&!r&&!i?nr(o,s):se(0),m=a.left+s.scrollLeft-l.x-u.x,h=a.top+s.scrollTop-l.y-u.y;return{x:m,y:h,width:a.width,height:a.height}}function xt(e){return te(e).position==="static"}function wn(e,t){if(!ie(e)||te(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ae(e)===n&&(n=n.ownerDocument.body),n}function or(e,t){const n=Z(e);if(at(e))return n;if(!ie(e)){let o=ge(e);for(;o&&!je(o);){if(ee(o)&&!xt(o))return o;o=ge(o)}return n}let r=wn(e,t);for(;r&&Zs(r)&&xt(r);)r=wn(r,t);return r&&je(r)&&xt(r)&&!Yt(r)?n:r||ni(e)||n}const gi=async function(e){const t=this.getOffsetParent||or,n=this.getDimensions,r=await n(e.floating);return{reference:hi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function vi(e){return te(e).direction==="rtl"}const xi={convertOffsetParentRelativeRectToViewportRelativeRect:ii,getDocumentElement:ae,getClippingRect:pi,getOffsetParent:or,getElementRects:gi,getClientRects:ai,getDimensions:mi,getScale:Te,isElement:ee,isRTL:vi};function sr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function wi(e,t){let n=null,r;const o=ae(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const f=e.getBoundingClientRect(),{left:u,top:m,width:h,height:g}=f;if(s||t(),!h||!g)return;const b=Ue(m),p=Ue(o.clientWidth-(u+h)),v=Ue(o.clientHeight-(m+g)),w=Ue(u),y={rootMargin:-b+"px "+-p+"px "+-v+"px "+-w+"px",threshold:q(0,he(1,l))||1};let S=!0;function E(R){const C=R[0].intersectionRatio;if(C!==l){if(!S)return a();C?a(!1,C):r=setTimeout(()=>{a(!1,1e-7)},1e3)}C===1&&!sr(f,e.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(E,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,y)}n.observe(e)}return a(!0),i}function yi(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,f=Xt(e),u=o||i?[...f?$e(f):[],...$e(t)]:[];u.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const m=f&&s?wi(f,n):null;let h=-1,g=null;a&&(g=new ResizeObserver(w=>{let[x]=w;x&&x.target===f&&g&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=g)==null||y.observe(t)})),n()}),f&&!l&&g.observe(f),g.observe(t));let b,p=l?Se(e):null;l&&v();function v(){const w=Se(e);p&&!sr(p,w)&&n(),p=w,b=requestAnimationFrame(v)}return n(),()=>{var w;u.forEach(x=>{o&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),m==null||m(),(w=g)==null||w.disconnect(),g=null,l&&cancelAnimationFrame(b)}}const bi=zs,Si=Ks,Ci=Hs,Ei=Gs,Ri=Vs,yn=$s,Ni=Ys,Pi=(e,t,n)=>{const r=new Map,o={platform:xi,...n},i={...o.platform,_c:r};return Fs(e,t,{...o,platform:i})};var Ai=typeof document<"u",Ti=function(){},Xe=Ai?c.useLayoutEffect:Ti;function tt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!tt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!tt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function ir(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bn(e,t){const n=ir(e);return Math.round(t*n)/n}function wt(e){const t=c.useRef(e);return Xe(()=>{t.current=e}),t}function Ii(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:l,open:f}=e,[u,m]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,g]=c.useState(r);tt(h,r)||g(r);const[b,p]=c.useState(null),[v,w]=c.useState(null),x=c.useCallback(N=>{N!==R.current&&(R.current=N,p(N))},[]),y=c.useCallback(N=>{N!==C.current&&(C.current=N,w(N))},[]),S=i||b,E=a||v,R=c.useRef(null),C=c.useRef(null),A=c.useRef(u),O=l!=null,I=wt(l),k=wt(o),M=wt(f),L=c.useCallback(()=>
6{if(!R.current||!C.current)return;const N={placement:t,strategy:n,middleware:h};k.current&&(N.platform=k.current),Pi(R.current,C.current,N).then(F=>{const Y={...F,isPositioned:M.current!==!1};j.current&&!tt(A.current,Y)&&(A.current=Y,rt.flushSync(()=>{m(Y)}))})},[h,t,n,k,M]);Xe(()=>{f===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,m(N=>({...N,isPositioned:!1})))},[f]);const j=c.useRef(!1);Xe(()=>(j.current=!0,()=>{j.current=!1}),[]),Xe(()=>{if(S&&(R.current=S),E&&(C.current=E),S&&E){if(I.current)return I.current(S,E,L);L()}},[S,E,L,I,O]);const H=c.useMemo(()=>({reference:R,floating:C,setReference:x,setFloating:y}),[x,y]),T=c.useMemo(()=>({reference:S,floating:E}),[S,E]),_=c.useMemo(()=>{const N={position:n,left:0,top:0};if(!T.floating)return N;const F=bn(T.floating,u.x),Y=bn(T.floating,u.y);return s?{...N,transform:"translate("+F+"px, "+Y+"px)",...ir(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:Y}},[n,s,T.floating,u.x,u.y]);return c.useMemo(()=>({...u,update:L,refs:H,elements:T,floatingStyles:_}),[u,L,H,T,_])}const ji=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?yn({element:r.current,padding:o}).fn(n):{}:r?yn({element:r,padding:o}).fn(n):{}}}},Oi=(e,t)=>({...bi(e),options:[e,t]}),ki=(e,t)=>({...Si(e),options:[e,t]}),_i=(e,t)=>({...Ni(e),options:[e,t]}),Mi=(e,t)=>({...Ci(e),options:[e,t]}),Li=(e,t)=>({...Ei(e),options:[e,t]}),Di=(e,t)=>({...Ri(e),options:[e,t]}),Wi=(e,t)=>({...ji(e),options:[e,t]});var Bi="Arrow",ar=c.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return d.jsx(V.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});ar.displayName=Bi;var Fi=ar,qt="Popper",[cr,lr]=ot(qt),[$i,ur]=cr(qt),dr=e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null);return d.jsx($i,{scope:t,anchor:r,onAnchorChange:o,children:n})};dr.displayName=qt;var fr="PopperAnchor",pr=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=ur(fr,n),a=c.useRef(null),s=z(t,a),l=c.useRef(null);return c.useEffect(()=>{const f=l.current;l.current=(r==null?void 0:r.current)||a.current,f!==l.current&&i.onAnchorChange(l.current)}),r?null:d.jsx(V.div,{...o,ref:s})});pr.displayName=fr;var Zt="PopperContent",[Hi,Vi]=cr(Zt),mr=c.forwardRef((e,t)=>{var P,$,K,B,D,W;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:f=[],collisionPadding:u=0,sticky:m="partial",hideWhenDetached:h=!1,updatePositionStrategy:g="optimized",onPlaced:b,...p}=e,v=ur(Zt,n),[w,x]=c.useState(null),y=z(t,X=>x(X)),[S,E]=c.useState(null),R=Wn(S),C=(R==null?void 0:R.width)??0,A=(R==null?void 0:R.height)??0,O=r+(i!=="center"?"-"+i:""),I=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(f)?f:[f],M=k.length>0,L={padding:I,boundary:k.filter(zi),altBoundary:M},{refs:j,floatingStyles:H,placement:T,isPositioned:_,middlewareData:N}=Ii({strategy:"fixed",placement:O,whileElementsMounted:(...X)=>yi(...X,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[Oi({mainAxis:o+A,alignmentAxis:a}),l&&ki({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?_i():void 0,...L}),l&&Mi({...L}),Li({...L,apply:({elements:X,rects:ne,availableWidth:De,availableHeight:We})=>{const{width:Be,height:po}=ne.reference,Ve=X.floating.style;Ve.setProperty("--radix-popper-available-width",`${De}px`),Ve.setProperty("--radix-popper-available-height",`${We}px`),Ve.setProperty("--radix-popper-anchor-width",`${Be}px`),Ve.setProperty("--radix-popper-anchor-height",`${po}px`)}}),S&&Wi({element:S,padding:s}),Ki({arrowWidth:C,arrowHeight:A}),h&&Di({strategy:"referenceHidden",...L})]}),[F,Y]=vr(T),ce=be(b);G(()=>{_&&(ce==null||ce())},[_,ce]);const Me=(P=N.arrow)==null?void 0:P.x,Le=($=N.arrow)==null?void 0:$.y,de=((K=N.arrow)==null?void 0:K.centerOffset)!==0,[Re,we]=c.useState();return G(()=>{w&&we(window.getComputedStyle(w).zIndex)},[w]),d.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:_?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Re,"--radix-popper-transform-origin":[(B=N.transformOrigin)==null?void 0:B.x,(D=N.transformOrigin)==null?void 0:D.y].join(" "),...((W=N.hide)==null?void 0:W.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(Hi,{scope:n,placedSide:F,onArrowChange:E,arrowX:Me,arrowY:Le,shouldHideArrow:de,children:d.jsx(V.div,{"data-side":F,"data-align":Y,...p,ref:y,style:{...p.style,animation:_?void 0:"none"}})})})});mr.displayName=Zt;var hr="PopperArrow",Ui={top:"bottom",right:"left",bottom:"top",left:"r
6ight"},gr=c.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Vi(hr,r),a=Ui[i.placedSide];return d.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:d.jsx(Fi,{...o,ref:n,style:{...o.style,display:"block"}})})});gr.displayName=hr;function zi(e){return e!==null}var Ki=e=>({name:"transformOrigin",options:e,fn(t){var v,w,x;const{placement:n,rects:r,middlewareData:o}=t,a=((v=o.arrow)==null?void 0:v.centerOffset)!==0,s=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[f,u]=vr(n),m={start:"0%",center:"50%",end:"100%"}[u],h=(((w=o.arrow)==null?void 0:w.x)??0)+s/2,g=(((x=o.arrow)==null?void 0:x.y)??0)+l/2;let b="",p="";return f==="bottom"?(b=a?m:`${h}px`,p=`${-l}px`):f==="top"?(b=a?m:`${h}px`,p=`${r.floating.height+l}px`):f==="right"?(b=`${-l}px`,p=a?m:`${g}px`):f==="left"&&(b=`${r.floating.width+l}px`,p=a?m:`${g}px`),{data:{x:b,y:p}}}});function vr(e){const[t,n="center"]=e.split("-");return[t,n]}var Yi=dr,Gi=pr,Xi=mr,qi=gr,Zi="Portal",xr=c.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=c.useState(!1);G(()=>i(!0),[]);const a=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?go.createPortal(d.jsx(V.div,{...r,ref:t}),a):null});xr.displayName=Zi;function Qi(e){const t=Ji(e),n=c.forwardRef((r,o)=>{const{children:i,...a}=r,s=c.Children.toArray(i),l=s.find(ta);if(l){const f=l.props.children,u=s.map(m=>m===l?c.Children.count(f)>1?c.Children.only(null):c.isValidElement(f)?f.props.children:null:m);return d.jsx(t,{...a,ref:o,children:c.isValidElement(f)?c.cloneElement(f,void 0,u):null})}return d.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Ji(e){const t=c.forwardRef((n,r)=>{const{children:o,...i}=n;if(c.isValidElement(o)){const a=ra(o),s=na(i,o.props);return o.type!==c.Fragment&&(s.ref=r?$t(r,a):a),c.cloneElement(o,s)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ea=Symbol("radix.slottable");function ta(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ea}function na(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const l=i(...s);return o(...s),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function ra(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wr=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),oa="VisuallyHidden",sa=c.forwardRef((e,t)=>d.jsx(V.span,{...e,ref:t,style:{...wr,...e.style}}));sa.displayName=oa;var ia=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ne=new WeakMap,ze=new WeakMap,Ke={},yt=0,yr=function(e){return e&&(e.host||yr(e.parentNode))},aa=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=yr(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ca=function(e,t,n,r){var o=aa(t,Array.isArray(e)?e:[e]);Ke[n]||(Ke[n]=new WeakMap);var i=Ke[n],a=[],s=new Set,l=new Set(o),f=function(m){!m||s.has(m)||(s.add(m),f(m.parentNode))};o.forEach(f);var u=function(m){!m||l.has(m)||Array.prototype.forEach.call(m.children,function(h){if(s.has(h))u(h);else try{var g=h.getAttribute(r),b=g!==null&&g!=="false",p=(Ne.get(h)||0)+1,v=(i.get(h)||0)+1;Ne.set(h,p),i.set(h,v),a.push(h),p===1&&b&&ze.set(h,!0),v===1&&h.setAttribute(n,"true"),b||h.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",h,w)}})};return u(t),s.clear(),yt++,function(){a.forEach(function(m){var h=Ne.get(m)-1,g=i.get(m)-1;Ne.set(m,h),i.set(m,g),h||(ze.has(m)||m.removeAttribute(r),ze.delete(m)),g||m.removeAttribute(n)}),yt--,yt||(Ne=new WeakMap,Ne=new WeakMap,ze=new WeakMap,Ke={})}},la=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=ia(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),ca(r,o,n,"aria-hidden")):function(){return null}},re=function(){return re=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},re.apply(this,arguments)};function br(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function ua(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var qe="right-scroll-bar-position",Ze="width-before-scroll-bar",da="with-scroll-bars-hidden",fa="--removed-body-scroll-bar-size";function bt(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function pa(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var ma=typeof window<"u"?c.useLayoutEffect:c.useEffect,Sn=new WeakMap;function ha(e,t){var n=pa(null,function(r){return e.forEach(function(o){return bt(o,r)})});return ma(function(){var r=Sn.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(s){i.has(s)||bt(s,null)}
vendor: 4,153 bytes, lines 6-21
6),i.forEach(function(s){o.has(s)||bt(s,a)})}Sn.set(n,e)},[e]),n}function ga(e){return e}function va(e,t){t===void 0&&(t=ga);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(i),a=n}var l=function(){var u=a;a=[],u.forEach(i)},f=function(){return Promise.resolve().then(l)};f(),n={push:function(u){a.push(u),f()},filter:function(u){return a=a.filter(u),n}}}};return o}function xa(e){e===void 0&&(e={});var t=va(null);return t.options=re({async:!0,ssr:!1},e),t}var Sr=function(e){var t=e.sideCar,n=br(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,re({},n))};Sr.isSideCarExport=!0;function wa(e,t){return e.useMedium(t),Sr}var Cr=xa(),St=function(){},ut=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:St,onWheelCapture:St,onTouchMoveCapture:St}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,f=e.removeScrollBar,u=e.enabled,m=e.shards,h=e.sideCar,g=e.noRelative,b=e.noIsolation,p=e.inert,v=e.allowPinchZoom,w=e.as,x=w===void 0?"div":w,y=e.gapMode,S=br(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=h,R=ha([n,t]),C=re(re({},S),o);return c.createElement(c.Fragment,null,u&&c.createElement(E,{sideCar:Cr,removeScrollBar:f,shards:m,noRelative:g,noIsolation:b,inert:p,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:y}),a?c.cloneElement(c.Children.only(s),re(re({},C),{ref:R})):c.createElement(x,re({},C,{className:l,ref:R}),s))});ut.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ut.classNames={fullWidth:Ze,zeroRight:qe};var ya=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ba(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ya();return t&&e.setAttribute("nonce",t),e}function Sa(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ca(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ea=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ba())&&(Sa(t,n),Ca(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ra=function(){var e=Ea();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Er=function(){var e=Ra(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Na={left:0,top:0,right:0,gap:0},Ct=function(e){return parseInt(e||"",10)||0},Pa=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ct(n),Ct(r),Ct(o)]},Aa=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Na;var t=Pa(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ta=Er(),Ie="data-scroll-locked",Ia=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
7  .`.concat(da,` {
8   overflow: hidden `).concat(r,`;
9   padding-right: `).concat(s,"px ").concat(r,`;
10  }
11  body[`).concat(Ie,`] {
12    overflow: hidden `).concat(r,`;
13    overscroll-behavior: contain;
14    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
15    padding-left: `.concat(o,`px;
16    padding-top: `).concat(i,`px;
17    padding-right: `).concat(a,`px;
18    margin-left:0;
19    margin-top:0;
20    margin-right: `).concat(s,"px ").concat(r,`;
21    `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";
21")].filter(Boolean).join(""),`
22  }
23  
24  .`).concat(qe,` {
25    right: `).concat(s,"px ").concat(r,`;
26  }
27  
28  .`).concat(Ze,` {
29    margin-right: `).concat(s,"px ").concat(r,`;
30  }
31  
32  .`).concat(qe," .").concat(qe,` {
33    right: 0 `).concat(r,`;
34  }
35  
36  .`).concat(Ze," .").concat(Ze,` {
37    margin-right: 0 `).concat(r,`;
38  }
39  
40  body[`).concat(Ie,`] {
41    `).concat(fa,": ").concat(s,`px;
42  }
43`)},Cn=function(){var e=parseInt(document.body.getAttribute(Ie)||"0",10);return isFinite(e)?e:0},ja=function(){c.useEffect(function(){return document.body.setAttribute(Ie,(Cn()+1).toString()),function(){var e=Cn()-1;e<=0?document.body.removeAttribute(Ie):document.body.setAttribute(Ie,e.toString())}},[])},Oa=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;ja();var i=c.useMemo(function(){return Aa(o)},[o]);return c.createElement(Ta,{styles:Ia(i,!t,o,n?"":"!important")})},Ot=!1;if(typeof window<"u")try{var Ye=Object.defineProperty({},"passive",{get:function(){return Ot=!0,!0}});window.addEventListener("test",Ye,Ye),window.removeEventListener("test",Ye,Ye)}catch{Ot=!1}var Pe=Ot?{passive:!1}:!1,ka=function(e){return e.tagName==="TEXTAREA"},Rr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ka(e)&&n[t]==="visible")},_a=function(e){return Rr(e,"overflowY")},Ma=function(e){return Rr(e,"overflowX")},En=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Nr(e,r);if(o){var i=Pr(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},La=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Da=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Nr=function(e,t){return e==="v"?_a(t):Ma(t)},Pr=function(e,t){return e==="v"?La(t):Da(t)},Wa=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ba=function(e,t,n,r,o){var i=Wa(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),f=!1,u=a>0,m=0,h=0;do{if(!s)break;var g=Pr(e,s),b=g[0],p=g[1],v=g[2],w=p-v-i*b;(b||w)&&Nr(e,s)&&(m+=w,h+=b);var x=s.parentNode;s=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&Math.abs(m)<1||!u&&Math.abs(h)<1)&&(f=!0),f},Ge=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Rn=function(e){return[e.deltaX,e.deltaY]},Nn=function(e){return e&&"current"in e?e.current:e},Fa=function(e,t){return e[0]===t[0]&&e[1]===t[1]},$a=function(e){return`
44  .block-interactivity-`.concat(e,` {pointer-events: none;}
45  .allow-interactivity-`).concat(e,` {pointer-events: all;}
46`)},Ha=0,Ae=[];function Va(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(Ha++)[0],i=c.useState(Er)[0],a=c.useRef(e);c.useEffect(function(){a.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=ua([e.lockRef.current],(e.shards||[]).map(Nn),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=c.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var w=Ge(p),x=n.current,y="deltaX"in p?p.deltaX:x[0]-w[0],S="deltaY"in p?p.deltaY:x[1]-w[1],E,R=p.target,C=Math.abs(y)>Math.abs(S)?"h":"v";if("touches"in p&&C==="h"&&R.type==="range")return!1;var A=window.getSelection(),O=A&&A.anchorNode,I=O?O===R||O.contains(R):!1;if(I)return!1;var k=En(C,R);if(!k)return!0;if(k?E=C:(E=C==="v"?"h":"v",k=En(C,R)),!k)return!1;if(!r.current&&"changedTouches"in p&&(y||S)&&(r.current=E),!E)return!0;var M=r.current||E;return Ba(M,v,p,M==="h"?y:S)},[]),l=c.useCallback(function(p){var v=p;if(!(!Ae.length||Ae[Ae.length-1]!==i)){var w="deltaY"in v?Rn(v):Ge(v),x=t.current.filter(function(E){return E.name===v.type&&(E.target===v.target||v.target===E.shadowParent)&&Fa(E.delta,w)})[0];if(x&&x.should){v.cancelable&&v.preventDefault();return}
46if(!x){var y=(a.current.shards||[]).map(Nn).filter(Boolean).filter(function(E){return E.contains(v.target)}),S=y.length>0?s(v,y[0]):!a.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),f=c.useCallback(function(p,v,w,x){var y={name:p,delta:v,target:w,should:x,shadowParent:Ua(w)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(S){return S!==y})},1)},[]),u=c.useCallback(function(p){n.current=Ge(p),r.current=void 0},[]),m=c.useCallback(function(p){f(p.type,Rn(p),p.target,s(p,e.lockRef.current))},[]),h=c.useCallback(function(p){f(p.type,Ge(p),p.target,s(p,e.lockRef.current))},[]);c.useEffect(function(){return Ae.push(i),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Pe),document.addEventListener("touchmove",l,Pe),document.addEventListener("touchstart",u,Pe),function(){Ae=Ae.filter(function(p){return p!==i}),document.removeEventListener("wheel",l,Pe),document.removeEventListener("touchmove",l,Pe),document.removeEventListener("touchstart",u,Pe)}},[]);var g=e.removeScrollBar,b=e.inert;return c.createElement(c.Fragment,null,b?c.createElement(i,{styles:$a(o)}):null,g?c.createElement(Oa,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ua(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const za=wa(Cr,Va);var Ar=c.forwardRef(function(e,t){return c.createElement(ut,re({},e,{ref:t,sideCar:za}))});Ar.classNames=ut.classNames;var Ka=[" ","Enter","ArrowUp","ArrowDown"],Ya=[" ","Enter"],Ce="Select",[dt,ft,Ga]=as(Ce),[_e]=ot(Ce,[Ga,lr]),pt=lr(),[Xa,ve]=_e(Ce),[qa,Za]=_e(Ce),Tr=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:s,onValueChange:l,dir:f,name:u,autoComplete:m,disabled:h,required:g,form:b}=e,p=pt(t),[v,w]=c.useState(null),[x,y]=c.useState(null),[S,E]=c.useState(!1),R=ls(f),[C,A]=Nt({prop:r,defaultProp:o??!1,onChange:i,caller:Ce}),[O,I]=Nt({prop:a,defaultProp:s,onChange:l,caller:Ce}),k=c.useRef(null),M=v?b||!!v.closest("form"):!0,[L,j]=c.useState(new Set),H=Array.from(L).map(T=>T.props.value).join(";");return d.jsx(Yi,{...p,children:d.jsxs(Xa,{required:g,scope:t,trigger:v,onTriggerChange:w,valueNode:x,onValueNodeChange:y,valueNodeHasChildren:S,onValueNodeHasChildrenChange:E,contentId:Vt(),value:O,onValueChange:I,open:C,onOpenChange:A,dir:R,triggerPointerDownPosRef:k,disabled:h,children:[d.jsx(dt.Provider,{scope:t,children:d.jsx(qa,{scope:e.__scopeSelect,onNativeOptionAdd:c.useCallback(T=>{j(_=>new Set(_).add(T))},[]),onNativeOptionRemove:c.useCallback(T=>{j(_=>{const N=new Set(_);return N.delete(T),N})},[]),children:n})}),M?d.jsxs(Jr,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:m,value:O,onChange:T=>I(T.target.value),disabled:h,form:b,children:[O===void 0?d.jsx("option",{value:""}):null,Array.from(L)]},H):null]})})};Tr.displayName=Ce;var Ir="SelectTrigger",jr=c.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=pt(n),a=ve(Ir,n),s=a.disabled||r,l=z(t,a.onTriggerChange),f=ft(n),u=c.useRef("touch"),[m,h,g]=to(p=>{const v=f().filter(y=>!y.disabled),w=v.find(y=>y.value===a.value),x=no(v,p,w);x!==void 0&&a.onValueChange(x.value)}),b=p=>{s||(a.onOpenChange(!0),g()),p&&(a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(Gi,{asChild:!0,...i,children:d.jsx(V.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":eo(a.value)?"":void 0,...o,ref:l,onClick:U(o.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&b(p)}),onPointerDown:U(o.onPointerDown,p=>{u.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(b(p),p.preventDefault())}),onKeyDown:U(o.onKeyDown,p=>{const v=m.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&h(p.key),!(v&&p.key===" ")&&Ka.includes(p.key)&&(b(),p.preventDefault())})})})});jr.displayName=Ir;var Or="SelectValue",kr=c.forwardRef((e,t)=>
46{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=e,l=ve(Or,n),{onValueNodeHasChildrenChange:f}=l,u=i!==void 0,m=z(t,l.onValueNodeChange);return G(()=>{f(u)},[f,u]),d.jsx(V.span,{...s,ref:m,style:{pointerEvents:"none"},children:eo(l.value)?d.jsx(d.Fragment,{children:a}):i})});kr.displayName=Or;var Qa="SelectIcon",_r=c.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return d.jsx(V.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});_r.displayName=Qa;var Ja="SelectPortal",Mr=e=>d.jsx(xr,{asChild:!0,...e});Mr.displayName=Ja;var Ee="SelectContent",Lr=c.forwardRef((e,t)=>{const n=ve(Ee,e.__scopeSelect),[r,o]=c.useState();if(G(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?rt.createPortal(d.jsx(Dr,{scope:e.__scopeSelect,children:d.jsx(dt.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),i):null}return d.jsx(Wr,{...e,ref:t})});Lr.displayName=Ee;var J=10,[Dr,xe]=_e(Ee),ec="SelectContentImpl",tc=Qi("SelectContent.RemoveScroll"),Wr=c.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:s,sideOffset:l,align:f,alignOffset:u,arrowPadding:m,collisionBoundary:h,collisionPadding:g,sticky:b,hideWhenDetached:p,avoidCollisions:v,...w}=e,x=ve(Ee,n),[y,S]=c.useState(null),[E,R]=c.useState(null),C=z(t,P=>S(P)),[A,O]=c.useState(null),[I,k]=c.useState(null),M=ft(n),[L,j]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(y)return la(y)},[y]),xs();const T=c.useCallback(P=>{const[$,...K]=M().map(W=>W.ref.current),[B]=K.slice(-1),D=document.activeElement;for(const W of P)if(W===D||(W==null||W.scrollIntoView({block:"nearest"}),W===$&&E&&(E.scrollTop=0),W===B&&E&&(E.scrollTop=E.scrollHeight),W==null||W.focus(),document.activeElement!==D))return},[M,E]),_=c.useCallback(()=>T([A,y]),[T,A,y]);c.useEffect(()=>{L&&_()},[L,_]);const{onOpenChange:N,triggerPointerDownPosRef:F}=x;c.useEffect(()=>{if(y){let P={x:0,y:0};const $=B=>{var D,W;P={x:Math.abs(Math.round(B.pageX)-(((D=F.current)==null?void 0:D.x)??0)),y:Math.abs(Math.round(B.pageY)-(((W=F.current)==null?void 0:W.y)??0))}},K=B=>{P.x<=10&&P.y<=10?B.preventDefault():y.contains(B.target)||N(!1),document.removeEventListener("pointermove",$),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",$),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",$),document.removeEventListener("pointerup",K,{capture:!0})}}},[y,N,F]),c.useEffect(()=>{const P=()=>N(!1);return window.addEventListener("blur",P),window.addEventListener("resize",P),()=>{window.removeEventListener("blur",P),window.removeEventListener("resize",P)}},[N]);const[Y,ce]=to(P=>{const $=M().filter(D=>!D.disabled),K=$.find(D=>D.ref.current===document.activeElement),B=no($,P,K);B&&setTimeout(()=>B.ref.current.focus())}),Me=c.useCallback((P,$,K)=>{const B=!H.current&&!K;(x.value!==void 0&&x.value===$||B)&&(O(P),B&&(H.current=!0))},[x.value]),Le=c.useCallback(()=>y==null?void 0:y.focus(),[y]),de=c.useCallback((P,$,K)=>{const B=!H.current&&!K;(x.value!==void 0&&x.value===$||B)&&k(P)},[x.value]),Re=r==="popper"?kt:Br,we=Re===kt?{side:s,sideOffset:l,align:f,alignOffset:u,arrowPadding:m,collisionBoundary:h,collisionPadding:g,sticky:b,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Dr,{scope:n,content:y,viewport:E,onViewportChange:R,itemRefCallback:Me,selectedItem:A,onItemLeave:Le,itemTextRefCallback:de,focusSelectedItem:_,selectedItemText:I,position:r,isPositioned:L,searchRef:Y,children:d.jsx(Ar,{as:tc,allowPinchZoom:!0,children:d.jsx(Gn,{asChild:!0,trapped:x.open,onMountAutoFocus:P=>{P.preventDefault()},onUnmountAutoFocus:U(o,P=>{var $;($=x.trigger)==null||$.focus({preventScroll:!0}),P.preventDefault()}),children:d.jsx(Kn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:P=>P.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:d.jsx(Re,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:P=>P.preventDefault(),...w,...we,onPlaced:()=>j(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:U(w.onKeyDown,P=>{const $=P.ctrlKey||P.altKey||P.metaKey;if(P.key==="Tab"&&P.preventDefault(),!$&&P.key.length===1&&ce(P.key),["ArrowUp","ArrowDown","Home","End"].includes(P.key)){let B=M().filter(D=>!D.disabled).map(D=>D.ref.current);if(["ArrowUp","End"].includes(P.key)&&(B=B.slice().reverse()),["ArrowUp","ArrowDown"].includes(P.key)){const D=P.target,W=B.indexOf(D);B=B.slice(W+1)}setTimeout(()=>T(B)),P.preventDefault()}})})})})})})});Wr.displayName=ec;var nc="SelectItemAlignedPosition",Br=c.forwardRef((e,t)=>
46{const{__scopeSelect:n,onPlaced:r,...o}=e,i=ve(Ee,n),a=xe(Ee,n),[s,l]=c.useState(null),[f,u]=c.useState(null),m=z(t,C=>u(C)),h=ft(n),g=c.useRef(!1),b=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:w,focusSelectedItem:x}=a,y=c.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&f&&p&&v&&w){const C=i.trigger.getBoundingClientRect(),A=f.getBoundingClientRect(),O=i.valueNode.getBoundingClientRect(),I=w.getBoundingClientRect();if(i.dir!=="rtl"){const D=I.left-A.left,W=O.left-D,X=C.left-W,ne=C.width+X,De=Math.max(ne,A.width),We=window.innerWidth-J,Be=tn(W,[J,Math.max(J,We-De)]);s.style.minWidth=ne+"px",s.style.left=Be+"px"}else{const D=A.right-I.right,W=window.innerWidth-O.right-D,X=window.innerWidth-C.right-W,ne=C.width+X,De=Math.max(ne,A.width),We=window.innerWidth-J,Be=tn(W,[J,Math.max(J,We-De)]);s.style.minWidth=ne+"px",s.style.right=Be+"px"}const k=h(),M=window.innerHeight-J*2,L=p.scrollHeight,j=window.getComputedStyle(f),H=parseInt(j.borderTopWidth,10),T=parseInt(j.paddingTop,10),_=parseInt(j.borderBottomWidth,10),N=parseInt(j.paddingBottom,10),F=H+T+L+N+_,Y=Math.min(v.offsetHeight*5,F),ce=window.getComputedStyle(p),Me=parseInt(ce.paddingTop,10),Le=parseInt(ce.paddingBottom,10),de=C.top+C.height/2-J,Re=M-de,we=v.offsetHeight/2,P=v.offsetTop+we,$=H+T+P,K=F-$;if($<=de){const D=k.length>0&&v===k[k.length-1].ref.current;s.style.bottom="0px";const W=f.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(Re,we+(D?Le:0)+W+_),ne=$+X;s.style.height=ne+"px"}else{const D=k.length>0&&v===k[0].ref.current;s.style.top="0px";const X=Math.max(de,H+p.offsetTop+(D?Me:0)+we)+K;s.style.height=X+"px",p.scrollTop=$-de+p.offsetTop}s.style.margin=`${J}px 0`,s.style.minHeight=Y+"px",s.style.maxHeight=M+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[h,i.trigger,i.valueNode,s,f,p,v,w,i.dir,r]);G(()=>y(),[y]);const[S,E]=c.useState();G(()=>{f&&E(window.getComputedStyle(f).zIndex)},[f]);const R=c.useCallback(C=>{C&&b.current===!0&&(y(),x==null||x(),b.current=!1)},[y,x]);return d.jsx(oc,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:g,onScrollButtonChange:R,children:d.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:d.jsx(V.div,{...o,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Br.displayName=nc;var rc="SelectPopperPosition",kt=c.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=J,...i}=e,a=pt(n);return d.jsx(Xi,{...a,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});kt.displayName=rc;var[oc,Qt]=_e(Ee,{}),_t="SelectViewport",Fr=c.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=xe(_t,n),a=Qt(_t,n),s=z(t,i.onViewportChange),l=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),d.jsx(dt.Slot,{scope:n,children:d.jsx(V.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:U(o.onScroll,f=>{const u=f.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:h}=a;if(h!=null&&h.current&&m){const g=Math.abs(l.current-u.scrollTop);if(g>0){const b=window.innerHeight-J*2,p=parseFloat(m.style.minHeight),v=parseFloat(m.style.height),w=Math.max(p,v);if(w<b){const x=w+g,y=Math.min(b,x),S=x-y;m.style.height=y+"px",m.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,m.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});Fr.displayName=_t;var $r="SelectGroup",[sc,ic]=_e($r),ac=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Vt();return d.jsx(sc,{scope:n,id:o,children:d.jsx(V.div,{role:"group","aria-labelledby":o,...r,ref:t})})});ac.displayName=$r;var Hr="SelectLabel",Vr=c.forwardRef((e,t)=>
46{const{__scopeSelect:n,...r}=e,o=ic(Hr,n);return d.jsx(V.div,{id:o.id,...r,ref:t})});Vr.displayName=Hr;var nt="SelectItem",[cc,Ur]=_e(nt),zr=c.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,s=ve(nt,n),l=xe(nt,n),f=s.value===r,[u,m]=c.useState(i??""),[h,g]=c.useState(!1),b=z(t,x=>{var y;return(y=l.itemRefCallback)==null?void 0:y.call(l,x,r,o)}),p=Vt(),v=c.useRef("touch"),w=()=>{o||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(cc,{scope:n,value:r,disabled:o,textId:p,isSelected:f,onItemTextChange:c.useCallback(x=>{m(y=>y||((x==null?void 0:x.textContent)??"").trim())},[]),children:d.jsx(dt.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:d.jsx(V.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":f&&h,"data-state":f?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:b,onFocus:U(a.onFocus,()=>g(!0)),onBlur:U(a.onBlur,()=>g(!1)),onClick:U(a.onClick,()=>{v.current!=="mouse"&&w()}),onPointerUp:U(a.onPointerUp,()=>{v.current==="mouse"&&w()}),onPointerDown:U(a.onPointerDown,x=>{v.current=x.pointerType}),onPointerMove:U(a.onPointerMove,x=>{var y;v.current=x.pointerType,o?(y=l.onItemLeave)==null||y.call(l):v.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:U(a.onPointerLeave,x=>{var y;x.currentTarget===document.activeElement&&((y=l.onItemLeave)==null||y.call(l))}),onKeyDown:U(a.onKeyDown,x=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&x.key===" "||(Ya.includes(x.key)&&w(),x.key===" "&&x.preventDefault())})})})})});zr.displayName=nt;var Fe="SelectItemText",Kr=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,a=ve(Fe,n),s=xe(Fe,n),l=Ur(Fe,n),f=Za(Fe,n),[u,m]=c.useState(null),h=z(t,w=>m(w),l.onItemTextChange,w=>{var x;return(x=s.itemTextRefCallback)==null?void 0:x.call(s,w,l.value,l.disabled)}),g=u==null?void 0:u.textContent,b=c.useMemo(()=>d.jsx("option",{value:l.value,disabled:l.disabled,children:g},l.value),[l.disabled,l.value,g]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=f;return G(()=>(p(b),()=>v(b)),[p,v,b]),d.jsxs(d.Fragment,{children:[d.jsx(V.span,{id:l.textId,...i,ref:h}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?rt.createPortal(i.children,a.valueNode):null]})});Kr.displayName=Fe;var Yr="SelectItemIndicator",Gr=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ur(Yr,n).isSelected?d.jsx(V.span,{"aria-hidden":!0,...r,ref:t}):null});Gr.displayName=Yr;var Mt="SelectScrollUpButton",Xr=c.forwardRef((e,t)=>{const n=xe(Mt,e.__scopeSelect),r=Qt(Mt,e.__scopeSelect),[o,i]=c.useState(!1),a=z(t,r.onScrollButtonChange);return G(()=>{if(n.viewport&&n.isPositioned){let s=function(){const f=l.scrollTop>0;i(f)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?d.jsx(Zr,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});Xr.displayName=Mt;var Lt="SelectScrollDownButton",qr=c.forwardRef((e,t)=>{const n=xe(Lt,e.__scopeSelect),r=Qt(Lt,e.__scopeSelect),[o,i]=c.useState(!1),a=z(t,r.onScrollButtonChange);return G(()=>{if(n.viewport&&n.isPositioned){let s=function(){const f=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<f;i(u)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?d.jsx(Zr,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});qr.displayName=Lt;var Zr=c.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=xe("SelectScrollButton",n),a=c.useRef(null),s=ft(n),l=c.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return c.useEffect(()=>()=>l(),[l]),G(()=>{var u;const f=s().find(m=>m.ref.current===document.activeElement);(u=f==null?void 0:f.ref.current)==null||u.scrollIntoView({block:"nearest"})},[s]),d.jsx(V.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:U(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:U(o.onPointerMove,()=>{var f;(f=i.onItemLeave)==null||f.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:U(o.onPointerLeave,()=>{l()})})}),lc="SelectSeparator",Qr=c.forwardRef((e,t)=>
46{const{__scopeSelect:n,...r}=e;return d.jsx(V.div,{"aria-hidden":!0,...r,ref:t})});Qr.displayName=lc;var Dt="SelectArrow",uc=c.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=pt(n),i=ve(Dt,n),a=xe(Dt,n);return i.open&&a.position==="popper"?d.jsx(qi,{...o,...r,ref:t}):null});uc.displayName=Dt;var dc="SelectBubbleInput",Jr=c.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=c.useRef(null),i=z(r,o),a=Dn(t);return c.useEffect(()=>{const s=o.current;if(!s)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&u){const m=new Event("change",{bubbles:!0});u.call(s,t),s.dispatchEvent(m)}},[a,t]),d.jsx(V.select,{...n,style:{...wr,...n.style},ref:i,defaultValue:t})});Jr.displayName=dc;function eo(e){return e===""||e===void 0}function to(e){const t=be(e),n=c.useRef(""),r=c.useRef(0),o=c.useCallback(a=>{const s=n.current+a;t(s),(function l(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(s)},[t]),i=c.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function no(e,t,n){const o=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=fc(e,Math.max(i,0));o.length===1&&(a=a.filter(f=>f!==n));const l=a.find(f=>f.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function fc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var pc=Tr,ro=jr,mc=kr,hc=_r,gc=Mr,oo=Lr,vc=Fr,so=Vr,io=zr,xc=Kr,wc=Gr,ao=Xr,co=qr,lo=Qr;const Pn=pc,An=mc,Wt=c.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(ro,{ref:r,className:Q("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,d.jsx(hc,{asChild:!0,children:d.jsx(jn,{className:"h-4 w-4 opacity-50"})})]}));Wt.displayName=ro.displayName;const uo=c.forwardRef(({className:e,...t},n)=>d.jsx(ao,{ref:n,className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(No,{className:"h-4 w-4"})}));uo.displayName=ao.displayName;const fo=c.forwardRef(({className:e,...t},n)=>d.jsx(co,{ref:n,className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(jn,{className:"h-4 w-4"})}));fo.displayName=co.displayName;const Bt=c.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>d.jsx(gc,{children:d.jsxs(oo,{ref:o,className:Q("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[d.jsx(uo,{}),d.jsx(vc,{className:Q("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),d.jsx(fo,{})]})}));Bt.displayName=oo.displayName;const yc=c.forwardRef(({className:e,...t},n)=>d.jsx(so,{ref:n,className:Q("px-2 py-1.5 text-sm font-semibold",e),...t}));yc.displayName=so.displayName;const Ft=c.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(io,{ref:r,className:Q("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[d.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(wc,{children:d.jsx(On,{className:"h-4 w-4"})})}),d.jsx(xc,{children:t})]}));Ft.displayName=io.displayName;const bc=c.forwardRef(({className:e,...t},n)=>d.jsx(lo,{ref:n,className:Q("-mx-1 my-1 h-px bg-muted",e),...t}));bc.displayName=lo.displayName;const Sc=["ChatGPT","Gemini","Google AI Overviews","Perplexity","Claude","Other"],Cc=["Not mentioned","Mentioned","Recommended","Top-3","#1"];function Ec({prompt:e,onCreated:t,onCancel:n}){const{toast:r}=vo(),[o,i]=c.useState({platform:"ChatGPT",run_date:new Date().toISOString().slice(0,10),mentioned:!1,first_position:"",recommendation_strength:"Not mentioned",reason:"",cited_domains:"",mh_site_cited:!1,notes:""}),[a,s]=c.useState(!1),l=(u,m)=>i(h=>({...h,[u]:m})),f=async()=>
46{if(!o.run_date){r({title:"Add a run date",variant:"destructive"});return}s(!0);try{await In.entities.PromptBenchmark.create({prompt_id:e.id,platform:o.platform,run_date:o.run_date,mentioned:o.mentioned,first_position:o.first_position?Number(o.first_position):null,recommendation_strength:o.recommendation_strength,reason:o.reason,cited_domains:o.cited_domains,mh_site_cited:o.mh_site_cited,notes:o.notes}),r({title:"Result logged"}),t()}catch(u){r({title:"Could not save",description:u.message,variant:"destructive"})}finally{s(!1)}};return d.jsxs("div",{className:"border border-border p-5 bg-muted/20",children:[d.jsxs("div",{className:"flex items-start justify-between gap-4 mb-5",children:[d.jsxs("div",{children:[d.jsx("div",{className:"font-mono-tech text-[9px] uppercase tracking-[0.2em] text-primary mb-1",children:"Logging result"}),d.jsx("p",{className:"font-display text-lg text-foreground/90 max-w-2xl",children:e.text})]}),d.jsx("button",{onClick:n,className:"font-mono-tech text-[10px] uppercase tracking-[0.18em] text-muted-foreground hover:text-foreground",children:"Close"})]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[d.jsxs("div",{children:[d.jsx(pe,{className:"font-mono-tech text-[9px] uppercase tracking-[0.18em]",children:"Platform"}),d.jsxs(Pn,{value:o.platform,onValueChange:u=>l("platform",u),children:[d.jsx(Wt,{className:"mt-1.5",children:d.jsx(An,{})}),d.jsx(Bt,{children:Sc.map(u=>d.jsx(Ft,{value:u,children:u},u))})]})]}),d.jsxs("div",{children:[d.jsx(pe,{className:"font-mono-tech text-[9px] uppercase tracking-[0.18em]",children:"Run date"}),d.jsx(mt,{type:"date",value:o.run_date,onChange:u=>l("run_date",u.target.value),className:"mt-1.5"})]}),d.jsxs("div",{children:[d.jsx(pe,{className:"font-mono-tech text-[9px] uppercase tracking-[0.18em]",children:"First position (1 = first)"}),d.jsx(mt,{type:"number",min:"1",value:o.first_position,onChange:u=>l("first_position",u.target.value),placeholder:"—",className:"mt-1.5"})]}),d.jsxs("div",{children:[d.jsx(pe,{className:"font-mono-tech text-[9px] uppercase tracking-[0.18em]",children:"Recommendation strength"}),d.jsxs(Pn,{value:o.recommendation_strength,onValueChange:u=>l("recommendation_strength",u),children:[d.jsx(Wt,{className:"mt-1.5",children:d.jsx(An,{})}),d.jsx(Bt,{children:Cc.map(u=>d.jsx(Ft,{value:u,children:u},u))})]})]}),d.jsxs("div",{children:[d.jsx(pe,{className:"font-mono-tech text-[9px] uppercase tracking-[0.18em]",children:"Cited source domains"}),d.jsx(mt,{value:o.cited_domains,onChange:u=>l("cited_domains",u.target.value),placeholder:"comma-separated",className:"mt-1.5"})]}),d.jsxs("div",{className:"flex items-end gap-6 pt-1",children:[d.jsxs("label",{className:"flex items-center gap-2.5",children:[d.jsx(Pt,{checked:o.mentioned,onCheckedChange:u=>l("mentioned",u)}),d.jsx("span",{className:"font-mono-tech text-[9px] uppercase tracking-[0.18em] text-foreground/80",children:"Mentioned"})]}),d.jsxs("label",{className:"flex items-center gap-2.5",children:[d.jsx(Pt,{checked:o.mh_site_cited,onCheckedChange:u=>l("mh_site_cited",u)}),d.jsx("span",{className:"font-mono-tech text-[9px] uppercase tracking-[0.18em] text-foreground/80",children:"Brand site cited"})]})]})]}),d.jsxs("div",{className:"mt-4",children:[d.jsx(pe,{className:"font-mono-tech text-[9px] uppercase tracking-[0.18em]",children:"Stated reason (or why not)"}),d.jsx(Rt,{value:o.reason,onChange:u=>l("reason",u.target.value),rows:2,className:"mt-1.5"})]}),d.jsxs("div",{className:"mt-3",children:[d.jsx(pe,{className:"font-mono-tech text-[9px] uppercase tracking-[0.18em]",children:"Notes"}),d.jsx(Rt,{value:o.notes,onChange:u=>l("notes",u.target.value),rows:2,className:"mt-1.5"})]}),d.jsxs("div",{className:"mt-5 flex justify-end gap-3",children:[d.jsx(Jt,{variant:"outline",onClick:n,children:"Cancel"}),d.jsx(Jt,{onClick:f,disabled:a,children:a?"Saving…":"Log result"})]})]})}function Ic(){const{user:e}=xo(),t=wo(),{data:n=[]}=yo({queryKey:["prompt-benchmarks"],queryFn:()=>In.entities.PromptBenchmark.list("-run_date",500)}),[r,o]=c.useState(null),[i,a]=c.useState(null),s=r?kn[r]:null,l=c.useMemo(()=>{const u={};
46return n.forEach(m=>{var h;(u[h=m.prompt_id]||(u[h]=[])).push(m)}),u},[n]),f=u=>u.length?Math.round(u.filter(m=>m.mentioned).length/u.length*100):null;return e&&e.role!=="admin"?d.jsx(bo,{to:"/",replace:!0}):d.jsxs("section",{className:"pt-32 md:pt-40 pb-24 md:pb-32 bg-background min-h-screen",children:[d.jsx(So,{title:"AI Visibility Benchmark",description:"Internal benchmark tracker for Michael Harding watercolour visibility across AI answer engines and search.",noindex:!0}),d.jsxs("div",{className:"mx-auto max-w-[1100px] px-6 md:px-10",children:[d.jsx("div",{className:"font-mono-tech text-[10px] uppercase tracking-[0.2em] text-primary mb-4",children:"Internal Tool"}),d.jsx("h1",{className:"font-display text-[clamp(2.2rem,6vw,4rem)] leading-[0.95] font-medium tracking-tight",children:"AI Visibility Benchmark"}),d.jsx("div",{className:"w-24 h-1 bg-primary mt-4"}),d.jsx("p",{className:"mt-8 text-base text-foreground/65 max-w-2xl leading-relaxed",children:"Run these prompts across ChatGPT, Gemini, Google AI Overviews, Perplexity and Claude — without prompting the brand — and log what each answer does (and does not) surface. Metrics below aggregate into Mention Rate, Top-3 Rate, #1 Rate and Citation Share, segmented by prompt cluster, so you can see what Michael Harding already owns and what it needs to earn."}),d.jsx("div",{className:"mt-10 grid grid-cols-1 md:grid-cols-2 gap-4",children:_n.map(u=>d.jsxs("div",{className:"border border-border p-4",children:[d.jsx("div",{className:"font-mono-tech text-[10px] uppercase tracking-[0.18em] text-primary",children:u.label}),d.jsx("p",{className:"text-sm text-foreground/65 mt-1.5",children:u.description})]},u.key))}),d.jsxs("details",{className:"mt-4 border border-border p-4",children:[d.jsx("summary",{className:"font-mono-tech text-[10px] uppercase tracking-[0.18em] text-foreground/80 cursor-pointer",children:"What to capture per prompt"}),d.jsx("ul",{className:"mt-3 grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-1.5 text-sm text-foreground/65",children:ko.map(u=>d.jsx("li",{className:"list-disc ml-4",children:u},u))})]}),d.jsxs("div",{className:"mt-12",children:[d.jsx("h2",{className:"font-display text-2xl md:text-3xl font-medium mb-4",children:"Metrics"}),d.jsx(_o,{records:n})]}),d.jsxs("div",{className:"mt-12",children:[d.jsx("h2",{className:"font-display text-2xl md:text-3xl font-medium mb-2",children:"Prompts"}),d.jsx("p",{className:"text-sm text-foreground/60 mb-6 max-w-2xl",children:"100 prompts across five clusters. Competitor brand names are intentionally omitted; the Discovery & Alternatives cluster is phrased generically. Click a prompt to log a result."}),d.jsxs("div",{className:"border border-border p-5 mb-8 bg-muted/20",children:[d.jsx("div",{className:"font-mono-tech text-[10px] uppercase tracking-[0.18em] text-primary mb-3",children:"How to run these"}),d.jsxs("ol",{className:"space-y-2 text-sm text-foreground/70 list-decimal ml-5 max-w-2xl",children:[d.jsxs("li",{children:["Click ",d.jsx("span",{className:"font-mono-tech text-[10px] uppercase tracking-[0.14em] text-foreground/80",children:"Copy"})," on a prompt to grab its exact wording."]}),d.jsx("li",{children:"Paste it, unchanged, into ChatGPT, Gemini, Google AI Overviews, Perplexity and Claude — without adding or naming Michael Harding."}),d.jsx("li",{children:"Record what each answer does: is the brand mentioned, where, how strongly, and whether the site is cited."}),d.jsx("li",{children:"Click the prompt row again to open the log form and save the result. The metrics above update automatically."})]})]}),s&&d.jsx("div",{className:"mb-8",children:d.jsx(Ec,{prompt:s,onCancel:()=>o(null),onCreated:()=>{o(null),t.invalidateQueries({queryKey:["prompt-benchmarks"]})}})}),d.jsx("div",{className:"space-y-10",children:Ht.map(u=>d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-baseline justify-between border-b border-border pb-2 mb-3",children:[d.jsx("h3",{className:"font-mono-tech text-[11px] uppercase tracking-[0.18em] text-foreground/80",children:u.label}),d.jsxs("span",{className:"font-mono-tech text-[9px] uppercase tracking-[0.18em] text-muted-foreground",children:[Et.filter(m=>
46m.cluster===u.id).length," prompts"]})]}),d.jsx("div",{className:"border-t border-border",children:Et.filter(m=>m.cluster===u.id).map(m=>{const h=l[m.id]||[],g=f(h),b=r===m.id;return d.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o(b?null:m.id),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),o(b?null:m.id))},className:`w-full flex items-center gap-4 py-3 px-3 border-b border-border text-left transition-colors cursor-pointer ${b?"bg-muted/40":"hover:bg-muted/20"}`,children:[d.jsx("span",{className:"font-mono-tech text-[9px] uppercase tracking-[0.14em] text-muted-foreground w-10 shrink-0",children:m.id}),d.jsx("span",{className:"flex-1 text-sm text-foreground/80",children:m.text}),d.jsxs("button",{type:"button",onClick:p=>{var v;p.stopPropagation(),(v=navigator.clipboard)==null||v.writeText(m.text).then(()=>{a(m.id),setTimeout(()=>a(null),1500)})},className:"inline-flex items-center gap-1 font-mono-tech text-[9px] uppercase tracking-[0.14em] text-muted-foreground hover:text-primary transition-colors shrink-0","aria-label":"Copy prompt",children:[i===m.id?d.jsx(On,{className:"w-3.5 h-3.5 text-primary"}):d.jsx(Eo,{className:"w-3.5 h-3.5"}),d.jsx("span",{className:"hidden sm:inline",children:i===m.id?"Copied":"Copy"})]}),d.jsx("span",{className:"font-mono-tech text-[9px] uppercase tracking-[0.14em] text-muted-foreground shrink-0",children:h.length>0?`${h.length} logged`:"not logged"}),g!==null&&d.jsxs("span",{className:"font-mono-tech text-[10px] text-primary shrink-0 tabular-nums",children:[g,"%"]})]},m.id)})})]},u.id))})]})]})]})}export{Ic as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.