1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,605638,(e,t,n)=>{t.exports=function(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}},98586,(e,t,n)=>{var r=e.r(605638),i=e.r(773759);t.exports=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=i(n))==n?n:0),void 0!==t&&(t=(t=i(t))==t?t:0),r(i(e),t,n)}},82270,e=>{"use strict";e.s(["OpenApiPage",()=>us],82270);var t,n,r,i,o=e.i(843476),a=e.i(868888),l=e.i(792616),s=e.i(177986),u=e.i(91557),c=e.i(590280),d=e.i(343590),p=e.i(491066),f=e.i(16731),m=e.i(411901),h=e.i(196151),g=e.i(477222),y=e.i(859711),v=e.i(179862),x=e.i(271645),b=e.i(968701),w=e.i(986368);let j=(0,x.createContext)({}),S=({value:e,children:t})=>(0,o.jsx)(j.Provider,{value:e,children:t}),E=()=>(0,x.useContext)(j);var k=e.i(672655),O=e.i(863481),C=e.i(819701),I=e.i(939368),R=e.i(93734);function T({example:e}){return(0,o.jsx)(R.Description,{className:"overflow-wrap-anywhere text-[13px] [&_*]:text-[13px]",markdown:"object"==typeof e&&null!==e?`\`\`\`json 2${function(e,t=45){return function e(t,n,r,i){return null===t?"null":void 0===t?"undefined":"string"==typeof t?JSON.stringify(t):"number"==typeof t||"boolean"==typeof t?String(t):Array.isArray(t)?function(t,n,r,i){if(0===t.length)return"[]";let o="["+t.map(t=>e(t,n,r,i)).join(", ")+"]";if(o.length<=n)return o;r++;let a="[\n"+t.map(t=>i.repeat(r)+e(t,n,r,i)).join(",\n")+"\n"+i.repeat(r-1)+"]";return r--,a}(t,n,r,i):"object"==typeof t&&null!==t?function(t,n,r,i){let o=Object.keys(t);if(0===o.length)return"{}";let a="{ "+o.map(o=>`${JSON.stringify(o)}: ${e(t[o],n,r,i)}`).join(", ")+" }";if(a.length<=n)return a;r++;let l="{\n"+o.map(o=>i.repeat(r)+`${JSON.stringify(o)}: ${e(t[o],n,r,i)}`).join(",\n")+"\n"+i.repeat(r-1)+"}";return r--,l}(t,n,r,i):String(t)}(e,t,0," ")}(e)} 3\`\`\``:`\`${"null"===e?null:JSON.stringify(e,void 0,2)}\``})}let P=({schema:e})=>{let t=(0,b.useLocaleStrings)(),n=e.example,r=void 0!==e.examples?Array.isArray(e.examples)?e.examples:[e.examples]:void 0,i=void 0!==n||void 0!==r&&r.length>0,a=r&&r.length>1?t["api.examples"]:t["api.example"];return i&&(0,o.jsxs)("div",{className:(0,v.cn)("flex prose prose-sm prose-gray dark:prose-invert mt-6 gap-1.5",("object"==typeof n||"object"==typeof(null==r?void 0:r[0]))&&"flex-col gap-y-3"),children:[(0,o.jsxs)("span",{children:[a,":"]}),void 0!==r?(0,o.jsx)("div",{className:(0,v.cn)("*:my-2","object"!=typeof r[0]&&"inline *:mr-2 [&_*]:inline"),children:r.map((e,t)=>(0,o.jsx)(T,{example:e},t))}):(0,o.jsx)(T,{example:n})]})},N=(e,t)=>
3null==t||""===t||!1===t?[]:!0===t?[e]:"string"==typeof t?[t]:"number"==typeof t?[String(t)]:Array.isArray(t)?t.flatMap(e=>"string"==typeof e?[e]:"number"==typeof e?[String(e)]:[]):[],A=(e,t=[])=>{var n;if(!e)return{pre:void 0,post:void 0};let r=e["x-mint"],i=[...null!=(n=null==r?void 0:r.pre)?n:[]],o=[];for(let n of(e.readOnly&&o.push("read-only"),e.writeOnly&&o.push("write-only"),t))o.push(...N(n,e[n]));return(null==r?void 0:r.post)&&o.push(...r.post),{pre:i.length?i:void 0,post:o.length?o:void 0}};var M=e.i(169690),L=e.i(483913);let D=({displayFlattened:e=!1,fieldType:t,schema:n,name:r,location:i,parentName:a,typeOptions:l,selectedIndex:s,onSelectTypeOption:u,paramId:c,style:d,explode:p,required:f,schemas:m,omitPadding:h,hideName:g,defaultExpanded:y,isLivePreview:x})=>{var b,w;let{post:j}=E(),{pre:S,post:k}=A((0,C.isArrayObject)(n)?n:void 0,j);if(!(0,C.isArrayObject)(n))return null;let O=null!=(b=null==l?void 0:l[null!=s?s:0])?b:"unknown",I=n.items,T=(0,C.hasPropertyChildren)(n.items),N=e&&!T?null!=(w=n.description)?w:`The ${t} is of type \`${O}\`.`:n.description,D=(0,C.isSchemaObject)(n.items)&&"object"===n.items.type;return(0,o.jsx)(M.ParamFieldWrapper,{paramId:c,className:"array-param-field",children:(0,o.jsxs)("div",{className:(0,v.cn)(!e&&!h&&"py-6"),children:[(0,o.jsx)(L.ParamHead,{id:c,name:g?void 0:r,location:i,required:null!=f&&f,deprecated:n.deprecated,typeLabel:O,fieldType:t,typeOptions:l,selectedTypeOptionIndex:s,onSelectTypeOption:u,parentName:a,pre:S,post:k,style:d,explode:p,isLivePreview:x}),(0,o.jsxs)("div",{className:(0,v.cn)({"mt-4":!h&&N}),children:[r&&N&&(0,o.jsx)(R.Description,{markdown:N}),(0,o.jsx)($,{schema:n,description:N}),(0,C.isSchemaObject)(I)&&(0,o.jsx)(ed,{omitPadding:!0,schema:I,displayFlattened:e,fieldType:t,location:i,name:r,parentName:a,style:d,explode:p,onSelectTypeOption:u,schemas:m,hideExampleDescription:!0,hideDescription:D,hideName:!0,defaultExpanded:y,isLivePreview:x}),(0,o.jsx)(P,{schema:n})]})]})})},$=({schema:e,description:t})=>(0,o.jsx)(o.Fragment,{children:(void 0!==e.minItems||void 0!==e.maxItems)&&(0,o.jsx)("div",{className:(0,v.cn)("prose prose-sm prose-gray dark:prose-invert",t&&"mt-6"),children:(0,o.jsx)(q,{minItems:e.minItems,maxItems:e.maxItems})})}),q=({minItems:e,maxItems:t})=>e===t&&void 0!==e?(0,o.jsxs)(o.Fragment,{children:["Required array length: ",(0,o.jsx)("code",{children:e})," element",e>1?"s":""]}):e&&t?(0,o.jsxs)(o.Fragment,{children:["Required array length: ",(0,o.jsx)("code",{children:`${e} - ${t}`})," element",t>1?"s":""]}):e?(0,o.jsxs)(o.Fragment,{children:["Minimum array length: ",(0,o.jsx)("code",{children:e})]}):t?(0,o.jsxs)(o.Fragment,{children:["Maximum array length: ",(0,o.jsx)("code",{children:t})]}):"";var U=e.i(243378);let B="user_toggled_expandables",F=()=>{try{let e=sessionStorage.getItem(B);return e?JSON.parse(e):{}}catch{return{}}};var z=e.i(596669);let _="expandable-content",K="Hide",W="Show",H="child attributes",V=({title:e=H,defaultOpen:t=!1,onChange:n,lazy:r,className:i,children:a,uniqueParamId:l,onMount:s,onOpen:u,onClose:c,openedText:d=K,closedText:p=W,hasScrolledToAnchorRef:f,anchor:m})=>{let h=!!l,{ref:g,isExpanded:y,onManualToggle:b,isInSessionStorage:w}=((e,t=!1)=>{let n=(0,x.useRef)(null),[r,i]=(0,x.useState)(!1),[o,a]=(0,x.useState)(!1),[l,s]=(0,x.useState)(t);return(0,x.useEffect)(()=>{if(!e)return;let t=F();e in t&&(s(!!t[e]),i(!0),a(!0))},[e]),(0,x.useEffect)(()=>{let e=new IntersectionObserver(e=>{e[0]&&e[0].isIntersecting&&!r&&t&&s(e=>e||!0)},{rootMargin:"100px",threshold:0}),i=n.current;return i&&e.observe(i),()=>{i&&e.unobserve(i)}},[r,t]),{ref:n,isExpanded:l,onManualToggle:(0,x.useCallback)(t=>{s(t),i(!0),a(!0),e&&((e,t)=>{try{let n={...F(),[e]:t};sessionStorage.setItem(B,JSON.stringify(n))}catch{}})(e,t)},[e]),isInSessionStorage:o}})(l||"",t),[j,S]=(0,x.useState)(t),E=!!(l&&null!=m&&m.includes(l))&&!(null!=f&&f.current),k=h?!!E||(w?y:t):j,[O,C]=(0,x.useState)(k||!r);(0,x.useLayoutEffect)(()=>{k&&!O&&C(!0)},[k,O]),(0,x.useEffect)(()=>{null==s||s()},[]);let I=(0,x.useId)(),R=`${e}-${I}-content`.replace(/\s+/g,"-");return(0,o.jsxs)("details",{className:(0,v.cn)(U.Classes.Expandable,"mt-4 rounded-xl border-standard",i),"data-component-part":"expandable","data-testid":l?`${l}-children`:void 0,onToggle:e=>{let t=e.currentTarget.open;t!==k&&(e=>{h?b(e):S(e),(e=>{C(!0),n&&n(e),e?null==u||u():null==c||c()})(e)})(t)},open:k,ref:g,children:[(0,o.jsxs)("summary",{"aria-controls":R,"aria-expanded":k,className:(0,v.cn)("not-prose flex w-full cursor-pointer flex-row content-center items-center text-sm","rounded-t-xl px-3.5 py-3 text-stone-600 hover:bg-stone-50/50 hover:text-stone-900 dark:text-stone-300 dark:hover:bg-white/5 dark:hover:text-stone-200","list-none [&::-webkit-details-marker]:hidden",!k&&"rounded-b-xl"),"data-component-part":"expandable-button",children:[(0,o.jsx)(z.Icon,{className:(0,v.cn)("size-2.5 bg-stone-400 transition-transform",k&&"rotate-90"),"data-component-part":"expandable-icon",icon:"angle-right",overrideColor:!0,overrideSize:!0}),(0,o.jsx)("div",{className:"ml-3 text-left leading-tight",children:(0,o.jsxs)("p",{className:"m-0",contentEditable:!1,
3children:[k?d:p," ",e]})})]}),(0,o.jsx)("div",{className:(0,v.cn)(_,"mx-3 border-stone-100 border-t px-2 dark:border-white/10"),"data-component-part":_,id:R,children:O&&a})]},e)};var Y=e.i(75048),X=e.i(311294),G=e.i(819268),J=e.i(987700);let Q="Tab Title",Z=Object.assign(({children:e,defaultTabIndex:t=0,onTabChange:n,className:r,borderBottom:i,ariaLabel:a,panelsRef:l})=>{let s=(0,x.useRef)([]),u=(0,x.useId)(),c=(0,x.useMemo)(()=>x.Children.toArray(e).filter(e=>(0,x.isValidElement)(e)),[e]),d=(0,x.useMemo)(()=>c.map((e,t)=>{if(e.props.id)return e.props.id;let n=e.props.title??Q;return`${u}-${n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}-${t}`}),[c,u]),p=c.length>0?Math.max(0,Math.min(t,c.length-1)):0,[f,m]=(0,x.useState)(p);(0,x.useEffect)(()=>{c.length>0&&f>=c.length&&m(c.length-1)},[c.length,f]);let h=(0,x.useCallback)(e=>{e!==f&&(m(e),null==n||n(e))},[f,n]),g=(0,x.useCallback)((e,t)=>{let n=c.length;if(0!==n){if("ArrowLeft"===e.key||"ArrowRight"===e.key){e.preventDefault();let r="ArrowLeft"===e.key?(t-1+n)%n:(t+1)%n;h(r),setTimeout(()=>{var e;null==(e=s.current[r])||e.focus()},0)}else if("Enter"===e.key||" "===e.key)e.preventDefault(),h(t);else if("Home"===e.key)e.preventDefault(),h(0),setTimeout(()=>{var e;null==(e=s.current[0])||e.focus()},0);else if("End"===e.key){e.preventDefault();let t=n-1;h(t),setTimeout(()=>{var e;null==(e=s.current[t])||e.focus()},0)}}},[c.length,h]);return(0,o.jsxs)("div",{className:(0,v.cn)(U.Classes.Tabs,"tabs tab-container",i&&"border-stone-200 border-b pb-6 dark:border-stone-700",r),children:[(0,o.jsx)("ul",{"aria-label":a??"Tabs",className:"not-prose mb-6 flex min-w-full flex-none gap-x-6 overflow-auto border-stone-200 border-b pb-px dark:border-stone-700","data-component-part":"tabs-list",role:"tablist",children:c.map((e,t)=>{let n=e.props.title??Q,r=e.props.icon,i=e.props.iconType,a=e.props.iconLibrary,l=t===f;return(0,o.jsx)("li",{"aria-controls":`panel-${d[t]}`,"aria-selected":l,className:"cursor-pointer","data-child-heading-ids":e.props[J.CHILD_HEADING_IDS_ATTRIBUTE],"data-child-tab-ids":e.props[J.CHILD_TAB_IDS_ATTRIBUTE],"data-component-part":"tab",id:d[t],onClick:e=>{e.stopPropagation(),h(t)},onKeyDown:e=>g(e,t),ref:e=>{s.current[t]=e},role:"tab",tabIndex:l?0:-1,children:(0,o.jsxs)("div",{className:(0,v.cn)("-mb-px flex max-w-max items-center gap-1.5 whitespace-nowrap border-b pt-3 pb-2.5 font-semibold text-sm leading-6",l?"border-current text-primary dark:text-primary-light":"border-transparent text-stone-900 hover:border-stone-300 dark:text-stone-200 dark:hover:border-stone-700"),"data-active":l,"data-component-part":"tab-button","data-testid":`tab-${n}`,children:[r&&(0,o.jsx)(z.Icon,{className:(0,v.cn)("size-4 shrink-0",l?"bg-primary dark:bg-primary-light":"bg-stone-900 dark:bg-stone-200",U.Classes.TabIcon),icon:r,iconLibrary:a,iconType:i,overrideColor:!0}),n]})},d[t])})}),(0,o.jsx)("div",{"data-component-part":"tabs-panels",ref:l,children:c.map((e,t)=>{let n=t===f;return(0,o.jsx)("div",{"aria-hidden":!n,"aria-labelledby":d[t],className:(0,v.cn)("prose dark:prose-invert overflow-x-auto",!n&&"hidden"),"data-component-part":"tab-content",id:`panel-${d[t]}`,role:"tabpanel",tabIndex:n?0:-1,children:e.props.children},d[t])})})]})},{Item:({children:e})=>(0,o.jsx)(o.Fragment,{children:e})}),ee=({options:e,selectedIndex:t,onSelectOption:n})=>(0,o.jsx)("div",{className:"-mt-2",children:(0,o.jsx)(Z,{defaultTabIndex:t,onTabChange:n,className:"!border-gray-100 dark:!border-white/10 [&_[data-component-part=tabs-list]]:!mb-4",children:e.map(e=>(0,o.jsx)(Z.Item,{title:e},e))})});var et=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let en=({fieldType:e,schema:t,name:n,location:r,parentName:i,typeOptions:a,selectedIndex:l,onSelectTypeOption:s,paramId:u,style:c,explode:d,required:p,displayFlattened:f=!1,schemas:m,oneOfOptions:h,lazy:g,omitPadding:y=!1,hideDescription:b,hideExampleDescription:w,hideName:j,defaultExpanded:S,isLivePreview:k})=>{var O;let{properties:I,additionalProperties:T}=function(e){return"object"!==e.type?{properties:void 0,additionalProperties:void 0}:{properties:e.properties,additionalProperties:e.additionalProperties}}
3(t),{anchor:N,hasScrolledToAnchorRef:D}=(0,Y.useEndpointLocation)(),$=!!(u&&(null==N?void 0:N.includes(u))),q=!f,U=q&&$,B=S||$||f,F=(0,x.useRef)(null),z=(0,x.useCallback)(e=>{var t,n;let r=e.closest(".expandable-content");for(;r;){let e=r.previousElementSibling;(null==e?void 0:e.getAttribute("aria-expanded"))==="false"&&e.click(),r=null!=(n=null==(t=r.parentElement)?void 0:t.closest(".expandable-content"))?n:null}},[]);(0,x.useEffect)(()=>{if(!U)return;let e=()=>{(0,G.scrollElementIntoView)({shouldReturnEarly:!!(null==D?void 0:D.current),isLivePreview:k,checkIfShouldScroll:e=>!!F.current&&F.current.contains(e),preScrollCallback(e){z(e)},postScrollCallback(){D&&(D.current=!0)}})};return e(),window.addEventListener("hashchange",e),()=>{window.removeEventListener("hashchange",e)}},[D,z,U,k]);let _=(0,C.hasPropertyChildren)(t),K=h||null==a?void 0:a[null!=l?l:0],W=null!=K?K:(0,C.generateSimpleSchemaLabel)(t),H=!!f,V=H&&!_?null!=(O=t.description)?O:`The ${e} is of type \`${W}\`.`:t.description,J=!!h,Q=!!V,Z=Q&&H!==J,et=Q&&!Z,{post:en}=E(),{pre:ei,post:eo}=A(t,en);return(0,o.jsx)(M.ParamFieldWrapper,{noBorder:w,paramId:u,className:"object-param-field",ref:F,children:(0,o.jsxs)("div",{className:(0,v.cn)(!H&&!y&&"py-6"),children:[(0,o.jsx)(L.ParamHead,{id:u,name:j?void 0:n,location:r,required:null!=p&&p,deprecated:t.deprecated,typeLabel:W,fieldType:e,typeOptions:null!=a?a:[W],selectedTypeOptionIndex:l,onSelectTypeOption:s,parentName:i,pre:ei,post:eo,style:c,explode:d,isLivePreview:k}),(0,o.jsxs)("div",{className:(0,v.cn)({"mt-4":!y&&(Q||_)}),children:[Z&&!b&&(0,o.jsx)(R.Description,{markdown:V}),(0,o.jsxs)("div",{className:(0,v.cn)(J&&"mt-4",J&&!H&&"rounded-xl border border-gray-100 px-4 pb-4 pt-2 dark:border-white/10"),children:[J&&(0,o.jsx)(ee,{selectedIndex:l,options:h,onSelectOption:s}),et&&!b&&(0,o.jsx)("div",{className:(0,v.cn)(J&&H&&"pt-6 pb-4"),children:(0,o.jsx)(R.Description,{markdown:V})}),_&&(0,o.jsx)("div",{className:(0,v.cn)(J&&!H&&"-mt-4"),children:(0,o.jsx)(er,{expandable:q,defaultOpen:B,lazy:null!=g?g:!B,uniqueParamId:u,anchor:N,hasScrolledToAnchorRef:D,children:(0,o.jsxs)(o.Fragment,{children:[I&&Object.entries(I).map(([t,a])=>{let l="deepObject"===c&&d?(0,X.getDeepObjectParentName)(null!=n?n:void 0,i):(0,X.getRecursiveParentName)(null!=n?n:void 0,i);return(0,o.jsx)(ed,{schema:a,name:t,required:a.isRequired,fieldType:e,location:r,parentName:l,style:c,explode:d,onSelectTypeOption:s,schemas:m,defaultExpanded:S,isLivePreview:k},t)}),"object"==typeof T&&((0,C.isSchemaObject)(T)||(0,C.isCircularRef)(T))&&(0,o.jsx)(ed,{schema:T,name:"{key}",required:T.isRequired,fieldType:e,location:r,parentName:(0,X.getRecursiveParentName)(null!=n?n:void 0,i),style:c,explode:d,onSelectTypeOption:s,schemas:m,defaultExpanded:S,isLivePreview:k},"{key}")]})})}),q&&!w&&(0,o.jsx)(P,{schema:t})]})]})]})})};function er(e){var{expandable:t,children:n}=e,r=et(e,["expandable","children"]);return t?(0,o.jsx)(V,Object.assign({},r,{children:n})):(0,o.jsx)(o.Fragment,{children:n})}let ei=({schema:e})=>{let t=(0,b.useLocaleStrings)(),n="boolean"===e.type?(0,C.getBooleanEnumOptions)(e):e.enum;return n&&0!==n.length?(0,o.jsxs)("div",{className:"whitespace-pre-wrap prose-sm mt-6",children:[t.availableOptions,":"," ",n.map((e,t)=>(0,o.jsxs)("div",{className:"inline-block",children:[(0,o.jsx)("code",{children:String(e)}),t!==n.length-1&&","," "]},`${e}-${t}`))]}):null},eo=({enumTable:e})=>{let t=(0,b.useLocaleStrings)();return(0,o.jsxs)("div",{className:"whitespace-pre-wrap prose prose-sm mt-6",children:[t.availableOptions,":",(0,o.jsxs)("table",{className:"w-fit max-w-full text-sm not-prose",children:[(0,o.jsxs)("tr",{children:[(0,o.jsx)("th",{className:"text-left",children:t["api.title"]}),(0,o.jsx)("th",{children:t["api.const"]})]}),e.map(({title:e,const:t})=>(0,o.jsxs)("tr",{children:[(0,o.jsx)("td",{children:e}),(0,o.jsx)("td",{children:(0,o.jsx)("code",{children:t})})]},e))]})]})},ea=({schema:e})=>{let t=e.exclusiveMinimum||void 0!==e.exclusiveMinimum,n=e.exclusiveMaximum||void 0!==e.exclusiveMaximum,r=(0,b.useLocaleStrings)(),i="";return(void 0!==e.maximum&&(i=`x ${n?"<":"<="} ${e.maximum}`),void 0!==e.minimum&&(i=`x ${t?">":">="} ${e.minimum}`),void 0!==e.maximum&&void 0!==e.minimum&&(i=`${e.minimum} ${t?"<":"<="} x ${n?"<":"<="} ${e.maximum}`),""===i&&void 0===e.multipleOf)?null:(0,o.jsxs)("div",{className:"prose prose-sm prose-gray dark:prose-invert mt-6",children:[i&&(0,o.jsxs)(o.Fragment,{children:[r.requiredRange,": ",(0,o.jsx)("code",{children:i})]}),e.multipleOf&&(0,o.jsxs)(o.Fragment,{children:[r["api.mustBeMultipleOf"]," ",(0,o.jsx)("code",{children:e.multipleOf})]})]})}
3,el=({schema:e,description:t})=>(0,o.jsxs)(o.Fragment,{children:["const"in e&&void 0!==e.const&&(0,o.jsxs)("div",{className:(0,v.cn)("prose prose-sm prose-gray dark:prose-invert",t&&"mt-6"),children:["Allowed value: ",(0,o.jsx)("code",{children:`"${e.const}"`})]}),(void 0!==e.minLength||void 0!==e.maxLength)&&(0,o.jsx)("div",{className:(0,v.cn)("prose prose-sm prose-gray dark:prose-invert",t&&"mt-6"),children:(0,o.jsx)(es,{minLength:e.minLength,maxLength:e.maxLength})}),"pattern"in e&&void 0!==e.pattern&&(0,o.jsxs)("div",{className:(0,v.cn)("prose prose-sm prose-gray dark:prose-invert",t&&"mt-6"),children:["Pattern: ",(0,o.jsx)("code",{children:e.pattern})]})]}),es=({minLength:e,maxLength:t})=>e===t&&void 0!==e?(0,o.jsxs)(o.Fragment,{children:["Required string length: ",(0,o.jsx)("code",{children:e})]}):e&&t?(0,o.jsxs)(o.Fragment,{children:["Required string length: ",(0,o.jsx)("code",{children:`${e} - ${t}`})]}):e?(0,o.jsxs)(o.Fragment,{children:["Minimum string length: ",(0,o.jsx)("code",{children:e})]}):t?(0,o.jsxs)(o.Fragment,{children:["Maximum string length: ",(0,o.jsx)("code",{children:t})]}):"",eu=({fieldType:e,schema:t,name:n,location:r,typeOptions:i,selectedIndex:a,onSelectTypeOption:l,parentName:s,paramId:u,style:c,explode:d,enumTable:p,omitPadding:f,hideExampleDescription:m,isTopLevel:h,hideName:g,isLivePreview:y})=>{var x,b;let w=null!=(x=null==i?void 0:i[null!=a?a:0])?x:"unknown",j=h?null!=(b=t.description)?b:`The ${e} is of type \`${w}\`.`:t.description,S=m||(0,C.isFileExample)(t),{post:k}=E(),{pre:O,post:I}=A(t,k);return(0,o.jsx)(M.ParamFieldWrapper,{noBorder:m,paramId:u,className:"primitive-param-field",children:(0,o.jsxs)("div",{className:(0,v.cn)(!f&&"py-6"),children:[(0,o.jsx)(L.ParamHead,{id:u,name:g?void 0:n,typeLabel:w,location:r,fieldType:e,required:t.isRequired,deprecated:t.deprecated,defaultValue:t.default,typeOptions:i,selectedTypeOptionIndex:a,onSelectTypeOption:l,parentName:s,pre:O,post:I,style:c,explode:d,isLivePreview:y}),(0,o.jsxs)("div",{className:(0,v.cn)({"mt-4":!f&&(j||(0,C.isEnum)(t))}),children:[j&&(0,o.jsx)(R.Description,{className:(0,v.cn)(m&&"py-4"),markdown:j}),p&&(0,o.jsx)(eo,{enumTable:p}),!p&&(0,C.isEnum)(t)&&(0,o.jsx)(ei,{schema:t}),!p&&(0,C.isStringSchema)(t)&&(0,o.jsx)(el,{schema:t,description:j}),!p&&(0,C.isNumberSchema)(t)&&(0,o.jsx)(ea,{schema:t}),!S&&(0,o.jsx)(P,{schema:t})]})]})})};var ec=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let ed=({schema:e,omitPadding:t,name:n,displayFlattened:r=!1,typeOptions:i,fieldType:a,location:l,parentName:s,style:u,explode:c,required:d,onSelectTypeOption:p,selectedIndex:f,schemas:m,enumTable:h,hideExampleDescription:g,hideDescription:y,isTopLevel:v=!1,hideName:x=!1,defaultExpanded:b,isLivePreview:w})=>{var j;let S=(0,I.getParamIdFromSchema)(e,a,n,s);if((0,C.isCircularRef)(e)){let r=e[O.CIRCULAR_REF_KEY],p=null==m?void 0:m[r];return p?(0,o.jsx)(en,{lazy:!0,omitPadding:t,schema:Object.assign(Object.assign({},p),{description:e.description}),typeOptions:i,fieldType:a,name:n,location:l,parentName:s,style:u,explode:c,required:d,schemas:m,paramId:S,hideName:x,defaultExpanded:b,isLivePreview:w}):null}if(e.oneOf&&Array.isArray(e.oneOf)&&e.oneOf.length>0){let i,h=e.oneOf.filter(e=>(0,C.isSchemaObject)(e));if(0===h.length)return null;if(h.some(e=>(0,C.isEnum)(e)&&"const"in e)&&(i=(h=(0,C.filterSchemasWithConsts)(h)).filter(e=>(0,C.isEnum)(e)&&"const"in e).map(e=>{var t,n;return{title:null!=(t=e.title)?t:"Unknown",const:null!=(n=e.const)?n:""}})),1===h.length&&(null==(j=h[0])?void 0:j.type)==="null"&&h[0])return(0,o.jsx)(eu,{omitPadding:t,fieldType:a,enumTable:i,schema:e,name:n,location:l,parentName:s,selectedIndex:f,onSelectTypeOption:p,style:u,explode:c,required:d,paramId:S,hideExampleDescription:g,isTopLevel:v,hideName:x,isLivePreview:w});let y=h.filter(e=>"null"!==e.type),E=h.some(e=>"null"===e.type),k=(0,C.generateSchemaOptionLabels)(y);if(1===y.length&&y[0]){let i=E&&e.typeLabel?[e.typeLabel]:k;return(0,o.jsx)(ed,{schema:y[0],omitPadding:t,displayFlattened:r,typeOptions:i,fieldType:a,name:n,location:l,parentName:s,style:u,explode:c,required:d,schemas:m,hideName:x,defaultExpanded:b,isLivePreview:w})}if(y.every(e=>"object"===e.type||(0,C.isObjectArray)(e)))return(0,o.jsx)(ef,{omitPadding:t,schema:e,schemas:y,displayFlattened:r,typeOptions:["object"],fieldType:a,name:n,location:l,style:u,explode:c,parentName:s,required:d,paramId:S,hideName:x,defaultExpanded:b,isLivePreview:w});{let e=y[null!=f?f:0];return e?(0,o.jsx)(ep,{omitPadding:t,schemas:y,schema:e,enumTable:i,displayFlattened:r,typeOptions:k,fieldType:a,name:n,location:l,style:u,explode:c,required:d,selectedIndex:f,parentName:s,onSelectTypeOption:p,hideName:x,defaultExpanded:b,isLivePreview:w}):null}}let E=(0,C.generateSchemaOptionLabels)([e]);return"array"!==e.type&&"object"!==e.type?(0,o.jsx)(eu,{omitPadding:t,fieldType:a,enumTable:h,schema:e,typeOptions:null!=i?i:E,name:n,location:l,parentName:s,selectedIndex:f,onSelectTypeOption:p,style:u,explode:c,required:d,paramId:S,hideExampleDescription:g,isTopLevel:v,hideName:x,isLivePreview:w}):"object"===e.type?(0,o.jsx)(en,{omitPadding:t,displayFlattened:r,fieldType:a,schema:e,typeOptions:null!=i?i:E,name:n,location:l,parentName:s,selectedIndex:f,onSelectTypeOption:p,style:u,explode:c,required:d,schemas:m,paramId:S,hideDescription:y,hideExampleDescription:g,hideName:x,defaultExpanded:b,isLivePreview:w}):"array"===e.type?(0,o.jsx)(D,{omitPadding:t,displayFlattened:r,fieldType:a,schema:e,typeOptions:null!=i?i:E,name:n,location:l,parentName:s,selectedIndex:f,onSelectTypeOption:p,style:u,explode:c,required:d,schemas:m,paramId:S,hideName:x,defaultExpanded:b,isLivePreview:w}):void 0};function ep(e){var{schemas:t}=e,n=ec(e,["schemas"]);let[r,i]=(0,x.useState)(0),a=t[r];return a?(0,o.jsx)(ed,Object.assign({},n,{selectedIndex:r,onSelectTypeOption:i,schema:a})):null}function ef(e){var{schemas:t,paramId:n}=e,r=ec(e,["schemas","paramId"]);let[i,a]=(0,x.useState)(0),l=t[i];if((0,C.isObjectArray)(l)&&(l=l.items),!l)return null;let s=(0,C.generateSchemaOptionLabels)(t),u=null!=n?n:(0,I.getParamIdFromSchema)(l,r.fieldType,r.name,r.parentName);return(0,o.jsx)(en,Object.assign({},r,{oneOfOptions:s,schema:l,selectedIndex:i,onSelectTypeOption:a,paramId:u}))}var em=e.i(507995);let eh=({apiReferenceData:e,pageMetadata:t,localeStrings:n=b.DEFAULT_LOCALE_STRINGS,markdownComponents:r,docsConfig:i,isLivePreview:a,className:l,readOnly:s,ReadOnlyWrapper:u,children:c})=>{var d,p,f,m;let h=e.schemaData,g="custom"===t.mode,y="frame"===t.mode,j=(null==(p=null==(d=null==i?void 0:i.api)?void 0:d.params)?void 0:p.expanded)==="all",E=null==(m=null==(f=null==i?void 0:i.api)?void 0:f.params)?void 0:m.post;if(!h)return null;let O=s&&u?u:x.default.Fragment;return(0,o.jsx)(k.ReadOnlyProvider,{value:null!=s&&s,children:(0,o.jsx)(b.LocalizationProvider,{localeStrings:n,children:(0,o.jsx)(S,{value:{post:E},children:(0,o.jsx)(w.MarkdownProvider,{markdownComponents:r,children:(0,o.jsx)("div",{className:(0,v.cn)("flex flex-col gap-8 isolate",l),id:"api-playground-2-schema-page",children:(0,o.jsx)(em.default,{children:(0,o.jsxs)("div",{className:(0,v.cn)("mdx-content","@container/columns-container relative",!g&&!y&&"prose prose-gray dark:prose-invert"),children:[(0,o.jsx)(em.default,{children:c}),(0,o.jsx)(O,{children:(0,o.jsx)(em.default,{children:(0,o.jsx)("div",Object.assign({className:(0,v.cn)(s&&"mx-7")},s&&{"data-block-selection-ignore":"true"},{children:(0,o.jsx)(ed,{schema:h,fieldType:"schema",displayFlattened:!0,defaultExpanded:j,isLivePreview:a})}))})})]})})})})})})})},eg=(0,x.createContext)({isSending:!1,isPlaygroundExpanded:!1});var ey=b,ev=e.i(334363),ex=e.i(547864),eb=e.i(165041);let ew=({children:e,prefix:t,className:n})=>(0,o.jsxs)("div",{className:(0,v.cn)("flex items-center gap-1 break-all rounded-md bg-stone-100/50 px-2 py-0.5 font-medium text-stone-600 dar
3k:bg-white/5 dark:text-stone-200",n),"data-component-part":"field-info-pill",children:[t&&(0,o.jsx)("span",{className:"text-stone-400 dark:text-stone-500",children:t}),(0,o.jsx)("span",{children:e})]});var ej=e.i(41212),eS=e.i(829623),eE=e.i(392475);let ek=({apiReferenceData:e,defaultExpanded:t,isLivePreview:n,fieldType:r="body"})=>{var i,a,l;let s=(0,b.useLocaleStrings)(),{selectedRequestBodyContentTypeIndex:u,setSelectedRequestBodyContentTypeIndex:c}=(0,ej.useSelectedRequestBodyContentType)(),d=null==(i=e.dependencies)?void 0:i.requestBody,p=null==d?void 0:d.description,f=Object.keys(null!=(a=null==d?void 0:d.content)?a:{}),m=Object.fromEntries(f.map(e=>[e,(0,eS.getBodySchema)(null==d?void 0:d.content[e])]).filter(e=>(0,C.isSchemaObject)(e[1]))),h=null==(l=e.dependencies)?void 0:l.schemas,g=f[u],y=void 0===g?void 0:m[g],v=g?null==d?void 0:d.content[g]:void 0,x=void 0!==v&&"itemSchema"in v&&void 0!==v.itemSchema;return 0===Object.keys(m).length?null:(0,o.jsxs)("div",{className:"api-section",children:[f.length>1?(0,o.jsx)(eE.SectionHeading,{title:s["api.body"],options:f,selectedIndex:u,onSelectOption:c,subtitle:p,withPadding:!p}):(0,o.jsx)(eE.SectionHeading,{title:s["api.body"],rightElement:f[0],subtitle:p,withPadding:!p}),x&&void 0!==y&&(0,o.jsx)("div",{className:"mb-4",children:(0,o.jsx)(ew,{className:"max-w-fit text-xs font-medium break-words",children:s["api.streamItem"]})}),void 0!==y&&(0,o.jsx)(ed,{schema:y,fieldType:r,displayFlattened:!0,omitPadding:!0,schemas:h,isTopLevel:!0,defaultExpanded:t,isLivePreview:n})]})};var eO=e.i(745786),eC=e.i(882890),eI=e.i(22042);let eR=(...e)=>e.filter((e,t,n)=>!!e&&n.indexOf(e)===t).join(" ");var eT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let eP=(0,x.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:a,...l},s)=>(0,x.createElement)("svg",{ref:s,...eT,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:eR("lucide",i),...l},[...a.map(([e,t])=>(0,x.createElement)(e,t)),...Array.isArray(o)?o:[o]])),eN=((e,t)=>{let n=(0,x.forwardRef)(({className:n,...r},i)=>(0,x.createElement)(eP,{ref:i,iconNode:t,className:eR(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r}));return n.displayName=`${e}`,n})("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.i(247167);var eA=e.i(174080);let eM={};function eL(e,t){let n=x.useRef(eM);return n.current===eM&&(n.current=e(t)),n}let eD=[];function e$(e){x.useEffect(e,eD)}var eq=Object.defineProperty,eU=(e,t,n)=>((e,t,n)=>t in e?eq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class eB{constructor(){eU(this,"currentId",0),eU(this,"clear",()=>{0!==this.currentId&&(clearTimeout(this.currentId),this.currentId=0)}),eU(this,"disposeEffect",()=>this.clear)}
3static create(){return new eB}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,t()},e)}isStarted(){return 0!==this.currentId}}function eF(){let e=eL(eB.create).current;return e$(e.disposeEffect),e}let ez=x[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],e_=ez&&ez!==x.useLayoutEffect?ez:e=>e();function eK(e){let t=eL(eW).current;return t.next=e,e_(t.effect),t.trampoline}function eW(){let e={next:void 0,callback:eH,trampoline:(...t)=>{var n;return null==(n=e.callback)?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function eH(){}let eV={...x},eY=0,eX=eV.useId;function eG(e,t){if(void 0!==eX){let n=eX();return e??(t?`${t}-${n}`:n)}return function(e,t="mui"){let[n,r]=x.useState(e),i=e||n;return x.useEffect(()=>{null==n&&(eY+=1,r(`${t}-${eY}`))},[n,t]),i}(e,t)}let eJ="u">typeof document?x.useLayoutEffect:()=>{};var eQ=Object.defineProperty,eZ=(e,t,n)=>((e,t,n)=>t in e?eQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);globalThis.requestAnimationFrame;let e0=new class{constructor(){eZ(this,"callbacks",[]),eZ(this,"callbacksCount",0),eZ(this,"nextId",1),eZ(this,"startId",1),eZ(this,"isScheduled",!1),eZ(this,"tick",e=>{var t;this.isScheduled=!1;let n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let r=0;r<n.length;r+=1)null==(t=n[r])||t.call(n,e)})}request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,this.callbacksCount-=1)}};class e1{constructor(){eZ(this,"currentId",null),eZ(this,"cancel",()=>{null!==this.currentId&&(e0.cancel(this.currentId),this.currentId=null)}),eZ(this,"disposeEffect",()=>this.cancel)}static create(){return new e1}static request(e){return e0.request(e)}static cancel(e){return e0.cancel(e)}request(e){this.cancel(),this.currentId=e0.request(()=>{this.currentId=null,e()})}}function e2(){let e=eL(e1.create).current;return e$(e.disposeEffect),e}function e5(){return"u">typeof window}function e4(e){return e8(e)?(e.nodeName||"").toLowerCase():"#document"}function e6(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function e3(e){var t;return null==(t=(e8(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function e8(e){return!!e5()&&(e instanceof Node||e instanceof e6(e).Node)}function e9(e){return!!e5()&&(e instanceof Element||e instanceof e6(e).Element)}function e7(e){return!!e5()&&(e instanceof HTMLElement||e instanceof e6(e).HTMLElement)}function te(e){return!(!e5()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof e6(e).ShadowRoot)}let tt=new Set(["inline","contents"]);function tn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=tf(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!tt.has(i)}let tr=new Set(["table","td","th"]),ti=[":popover-open",":modal"];function to(e){return ti.some(t=>{try{return e.matches(t)}catch{return!1}})}let ta=["transform","translate","scale","rotate","perspective"],tl=["transform","translate","scale","rotate","perspective","filter"],ts=["paint","layout","strict","content"];function tu(e){let t=tc(),n=e9(e)?tf(e):e;return ta.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||tl.some(e=>(n.willChange||"").includes(e))||ts.some(e=>(n.contain||"").includes(e))}function tc(){return!(typeof CSS>"u")&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let td=new Set(["html","body","#document"]);function tp(e){return td.has(e4(e))}function tf(e){return e6(e).getComputedStyle(e)}function tm(e){return e9(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function th(e){if("html"===e4(e))return e;let t=e.assignedSlot||e.parentNode||te(e)&&e.host||e3(e);return te(t)?t.host:t}function tg(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let i=function e(t){let n=th(t);return tp(n)?t.ownerDocument?t.ownerDocument.body:t.body:e7(n)&&tn(n)?n:e(n)}(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),a=e6(i);if(o){let e=ty(a);
3return t.concat(a,a.visualViewport||[],tn(i)?i:[],e&&n?tg(e):[])}return t.concat(i,tg(i,[],n))}function ty(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}let tv="u">typeof navigator,tx=function(){if(!tv)return{platform:"",maxTouchPoints:-1};let e=navigator.userAgentData;return null!=e&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}(),tb=function(){if(!tv)return"";let e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform??""}(),tw=function(){if(!tv)return"";let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(" "):navigator.userAgent}(),tj=!(typeof CSS>"u")&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter:none"),tS="MacIntel"===tx.platform&&tx.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(tx.platform),tE=tv&&/apple/i.test(navigator.vendor),tk=tv&&/android/i.test(tb)||/android/i.test(tw),tO=tv&&tb.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,tC=tw.includes("jsdom/");function tI(e){return(null==e?void 0:e.ownerDocument)||document}function tR(){}let tT=Object.freeze([]),tP=Object.freeze({});
3var tN=Object.defineProperty,tA=(e,t,n)=>((e,t,n)=>t in e?tN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);let tM={},tL={},tD="",t$=new class{constructor(){tA(this,"lockCount",0),tA(this,"restore",null),tA(this,"timeoutLock",eB.create()),tA(this,"timeoutUnlock",eB.create()),tA(this,"release",()=>{this.lockCount-=1,0===this.lockCount&&this.restore&&this.timeoutUnlock.start(0,this.unlock)}),tA(this,"unlock",()=>{var e;0===this.lockCount&&this.restore&&(null==(e=this.restore)||e.call(this),this.restore=null)})}acquire(e){return this.lockCount+=1,1===this.lockCount&&null===this.restore&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}lock(e){if(0===this.lockCount||null!==this.restore)return;let t=tI(e).documentElement,n=e6(t).getComputedStyle(t).overflowY;if("hidden"===n||"clip"===n){this.restore=tR;return}let r=tS||!function(e){if(typeof document>"u")return!1;let t=tI(e);return e6(t).innerWidth-t.documentElement.clientWidth>0}(e);this.restore=r?function(e){let t=tI(e),n=t.documentElement,r=t.body,i=tn(n)?n:r,o=i.style.overflow;return i.style.overflow="hidden",()=>{i.style.overflow=o}}(e):function(e){var t;let n=tI(e),r=n.documentElement,i=n.body,o=e6(r),a=0,l=0,s=!1,u=e1.create();if(tj&&((null==(t=o.visualViewport)?void 0:t.scale)??1)!==1)return()=>{};function c(){let t=o.getComputedStyle(r),n=o.getComputedStyle(i),u=(t.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=r.scrollTop,l=r.scrollLeft,tM={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY,overflowX:r.style.overflowX},tD=r.style.scrollBehavior,tL={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};let c=r.scrollHeight>r.clientHeight,d=r.scrollWidth>r.clientWidth,p="scroll"===t.overflowY||"scroll"===n.overflowY,f="scroll"===t.overflowX||"scroll"===n.overflowX,m=Math.max(0,o.innerWidth-i.clientWidth),h=Math.max(0,o.innerHeight-i.clientHeight),g=parseFloat(n.marginTop)+parseFloat(n.marginBottom),y=parseFloat(n.marginLeft)+parseFloat(n.marginRight),v=tn(r)?r:i;if(s=function(e){if(!("u">typeof CSS&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;let t=tI(e).documentElement,n={scrollbarGutter:t.style.scrollbarGutter,overflowY:t.style.overflowY};t.style.scrollbarGutter="stable",t.style.overflowY="scroll";let r=t.offsetWidth;t.style.overflowY="hidden";let i=t.offsetWidth;return Object.assign(t.style,n),r===i}(e)){r.style.scrollbarGutter=u,v.style.overflowY="hidden",v.style.overflowX="hidden";return}Object.assign(r.style,{scrollbarGutter:u,overflowY:"hidden",overflowX:"hidden"}),(c||p)&&(r.style.overflowY="scroll"),(d||f)&&(r.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:g||h?`calc(100dvh - ${g+h}px)`:"100dvh",width:y||m?`calc(100vw - ${y+m}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),i.scrollTop=a,i.scrollLeft=l,r.setAttribute("data-base-ui-scroll-locked",""),r.style.scrollBehavior="unset"}function d(){Object.assign(r.style,tM),Object.assign(i.style,tL),s||(r.scrollTop=a,r.scrollLeft=l,r.removeAttribute("data-base-ui-scroll-locked"),r.style.scrollBehavior=tD)}function p(){d(),u.request(c)}return c(),o.addEventListener("resize",p),()=>{u.cancel(),d(),"function"==typeof o.removeEventListener&&o.removeEventListener("resize",p)}}(e)}};function tq(e,...t){let n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(e=>n.searchParams.append("args[]",e)),`Base UI error #${e}; visit ${n} for the full message.`}let tU=x.createContext(void 0);function tB(e){let t=x.useContext(tU);if(void 0===t&&!e)throw Error(tq(36));return t}let tF=x.createContext(null);function tz(e){return x.useContext(tF)}let t_={style:{transition:"none"}},tK={fallbackAxisSide:"none"},tW={fallbackAxisSide:"end"},tH={clipPath:"inset(50%)",position:"fixed",top:0,left:0},tV=x.createContext(void 0);function tY(){let e=x.useContext(tV);return(null==e?void 0:e.direction)??"ltr"}function tX(e,t,n,r){let i=!1,o=!1,a=r??tP;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){o=!0},get isCanceled(){return i},get isPropagationAllowed(){return o},trigger:n,...a}}
3let tG=x.createContext(void 0);function tJ(e=!0){let t=x.useContext(tG);if(void 0===t&&!e)throw Error(tq(25));return t}function tQ(){let e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}var tZ=Object.defineProperty,t0=(e,t,n)=>((e,t,n)=>t in e?tZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class t1{constructor(){t0(this,"nodesRef",{current:[]}),t0(this,"events",tQ())}addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);-1!==t&&this.nodesRef.current.splice(t,1)}}var t2=Object.defineProperty,t5=(e,t,n)=>((e,t,n)=>t in e?t2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class t4{constructor(e){t5(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})),t5(this,"getSnapshot",()=>this.state),this.state=e,this.listeners=new Set,this.updateTick=0}setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t]))return void t4.prototype.setState.call(this,{...this.state,...e})}set(e,t){Object.is(this.state[e],t)||t4.prototype.setState.call(this,{...this.state,[e]:t})}notifyAll(){let e={...this.state};t4.prototype.setState.call(this,e)}}var t6={exports:{}},t3={};function t8(){return n||(n=1,t6.exports=function(){if(t)return t3;t=1;var e=x.default,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch{return!0}}var s=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?function(e,t){return t()}:function(e,t){var n=t(),s=r({inst:{value:n,getSnapshot:t}}),u=s[0].inst,c=s[1];return o(function(){u.value=n,u.getSnapshot=t,l(u)&&c({inst:u})},[e,n,t]),i(function(){return l(u)&&c({inst:u}),e(function(){l(u)&&c({inst:u})})},[e]),a(n),n};return t3.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:s,t3}()),t6.exports}var t9=t8(),t7={exports:{}},ne={},nt=(i||(i=1,t7.exports=function(){if(r)return ne;r=1;var e=x.default,t=t8(),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,l=e.useMemo,s=e.useDebugValue;return ne.useSyncExternalStoreWithSelector=function(e,t,r,u,c){var d=o(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;var f=i(e,(d=l(function(){function e(e){if(!a){if(a=!0,i=e,e=u(e),void 0!==c&&p.hasValue){var t=p.value;if(c(t,e))return o=t}return o=e}if(t=o,n(i,e))return t;var r=u(e);return void 0!==c&&c(t,r)?(i=e,t):(i=e,o=r)}var i,o,a=!1,l=void 0===r?null:r;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,r,u,c]))[0],d[1]);return a(function(){p.hasValue=!0,p.value=f},[f]),s(f),f},ne}
3()),t7.exports);let nn=parseInt(x.version,10),nr=nn>=19?function(e,t,n,r,i){let o=x.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return t9.useSyncExternalStore(e.subscribe,o,o)}:function(e,t,n,r,i){return nt.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))};var ni=Object.defineProperty,no=(e,t,n)=>((e,t,n)=>t in e?ni(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);class na extends t4{constructor(e,t={},n){super(e),no(this,"controlledValues",new Map),no(this,"select",(e,t,n,r)=>(0,this.selectors[e])(this.state,t,n,r)),no(this,"useState",(e,t,n,r)=>(x.useDebugValue(e),nr(this,this.selectors[e],t,n,r))),this.context=t,this.selectors=n}useSyncedValue(e,t){x.useDebugValue(e),eJ(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;eJ(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;eJ(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t,n
3){x.useDebugValue(e);let r=this,i=void 0!==t;this.controlledValues.has(e)||(this.controlledValues.set(e,i),i||Object.is(this.state[e],n)||super.setState({...this.state,[e]:n})),eJ(()=>{i&&!Object.is(r.state[e],t)&&super.setState({...r.state,[e]:t})},[r,e,t,n,i])}set(e,t){!0!==this.controlledValues.get(e)&&super.set(e,t)}update(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&!0===this.controlledValues.get(e)){delete t[e];continue}super.update(t)}setState(e){let t={...e};for(let e in t)if(Object.hasOwn(t,e)&&!0===this.controlledValues.get(e)){delete t[e];continue}super.setState({...this.state,...t})}useContextCallback(e,t){x.useDebugValue(e);let n=eK(t??tR);this.context[e]=n}useStateSetter(e){let t=x.useRef(void 0);return void 0===t.current&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n,r=(n="function"==typeof e?e:this.selectors[e])(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}}class nl{constructor(){this.elements=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(void 0!==n&&this.elements.delete(n),this.elements.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elements.delete(t),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(let t of this.elements)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function ns(e){e.preventDefault(),e.stopPropagation()}function nu(e){return 0===e.mozInputSource&&!!e.isTrusted||(tk&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function nc(e){return!tC&&(!tk&&0===e.width&&0===e.height||tk&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function nd(e,t){let n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function np(e){let t=e.type;return"click"===t||"mousedown"===t||"keydown"===t||"keyup"===t}var nf=Symbol("NOT_FOUND"),nm=e=>Array.isArray(e)?e:[e],nh=(e,t)=>e===t,ng="u">typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function ny(){return{s:0,v:void 0,o:null,p:null}}function nv(e,t={}){let n=ny(),{resultEqualityCheck:r}=t,i,o=0;function a(){var t;let a,l=n,{length:s}=arguments;for(let e=0;e<s;e++){let t=arguments[e];if("function"==typeof t||"object"==typeof t&&null!==t){let e=l.o;null===e&&(l.o=e=new WeakMap);let n=e.get(t);void 0===n?(l=ny(),e.set(t,l)):l=n}else{let e=l.p;null===e&&(l.p=e=new Map);let n=e.get(t);void 0===n?(l=ny(),e.set(t,l)):l=n}}let u=l;if(1===l.s)a=l.v;else if(a=e.apply(null,arguments),o++,r){let e=(null==(t=null==i?void 0:i.deref)?void 0:t.call(i))??i;null!=e&&r(e,a)&&(a=e,0!==o&&o--),i="object"==typeof a&&null!==a||"function"==typeof a?new ng(a):a}return u.s=1,u.v=a,a}return a.clearCache=()=>{n=ny(),a.resetResultsCount()},a.resultsCount=()=>o,a.resetResultsCount=()=>{o=0},a}function nx(e,...t){let n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,o={},a=e.pop();"object"==typeof a&&(o=a,a=e.pop()),function(e,t=`expected a function, instead received ${typeof e}`){if("function"!=typeof e)throw TypeError(t)}(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);let{memoize:l,memoizeOptions:s=[],argsMemoize:u=nv,argsMemoizeOptions:c=[],devModeChecks:d={}}={...n,...o},p=nm(s),f=nm(c),m=function(e){let t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){let n=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),h=l(function(){return t++,a.apply(null,arguments)},...p);return Object.assign(u(function(){r++;let e=function(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}(m,arguments);return i=h.apply(null,e)}
3,...f),{resultFunc:a,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:l,argsMemoize:u})};return Object.assign(r,{withTypes:()=>r}),r}var nb=nx(nv),nw=Object.assign((e,t=nb)=>{!function(e,t=`expected an object, instead received ${typeof e}`){if("object"!=typeof e)throw TypeError(t)}(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>nw});nx({memoize:function(e,t){let n,{equalityCheck:r=nh,maxSize:i=1,resultEqualityCheck:o}="object"==typeof t?t:{equalityCheck:t},a=function(e,t){if(null===e||null===t||e.length!==t.length)return!1;let{length:n}=e;for(let i=0;i<n;i++)if(!r(e[i],t[i]))return!1;return!0},l=0,s=i<=1?{get:e=>n&&a(n.key,e)?n.value:nf,put(e,t){n={key:e,value:t}},getEntries:()=>n?[n]:[],clear(){n=void 0}}:function(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return nf}return{get:r,put:function(t,i){r(t)===nf&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(i,a);function u(){let t=s.get(arguments);if(t===nf){if(t=e.apply(null,arguments),l++,o){let e=s.getEntries().find(e=>o(e.value,t));e&&(t=e.value,0!==l&&l--)}s.put(arguments,t)}return t}return u.clearCache=()=>{s.clear(),u.resetResultsCount()},u.resultsCount=()=>l,u.resetResultsCount=()=>{l=0},u},memoizeOptions:{maxSize:1,equalityCheck:Object.is}});let nj=(e,t,n,r,i,o,...a)=>{let l;if(a.length>0)throw Error(tq(1));if(e)l=e;else throw Error("Missing arguments");return l};var nS=Object.defineProperty;let nE={open:nj(e=>e.open),domReferenceElement:nj(e=>e.domReferenceElement),referenceElement:nj(e=>e.positionReference??e.referenceElement),floatingElement:nj(e=>e.floatingElement),floatingId:nj(e=>e.floatingId)};class nk extends na{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:i,...o}=e;super({...o,positionReference:o.referenceElement,domReferenceElement:o.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:tQ(),nested:t,noEmit:n,triggerElements:i},nE),((e,t,n)=>((e,t,n)=>t in e?nS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n))(this,"setOpen",(e,t)=>{var n,r;if((!e||!this.state.open||np(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",n)}null==(r=(n=this.context).onOpenChange)||r.call(n,e,t)})}}let nO={open:nj(e=>e.open),mounted:nj(e=>e.mounted),transitionStatus:nj(e=>e.transitionStatus),floatingRootContext:nj(e=>e.floatingRootContext),preventUnmountingOnClose:nj(e=>e.preventUnmountingOnClose),payload:nj(e=>e.payload),activeTriggerId:nj(e=>e.activeTriggerId),activeTriggerElement:nj(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:nj((e,t)=>void 0!==t&&e.activeTriggerId===t),isOpenedByTrigger:nj((e,t)=>void 0!==t&&e.activeTriggerId===t&&e.open),isMountedByTrigger:nj((e,t)=>void 0!==t&&e.activeTriggerId===t&&e.mounted),triggerProps:nj((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:nj(e=>e.popupProps),popupElement:nj(e=>e.popupElement),positionerElement:nj(e=>e.positionerElement)};var nC=Object.defineProperty;let nI={...nO,disabled:nj(e=>"menubar"===e.parent.type&&e.parent.context.disabled||e.disabled),modal:nj(e=>(void 0===e.parent.type||"context-menu"===e.parent.type)&&(e.modal??!0)),allowMouseEnter:nj(e=>"menu"===e.parent.type?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:nj(e=>e.stickIfOpen),parent:nj(e=>e.parent),rootId:nj(e=>"menu"===e.parent.type?e.parent.store.select("rootId"):void 0!==e.parent.type?e.parent.context.rootId:e.rootId),activeIndex:nj(e=>e.activeIndex),isActive:nj((e,t)=>e.activeIndex===t),hoverEnabled:nj(e=>e.hoverEnabled),instantType:nj(e=>e.instantType),lastOpenChangeReason:nj(e=>e.openChangeReason),floatingTreeRoot:nj(e=>"menu"===e.parent.type?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:nj(e=>e.floatingNodeId),floatingParentNodeId:nj(e=>e.floatingParentNodeId),itemProps:nj(e=>e.itemProps),closeDelay:nj(e=>e.closeDelay),keyboardEventRelay:nj(e=>e.keyboardEventRelay?e.keyboardEventRelay:"menu"===e.parent.type?e.parent.store.select("keyboardEventRelay"):void 0)};
3class nR extends na{constructor(e){super({...{...{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:new nk({open:!1,floatingElement:null,referenceElement:null,triggerElements:new nl,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0}),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:tP,inactiveTriggerProps:tP,popupProps:tP},disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new t1,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:tP,keyboardEventRelay:void 0,closeDelay:0},...e},{positionerRef:x.createRef(),popupRef:x.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:x.createRef(),beforeContentFocusGuardRef:x.createRef(),onOpenChangeComplete:void 0,triggerElements:new nl},nI),((e,t,n)=>((e,t,n)=>t in e?nC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n))(this,"unsubscribeParentListener",null),this.observe(nj(e=>e.allowMouseEnter),(e,t)=>{"menu"===this.state.parent.type&&e!==t&&this.state.parent.store.set("allowMouseEnter",e)}),this.unsubscribeParentListener=this.observe("parent",e=>{var t;if(null==(t=this.unsubscribeParentListener)||t.call(this),"menu"===e.type){this.unsubscribeParentListener=e.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}void 0!==e.type&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}static useStore(e,t){let n=eL(()=>new nR(t)).current;return e??n}}let nT=x.createContext(void 0),nP=x.createContext(null),nN=x.createContext(null),nA=()=>{var e;return(null==(e=x.useContext(nP))?void 0:e.id)||null},nM=e=>{let t=x.useContext(nN);return e??t};function nL(e){let t=eG(),n=nM(e),r=nA();return eJ(()=>{if(!t)return;let e={id:t,parentId:r};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}},[n,t,r]),t}function nD(e){let{children:t,id:n}=e,r=nA();return(0,o.jsx)(nP.Provider,{value:x.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function n$(e){let{children:t,externalTree:n}=e,r=eL(()=>n??new t1).current;return(0,o.jsx)(nN.Provider,{value:r,children:t})}function nq(e){return null==e?e:"current"in e?e.current:e}let nU=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({}),nB={[nU.startingStyle]:""},nF={[nU.endingStyle]:""};function nz(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,o=eK(i),a=function(e,t=!1,n=!0){let r=e2();return eK((i,o=null)=>{function a(){eA.flushSync(i)}r.cancel();let l=nq(e);if(null!=l)if("function"!=typeof l.getAnimations||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let e=function(){Promise.all(l.getAnimations().map(e=>e.finished)).then(()=>{null!=o&&o.aborted||a()}).catch(()=>{let t=l.getAnimations();if(n){if(null!=o&&o.aborted)return;a()}else t.length>0&&t.some(e=>e.pending||"finished"!==e.playState)&&e()})};if(t)return void function(){let t=nU.startingStyle;if(!l.hasAttribute(t))return r.request(e);let n=new MutationObserver(()=>{l.hasAttribute(t)||(n.disconnect(),e())});n.observe(l,{attributes:!0,attributeFilter:[t]}),null==o||o.addEventListener("abort",()=>n.disconnect(),{once:!0})}();r.request(e)}})}(r,n,!1);x.useEffect(()=>{if(!t)return;let e=new AbortController;return a(o,e.signal),()=>{e.abort()}},[t,n,o,a])}function n_(e){return`data-base-ui-${e}`}function nK(e,t,n=!0){return e.filter(e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))}).flatMap(t=>[t,...nK(e,t.id,n)])}function nW(e,t){var n;let r=[],i=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;i;){let t=e.find(e=>e.id===i);i=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}let nH="data-base-ui-focusable",nV="active",nY="selected",nX="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",nG="ArrowLeft",nJ="ArrowRight",nQ="ArrowUp",nZ="ArrowDown";function n0(e){var t;let n=e.activeElement;for(;(null==(t=null==n?void 0:n.shadowRoot)?void 0:t.activeElement)!=null;)n=n.shadowRoot.activeElement;return n}function n1(e,t){var n;if(!e||!t)return!1;let r=null==(n=t.getRootNode)?void 0:n.call(t);if(e.contains(t))return!0;
3if(r&&te(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function n2(e){return"composedPath"in e?e.composedPath()[0]:e.target}function n5(e,t){return null!=t&&("composedPath"in e?e.composedPath().includes(t):null!=e.target&&t.contains(e.target))}function n4(e){return(null==e?void 0:e.ownerDocument)||document}function n6(e){return e7(e)&&e.matches(nX)}function n3(e){return!!e&&"combobox"===e.getAttribute("role")&&n6(e)}function n8(e){return e?e.hasAttribute(nH)?e:e.querySelector(`[${nH}]`)||e:null}let n9="trigger-press",n7="trigger-hover",re="trigger-focus",rt="outside-press",rn="item-press",rr="focus-out",ri="escape-key",ro="list-navigation",ra="sibling-open",rl={intentional:"onClick",sloppy:"onPointerDown"},rs=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function ru(e){let t=eL(rc,e).current;return t.next=e,eJ(t.effect),t}function rc(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}let rd=0;function rp(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(rd);let o=()=>null==e?void 0:e.focus({preventScroll:n});i?o():rd=requestAnimationFrame(o)}let rf=["top","right","bottom","left"],rm=Math.min,rh=Math.max,rg=Math.round,ry=Math.floor,rv=e=>({x:e,y:e}),rx={left:"right",right:"left",bottom:"top",top:"bottom"},rb={start:"end",end:"start"};function rw(e,t){return"function"==typeof e?e(t):e}function rj(e){return e.split("-")[0]}function rS(e){return e.split("-")[1]}function rE(e){return"x"===e?"y":"x"}function rk(e){return"y"===e?"height":"width"}let rO=new Set(["top","bottom"]);function rC(e){return rO.has(rj(e))?"y":"x"}function rI(e){return e.replace(/start|end/g,e=>rb[e])}let rR=["left","right"],rT=["right","left"],rP=["top","bottom"],rN=["bottom","top"];function rA(e){return e.replace(/left|right|bottom|top/g,e=>rx[e])}function rM(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function rL(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function rD(e,t,n){return Math.floor(e/t)!==n}function r$(e,t){return t<0||t>=e.current.length}function rq(e,t){return rB(e,{disabledIndices:t})}function rU(e,t){return rB(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function rB(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let o=t;do o+=n?-i:i;while(o>=0&&o<=e.current.length-1&&rF(e,o,r))return o}function rF(e,t,n){if("function"==typeof n)return n(t);if(n)return n.includes(t);let r=e.current[t];return!!r&&(r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled"))}function rz(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function r_(e,t){return rz(t,e===nQ||e===nZ,e===nG||e===nJ)}function rK(e,t,n){return rz(t,e===nZ,n?e===nG:e===nJ)||"Enter"===e||" "===e||""===e}function rW(e=[]){let t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),i=e.map(e=>null==e?void 0:e.trigger),o=x.useCallback(t=>rH(t,e,"reference"),t),a=x.useCallback(t=>rH(t,e,"floating"),n),l=x.useCallback(t=>rH(t,e,"item"),r),s=x.useCallback(t=>rH(t,e,"trigger"),i);return x.useMemo(()=>({getReferenceProps:o,getFloatingProps:a,getItemProps:l,getTriggerProps:s}),[o,a,l,s])}function rH(e,t,n){var r;let i=new Map,o="item"===n,a={};for(let t in"floating"===n&&(a.tabIndex=-1,a[nH]=""),e)o&&e&&(t===nV||t===nY)||(a[t]=e[t]);for(let l=0;l<t.length;l+=1){let s,u=null==(r=t[l])?void 0:r[n];(s="function"==typeof u?e?u(e):null:u)&&rV(a,s,o,i)}return rV(a,e,o,i),a}function rV(e,t,n,r){var i;for(let o in t){let a=t[o];n&&(o===nV||o===nY)||(o.startsWith("on")?(r.has(o)||r.set(o,[]),"function"==typeof a&&(null==(i=r.get(o))||i.push(a),e[o]=(...e)=>{var t;return null==(t=r.get(o))?void 0:t.map(t=>t(...e)).find(e=>void 0!==e)})):e[o]=a)}}function rY(e,t){return e&&!t?e:!e&&t?t:e||t?{...e,...t}:void 0}let rX={};function rG(e,t,n,r,i){let o={...rZ(e,rX)};return t&&(o=rJ(o,t)),n&&(o=rJ(o,n)),r&&(o=rJ(o,r)),o}function rJ(e,t){return rQ(t)?t(e):function(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case"style":e[n]=rY(e.style,r);break;case"className":e[n]=r1(e.className,r);break;default:!function(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return 111===n&&110===r&&i>=65&&i<=90&&("function"==typeof t||typeof t>"u")}(n,r)?e[n]=r:e[n]=function(e,t){return t?e?n=>{var r;if(null!=(r=n)&&"object"==typeof r&&"nativeEvent"in r){r0(n);let r=t(n);return n.baseUIHandlerPrevented||null==e||e(n),r}let i=t(n);return null==e||e(n),i}:t:e}(e[n],r)}}return e}(e,t)}function rQ(e){return"function"==typeof e}function rZ(e,t){return rQ(e)?e(t):e??rX}function r0(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function r1(e,t){return t?e?t+" "+e:t:e}
3function r2(e){let t,n,{children:r,open:i,onOpenChange:a,onOpenChangeComplete:l,defaultOpen:s=!1,disabled:u=!1,modal:c,loopFocus:d=!0,orientation:p="vertical",actionsRef:f,closeParentOnEsc:m=!1,handle:h,triggerId:g,defaultTriggerId:y=null,highlightItemOnHover:v=!0}=e,b=tJ(!0),w=tB(!0),j=tz(),S=x.useContext(nT),E=x.useMemo(()=>S&&w?{type:"menu",store:w.store}:j?{type:"menubar",context:j}:b&&!w?{type:"context-menu",context:b}:{type:void 0},[b,w,j,S]),k=nR.useStore(null==h?void 0:h.store,{parent:E}),O=k.useState("floatingTreeRoot"),C=nL(O),I=nA();eJ(()=>{b&&!w?k.update({parent:{type:"context-menu",context:b},floatingNodeId:C,floatingParentNodeId:I}):w&&k.update({floatingNodeId:C,floatingParentNodeId:I})},[b,w,C,I,k]),k.useControlledProp("open",i,s),k.useControlledProp("activeTriggerId",g,y),k.useContextCallback("onOpenChangeComplete",l);let R=k.useState("open"),T=k.useState("activeTriggerElement"),P=k.useState("positionerElement"),N=k.useState("hoverEnabled"),A=k.useState("modal"),M=k.useState("disabled"),L=k.useState("lastOpenChangeReason"),D=k.useState("parent"),$=k.useState("activeIndex"),q=k.useState("payload"),U=k.useState("floatingParentNodeId"),B=x.useRef(null),F=null!=U;k.useSyncedValues({disabled:u,modal:void 0===D.type?c:void 0,rootId:eG()});let{openMethod:z,triggerProps:_,reset:K}=function(e){let[t,n]=x.useState(null),r=eK((t,r)=>{e||n(r||(tS?"touch":""))}),i=x.useCallback(()=>{n(null)},[]),{onClick:o,onPointerDown:a}=function(e){let t=x.useRef(""),n=x.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:x.useCallback(n=>{if(0===n.detail)return void e(n,"keyboard");"pointerType"in n&&e(n,n.pointerType),e(n,t.current),t.current=""},[e]),onPointerDown:n}}(r);return x.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:o,onPointerDown:a}}),[t,i,o,a])}(R),W=k.useState("open");eJ(()=>{if(W&&!k.select("activeTriggerId")&&1===k.context.triggerElements.size){let e=k.context.triggerElements.entries().next();if(!e.done){let[t,n]=e.value;k.update({activeTriggerId:t,activeTriggerElement:n})}}},[W,k]);let{forceUnmount:H}=function(e,t,n){let{mounted:r,setMounted:i,transitionStatus:o}=function(e,t=!1,n=!1){let[r,i]=x.useState(e&&t?"idle":void 0),[o,a]=x.useState(e);return e&&!o&&(a(!0),i("starting")),e||!o||"ending"===r||n||i("ending"),e||o||"ending"!==r||i(void 0),eJ(()=>{if(!e&&o&&"ending"!==r&&n){let e=e1.request(()=>{i("ending")});return()=>{e1.cancel(e)}}},[e,o,r,n]),eJ(()=>{if(!e||t)return;let n=e1.request(()=>{i(void 0)});return()=>{e1.cancel(n)}},[t,e]),eJ(()=>{if(!e||!t)return;e&&o&&"idle"!==r&&i("starting");let n=e1.request(()=>{i("idle")});return()=>{e1.cancel(n)}},[t,e,o,i,r]),x.useMemo(()=>({mounted:o,setMounted:a,transitionStatus:r}),[o,r])}(e);t.useSyncedValues({mounted:r,transitionStatus:o});let a=eK(()=>{var e,r;i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),null==n||n(),null==(r=(e=t.context).onOpenChangeComplete)||r.call(e,!1)});return nz({enabled:!t.useState("preventUnmountingOnClose"),open:e,ref:t.context.popupRef,onComplete(){e||a()}}),{forceUnmount:a,transitionStatus:o}}(R,k,()=>{k.update({allowMouseEnter:!1,stickIfOpen:!0}),K()}),V=x.useRef("context-menu"!==D.type),Y=eF();x.useEffect(()=>{if(R||(B.current=null),"context-menu"===D.type){if(!R){Y.clear(),V.current=!1;return}Y.start(500,()=>{V.current=!0})}},[Y,R,D.type]),function(e=!0,t=null){eJ(()=>{if(e)return t$.acquire(t)},[e,t])}(R&&A&&L!==n7&&"touch"!==z,P),eJ(()=>{R||N||k.set("hoverEnabled",!0)},[R,N,k]);let X=x.useRef(!0),G=eF(),J=eK((e,n)=>{let r=n.reason;if(R===e&&n.trigger===T&&L===r||(n.preventUnmountOnClose=()=>{k.set("preventUnmountingOnClose",!0)},e||null!=n.trigger||(n.trigger=T??void 0),null==a||a(e,n),n.isCanceled))return;let i={open:e,nativeEvent:n.event,reason:n.reason,nested:F};null==t||t.emit("openchange",i);let o=n.event;if(!1===e&&(null==o?void 0:o.type)==="click"&&"touch"===o.pointerType&&!X.current)return;if(!e&&null!==$){let e=k.context.itemDomElements.current[$];queueMicrotask(()=>{null==e||e.setAttribute("tabindex","-1")})}e&&r===re?(X.current=!1,G.start(300,()=>{X.current=!0})):(X.current=!0,G.clear());let l=(r===n9||r===rn)&&0===o.detail&&(null==o?void 0:o.isTrusted),s=!e&&(r===ri||null==r);function u(){var t;let i={open:e,openChangeReason:r};B.current=n.event??null;let o=(null==(t=n.trigger)?void 0:t.id)??null;(o||e)&&(i.activeTriggerId=o,i.activeTriggerElement=n.trigger??null),k.update(i)}r===n7?eA.flushSync(u):u(),"menubar"===D.type&&(r===re||r===rr||r===n7||r===ro||r===ra)?k.set("instantType","group"):l||s?k.set("instantType",l?"click":"dismiss"):k.set("instantType",void 0)}),Q=x.useCallback(e=>{let t=tX(e);return t.preventUnmountOnClose=()=>{k.set("preventUnmountingOnClose",!0)},t},[k]),Z=x.useCallback(()=>{k.setOpen(!1,Q("imperative-action"))},[k,Q]);x.useImperativeHandle(f,()=>({unmount:H,close:Z}),[H,Z]),"context-menu"===D.type&&(n=D.context),x.useImperativeHandle(null==n?void 0:n.positionerRef,()=>P,[P]),x.useImperativeHandle(null==n?void 0:n.actionsRef,()=>({setOpen:J}),[J]);let ee=function(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,o=eG(),a=null!=nA(),l=t.useState("open"),s=t.useState("activeTriggerElement"),u=t.useState(r?"popupElement":"positionerElement"),c=t.context.triggerElements,d=eL(()=>new nk({open:l,referenceElement:s,floatingElement:u,triggerElements:c,onOpenChange:i,floatingId:o,nested:a,noEmit:n})).current;return eJ(()=>{let e={open:l,floatingId:o,referenceElement:s,floatingElement:u};e9(s)&&(e.domReferenceElement=s),d.state.positionReference===d.state.referenceElement&&(e.positionReference=s),d.update(e)},[l,o,s,u,d]),d.context.onOpenChange=i,d.context.nested=a,d.context.noEmit=n,d}({popupStore:k,onOpenChange:J});t=ee.context.events,x.useEffect(()=>{let e=({open:e,eventDetails:t})=>J(e,t);return t.on("setOpen",e),()=>{null==t||t.off("setOpen",e)}},[t,J]);let et=function(e,t={}){let n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingElement"),o=n.useState("referenceElement"),a=n.useState("domReferenceElement"),{onOpenChange:l,dataRef:s}=n.context,{enabled:u=!0,escapeKey:c=!0,outsidePress:d=!0,outsidePressEvent:p="sloppy",referencePress:f=!1,referencePressEvent:m="sloppy",ancestorScroll:h=!1,bubbles:g,externalTree:y}
3=t,v=nM(y),b=eK("function"==typeof d?d:()=>!1),w="function"==typeof d?b:d,j=x.useRef(!1),{escapeKey:S,outsidePress:E}={escapeKey:"boolean"==typeof g?g:(null==g?void 0:g.escapeKey)??!1,outsidePress:"boolean"==typeof g?g:(null==g?void 0:g.outsidePress)??!0},k=x.useRef(null),O=eF(),C=eF(),I=eK(()=>{C.clear(),s.current.insideReactTree=!1}),R=x.useRef(!1),T=x.useRef(""),P=eK(e=>{T.current=e.pointerType}),N=eK(()=>{let e=T.current,t="function"==typeof p?p():p;return"string"==typeof t?t:t["pen"!==e&&e?e:"mouse"]}),A=eK(e=>{var t;if(!r||!u||!c||"Escape"!==e.key||R.current)return;let i=null==(t=s.current.floatingContext)?void 0:t.nodeId,o=v?nK(v.nodesRef.current,i):[];if(!S&&o.length>0){let e=!0;if(o.forEach(t=>{var n;null!=(n=t.context)&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let a=tX(ri,"nativeEvent"in e?e.nativeEvent:e);n.setOpen(!1,a),S||a.isPropagationAllowed||e.stopPropagation()}),M=eK(e=>{let t=N();return"intentional"===t&&"click"!==e.type||"sloppy"===t&&"click"===e.type}),L=eK(()=>{s.current.insideReactTree=!0,C.start(0,I)}),D=eK((e,t=!1)=>{var r;if(M(e)||s.current.insideReactTree)return void I();if("intentional"===N()&&t||"function"==typeof w&&!w(e))return;let i=n2(e),o=`[${n_("inert")}]`,a=n4(n.select("floatingElement")).querySelectorAll(o),l=n.context.triggerElements;if(i&&(l.hasElement(i)||l.hasMatchingElement(e=>n1(e,i))))return;let u=e9(i)?i:null;for(;u&&!tp(u);){let e=th(u);if(tp(e)||!e9(e))break;u=e}if(a.length&&e9(i)&&!i.matches("html,body")&&!n1(i,n.select("floatingElement"))&&Array.from(a).every(e=>!n1(u,e)))return;if(e7(i)&&!("touches"in e)){let t=tp(i),n=tf(i),r=/auto|scroll/,o=t||r.test(n.overflowX),a=t||r.test(n.overflowY),l=o&&i.clientWidth>0&&i.scrollWidth>i.clientWidth,s=a&&i.clientHeight>0&&i.scrollHeight>i.clientHeight,u="rtl"===n.direction,c=s&&(u?e.offsetX<=i.offsetWidth-i.clientWidth:e.offsetX>i.clientWidth),d=l&&e.offsetY>i.clientHeight;if(c||d)return}let c=null==(r=s.current.floatingContext)?void 0:r.nodeId,d=v&&nK(v.nodesRef.current,c).some(t=>{var n;return n5(e,null==(n=t.context)?void 0:n.elements.floating)});if(n5(e,n.select("floatingElement"))||n5(e,n.select("domReferenceElement"))||d)return;let p=v?nK(v.nodesRef.current,c):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;null!=(n=t.context)&&n.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,tX(rt,e)),I()}),$=eK(e=>{"sloppy"!==N()||"touch"===e.pointerType||!n.select("open")||!u||n5(e,n.select("floatingElement"))||n5(e,n.select("domReferenceElement"))||D(e)}),q=eK(e=>{if("sloppy"!==N()||!n.select("open")||!u||n5(e,n.select("floatingElement"))||n5(e,n.select("domReferenceElement")))return;let t=e.touches[0];t&&(k.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{k.current&&(k.current.dismissOnTouchEnd=!1,k.current.dismissOnMouseDown=!1)}))}),U=eK(e=>{let t=n2(e);null==t||t.addEventListener(e.type,function n(){q(e),null==t||t.removeEventListener(e.type,n)})}),B=eK(e=>{let t=j.current;if(j.current=!1,O.clear(),"mousedown"===e.type&&k.current&&!k.current.dismissOnMouseDown)return;let n=n2(e);null==n||n.addEventListener(e.type,function r(){"pointerdown"===e.type?$(e):D(e,t),null==n||n.removeEventListener(e.type,r)})}),F=eK(e=>{if("sloppy"!==N()||!k.current||n5(e,n.select("floatingElement"))||n5(e,n.select("domReferenceElement")))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-k.current.startX),i=Math.abs(t.clientY-k.current.startY),o=Math.sqrt(r*r+i*i);o>5&&(k.current.dismissOnTouchEnd=!0),o>10&&(D(e),O.clear(),k.current=null)}),z=eK(e=>{let t=n2(e);null==t||t.addEventListener(e.type,function n(){F(e),null==t||t.removeEventListener(e.type,n)})}),_=eK(e=>{"sloppy"!==N()||!k.current||n5(e,n.select("floatingElement"))||n5(e,n.select("domReferenceElement"))||(k.current.dismissOnTouchEnd&&D(e),O.clear(),k.current=null)}),K=eK(e=>{let t=n2(e);null==t||t.addEventListener(e.type,function n(){_(e),null==t||t.removeEventListener(e.type,n)})});x.useEffect(()=>{if(!r||!u)return;s.current.__escapeKeyBubbles=S,s.current.__outsidePressBubbles=E;let e=new eB;function t(e){n.setOpen(!1,tX("none",e))}function l(){e.clear(),R.current=!0}function d(){e.start(5*!!tc(),()=>{R.current=!1})}let p=n4(i);p.addEventListener("pointerdown",P,!0),c&&(p.addEventListener("keydown",A),p.addEventListener("compositionstart",l),p.addEventListener("compositionend",d)),w&&(p.addEventListener("click",B,!0),p.addEventListener("pointerdown",B,!0),p.addEventListener("touchstart",U,!0),p.addEventListener("touchmove",z,!0),p.addEventListener("touchend",K,!0),p.addEventListener("mousedown",B,!0));let f=[];return h&&(e9(a)&&(f=tg(a)),e9(i)&&(f=f.concat(tg(i))),!e9(o)&&o&&o.contextElement&&(f=f.concat(tg(o.contextElement)))),(f=f.filter(e=>{var t;
3return e!==(null==(t=p.defaultView)?void 0:t.visualViewport)})).forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{p.removeEventListener("pointerdown",P,!0),c&&(p.removeEventListener("keydown",A),p.removeEventListener("compositionstart",l),p.removeEventListener("compositionend",d)),w&&(p.removeEventListener("click",B,!0),p.removeEventListener("pointerdown",B,!0),p.removeEventListener("touchstart",U,!0),p.removeEventListener("touchmove",z,!0),p.removeEventListener("touchend",K,!0),p.removeEventListener("mousedown",B,!0)),f.forEach(e=>{e.removeEventListener("scroll",t)}),e.clear(),j.current=!1}},[s,i,o,a,c,w,r,l,h,u,S,E,A,D,B,$,U,z,K,P,n]),x.useEffect(I,[w,I]);let W=x.useMemo(()=>({onKeyDown:A,...f&&{[rl[m]]:e=>{n.setOpen(!1,tX(n9,e.nativeEvent))},..."intentional"!==m&&{onClick(e){n.setOpen(!1,tX(n9,e.nativeEvent))}}}}),[A,n,f,m]),H=eK(e=>{let t=n2(e.nativeEvent);n1(n.select("floatingElement"),t)&&0===e.button&&(j.current=!0)}),V=eK(e=>{r&&u&&0===e.button&&(j.current=!0)}),Y=x.useMemo(()=>({onKeyDown:A,onPointerDown:H,onMouseDown:H,onMouseUp:H,onClickCapture:L,onMouseDownCapture(e){L(),V(e)},onPointerDownCapture(e){L(),V(e)},onMouseUpCapture:L,onTouchEndCapture:L,onTouchMoveCapture:L}),[A,H,L,V]);return x.useMemo(()=>u?{reference:W,floating:Y,trigger:W}:{},[u,W,Y])}(ee,{enabled:!M,bubbles:{escapeKey:m&&"menu"===D.type},outsidePress(){var e;return"context-menu"!==D.type||(null==(e=B.current)?void 0:e.type)==="contextmenu"||V.current},externalTree:F?O:void 0}),en=function(e,t={}){let n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingId"),o=n.useState("domReferenceElement"),a=n.useState("floatingElement"),{enabled:l=!0,role:s="dialog"}=t,u=eG(),c=(null==o?void 0:o.id)||u,d=x.useMemo(()=>{var e;return(null==(e=n8(a))?void 0:e.id)||i},[a,i]),p=rs.get(s)??s,f=null!=nA(),m=x.useMemo(()=>"tooltip"===p||"label"===s?tP:{"aria-haspopup":"alertdialog"===p?"dialog":p,"aria-expanded":"false",..."listbox"===p&&{role:"combobox"},..."menu"===p&&f&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}},[p,f,s]),h=x.useMemo(()=>"tooltip"===p||"label"===s?{[`aria-${"label"===s?"labelledby":"describedby"}`]:r?d:void 0}:{...m,"aria-expanded":r?"true":"false","aria-controls":r?d:void 0,..."menu"===p&&{id:c}},[p,d,r,c,s,m]),g=x.useMemo(()=>{let e={id:d,...p&&{role:p}};return"tooltip"===p||"label"===s?e:{...e,..."menu"===p&&{"aria-labelledby":c}}},[p,d,c,s]),y=x.useCallback(({active:e,selected:t})=>{let n={role:"option",...e&&{id:`${d}-fui-option`}};switch(s){case"select":case"combobox":return{...n,"aria-selected":t}}return{}},[d,s]);return x.useMemo(()=>l?{reference:h,floating:g,item:y,trigger:m}:{},[l,h,g,m,y])}(ee,{role:"menu"}),er=tY(),ei=x.useCallback(e=>{k.select("activeIndex")!==e&&k.set("activeIndex",e)},[k]),eo=function(e,t){let n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingElement"),o=n.useState("domReferenceElement"),a=n.context.dataRef,{listRef:l,activeIndex:s,onNavigate:u=()=>{},enabled:c=!0,selectedIndex:d=null,allowEscape:p=!1,loopFocus:f=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:w,orientation:j="vertical",parentOrientation:S,cols:E=1,scrollItemIntoView:k=!0,itemSizes:O,dense:C=!1,id:I,resetOnPointerLeave:R=!0,externalTree:T}=t,P=ru(n8(i)),N=nA(),A=nM(T);eJ(()=>{a.current.orientation=j},[a,j]);let M=n3(o),L=x.useRef(y),D=x.useRef(d??-1),$=x.useRef(null),q=x.useRef(!0),U=eK(e=>{u(-1===D.current?null:D.current,e)}),B=x.useRef(U),F=x.useRef(!!i),z=x.useRef(r),_=x.useRef(!1),K=x.useRef(!1),W=ru(w),H=ru(r),V=ru(k),Y=ru(d),X=ru(R),G=eK(()=>{function e(e){g?null==A||A.events.emit("virtualfocus",e):rp(e,{sync:_.current,preventScroll:!0})}let t=l.current[D.current],n=K.current;t&&e(t),(_.current?e=>e():requestAnimationFrame)(()=>{var r;let i=l.current[D.current]||t;if(!i)return;t||e(i);let o=V.current;o&&Q&&(n||!q.current)&&(null==(r=i.scrollIntoView)||r.call(i,"boolean"==typeof o?{block:"nearest",inline:"nearest"}:o))})});eJ(()=>{c&&(r&&i?(D.current=d??-1,L.current&&null!=d&&(K.current=!0,U())):F.current&&(D.current=-1,B.current()))},[c,r,i,d,U]),eJ(()=>{if(c){if(!r){_.current=!1;return}if(i)if(null==s){if(_.current=!1,null!=Y.current)return;if(F.current&&(D.current=-1,G()),(!z.current||!F.current)&&L.current&&(null!=$.current||!0===L.current&&null==$.current)){let e=0,t=()=>{null==l.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e+=1):(D.current=null==$.current||rK($.current,j,h)||m?rq(l):rU(l),$.current=null,U())};t()}}else r$(l,s)||(D.current=s,G(),K.current=!1)}},[c,r,i,s,Y,m,l,j,h,U,G,W]),eJ(()=>{var e,t;if(!c||i||!A||g||!F.current)return;let n=A.nodesRef.current,r=null==(t=null==(e=n.find(e=>e.id===N))?void 0:e.context)?void 0:t.elements.floating,o=n0(n4(i)),a=n.some(e=>e.context&&n1(e.context.elements.floating,o));r&&!a&&q.current&&r.focus({preventScroll:!0})},[c,i,A,N,g]),eJ(()=>{B.current=U,z.current=r,F.current=!!i}),eJ(()=>{r||($.current=null,L.current=y)},[r,y]);let J=null!=s,Q=x.useMemo(()=>{function e(e){if(!H.current)return;let t=l.current.indexOf(e.currentTarget);-1!==t&&D.current!==t&&(D.current=t,U(e))}return{onFocus(t){_.current=!0,e(t)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(t){_.current=!0,K.current=!1,v&&e(t)},onPointerLeave(e){var t;if(!H.current||!q.current||"touch"===e.pointerType)return;_.current=!0;let n=e.relatedTarget;!v||l.current.includes(n)||X.current&&(D.current=-1,U(e),g||null==(t=P.current)||t.focu
3s({preventScroll:!0}))}}},[H,P,v,l,U,X,g]),Z=x.useCallback(()=>{var e,t,n;return S??(null==(n=null==(t=null==(e=null==A?void 0:A.nodesRef.current.find(e=>e.id===N))?void 0:e.context)?void 0:t.dataRef)?void 0:n.current.orientation)},[N,A,S]),ee=eK(e=>{var t,i;if(q.current=!1,_.current=!0,229===e.which||!H.current&&e.currentTarget===P.current)return;if(m&&(t=e.key,"both"===j||"horizontal"===j&&E&&E>1?"Escape"===t:rz(j,h?t===nJ:t===nG,t===nQ))){r_(e.key,Z())||ns(e),n.setOpen(!1,tX(ro,e.nativeEvent)),e7(o)&&(g?null==A||A.events.emit("virtualfocus",o):o.focus());return}let a=D.current,s=rq(l,w),u=rU(l,w);if(M||("Home"===e.key&&(ns(e),D.current=s,U(e)),"End"===e.key&&(ns(e),D.current=u,U(e))),E>1){let t=O||Array.from({length:l.current.length},()=>({width:1,height:1})),n=function(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:o},a)=>{let l=!1;for(n&&(i=0);!l;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<o;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>null==r[e])?(n.forEach(e=>{r[e]=a}),l=!0):i+=1}}),[...r]}(t,E,C),r=n.findIndex(e=>null!=e&&!rF(l,e,w)),o=n.reduce((e,t,n)=>null==t||rF(l,t,w)?e:n,-1),a=n[function(e,{event:t,orientation:n,loopFocus:r,rtl:i,
3cols:o,disabledIndices:a,minIndex:l,maxIndex:s,prevIndex:u,stopEvent:c=!1}){let d=u,p=[],f={},m=!1;{let t=null,n=-1;e.current.forEach((e,r)=>{if(null==e)return;let i=e.closest('[role="row"]');i&&(m=!0),(i!==t||-1===n)&&(t=i,p[n+=1]=[]),p[n].push(r),f[r]=n})}let h=m&&p.length>0&&p.some(e=>e.length!==o);function g(t){if(!h||-1===u)return;let n=f[u];if(null==n)return;let i=p[n].indexOf(u),o="up"===t?n-1:n+1;r&&(o<0?o=p.length-1:o>=p.length&&(o=0));let l=new Set;for(;o>=0&&o<p.length&&!l.has(o);){l.add(o);let n=p[o];if(0===n.length){o="up"===t?o-1:o+1;continue}let s=Math.min(i,n.length-1);for(let t=s;t>=0;t-=1){let r=n[t];if(!rF(e,r,a))return r}o="up"===t?o-1:o+1,r&&(o<0?o=p.length-1:o>=p.length&&(o=0))}}if(t.key===nQ){let n=g("up");if(void 0!==n)c&&ns(t),d=n;else{if(c&&ns(t),-1===u)d=s;else if(d=rB(e,{startingIndex:d,amount:o,decrement:!0,disabledIndices:a}),r&&(u-o<l||d<0)){let e=u%o,t=s%o,n=s-(t-e);d=t===e?s:t>e?n:n-o}r$(e,d)&&(d=u)}}if(t.key===nZ){let n=g("down");void 0!==n?(c&&ns(t),d=n):(c&&ns(t),-1===u?d=l:(d=rB(e,{startingIndex:u,amount:o,disabledIndices:a}),r&&u+o>s&&(d=rB(e,{startingIndex:u%o-o,amount:o,disabledIndices:a}))),r$(e,d)&&(d=u))}if("both"===n){let n=ry(u/o);t.key===(i?nG:nJ)&&(c&&ns(t),u%o!=o-1?(d=rB(e,{startingIndex:u,disabledIndices:a}),r&&rD(d,o,n)&&(d=rB(e,{startingIndex:u-u%o-1,disabledIndices:a}))):r&&(d=rB(e,{startingIndex:u-u%o-1,disabledIndices:a})),rD(d,o,n)&&(d=u)),t.key===(i?nJ:nG)&&(c&&ns(t),u%o!=0?(d=rB(e,{startingIndex:u,decrement:!0,disabledIndices:a}),r&&rD(d,o,n)&&(d=rB(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:a}))):r&&(d=rB(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:a})),rD(d,o,n)&&(d=u));let l=ry(s/o)===n;r$(e,d)&&(d=r&&l?t.key===(i?nJ:nG)?s:rB(e,{startingIndex:u-u%o-1,disabledIndices:a}):u)}return d}({current:n.map(e=>null!=e?l.current[e]:null)},{event:e,orientation:j,loopFocus:f,rtl:h,cols:E,disabledIndices:(i=[...("function"!=typeof w?w:null)||l.current.map((e,t)=>rF(l,t,w)?t:void 0),void 0],n.flatMap((e,t)=>i.includes(e)?[t]:[])),minIndex:r,maxIndex:o,prevIndex:function(e,t,n,r,i){if(-1===e)return -1;let o=n.indexOf(e),a=t[e];switch(i){case"tl":return o;case"tr":return a?o+a.width-1:o;case"bl":return a?o+(a.height-1)*r:o;case"br":return n.lastIndexOf(e);default:return -1}}(D.current>u?s:D.current,t,n,E,e.key===nZ?"bl":e.key===(h?nG:nJ)?"tr":"tl"),stopEvent:!0})];if(null!=a&&(D.current=a,U(e)),"both"===j)return}if(r_(e.key,j)){if(ns(e),r&&!g&&n0(e.currentTarget.ownerDocument)===e.currentTarget){D.current=rK(e.key,j,h)?s:u,U(e);return}rK(e.key,j,h)?f?a>=u?p&&a!==l.current.length?D.current=-1:(_.current=!1,D.current=s):D.current=rB(l,{startingIndex:a,disabledIndices:w}):D.current=Math.min(u,rB(l,{startingIndex:a,disabledIndices:w})):f?a<=s?p&&-1!==a?D.current=l.current.length:(_.current=!1,D.current=u):D.current=rB(l,{startingIndex:a,decrement:!0,disabledIndices:w}):D.current=Math.max(s,rB(l,{startingIndex:a,decrement:!0,disabledIndices:w})),r$(l,D.current)&&(D.current=-1),U(e)}}),et=x.useMemo(()=>g&&r&&J&&{"aria-activedescendant":`${I}-${s}`},[g,r,J,I,s]),en=x.useMemo(()=>({"aria-orientation":"both"===j?void 0:j,...M?{}:et,onKeyDown(e){if("Tab"===e.key&&e.shiftKey&&r&&!g){let t=n2(e.nativeEvent);if(t&&!n1(P.current,t))return;ns(e),n.setOpen(!1,tX(rr,e.nativeEvent)),e7(o)&&o.focus();return}ee(e)},onPointerMove(){q.current=!0}}),[et,ee,P,j,M,n,r,g,o]),er=x.useMemo(()=>{function e(e){"auto"===y&&nu(e.nativeEvent)&&(L.current=!g)}function t(e){L.current=y,"auto"===y&&nc(e.nativeEvent)&&(L.current=!0)}return{onKeyDown(e){var t;let r=n.select("open");q.current=!1;let i=e.key.startsWith("Arrow"),o=(t=e.key,rz(Z(),h?t===nG:t===nJ,t===nZ)),a=r_(e.key,j),s=(m?o:a)||"Enter"===e.key||""===e.key.trim();if(g&&r)return ee(e);if(!(!r&&!b&&i)){if(s){let t=r_(e.key,Z());$.current=m&&t?null:e.key}if(m){o&&(ns(e),r?(D.current=rq(l,W.current),U(e)):n.setOpen(!0,tX(ro,e.nativeEvent,e.currentTarget)));return}a&&(null!=Y.current&&(D.current=Y.current),ns(e),!r&&b?n.setOpen(!0,tX(ro,e.nativeEvent,e.currentTarget)):ee(e),r&&U(e))}},onFocus(e){n.select("open")&&!g&&(D.current=-1,U(e))},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[ee,W,y,l,m,U,n,b,j,Z,h,Y,g]),ei=x.useMemo(()=>({...et,...er}),[et,er]);return x.useMemo(()=>c?{reference:ei,floating:en,item:Q,trigger:er}:{},[c,ei,en,er,Q])}
3(ee,{enabled:!M,listRef:k.context.itemDomElements,activeIndex:$,nested:void 0!==D.type,loopFocus:d,orientation:p,parentOrientation:"menubar"===D.type?D.context.orientation:void 0,rtl:"rtl"===er,disabledIndices:tT,onNavigate:ei,openOnArrowKeyDown:"context-menu"!==D.type,externalTree:F?O:void 0,focusItemOnHover:v}),ea=x.useCallback(e=>{k.context.typingRef.current=e},[k]),{getReferenceProps:el,getFloatingProps:es,getItemProps:eu,getTriggerProps:ec}=rW([et,en,eo,function(e,t){let n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.context.dataRef,{listRef:o,activeIndex:a,onMatch:l,onTypingChange:s,enabled:u=!0,findMatch:c=null,resetMs:d=750,ignoreKeys:p=tT,selectedIndex:f=null}=t,m=eF(),h=x.useRef(""),g=x.useRef(f??a??-1),y=x.useRef(null);eJ(()=>{r&&(m.clear(),y.current=null,h.current="")},[r,m]),eJ(()=>{r&&""===h.current&&(g.current=f??a??-1)},[r,f,a]);let v=eK(e=>{e?i.current.typing||(i.current.typing=e,null==s||s(e)):i.current.typing&&(i.current.typing=e,null==s||s(e))}),b=eK(e=>{function t(e,t,n){let r=c?c(t,n):t.find(e=>(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))===0);return r?e.indexOf(r):-1}let n=o.current;if(h.current.length>0&&" "!==h.current[0]&&(-1===t(n,n,h.current)?v(!1):" "===e.key&&ns(e)),null==n||p.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(ns(e),v(!0)),n.every(e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())})&&h.current===e.key&&(h.current="",g.current=y.current),h.current+=e.key,m.start(d,()=>{h.current="",g.current=y.current,v(!1)});let i=g.current,a=t(n,[...n.slice((i||0)+1),...n.slice(0,(i||0)+1)],h.current);-1!==a?(null==l||l(a),y.current=a):" "!==e.key&&(h.current="",v(!1))}),w=x.useMemo(()=>({onKeyDown:b}),[b]),j=x.useMemo(()=>({onKeyDown:b,onKeyUp(e){" "===e.key&&v(!1)}}),[b,v]);return x.useMemo(()=>u?{reference:w,floating:j}:{},[u,w,j])}(ee,{listRef:k.context.itemLabels,activeIndex:$,resetMs:500,onMatch:e=>{R&&e!==$&&k.set("activeIndex",e)},onTypingChange:ea})]),ed=x.useMemo(()=>{let e=rG(el(),{onMouseEnter(){k.set("hoverEnabled",!0)},onMouseMove(){k.set("allowMouseEnter",!0)}},_);return delete e.role,e},[el,k,_]),ep=x.useMemo(()=>{let e=ec();if(!e)return e;let t=rG(e,_);return delete t.role,delete t["aria-controls"],t},[ec,_]),ef=e2(),em=x.useMemo(()=>es({onMouseEnter(){"menu"===D.type&&ef.request(()=>k.set("hoverEnabled",!1))},onMouseMove(){k.set("allowMouseEnter",!0)},onClick(){k.select("hoverEnabled")&&k.set("hoverEnabled",!1)},onKeyDown(e){let t=k.select("keyboardEventRelay");t&&!e.isPropagationStopped()&&t(e)}}),[es,D.type,ef,k]),eh=x.useMemo(()=>eu(),[eu]);k.useSyncedValues({floatingRootContext:ee,activeTriggerProps:ed,inactiveTriggerProps:ep,popupProps:em,itemProps:eh});let eg=x.useMemo(()=>({store:k,parent:E}),[k,E]),ey=(0,o.jsx)(tU.Provider,{value:eg,children:"function"==typeof r?r({payload:q}):r});return void 0===D.type||"context-menu"===D.type?(0,o.jsx)(n$,{externalTree:O,children:ey}):ey}let r5=x.createContext(void 0),r4={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1,position:"fixed",top:0,left:0},r6=x.forwardRef(function(e,t){let[n,r]=x.useState();return eJ(()=>{tE&&r("button")},[]),(0,o.jsx)("span",{...e,ref:t,style:r4,"aria-hidden":!n||void 0,tabIndex:0,role:n,"data-base-ui-focus-guard":""})});function r3(e,t,n,r){var i,o,a,l,s;let u=eL(r8).current;return i=u,o=e,a=t,l=n,s=r,(i.refs[0]!==o||i.refs[1]!==a||i.refs[2]!==l||i.refs[3]!==s)&&r9(u,[e,t,n,r]),u.callback}function r8(){return{callback:null,cleanup:null,refs:[]}}function r9(e,t){if(e.refs=t,t.every(e=>null==e)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),null!=n){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(null!=i)switch(typeof i){case"function":{let t=i(n);"function"==typeof t&&(r[e]=t);break}case"object":i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(null!=n)switch(typeof n){case"function":{let t=r[e];"function"==typeof t?t():n(null);break}case"object":n.current=null}}}}}}function r7(e){if(!x.isValidElement(e))return null;let t=e.props;return(nn>=19?null==t?void 0:t.ref:e.ref)??null}function ie(e,t,n={}){let r=t.render,i=function(e,t={}){let{className:n,style:r,render:i}=e,{state:o=tP,ref:a,props:l,stateAttributesMapping:s,enabled:u=!0}=t,c=u?"function"==typeof n?n(o):n:void 0,d=u?"function"==typeof r?r(o):r:void 0,p=u?function(e,t){let n={};for(let r in e){let i=e[r];if(null!=t&&t.hasOwnProperty(r)){let e=t[r](i);null!=e&&Object.assign(n,e);continue}!0===i?n[`data-${r.toLowerCase()}`]="":i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}(o,s):tP,f=u?rY(p,Array.isArray(l)?function(e){if(0===e.length)return rX;if(1===e.length)return rZ(e[0],rX);let t={...rZ(e[0],rX)};for(let n=1;n<e.length;n+=1)t=rJ(t,e[n]);return t}(l):l)??tP:tP;return"u">typeof document&&(u?Array.isArray(a)?f.ref=function(e){var t,n;let r=eL(r8).current;return t=r,n=e,(t.refs.length!==n.length||t.refs.some((e,t)=>e!==n[t]))&&r9(r,e),r.callback}([f.ref,r7(i),...a]):f.ref=r3(f.ref,r7(i),a):r3(null,null)),u?(void 0!==c&&(f.className=r1(f.className,c)),void 0!==d&&(f.style=rY(f.style,d)),f):tP}(t,n);return!1===n.enabled?null:function(e,t,n,r){if(t){if("function"==typeof t)return t(n,r);let e=rG(n,t.props);return e.ref=n.ref,x.cloneElement(t,e)}if(e&&"string"==typeof e){var i,o;return i=e,o=n,"button"===i?(0,x.createElement)("button",{type:"button",...o,key:o.key}):"img"===i?(0,x.createElement)("img",{alt:"",...o,key:o.key}):x.createElement(i,o)}throw Error(tq(8))}(e,r,i,n.state??tP)}var it='input:not([inert]):not([inert] *),select:not([inert]):not([inert] *),textarea:not([inert]):not([inert] *),a[href]:not([inert]):not([inert] *),button:not([inert]):not([inert] *),[tabindex]:not
3(slot):not([inert]):not([inert] *),audio[controls]:not([inert]):not([inert] *),video[controls]:not([inert]):not([inert] *),[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *),details>summary:first-of-type:not([inert]):not([inert] *),details:not([inert]):not([inert] *)',ir=typeof Element>"u",ii=ir?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,io=!ir&&Element.prototype.getRootNode?function(e){var t;return null==e||null==(t=e.getRootNode)?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},ia=function(e,t){void 0===t&&(t=!0);var n,r=null==e||null==(n=e.getAttribute)?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):ia(e.parentNode))},il=function(e){var t,n=null==e||null==(t=e.getAttribute)?void 0:t.call(e,"contenteditable");return""===n||"true"===n},is=function(e,t,n){if(ia(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(it));return t&&ii.call(e,it)&&r.unshift(e),r=r.filter(n)},iu=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var o=i.shift();if(!ia(o,!1))if("SLOT"===o.tagName){var a=o.assignedElements(),l=iu(a.length?a:o.children,!0,n);
3n.flatten?r.push.apply(r,l):r.push({scopeParent:o,candidates:l})}else{ii.call(o,it)&&n.filter(o)&&(t||!e.includes(o))&&r.push(o);var s=o.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(o),u=!ia(s,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(o));if(s&&u){var c=iu(!0===s?o.children:s.children,!0,n);n.flatten?r.push.apply(r,c):r.push({scopeParent:o,candidates:c})}else i.unshift.apply(i,o.children)}}return r},ic=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},id=function(e){if(!e)throw Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||il(e))&&!ic(e)?0:e.tabIndex},ip=function(e,t){var n=id(e);return n<0&&t&&!ic(e)?0:n},im=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ih=function(e){return"INPUT"===e.tagName},ig=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},iy=function(e){if(!e.name)return!0;var t,n=e.form||io(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("u">typeof window&&"u">typeof window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var i=ig(t,e.form);return!i||i===e},iv=function(e){return ih(e)&&"radio"===e.type&&!iy(e)},ix=function(e){var t,n,r,i,o,a,l,s=e&&io(e),u=null==(l=s)?void 0:l.host,c=!1;if(s&&s!==e)for(c=!!(null!=(t=u)&&null!=(n=t.ownerDocument)&&n.contains(u)||null!=e&&null!=(r=e.ownerDocument)&&r.contains(e));!c&&u;)c=!!(null!=(o=u=null==(i=s=io(u))?void 0:i.host)&&null!=(a=o.ownerDocument)&&a.contains(u));return c},ib=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},iw=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var i=ii.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ii.call(i,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ib(e)}else{if("function"==typeof r){for(var o=e;e;){var a=e.parentElement,l=io(e);if(a&&!a.shadowRoot&&!0===r(a))return ib(e);e=e.assignedSlot?e.assignedSlot:a||l===e.ownerDocument?a:l.host}e=o}if(ix(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ij=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!ii.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1},iS=function(e,t){return!(t.disabled||ih(t)&&"hidden"===t.type||iw(t,e)||"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some(function(e){return"SUMMARY"===e.tagName})||ij(t))},iE=function(e,t){return!(iv(t)||0>id(t)||!iS(e,t))},ik=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},iO=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,o=i?e.scopeParent:e,a=ip(o,i),l=i?iO(e.candidates):o;0===a?i?t.push.apply(t,l):t.push(o):n.push({documentOrder:r,tabIndex:a,item:e,isScope:i,content:l})}),n.sort(im).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},iC=function(e,t){return iO((t=t||{}).getShadowRoot?iu([e],t.includeContainer,{filter:iE.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ik}):is(e,t.includeContainer,iE.bind(null,t)))},iI=function(e,t){if(t=t||{},!e)throw Error("No node provided");return!1!==ii.call(e,it)&&iE(t,e)};let iR=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function iT(e,t){let n=iC(e,iR()),r=n.length;if(0===r)return;let i=n0(n4(e)),o=n.indexOf(i);return n[-1===o?1===t?0:r-1:o+t]}function iP(e){return iT(n4(e).body,1)||e}function iN(e){return iT(n4(e).body,-1)||e}function iA(e,t){if(!e)return null;let n=iC(n4(e).body,iR()),r=n.length;if(0===r)return null;let i=n.indexOf(e);return -1===i?null:n[(i+t+r)%r]}function iM(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!n1(n,r)}
3function iL(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}let iD=x.createContext(null),i$=()=>x.useContext(iD),iq=n_("portal"),iU=x.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:l,...s}=e,{portalNode:u,portalSubtree:c}=function(e={}){let{ref:t,container:n,componentProps:r=tP,elementProps:i,elementState:o}=e,a=eG(),l=i$(),s=null==l?void 0:l.portalNode,[u,c]=x.useState(null),[d,p]=x.useState(null),f=eK(e=>{null!==e&&p(e)}),m=x.useRef(null);eJ(()=>{if(null===n){m.current&&(m.current=null,p(null),c(null));return}if(null==a)return;let e=(n&&(e8(n)?n:n.current))??s??document.body;if(null==e){m.current&&(m.current=null,p(null),c(null));return}m.current!==e&&(m.current=e,p(null),c(e))},[n,s,a]);let h=ie("div",r,{ref:[t,f],state:o,props:[{id:a,[iq]:""},i]});return{portalNode:d,portalSubtree:u&&h?eA.createPortal(h,u):null}}({container:r,ref:t,componentProps:e,elementProps:s}),d=x.useRef(null),p=x.useRef(null),f=x.useRef(null),m=x.useRef(null),[h,g]=x.useState(null),y=null==h?void 0:h.modal,v=null==h?void 0:h.open,b="boolean"==typeof l?l:!!h&&!h.modal&&h.open&&!!u;x.useEffect(()=>{if(u&&!y)return u.addEventListener("focusin",e,!0),u.addEventListener("focusout",e,!0),()=>{u.removeEventListener("focusin",e,!0),u.removeEventListener("focusout",e,!0)};function e(e){u&&e.relatedTarget&&iM(e)&&("focusin"===e.type?iL:function(e){iC(e,iR()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})})(u)}},[u,y]),x.useEffect(()=>{!u||v||iL(u)},[v,u]);let w=x.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:p,beforeInsideRef:f,afterInsideRef:m,portalNode:u,setFocusManagerState:g}),[u]);return(0,o.jsxs)(x.Fragment,{children:[c,(0,o.jsxs)(iD.Provider,{value:w,children:[b&&u&&(0,o.jsx)(r6,{"data-type":"outside",ref:d,onFocus:e=>{var t;if(iM(e,u))null==(t=f.current)||t.focus();else{let e=iN(h?h.domReference:null);null==e||e.focus()}}}),b&&u&&(0,o.jsx)("span",{"aria-owns":u.id,style:tH}),u&&eA.createPortal(n,u),b&&u&&(0,o.jsx)(r6,{"data-type":"outside",ref:p,onFocus:e=>{var t;if(iM(e,u))null==(t=m.current)||t.focus();else{let t=iP(h?h.domReference:null);null==t||t.focus(),null!=h&&h.closeOnFocusOut&&(null==h||h.onOpenChange(!1,tX(rr,e.nativeEvent)))}}})]})]})}),iB=x.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=tB();return i.useState("mounted")||n?(0,o.jsx)(r5.Provider,{value:n,children:(0,o.jsx)(iU,{ref:t,...r})}):null}),iF=x.createContext(void 0);function iz(e){let t=x.useContext(iF);if(void 0===t&&!e)throw Error(tq(33));return t}function i_(e,t,n){let r,{reference:i,floating:o}=e,a=rC(t),l=rE(rC(t)),s=rk(l),u=rj(t),c="y"===a,d=i.x+i.width/2-o.width/2,p=i.y+i.height/2-o.height/2,f=i[s]/2-o[s]/2;switch(u){case"top":r={x:d,y:i.y-o.height};break;case"bottom":r={x:d,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:p};break;case"left":r={x:i.x-o.width,y:p};break;default:r={x:i.x,y:i.y}}switch(rS(t)){case"start":r[l]-=f*(n&&c?-1:1);break;case"end":r[l]+=f*(n&&c?-1:1)}return r}let iK=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,l=o.filter(Boolean),s=await (null==a.isRTL?void 0:a.isRTL(t)),u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=i_(u,r,s),p=r,f={},m=0;for(let n=0;n<l.length;n++){let{name:o,fn:h}=l[n],{x:g,y:y,data:v,reset:x}=await h({x:c,y:d,initialPlacement:r,placement:p,strategy:i,middlewareData:f,re
3cts:u,platform:a,elements:{reference:e,floating:t}});c=g??c,d=y??d,f={...f,[o]:{...f[o],...v}},x&&m<=50&&(m++,"object"==typeof x&&(x.placement&&(p=x.placement),x.rects&&(u=!0===x.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:c,y:d}=i_(u,p,s)),n=-1)}return{x:c,y:d,placement:p,strategy:i,middlewareData:f}};async function iW(e,t){var n;void 0===t&&(t={});let{x:r,y:i,platform:o,rects:a,elements:l,strategy:s}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=rw(t,e),m=rM(f),h=l[p?"floating"===d?"reference":"floating":d],g=rL(await o.getClippingRect({element:null==(n=await (null==o.isElement?void 0:o.isElement(h)))||n?h:h.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(l.floating)),boundary:u,rootBoundary:c,strategy:s})),y="floating"===d?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,v=await (null==o.getOffsetParent?void 0:o.getOffsetParent(l.floating)),x=await (null==o.isElement?void 0:o.isElement(v))&&await (null==o.getScale?void 0:o.getScale(v))||{x:1,y:1},b=rL(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:s}):y);return{top:(g.top-b.top+m.top)/x.y,bottom:(b.bottom-g.bottom+m.bottom)/x.y,left:(g.left-b.left+m.left)/x.x,right:(b.right-g.right+m.right)/x.x}}function iH(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function iV(e){return rf.some(t=>e[t]>=0)}let iY=new Set(["left","top"]);async function iX(e,t){let{placement:n,platform:r,elements:i}=e,o=await (null==r.isRTL?void 0:r.isRTL(i.floating)),a=rj(n),l=rS(n),s="y"===rC(n),u=iY.has(a)?-1:1,c=o&&s?-1:1,d=rw(t,e),{mainAxis:p,crossAxis:f,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&"number"==typeof m&&(f="end"===l?-1*m:m),s?{x:f*c,y:p*u}:{x:p*u,y:f*c}}function iG(e){let t=tf(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=e7(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,l=rg(n)!==o||rg(r)!==a;return l&&(n=o,r=a),{width:n,height:r,$:l}}function iJ(e){return e9(e)?e:e.contextElement}function iQ(e){let t=iJ(e);if(!e7(t))return rv(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:o}=iG(t),a=(o?rg(n.width):n.width)/r,l=(o?rg(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}let iZ=rv(0);function i0(e){let t=e6(e);return tc()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:iZ}function i1(e,t,n,r){var i;void 0===t&&(t=!1),void 0===n&&(n=!1);let o=e.getBoundingClientRect(),a=iJ(e),l=rv(1);t&&(r?e9(r)&&(l=iQ(r)):l=iQ(e));let s=(void 0===(i=n)&&(i=!1),r&&(!i||r===e6(a))&&i)?i0(a):rv(0),u=(o.left+s.x)/l.x,c=(o.top+s.y)/l.y,d=o.width/l.x,p=o.height/l.y;if(a){let e=e6(a),t=r&&e9(r)?e6(r):r,n=e,i=ty(n);for(;i&&r&&t!==n;){let e=iQ(i),t=i.getBoundingClientRect(),r=tf(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,c*=e.y,d*=e.x,p*=e.y,u+=o,c+=a,i=ty(n=e6(i))}}return rL({width:d,height:p,x:u,y:c})}function i2(e,t){let n=tm(e).scrollLeft;return t?t.left+n:i1(e3(e)).left+n}function i5(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-i2(e,n),y:n.top+t.scrollTop}}let i4=new Set(["absolute","fixed"]);function i6(e,t,n){let r;if("viewport"===t)r=function(e,t){let n=e6(e),r=e3(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,l=0,s=0;if(i){o=i.width,a=i.height;let e=tc();(!e||e&&"fixed"===t)&&(l=i.offsetLeft,s=i.offsetTop)}let u=i2(r);if(u<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-i);a<=25&&(o-=a)}else u<=25&&(o+=u);return{width:o,height:a,x:l,y:s}}(e,n);else if("document"===t)r=function(e){let t=e3(e),n=tm(e),r=e.ownerDocument.body,i=rh(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=rh(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),a=-n.scrollLeft+i2(e),l=-n.scrollTop;return"rtl"===tf(r).direction&&(a+=rh(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:l}}(e3(e));else if(e9(t))r=function(e,t){let n=i1(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=e7(e)?iQ(e):rv(1),a=e.clientWidth*o.x,l=e.clientHeight*o.y;return{width:a,height:l,x:i*o.x,y:r*o.y}}(t,n);else{let n=i0(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return rL(r)}function i3(e){return"static"===tf(e).position}function i8(e,t){if(!e7(e)||"fixed"===tf(e).position)return null;if(t)return t(e);let n=e.offsetParent;return e3(e)===n&&(n=n.ownerDocument.body),n}function i9(e,t){var n;let r=e6(e);if(to(e))return r;if(!e7(e)){let t=th(e);for(;t&&!tp(t);){if(e9(t)&&!i3(t))return t;t=th(t)}return r}let i=i8(e,t);for(;i&&(n=i,tr.has(e4(n)))&&i3(i);)i=i8(i,t);return i&&tp(i)&&i3(i)&&!tu(i)?r:i||function(e){let t=th(e);for(;e7(t)&&!tp(t);){if(tu(t))return t;if(to(t))break;t=th(t)}return null}(e)||r}let i7=async function(e){let t=this.getOffsetParent||i9,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=e7(t),i=e3(t),o="fixed"===n,a=i1(e,!0,o,t),l={scrollLeft:0,scrollTop:0},s=rv(0);if(r||!r&&!o)if(("body"!==e4(t)||tn(i))&&(l=tm(t)),r){let e=i1(t,!0,o,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=i2(i));o&&!r&&i&&(s.x=i2(i));let u=!i||r||o?rv(0):i5(i,l);
3return{x:a.left+l.scrollLeft-s.x-u.x,y:a.top+l.scrollTop-s.y-u.y,width:a.width,height:a.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},oe={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,o="fixed"===i,a=e3(r),l=!!t&&to(t.floating);if(r===a||l&&o)return n;let s={scrollLeft:0,scrollTop:0},u=rv(1),c=rv(0),d=e7(r);if((d||!d&&!o)&&(("body"!==e4(r)||tn(a))&&(s=tm(r)),e7(r))){let e=i1(r);u=iQ(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}let p=!a||d||o?rv(0):i5(a,s);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+c.x+p.x,y:n.y*u.y-s.scrollTop*u.y+c.y+p.y}},getDocumentElement:e3,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,o=[..."clippingAncestors"===n?to(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=tg(e,[],!1).filter(e=>e9(e)&&"body"!==e4(e)),i=null,o="fixed"===tf(e).position,a=o?th(e):e;for(;e9(a)&&!tp(a);){let t=tf(a),n=tu(a);n||"fixed"!==t.position||(i=null),(o?!n&&!i:!n&&"static"===t.position&&!!i&&i4.has(i.position)||tn(a)&&!n&&function e(t,n){let r=th(t);return!(r===n||!e9(r)||tp(r))&&("fixed"===tf(r).position||e(r,n))}(e,a))?r=r.filter(e=>e!==a):i=t,a=th(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((e,n)=>{let r=i6(t,n,i);return e.top=rh(r.top,e.top),e.right=rm(r.right,e.right),e.bottom=rm(r.bottom,e.bottom),e.left=rh(r.left,e.left),e},i6(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:i9,getElementRects:i7,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=iG(e);return{width:t,height:n}},getScale:iQ,isElement:e9,isRTL:function(e){return"rtl"===tf(e).direction}};function ot(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function on(e,t,n,r){void 0===r&&(r={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,u=iJ(e),c=i||o?[...u?tg(u):[],...tg(t)]:[];c.forEach(e=>{i&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});let d=u&&l?function(e,t){let n=null,r,i=e3(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function a(l,s){void 0===l&&(l=!1),void 0===s&&(s=1),o();let u=e.getBoundingClientRect(),{left:c,top:d,width:p,height:f}=u;if(l||t(),!p||!f)return;let m=ry(d),h=ry(i.clientWidth-(c+p)),g={rootMargin:-m+"px "+-h+"px "+-ry(i.clientHeight-(d+f))+"px "+-ry(c)+"px",threshold:rh(0,rm(1,s))||1},y=!0;function v(t){let n=t[0].intersectionRatio;if(n!==s){if(!y)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==n||ot(u,e.getBoundingClientRect())||a(),y=!1}try{n=new IntersectionObserver(v,{...g,root:i.ownerDocument})}catch{n=new IntersectionObserver(v,g)}n.observe(e)}(!0),o}(u,n):null,p=-1,f=null;a&&(f=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),u&&!s&&f.observe(u),f.observe(t));let m,h=s?i1(e):null;return s&&function t(){let r=i1(e);h&&!ot(h,r)&&n(),h=r,m=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{i&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=f)||e.disconnect(),f=null,s&&cancelAnimationFrame(m)}}var or="u">typeof document?x.useLayoutEffect:function(){};function oi(e,t){let n,r,i;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!oi(e[r],t[r]))return!1;return!0}if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){let n=i[r];if(!("_owner"===n&&e.$$typeof)&&!oi(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function oo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function oa(e,t){let n=oo(e);return Math.round(t*n)/n}function ol(e){let t=x.useRef(e);return or(()=>{t.current=e}),t}let os={name:"hide",async fn(e){var t,n;let r,i,{width:o,height:a,x:l,y:s}=e.rects.reference;return{data:{referenceHidden:(null==(t=(await ({...(void 0===(n=r)&&(n={}),{name:"hide",options:n,async fn(e){let{rects:t}=e,{strategy:r="referenceHidden",...i}=rw(n,e);switch(r){case"referenceHidden":{let n=iH(await iW(e,{...i,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:n,referenceHidden:iV(n)}}}case"escaped":{let n=iH(await iW(e,{...i,altBoundary:!0}),t.floating);return{data:{escapedOffsets:n,escaped:iV(n)}}}default:return{}}}}),options:[r,i]}).fn(e)).data)?void 0:t.referenceHidden)||0===o&&0===a&&0===l&&0===s}}}},ou={sideX:"left",sideY:"top"};function oc(e,t,n){let r="inline-start"===e||"inline-end"===e;return({top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"})[t]}
3function od(e,t,n){let{rects:r,placement:i}=e;return{side:oc(t,rj(i),n),align:rS(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function op(e){return null!=e&&"current"in e}let of=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=nU.startingStyle]="startingStyle",e[e.endingStyle=nU.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e}({}),om=function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e}({});om.popupOpen;let oh={[om.popupOpen]:"",[om.pressed]:""},og={[of.open]:""},oy={[of.closed]:""},ov={[of.anchorHidden]:""},ox={open:e=>e?oh:null},ob={open:e=>e?og:oy,anchorHidden:e=>e?ov:null},ow=x.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function oj(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=eK(i),l=x.useRef(0),s=eL(oE).current,u=eL(oS).current,[c,d]=x.useState(0),p=x.useRef(c),f=eK((e,t)=>{u.set(e,t??null),p.current+=1,d(p.current)}),m=eK(e=>{u.delete(e),p.current+=1,d(p.current)}),h=x.useMemo(()=>{let e=new Map;return Array.from(u.keys()).filter(e=>
3e.isConnected).sort(ok).forEach((t,n)=>{let r=u.get(t)??{};e.set(t,{...r,index:n})}),e},[u,c]);eJ(()=>{if("function"!=typeof MutationObserver||0===h.size)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),0===t.size&&(p.current+=1,d(p.current))});return h.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[h]),eJ(()=>{p.current===c&&(n.current.length!==h.size&&(n.current.length=h.size),r&&r.current.length!==h.size&&(r.current.length=h.size),l.current=h.size),a(h)},[a,h,n,r,c]),eJ(()=>()=>{n.current=[]},[n]),eJ(()=>()=>{r&&(r.current=[])},[r]);let g=eK(e=>(s.add(e),()=>{s.delete(e)}));eJ(()=>{s.forEach(e=>e(h))},[s,h]);let y=x.useMemo(()=>({register:f,unregister:m,subscribeMapChange:g,elementsRef:n,labelsRef:r,nextIndexRef:l}),[f,m,g,n,r,l]);return(0,o.jsx)(ow.Provider,{value:y,children:t})}function oS(){return new Map}function oE(){return new Set}function ok(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}let oO=x.forwardRef(function(e,t){let n,{cutout:r,...i}=e;if(r){let e=null==r?void 0:r.getBoundingClientRect();n=`polygon( 4 0% 0%, 5 100% 0%, 6 100% 100%, 7 0% 100%, 8 0% 0%, 9 ${e.left}px ${e.top}px, 10 ${e.left}px ${e.bottom}px, 11 ${e.right}px ${e.bottom}px, 12 ${e.right}px ${e.top}px, 13 ${e.left}px ${e.top}px 14 )`}return(0,o.jsx)("div",{ref:t,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:n}})}),oC=x.forwardRef(function(e,t){var n,r;let{anchor:i,positionMethod:a="absolute",className:l,render:s,side:u,align:c,sideOffset:d=0,alignOffset:p=0,collisionBoundary:f="clipping-ancestors",collisionPadding:m=5,arrowPadding:h=5,sticky:g=!1,disableAnchorTracking:y=!1,collisionAvoidance:v=tK,...b}=e,{store:w}=tB(),j=function(){let e=x.useContext(r5);if(void 0===e)throw Error(tq(32));return e}(),S=tJ(!0),E=w.useState("parent"),k=w.useState("floatingRootContext"),O=w.useState("floatingTreeRoot"),C=w.useState("mounted"),I=w.useState("open"),R=w.useState("modal"),T=w.useState("activeTriggerElement"),P=w.useState("lastOpenChangeReason"),N=w.useState("floatingNodeId"),A=w.useState("floatingParentNodeId"),M=i,L=d,D=p,$=c,q=v;"context-menu"===E.type&&(M=i??(null==(n=E.context)?void 0:n.anchor),$=$??"start",u||"center"===$||(D=e.alignOffset??2,L=e.sideOffset??-5));let U=u,B=$;"menu"===E.type?(U=U??"inline-end",B=B??"start",q=e.collisionAvoidance??tW):"menubar"===E.type&&(U=U??"bottom",B=B??"start");let F="context-menu"===E.type,z=function(e){var t,n,r,i,o,a;let l,s,u,c,d,p,f,m,h,g,{anchor:y,positionMethod:v="absolute",side:b="bottom",sideOffset:w=0,align:j="center",alignOffset:S=0,collisionBoundary:E,collisionPadding:k=5,sticky:O=!1,arrowPadding:C=5,disableAnchorTracking:I=!1,keepMounted:R=!1,floatingRootContext:T,mounted:P,collisionAvoidance:N,shiftCrossAxis:A=!1,nodeId:M,adaptiveOrigin:L,lazyFlip:D=!1,externalTree:$}=e,[q,U]=x.useState(null);P||null===q||U(null);let B=N.side||"flip",F=N.align||"flip",z=N.fallbackAxisSide||"end",_="function"==typeof y?y:void 0,K=eK(_),W=_?K:y,H=ru(y),V="rtl"===tY(),Y=q||({top:"top",right:"right",bottom:"bottom",left:"left","inline-end":V?"left":"right","inline-start":V?"right":"left"})[b],X="center"===j?Y:`${Y}-${j}`,G=k,J=+("bottom"===b),Q=+("top"===b),Z=+("right"===b),ee=+("left"===b);"number"==typeof G?G={top:G+J,right:G+ee,bottom:G+Q,left:G+Z}:G&&(G={top:(G.top||0)+J,right:(G.right||0)+ee,bottom:(G.bottom||0)+Q,left:(G.left||0)+Z});
14let et={boundary:"clipping-ancestors"===E?"clippingAncestors":E,padding:G},en=x.useRef(null),er=ru(w),ei=ru(S),eo=[(l=e=>{let t=od(e,b,V),n="function"==typeof er.current?er.current(t):er.current,r="function"==typeof ei.current?ei.current(t):ei.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},s=["function"!=typeof w?w:0,"function"!=typeof S?S:0,V,b],{...(void 0===(r=l)&&(r=0),{name:"offset",options:r,async fn(e){var t,n;let{x:i,y:o,placement:a,middlewareData:l}=e,s=await iX(e,r);return a===(null==(t=l.offset)?void 0:t.placement)&&null!=(n=l.arrow)&&n.alignmentOffset?{}:{x:i+s.x,y:o+s.y,data:{...s,placement:a}}}}),options:[l,s]})],ea="none"===F&&"shift"!==B,el=!ea&&(O||A||"shift"===B),es="none"===B?null:{...{name:"flip",options:i=u={...et,padding:{top:G.top+1,right:G.right+1,bottom:G.bottom+1,left:G.left+1},mainAxis:!A&&"flip"===B,crossAxis:"flip"===F&&"alignment",fallbackAxisSideDirection:z},async fn(e){var t,n,r,o,a;let{placement:l,middlewareData:s,rects:u,initialPlacement:c,platform:d,elements:p}=e,{mainAxis:f=!0,crossAxis:m=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...x}=rw(i,e);if(null!=(t=s.arrow)&&t.alignmentOffset)return{};let b=rj(l),w=rC(c),j=rj(c)===c,S=await (null==d.isRTL?void 0:d.isRTL(p.floating)),E=h||(j||!v?[rA(c)]:function(e){let t=rA(e);return[rI(e),t,rI(t)]}(c)),k="none"!==y;!h&&k&&E.push(...function(e,t,n,r){let i=rS(e),o=function(e,t,n){switch(e){case"top":case"bottom":return n?t?rT:rR:t?rR:rT;case"left":case"right":return t?rP:rN;default:return[]}}(rj(e),"start"===n,r);return i&&(o=o.map(e=>e+"-"+i),t&&(o=o.concat(o.map(rI)))),o}(c,v,y,S));let O=[c,...E],C=await iW(e,x),I=[],R=(null==(n=s.flip)?void 0:n.overflows)||[];if(f&&I.push(C[b]),m){let e=function(e,t,n){void 0===n&&(n=!1);let r=rS(e),i=rE(rC(e)),o=rk(i),a="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=rA(a)),[a,rA(a)]}(l,u,S);I.push(C[e[0]],C[e[1]])}if(R=[...R,{placement:l,overflows:I}],!I.every(e=>e<=0)){let e=((null==(r=s.flip)?void 0:r.index)||0)+1,t=O[e];if(t&&("alignment"!==m||w===rC(t)||R.every(e=>rC(e.placement)!==w||e.overflows[0]>0)))return{data:{index:e,overflows:R},reset:{placement:t}};let n=null==(o=R.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!n)switch(g){case"bestFit":{let e=null==(a=R.filter(e=>{if(k){let t=rC(e.placement);return t===w||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(n=e);break}case"initialPlacement":n=c}if(l!==n)return{reset:{placement:n}}}return{}}},options:[u,c]},eu=ea?null:(d=e=>{var t;let n,r,i=tI(e.elements.floating).documentElement;return{...et,rootBoundary:A?{x:0,y:0,width:i.clientWidth,height:i.clientHeight}:void 0,mainAxis:"none"!==F,crossAxis:el,limiter:O||A?void 0:{...(void 0===(t=n=e=>{if(!en.current)return{};let{width:t,height:n}=en.current.getBoundingClientRect(),r=rC(rj(e.placement)),i="y"===r?G.left+G.right:G.top+G.bottom;return{offset:("y"===r?t:n)/2+i/2}})&&(t={}),{options:t,fn(e){let{x:n,y:r,placement:i,rects:o,middlewareData:a}=e,{offset:l=0,mainAxis:s=!0,crossAxis:u=!0}=rw(t,e),c={x:n,y:r},d=rC(i),p=rE(d),f=c[p],m=c[d],h=rw(l,e),g="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(s){let e="y"===p?"height":"width",t=o.reference[p]-o.floating[e]+g.mainAxis,n=o.reference[p]+o.reference[e]-g.mainAxis;f<t?f=t:f>n&&(f=n)}if(u){var y,v;let e="y"===p?"width":"height",t=iY.has(rj(i)),n=o.reference[d]-o.floating[e]+(t&&(null==(y=a.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),r=o.reference[d]+o.reference[e]+(t?0:(null==(v=a.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[p]:f,[d]:m}}}),options:[n,r]}}},p=[et,O,A,G,F],{...(void 0===(o=d)&&(o={}),{name:"shift",options:o,async fn(e){let{x:t,y:n,placement:r}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=rw(o,e),u={x:t,y:n},c=await iW(e,s),d=rC(rj(r)),p=rE(d),f=u[p],m=u[d];
14if(i){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",n=f+c[e],r=f-c[t];f=rh(n,rm(f,r))}if(a){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",n=m+c[e],r=m-c[t];m=rh(n,rm(m,r))}let h=l.fn({...e,[p]:f,[d]:m});return{...h,data:{x:h.x-t,y:h.y-n,enabled:{[p]:i,[d]:a}}}}}),options:[d,p]});"shift"===B||"shift"===F||"center"===j?eo.push(eu,es):eo.push(es,eu),eo.push({...{name:"size",options:a=f={...et,apply({elements:{floating:e},rects:{reference:t},availableWidth:n,availableHeight:r}){Object.entries({"--available-width":`${n}px`,"--available-height":`${r}px`,"--anchor-width":`${t.width}px`,"--anchor-height":`${t.height}px`}).forEach(([t,n])=>{e.style.setProperty(t,n)})}},async fn(e){var t,n;let r,i,{placement:o,rects:l,platform:s,elements:u}=e,{apply:c=()=>{},...d}=rw(a,e),p=await iW(e,d),f=rj(o),m=rS(o),h="y"===rC(o),{width:g,height:y}=l.floating;"top"===f||"bottom"===f?(r=f,i=m===(await (null==s.isRTL?void 0:s.isRTL(u.floating))?"start":"end")?"left":"right"):(i=f,r="end"===m?"top":"bottom");let v=y-p.top-p.bottom,x=g-p.left-p.right,b=rm(y-p[r],v),w=rm(g-p[i],x),j=!e.middlewareData.shift,S=b,E=w;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(E=x),null!=(n=e.middlewareData.shift)&&n.enabled.y&&(S=v),j&&!m){let e=rh(p.left,0),t=rh(p.right,0),n=rh(p.top,0),r=rh(p.bottom,0);h?E=g-2*(0!==e||0!==t?e+t:rh(p.left,p.right)):S=y-2*(0!==n||0!==r?n+r:rh(p.top,p.bottom))}await c({...e,availableWidth:E,availableHeight:S});let k=await s.getDimensions(u.floating);return g!==k.width||y!==k.height?{reset:{rects:!0}}:{}}},options:[f,m]},(h=()=>({element:en.current||document.createElement("div"),padding:C,offsetParent:"floating"}),g=[C],{name:"arrow",options:h,async fn(e){var t,n;let{x:r,y:i,placement:o,rects:a,platform:l,elements:s,middlewareData:u}=e,{element:c,padding:d=0,offsetParent:p="real"}=rw(h,e)||{};if(null==c)return{};let f=rM(d),m={x:r,y:i},g=rE(rC(o)),y=rk(g),v=await l.getDimensions(c),x="y"===g,b=x?"clientHeight":"clientWidth",w=a.reference[y]+a.reference[g]-m[g]-a.floating[y],j=m[g]-a.reference[g],S="real"===p?await (null==(t=l.getOffsetParent)?void 0:t.call(l,c)):s.floating,E=s.floating[b]||a.floating[y];E&&await (null==(n=l.isElement)?void 0:n.call(l,S))||(E=s.floating[b]||a.floating[y]);let k=E/2-v[y]/2-1,O=Math.min(f[x?"top":"left"],k),C=Math.min(f[x?"bottom":"right"],k),I=E-v[y]-C,R=E/2-v[y]/2+(w/2-j/2),T=rh(O,rm(R,I)),P=!u.arrow&&null!=rS(o)&&R!==T&&a.reference[y]/2-(R<O?O:C)-v[y]/2<0,N=P?R<O?R-O:R-I:0;return{[g]:m[g]+N,data:{[g]:T,centerOffset:R-T-N,...P&&{alignmentOffset:N}},reset:P}},options:[h,g]}),{name:"transformOrigin",fn(e){var t,n,r;let{elements:i,middlewareData:o,placement:a,rects:l,y:s}=e,u=rj(a),c=rC(u),d=en.current,p=(null==(t=o.arrow)?void 0:t.x)||0,f=(null==(n=o.arrow)?void 0:n.y)||0,m=(null==d?void 0:d.clientWidth)||0,h=(null==d?void 0:d.clientHeight)||0,g=p+m/2,y=f+h/2,v=Math.abs((null==(r=o.shift)?void 0:r.y)||0),x=l.reference.height/2,j="function"==typeof w?w(od(e,b,V)):w,S=v>j,E={top:`${g}px calc(100% + ${j}px)`,bottom:`${g}px ${-j}px`,left:`calc(100% + ${j}px) ${y}px`,right:`${-j}px ${y}px`}[u],k=`${g}px ${l.reference.y+x-s}px`;return i.floating.style.setProperty("--transform-origin",el&&"y"===c&&S?k:E),{}}},os,L),eJ(()=>{!P&&T&&T.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[P,T]);let ec=x.useMemo(()=>({elementResize:!I&&"u">typeof ResizeObserver,layoutShift:!I&&"u">typeof IntersectionObserver}),[I]),{refs:ed,elements:ep,x:ef,y:em,middlewareData:eh,update:eg,placement:ey,context:ev,isPositioned:ex,floatingStyles:eb}=function(e={}){let{nodeId:t,externalTree:n}=e,r=function(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=eG(),o=null!=nA(),a=eL(()=>new nk({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:r.triggers??new nl,floatingId:i,nested:o,noEmit:e.noEmit||!1})).current;return eJ(()=>{let e={open:t,floatingId:i};void 0!==r.reference&&(e.referenceElement=r.reference,e.domReferenceElement=e9(r.reference)?r.reference:null),void 0!==r.floating&&(e.floatingElement=r.floating),a.update(e)},[t,i,r.reference,r.floating,a]),a.context.onOpenChange=n,a.context.nested=o,a.context.noEmit=e.noEmit||!1,a}(e),i=e.rootContext||r,o={reference:i.useState("referenceElement"),floating:i.useState("floatingElement"),domReference:i.useState("domReferenceElement")},[a,l]=x.useState(null),s=x.useRef(null),u=nM(n);eJ(()=>{o.domReference&&(s.current=o.domReference)},[o.domReference]);let c=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:l=!0,whileElementsMounted:s,open:u}=e,[c,d]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}
14),[p,f]=x.useState(r);oi(p,r)||f(r);let[m,h]=x.useState(null),[g,y]=x.useState(null),v=x.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),b=x.useCallback(e=>{e!==E.current&&(E.current=e,y(e))},[]),w=o||m,j=a||g,S=x.useRef(null),E=x.useRef(null),k=x.useRef(c),O=null!=s,C=ol(s),I=ol(i),R=ol(u),T=x.useCallback(()=>{if(!S.current||!E.current)return;let e={placement:t,strategy:n,middleware:p};I.current&&(e.platform=I.current),((e,t,n)=>{let r=new Map,i={platform:oe,...n},o={...i.platform,_c:r};return iK(e,t,{...i,platform:o})})(S.current,E.current,e).then(e=>{let t={...e,isPositioned:!1!==R.current};P.current&&!oi(k.current,t)&&(k.current=t,eA.flushSync(()=>{d(t)}))})},[p,t,n,I,R]);or(()=>{!1===u&&k.current.isPositioned&&(k.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[u]);let P=x.useRef(!1);or(()=>(P.current=!0,()=>{P.current=!1}),[]),or(()=>{if(w&&(S.current=w),j&&(E.current=j),w&&j){if(C.current)return C.current(w,j,T);T()}},[w,j,T,C,O]);let N=x.useMemo(()=>({reference:S,floating:E,setReference:v,setFloating:b}),[v,b]),A=x.useMemo(()=>({reference:w,floating:j}),[w,j]),M=x.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=oa(A.floating,c.x),r=oa(A.floating,c.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...oo(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,A.floating,c.x,c.y]);return x.useMemo(()=>({...c,update:T,refs:N,elements:A,floatingStyles:M}),[c,T,N,A,M])}({...e,elements:{...o,...a&&{reference:a}}}),d=x.useCallback(e=>{let t=e9(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;l(t),c.refs.setReference(t)},[c.refs]),[p,f]=x.useState(null),[m,h]=x.useState(null);i.useSyncedValue("referenceElement",p),i.useSyncedValue("domReferenceElement",e9(p)?p:null),i.useSyncedValue("floatingElement",m);let g=x.useCallback(e=>{(e9(e)||null===e)&&(s.current=e,f(e)),(e9(c.refs.reference.current)||null===c.refs.reference.current||null!==e&&!e9(e))&&c.refs.setReference(e)},[c.refs,f]),y=x.useCallback(e=>{h(e),c.refs.setFloating(e)},[c.refs]),v=x.useMemo(()=>({...c.refs,setReference:g,setFloating:y,setPositionReference:d,domReference:s}),[c.refs,g,y,d]),b=x.useMemo(()=>({...c.elements,domReference:o.domReference}),[c.elements,o.domReference]),w=i.useState("open"),j=i.useState("floatingId"),S=x.useMemo(()=>({...c,dataRef:i.context.dataRef,open:w,onOpenChange:i.setOpen,events:i.context.events,floatingId:j,refs:v,elements:b,nodeId:t,rootStore:i}),[c,v,b,t,i,w,j]);return eJ(()=>{i.context.dataRef.current.floatingContext=S;let e=null==u?void 0:u.nodesRef.current.find(e=>e.id===t);e&&(e.context=S)}),x.useMemo(()=>({...c,context:S,refs:v,elements:b,rootStore:i}),[c,v,b,S,i])}({rootContext:T,placement:X,middleware:eo,strategy:v,whileElementsMounted:R?void 0:(...e)=>on(...e,ec),nodeId:M,externalTree:$}),{sideX:ew,sideY:ej}=eh.adaptiveOrigin||ou,eS=ex?v:"fixed",eE=x.useMemo(()=>L?{position:eS,[ew]:ef,[ej]:em}:{position:eS,...eb},[L,eS,ew,ef,ej,em,eb]),ek=x.useRef(null);eJ(()=>{if(!P)return;let e=H.current,t="function"==typeof e?e():e,n=(op(t)?t.current:t)||null;n!==ek.current&&(ed.setPositionReference(n),ek.current=n)},[P,ed,W,H]),x.useEffect(()=>{if(!P)return;let e=H.current;"function"!=typeof e&&op(e)&&e.current!==ek.current&&(ed.setPositionReference(e.current),ek.current=e.current)},[P,ed,W,H]),x.useEffect(()=>{if(R&&P&&ep.domReference&&ep.floating)return on(ep.domReference,ep.floating,eg,ec)},[R,P,ep,eg,ec]);
14let eO=rj(ey),eC=oc(b,eO,V),eI=rS(ey)||"center",eR=!!(null!=(t=eh.hide)&&t.referenceHidden);eJ(()=>{D&&P&&ex&&U(eO)},[D,P,ex,eO]);let eT=x.useMemo(()=>{var e,t;return{position:"absolute",top:null==(e=eh.arrow)?void 0:e.y,left:null==(t=eh.arrow)?void 0:t.x}},[eh.arrow]),eP=(null==(n=eh.arrow)?void 0:n.centerOffset)!==0;return x.useMemo(()=>({positionerStyles:eE,arrowStyles:eT,arrowRef:en,arrowUncentered:eP,side:eC,align:eI,physicalSide:eO,anchorHidden:eR,refs:ed,context:ev,isPositioned:ex,update:eg}),[eE,eT,en,eP,eC,eI,eO,eR,ed,ev,ex,eg])}({anchor:M,floatingRootContext:k,positionMethod:S?"fixed":a,mounted:C,side:U,sideOffset:L,align:B,alignOffset:D,arrowPadding:F?0:h,collisionBoundary:f,collisionPadding:m,sticky:g,nodeId:N,keepMounted:j,disableAnchorTracking:y,collisionAvoidance:q,shiftCrossAxis:F,externalTree:O}),_=x.useMemo(()=>{let e={};return I||(e.pointerEvents="none"),{role:"presentation",hidden:!C,style:{...z.positionerStyles,...e}}},[I,C,z.positionerStyles]);x.useEffect(()=>{function e(e){e.open?(e.parentNodeId===N&&w.set("hoverEnabled",!1),e.nodeId!==N&&e.parentNodeId===w.select("floatingParentNodeId")&&w.setOpen(!1,tX(ra))):e.parentNodeId===N&&e.reason!==ra&&w.set("hoverEnabled",!0)}return O.events.on("menuopenchange",e),()=>{O.events.off("menuopenchange",e)}},[w,O.events,N]),x.useEffect(()=>{if(null!=w.select("floatingParentNodeId"))return O.events.on("menuopenchange",e),()=>{O.events.off("menuopenchange",e)};function e(e){if(e.open||e.nodeId!==w.select("floatingParentNodeId"))return;let t=e.reason??ra;w.setOpen(!1,tX(t))}},[O.events,w]),x.useEffect(()=>{function e(e){!I||e.nodeId!==w.select("floatingParentNodeId")||e.target&&T&&T!==e.target&&w.setOpen(!1,tX(ra))}return O.events.on("itemhover",e),()=>{O.events.off("itemhover",e)}},[O.events,I,T,w]),x.useEffect(()=>{let e={open:I,nodeId:N,parentNodeId:A,reason:w.select("lastOpenChangeReason")};O.events.emit("menuopenchange",e)},[O.events,I,w,N,A]);let K=x.useMemo(()=>({open:I,side:z.side,align:z.align,anchorHidden:z.anchorHidden,nested:"menu"===E.type}),[I,z.side,z.align,z.anchorHidden,E.type]),W=x.useMemo(()=>({side:z.side,align:z.align,arrowRef:z.arrowRef,arrowUncentered:z.arrowUncentered,arrowStyles:z.arrowStyles,nodeId:z.context.nodeId}),[z.side,z.align,z.arrowRef,z.arrowUncentered,z.arrowStyles,z.context.nodeId]),H=ie("div",e,{state:K,stateAttributesMapping:ob,ref:[t,w.useStateSetter("positionerElement")],props:[_,b]}),V=C&&"menu"!==E.type&&("menubar"!==E.type&&R&&P!==n7||"menubar"===E.type&&E.context.modal),Y=null;return"menubar"===E.type?Y=E.context.contentElement:void 0===E.type&&(Y=T),(0,o.jsxs)(iF.Provider,{value:W,children:[V&&(0,o.jsx)(oO,{ref:"context-menu"===E.type||"nested-context-menu"===E.type?E.context.internalBackdropRef:null,inert:(r=!I,nn>=19?r:r?"true":void 0),cutout:Y}),(0,o.jsx)(nD,{id:N,children:(0,o.jsx)(oj,{elementsRef:w.context.itemDomElements,labelsRef:w.context.itemLabels,children:H})})]})}),oI=x.createContext(void 0),oR="ArrowUp",oT="ArrowDown",oP="ArrowLeft",oN="ArrowRight",oA=new Set([oP,oN]),oM=([...new Set([...oA,...new Set([oR,oT])])],new Set([oR,oT,oP,oN,"Home","End"])),oL=n_("safe-polygon"),oD=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${nX}`;function o$(e){let t=x.useRef(void 0),n=x.useRef(!1),r=x.useRef(void 0),i=x.useRef(!0),o=x.useRef(!1),a=x.useRef(()=>{}),l=x.useRef(!1),s=eF(),u=eF(),c=x.useRef(void 0);return x.useMemo(()=>{let d=e.context.dataRef.current;return d.hoverInteractionState||(d.hoverInteractionState={pointerTypeRef:t,interactedInsideRef:n,handlerRef:r,blockMouseMoveRef:i,performedPointerEventsMutationRef:o,unbindMouseMoveRef:a,restTimeoutPendingRef:l,openChangeTimeout:s,restTimeout:u,handleCloseOptionsRef:c}),d.hoverInteractionState},[e,t,n,r,i,o,a,l,s,u,c])}let oq=new Set(["click","mousedown"]),oU={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function oB(e){return"inert"===e?oU.inert:"aria-hidden"===e?oU["aria-hidden"]:oU.none}let oF=new WeakSet,oz={},o_=0,oK=e=>e&&(e.host||oK(e.parentNode)),oW=[];function oH(){oW=oW.filter(e=>e.isConnected)}function oV(){return oH(),oW[oW.length-1]}function oY(e,t){var n,r,i;if(!t.current.includes("floating")&&!(null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;let o=iR(),a=(r=e,(i=(i=o)||{}).getShadowRoot?iu([r],i.includeContainer,{filter:iS.bind(null,i),flatten:!0,getShadowRoot:i.getShadowRoot}):is(r,i.includeContainer,iS.bind(null,i))).filter(e=>{let t=e.getAttribute("data-tabindex")||"";return iI(e,o)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),l=e.getAttribute("tabindex");t.current.includes("floating")||0===a.length?"0"!==l&&e.setAttribute("tabindex","0"):("-1"!==l||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}
14function oX(e){let{context:t,children:n,disabled:r=!1,order:i=["content"],initialFocus:a=!0,returnFocus:l=!0,restoreFocus:s=!1,modal:u=!0,closeOnFocusOut:c=!0,openInteractionType:d="",getInsideElements:p=()=>[],nextFocusableElement:f,previousFocusableElement:m,beforeContentFocusGuardRef:h,externalTree:g}=e,y="rootStore"in t?t.rootStore:t,v=y.useState("open"),b=y.useState("domReferenceElement"),w=y.useState("floatingElement"),{events:j,dataRef:S}=y.context,E=eK(()=>{var e;return null==(e=S.current.floatingContext)?void 0:e.nodeId}),k=eK(p),O=!1===a,C=n3(b)&&O,I=ru(i),R=ru(a),T=ru(l),P=ru(d),N=nM(g),A=i$(),M=x.useRef(null),L=x.useRef(null),D=x.useRef(!1),$=x.useRef(!1),q=x.useRef(!1),U=x.useRef(-1),B=x.useRef(""),F=x.useRef(""),z=x.useRef(null),_=x.useRef(null),K=r3(z,h,null==A?void 0:A.beforeInsideRef),W=r3(_,null==A?void 0:A.afterInsideRef),H=eF(),V=eF(),Y=e2(),X=null!=A,G=n8(w),J=eK((e=G)=>e?iC(e,iR()):[]),Q=eK(e=>{let t=J(e);return I.current.map(()=>t).filter(Boolean).flat()});x.useEffect(()=>{if(r||!u)return;function e(e){"Tab"===e.key&&n1(G,n0(n4(G)))&&0===J().length&&!C&&ns(e)}let t=n4(G);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,b,G,u,I,C,J,Q]),x.useEffect(()=>{if(!r&&w)return w.addEventListener("focusin",e),()=>{w.removeEventListener("focusin",e)};function e(e){let t=n2(e),n=J().indexOf(t);-1!==n&&(U.current=n)}},[r,w,J]),x.useEffect(()=>{if(r||!v)return;let e=n4(G);function t(){q.current=!1}function n(e){let t=n2(e);q.current=!(n1(w,t)||n1(b,t)||n1(null==A?void 0:A.portalNode,t)),F.current=e.pointerType||"keyboard"}function i(){F.current="keyboard"}return e.addEventListener("pointerdown",n,!0),e.addEventListener("pointerup",t,!0),e.addEventListener("pointercancel",t,!0),e.addEventListener("keydown",i,!0),()=>{e.removeEventListener("pointerdown",n,!0),e.removeEventListener("pointerup",t,!0),e.removeEventListener("pointercancel",t,!0),e.removeEventListener("keydown",i,!0)}},[r,w,b,G,v,A]),x.useEffect(()=>{if(r||!c)return;function e(){$.current=!0,V.start(0,()=>{$.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=n2(e);queueMicrotask(()=>{let i=E(),o=y.context.triggerElements,a=(null==t?void 0:t.hasAttribute(n_("focus-guard")))&&[z.current,_.current,null==A?void 0:A.beforeInsideRef.current,null==A?void 0:A.afterInsideRef.current,null==A?void 0:A.beforeOutsideRef.current,null==A?void 0:A.afterOutsideRef.current,nq(m),nq(f)].includes(t),l=!(n1(b,t)||n1(w,t)||n1(t,w)||n1(null==A?void 0:A.portalNode,t)||null!=t&&o.hasElement(t)||o.hasMatchingElement(e=>n1(e,t))||a||N&&(nK(N.nodesRef.current,i).find(e=>{var n,r;return n1(null==(n=e.context)?void 0:n.elements.floating,t)||n1(null==(r=e.context)?void 0:r.elements.domReference,t)})||nW(N.nodesRef.current,i).find(e=>{var n,r,i;return[null==(n=e.context)?void 0:n.elements.floating,n8(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(i=e.context)?void 0:i.elements.domReference)===t})));if(n===b&&G&&oY(G,I),s&&n!==b&&!(r&&r.isConnected&&("function"==typeof r.checkVisibility?r.checkVisibility():"none"!==tf(r).display))&&n0(n4(G))===n4(G).body){if(e7(G)&&(G.focus(),"popup"===s))return void Y.request(()=>{G.focus()});let e=U.current,t=J(),n=t[e]||t[t.length-1]||G;e7(n)&&n.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(C||!u)&&t&&l&&!$.current&&(C||t!==oV())&&(D.current=!0,y.setOpen(!1,tX(rr,e)))})}function n(){q.current||(S.current.insideReactTree=!0,H.start(0,()=>{S.current.insideReactTree=!1}))}let i=e7(b)?b:null,o=[];if(!(!w&&!i))return i&&(i.addEventListener("focusout",t),i.addEventListener("pointerdown",e),o.push(()=>{i.removeEventListener("focusout",t),i.removeEventListener("pointerdown",e)})),w&&(w.addEventListener("focusout",t),A&&(w.addEventListener("focusout",n,!0),o.push(()=>{w.removeEventListener("focusout",n,!0)})),o.push(()=>{w.removeEventListener("focusout",t)})),()=>{o.forEach(e=>{e()})}},[r,b,w,G,u,N,A,y,c,s,J,C,E,I,S,H,V,Y,f,m]),x.useEffect(()=>{var e,t,n;if(r||!w||!v)return;let i=Array.from((null==(e=null==A?void 0:A.portalNode)?void 0:e.querySelectorAll(`[${n_("portal")}]`))||[]),o=function(e,t=!1,n=!1){let r=n4(e[0]).body;return function(e,t,n,r){let i="data-base-ui-inert",o=r?"inert":n?"aria-hidden":null,a=e.map(e=>{if(t.contains(e))return e;let n=oK(e);return t.contains(n)?n:null}).filter(e=>
14null!=e),l=new Set,s=new Set(a),u=[];oz[i]||(oz[i]=new WeakMap);let c=oz[i];return a.forEach(function e(t){!t||l.has(t)||(l.add(t),t.parentNode&&e(t.parentNode))}),function e(t){!t||s.has(t)||[].forEach.call(t.children,t=>{if("script"!==e4(t))if(l.has(t))e(t);else{let e=o?t.getAttribute(o):null,n=null!==e&&"false"!==e,r=oB(o),a=(r.get(t)||0)+1,l=(c.get(t)||0)+1;r.set(t,a),c.set(t,l),u.push(t),1===a&&n&&oF.add(t),1===l&&t.setAttribute(i,""),!n&&o&&t.setAttribute(o,"inert"===o?"":"true")}})}(t),l.clear(),o_+=1,()=>{u.forEach(e=>{let t=oB(o),n=(t.get(e)||0)-1,r=(c.get(e)||0)-1;t.set(e,n),c.set(e,r),n||(!oF.has(e)&&o&&e.removeAttribute(o),oF.delete(e)),r||e.removeAttribute(i)}),(o_-=1)||(oU.inert=new WeakMap,oU["aria-hidden"]=new WeakMap,oU.none=new WeakMap,oF=new WeakSet,oz={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}([w,null==(n=null==(t=(N?nW(N.nodesRef.current,E()):[]).find(e=>{var t;return n3((null==(t=e.context)?void 0:t.elements.domReference)||null)}))?void 0:t.context)?void 0:n.elements.domReference,...i,...k(),M.current,L.current,z.current,_.current,null==A?void 0:A.beforeOutsideRef.current,null==A?void 0:A.afterOutsideRef.current,nq(m),nq(f),C?b:null].filter(e=>null!=e),u||C);return()=>{o()}},[v,r,b,w,u,I,A,C,N,E,k,f,m]),eJ(()=>{if(!v||r||!e7(G))return;let e=n0(n4(G));queueMicrotask(()=>
14{let t,n=Q(G),r=R.current,i="function"==typeof r?r(P.current||""):r;void 0!==i&&!1!==i&&(t=(t=!0===i||null===i?n[0]||G:nq(i))||n[0]||G,n1(G,e)||rp(t,{preventScroll:t===G}))})},[r,v,G,O,Q,R,P]),eJ(()=>{var e;if(r||!G)return;let t=n4(G);function n(e){if(e.open||(B.current=function(e,t){let n=e6(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(0===e.detail?"keyboard":"mouse"):""}(e.nativeEvent,F.current)),e.reason===n7&&"mouseleave"===e.nativeEvent.type&&(D.current=!0),e.reason===rt)if(e.nested)D.current=!1;else if(nu(e.nativeEvent)||nc(e.nativeEvent))D.current=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),e?D.current=!1:D.current=!0}}e=n0(t),oH(),e&&"body"!==e4(e)&&(oW.push(e),oW.length>20&&(oW=oW.slice(-20))),j.on("openchange",n);let i=t.createElement("span");return i.setAttribute("tabindex","-1"),i.setAttribute("aria-hidden","true"),Object.assign(i.style,r4),X&&b&&b.insertAdjacentElement("afterend",i),()=>{j.off("openchange",n);let e=n0(t),r=n1(w,e)||N&&nK(N.nodesRef.current,E(),!1).some(t=>{var n;return n1(null==(n=t.context)?void 0:n.elements.floating,e)}),o=function(){let e=T.current,t="function"==typeof e?e(B.current):e;if(void 0===t||!1===t)return null;if(null===t&&(t=!0),"boolean"==typeof t){let e=b||oV();return e&&e.isConnected?e:i}let n=b||oV()||i;return nq(t)||n}();queueMicrotask(()=>{let n=function(e){if(!e)return null;let t=iR();return iI(e,t)?e:iC(e,t)[0]||e}(o),a="boolean"!=typeof T.current;T.current&&!D.current&&e7(n)&&(!(!a&&n!==e&&e!==t.body)||r)&&n.focus({preventScroll:!0}),i.remove()})}},[r,w,G,T,S,j,N,X,b,E]),x.useEffect(()=>{queueMicrotask(()=>{D.current=!1})},[r]),x.useEffect(()=>{if(r||!v)return;function e(e){let t=n2(e);null!=t&&t.closest("[data-base-ui-click-trigger]")&&($.current=!0)}let t=n4(G);return t.addEventListener("pointerdown",e,!0),()=>{t.removeEventListener("pointerdown",e,!0)}},[r,v,G]),eJ(()=>{if(!r&&A)return A.setFocusManagerState({modal:u,closeOnFocusOut:c,open:v,onOpenChange:y.setOpen,domReference:b}),()=>{A.setFocusManagerState(null)}},[r,A,u,v,y,c,b]),eJ(()=>{if(!(r||!G))return oY(G,I),()=>{queueMicrotask(oH)}},[r,G,I]);let Z=!r&&(!u||!C)&&(X||u);return(0,o.jsxs)(x.Fragment,{children:[Z&&(0,o.jsx)(r6,{"data-type":"inside",ref:K,onFocus:e=>{var t;if(u){let e=Q();rp(e[e.length-1])}else if(null!=A&&A.portalNode)if(D.current=!1,iM(e,A.portalNode)){let e=iP(b);null==e||e.focus()}else null==(t=nq(m??A.beforeOutsideRef))||t.focus()}}),n,Z&&(0,o.jsx)(r6,{"data-type":"inside",ref:W,onFocus:e=>{var t;if(u)rp(Q()[0]);else if(null!=A&&A.portalNode)if(c&&(D.current=!0),iM(e,A.portalNode)){let e=iN(b);null==e||e.focus()}else null==(t=nq(f??A.afterOutsideRef))||t.focus()}})]})}let oG={...ob,transitionStatus:e=>"starting"===e?nB:"ending"===e?nF:null},oJ=x.forwardRef(function(e,t){let{render:n,className:r,finalFocus:i,...a}=e,{store:l}=tB(),{side:s,align:u}=iz(),c=null!=x.useContext(oI),d=l.useState("open"),p=l.useState("transitionStatus"),f=l.useState("popupProps"),m=l.useState("mounted"),h=l.useState("instantType"),g=l.useState("activeTriggerElement"),y=l.useState("parent"),v=l.useState("lastOpenChangeReason"),b=l.useState("rootId"),w=l.useState("floatingRootContext"),j=l.useState("floatingTreeRoot"),S=l.useState("closeDelay"),E=l.useState("activeTriggerElement"),k="context-menu"===y.type;nz({open:d,ref:l.context.popupRef,onComplete(){var e,t;d&&(null==(t=(e=l.context).onOpenChangeComplete)||t.call(e,!0))}}),x.useEffect(()=>{function e(e){l.setOpen(!1,tX(e.reason,e.domEvent))}return j.events.on("close",e),()=>{j.events.off("close",e)}},[j.events,l]);let O=l.useState("hoverEnabled"),C=l.useState("disabled");!function(e,t={}){let n="rootStore"in e?e.rootStore:e,r=n.useState("open"),i=n.useState("floatingElement"),o=n.useState("domReferenceElement"),{dataRef:a}=n.context,{enabled:l=!0,closeDelay:s=0,externalTree:u}=t,{pointerTypeRef:c,interactedInsideRef:d,handlerRef:p,performedPointerEventsMutationRef:f,unbindMouseMoveRef:m,restTimeoutPendingRef:h,openChangeTimeout:g,handleCloseOptionsRef:y}=o$(n),v=nM(u),b=nA(),w=eK(()=>!!d.current||!!a.current.openEvent&&oq.has(a.current.openEvent.type)),j=eK(()=>{var e;let t=null==(e=a.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),S=x.useCallback((e,t=!0)=>{var r,i;let o=(r=s,(i=c.current)&&!nd(i)?0:"function"==typeof r?r():r);o&&!p.current?g.start(o,()=>n.setOpen(!1,tX(n7,e))):t&&(g.clear(),n.setOpen(!1,tX(n7,e)))},[s,p,n,c,g]),E=eK(()=>{m.current(),p.current=void 0}),k=eK(()=>
14{if(f.current){let e=n4(i).body;e.style.pointerEvents="",e.removeAttribute(oL),f.current=!1}}),O=eK(e=>{var t;if(!((t=n2(e))&&t.closest(oD))){d.current=!1;return}d.current=!0});eJ(()=>{r||(c.current=void 0,h.current=!1,d.current=!1,E(),k())},[r,c,h,d,E,k]),x.useEffect(()=>()=>{E()},[E]),x.useEffect(()=>k,[k]),eJ(()=>{var e,t,n;if(l&&r&&null!=(e=y.current)&&e.blockPointerEvents&&j()&&e9(o)&&i){f.current=!0;let e=n4(i).body;e.setAttribute(oL,"");let r=null==(n=null==(t=null==v?void 0:v.nodesRef.current.find(e=>e.id===b))?void 0:t.context)?void 0:n.elements.floating;return r&&(r.style.pointerEvents=""),e.style.pointerEvents="none",o.style.pointerEvents="auto",i.style.pointerEvents="auto",()=>{e.style.pointerEvents="",o.style.pointerEvents="",i.style.pointerEvents=""}}},[l,r,o,i,y,j,v,b,f]),x.useEffect(()=>{if(l)return i&&(i.addEventListener("mouseleave",e),i.addEventListener("mouseenter",t),i.addEventListener("mouseleave",r),i.addEventListener("pointerdown",O,!0)),()=>{i&&(i.removeEventListener("mouseleave",e),i.removeEventListener("mouseenter",t),i.removeEventListener("mouseleave",r),i.removeEventListener("pointerdown",O,!0))};function e(e){if(w()||!a.current.floatingContext||!n.select("open"))return;let t=n.context.triggerElements;e.relatedTarget&&t.hasElement(e.relatedTarget)||(k(),E(),w()||S(e))}function t(e){var t;g.clear(),k(),null==(t=p.current)||t.call(p,e),E()}function r(e){w()||S(e,!1)}})}(w,{enabled:O&&!C&&!k&&"menubar"!==y.type,closeDelay:S});let I=ie("div",e,{state:x.useMemo(()=>({transitionStatus:p,side:s,align:u,open:d,nested:"menu"===y.type,instant:h}),[p,s,u,d,y.type,h]),ref:[t,l.context.popupRef],stateAttributesMapping:oG,props:[f,{onKeyDown(e){c&&oM.has(e.key)&&e.stopPropagation()}},"starting"===p?t_:tP,a,{"data-rootownerid":b}]}),R=void 0===y.type||k;return(g||"menubar"===y.type&&v!==rt)&&(R=!0),(0,o.jsx)(oX,{context:w,modal:k,disabled:!m,returnFocus:void 0===i?R:i,initialFocus:"menu"!==y.type,restoreFocus:!0,externalTree:"menubar"!==y.type?j:void 0,previousFocusableElement:E,nextFocusableElement:void 0===y.type?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:void 0===y.type?l.context.beforeContentFocusGuardRef:void 0,children:I})}),oQ=x.createContext(void 0);function oZ(e=!1){let t=x.useContext(oQ);if(void 0===t&&!e)throw Error(tq(16));return t}function o0(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0}=e,o=x.useRef(null),a=void 0!==oZ(!0),l=eK(()=>{let e=o.current;return!!((null==e?void 0:e.tagName)==="A"&&null!=e&&e.href)}),{props:s}=function(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:o}=e,a=r&&!1!==t,l=r&&!1===t;return{props:x.useMemo(()=>{let e={onKeyDown(e){n&&t&&"Tab"!==e.key&&e.preventDefault()}};return r||(e.tabIndex=i,!o&&n&&(e.tabIndex=t?i:-1)),(o&&(t||a)||!o&&n)&&(e["aria-disabled"]=n),o&&(!t||l)&&(e.disabled=n),e},[r,n,t,a,l,o,i])}}({focusableWhenDisabled:n,disabled:t,composite:a,tabIndex:r,isNativeButton:i}),u=x.useCallback(()=>{var e;let n=o.current;e7(e=n)&&"BUTTON"===e.tagName&&a&&t&&void 0===s.disabled&&n.disabled&&(n.disabled=!1)},[t,s.disabled,a]);return eJ(u,[u]),{getButtonProps:x.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:o,onKeyDown:a,onPointerDown:u,...c}=e;return rG({type:i?"button":void 0,onClick(e){if(t)return void e.preventDefault();null==n||n(e)},onMouseDown(e){t||null==r||r(e)},onKeyDown(e){if(t||(r0(e),null==a||a(e)),e.baseUIHandlerPrevented)return;let r=e.target===e.currentTarget&&!i&&!l()&&!t,o="Enter"===e.key,s=" "===e.key;r&&((s||o)&&e.preventDefault(),o&&(null==n||n(e)))},onKeyUp(e){t||(r0(e),null==o||o(e)),e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||t||" "!==e.key||null==n||n(e)},onPointerDown(e){if(t)return void e.preventDefault();null==u||u(e)}},i?void 0:{role:"button"},s,c)},[t,s,i,l]),buttonRef:eK(e=>{o.current=e,u()})}}let o1={type:"regular-item"};function o2(e){return eG(e,"base-ui")}let o5=function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e}({});function o4(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:o}=e,{register:a,unregister:l,subscribeMapChange:s,elementsRef:u,labelsRef:c,nextIndexRef:d}=x.useContext(ow),p=x.useRef(-1),[f,m]=x.useState(o??(i===o5.GuessFromOrder?()=>{if(-1===p.current){let e=d.current;d.current+=1,p.current=e}return p.current}:-1)),h=x.useRef(null),g=x.useCallback(e=>{var n;if(h.current=e,-1!==f&&null!==e&&(u.current[f]=e,c)){let i=void 0!==t;c.current[f]=i?t:(null==(n=null==r?void 0:r.current)?void 0:n.textContent)??e.textContent}},[f,u,c,t,r]);return eJ(()=>{if(null!=o)return;let e=h.current;if(e)return a(e,n),()=>{l(e)}},[o,a,l,n]),eJ(()=>{if(null==o)return s(e=>{var t;let n=h.current?null==(t=e.get(h.current))?void 0:t.index:null;null!=n&&m(n)})},[o,s,m]),x.useMemo(()=>({ref:g,index:f}),[f,g])}let o6=x.forwardRef(function(e,t){let{render:n,className:r,id:i,label:o,nativeButton:a=!1,disabled:l=!1,closeOnClick:s=!0,...u}=e,c=o4({label:o}),d=iz(!0),p=o2(i),{store:f}=tB(),m=f.useState("isActive",c.index),h=f.useState("itemProps"),{getItemProps:g,itemRef:y}=function(e){let{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:o,nativeButton:a,itemMetadata:l,nodeId:s}=e,u=x.useRef(null),c=tJ(!0),d=void 0!==c,{events:p}=o.useState("floatingTreeRoot"),{getButtonProps:f,buttonRef:m}=o0({disabled:n,focusableWhenDisabled:!0,native:a}),h=x.useCallback(e=>rG({id:i,role:"menuitem",tabIndex:r?0:-1,onMouseMove(e){s&&p.emit("itemhover",{nodeId:s,target:e.currentTarget})},onMouseEnter(){"submenu-trigger"===l.type&&l.setActive()},onKeyUp(e){" "===e.key&&o.context.typingRef.current&&e.preventBaseUIHandler()}
14,onClick(e){t&&p.emit("close",{domEvent:e,reason:rn})},onMouseUp(e){if(c){let t=c.initialCursorPointRef.current;if(c.initialCursorPointRef.current=null,d&&t&&1>=Math.abs(e.clientX-t.x)&&1>=Math.abs(e.clientY-t.y))return}u.current&&o.context.allowMouseUpTriggerRef.current&&(!d||2===e.button)&&"regular-item"===l.type&&u.current.click()}},e,f),[i,r,f,t,p,o,d,c,l,s]),g=r3(u,m);return x.useMemo(()=>({getItemProps:h,itemRef:g}),[h,g])}({closeOnClick:s,disabled:l,highlighted:m,id:p,store:f,nativeButton:a,nodeId:null==d?void 0:d.nodeId,itemMetadata:o1});return ie("div",e,{state:x.useMemo(()=>({disabled:l,highlighted:m}),[l,m]),props:[h,u,g],ref:[y,t,c.ref]})});function o3(e){let{render:t,className:n,state:r=tP,props:i=tT,refs:o=tT,metadata:a,stateAttributesMapping:l,tag:s="div",...u}=e,{compositeProps:c,compositeRef:d}=function(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=oZ(),{ref:i,index:o}=o4(e),a=n===o,l=x.useRef(null),s=r3(i,l);return{compositeProps:x.useMemo(()=>({tabIndex:a?0:-1,onFocus(){r(o)},onMouseMove(){let e=l.current;if(!t||!e)return;let n=e.hasAttribute("disabled")||"true"===e.ariaDisabled;a||n||e.focus()}}),[a,r,o,t]),compositeRef:s,index:o}}({metadata:a});return ie(s,e,{state:r,ref:[...o,d],props:[c,...i,u],stateAttributesMapping:l})}function o8(e,t,n){if(n&&!nd(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){let n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function o9(e){return"function"==typeof e?e():e}let o7={current:null};function ae(e,t){let[n,r]=e,i=!1,o=t.length;for(let e=0,a=o-1;e<o;a=e++){let[o,l]=t[e]||[0,0],[s,u]=t[a]||[0,0];l>=r!=u>=r&&n<=(s-o)*(r-l)/(u-l)+o&&(i=!i)}return i}let at=tO&&tE,an=x.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:l,openOnHover:s,delay:u=100,closeDelay:c=0,handle:d,payload:p,...f}=e,m=tB(!0),h=(null==d?void 0:d.store)??(null==m?void 0:m.store);if(!h)throw Error(tq(85));let g=o2(l),y=h.useState("isTriggerActive",g),v=h.useState("floatingRootContext"),b=h.useState("isOpenedByTrigger",g),w=x.useRef(null),j=function(){let e=tJ(!0),t=tB(!0),n=tz();return x.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}(),S=oZ(!0),E=nM(),k=x.useMemo(()=>E??new t1,[E]),O=nL(k),{registerTrigger:C,isMountedByThisTrigger:I}=function(e,t,n,r){let i=n.useState("isMountedByTrigger",e),o=function(e,t){let n=x.useRef(null),r=x.useRef(null);return x.useCallback(i=>{if(void 0!==e){if(null!==n.current){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&t.context.triggerElements.delete(e),n.current=null,r.current=null}null!==i&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}(e,n),a=eK(t=>{if(o(t),!t||!n.select("open"))return;let i=n.select("activeTriggerId");if(i===e)return void n.update({activeTriggerElement:t,...r});null==i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return eJ(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:a,isMountedByThisTrigger:i}}(g,w,h,{payload:p,closeDelay:c,parent:j,floatingTreeRoot:k,floatingNodeId:O,floatingParentNodeId:nA(),keyboardEventRelay:null==S?void 0:S.relayKeyboardEvent}),R="menubar"===j.type,T=h.useState("disabled"),P=i||T||R&&j.context.disabled,{getButtonProps:N,buttonRef:A}=o0({disabled:P,native:a});x.useEffect(()=>{b||void 0!==j.type||(h.context.allowMouseUpTriggerRef.current=!1)},[h,b,j.type]);let M=x.useRef(null),L=eF(),D=eK(e=>{if(!M.current)return;L.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(n1(M.current,t)||n1(h.select("positionerElement"),t)||t===M.current||null!=t&&function e(t){return e7(t)&&t.hasAttribute("data-rootownerid")?t.getAttribute("data-rootownerid")??void 0:tp(t)?void 0:e(th(t))}(t)===h.select("rootId"))return;let n=function(e){let t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if("none"===n.content&&"none"===r.content)return t;let i=parseFloat(n.width)||0,o=parseFloat(n.height)||0,a=parseFloat(r.width)||0,l=parseFloat(r.height)||0,s=Math.max(t.width,i,a),u=Math.max(t.height,o,l),c=s-t.width,d=u-t.height;return{left:t.left-c/2,right:t.right+c/2,top:t.top-d/2,bottom:t.bottom+d/2}}(M.current);e.clientX>=n.left-2&&e.clientX<=n.right+2&&e.clientY>
14=n.top-2&&e.clientY<=n.bottom+2||k.events.emit("close",{domEvent:e,reason:"cancel-open"})});x.useEffect(()=>{b&&h.select("lastOpenChangeReason")===n7&&tI(M.current).addEventListener("mouseup",D,{once:!0})},[b,D,h]);let $=R&&j.context.hasSubmenuOpen,q=function(e,t={}){var n;let r="rootStore"in e?e.rootStore:e,{dataRef:i,events:o}=r.context,{enabled:a=!0,delay:l=0,handleClose:s=null,mouseOnly:u=!1,restMs:c=0,move:d=!0,triggerElementRef:p=o7,externalTree:f,isActiveTrigger:m=!0}=t,h=nM(f),{pointerTypeRef:g,interactedInsideRef:y,handlerRef:v,blockMouseMoveRef:b,performedPointerEventsMutationRef:w,unbindMouseMoveRef:j,restTimeoutPendingRef:S,openChangeTimeout:E,restTimeout:k,handleCloseOptionsRef:O}=o$(r),C=ru(s),I=ru(l),R=ru(c);m&&(O.current=null==(n=C.current)?void 0:n.__options);let T=eK(()=>!!y.current||!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)),P=x.useCallback((e,t=!0)=>{let n=o8(I.current,"close",g.current);n&&!v.current?E.start(n,()=>r.setOpen(!1,tX(n7,e))):t&&(E.clear(),r.setOpen(!1,tX(n7,e)))},[I,v,r,g,E]),N=eK(()=>{j.current(),v.current=void 0}),A=eK(()=>{if(w.current){let e=n4(r.select("domReferenceElement")).body;e.style.pointerEvents="",e.removeAttribute(oL),w.current=!1}});x.useEffect(()=>{if(a)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){e.open||(E.clear(),k.clear(),b.current=!0,S.current=!1)}},[a,o,E,k,b,S]);let M=eK(e=>{var t;if(T()||!i.current.floatingContext)return;let n=r.context.triggerElements;if(e.relatedTarget&&n.hasElement(e.relatedTarget))return;let o=p.current;null==(t=C.current)||t.call(C,{...i.current.floatingContext,tree:h,x:e.clientX,y:e.clientY,onClose(){A(),N(),T()||o!==r.select("domReferenceElement")||P(e)}})(e)});return x.useEffect(()=>{if(!a)return;let e=p.current??(m?r.select("domReferenceElement"):null);if(e9(e))return r.select("open")&&e.addEventListener("mouseleave",o),d&&e.addEventListener("mousemove",t,{once:!0}),e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),()=>{e.removeEventListener("mouseleave",o),d&&e.removeEventListener("mousemove",t),e.removeEventListener("mouseenter",t),e.removeEventListener("mouseleave",n)};function t(e){if(E.clear(),b.current=!1,u&&!nd(g.current)||o9(R.current)>0&&!o8(I.current,"open"))return;let t=o8(I.current,"open",g.current),n=r.select("domReferenceElement"),i=r.context.triggerElements,o=(i.hasElement(e.target)||i.hasMatchingElement(t=>n1(t,e.target)))&&(!n||!n1(n,e.target)),a=e.currentTarget??null,l=r.select("open"),s=!l||o;o&&l?r.setOpen(!0,tX(n7,e,a)):t?E.start(t,()=>{s&&r.setOpen(!0,tX(n7,e,a))}):s&&r.setOpen(!0,tX(n7,e,a))}function n(e){if(T())return void A();j.current();let t=n4(r.select("domReferenceElement"));k.clear(),S.current=!1;let n=r.context.triggerElements;if(!(e.relatedTarget&&n.hasElement(e.relatedTarget))){if(C.current&&i.current.floatingContext){r.select("open")||E.clear();let n=p.current;v.current=C.current({...i.current.floatingContext,tree:h,x:e.clientX,y:e.clientY,onClose(){A(),N(),T()||n!==r.select("domReferenceElement")||P(e,!0)}});let o=v.current;o(e),t.addEventListener("mousemove",o),j.current=()=>{t.removeEventListener("mousemove",o)};return}"touch"===g.current&&n1(r.select("floatingElement"),e.relatedTarget)||P(e)}}function o(e){M(e)}},[N,A,b,i,I,P,r,a,C,M,m,T,u,d,g,R,k,S,E,p,h,j,v]),x.useMemo(()=>{function e(e){g.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,i=r.select("domReferenceElement"),o=r.context.triggerElements,a=r.select("open"),l=(o.hasElement(e.target)||o.hasMatchingElement(t=>n1(t,e.target)))&&(!i||!n1(i,e.target));function s(){if(S.current=!1,T())return;let e=r.select("open");b.current||e&&!l||r.setOpen(!0,tX(n7,t,n))}(!u||nd(g.current))&&(!a||l)&&0!==o9(R.current)&&(l||!S.current||!(e.movementX**2+e.movementY**2<2))&&(k.clear(),"touch"===g.current?eA.flushSync(()=>{s()}):l&&a?s():(S.current=!0,k.start(o9(R.current),s)))}}},[b,T,u,r,g,R,k,S])}(v,{enabled:(s??$)&&!P&&"context-menu"!==j.type&&(!R||$&&!I),handleClose:function(e={}){let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i=new eB,o=!1,a=null,l=null,s="u">typeof performance?performance.now():0,u=({x:e,y:n,placement:u,elements:c,onClose:d,nodeId:p,tree:f})=>function(m){var h;function g(){i.clear(),d()}if(i.clear(),!c.domReference||!c.floating||null==u||null==e||null==n)return;let{clientX:y,clientY:v}=m,x=n2(m),b="mouseleave"===m.type,w=n1(c.floating,x),j=n1(c.domReference,x),S=c.domReference.getBoundingClientRect(),E=c.floating.getBoundingClientRect(),k=u.split("-")[0],O=e>E.right-E.width/2,C=n>E.bottom-E.height/2,I=(h=[y,v])[0]>=S.x&&h[0]<=S.x+S.width&&h[1]>=S.y&&h[1]<=S.y+S.height,R=E.width>S.width,T=E.height>S.height,P=(R?S:E).left,N=(R?S:E).right,A=(T?S:E).top,M=(T?S:E).bottom;if(w&&(o=!0,!b))return;if(j&&(o=!1),j&&!b){o=!0;return}if(b&&e9(m.relatedTarget)&&n1(c.floating,m.relatedTarget)||f&&nK(f.nodesRef.current,p).some(({context:e})=>null==e?void 0:e.open))return;if("top"===k&&n>=S.bottom-1||"bottom"===k&&n<=S.top+1||"left"===k&&e>=S.right-1||"right"===k&&e<=S.left+1)return g();let L=[];switch(k){case"top":L=[[P,S.top+1],[P,E.bottom-1],[N,E.bottom-1],[N,S.top+1]];break;case"bottom":L=[[P,E.top+1],[P,S.bottom-1],[N,S.bottom-1],[N,E.top+1]];break;case"left":L=[[E.right-1,M],[E.right-1,A],[S.left+1,A],[S.left+1,M]];break;case"right":L=[[S.right-1,M],[S.right-1,A],[E.left+1,A],[E.left+1,M]]}
14if(!ae([y,v],L)){if(o&&!I)return g();if(!b&&r){let e=function(e,t){let n=performance.now(),r=n-s;if(null===a||null===l||0===r)return a=e,l=t,s=n,null;let i=e-a,o=t-l,u=Math.sqrt(i*i+o*o)/r;return a=e,l=t,s=n,u}(m.clientX,m.clientY);if(null!==e&&e<.1)return g()}ae([y,v],function([e,n]){switch(k){case"top":{let r=[[E.left,O||R?E.bottom-t:E.top],[E.right,O?R?E.bottom-t:E.top:E.bottom-t]];return[[R?e+t/2:O?e+4*t:e-4*t,n+t+1],[R?e-t/2:O?e+4*t:e-4*t,n+t+1],...r]}case"bottom":{let r=[[E.left,O||R?E.top+t:E.bottom],[E.right,O?R?E.top+t:E.bottom:E.top+t]];return[[R?e+t/2:O?e+4*t:e-4*t,n-t],[R?e-t/2:O?e+4*t:e-4*t,n-t],...r]}case"left":return[[C||T?E.right-t:E.left,E.top],[C?T?E.right-t:E.left:E.right-t,E.bottom],[e+t+1,T?n+t/2:C?n+4*t:n-4*t],[e+t+1,T?n-t/2:C?n+4*t:n-4*t]];case"right":{let r=[[C||T?E.left+t:E.right,E.top],[C?T?E.left+t:E.right:E.left+t,E.bottom]];return[[e-t,T?n+t/2:C?n+4*t:n-4*t],[e-t,T?n-t/2:C?n+4*t:n-4*t],...r]}default:return[]}}([e,n]))?!o&&r&&i.start(40,g):g()}};return u.__options={blockPointerEvents:n},u}({blockPointerEvents:!R}),mouseOnly:!0,move:!1,restMs:void 0===j.type?u:void 0,delay:{close:c},triggerElementRef:w,externalTree:k,isActiveTrigger:y}),U=function(e,t){let n=eF(),[r,i]=x.useState(!1);return eJ(()=>{e&&"trigger-hover"===t?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}(b,h.select("lastOpenChangeReason")),B=function(e,t={}){let n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:i=!0,event:o="click",toggle:a=!0,ignoreMouse:l=!1,stickIfOpen:s=!0,touchOpenDelay:u=0}=t,c=x.useRef(void 0),d=e2(),p=eF(),f=x.useMemo(()=>({onPointerDown(e){c.current=e.pointerType},onMouseDown(e){let t=c.current,i=e.nativeEvent,f=n.select("open");if(0!==e.button||"click"===o||nd(t,!0)&&l)return;let m=r.current.openEvent,h=null==m?void 0:m.type,g=n.select("domReferenceElement")!==e.currentTarget,y=f&&g||!(f&&a&&(!(m&&s)||"click"===h||"mousedown"===h));if(n6(i.target)){let e=tX(n9,i,i.target);y&&"touch"===t&&u>0?p.start(u,()=>{n.setOpen(!0,e)}):n.setOpen(y,e);return}let v=e.currentTarget;d.request(()=>{let e=tX(n9,i,v);y&&"touch"===t&&u>0?p.start(u,()=>{n.setOpen(!0,e)}):n.setOpen(y,e)})},onClick(e){if("mousedown-only"===o)return;let t=c.current;if("mousedown"===o&&t){c.current=void 0;return}if(nd(t,!0)&&l)return;let i=n.select("open"),d=r.current.openEvent,f=n.select("domReferenceElement")!==e.currentTarget,m=i&&f||!(i&&a&&(!(d&&s)||np(d))),h=tX(n9,e.nativeEvent,e.currentTarget);m&&"touch"===t&&u>0?p.start(u,()=>{n.setOpen(!0,h)}):n.setOpen(m,h)},onKeyDown(){c.current=void 0}}),[r,o,l,n,s,a,d,p,u]);return x.useMemo(()=>i?{reference:f}:tP,[i,f])}(v,{enabled:!P&&"context-menu"!==j.type,event:b&&R?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:void 0===j.type&&U}),F=function(e,t={}){let n="rootStore"in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:o=!0,visibleOnly:a=!0,delay:l}=t,s=x.useRef(!1),u=x.useRef(null),c=eF(),d=x.useRef(!0);x.useEffect(()=>{let e=n.select("domReferenceElement");if(!o)return;let t=e6(e);function r(){let e=n.select("domReferenceElement");!n.select("open")&&e7(e)&&e===n0(n4(e))&&(s.current=!0)}function i(){d.current=!0}function a(){d.current=!1}return t.addEventListener("blur",r),at&&(t.addEventListener("keydown",i,!0),t.addEventListener("pointerdown",a,!0)),()=>{t.removeEventListener("blur",r),at&&(t.removeEventListener("keydown",i,!0),t.removeEventListener("pointerdown",a,!0))}},[n,o]),x.useEffect(()=>{if(o)return r.on("openchange",e),()=>{r.off("openchange",e)};function e(e){if(e.reason===n9||e.reason===ri){let e=n.select("domReferenceElement");e9(e)&&(u.current=e,s.current=!0)}}},[r,o,n]);let p=x.useMemo(()=>({onMouseLeave(){s.current=!1,u.current=null},onFocus(e){let t=e.currentTarget;if(s.current){if(u.current===t)return;s.current=!1,u.current=null}let r=n2(e.nativeEvent);if(a&&e9(r)){if(at&&!e.relatedTarget){if(!d.current&&!n6(r))return}else if(!function(e){if(!e||tC)return!0;try{return e.matches(":focus-visible")}catch{return!0}}(r))return}let i=e.relatedTarget&&n.context.triggerElements.hasElement(e.relatedTarget),{nativeEvent:o,currentTarget:p}=e,f="function"==typeof l?l():l;if(n.select("open")&&i||0===f||void 0===f)return void n.setOpen(!0,tX(re,o,p));c.start(f,()=>{s.current||n.setOpen(!0,tX(re,o,p))})},onBlur(e){s.current=!1,u.current=null;let t=e.relatedTarget,r=e.nativeEvent,o=e9(t)&&t.hasAttribute(n_("focus-guard"))&&"outside"===t.getAttribute("data-type");c.start(0,()=>{var e;let a=n.select("domReferenceElement"),l=n0(a?a.ownerDocument:document);if(!t&&l===a||n1(null==(e=i.current.floatingContext)?void 0:e.refs.floating.current,l)||n1(a,l)||o)return;let s=t??l;if(e9(s)){let e=n.context.triggerElements;if(e.hasElement(s)||e.hasMatchingElement(e=>n1(e,s)))return}n.setOpen(!1,tX(re,r))})}}),[i,n,a,c,l]);return x.useMemo(()=>o?{reference:p,trigger:p}:{},[o,p])}(v,{enabled:!P&&$}),z=function(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=x.useRef(!1);return x.useMemo(()=>t?{onMouseDown:e=>{("open"===n&&!r||"close"===n&&r)&&(i.current=!0,tI(e.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:tP,[t,n,r])}({open:b,enabled:R,mouseDownAction:"open"}),_=rW([B,F]),K=x.useMemo(()=>({disabled:P,open:b}
14),[P,b]),W=h.useState("triggerProps",I),H=[M,t,A,C,w],V=[_.getReferenceProps(),q??tP,W,{"aria-haspopup":"menu",id:g,onMouseDown:e=>{h.select("open")||(L.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),tI(e.currentTarget).addEventListener("mouseup",D,{once:!0}))}},R?{role:"menuitem"}:{},z,f,N],Y=x.useRef(null),X=eK(e=>{eA.flushSync(()=>{h.setOpen(!1,tX(rr,e.nativeEvent,e.currentTarget))});let t=iA(Y.current,-1);null==t||t.focus()}),G=eK(e=>{var t;let n=h.select("positionerElement");if(n&&iM(e,n))null==(t=h.context.beforeContentFocusGuardRef.current)||t.focus();else{eA.flushSync(()=>{h.setOpen(!1,tX(rr,e.nativeEvent,e.currentTarget))});let t=iA(h.context.triggerFocusTargetRef.current||w.current,1);for(;null!==t&&n1(n,t);){let e=t;if((t=iP(t))===e)break}null==t||t.focus()}}),J=ie("button",e,{enabled:!R,stateAttributesMapping:ox,state:K,ref:H,props:V});return R?(0,o.jsx)(o3,{tag:"button",render:n,className:r,state:K,refs:H,props:V,stateAttributesMapping:ox}):b?(0,o.jsxs)(x.Fragment,{children:[(0,o.jsx)(r6,{ref:Y,onFocus:X},`${g}-pre-focus-guard`),(0,o.jsx)(x.Fragment,{children:J},g),(0,o.jsx)(r6,{ref:h.context.triggerFocusTargetRef,onFocus:G},`${g}-post-focus-guard`)]}):(0,o.jsx)(x.Fragment,{children:J},g)}),ar=({children:e,open:t,onOpenChange:n})=>(0,o.jsx)(r2,{onOpenChange:n,open:t,children:e});ar.displayName="DropdownMenu";let ai=({className:e,children:t,...n})=>(0,o.jsx)(an,{className:(0,v.cn)("group group overflow-hidden rounded-lg disabled:pointer-events-none [&>span]:line-clamp-1","flex items-center gap-1 py-0.5 text-sm text-stone-950/50 group-hover:text-stone-950/70 dark:text-white/50 dark:group-hover:text-white/70",e),...n,children:t});ai.displayName="DropdownMenuTrigger";let ao=({className:e,sideOffset:t=4,align:n="start",...r})=>(0,o.jsx)(iB,{children:(0,o.jsx)(oC,{align:n,className:"z-50",collisionPadding:16,sideOffset:t,children:(0,o.jsx)(oJ,{className:(0,v.cn)("relative max-h-96 min-w-(--anchor-width) overflow-y-auto rounded-2xl border-standard bg-white p-1 text-stone-950/70 shadow-stone-500/5 shadow-xl dark:bg-stone-950 dark:text-white/70 dark:shadow-none dark:shadow-stone-500/5","data-[ending-style]:fade-out-0 data-[starting-style]:fade-in-0 data-[ending-style]:zoom-out-95 data-[starting-style]:zoom-in-95",e),style:{textRendering:"geometricPrecision"},...r})})});ao.displayName="DropdownMenuContent";let aa=({className:e,isSelected:t,children:n,onSelect:r,onClick:i,...a})=>(0,o.jsxs)(o6,{className:(0,v.cn)("group relative flex w-full cursor-pointer select-none items-center justify-between gap-2 rounded-md px-2 py-1 text-sm outline-0 hover:bg-stone-950/3 focus:bg-stone-950/5 data-disabled:pointer-events-none data-disabled:cursor-default data-disabled:opacity-50 dark:focus:bg-white/5 dark:hover:bg-white/3",t?"font-medium text-primary dark:text-primary-light":"text-stone-950/50 hover:text-stone-950/75 focus:text-stone-950/75 dark:text-white/50 dark:focus:text-white/75 dark:hover:text-white/75",e),onClick:e=>{null==i||i(e),null==r||r()},...a,children:[n,(0,o.jsx)(eN,{className:(0,v.cn)("size-3.5 shrink-0 text-primary dark:text-primary-light",!t&&"opacity-0"),strokeWidth:2.5})]});aa.displayName="DropdownMenuItem";var al=e.i(855830);let as=({options:e,selectedIndex:t,onSelectOption:n,className:r})=>{let i=e.length>1,a=e[t];return(0,o.jsx)("div",{className:(0,v.cn)("relative flex items-center px-2 py-0.5 text-gray-600 dark:text-gray-300 hover:text-gray-950 dark:hover:text-white font-medium",r),children:(0,o.jsxs)(ar,{children:[(0,o.jsx)(ai,{disabled:!i,className:"font-mono text-xs text-gray-600 dark:text-gray-300 hover:text-gray-950 dark:hover:text-white px-2",children:(0,o.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,o.jsx)("span",{children:null==a?void 0:a.label}),i&&(0,o.jsx)(al.ChevronDownIcon,{className:"h-2.5 w-2.5 text-gray-500 dark:text-gray-400 shrink-0"})]})}),(0,o.jsx)(ao,{className:"min-w-24",align:"end",children:e.map((e,r)=>(0,o.jsx)(aa,{isSelected:r===t,onSelect:()=>n(r),className:"text-xs rounded-xl",children:e.label},r))})]})})},au=({apiReferenceData:e,defaultExpanded:t,isLivePreview:n,fieldType:r="response"})=>{var i,a,l,s;
14let u=(0,b.useLocaleStrings)(),[c,d]=(0,x.useState)(0),{selectedResponseContentTypeIndex:p,setSelectedResponseContentTypeIndex:f}=(0,eI.useSelectedResponseContentType)(),m=(0,x.useRef)(e.operation),h=(0,x.useMemo)(()=>{var t,n;return null!=(n=null==(t=e.dependencies)?void 0:t.responses)?n:{}},[null==(i=e.dependencies)?void 0:i.responses]),g=null==(a=e.dependencies)?void 0:a.schemas,y=(0,x.useMemo)(()=>{var t;let n=null==(t=e.operation)?void 0:t.responses;return n?Object.entries(n).map(([e,t])=>{var n;let r=h[t];return[e,null!=(n=null==r?void 0:r.content)?n:{}]}):[]},[h,null==(l=e.operation)?void 0:l.responses]);(0,x.useEffect)(()=>{m.current!==e.operation?(m.current=e.operation,d(0)):c>=y.length&&y.length>0&&d(0)},[e.operation,y.length,c]);let w=(0,x.useMemo)(()=>{let e=y[c];return e&&e[1]?Object.entries(e[1]):[]},[y,c]),j=(0,x.useCallback)(e=>{d(e);let t=y[e];t&&t[1]&&p>=Object.entries(t[1]).length&&f(0)},[y,p,d,f]),S=(0,x.useCallback)(e=>{f(e)},[f]),{contentType:E,schema:k,description:I,isStreamItem:R}=(0,x.useMemo)(()=>{var t,n;let r=y[c],i=r?String(r[0]):void 0,o=i?null==(n=null==(t=e.operation)?void 0:t.responses)?void 0:n[i]:void 0,a=o?h[o]:void 0,l=(null==a?void 0:a.description)||(null==a?void 0:a.summary),s=w[p];if(!s)return{contentType:void 0,schema:void 0,description:l,isStreamItem:!1};let[u,d]=s,f="itemSchema"in d?d.itemSchema:void 0,m=null!=f?f:d.schema;return"_mintlify/placeholder"===u?{schema:m,contentType:"",description:l,isStreamItem:!1}:{schema:m,contentType:u,description:l,isStreamItem:void 0!==f}},[w,p,y,c,h,null==(s=e.operation)?void 0:s.responses]),T=k?[k]:[];T.some(e=>(0,C.isSchemaObject)(e)&&"null"===e.type)&&(T=T.filter(e=>!(0,C.isSchemaObject)(e)||"null"!==e.type));let P=(0,C.generateSchemaOptionLabels)(T),N=y.map(([e,t])=>({label:String(e),schema:t})),A=w.filter(([e])=>"_mintlify/placeholder"!==e).map(([e,t])=>({label:String(e),schema:t})),M=y[0]?`${y[0][0]}`:"",L=E?`${E}`:"",D=`${M}${M&&L?" - ":""}${L}`,$=y.length>1,q=w.length>1,U=$||q;return(0,o.jsxs)("div",{className:"api-section",children:[(0,o.jsxs)(eE.SectionHeading,{title:u["api.response"],subtitle:I,rightElement:U?(0,o.jsxs)("div",{className:"flex items-center gap-x-3 font-mono text-xs",children:[(0,o.jsx)(as,{onSelectOption:j,options:N,selectedIndex:c,className:(0,v.cn)("bg-transparent dark:bg-transparent",$&&"hover:text-zinc-950 dark:hover:text-white transition-all")}),(0,o.jsx)(as,{onSelectOption:S,options:A,selectedIndex:p,className:(0,v.cn)("bg-transparent dark:bg-transparent",q&&"hover:text-zinc-950 dark:hover:text-white transition-all")})]}):D,children:[P[0]&&P[0].includes(O.orNullTypeString)&&(0,o.jsx)("div",{children:(0,o.jsx)(ew,{className:"max-w-fit text-xs font-medium font-mono break-words",children:P[0]})}),R&&(0,o.jsx)("div",{children:(0,o.jsx)(ew,{className:"max-w-fit text-xs font-medium break-words",children:u["api.streamItem"]})})]}),T.length>1?(0,o.jsx)(Z,{children:T.map((e,i)=>{var a;return(0,o.jsx)(Z.Item,{title:null!=(a=P[i])?a:"",children:(0,C.isSchemaObject)(e)&&(0,o.jsx)(ed,{schema:e,fieldType:r,displayFlattened:!0,schemas:g,isTopLevel:!0,defaultExpanded:t,isLivePreview:n})},i)})}):T[0]&&(0,C.isSchemaObject)(T[0])?(0,o.jsx)(ed,{schema:T[0],fieldType:r,displayFlattened:!0,omitPadding:!0,schemas:g,isTopLevel:!0,defaultExpanded:t,isLivePreview:n}):null]})},ac=({apiReferenceData:e,defaultExpanded:t,isLivePreview:n})=>{var r;let i=(0,b.useLocaleStrings)(),a=null==(r=e.dependencies)?void 0:r.callbacks;return a&&0!==a.length?(0,o.jsxs)("div",{className:"api-section pb-6",children:[(0,o.jsx)(eE.SectionHeading,{title:i["api.callbacks"],withPadding:!0}),(0,o.jsx)("div",{className:"flex flex-col gap-y-3",children:a.map((e,r)=>(0,o.jsx)(ad,{callback:e,index:r,defaultExpanded:t,isLivePreview:n},`${e.callbackName}-${e.expression}-${e.method}-${r}`))})]}):null};function ad({callback:e,index:t,defaultExpanded:n,isLivePreview:r}){var i,a;let l=`callback-${t}-`,[s,u]=(0,x.useState)(null!=n&&n),c=(0,x.useRef)(null);(0,x.useEffect)(()=>{let e=()=>{window.location.hash.substring(1).startsWith(l)&&(c.current&&(c.current.open=!0),u(!0))};return e(),window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[l]);let d=(0,x.useMemo)(()=>{var t;return{operation:Object.assign(Object.assign({},e.resolved.operation),{path:e.expression,baseUrlOptions:[],title:e.callbackName,description:null!=(t=e.resolved.operation.description)?t:""}),dependencies:Object.assign(Object.assign({},e.resolved.dependencies),{schemas:e.resolved.schemas,servers:{},security:{}})}},[e]),p=!!(null==(i=d.dependencies)?void 0:i.requestBody),f=(null==(a=d.dependencies)?void 0:a.responses)&&Object.keys(d.dependencies.responses).length>0;return p||f?(0,o.jsxs)("details",{ref:c,className:"rounded-xl border-standard",open:s,onToggle:e=>u(e.currentTarget.open),children:[(0,o.jsxs)("summary",{className:(0,v.cn)("not-prose flex w-full cursor-pointer items-center gap-x-2 px-3.5 py-3","list-none [&::-webkit-details-marker]:hidden","text-sm text-stone-600 hover:bg-stone-50/50 hover:text-stone-900","dark:text-stone-300 dark:hover:bg-white/5 dark:hover:text-stone-200","rounded-t-xl",!s&&"rounded-b-xl"),children:[(0,o.jsx)("span",{className:(0,v.cn)("inline-block size-2.5 bg-stone-400 transition-transform",s&&"rotate-90"),style:{WebkitMaskImage:"url(https://d3gk2c5xim1je2.cloudfront.net/v7.1.0/regular/angle-right.svg)",WebkitMaskRepeat:"no-repeat",WebkitMaskPosition:"center",WebkitMaskSize:"contain",maskImage:"url(https://d3gk2c5xim1je2.cloudfront.net/v7.1.0/regular/angle-right.svg)",maskRepeat:"no-repeat",maskPosition:"center",maskSize:"contain"}}),(0,o.jsx)(eC.MethodPill,{method:e.method}),(0,o.jsx)("span",{className:"font-mono text-sm",children:e.expression}),(0,o.jsx)("span",{className:"ml-auto text-xs text-stone-400",children:e.callbackName})]}),(0,o.jsx)("div",{className:"mx-3 border-t border-stone-100 px-2 dark:border-white/10",children:(0,o.jsx)(eO.ContentTypeOverrideProvider,{children:(0,o.jsxs)("div",{className:"flex flex-col gap-y-4 pb-4",children:[p&&(0,o.jsx)(Y.EndpointLocationProvider,{location:"request",children:(0,o.jsx)(ek,{apiReferenceData:d,defaultExpanded:n,isLivePreview:r,fieldType:`callback-${t}-body`})}),f&&(0,o.jsx)(Y.EndpointLocationProvider,{location:"response",children:(0,o.jsx)(au,{apiReferenceData:d,defaultExpanded:n,isLivePreview:r,fieldType:`callback-${t}-response`})})]})})})]}):null}let ap=({apiReferenceData:e,defaultExpanded:t,isLivePreview:n})=>{var r,i,a,l,s,u,c;
14let d=(0,b.useLocaleStrings)(),p=(0,x.useMemo)(()=>{var t,n;return null!=(n=null==(t=e.dependencies)?void 0:t.parameters)?n:{}},[null==(r=e.dependencies)?void 0:r.parameters]),f=null==(i=e.dependencies)?void 0:i.schemas,m=(0,x.useMemo)(()=>{let e={header:{},path:{},query:{},querystring:{},cookie:{}};return Object.entries(p).forEach(([t,n])=>{let r=n.in;r in e&&e[r]&&(e[r][n.name]=n)}),e},[p]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(af,{title:d["api.headers"],parameters:null!=(a=m.header)?a:{},schemas:f,defaultExpanded:t,isLivePreview:n}),(0,o.jsx)(af,{title:d["api.pathParameters"],parameters:null!=(l=m.path)?l:{},schemas:f,defaultExpanded:t,isLivePreview:n}),(0,o.jsx)(af,{title:d["api.queryParameters"],parameters:null!=(s=m.query)?s:{},schemas:f,defaultExpanded:t,isLivePreview:n}),(0,o.jsx)(af,{title:d["api.queryString"],parameters:null!=(u=m.querystring)?u:{},schemas:f,defaultExpanded:t,isLivePreview:n}),(0,o.jsx)(af,{title:d["api.cookies"],parameters:null!=(c=m.cookie)?c:{},schemas:f,defaultExpanded:t,isLivePreview:n})]})},af=({parameters:e,title:t,schemas:n,defaultExpanded:r,isLivePreview:i})=>{if(0===Object.keys(e).length)return null;let a=Object.entries(e).map(([e,t])=>t.schema&&(0,C.isSchemaObject)(t.schema)?(0,o.jsx)(ed,{schema:t.schema,fieldType:"parameter",name:t.name,style:t.style,explode:t.explode,required:t.required,schemas:n,defaultExpanded:r,isLivePreview:i},t.name):null);return(0,o.jsxs)("div",{className:"api-section",children:[(0,o.jsx)(eE.SectionHeading,{title:t}),a]})};var am=e.i(298618);let ah=e=>{if(!e.scopes||0===e.scopes.length)return[];let t=new Map;"oauth2"===e.type&&Object.values(e.flows).forEach(e=>{e&&Object.entries(e.scopes).forEach(([e,n])=>{n&&!t.has(e)&&t.set(e,n)})});let n=new Set;return e.scopes.flatMap(e=>{if(n.has(e))return[];n.add(e);let r=t.get(e);return[Object.assign({name:e},r?{description:r}:{})]})},ag=["authorizationCode","clientCredentials","implicit","password","deviceAuthorization"],ay=["authorizationUrl","deviceAuthorizationUrl","tokenUrl","refreshUrl"],av=e=>{if("oauth2"!==e.type)return[];let t=e.flows;return ag.flatMap(e=>{let n=t[e];if(!n)return[];let r={};for(let e of ay){let t=n[e];"string"==typeof t&&(r[e]=t)}return[{flow:e,urls:r}]})},ax=({scopes:e,label:t,className:n})=>0===e.length?null:(0,o.jsxs)("div",{className:(0,v.cn)("not-prose space-y-2.5 text-sm",n),children:[(0,o.jsxs)("div",{className:"flex items-center gap-2 font-mono text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[(0,o.jsx)("span",{children:t}),(0,o.jsx)("span",{className:"rounded-md bg-gray-100 px-1.5 py-0.5 text-gray-600 dark:bg-white/10 dark:text-gray-300",children:e.length})]}),(0,o.jsx)("div",{className:"space-y-2",children:e.map(e=>(0,o.jsxs)("div",{className:"rounded-xl border border-gray-200/70 bg-background-light px-3 py-3 dark:border-white/10 dark:bg-white/[0.03]",children:[(0,o.jsx)("div",{className:"w-fit max-w-full break-all font-mono text-sm font-medium leading-5 text-gray-900 dark:text-gray-100",children:e.name}),e.description&&(0,o.jsx)("div",{className:"overflow-wrap-anywhere mt-1 text-sm leading-5 text-gray-500 dark:text-gray-400",children:e.description})]},e.name))})]}),ab={authorizationCode:"api.oauth.authorizationCode",clientCredentials:"api.oauth.clientCredentials",implicit:"api.oauth.implicit",password:"api.oauth.password",deviceAuthorization:"api.oauth.deviceAuthorization"},aw={authorizationUrl:"api.oauth.authorizationUrl",deviceAuthorizationUrl:"api.oauth.deviceAuthorizationUrl",tokenUrl:"api.oauth.tokenUrl",refreshUrl:"api.oauth.refreshUrl"},aj=Object.keys(aw),aS=({scheme:e})=>{let t=(0,b.useLocaleStrings)(),n=av(e),r="oauth2MetadataUrl"in e?e.oauth2MetadataUrl:void 0;if(0===n.length&&!r)return null;let i=ah(e);return(0,o.jsxs)("div",{className:"not-prose space-y-3 pb-4 text-sm",children:[n.map(({flow:e,urls:n})=>(0,o.jsxs)("div",{className:"rounded-xl border border-gray-200/70 px-3 py-3 dark:border-white/10",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2 font-mono text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[(0,o.jsx)("span",{children:t["api.oauth.flow"]}),(0,o.jsx)("span",{className:"rounded-md bg-gray-100 px-1.5 py-0.5 normal-case tracking-normal text-gray-700 dark:bg-white/10 dark:text-gray-200",children:t[ab[e]]})]}),(0,o.jsx)("dl",{className:"mt-2 space-y-1",children:aj.flatMap(e=>{let r=n[e];return void 0===r?[]:[(0,o.jsxs)("div",{className:"flex flex-wrap gap-x-2 text-xs",children:[(0,o.jsx)("dt",{className:"text-gray-500 dark:text-gray-400",children:t[aw[e]]}),(0,o.jsx)("dd",{className:"break-all font-mono text-gray-900 dark:text-gray-100",children:r})]},e)]})})]},e)),r&&(0,o.jsxs)("div",{className:"flex flex-wrap gap-x-2 pb-1 text-xs",children:[(0,o.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:t["api.oauth.metadataUrl"]}),(0,o.jsx)("span",{className:"break-all font-mono text-gray-900 dark:text-gray-100",children:r})]}),(0,o.jsx)(ax,{scopes:i,label:t["api.scopes"]})]})},aE=({apiReferenceData:e})=>{var t;
14let n=(0,b.useLocaleStrings)(),{selectedSecurityOptionIndex:r,setSelectedSecurityOptionIndex:i}=(0,am.useSelectedSecurityOption)(),a=null==(t=e.dependencies)?void 0:t.processedSecurityOptions;if(!a)return null;let l=a[r];if(!l)return null;let s=[];if(l.schemes.forEach(({scheme:e,schema:t,name:n})=>{if("apiKey"===e.type&&"name"in e&&"in"in e)s.push((0,o.jsx)(eu,{fieldType:"authorization",schema:t,typeOptions:["string"],name:n,location:e.in},`${e.in}:${e.name}`));else if("http"===e.type&&"scheme"in e)if("basic"===e.scheme){let e=Object.assign(Object.assign({},t),{type:"string"});s.push((0,o.jsx)(eu,{fieldType:"authorization",schema:e,typeOptions:["string"],name:n,location:"header"},`header:${t.title}`))}else"bearer"===e.scheme&&s.push((0,o.jsx)(eu,{fieldType:"authorization",schema:t,typeOptions:["string"],name:n,location:"header"},`header:${t.title}`));else if("oauth2"===e.type){let r=(0,o.jsx)(eu,{fieldType:"authorization",schema:t,typeOptions:["string"],name:n,location:"header"},`header:${t.title}`);av(e).length>0||"oauth2MetadataUrl"in e?s.push((0,o.jsxs)("div",{className:"border-gray-100 dark:border-gray-800 border-b last:border-b-0 [&>:first-child]:border-b-0",children:[r,(0,o.jsx)(aS,{scheme:e})]},`oauth:${t.title}`)):s.push(r)}}),0===s.length)return null;let u=a.map(e=>e.deprecated?`${e.title} (${n["api.deprecated"]})`:e.title);return(0,o.jsxs)("div",{className:"api-section",children:[(0,o.jsx)(eE.SectionHeading,{title:n["api.authorizations"],options:u,selectedIndex:r,onSelectOption:i}),s]})},ak=({apiReferenceData:e,defaultExpanded:t,isLivePreview:n})=>{let{dependencies:r}=e,i=(null==r?void 0:r.processedSecurityOptions)&&r.processedSecurityOptions.length>0,a=(null==r?void 0:r.parameters)&&Object.keys(r.parameters).length>0,l=null==r?void 0:r.requestBody,s=(null==r?void 0:r.responses)&&Object.keys(r.responses).length>0,u=(null==r?void 0:r.callbacks)&&r.callbacks.length>0;return(0,o.jsxs)(o.Fragment,{children:[i&&(0,o.jsx)(aE,{apiReferenceData:e}),a&&(0,o.jsx)(ap,{apiReferenceData:e,defaultExpanded:t,isLivePreview:n}),l&&(0,o.jsx)(Y.EndpointLocationProvider,{location:"request",children:(0,o.jsx)(ek,{apiReferenceData:e,defaultExpanded:t,isLivePreview:n})}),u&&(0,o.jsx)(ac,{apiReferenceData:e,defaultExpanded:t,isLivePreview:n}),s&&(0,o.jsx)(Y.EndpointLocationProvider,{location:"response",children:(0,o.jsx)(au,{apiReferenceData:e,defaultExpanded:t,isLivePreview:n})})]})};var aO=e.i(703352),aC=e.i(864823),aI=e.i(108153),aR=e.i(505145),aT=e.i(510248),aP=e.i(541837);let aN=({baseUrlOptions:e,baseUrlNames:t,selectedBaseUrlIndex:n,setSelectedBaseUrlIndex:r,display:i,path:a,method:l,type:s,onBaseUrlChange:u,urlDisplay:c,isInPlaygroundModal:d,parameters:p})=>{var f;let[m,h]=(0,x.useState)(!1),g=(0,b.useLocaleStrings)(),y=(({path:e,baseUrl:t,parameters:n})=>{let r=(0,aC.usePlaygroundInputsStore)(e=>e.getApiPlaygroundInputs)(),i=(0,aO.addPathParams)(e,r.path,n);return(0,aO.joinWithSingleSlash)((0,aO.addServerVariables)(t,r.server),i)})({path:a,baseUrl:null!=(f=e[n])?f:"",parameters:p}),w=()=>(function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function l(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,l)}s((r=r.apply(e,t||[])).next())})})(void 0,void 0,void 0,function*(){let e="webhook"!==s||a.startsWith("/")?y:a;"success"===(yield(0,aI.copyToClipboard)(e))&&(h(!0),setTimeout(()=>{h(!1)},2e3))});return(0,o.jsxs)("div",{className:(0,v.cn)("group relative flex-1 flex gap-2 min-w-0 rounded-xl items-center cursor-pointer p-1.5 pr-0 overflow-hidden","simple"!=i&&"border-standard",d&&"bg-gray-50 dark:bg-white/5"),onClick:w,children:[(0,o.jsx)(eC.MethodPill,{method:"webhook"===s?"webhook":l,active:!1}),(0,o.jsxs)(aR.ScrollArea,{className:"flex-1",children:[(0,o.jsx)(aR.ScrollAreaViewport,{className:"overflow-y-hidden! [--scroll-area-fade-size:16px]",fade:["left"],children:(0,o.jsxs)(aR.ScrollAreaContent,{className:"flex items-center space-x-2 pr-8",children:[(0,o.jsx)(aT.BasePathSelector,{baseUrlOptions:e,baseUrlNames:t,selectedBaseUrlIndex:n,setSelectedBaseUrlIndex:r,onBaseUrlChange:u,urlDisplay:c,selectBaseUrlAriaLabel:g["aria.selectBaseUrl"]}),(0,o.jsx)(aP.PrettyPath,{path:a,method:l})]})}),(0,o.jsx)(aR.ScrollAreaScrollbar,{orientation:"horizontal",className:"-mb-[5px]",onClick:e=>e.stopPropagation()})]}),(0,o.jsx)(aP.EndpointCopyButton,{isCopiedActive:m,hasGrayBackgroun
14d:d,onCopy:w,copyAriaLabel:g["tooltip.copy"],copiedStatusText:g.copied})]})};var aA=e.i(215371);let aM=({apiReferenceData:e,pageMetadata:t,docsConfig:n,isLivePreview:r,docsConfigOverrides:i,userGroups:a,localeStrings:l=ey.DEFAULT_LOCALE_STRINGS,markdownComponents:s,mdxRequestExampleData:u,mdxResponseExampleData:c,isChatSheetOpen:d,codeComponents:p,Playground:f,className:m,readOnly:h,ReadOnlyWrapper:g,children:y})=>{var b,j,E,O,C,I,R,T,P,N,A;let M=null==e?void 0:e.operation,L=(null==t?void 0:t.mode)==="custom",D=(null==t?void 0:t.mode)==="frame",$=(null!=(E=null==(j=null==(b=null==i?void 0:i.api)?void 0:b.params)?void 0:j.expanded)?E:null==(C=null==(O=null==n?void 0:n.api)?void 0:O.params)?void 0:C.expanded)==="all",q=null!=(T=null==(R=null==(I=null==i?void 0:i.api)?void 0:I.params)?void 0:R.post)?T:null==(N=null==(P=null==n?void 0:n.api)?void 0:P.params)?void 0:N.post,U=(0,ex.getApiPlaygroundDisplay)({pageMetadata:t,docsConfig:n,isLivePreview:r,docsConfigOverrides:i,apiReferenceData:e,userGroups:a}),[B,F]=(0,x.useState)(!1),z="none"===U,_="simple"===U,{selectedBaseUrlIndex:K,setSelectedBaseUrlIndex:W,baseUrl:H}=(0,ev.useSelectedBaseUrl)();(0,x.useEffect)(()=>{new URLSearchParams(window.location.search).has("playground")&&requestAnimationFrame(()=>{F(!0)})},[]);let V=e=>{if(F(e),e){let e=new URL(window.location.href);e.searchParams.set("playground","open"),window.history.replaceState({},"",e)}else{let e=new URL(window.location.href);e.searchParams.delete("playground"),window.history.replaceState({},"",e)}};if(!M)return null;let{path:Y,method:X,baseUrlOptions:G,baseUrlNames:J,type:Q,urlDisplay:Z}=M,ee=(null==t?void 0:t.openapi)&&M,et=h&&g?g:x.default.Fragment;return(0,o.jsx)(k.ReadOnlyProvider,{value:null!=h&&h,children:(0,o.jsx)(ey.LocalizationProvider,{localeStrings:l,children:(0,o.jsx)(S,{value:{post:q},children:(0,o.jsx)(w.MarkdownProvider,{markdownComponents:s,children:(0,o.jsxs)(eg.Provider,{value:{isPlaygroundExpanded:B,setIsPlaygroundExpanded:V},children:[(0,o.jsxs)("div",{className:(0,v.cn)("flex flex-col gap-8 isolate",m),id:"api-playground-2-operation-page",children:[(0,o.jsx)(em.default,{children:(0,o.jsxs)("div",{className:(0,v.cn)(!z&&"mt-6","flex w-full flex-col space-y-4"),children:[z?null:(0,o.jsx)(et,{children:(0,o.jsx)(em.default,{children:(0,o.jsx)("div",{className:(0,v.cn)("flex flex-col bg-background-light dark:bg-background-dark border-standard rounded-2xl p-1.5","simple"===U?"p-1":"p-1.5",h?"mx-7":"w-full",h&&"pointer-events-none"),children:(0,o.jsxs)("div",{className:"flex items-center space-x-1.5",children:[(0,o.jsx)(aN,{baseUrlOptions:G,baseUrlNames:J,selectedBaseUrlIndex:K,setSelectedBaseUrlIndex:W,display:U,path:Y,method:X,type:Q,onBaseUrlChange:()=>{},isInPlaygroundModal:!1,urlDisplay:Z,parameters:null==(A=null==e?void 0:e.dependencies)?void 0:A.parameters}),_?null:(0,o.jsx)(aA.SendPill,{label:l.tryIt,sendingRequestAriaLabel:l["aria.sendingRequest"],method:X,onClick:()=>{f&&!h&&V(!0)}})]})})})}),!h&&(0,o.jsx)(em.default,{children:(0,o.jsx)("div",{className:"mt-8 lg:mt-0 flex flex-col gap-6 max-h-[30rem] print:max-h-none [html:not([data-assistant-state=open])_&]:xl:hidden",children:(0,o.jsx)(eb.ApiExamples,{codeComponents:p,openApiReferenceData:e,apiPlaygroundDisplay:U,mdxRequestExampleData:u,mdxResponseExampleData:c,isChatSheetOpen:d})})})]})}),(0,o.jsx)(em.default,{children:(0,o.jsxs)("div",{className:(0,v.cn)("mdx-content","@container/columns-container relative",!L&&!D&&"prose prose-gray dark:prose-invert"),children:[y,ee&&(0,o.jsx)(et,{children:(0,o.jsx)("div",Object.assign({className:(0,v.cn)("mb-14",!L&&!D&&"prose prose-gray dark:prose-invert",h&&"mx-7")},h&&{"data-block-selection-ignore":"true"},{children:(0,o.jsx)(ak,{apiReferenceData:e,defaultExpanded:$,isLivePreview:r})}))})]})})]}),!z&&!_&&f&&(0,o.jsx)(em.default,{children:(0,o.jsx)(f,{isPlaygroundExpanded:B,setIsPlaygroundExpanded:V,baseUrl:H,baseUrlOptions:G,apiReferenceData:e})})]})})})})})};var aL=e.i(256349),aD=e.i(456542),a$=e.i(165592),aq=e.i(560060),aU=e.i(854472),aB=e.i(665291),aF=e.i(87390),az=e.i(888076),a_=e.i(912710);let aK={store:a_.storeEncrypted,load:a_.loadEncrypted};var aW=e.i(768834),aH=e.i(307080);let aV="mintlify-server-variables",aY=(e,t)=>{var n,r;let i=null!=(n=null==e?void 0:e.baseUrlOptions[t])?n:"",o=null==(r=null==e?void 0:e.baseUrlNames)?void 0:r[t];return void 0===o||""===o?i:`${i}#${encodeURIComponent(o)}`},aX=()=>{let e=localStorage.getItem(aV);if(e)try{let t=JSON.parse(e);
14if((e=>"object"==typeof e&&null!=e&&Object.values(e).every(e=>"object"==typeof e&&null!==e&&Object.values(e).every(e=>"string"==typeof e)))(t))return t}catch(e){console.log(`unable to parse stored server variables: ${e}`)}return{}};var aG=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function l(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,l)}s((r=r.apply(e,t||[])).next())})};let aJ=(0,aW.create)((e,t)=>({locallyStoredCredentials:void 0,setLocallyStoredCredentials:t=>e({locallyStoredCredentials:t}),locallyStoredServerVariables:void 0,setLocallyStoredServerVariables:t=>e({locallyStoredServerVariables:t}),syncCredentialsState:()=>{let{inputs:n,apiReferenceData:r,selectedSecurityOptionIndex:i}=aC.usePlaygroundInputsStore.getState(),{locallyStoredCredentials:o}=t();r&&void 0!==o&&e({locallyStoredCredentials:aQ(n,r,i,o)})},syncServerVariablesState:()=>{var n;let{inputs:r,apiReferenceData:i,selectedBaseUrlIndex:o}=aC.usePlaygroundInputsStore.getState(),{locallyStoredServerVariables:a}=t();if(!i)return;let l=(0,C.unflattenInputs)(r),s=null==(n=i.operation)?void 0:n.userInfoPlaygroundInputs,u=Object.assign(Object.assign({},null==s?void 0:s.server),l.server),c=aY(i.operation,o);e({locallyStoredServerVariables:Object.assign(Object.assign({},null!=a?a:{}),{[c]:u})})},updateLocalStorage:e=>void aG(void 0,void 0,void 0,function*(){let{apiReferenceData:t,selectedBaseUrlIndex:n,inputs:r,selectedSecurityOptionIndex:i}=aC.usePlaygroundInputsStore.getState();yield aZ({apiReferenceData:t,selectedBaseUrlIndex:n,inputs:r,selectedSecurityOptionIndex:i,storage:e})})})),aQ=(e,t,n,r)=>{var i,o;let a=(0,C.unflattenInputs)(e),l=null==(o=null==(i=t.dependencies)?void 0:i.processedSecurityOptions)?void 0:o[n],s={query:Object.assign({},null==r?void 0:r.query),header:Object.assign({},null==r?void 0:r.header),cookie:Object.assign({},null==r?void 0:r.cookie)};if(l)for(let e of"schemes"in l?l.schemes:[l]){let t=e.name,n="in"in e.scheme?e.scheme.in:"header",r=a[n][t];void 0!==r&&(s[n][t]=r)}return s},aZ=e=>aG(void 0,[e],void 0,function*({apiReferenceData:e,selectedBaseUrlIndex:t,inputs:n,selectedSecurityOptionIndex:r,storage:i}){var o;let a=null==(o=null==e?void 0:e.operation)?void 0:o.userInfoPlaygroundInputs,l=(0,C.unflattenInputs)(n),s=aX(),u=Object.assign(Object.assign({},null==a?void 0:a.server),l.server),c=aY(null==e?void 0:e.operation,t),d=JSON.stringify(Object.assign(Object.assign({},s),{[c]:u}));localStorage.setItem(aV,d);let p=yield(0,aH.loadCredentialStore)(i),f=e?aQ(n,e,r,p):p;yield i.store(aH.CREDENTIALS_LOCALSTORAGE_KEY,f)});var a0=e.i(450322),a1=e.i(407859);function a2({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:n,selectedExampleIndex:r,selectedContentTypeIndex:i,locallyStoredCredentials:o,serverInputs:a}){var l;let s=null==(l=e.operation)?void 0:l.userInfoPlaygroundInputs,u=(0,a1.getExternalApiPlaygroundServerInputs)();return a5({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:n,selectedExampleIndex:r,selectedContentTypeIndex:i,mergedUserInfo:{server:Object.assign(Object.assign(Object.assign({},null==s?void 0:s.server),a),u),header:Object.assign(Object.assign({},null==s?void 0:s.header),null==o?void 0:o.header),query:Object.assign(Object.assign({},null==s?void 0:s.query),null==o?void 0:o.query),cookie:Object.assign(Object.assign({},null==s?void 0:s.cookie),null==o?void 0:o.cookie),path:Object.assign({},null==s?void 0:s.path)}})}let a5=({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:n,selectedExampleIndex:r=0,selectedContentTypeIndex:i=0,mergedUserInfo:o})=>{var a,l,s,u,c,d,p,f,m,h;let g={},y=null==(a=e.operation)?void 0:a.prefillPlaygroundWithExample,v=(null!=(s=null==(l=e.operation)?void 0:l.prefillPlaygroundExamples)?s:[])[r],x=null==(d=Object.values(null!=(c=null==(u=e.dependencies)?void 0:u.servers)?c:{})[t])?void 0:d.variables,b=null==(p=e.dependencies)?void 0:p.processedSecurityOptions,w=null==b?void 0:b[n],j=null==(f=e.depen
14dencies)?void 0:f.parameters,S=null==(m=e.dependencies)?void 0:m.requestBody;if(y&&v)g=Object.assign(Object.assign(Object.assign(Object.assign({},a4(x)),a6(w)),a3({apiReferenceData:e,parameters:j})),v);else if("examples"===(0,a0.requestBodyExampleType)(S,(0,C.getRequestBodyContentType)(e,i)))g=Object.assign(Object.assign(Object.assign({},a4(x)),a6(w)),a3({apiReferenceData:e,parameters:j}));else{let t=null==(h=e.operation)?void 0:h.requiredOnlyExamples;g=Object.assign(Object.assign(Object.assign(Object.assign({},a4(x)),a6(w)),a3({apiReferenceData:e,parameters:j})),t?{}:function({requestBody:e,apiReferenceData:t,selectedContentTypeIndex:n}){let r={};if(!e)return r;let i=(0,C.getRequestBodyContentType)(t,n);if(i){let t=(0,eS.getBodySchema)(e.content[i]),n="object"==typeof t&&null!==t?(0,C.getSchemaDefault)(t):void 0;if(n)r[`${O.apiPlaygroundInputKeys.body}`]=n;else if((0,C.isSchemaObject)(t)){let e=(0,C.getBodyDefaultsFromSchema)(t);return Object.assign(Object.assign({},r),e)}}return r}({requestBody:S,apiReferenceData:e,selectedContentTypeIndex:i}))}return o&&(g=Object.assign(Object.assign({},g),function({mergedUserInfo:e,securityOption:t,serverVariables:n,apiReferenceData:r}){var i,o,a;let l={};if(t){let n={};t.schemes.forEach(({scheme:e,name:t})=>{n[t]=e}),Object.entries(null!=(i=e.header)?i:{}).forEach(([e,t])=>{let r=n[e];r&&((0,C.isBasicAuth)(r)?("object"==typeof t&&null!==t&&"username"in t&&"string"==typeof t.username&&(l[`${O.apiPlaygroundInputKeys.header}.Authorization.username`]=t.username),"object"==typeof t&&null!==t&&"password"in t&&"string"==typeof t.password&&(l[`${O.apiPlaygroundInputKeys.header}.Authorization.password`]=t.password)):"string"==typeof t&&(l[`${O.apiPlaygroundInputKeys.header}.${(0,C.escapeDots)(e)}`]=t))}),Object.entries(null!=(o=e.query)?o:{}).forEach(([e,t])=>{n[e]&&(l[`${O.apiPlaygroundInputKeys.query}.${(0,C.escapeDots)(e)}`]=t)}),Object.entries(null!=(a=e.cookie)?a:{}).forEach(([e,t])=>{n[e]&&(l[`${O.apiPlaygroundInputKeys.cookie}.${(0,C.escapeDots)(e)}`]=t)})}if(n&&Object.keys(n).length>0&&e.server&&Object.entries(e.server).forEach(([e,t])=>{n[e]&&(l[`${O.apiPlaygroundInputKeys.server}.${(0,C.escapeDots)(e)}`]=t)}),e.path&&Object.keys(e.path).length>0){let{path:t}=(0,C.getParametersPerSection)(r),n=new Set(t.map(e=>e.name));Object.entries(e.path).forEach(([e,t])=>{n.has(e)&&(l[`${O.apiPlaygroundInputKeys.path}.${(0,C.escapeDots)(e)}`]=t)})}return l}({mergedUserInfo:o,securityOption:w,serverVariables:x,apiReferenceData:e}))),g};function a4(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{let r=`${O.apiPlaygroundInputKeys.server}.${(0,C.escapeDots)(e)}`;if("object"==typeof n&&null!==n){let e=(0,C.getSchemaDefault)(n);e&&(t[r]=e)}}),t}function a6(e){let t={};return e&&e.schemes.forEach(({scheme:e,schema:n,name:r})=>{let i=(0,C.getSecurityOptionInputKeyPrefix)({scheme:e,name:r}),o=(0,C.getSchemaDefault)(n);o&&"string"==typeof o&&(t[i]=o),o&&"object"==typeof o&&(t[i+".username"]="username"in o&&"string"==typeof o.username?o.username:"",t[i+".password"]="password"in o&&"string"==typeof o.password?o.password:"")}),t}function a3({apiReferenceData:e,parameters:t}){let n={};if(!t)return n;let{header:r,path:i,query:o,querystring:a,cookie:l}=(0,C.getParametersPerSection)(e);return[...r,...i,...o,...a,...l].forEach(e=>{if(e.schema){let t=`${(0,C.mapParamInToPlaygroundInputKey)(e.in)}.${(0,C.escapeDots)(e.name)}`,r=(0,C.getSchemaDefault)(e.schema);r&&(n[t]=r)}}),n}var a8=e.i(167057),a9=e.i(979691),a7=e.i(420078);e.i(45082);var le=e.i(963899),lt=e.i(25871),ln=e.i(346944);let lr=({name:e,schema:t,clearValue:n,parentNames:r,style:i,explode:a,inputKeyPrefix:l,arrayIndices:s,isArrayChild:u,isBody:c,onChangeCallback:d,defaultExpanded:p,depth:f})=>{let m="oneOf"in t&&t.oneOf?t.oneOf.filter(C.isSchemaObject):[],h=(0,C.generateSchemaOptionLabels)(m),g=m.map((e,t)=>({label:h[t]??(0,C.generateSimpleSchemaLabel)(e),schema:e})),y=(0,aC.usePlaygroundInputsStore)(e=>e.setInput),v=(0,aC.usePlaygroundInputsStore)(e=>e.deleteInput),b=(0,I.getUniqueInputKey)(l,t,s),w=`${b}.oneOf.`,j=(0,aC.usePlaygroundInputsStore)((0,ln.useShallow)(e=>{let t={};
14return Object.keys(e.inputs).forEach(n=>{n.startsWith(w)&&(t[n]=e.inputs[n])}),t})),S=(0,x.useMemo)(()=>{let e=Object.keys(j).find(e=>e.startsWith(w));if(e){let t=e.slice(w.length).match(/^(\d+)(?:\.|$)/);if(t&&t[1]){let e=parseInt(t[1],10);if(e>=0&&e<m.length)return e}}return 0},[j,w,m.length]),[E,k]=(0,x.useState)(S);(0,x.useEffect)(()=>{k(S)},[S]);let O=m[E],R=(0,aC.usePlaygroundInputsStore)(e=>e.setInputs),T=e=>{v(b);let t=m[e];if(t&&"type"in t&&"null"===t.type)y(b,null);else if(y(b,void 0),c&&t){let e=(0,C.getBodyDefaultsFromSchema)(t);Object.keys(e).length>0&&R(e)}k(e)};if(!O)return null;let P=m.every(e=>"object"===e.type||(0,C.isObjectArray)(e));if(!u&&P&&c){let t=(0,C.generateSchemaOptionLabels)(m);return(0,o.jsx)(le.Tabs,{defaultTabIndex:E,onClickTab:T,className:"border-gray-100! mb-4! dark:border-white/10!",children:t.map(t=>(0,o.jsx)(lt.Tab,{title:t,children:(0,o.jsx)(l_,{skipContainer:!0,arrayIndices:s,name:e,schema:O,clearValue:n,parentNames:r,style:i,explode:a,inputKeyPrefix:l,onChangeCallback:d,defaultExpanded:p,depth:f})},t))})}let N=(0,o.jsx)(as,{options:g,selectedIndex:E,onSelectOption:T});return(0,o.jsx)(l_,{name:e,schema:O,typeDropdown:N,clearValue:n,parentNames:r,style:i,explode:a,inputKeyPrefix:l,arrayIndices:s,isArrayChild:u,onChangeCallback:d,defaultExpanded:p,depth:f})},li=({schema:e,...t})=>{let n=(0,x.useMemo)(()=>{let t=(0,C.convertAnySchemaToOneOfs)(),n=e.uniqueKey??"",{type:r,typeLabel:i,oneOf:o,uniqueKey:a,...l}=e;return{...e,oneOf:(t.oneOf??[]).filter(C.isSchemaObject).map((e,t)=>({...l,...e,uniqueKey:n?`${n}.oneOf.${t}`:`oneOf.${t}`}))}},[e]);return(0,o.jsx)(lr,{...t,schema:n})};var lo=e.i(579629),la=e.i(422233);let ll=e=>{let t=(0,C.getDifferentiatedType)(e);if("object"!==t&&"array"!==t){let t=(0,C.getSchemaDefault)(e);if(void 0!==t)return t}switch(t){case"object":return{};case"array":return[];case"string":case"enum<string>":return"";case"number":case"integer":case"enum<number>":case"enum<integer>":return 0;case"boolean":return!1;case"enum<boolean>":return(0,C.getBooleanEnumOptions)(e)[0]??!1;case"null":return null;case"oneOf":if(e.oneOf&&Array.isArray(e.oneOf)&&e.oneOf.length>0){let t=e.oneOf[0];if((0,C.isSchemaObject)(t)&&"null"!==t.type)return ll(t);if(e.oneOf.length>1&&(0,C.isSchemaObject)(e.oneOf[1]))return ll(e.oneOf[1])}return;default:return}},ls=(e,t,n)=>{let r={};if(!e.properties)return r;for(let i of Object.values(e.properties))if((0,C.isSchemaObject)(i))if("object"===i.type)Object.assign(r,ls(i,t,n));else{let e=(0,C.getSchemaDefault)(i);void 0!==e&&(r[(0,I.getUniqueInputKey)(t,i,n)]=e)}return r},lu=({schema:e,depth:t,parentNames:n,inputKeyPrefix:r,arrayIndices:i,onChangeCallback:a,defaultExpanded:l})=>{let s=(0,d.useSelectedLocale)(),u=(0,aC.usePlaygroundInputsStore)(e=>e.setInputs),c=(0,aC.usePlaygroundInputsStore)(e=>e.deleteInput),p=(0,aC.usePlaygroundInputsStore)((0,ln.useShallow)(e=>e.inputs)),f=(0,la.v4)(),m="items"in e&&(0,C.isSchemaObject)(e.items)?e.items:void 0;if(!m)return null;let h="uniqueKey"in m?m.uniqueKey:"",g=`${r}.${h}`;i?.forEach(e=>{g=g.replace("[INDEX]",String(e))}),g=g.replaceAll("[INDEX]","");let y=[];Object.keys(p).forEach(e=>{if(e.startsWith(g)){let t=e.substring(g.length).match(/^(\d+)/);if(t){let e=parseInt(t[1]??"0",10);y.includes(e)||y.push(e)}}}),y.sort((e,t)=>e-t);let x=y.length>0?Math.max(...y)+1:0;return(0,o.jsxs)(o.Fragment,{children:[y.map(e=>{let s=[...i??[],e],u=(0,I.getUniqueInputKey)(r,m,s);return(0,o.jsx)(l_,{schema:m,arrayIndices:s,depth:(t??0)+1,parentNames:n,inputKeyPrefix:r,clearValue:()=>{c(u)},isArrayChild:!0,onChangeCallback:a,defaultExpanded:l},`item-${e}`)}),(0,o.jsx)(lo.AdditionalItemButton,{label:s["api.addItem"],className:(0,v.cn)(y.length>0&&"mt-4"),onClick:()=>{let e=[...i??[],x],t=(0,I.getUniqueInputKey)(r,m,e);u({[t]:ll(m),...ls(m,r,e)})},dataTestId:g+"add-item-button"},"add-item-button"+f)]})},lc=({name:e,schema:t,inputKeyPrefix:n,arrayIndices:r})=>{let i=(0,d.useSelectedLocale)(),a=(0,x.useRef)(null),[l,s]=(0,x.useState)(!1),u=(0,C.getSchemaPlaceholder)(t)??"Drop a file here or click to upload",c=(0,I.getUniqueInputKey)(n,t,r),{value:p,setInput:f}=(0,aC.usePlaygroundInput)(c),m=p instanceof File?p:void 0,h=m?.name??u;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("button",{"aria-label":i["aria.fileUploadButton"],className:(0,v.cn)("text-left flex text-playground-input overflow-hidden",m||l?"text-gray-900! dark:text-gray-100!":"text-gray-400! dark:text-white/30!"),onClick:()=>a.current?.click(),onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy",s(!0)},onDragLeave:()=>s(!1),onDrop:e=>{e.preventDefault(),s(!1);let t=e.dataTransfer.files[0];t&&(f(c,t),a.current&&(a.current.value=""))},children:h}),(0,o.jsx)("input",{type:"file","data-testid":`${e??"file"}-input`,onChange:e=>{f(c,e.target.files?.[0])},ref:a,className:"hidden"})]})};var ld=e.i(861862),lp=e.i(239140),lf=e.i(715227),lm=e.i(786475),lh=e.i(321472),lg=e.i(344246),ly=e.i(757808);
14let lv=({name:e,schema:t,defaultExpanded:n=!0,typeDropdown:r,arrayIndices:i,parentNames:a,clearValue:l,style:s,explode:u,children:c,isArrayChild:d,depth:p})=>{let f="array"===t.type,m="object"===t.type,[h,g]=(0,x.useState)(!m||0===p||n),y=(0,lh.useHiddenUntilFound)({hidden:!h,onReveal:()=>g(!0)}),b=(0,C.isEnum)(t)&&t.description&&(0,lg.containsMarkdownTable)(t.description),w=m?Object.keys(t.properties??{}).length:0,j=i&&i.length>0?i[i.length-1]:void 0,S=void 0!=j&&d;return void 0==j||!d||m||f?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:(0,v.cn)("flex space-x-3 items-start",S&&!m&&"flex items-center"),children:[S&&(0,o.jsx)(ld.ArrayCount,{className:(0,v.cn)(m&&"mt-8"),children:j+1}),(0,o.jsxs)("div",{className:(0,v.cn)("flex-1 grid lg:grid-cols-2 gap-x-12 gap-y-4 py-5 max-w-full",f&&"flex flex-col",m&&"gap-y-0 flex flex-col border border-gray-50 dark:border-white/5 rounded-xl px-4 py-0 my-5",S&&"py-1 my-2"),"data-testid":e?`api-input-${e}`:void 0,children:[(0,o.jsxs)("div",{className:(0,v.cn)("space-y-2",m&&"pt-8 py-5 border-b border-gray-50 dark:border-white/5",!h&&"border-none",S&&!m&&"flex items-center"),children:[(0,o.jsxs)("div",{className:"flex items-center justify-between font-mono font-bold",children:[(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs truncate",title:a&&a.length>0?`${a.join(".")}.${e}`:e,children:[(0,o.jsx)("div",{className:(0,v.cn)("text-sm truncate",void 0==e&&"hidden"),children:a&&a.length>0&&"deepObject"===s&&u?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:a.map((e,t)=>(0,o.jsxs)(o.Fragment,{children:[e,0===t?"[":"]["]}))}),(0,o.jsx)("span",{className:"font-semibold text-gray-900 dark:text-gray-100",children:e}),(0,o.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:"]"})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:a?`${a.join(".")}.`:""}),(0,o.jsx)("span",{className:"font-semibold text-gray-900 dark:text-gray-100",children:e})]})}),void 0!=r?r:(0,o.jsx)(lm.InfoPill,{className:"text-wrap",children:t.typeLabel}),t.isRequired&&(0,o.jsx)(lm.RequiredPill,{}),t.deprecated&&(0,o.jsx)(lm.DeprecatedPill,{})]}),m&&(0,o.jsx)(lf.ObjectExpandButton,{onClick:()=>g(!h),count:w,expanded:h})]}),t.description&&!b&&(0,o.jsx)(lp.Description,{markdown:t.description,className:"text-gray-500 dark:text-gray-400"})]}),(0,o.jsx)("div",{ref:y,className:(0,v.cn)("grid grid-cols-1 w-full items-start divide-y divide-gray-50 dark:divide-white/5",f&&"divide-y-0"),children:c})]}),(void 0!=i&&i.length>0||a)&&l&&(0,o.jsx)(lx,{className:(0,v.cn)(m&&"mt-8",a&&"mt-7"),onClick:()=>l()})]}),t.description&&b&&(0,o.jsx)(lp.Description,{markdown:t.description,className:"text-gray-500 dark:text-gray-400"})]}):(0,o.jsxs)("div",{className:"flex space-x-3 items-center",children:[(0,o.jsx)(ld.ArrayCount,{children:j+1}),(0,o.jsxs)("div",{className:"flex-1 min-w-0 flex items-center gap-2 py-1 my-2","data-testid":e?`api-input-${e}`:`api-input-array-item-${j}`,children:[r,(0,o.jsx)("div",{className:"flex-1 min-w-0",children:c})]}),l&&(0,o.jsx)(lx,{onClick:()=>l()})]})},lx=({className:e,onClick:t})=>{let n=(0,d.useSelectedLocale)();return(0,o.jsx)("button",{className:(0,v.cn)("px-1 text-gray-400 dark:text-gray-600 hover:text-gray-600 dark:hover:text-gray-400",e),onClick:t,"aria-label":n["aria.deleteItem"],children:(0,o.jsx)(ly.TrashIcon,{strokeWidth:2,className:"size-4"})})},lb=()=>(0,o.jsx)("input",{className:"flex-1 min-w-0 outline-0 bg-transparent text-playground-input",type:"text",placeholder:"--",contentEditable:"false",disabled:!0});var lw=e.i(111048),lj=e.i(462153);let lS=({name:e,schema:t,inputKeyPrefix:n,numberType:r,arrayIndices:i,onChangeCallback:a})=>{let l=(0,d.useSelectedLocale)(),s=(0,C.getSchemaPlaceholder)(t),u=(0,I.getUniqueInputKey)(n,t,i),{value:c,setInput:p}=(0,aC.usePlaygroundInput)(u),f=s??l["api.enterValue"].replace("{name}",e??l["api.value"]),m=t.type,h=((e,t)=>"integer"===e?(0,lj.isInteger)(t)?t:void 0:(0,lj.isNumber)(t)?t:void 0)(r,c);return(0,o.jsx)("input",{id:lw.Ids.APIPlaygroundInput,className:"flex-1 min-w-0 bg-transparent outline-0 text-playground-input",placeholder:f,"aria-label":s??l["aria.enterValue"].replace("{name}",e??l["api.value"]),onKeyDown:e=>{("e"===e.key||"."===e.key&&"integer"===m)&&e.preventDefault()},type:"number",value:h??"",onChange:e=>{if(0===e.target.value.length){p(u,void 0),a?.();return}if("integer"===m){let t=parseInt(e.target.value);if(isNaN(t))return;p(u,t)}else p(u,parseFloat(e.target.value));a?.()}})};var lE=e.i(275143),lk=e.i(110683);let lO=({count:e,hidden:t,onReveal:n,id:r,children:i,className:a})=>{let l=(0,lh.useHiddenUntilFound)({hidden:t&&e>0,onReveal:n}
14);return 0===e?null:(0,o.jsx)("div",{ref:l,id:r,"data-testid":"optional-fields-group",className:(0,v.cn)("divide-y divide-gray-100 dark:divide-white/10",a),children:i})},lC=e=>"path"===e.in||!!e.required,lI=e=>{let t=[...e].sort((e,t)=>{let n=lC(e);return n===lC(t)?0:n?-1:1}),n=[],r=[];for(let e of t)lC(e)?n.push(e):r.push(e);return{required:n,optional:r}},lR=(0,x.createContext)({expandedSections:new Set,setSectionsExpanded:()=>{}}),lT=({resetKey:e,children:t})=>{let[n,r]=(0,x.useState)(new Set),[i,a]=(0,x.useState)(e);i!==e&&(a(e),r(new Set));let l=(0,x.useCallback)((e,t)=>{r(n=>{let r=new Set(n);return e.forEach(e=>{t?r.add(e):r.delete(e)}),r})},[r]),s=(0,x.useMemo)(()=>({expandedSections:n,setSectionsExpanded:l}),[n,l]);return(0,o.jsx)(lR.Provider,{value:s,children:t})},lP=()=>(0,x.useContext)(lR),lN=new Map([[O.apiPlaygroundInputKeys.header,"header"],[O.apiPlaygroundInputKeys.cookie,"cookie"],[O.apiPlaygroundInputKeys.path,"path"],[O.apiPlaygroundInputKeys.query,"query"],[O.apiPlaygroundInputKeys.querystring,"querystring"],[O.apiPlaygroundInputKeys.body,"body"]]),lA=e=>Array.isArray(e.oneOf)?Math.max(0,...e.oneOf.filter(C.isSchemaObject).map(lA)):"object"===e.type&&e.properties?Object.values(e.properties).filter(e=>(0,C.isSchemaObject)(e)&&!0!==e.isRequired).length:0,lM=[],lL=({schema:e,inputKeyPrefix:t,arrayIndices:n,name:r})=>{let i=(0,d.useSelectedLocale)(),a=(0,I.getUniqueInputKey)(t,e,n),{value:l,setInput:s}=(0,aC.usePlaygroundInput)(a),u=(0,x.useCallback)(e=>{if(null==e)return"";if("string"==typeof e)return e;try{return JSON.stringify(e,null,2)}catch{return""}},[]),c=(0,x.useMemo)(()=>u(l),[u,l]),[p,f]=(0,x.useState)(c),m=(0,x.useRef)(!1);(0,x.useEffect)(()=>{m.current||f(c)},[c]);let h=(0,x.useCallback)(e=>{let t=e.target.value;if(f(t),!t.trim())return void s(a,void 0);try{let e=JSON.parse(t);"object"==typeof e&&null!==e&&s(a,e)}catch{}},[a,s]),g=(0,x.useCallback)(()=>{m.current=!0},[]),y=(0,x.useCallback)(()=>{m.current=!1,f(u(l))},[u,l]),v=Math.max(2,Math.min(15,p.split("\n").length));return(0,o.jsx)("textarea",{className:"-mx-3.5 px-3.5 flex-1 min-h-[2.5rem] min-w-0 bg-transparent outline-0 text-playground-input resize-y font-mono text-xs",rows:v,placeholder:i["api.enterValueCapitalized"].replace("{name}",r??i["api.value"]),"aria-label":i["aria.enterValue"].replace("{name}",r??i["api.value"]),value:p,onChange:h,onFocus:g,onBlur:y,spellCheck:!1,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})},lD=({schema:e,depth:t,parentNames:n,style:r,explode:i,inputKeyPrefix:a,name:l,arrayIndices:s,onChangeCallback:u,defaultExpanded:c})=>{let d=(0,aC.usePlaygroundInputsStore)(e=>e.deleteInput),[p,f]=(0,x.useState)([]),{expandedSections:m,setSectionsExpanded:h}=lP(),g=(0,C.isSchemaObject)(e.additionalProperties),y=(0,aC.usePlaygroundInputsStore)((0,ln.useShallow)(t=>{if(!g)return lM;let n=`${(0,I.getUniqueInputKey)(a,e,s)}.`,r=new Set(Object.keys(e.properties??{})),i=[];return Object.keys(t.inputs).forEach(e=>{if(!e.startsWith(n))return;let t=e.slice(n.length).match(/^((?:\\.|[^.\\])+)/)?.[1];if(!t)return;let o=(0,C.decodePathSegment)(t).replaceAll("\\.",".");r.has(o)||i.includes(o)||i.push(o)}),i})),v=(0,x.useMemo)(()=>[...p,...y.filter(e=>!p.includes(e))],[p,y]);if(!(Object.keys(e.properties??{}).length>0)&&!g)return(0,o.jsx)(lL,{schema:e,inputKeyPrefix:a,arrayIndices:s,name:l});let b=[],w=[];Object.entries(e.properties??{}).forEach(([e,d])=>{if((0,C.isSchemaObject)(d)){let p=l?[...n??[],l]:void 0,f=(0,o.jsx)(l_,{name:e,schema:d,depth:(t??0)+1,parentNames:p,style:r,explode:i,arrayIndices:s,inputKeyPrefix:a,onChangeCallback:u,defaultExpanded:c},e);l$(d)?b.push(f):w.push(f)}});let j=!1!==e.additionalProperties,S=(0,la.v4)(),E=[];v.forEach(p=>{let m=l?[...n??[],l]:n;if((0,C.isSchemaObject)(e.additionalProperties)){let n=e.uniqueKey??"",l=n?`${n}.${(0,C.escapeDots)(p)}`:(0,C.escapeDots)(p),h=e.additionalProperties,g="uniqueKey"in h&&"string"==typeof h.uniqueKey?h.uniqueKey:"",y=(0,lk.updateSchemaUniqueKeys)(h,g,l),v=(0,I.getUniqueInputKey)(a,y,s);E.push((0,o.jsx)(l_,{name:p,schema:y,depth:(t??0)+1,parentNames:m,style:r,explode:i,arrayIndices:s,inputKeyPrefix:a,clearValue:()=>{d(v),f(e=>e.filter(e=>e!==p))},onChangeCallback:u,defaultExpanded:c},p))}else{let n=e.uniqueKey??"",l=(0,C.convertAnySchemaToOneOfs)(),h=`${n}.${(0,C.escapeDots)(p)}.oneOf`,g={oneOf:l.oneOf?.map((e,t)=>({...e,uniqueKey:`${h}.${t}`})),uniqueKey:h};(0,C.isSchemaObject)(g)&&E.push((0,o.jsx)(l_,{name:p,schema:g,depth:(t??0)+1,parentNames:m,style:r,explode:i,arrayIndices:s,inputKeyPrefix:a,clearValue:()=>{d((0,I.getUniqueInputKey)(a,g,s)),f(e=>e.filter(e=>e!==p))},onChangeCallback:u,defaultExpanded:c},p))}});let k=0===t?(e=>{let t=e.split(".")[0];return void 0===t?void 0:lN.get(t)})(a):void 0,O=void 0!==k&&!m.has(k),R=(0,o.jsx)(lO,{count:w.length,hidden:O,onReveal:()=>{void 0!==k&&h([k],!0)},children:w});if(0===t)return(0,o.jsxs)(o.Fragment,{children:[b,R,E]});let T=[...Object.keys(e.properties??{}),...v];return(0,o.jsxs)(o.Fragment,{children:[b,R,E,j?(0,o.jsx)(lE.AdditionalPropertyButton,{existingKeys:T,onAddKey:e=>{f([...p,e])},dataTestId:e.uniqueKey+".additional-property-button"},"add-property-button"+S):null]})},l$=e=>!0===e.isRequired;var lq=e.i(448205);
14let lU=({name:e,schema:t,inputKeyPrefix:n,enumType:r,arrayIndices:i,parentNames:a,clearValue:l,onChangeCallback:s})=>{let u=(0,d.useSelectedLocale)(),c=(0,C.getSchemaPlaceholder)(t),p=t.enum?.filter(e=>"number"==typeof e||"string"==typeof e)??[],f="boolean"===t.type?(0,C.getBooleanEnumOptions)(t):p,m=(0,I.getUniqueInputKey)(n,t,i),{value:h,setInput:g}=(0,aC.usePlaygroundInput)(m),y=(0,aC.usePlaygroundInputsStore)(e=>e.deleteInput),x=((e,t)=>{switch(e){case"integer":return(0,lj.isInteger)(t)?t:void 0;case"number":return(0,lj.isNumber)(t)?t:void 0;case"string":return(0,lj.isString)(t)?t:void 0;case"boolean":return(0,lj.isBoolean)(t)?t:void 0;default:return}})(r,h),b=void 0!==l&&((i?.length??0)>0||a);return(0,o.jsxs)("div",{className:"flex items-center gap-1",children:[(0,o.jsxs)("div",{className:"relative flex-1",children:[(0,o.jsxs)("select",{className:(0,v.cn)("relative text-playground-input w-full text-left flex-1 outline-0 cursor-pointer bg-transparent pr-6",void 0!==x?"text-gray-900! dark:text-gray-100!":"text-gray-400! dark:text-white/30!"),value:x?.toString()??"","aria-label":c??u["aria.selectOption"].replace("{name}",e||u["api.option"]),onChange:e=>{"boolean"===r?g(m,"true"===e.target.value):"integer"===r?g(m,parseInt(e.target.value,10)):"number"===r?g(m,parseFloat(e.target.value)):g(m,e.target.value),s?.()},children:[(0,o.jsx)("option",{value:"",disabled:!0,children:c??u["api.selectOption"].replace("{name}",e||u["api.option"])}),f.map(e=>(0,o.jsx)("option",{value:e.toString(),children:e.toString()},e.toString()))]}),(0,o.jsx)(lq.ChevronDownIcon,{strokeWidth:2,className:"absolute right-2 top-1/2 -translate-y-1/2 size-4 text-gray-400 dark:text-white/30 pointer-events-none"})]}),void 0!==x&&!b&&(0,o.jsx)("button",{type:"button",className:"p-0.5 text-gray-400 dark:text-gray-600 hover:text-gray-600 dark:hover:text-gray-400",onClick:()=>{y(m)},"aria-label":u["aria.deleteItem"],children:(0,o.jsx)(ly.TrashIcon,{strokeWidth:2,className:"size-4"})})]})},lB=({name:e,schema:t,inputKeyPrefix:n,arrayIndices:r,onChangeCallback:i})=>{let a=(0,d.useSelectedLocale)(),l=(0,C.getSchemaPlaceholder)(t),{prefix:s,placeholder:u}=lF(t.format,a["api.enterBearerToken"]),c=(0,I.getUniqueInputKey)(n,t,r),{value:p,setInput:f}=(0,aC.usePlaygroundInput)(c),m=(0,lj.isString)(p)?p:void 0,h=s&&m?.startsWith(s)?m.substring(s.length):m;return(0,o.jsxs)("div",{className:"relative flex flex-1 items-center",children:[(0,o.jsx)("div",{className:"absolute left-2.5 top-0 bottom-0 flex items-center justify-center text-sm text-gray-800 dark:text-gray-100",children:s}),(0,o.jsx)("input",{id:lw.Ids.APIPlaygroundInput,className:"flex-1 min-w-0 bg-transparent outline-0 text-playground-input",style:{paddingLeft:s?.52*s.length+"rem":void 0},placeholder:l??u??a["api.enterValue"].replace("{name}",e??a["api.value"]),"aria-label":l??u??a["aria.enterValue"].replace("{name}",e??a["api.value"]),type:"text",value:h??"",onChange:e=>{(e=>{let t=`${s??""}${e}`;t?f(c,t):f(c,void 0)})(e.target.value),i?.()},spellCheck:!1})]})},lF=(e,t)=>e?.toLowerCase()==="bearer"?{prefix:"Bearer ",placeholder:t}:{},lz=({name:e,schema:t,inputKeyPrefix:n,arrayIndices:r,onChangeCallback:i})=>{let a=(0,d.useSelectedLocale)(),l=(0,I.getUniqueInputKey)(n,t,r),{value:s,setInput:u}=(0,aC.usePlaygroundInput)(l),c=(0,lj.isString)(s)?s:void 0,p=(0,C.getSchemaPlaceholder)(t);return(0,o.jsx)("textarea",{className:"-mx-3.5 px-3.5 flex-1 min-h-[2.5rem] min-w-0 bg-transparent outline-0 text-playground-input resize-y",rows:2,placeholder:p??a["api.enterValueCapitalized"].replace("{name}",e??a["api.value"]),"aria-label":p??a["aria.enterValue"].replace("{name}",e??a["api.value"]),value:c,onChange:e=>{u(l,e.target.value),i?.()},spellCheck:!1,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off"})},l_=({...e})=>{switch((0,C.getDifferentiatedType)(e.schema)){case"oneOf":return(0,o.jsx)(lr,{...e});case"any":case void 0:return(0,o.jsx)(li,{...e});case"string":{let t=e.isBody&&0===e.depth||e.skipContainer?lz:lB;return(0,o.jsx)(lv,{...e,children:(0,o.jsx)(t,{...e})})}case"object":if(e.isBody&&0===e.depth||e.skipContainer)return(0,o.jsx)(lD,{...e});return(0,o.jsx)(lv,{...e,children:(0,o.jsx)(lD,{...e})});case"number":return(0,o.jsx)(lv,{...e,children:(0,o.jsx)(lS,{...e,numberType:"number"})});case"integer":return(0,o.jsx)(lv,{...e,children:(0,o.jsx)(lS,{...e,numberType:"integer"})});case"array":return(0,o.jsx)(lv,{...e,children:(0,o.jsx)(lu,{...e})});case"boolean":case"enum<boolean>":return(0,o.jsx)(lv,{...e,children:(0,o.jsx)(lU,{...e,enumType:"boolean"})});case"enum<string>":return(0,o.jsx)(lv,{...e,children:(0,o.jsx)(lU,{...e,enumType:"string"})});case"enum<number>":return(0,o.jsx)(lv,{...e,children:(0,o.jsx)(lU,{...e,enumType:"number"})});case"enum<integer>":return(0,o.jsx)(lv,{...e,children:(0,o.jsx)(lU,{...e,enumType:"integer"})});case"file":return(0,o.jsx)(lv,{...e,children:(0,o.jsx)(lc,{...e})});case"null":return(0,o.jsx)(lv,{...e,children:(0,o.jsx)(lb,{})});default:return(0,o.jsx)(lv,{...e,children:(0,o.jsx)(lB,{...e})})}};var lK=e.i(568258);let lW=({name:e,validationState:t,children:n,rightElement:r,footer
14:i,onPaste:a})=>{let[l,s]=(0,x.useState)(!0),u=(0,d.useSelectedLocale)(),c=l&&null!=n&&!1!==n;return(0,o.jsxs)("div",{"data-testid":`api-input-section-${e}`,children:[(0,o.jsxs)("div",{role:"button",tabIndex:0,"aria-label":u["aria.expandInputSection"],onClick:()=>s(e=>!e),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),s(e=>!e))},className:(0,v.cn)("flex w-full px-4 py-2.5 items-center justify-between border-standard cursor-pointer hover:bg-gray-50 dark:hover:bg-white/5",c?"border-b-0! border-t border-x rounded-t-2xl":"rounded-2xl"),children:[(0,o.jsxs)("div",{className:"flex items-center gap-x-1.5",children:[(0,o.jsx)(lK.default,{icon:"angle-right",iconType:"solid",className:(0,v.cn)("h-3 w-3 bg-gray-400 dark:bg-gray-500 transition-transform",c&&"rotate-90")}),(0,o.jsxs)("div",{className:"flex-1 flex items-center space-x-2",children:[(0,o.jsx)("div",{className:"text-sm font-medium text-gray-800 dark:text-gray-200 leading-6",children:e}),t?"invalid"===t?(0,o.jsx)(lH,{}):(0,o.jsx)(lV,{}):null]})]}),(0,o.jsx)("div",{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:r})]}),(0,o.jsxs)("div",{onPaste:a,className:(0,v.cn)("bg-background-light dark:bg-background-dark flex-1 px-4 rounded-b-xl border-standard border-t-0!","[&>:not([hidden])~:not([hidden])]:border-t [&>:not([hidden])~:not([hidden])]:border-gray-100 dark:[&>:not([hidden])~:not([hidden])]:border-white/10",c?"":"hidden"),children:[(0,o.jsx)("div",{}),n,i?(0,o.jsx)("div",{className:"-mx-4 border-t-0!",children:i}):null]})]})},lH=()=>(0,o.jsx)(lK.default,{className:"h-4 w-4 bg-[#2AB673]",icon:"circle-check"}),lV=()=>(0,o.jsx)(lK.default,{className:"h-4 w-4 bg-[#CB3A32]",icon:"circle-exclamation"});var lY=e.i(340373),lX=e.i(129749);let lG=({count:e,expanded:t,onToggle:n,controlsId:r,className:i})=>{let a=(0,d.useSelectedLocale)();if(0===e)return null;let l=a[t?1===e?"api.collapseOptionalFields_one":"api.collapseOptionalFields_other":1===e?"api.expandOptionalFields_one":"api.expandOptionalFields_other"].replace("{count}",String(e)),s=t?lY.MinusIcon:lX.PlusIcon;return(0,o.jsxs)("button",{type:"button","aria-expanded":t,"aria-controls":r,onClick:n,"data-testid":"optional-fields-row",className:(0,v.cn)("flex h-9 w-full items-center gap-2 rounded-b-[calc(var(--radius-xl)-1px)] border-t border-gray-200 bg-gray-100 px-3.5 text-left text-sm leading-6 text-gray-600 hover:bg-gray-200/60 dark:border-white/10 dark:bg-white/5 dark:text-gray-400 dark:hover:bg-white/10",i),children:[(0,o.jsx)(s,{"aria-hidden":"true",className:"size-4 shrink-0 text-gray-400 dark:text-gray-500",strokeWidth:1.5}),(0,o.jsx)("span",{children:l})]})},lJ=({apiReferenceData:e,selectedContentTypeIndex:t,setSelectedContentTypeIndex:n,defaultExpanded:r})=>{let i=(0,d.useSelectedLocale)(),a=(0,aC.usePlaygroundInputsStore)(e=>e.setInputs),l=(0,aC.usePlaygroundInputsStore)(e=>e.deleteInput),{expandedSections:s,setSectionsExpanded:u}=lP(),{dependencies:c}=e,{requestBody:p}=c??{};if(!p)return null;let f=Object.entries(p.content).map(([e,t])=>({contentType:e,schema:(0,eS.getBodySchema)(t),label:e})),m=f[t];if(!m)return null;let h=(0,C.isSchemaObject)(m.schema)?m.schema:void 0,g=`${O.apiPlaygroundInputKeys.body}`,y=void 0===h?0:lA(h),x=s.has("body");return(0,o.jsx)(lW,{name:i["api.body"],rightElement:(0,o.jsx)(()=>(0,o.jsx)("div",{onClick:e=>e.stopPropagation(),className:(0,v.cn)("text-xs font-mono",f.length<=1&&"hidden"),children:(0,o.jsx)(as,{options:f,selectedIndex:t,onSelectOption:e=>{n(e)}})}),{}),footer:y>0?(0,o.jsx)(lG,{count:y,expanded:x,onToggle:()=>u(["body"],!x)}):void 0,onPaste:e=>{if(void 0===h)return;let t=(0,a9.getPastedJson)(e);if(void 0===t||!("object"===h.type&&(Object.keys(h.properties??{}).length>0||(0,C.isSchemaObject)(h.additionalProperties))||"array"===h.type&&"items"in h&&(0,C.isSchemaObject)(h.items)||Array.isArray(h.oneOf)&&h.oneOf.length>0))return;let n=(0,a7.getExampleBodyInputs)({schema:h,example:t});0!==Object.keys(n).length&&(e.preventDefault(),l(g),a(n))},children:void 0===h?null:(0,o.jsx)(l_,{schema:h,isBody:!0,depth:0,inputKeyPrefix:g,defaultExpanded:r})})},lQ=({sectionsWithOptionalFields:e,onExpandAll:t,className:n})=>{let r=(0,d.useSelectedLocale)(),{expandedSections:i,setSectionsExpanded:a}=lP();if(0===e.length)return null;let l=e.some(e=>!i.has(e));return(0,o.jsx)("button",{type:"button","aria-expanded":!l,onClick:()=>{a(e,l),l&&t?.()},"data-testid":"optional-fields-toggle",className:(0,v.cn)("inline-flex h-8 items-center whitespace-nowrap rounded-[10px] border border-gray-200 bg-background-light px-2 text-sm font-medium leading-5 text-gray-800 hover:bg-gray-50 dark:border-white/10 dark:bg-background-dark dark:text-gray-200 dark:hover:bg-white/5",n),children:(0,o.jsxs)("span",{className:"grid justify-items-center",children:[(0,o.jsx)("span",{"aria-hidden":!l,className:(0,v.cn)("col-start-1 row-start-1",!l&&"invisible"),children:r["api.expandOptionalFields"]}),(0,o.jsx)("span",{"aria-hidden":l,className:(0,v.cn)("col-start-1 row-start-1",l&&"invisible"),children:r["api.collapseOptionalFields"]})]})})},lZ=({apiReferenceData:e,defaultExpanded:t})=>{let n=(0,d.useSelectedLocale)(),{expandedSections:r,setSectionsExpanded:i}=lP(),a=(0,x.useId)(),{dependencies:l}=e,{parameters:s}=l??{};if(!s||0===Object.keys(s).length)return null;let{header:u,path:c,query:p,querystring:f,cookie:m}=(0,C.getParametersPerSection)(e),h=e=>{if(void 0===e)return null;if((0,C.isSchemaObject)(e.schema)){let n=`${(0,C.mapParamInToPlaygroundInputKey)(e.in)}.${(0,C.escapeDots)(e.name)}`;return(0,o.jsx)(l_,{name:e.name,schema:{...e.schema,description:e.description},style:e.style,explode:e.explode,inputKeyPrefix:n,defaultExpanded:t},e.name)}return null},g=(e,t,n)=>{let{required:l,optional:s}=lI(e),u=l.map(h).filter(e=>null!==e),c=s.map(h).filter(e=>null!==e);if(0===u.length&&0===c.length)return null;let d=r.has(n),p=`${a}-${n}`;
14return(0,o.jsxs)(lW,{name:t,footer:c.length>0?(0,o.jsx)(lG,{count:c.length,expanded:d,onToggle:()=>i([n],!d),controlsId:p}):void 0,children:[u,(0,o.jsx)(lO,{id:p,count:c.length,hidden:!d,onReveal:()=>i([n],!0),children:c})]})};return(0,o.jsxs)(o.Fragment,{children:[g(u,n["api.header"],"header"),g(m,n["api.cookies"],"cookie"),g(c,n["api.path"],"path"),g(p,n["api.query"],"query"),g(f,n["api.queryString"],"querystring")]})};var l0=e.i(453778),l1=e.i(206558),l2=e.i(886235),l5=e.i(98586),l4=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function l(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,l)}s((r=r.apply(e,t||[])).next())})};class l6 extends Error{constructor(){super(...arguments),this.name="TransientTokenRequestError"}}let l3=(e,t)=>"string"==typeof e[t]?e[t]:void 0,l8=(e,t)=>"number"==typeof e[t]&&Number.isFinite(e[t])?e[t]:void 0,l9=e=>"bearer"===e.toLowerCase()?"Bearer":e,l7=(e,t)=>{let n=(0,lj.isObject)(e)?l3(e,"error"):void 0;return{code:"server_error",error:null!=n?n:`HTTP ${t}`,description:(0,lj.isObject)(e)?l3(e,"error_description"):void 0}},se=(e,t)=>new Promise((n,r)=>{if(t.aborted)return void r(t.reason);let i=setTimeout(()=>{t.removeEventListener("abort",o),n()},1e3*e),o=()=>{clearTimeout(i),r(t.reason)};t.addEventListener("abort",o,{once:!0})}),st=async(e,t,n)=>{let r,i;try{r=await fetch(`${l1.NEXT_PUBLIC.BASE_PATH}/_mintlify/api/request`,{method:"POST",headers:{"content-type":"application/json"},signal:n,body:JSON.stringify({method:"post",url:e,header:{"content-type":"application/x-www-form-urlencoded",accept:"application/json"},query:{},cookie:{},body:new URLSearchParams(t).toString(),followRedirects:!1})})}catch(e){throw new l6(e instanceof Error?e.message:"unable to reach the proxy")}let o=await r.json();if(o.error)throw(e=>"request timed out"===e||"no response received"===e)(o.errorMessage)?new l6(o.errorMessage):Error(o.errorMessage);let{status:a,headers:l,data:s}=o.response;if(a>=300&&a<400)throw Error(`the authorization server redirected (HTTP ${a}); redirects are not followed`);let u=l["content-type"];if("string"!=typeof u||!(0,aO.isJsonContentType)(u))return{status:a,body:void 0};let c="string"==typeof s?new TextDecoder().decode((0,l2.base64ToUint8Array)(s)):"";try{i=JSON.parse(c)}catch{i=void 0}return{status:a,body:i}},sn=(e,t)=>
14{switch(e.code){case"access_denied":return t["api.oauth.accessDenied"];case"expired_token":return t["api.oauth.codeExpired"];case"cancelled":return"";case"insufficient_scope":return`${t["api.oauth.insufficientScope"]} ${e.missing.join(", ")}`;case"unsupported_token_type":return`${t["api.oauth.unsupportedTokenType"]} ${e.tokenType}`;case"invalid_response":return`${t["api.oauth.connectionFailed"]} ${e.message}`;case"server_error":return`${t["api.oauth.connectionFailed"]} ${e.description??e.error}`}},sr=e=>{for(let t of[e.verificationUriComplete,e.verificationUri])if(void 0!==t)try{let e=new URL(t);if("https:"===e.protocol||"http:"===e.protocol)return e.href}catch{}},si="inline-flex h-8 items-center gap-1.5 rounded-lg border border-gray-200 bg-gray-50 px-3 text-xs font-medium text-gray-700 hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/10 dark:bg-white/5 dark:text-gray-200 dark:hover:bg-white/10",so=({configuration:e,onToken:t})=>{let n=(0,d.useSelectedLocale)(),r=(0,x.useId)(),[i,a]=(0,x.useState)(""),{state:l,connect:s,cancel:u}=(({configuration:e,onToken:t})=>{let[n,r]=(0,x.useState)({status:"idle"}),i=(0,x.useRef)(null),o=(0,x.useCallback)(()=>{i.current?.abort(),i.current=null,r({status:"idle"})},[]),a=JSON.stringify([e.deviceAuthorizationUrl,e.tokenUrl,e.requiredScopes.map(e=>e.name)]);return(0,x.useEffect)(()=>o,[o,a]),{state:n,connect:(0,x.useCallback)(async n=>{i.current?.abort();let o=new AbortController;i.current=o,r({status:"requesting"});try{let i,a,l=await (i={deviceAuthorizationUrl:e.deviceAuthorizationUrl,clientId:n,scopes:e.requiredScopes.map(e=>e.name),post:st,signal:o.signal},l4(void 0,[i],void 0,function*({deviceAuthorizationUrl:e,clientId:t,scopes:n,post:r,signal:i,now:o=()=>Date.now()}){let a={client_id:t};n.length>0&&(a.scope=n.join(" "));let l=o(),{status:s,body:u}=yield r(e,a,i);if(s>=400)return{ok:!1,failure:l7(u,s)};let c=(e=>{var t;if(!(0,lj.isObject)(e))return;let n=l3(e,"device_code"),r=l3(e,"user_code"),i=l3(e,"verification_uri"),o=l8(e,"expires_in");if(n&&r&&i&&void 0!==o&&!(o<=0))return{deviceCode:n,userCode:r,verificationUri:i,verificationUriComplete:l3(e,"verification_uri_complete")||void 0,expiresIn:o,interval:(0,l5.default)(null!=(t=l8(e,"interval"))?t:5,1,1800)}})(u);return c?{ok:!0,authorization:Object.assign(Object.assign({},c),{expiresAt:l+1e3*c.expiresIn})}:{ok:!1,failure:{code:"invalid_response",message:"Device authorization response is missing device_code, user_code, or verification_uri"}}}));if(o.signal.aborted)return;if(!l.ok)return void r({status:"failed",failure:l.failure});r({status:"pending",authorization:l.authorization});let s=await (a={tokenUrl:e.tokenUrl,clientId:n,authorization:l.authorization,post:st,signal:o.signal},l4(void 0,[a],void 0,function*({tokenUrl:e,clientId:t,authorization:n,post:r,signal:i,now:o=()=>Date.now()}){var a;let l=null!=(a=n.expiresAt)?a:o()+1e3*n.expiresIn,s=n.interval;try{for(;;){let a;if(o()+1e3*s>=l||(yield se(s,i),o()>=l))return{ok:!1,failure:{code:"expired_token"}};try{a=yield r(e,{grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:n.deviceCode,client_id:t},i)}catch(e){if(i.aborted||!(e instanceof l6))throw e;s+=5;continue}let{status:u,body:c}=a,d=(0,lj.isObject)(c)?c:{},p=l3(d,"error");if(u<400&&!p){let e=l3(d,"access_token"),t=l3(d,"token_type");if(!e||!t)return{ok:!1,failure:{code:"invalid_response",message:"Token response is missing access_token or token_type"}};return{ok:!0,token:{accessToken:e,tokenType:l9(t),expiresIn:l8(d,"expires_in"),refreshToken:l3(d,"refresh_token"),scope:l3(d,"scope")}}}switch(p){case"authorization_pending":continue;case"slow_down":s+=5;continue;
14case"access_denied":return{ok:!1,failure:{code:"access_denied"}};case"expired_token":return{ok:!1,failure:{code:"expired_token"}};default:return{ok:!1,failure:l7(c,u)}}}}catch(e){if(i.aborted)return{ok:!1,failure:{code:"cancelled"}};throw e}}));if(o.signal.aborted)return;if(s.ok){let n=((e,t)=>{if(void 0===e.scope)return[];let n=new Set(e.scope.split(/\s+/).filter(Boolean));return t.filter(e=>!n.has(e))})(s.token,e.requiredScopes.map(e=>e.name));if(n.length>0)return void r({status:"failed",failure:{code:"insufficient_scope",missing:n}});if("Bearer"!==s.token.tokenType)return void r({status:"failed",failure:{code:"unsupported_token_type",tokenType:s.token.tokenType}});t(s.token.accessToken,s.token.tokenType),r({status:"connected"})}else r({status:"failed",failure:s.failure})}catch(e){if(o.signal.aborted)return;r({status:"failed",failure:{code:"server_error",error:e instanceof Error?e.message:"unable to complete request"}})}},[e,t]),cancel:o}})({configuration:e,onToken:t}),c="requesting"===l.status||"pending"===l.status;return(0,o.jsxs)("div",{className:"my-3 space-y-3 rounded-xl border border-gray-200/70 px-4 py-3 text-sm dark:border-white/10","data-testid":"device-authorization-panel",children:[(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2 font-mono text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:[(0,o.jsx)("span",{children:n["api.oauth.flow"]}),(0,o.jsx)("span",{className:"rounded-md bg-gray-100 px-1.5 py-0.5 normal-case tracking-normal text-gray-700 dark:bg-white/10 dark:text-gray-200",children:n["api.oauth.deviceAuthorization"]})]}),(0,o.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,o.jsxs)("label",{className:"flex min-w-48 flex-1 flex-col gap-1 text-xs",htmlFor:r,children:[(0,o.jsx)("span",{className:"font-medium text-gray-600 dark:text-gray-300",children:n["api.oauth.clientId"]}),(0,o.jsx)("input",{id:r,value:i,onChange:e=>a(e.target.value),disabled:c,autoComplete:"off",spellCheck:!1,className:"h-8 rounded-lg border border-gray-200 bg-transparent px-2.5 text-sm text-gray-900 outline-none focus:border-gray-400 dark:border-white/10 dark:text-gray-100 dark:focus:border-white/30"})]}),c?(0,o.jsx)("button",{type:"button",onClick:u,className:si,children:n["api.oauth.cancel"]}):(0,o.jsx)("button",{type:"button",onClick:()=>void s(i.trim()),disabled:""===i.trim(),className:si,"data-testid":"device-authorization-connect",children:n["api.oauth.connect"]})]}),"pending"===l.status&&(0,o.jsxs)("div",{className:"space-y-2",role:"status",children:[(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,o.jsx)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:n["api.oauth.userCode"]}),(0,o.jsx)("code",{className:"rounded-md bg-gray-100 px-2 py-1 font-mono text-base font-semibold tracking-widest text-gray-900 dark:bg-white/10 dark:text-gray-100","data-testid":"device-authorization-user-code",children:l.authorization.userCode}),(0,o.jsx)(l0.CopyToClipboardButton,{textToCopy:l.authorization.userCode,showTooltip:!1,className:"relative"})]}),(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[sr(l.authorization)?(0,o.jsx)("a",{href:sr(l.authorization),target:"_blank",rel:"noreferrer noopener",className:(0,v.cn)(si,"no-underline"),children:n["api.oauth.openVerificationPage"]}):(0,o.jsx)("code",{className:"text-xs text-gray-700 dark:text-gray-200",children:l.authorization.verificationUriComplete??l.authorization.verificationUri}),(0,o.jsx)("span",{className:"animate-pulse text-xs text-gray-500 dark:text-gray-400",children:n["api.oauth.waitingForApproval"]})]})]}),"connected"===l.status&&(0,o.jsx)("p",{className:"text-xs text-green-700 dark:text-green-400",role:"status",children:n["api.oauth.connected"]}),"failed"===l.status&&""!==sn(l.failure,n)&&(0,o.jsx)("p",{className:"text-xs text-red-600 dark:text-red-400",role:"alert",children:sn(l.failure,n)})]})},sa=({apiReferenceData:e,updateLocalStorageCallback:t,defaultExpanded:n})=>{let r=(0,d.useSelectedLocale)(),{selectedSecurityOptionIndex:i,setSelectedSecurityOptionIndex:a}=(0,am.useSelectedSecurityOption)(),l=(0,aC.usePlaygroundInputsStore)(e=>e.setInput),s=(0,x.useCallback)((e,n,r)=>{l(e,`${r} ${n}`),t()}
14,[l,t]),u=e.dependencies?.processedSecurityOptions;if(!u||0===u.length)return null;let c=u[i];if(!c)return null;let p=u.map(e=>({label:e.deprecated?`${e.title} (${r["api.deprecated"]})`:e.title,schema:e.schemes[0]?.schema??{type:"string"}}));return(0,o.jsx)(lW,{name:r["api.authorization"],rightElement:(0,o.jsx)(()=>(0,o.jsx)("div",{onClick:e=>e.stopPropagation(),className:(0,v.cn)("text-xs font-mono",u.length<=1&&"hidden"),children:(0,o.jsx)(as,{options:p,selectedIndex:i,onSelectOption:e=>{a(e)}})}),{}),children:c.schemes.map(({scheme:e,schema:r,name:a},l)=>{let u=(0,C.getSecurityOptionInputKeyPrefix)({scheme:e,name:a}),c=(e=>{if("oauth2"!==e.type||!("deviceAuthorization"in e.flows))return;let t=e.flows.deviceAuthorization;if(!t)return;let n=ah(e);if(n.some(e=>!(e.name in t.scopes)))return;let r=n.map(e=>{let n=t.scopes[e.name]||e.description;return Object.assign({name:e.name},n?{description:n}:{})});return Object.assign(Object.assign({deviceAuthorizationUrl:t.deviceAuthorizationUrl,tokenUrl:t.tokenUrl},t.refreshUrl?{refreshUrl:t.refreshUrl}:{}),{requiredScopes:r})})(e),d="oauth2"===e.type&&(av(e).length>0||"oauth2MetadataUrl"in e);return(0,o.jsxs)(x.Fragment,{children:[r.description&&"object"===r.type&&(0,o.jsx)(lp.Description,{markdown:r.description,className:"text-gray-500 dark:text-gray-400 py-2"}),(0,o.jsx)(l_,{name:a,schema:r,inputKeyPrefix:u,skipContainer:"object"===r.type,onChangeCallback:t,defaultExpanded:n},`${e.type}-${a}`),d&&(0,o.jsx)(aS,{scheme:e}),c&&(0,o.jsx)(so,{configuration:c,onToken:(e,t)=>s(u,e,t)},`${i}-${u}`)]},`${e.type}-${a}-${l}`)})})},sl=({apiReferenceData:e,selectedBaseUrlIndex:t,updateLocalStorageCallback:n})=>{let{dependencies:r}=e,{servers:i}=r??{};if(!i||0===Object.keys(i).length)return null;let a=Object.values(i),l=a[t]?.variables;return l&&0!==Object.keys(l).length?(0,o.jsx)(lW,{name:"Server",children:Object.entries(l).map(([e,t])=>{let r={...t,type:"string"},i=`${O.apiPlaygroundInputKeys.server}.${(0,C.escapeDots)(e)}`;return(0,o.jsx)(l_,{name:e,schema:r,inputKeyPrefix:i,onChangeCallback:n},e)})}):null};var ss=e.i(885401),su=e.i(152537);let sc={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/avif":"avif","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","audio/mpeg":"mp3","audio/mp4":"m4a","audio/ogg":"ogg","audio/wav":"wav","audio/webm":"weba","audio/aac":"aac","audio/flac":"flac","video/mp4":"mp4","video/mpeg":"mpeg","video/ogg":"ogv","video/webm":"webm","video/quicktime":"mov","application/pdf":"pdf","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/json":"json","application/xml":"xml","application/zip":"zip","application/gzip":"gz","application/octet-stream":"bin","application/javascript":"js","application/wasm":"wasm","application/yaml":"yaml","text/yaml":"yaml","text/javascript":"js","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/xml":"xml","text/markdown":"md"},sd={json:"json",xml:"xml",zip:"zip",gzip:"gz"},sp=({message:e,icon:t})=>{let n=(0,ss.useCodeBlockThemeEnum)();return(0,o.jsx)("div",{className:(0,v.cn)("system"===n?"bg-response-body-auto":"bg-response-body-dark","rounded-b-xl"),children:(0,o.jsxs)("div",{className:"pb-8 pt-10 px-6 space-y-4 flex flex-col items-center",children:[(0,o.jsx)(lK.default,{icon:t,className:"h-8 w-8 bg-gray-300 dark:bg-white/20"}),(0,o.jsx)("div",{className:"text-sm text-center",children:e})]})})},sf=({data:e})=>{let t=(0,ss.useCodeBlockThemeEnum)();return(0,o.jsx)("div",{className:(0,v.cn)("system"===t?"bg-response-body-auto":"bg-response-body-dark","flex p-12 items-center rounded-b-xl h-full"),children:(0,o.jsx)("audio",{controls:!0,className:"w-full",src:e.url})})};var sm=e.i(876469),sh=e.i(306864),sg=e.i(650809);let sy=({data:e})=>{let t=(0,ss.useCodeBlockThemeObject)(),n=(0,d.useSelectedLocale)(),r=e.content.length>5*sm.MAX_PREVIEW_BYTES,i=((e,t,n=!1)=>
14{if(!(n||(0,eS.isSequentialMediaType)(t)))try{return{json:JSON.parse(e)}}catch(e){console.error(e);return}})(e.content,e.contentType,e.live),a=void 0!==i,l=(0,sg.useGetShikiHighlightedHtml)({codeString:i?JSON.stringify(i.json,null,2):e.content,codeBlockTheme:t,language:a?"json":"text",opts:{structure:"inline"}});return(0,o.jsxs)(su.ScrollArea,{className:"h-full",children:[(0,o.jsx)(su.ScrollAreaViewport,{role:"region","aria-label":n["aria.responseContent"],children:(0,o.jsx)(su.ScrollAreaContent,{className:"h-full",children:(0,o.jsx)("div",{className:(0,v.cn)(sh.SHIKI_CLASSNAME,"px-3 py-3.5 h-full whitespace-pre border-gray-200 dark:border-gray-700 dark:text-gray-300 font-mono text-xs leading-5",r&&"whitespace-pre-line"),children:a&&void 0!==l?(0,o.jsx)("span",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:l}}):(0,o.jsx)("span",{suppressHydrationWarning:!0,children:i?JSON.stringify(i.json,null,2):e.content})})})}),(0,o.jsx)(su.ScrollAreaScrollbar,{orientation:"horizontal"}),(0,o.jsx)(su.ScrollAreaScrollbar,{orientation:"vertical"}),(0,o.jsx)(su.ScrollAreaCorner,{})]})},sv=({data:e})=>{let t=(0,ss.useCodeBlockThemeEnum)();return(0,o.jsx)("div",{className:(0,v.cn)("system"===t?"bg-response-body-auto":"bg-response-body-dark","h-60"),children:(0,o.jsx)("img",{alt:"image response from the server",className:"p-6 w-full h-full object-scale-down",src:e.url})})},sx=({data:e})=>{let t=(0,ss.useCodeBlockThemeEnum)();return(0,o.jsx)("div",{className:(0,v.cn)("system"===t?"bg-response-body-auto":"bg-response-body-dark","flex p-2 items-center h-full rounded-xt"),children:(0,o.jsx)("video",{controls:!0,className:"w-full rounded-lg",src:e.url})})},sb=({data:e})=>{let t=(0,d.useSelectedLocale)();if(null==e)return(0,o.jsx)(sp,{message:t["api.noBodyReceived"],icon:"brackets-curly"});switch(e.type){case"video":return(0,o.jsx)(sx,{data:e});case"audio":return(0,o.jsx)(sf,{data:e});case"image":return(0,o.jsx)(sv,{data:e});case"other":return(0,o.jsx)(sy,{data:e})}},sw=({message:e})=>{let t=(0,d.useSelectedLocale)();return(0,o.jsx)(sp,{message:`${t["api.requestError"]} ${e}`,icon:"triangle-exclamation"})},sj=({children:e})=>(0,o.jsxs)(su.ScrollArea,{className:"w-full",children:[(0,o.jsx)(su.ScrollAreaViewport,{className:"overflow-y-hidden!",children:(0,o.jsx)(su.ScrollAreaContent,{children:(0,o.jsx)("div",{className:"min-w-max",children:e})})}),(0,o.jsx)(su.ScrollAreaScrollbar,{orientation:"horizontal"})]}),sS=({data:e})=>{let t=(0,ss.useCodeBlockThemeEnum)();return(0,o.jsx)("div",{className:"w-full rounded-b-xl",children:(0,o.jsx)("table",{className:"table-fixed pb-8 w-full pt-10",children:e.flatMap(([e,t])=>Array.isArray(t)?t.map(t=>[e,t]):[[e,t]]).map(([e,n],r)=>(0,o.jsxs)("tr",{className:(0,v.cn)("w-full flex divide-x border-b last:border-b-0 text-xs text-gray-600 dark:text-gray-400","system"===t?"divi
14de-gray-100 dark:divide-white/10 border-gray-100 dark:border-white/10 text-gray-600 dark:text-gray-400":"divide-white/10 border-white/10 text-gray-400"),children:[(0,o.jsx)("td",{className:"flex min-w-0 items-center basis-1/2 py-2 px-4 text-gray-600",children:(0,o.jsx)(sj,{children:e})}),(0,o.jsx)("td",{className:"flex min-w-0 items-center basis-1/2 py-2 px-4",children:(0,o.jsx)(sj,{children:`${n}`})})]},`${e}-${r}`))})})},sE=({response:e})=>{let t=(0,d.useSelectedLocale)(),n=Object.entries(e.headers);return 0===n.length?(0,o.jsx)(sp,{message:t["api.noHeadersReceived"],icon:"table"}):(0,o.jsx)(sS,{data:n})},sk=({data:e})=>{let[t,n]=(0,x.useState)(!1),r=sC(e,()=>{n(!0),setTimeout(()=>{n(!1)},2e3)},e=>console.error(`unable to copy response to clipboard: ${e}`));return r?(0,o.jsx)(l0.CopyIconButton,{onClick:r,isCopiedActive:t}):null},sO=["image/png","text/plain"],sC=(e,t,n)=>(0,x.useMemo)(()=>{if(e.contentType&&sO.includes(e.contentType))try{let r=new ClipboardItem({[e.contentType]:e.blob.arrayBuffer().then(t=>new Blob([t],{type:e.contentType})).catch(e=>{throw Error(`Failed to process blob: ${e.message}`)})});return()=>navigator.clipboard.write([r]).then(t,n)}catch(e){console.error(`unable to create clipboard item: ${e}`)}if("other"===e.type)return()=>navigator.clipboard.writeText(e.content).then(t,n)},[e,t,n]),sI=({data:e})=>{let[t,n]=(0,x.useState)(!1),r=(0,d.useSelectedLocale)(),i=(0,ss.useCodeBlockThemeEnum)();return e.extension?(0,o.jsx)(l0.CodeBlockTooltip,{text:t?r["tooltip.copied"]:r["tooltip.download"],children:(0,o.jsx)("a",{"aria-label":t?r["aria.fileDownloaded"]:r["aria.downloadResponseFile"],className:"group h-7 w-7 flex items-center justify-center cursor-pointer",onClick:()=>{n(!0),setTimeout(()=>{n(!1)},2e3)},href:e.url,download:`api-response.${e.extension}`,children:t?(0,o.jsx)(lK.default,{icon:"circle-check",iconType:"solid",className:"h-4 w-4 bg-primary dark:bg-primary-light"}):(0,o.jsx)(lK.default,{icon:"arrow-down-to-line",className:(0,v.cn)("w-4 h-4","system"===i?"bg-gray-400 group-hover:bg-gray-500 dark:bg-white/40 dark:group-hover:bg-white/60":"bg-white/40 group-hover:bg-white/60")})})}):null},sR=({result:e,selectedSection:t,setSelectedSection:n,data:r})=>(0,o.jsxs)("div",{className:"flex w-full px-2 py-1 space-x-3 items-center rounded-t-2xl",children:[(0,o.jsxs)("div",{className:"flex flex-1 space-x-4 items-center",children:[(0,o.jsx)(sP,{status:e.error?void 0:e.response.status,statusText:e.error?void 0:e.response.statusText}),!e.error&&e.stream&&(0,o.jsx)(sT,{stream:e.stream})]}),r?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(sA,{selectedSection:t,setSelectedSection:n}),(0,o.jsx)(sI,{data:r}),(0,o.jsx)(sk,{data:r})]}):null]}),sT=({stream:e})=>{let t=(0,d.useSelectedLocale)(),n=(0,ss.useCodeBlockThemeEnum)(),r=e.done?e.aborted?t["api.streamStopped"]:e.interrupted?t["api.streamInterrupted"]:e.truncated?t["api.streamTruncated"]:void 0:t["api.streaming"];return r?(0,o.jsx)("div",{className:(0,v.cn)("text-xs",!e.done&&"animate-pulse","system"===n?"text-gray-500 dark:text-gray-400":"text-gray-400"),role:"status",children:r}):null},sP=({status:e,statusText:t})=>{let n=(0,ss.useCodeBlockThemeEnum)();return(0,o.jsxs)("div",{className:"flex space-x-2 items-center",children:[(0,o.jsx)(sN,{status:e}),(0,o.jsx)("div",{className:(0,v.cn)("text-xs","system"===n?"text-gray-800 dark:text-gray-200 font-medium":"text-gray-200 font-medium"),children:e?`${e} - ${t}`:"--"})]})},sN=({status:e})=>{let t="w-3.5 h-3.5";return void 0===e?(0,o.jsx)(lK.default,{icon:"triangle-exclamation",className:(0,v.cn)(t,"bg-red-600 dark:bg-red-500")}):e>=400?(0,o.jsx)(lK.default,{icon:"circle-x",className:(0,v.cn)(t,"bg-red-600 dark:bg-red-500")}):e>=200&&e<300?(0,o.jsx)(lK.default,{icon:"circle-check",className:(0,v.cn)(t,"bg-green-600 dark:bg-green-500")}):(0,o.jsx)(lK.default,{icon:"circle-exclamation",className:(0,v.cn)(t,"bg-orange-600 dark:bg-orange-500")})},sA=({selectedSection:e,setSelectedSection:t})=>{let n=(0,ss.useCodeBlockThemeEnum)(),r=(0,d.useSelectedLocale)();return(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)("select",{"aria-label":r["aria.selectResponseSection"],className:(0,v.cn)("pl-2.5 pr-6 py-1 rounded-lg text-xs font-medium border cursor-pointer focus:outline-0","system"===n?"text-gray-600 dark:text-gray-400 border-standard hover:bg-gray-50 dark:hover:bg-white/[0.03]":"text-gray-200 border-gray-800/50 hover:bg-gray-800/50 bg-gray-800/50"),value:e,onCh
14ange:e=>t(e.target.value),children:sM.map(e=>(0,o.jsx)("option",{value:e,children:(e[0]?.toUpperCase()??"")+e.slice(1)},e))}),(0,o.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-end pr-2.5",children:(0,o.jsx)(lK.default,{icon:"angle-down",iconType:"solid",className:(0,v.cn)("w-2.5 h-2.5","system"===n?"bg-gray-400 dark:bg-gray-500":"bg-gray-200")})})]})},sM=["body","headers"],sL=({result:e,className:t})=>{let[n,r]=(0,x.useState)("body"),i=sD(e),a=(0,ss.useCodeBlockThemeEnum)(),l=(0,o.jsxs)(su.ScrollArea,{className:(0,v.cn)("rounded-xt dark:bg-codeblock max-h-[360px]","system"===a?"bg-white":"codeblock-dark bg-codeblock"),children:[(0,o.jsx)(su.ScrollAreaViewport,{className:"max-h-[inherit]",children:(0,o.jsx)(su.ScrollAreaContent,{className:"min-w-0! w-full",children:e.error?(0,o.jsx)(sw,{message:e.errorMessage}):"body"===n?(0,o.jsx)(sb,{data:i}):(0,o.jsx)(sE,{response:e.response})})}),(0,o.jsx)(su.ScrollAreaScrollbar,{orientation:"vertical"})]});return(0,o.jsx)(h.default,{children:(0,o.jsxs)("div",{className:(0,v.cn)("w-full grow rounded-2xl border p-0.5",e.error&&"shrink-0","system"===a?"bg-gray-50 dark:bg-white/5 border-gray-950/10 dark:border-white/10":"bg-codeblock dark:bg-white/5 border-white/10",t),children:[(0,o.jsx)(sR,{selectedSection:n,setSelectedSection:r,result:e,data:i}),l]})})},sD=e=>{let t=(0,x.useMemo)(()=>{if(e.error||void 0==e.response.data)return;let t=(0,l2.base64ToUint8Array)(e.response.data),n=s$(e.response.headers),r=sq(n),i=new Blob([t],{type:n}),o=URL.createObjectURL(i),a=n?(e=>{let t=sc[e];if(t)return t;let n=e.lastIndexOf("+");if(-1!==n)return sd[e.slice(n+1)]})(n):void 0;return n&&"other"!==r?{type:r,contentType:n,blob:i,url:o,extension:a}:{type:"other",contentType:n,content:new TextDecoder("utf-8",{ignoreBOM:!0}).decode(t),live:void 0!==e.stream&&!e.stream.done,blob:i,url:o,extension:a}},[e]);return(e=>{let t=(0,x.useRef)(new Map);(0,x.useEffect)(()=>{if(void 0===e)return;let n=t.current;return clearTimeout(n.get(e)),n.delete(e),()=>{n.set(e,setTimeout(()=>{n.delete(e),URL.revokeObjectURL(e)},0))}},[e])})(t?.url),t},s$=e=>{for(let t in e)if("content-type"===t.toLowerCase()){let n=e[t];if("string"==typeof n)return n.split(";")[0]?.trim().toLowerCase()}},sq=e=>{let[t]=e?.split("/")??[];return"image"===t||"audio"===t||"video"===t?t:"other"};var sU=e.i(865420);let sB=e=>150*(1+Math.floor(e/1048576));class sF{bytes=new Uint8Array(65536);encoded="";encodedLength=0;length=0;append(e){if(this.length+e.byteLength>this.bytes.byteLength){let t=new Uint8Array(Math.max(2*this.bytes.byteLength,this.length+e.byteLength));t.set(this.bytes.subarray(0,this.length)),this.bytes=t}this.bytes.set(e,this.length),this.length+=e.byteLength}view(){return this.bytes.subarray(0,this.length)}base64(){let e=this.length-this.length%3;return e<this.encodedLength&&(this.encoded="",this.encodedLength=0),e>this.encodedLength&&(this.encoded+=(0,l2.bytesToBase64)(this.bytes.subarray(this.encodedLength,e)),this.encodedLength=e),this.encoded+(0,l2.bytesToBase64)(this.bytes.subarray(e,this.length))}}let sz=e=>({error:!1,response:{status:e?.status??0,statusText:e?.statusText??"",headers:e?.headers??{},data:""},stream:{done:!0,aborted:!0,interrupted:!1,truncated:!1}}),s_=async({body:e,meta:t,onUpdate:n,signal:r,now:i=()=>Date.now()})=>{let o,a=new sF,l={done:!1,aborted:!1,interrupted:!1,truncated:!1},s=()=>({error:!1,response:{status:t.status,statusText:t.statusText,headers:t.headers,data:a.base64()},stream:{...l}});n(s());let u=i(),c=()=>{clearTimeout(o),o=void 0,n(s()),u=i()},d=e?.getReader();if(d){let e=()=>{d.cancel().catch(()=>void 0)};r?.aborted?e():r?.addEventListener("abort",e,{once:!0});try{for(;;){let{value:e,done:t}=await d.read();if(t)break;let n=0xa00001-a.length;if(a.append(e.byteLength>n?e.subarray(0,n):e),a.length>0xa00000){a.length=0xa00000,l.truncated=!0,await d.cancel().catch(()=>void 0);break}let r=i()-u,s=sB(a.length);r>=s?c():void 0===o&&(o=setTimeout(c,s-r))}}catch(e){r?.aborted||e instanceof DOMException&&"AbortError"===e.name?l.aborted=!0:(l.interrupted=!0,console.error(e))}finally{r?.removeEventListener("abort",e)}!r?.aborted||l.truncated||l.interrupted||(l.aborted=!0)}return clearTimeout(o),l.done=!0,s()},sK="x-mintlify-upstream-headers-truncated";var sW=e.i(434062),sH=e.i(459685),sV=e.i(316055);let sY=(e,t,n,r,i)=>{var o;let a=(e=>void 0===e||/[\x00-\x1f\x7f]/.test(e)?void 0:e)((0,sV.getPartContentType)(t,n,r));return(0,lj.isFile)(e)?{contentType:null!=a?a:"application/octet-stream",fileName:e.name,body:null!=(o=null==i?void 0:i.get(e))?o:e}:{contentType:null!=a?a:(0,sV.defaultPartContentType)(e),body:(0,sV.serializePartValue)(e)}},sX=new TextDecoder("latin1"),sG=e=>{var t,n;return"string"==typeof e.body?e.body:e.body instanceof Uint8Array?`${null!=(t=e.fileName)?t:""}\r 15${sX.decode(e.body)}`:`${null!=(n=e.fileName)?n:""}`},sJ=e=>{let t=(0,aO.getMediaType)(e);return t.startsWith("multipart/")&&t!==sV.MULTIPART_FORM_DATA},sQ=e=>(0,lj.isFile)(e)?[e]:Array.isArray(e)?e.flatMap(sQ):(0,lj.isObject)(e)?Object.values(e).flatMap(sQ):[],sZ=(e,t,n,r)=>{var i;if(!sJ(t)||!Array.isArray(e)&&!(0,lj.isObject)(e))return;let o=((e,t,n)=>Array.isArray(e)?e.flatMap((e,r)=>null==e?[]:[sY(e,t,String(r),r,n)]):(0,lj.isObject)(e)?Object.entries(e).flatMap(([e,r])=>Array.isArray(r)?r.flatMap((r,i)=>null==r?[]:[sY(r,t,e,i,n)]):null==r?[]:[sY(r,t,e,void 0,n)]):[])(e,n,r),a=o.map(sG).join("\r\n"),l=o.some(e=>"string"!=typeof e.body),s=o.some(e=>(0,lj.isFile)(e.body))?`----MintlifyMultipart${s0()}`:null!=(i=(0,eS.declaredMultipartBoundary)(t))?i:l?`----MintlifyMultipart${s0()}`:(0,eS.multipartBoundary)(t),u=(0,eS.boundaryAbsentFrom)(s,a),c=[];o.forEach((e,t)=>{let n=[`--${u}`,`Content-Type: ${e.contentType}`,...void 0!==e.fileName?[`Content-Disposition: attachment; filename="${e.fileName.replace(/[\x00-\x1f\x7f]/g,"").replace(/\\/g,"\\\\").replace(/"/g,"%22")}"`]:[],"",""].join("\r\n");c.push(0===t?n:`\r 16${n}`),c.push(e.body)}),c.push(`\r 17--${u}--`);let d=t.replace(/;\s*boundary=(?:"[^"]*"|[^;]*)/i,"").trim(),p=`${d.replace(/;\s*$/,"")}; boundary=${(0,eS.boundaryParameter)(u)}`;return{chunks:s1(c),contentType:p}},s0=()=>Array.from(crypto.getRandomValues(new Uint8Array(12)),e=>e.toString(16).padStart(2,"0")).join(""),s1=e=>e.reduce((e,t)=>
17{let n=e[e.length-1];return"string"==typeof t&&"string"==typeof n?e[e.length-1]=n+t:e.push(t),e},[]);var s2=e.i(269377),s5=e.i(356268);let s4=async e=>new Map(await Promise.all(e.map(async e=>[e,new Uint8Array(await new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let{result:e}=r;e instanceof ArrayBuffer?t(e):n(Error("file could not be read as bytes"))},r.onerror=()=>n(r.error??Error("file could not be read")),r.readAsArrayBuffer(e)}))]))),s6=e=>e instanceof Uint8Array?new Uint8Array(e):e;function s3(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let s8=new Set(["GET","HEAD"]),s9=e=>{let t=Object.keys(e).find(e=>"content-type"===e.toLowerCase()),n=void 0===t?void 0:e[t];return"string"==typeof n&&""!==n?n:void 0},s7=async({request:e,contentType:t,disableProxy:n,withCredentials:r,signal:i,onUpdate:o})=>{let a,l;try{if(n){let n=Object.fromEntries(Object.entries(e.header).flatMap(([e,t])=>null==t?[]:[[e,String(t)]])),o=e.method.toUpperCase(),s=s9(n)??t;l={status:(a=await fetch(e.url,{method:o,headers:n,body:s8.has(o)?void 0:((e,t)=>{if(null!=e){if("string"==typeof e&&(0,aO.isJsonContentType)(t))try{return JSON.parse(e),e}catch{return JSON.stringify(e)}return"string"==typeof e||e instanceof Blob||e instanceof ArrayBuffer?e:t.includes("application/x-www-form-urlencoded")&&s3(e)?s5.default.toFormData(e,new URLSearchParams).toString():JSON.stringify(e)}})(e.body,s),signal:i,...r?{credentials:"include"}:{}})).status,statusText:a.statusText,headers:(e=>{let t={};e.forEach((e,n)=>{t[n]=e});let n="function"==typeof e.getSetCookie?e.getSetCookie():[];return n.length>1&&(t["set-cookie"]=n),t})(a.headers)}}else{if(a=await fetch(`${l1.NEXT_PUBLIC.BASE_PATH}/_mintlify/api/request/stream`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e),signal:i}),a.headers.get("content-type")?.includes("application/json")){let e=await a.json().catch(()=>void 0);return(e=>"object"==typeof e&&null!==e&&"error"in e&&!0===e.error&&"errorMessage"in e&&"string"==typeof e.errorMessage)(e)?e:{error:!0,errorMessage:`unable to complete request (${a.status})`}}let t=a.headers.get("x-mintlify-upstream-status");if(null===t)return await a.body?.cancel().catch(()=>void 0),{error:!0,errorMessage:`unable to complete request (${a.status})`};l={status:Number(t),statusText:(e=>{if(!e)return"";try{return decodeURIComponent(e)}catch{return""}})(a.headers.get("x-mintlify-upstream-status-text")),headers:((e,t=null)=>{let n=(e=>{if(!e)return{};try{let t=JSON.parse(decodeURIComponent(e));if("object"!=typeof t||null===t||Array.isArray(t))return{};return Object.fromEntries(Object.entries(t).flatMap(([e,t])=>{let n=(e=>{if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return String(e);if(Array.isArray(e)){let t=e.filter(e=>"string"==typeof e);return 0===t.length?void 0:1===t.length?t[0]:t}})(t);return void 0===n?[]:[[e,n]]}))}catch{return{}}})(e),r=Number(t);return Number.isInteger(r)&&r>0?{...n,[sK]:String(r)}:n})(a.headers.get("x-mintlify-upstream-headers"),a.headers.get(sK))}}}catch(e){if(i.aborted)return sz();throw e}let s=s9(l.headers);if(void 0!==s&&!(0,eS.isSequentialMediaType)(s)){let e=await s_({body:a.body,meta:l,onUpdate:()=>void 0,signal:i});return e.error||void 0===e.stream||e.stream.aborted||e.stream.interrupted||e.stream.truncated?e:{error:!1,response:e.response}}return s_({body:a.body,meta:l,onUpdate:o,signal:i})},ue=(e,t)=>
17{let n=Object.keys(e).find(e=>"content-type"===e.toLowerCase())??"content-type";return{...e,[n]:t}},ut=async({method:t,path:n,inputs:r,headers:i})=>{let o=i["API-SECRET"],{getCoboV1CustodyGeneratedKeys:a}=await e.A(441570),l={...i,...a(t,n,o,r.body||r.query)};return delete l["API-SECRET"],l},un=async(t,n,r,i,o)=>{let{getCoboV2CustodyGeneratedKeys:a}=await e.A(315451),l=o["BIZ-API-KEY"];return"string"==typeof l?await a(l,t,n,r,i):{}},ur=async({request:t,withCredentials:n,signal:r})=>{let i=await e.A(966799).then(e=>e.default),o=Object.keys(t.header).find(e=>"content-type"===e.toLowerCase()),a=t.body,l=t.header;if(o?.includes("multipart/form-data")){let{data:e,headers:n}=uo(t);a=e,l=n}return i({url:t.url,method:t.method,params:t.query,data:a,...n?{withCredentials:n}:{},...r?{signal:r}:{},headers:l,paramsSerializer:{indexes:null},responseType:"arraybuffer",validateStatus:()=>!0,transformResponse:e=>(0,l2.bytesToBase64)(new Uint8Array(e))})},ui=async(t,n)=>{let r=await e.A(966799).then(e=>e.default),i=new FormData;i.append("requestInfo",JSON.stringify({method:t.method,url:t.url,header:t.header,query:t.query,cookie:t.cookie})),"object"==typeof t.body&&null!==t.body&&Object.entries(t.body).forEach(([e,t])=>{t instanceof File?i.append(e,t):Array.isArray(t)?t.forEach(t=>{t instanceof File?i.append(e,t):null!=t&&i.append(e,"object"==typeof t?JSON.stringify(t):t.toString())}):null!=t&&i.append(e,"object"==typeof t?JSON.stringify(t):t.toString())});let{data:o}=await r.post(`${l1.NEXT_PUBLIC.BASE_PATH}/_mintlify/api/file-request`,i,n?{signal:n}:void 0);return o},uo=e=>{let t=e.body,n=e.header;if(n["content-type"]?.includes("multipart/form-data")){let e=new FormData;"object"==typeof t&&null!==t&&(Object.entries(t).forEach(([t,n])=>{n instanceof File?e.append(t,n):Array.isArray(n)?n.forEach(n=>{n instanceof File?e.append(t,n):null!=n&&e.append(t,"object"==typeof n?JSON.stringify(n):n.toString())}):null!=n&&e.append(t,"object"==typeof n?JSON.stringify(n):n.toString())}),t=e,delete n["content-type"])}return{data:t,headers:n}},ua=({apiReferenceData:t,baseUrl:n,selectedRequestBodyContentTypeIndex:r,setResult:i,label:a,method:l,className:s})=>{let[u,c]=(0,x.useState)(!1),p=(0,d.useSelectedLocale)(),{sendRequest:f,cancelRequest:m,canCancel:h}=(({apiReferenceData:t,baseUrl:n,contentType:r="application/json",setResult:i,setIsSending:o})=>{let a,l=(0,sU.useAnalyticsContext)("docs.api_playground.request"),s=(0,aC.usePlaygroundInputsStore)(e=>e.getApiPlaygroundInputs),u=(0,aC.usePlaygroundInputsStore)(e=>e.selectedSecurityOptionIndex),c=t.dependencies?.processedSecurityOptions?.[u],d=t.operation?.isCobo,p=t.operation?.disableProxy,f=p&&t.operation?.withCredentials,m=t.operation?.path,h=t.operation?.method,g=t.dependencies?.parameters,y=t.dependencies?.requestBody?.content[r],v=(0,eS.getBodySchema)(y),b=(0,C.isSchemaObject)(v)?v:void 0,w=(0,eS.isSequentialItemMedia)(r,y),j=t.dependencies?.requestBody?.required,S=(a=t,Object.values(a.dependencies?.responses??{}).some(e=>Object.keys(e.content??{}).some(eS.isSequentialMediaType))&&!r.includes("multipart/form-data")),E=(0,x.useRef)(null),[k,O]=(0,x.useState)(!1);(0,x.useEffect)(()=>()=>{let e=E.current;E.current=null,e?.abort()},[]);let I=(0,x.useCallback)(()=>E.current?.abort(),[]);return{sendRequest:(0,x.useCallback)(async()=>{let t,a,u=s();if(o(!0),!m||!n||!h||!r||!n){o(!1),i({error:!0,errorMessage:"Missing required fields to send a playground request"}),console.error(`Missing some required field to send a playground request: 18 19path=${m} 20method=${h} 21contentType=${r} 22baseUrl=${n}`);return}E.current?.abort();let v=new AbortController;E.current=v,O(S);let x=()=>{E.current===v&&(o(!1),E.current=null,O(!1))},k=()=>!!v.signal.aborted&&E.current===v&&(i(sz()),x(),!0),I=await e.A(966799).then(e=>e.default);if(E.current!==v||k())return;let R=(0,aO.addPathParams)(m,u.path,g??{}),T=(0,s2.serializeQuerystring)({inputs:u,parameters:g??{}}),P=(0,s2.hasQuerystringParameter)(g??{})?((e,t)=>{let n=(0,sW.getQuerySecurityNames)(t);return Object.fromEntries(Object.entries(e).filter(([e])=>n.has(e)))})(u.query,c):u.query,N=((...e)=>e.filter(e=>!!e).join("&")||void 0)(T,(0,sW.serializeQueryParams)((0,sW.createInputQueryParams)({...u,query:P},g??{}))),A=(0,sW.appendQueryString)((0,aO.joinWithSingleSlash)((0,aO.addServerVariables)(n,u.server),R),N),M=s9(u.header)??r,L=w&&(0,eS.isSequentialMediaType)(M),D=L?(0,eS.sequentialItemContentType)(M):r,$=(e=>{if(!e.Authorization||"object"!=typeof e.Authorization)return e;if("object"==typeof e.Authorization){let t="username"in e.Authorization?e.Authorization.username:"",n="password"in e.Authorization?e.Authorization.password:"",r=(0,C.encodeBasicAuth)(t,n);e.Authorization=`Basic ${r}`,delete e.Authorization.username,delete e.Authorization.password}return e})(u.header),q=void 0!==y&&void 0===b&&s3(u.body)?void 0:u.body;s3(q)&&b&&(q=(0,sH.stripOptionalObjectsWithEmptyRequiredFields)(q,b));let U=sJ(M),B=!1;if((0,aO.isJsonContentType)(M)||L||U||(q=(0,aO.omitNullValues)(q)),void 0===q&&j&&(b&&"type"in b?("array"===b.type&&(q=[]),"object"===b.type&&(q={}),"string"===b.type&&(q="")):q={}),L&&void 0!==q){let e=(0,eS.serializeSequentialItem)(q,D,y);q=e,$=ue($,(0,eS.matchMultipartBoundary)(D,e))}else if(U&&"object"==typeof q&&null!==q&&p){let e=sZ(q=(0,sV.orderPartsBySchema)(q,b),M,y);void 0!==e&&(B=!0,$=ue($,e.contentType),q=e.chunks.every(e=>"string"==typeof e)?e.chunks.join(""):new Blob(e.chunks.map(s6),{type:e.contentType}))}else if(U&&"object"==typeof q&&null!==q){let e=sQ(q=(0,sV.orderPartsBySchema)(q,b));if((e=>{let t=new TextEncoder;return(e?.chunks??[]).reduce((e,n)=>e+("string"==typeof n?t.encode(n).byteLength:n instanceof Uint8Array?n.byteLength:n.size),0)})(sZ(q,M,y))>0xa00000){i({error:!0,errorMessage:"request body too large"}),x();return}try{let n=await s4(e);if(E.current!==v||k())return;let r=sZ(q,M,y,n);void 0!==r&&(B=!0,$=ue($,r.contentType),r.chunks.every(e=>"string"==typeof e)?q=r.chunks.join(""):(q=(0,l2.bytesToBase64)(((e,t)=>{let n=new TextEncoder,r=e.map(e=>{if("string"==typeof e)return n.encode(e);if(e instanceof Uint8Array)return e;let r=t.get(e);if(void 0===r)throw Error(`${e.name} was not read`);return r}),i=new Uint8Array(new ArrayBuffer(r.reduce((e,t)=>
22e+t.byteLength,0))),o=0;for(let e of r)i.set(e,o),o+=e.byteLength;return i})(r.chunks,n)),t="base64"))}catch(e){if(E.current!==v||k())return;i({error:!0,errorMessage:"unable to read the selected file"}),x(),console.error(e);return}}if(d&&($=R.startsWith("/v1")?await ut({method:h,path:m,inputs:{...u,body:q},headers:$}):await un(h,R,q,u.query,$),E.current!==v||k()))return;M.includes("application/x-www-form-urlencoded")&&s3(q)&&(q=(e=>{let t=new URLSearchParams;return Object.entries(e).forEach(([e,n])=>{(Array.isArray(n)?n:[n]).forEach(n=>{null!=n&&t.append(e,"object"==typeof n?JSON.stringify(n,void 0,2):String(n))})}),t.toString()})(q)),void 0===q||L||($=((e,t)=>Object.keys(e).some(e=>"content-type"===e.toLowerCase())?e:{...e,"content-type":t})($,r));let F={method:h,url:A,header:$,body:q,...void 0===t?{}:{bodyEncoding:t},cookie:u.cookie,query:{}},z=!1;try{if(S){let e=await s7({request:F,contentType:r,disableProxy:p,withCredentials:f,signal:v.signal,onUpdate:e=>{E.current===v&&i(e)}});if(E.current!==v)return;"response"in e&&(a=e.response.status),i(e)}else if(p){let e=await ur({request:F,withCredentials:f,signal:v.signal});if(E.current!==v)return;a=e.status,i({error:!1,response:{status:e.status,statusText:e.statusText,headers:e.headers,data:e.data}})}else if(M.includes("multipart/form-data")&&!B){let e=await ui(F,v.signal);if(E.current!==v)return;"response"in e&&(a=e.response.status),i(e)}else{let{data:e}=await I.post(`${l1.NEXT_PUBLIC.BASE_PATH}/_mintlify/api/request`,F,{signal:v.signal});if(E.current!==v)return;"response"in e&&(a=e.response.status),i(e)}}catch(e){if(E.current!==v||k())return;z=!0,i({error:!0,errorMessage:"unable to complete request"}),console.error(e)}x(),l({path:m,method:h,responseStatus:a,isError:z})},[h,m,o,s,n,r,d,b,y,w,j,l,p,i,f,c,S,g]),cancelRequest:I,canCancel:S||k}})({apiReferenceData:t,baseUrl:n,contentType:(0,C.getRequestBodyContentType)(t,r),setResult:i,setIsSending:c});return(0,o.jsx)(aA.SendPill,{label:a,method:l,isSending:u,onClick:f,onCancel:h?m:void 0,cancelLabel:p["api.stop"],className:s,sendingRequestAriaLabel:p["aria.sendingRequest"]})},ul=({isPlaygroundExpanded:e,setIsPlaygroundExpanded:t,baseUrl:n,baseUrlOptions:r,apiReferenceData:i})=>{let{selectedBaseUrlIndex:a,setSelectedBaseUrlIndex:l}=(0,ev.useSelectedBaseUrl)(),{selectedRequestBodyContentTypeIndex:s,setSelectedRequestBodyContentTypeIndex:u}=(0,ej.useSelectedRequestBodyContentType)(),[c,p]=(0,x.useState)(),f=(0,d.useSelectedLocale)(),{selectedExampleIndex:m}=(0,a8.useSelectedExample)(),h=aJ(e=>e.locallyStoredCredentials),g=aJ(e=>e.setLocallyStoredCredentials),y=aJ(e=>e.locallyStoredServerVariables),b=aJ(e=>e.setLocallyStoredServerVariables),w=i.operation?.urlDisplay;(0,x.useEffect)(()=>{let e=!1;return b(aX()),(async()=>{let t=await (0,aH.loadCredentialStore)(aK);e||g(t)})(),()=>{e=!0}},[g,b]),function({apiReferenceData:e,selectedBaseUrlIndex:t,selectedExampleIndex:n,selectedRequestBodyContentTypeIndex:r,locallyStoredCredentials:i,serverInputs:o}){var a;let l=(0,x.useRef)(!1),s=(0,x.useRef)(!1),u=(0,x.useRef)(n);(0,x.useEffect)(()=>{if(l.current)return;let n=aC.usePlaygroundInputsStore.getState();n.reset();let a=a2({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:0,selectedExampleIndex:0,selectedContentTypeIndex:r,locallyStoredCredentials:i,serverInputs:o});n.initializeInputs(a),n.initializeApiReferenceData(e),l.current=!0,s.current=!!i,u.current=0},[]),(0,x.useEffect)(()=>{if(!l.current||s.current||!i)return;let n=aC.usePlaygroundInputsStore.getState(),a=a2({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:n.selectedSecurityOptionIndex,selectedExampleIndex:n.selectedExampleIndex,selectedContentTypeIndex:r,locallyStoredCredentials:i,serverInputs:o});n.replaceInputs(a),s.current=!0},[i]),(0,x.useEffect)(()=>{var a;if(!l.current||u.current===n||!(null==(a=e.operation)?void 0:a.prefillPlaygroundWithExample))return;let s=aC.usePlaygroundInputsStore.getState();s.clear();let c=a2({apiReferenceData:e,selectedBaseUrlIndex:t,selectedSecurityOptionIndex:s.selectedSecurityOptionIndex,selectedExampleIndex:n,selectedContentTypeIndex:r,locallyStoredCredentials:i,serverInputs:o});s.initializeInputs(c),u.current=n},[n,null==(a=e.operation)?void 0:a.prefillPlaygroundWithExample]);let c=(0,x.useRef)(o);c.current=o,(0,x.useEffect)(()=>{let n=(n,r)=>
22{!function({server:e,previousServer:t,apiReferenceData:n,selectedBaseUrlIndex:r,fallbackServerInputs:i}){var o,a,l,s,u,c,d,p;let f=null==(l=Object.values(null!=(a=null==(o=n.dependencies)?void 0:o.servers)?a:{})[r])?void 0:l.variables;if(!f||0===Object.keys(f).length)return;let m=null!=(c=null==(u=null==(s=n.operation)?void 0:s.userInfoPlaygroundInputs)?void 0:u.server)?c:{},{setInput:h,deleteInput:g}=aC.usePlaygroundInputsStore.getState();for(let[t,n]of Object.entries(e))f[t]&&h(`${O.apiPlaygroundInputKeys.server}.${(0,C.escapeDots)(t)}`,n);if(void 0!==t)for(let n of Object.keys(t)){if(n in e||!f[n])continue;let t=`${O.apiPlaygroundInputKeys.server}.${(0,C.escapeDots)(n)}`,r=f[n],o=null!==r&&"object"==typeof r?(0,C.getSchemaDefault)(r):void 0,a="string"==typeof o?o:void 0,l=null!=(p=null!=(d=null==i?void 0:i[n])?d:m[n])?p:a;void 0!==l?h(t,l):g(t)}}({server:n,previousServer:r,apiReferenceData:e,selectedBaseUrlIndex:t,fallbackServerInputs:c.current})};return n((0,a1.getExternalApiPlaygroundServerInputs)()),a1.useExternalApiPlaygroundInputsStore.subscribe((e,t)=>{n(e.server,t.server)})},[e,t])}({apiReferenceData:i,selectedBaseUrlIndex:a,selectedExampleIndex:m,selectedRequestBodyContentTypeIndex:s,locallyStoredCredentials:h,serverInputs:((e,t,n)=>{var r,i,o;return null!=(o=null!=(r=null==e?void 0:e[aY(t,n)])?r:null==e?void 0:e[null!=(i=null==t?void 0:t.baseUrlOptions[n])?i:""])?o:{}})(y,i.operation,a)}),(0,az.useKeyboardShortcut)({key:"Escape",callback:e?()=>t(!1):void 0,isSingleKey:!0});let j=(0,x.useRef)(null),S=(0,x.useCallback)(()=>{let e=aJ.getState();e.syncCredentialsState(),e.syncServerVariablesState(),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{j.current=null,aJ.getState().updateLocalStorage(aK)},300)},[]);(0,x.useEffect)(()=>()=>{j.current&&(clearTimeout(j.current),aJ.getState().updateLocalStorage(aK))},[]);let E=(0,x.useRef)(null),k=(0,x.useCallback)(()=>{E.current?.closest('[data-component-part="scroll-area-viewport"]')?.scrollTo({top:0})},[]),I=(({apiReferenceData:e,selectedContentTypeIndex:t})=>{let n=[],{parameters:r,requestBody:i}=e.dependencies??{};if(r&&Object.keys(r).length>0){let{header:t,path:r,query:i,querystring:o,cookie:a}=(0,C.getParametersPerSection)(e);[["header",t],["cookie",a],["path",r],["query",i],["querystring",o]].forEach(([e,t])=>{let{optional:r}=lI(t);r.some(e=>(0,C.isSchemaObject)(e.schema))&&n.push(e)})}let o=i?.content??{},a=Object.keys(o)[t],l=void 0===a?void 0:(0,eS.getBodySchema)(o[a]);return(0,C.isSchemaObject)(l)&&lA(l)>0&&n.push("body"),n})({apiReferenceData:i,selectedContentTypeIndex:s});if(!i.operation)return null;let{path:R,method:T,title:P,description:N,type:A}=i.operation,M=i.operation["x-mint"]?.playground?.expand;return(0,o.jsxs)(aB.PlaygroundModalWrapper,{isPlaygroundExpanded:e,setIsPlaygroundExpanded:t,children:[(0,o.jsx)("div",{className:"sticky top-0 z-50 bg-background-light dark:bg-background-dark px-4 pt-4 pb-2",children:(0,o.jsxs)("div",{className:"flex items-center justify-between gap-x-2",children:[(0,o.jsx)(aq.EndpointsMenu,{operation:{method:T,title:P}}),(0,o.jsx)(aN,{baseUrlOptions:r,baseUrlNames:i.operation?.baseUrlNames,selectedBaseUrlIndex:a,setSelectedBaseUrlIndex:l,display:"interactive",path:R,method:T,type:A,onBaseUrlChange:()=>{},isInPlaygroundModal:!0,urlDisplay:w,parameters:i.dependencies?.parameters}),(0,o.jsx)(ua,{apiReferenceData:i,baseUrl:n,selectedRequestBodyContentTypeIndex:s,setResult:p,label:f.send,method:T,className:"w-20"})]})}),(0,o.jsx)(lT,{resetKey:`${T}:${R}`,children:(0,o.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-x-8 gap-y-6 px-4 pt-3.5",children:[(0,o.jsxs)("div",{ref:E,className:"col-span-1 lg:col-span-3 pb-4",children:[(0,o.jsxs)("div",{className:"flex items-start gap-x-2",children:[(0,o.jsx)("div",{className:"flex-1 min-w-0",children:(0,o.jsx)(aU.ModalHeader,{title:P,description:N})}),(0,o.jsx)(lQ,{sectionsWithOptionalFields:I,onExpandAll:k})]}),c&&(0,o.jsx)(sL,{result:c,className:"mt-6 block lg:hidden"}),(0,o.jsxs)("div",{className:"space-y-2 mt-6",children:[(0,o.jsx)(sl,{apiReferenceData:i,selectedBaseUrlIndex:a,updateLocalStorageCallback:S}),(0,o.jsx)(sa,{apiReferenceData:i,updateLocalStorageCallback:S,defaultExpanded:M}),(0,o.jsx)(lZ,{apiReferenceData:i,defaultExpanded:M}),(0,o.jsx)(lJ,{apiReferenceData:i,selectedContentTypeIndex:s,setSelectedContentTypeIndex:u,defaultExpanded:M})]})]}),(0,o.jsxs)("div",{className:(0,v.cn)("col-span-1 lg:col-span-2 lg:space-y-6 lg:sticky lg:top-20 lg:self-start max-lg:pb-4",c&&"lg:flex lg:flex-col"),children:[c&&(0,o.jsx)(sL,{result:c,className:"hidden lg:block min-h-fit"}),(0,o.jsx)(aF.ApiExamples,{isModal:!0,"data-testid":"api-playground-request-example",className:"xl:w-full"})]})]})})]})},us=({children:e})=>{let{openApiReferenceData:t}=(0,x.useContext)(y.OpenApiReferenceContext),{pageMetadata:n}=(0,x.useContext)(u.PageContext),{docsConfig:r}=(0,x.useContext)(u.DocsConfigContext),{isLivePreview:i,getDocsConfigOverrides:v}=(0,x.useContext)(c.LivePreviewContext),b=v(),w=(0,f.useUserGroups)(),j=(0,p.useMdxCodeExampleData)("request"),S=(0,p.useMdxCodeExampleData)("response"),{isChatSheetOpen:E}=(0,x.useContext)(g.ChatAssistantContext),k=(0,d.useSelectedLocale)(),O=(0,x.useMemo)(()=>({"api.example":k["api.example"],"api.examples":k["api.examples"],"aria.navigateToHeader":k["aria.navigateToHeader"],"api.default":k["api.default"],"api.required":k["api.required"],"api.deprecated":k["api.deprecated"],"aria.selectSchemaType":k["aria.selectSchemaType"],availableOptions:k.availableOptions,"api.title":k["api.title"],"api.const":k["api.const"],requiredRange:k.requiredRange,"api.mustBeMultipleOf":k["api.mustBeMultipleOf"],tryIt:k.tryIt,"aria.sendingRequest":k["aria.sendingRequest"],"aria.selectBaseUrl":k["aria.selectBaseUrl"],"tooltip.copy":k["tooltip.copy"],copied:k.copied,"api.body":k["api.body"],"api.headers":k["api.headers"],"api.pathParameters":k["api.pathParameters"],"api.queryParameters":k["api.queryParameters"],"api.queryString":k["api.queryString"],"api.cookies":k["api.cookies"],"api.response":k["api.response"],"api.streamItem":k["api.streamItem"],"api.callbacks":k["api.callbacks"],"api.authorizations":k["api.authorizations"],"api.scopes":k["api.scopes"],"api.oauth.flow":k["api.oauth.flow"],"api.oauth.authorizationCode":k["api.oauth.authorizationCode"],"api.oauth.clientCredentials":k["api.oauth.clientCredentials"],"api.oauth.implicit":k["api.oauth.implicit"],"api.oauth.password":k["api.oauth.password"],"api.oauth.deviceAuthorization":k["api.oauth.deviceAuthorization"],"api.oauth.authorizationUrl":k["api.oauth.authorizationUrl"],"api.oauth.deviceAuthorizationUrl":k["api.oauth.deviceAuthorizationUrl"],"api.oauth.tokenUrl":k["api.oauth.tokenUrl"],"api.oauth.refreshUrl":k["api.oauth.refreshUrl"],"api.oauth.metadataUrl":k["api.oauth.metadataUrl"],"api.oauth.callbackUrl":k["api.oauth.callbackUrl"],"api.oauth.clientId":k["api.oauth.clientId"],"api.oauth.clientSecret":k["api.oauth.clientSecret"],"api.oauth.optional":k["api.oauth.optional"],"api.oauth.connectPreview":k["api.oauth.connectPreview"]}),[k]),C=(0,x.useMemo)(()=>({Markdown:m.DynamicMarkdown,MarkdownWithoutHeaders:m.DynamicMarkdownWithoutHeaders}),[]),I=(0,x.useMemo)(()=>({CodeGroup:s.CodeGroup,CodeBlock:l.CodeBlock,CodeSnippet:a.CodeSnippet,CodeSnippets:aD.CodeSnippets,MdxCodeExample:a$.MdxCodeExample,CodeGroupSelect:aL.CodeGroupSelect}),[]);return t.operation?(0,o.jsx)(h.default,{children:(0,o.jsx)(aM,{apiReferenceData:t,pageMetadata:n,docsConfig:r,isLivePreview:i,docsConfigOverrides:b,userGroups:w,localeStrings:O,markdownComponents:C,Playground:ul,mdxRequestExampleData:j,mdxResponseEx
22ampleData:S,codeComponents:I,isChatSheetOpen:E,children:e})}):t.schemaData?(0,o.jsx)(h.default,{children:(0,o.jsx)(eh,{apiReferenceData:t,pageMetadata:n,docsConfig:r,localeStrings:O,markdownComponents:C,isLivePreview:i,children:e})}):null}},333233,e=>{e.n(e.i(82270))}]);
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.