@llmops/app 0.1.5-beta.2 → 0.1.6-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/.vite/manifest.json +337 -298
  2. package/dist/assets/{Form-B1rZ0Hvr.js → Form-Bh6BPtQ_.js} +1 -1
  3. package/dist/assets/{InternalBackdrop-CXjGP6a9.js → InternalBackdrop-Za9lpJi7.js} +1 -1
  4. package/dist/assets/_environment-COxSWJ9w.js +1 -0
  5. package/dist/assets/_observability-C8wSXZk2.js +1 -0
  6. package/dist/assets/{_observability-DPSeR4-h.css → _observability-CBX-o26D.css} +1 -1
  7. package/dist/assets/{_settings-Bv8acMq8.js → _settings-DOmj1R7I.js} +1 -1
  8. package/dist/assets/{_tabs-Bi-rsAVV.js → _tabs-D9USU0yw.js} +1 -1
  9. package/dist/assets/{_tabs-oKfgxR5m.js → _tabs-DaucGqpx.js} +1 -1
  10. package/dist/assets/{_variant-Zg5HjNSN.js → _variant-DxME2BL0.js} +2 -2
  11. package/dist/assets/{_variants-B36Lo8m_.js → _variants-Bjp8ZEvO.js} +1 -1
  12. package/dist/assets/{area.css-DTnbbu5M.js → area.css-CSjofvHM.js} +1 -1
  13. package/dist/assets/{button-DftzA6-1.js → button-CMZqhyXB.js} +1 -1
  14. package/dist/assets/check-D9E8RKB4.js +1 -0
  15. package/dist/assets/{chevron-down-BjDiaa62.js → chevron-down-BJFxhYkh.js} +1 -1
  16. package/dist/assets/{chevron-right-Dz77YeP_.js → chevron-right-fMWRsRLZ.js} +1 -1
  17. package/dist/assets/combobox-iSbUYz0A.js +1 -0
  18. package/dist/assets/configs-BflhBVlY.js +1 -0
  19. package/dist/assets/{copy-D-DZB-6Z.js → copy-DADLeZ69.js} +1 -1
  20. package/dist/assets/costs-Fh0OPnEw.js +1 -0
  21. package/dist/assets/environments-ChldQPyq.js +1 -0
  22. package/dist/assets/{getDisabledMountTransitionStyles-CKUvhO4q.js → getDisabledMountTransitionStyles-TZFYxPIU.js} +1 -1
  23. package/dist/assets/{index-BS3B2BG5.js → index-BDsrc1Q7.js} +1 -1
  24. package/dist/assets/{index-BiCR_Kj2.css → index-BFe2NM3q.css} +1 -1
  25. package/dist/assets/{index-D841new6.js → index-BWU02PnY.js} +1 -1
  26. package/dist/assets/{index-xdhK5tU9.js → index-Cns5MLjo.js} +1 -1
  27. package/dist/assets/{index-CnOYeKc1.js → index-DW-cTzEh.js} +1 -1
  28. package/dist/assets/{index-CpAxLUl2.js → index-DYoud8po.js} +1 -1
  29. package/dist/assets/{index-DvzXLQL6.js → index-DeuSY0Yv.js} +1 -1
  30. package/dist/assets/{index-BCY9aD4r.js → index-FrTQ7TcS.js} +3 -3
  31. package/dist/assets/index.esm-oCSEvUVx.js +1 -0
  32. package/dist/assets/info-box.css-DuVI9M9-.js +1 -0
  33. package/dist/assets/{llmops-C5uyvq6E.js → llmops-CdOQq40D.js} +1 -1
  34. package/dist/assets/{observability-C5jdcUSg.css → observability-DEEfw22p.css} +1 -1
  35. package/dist/assets/observability.css-wgjHtY3p.js +1 -0
  36. package/dist/assets/overview-D1QIYPBL.js +33 -0
  37. package/dist/assets/{plus-C_L0BpbU.js → plus-JQ0TORpd.js} +1 -1
  38. package/dist/assets/{popover-CSR0ctop.js → popover-DXj4s-ni.js} +1 -1
  39. package/dist/assets/popupStateMapping-DolkyTT3.js +1 -0
  40. package/dist/assets/requests-CzvYwfwV.js +1 -0
  41. package/dist/assets/reselect-DVmmTZGf.js +1 -0
  42. package/dist/assets/{route-vfMzB8KR.js → route-CjAw8hSU.js} +1 -1
  43. package/dist/assets/{route-CI77gokb.js → route-Df57lqxl.js} +1 -1
  44. package/dist/assets/{route-wrnLt3bn.js → route-DmWZbVk6.js} +1 -1
  45. package/dist/assets/{route-CZ2yCnzN.js → route-timDYxX2.js} +1 -1
  46. package/dist/assets/{secrets-B9u5jvFm.js → secrets-BxFGEuKj.js} +1 -1
  47. package/dist/assets/settings-DpSRw7LL.js +1 -0
  48. package/dist/assets/settings-pgWZnVf6.js +1 -0
  49. package/dist/assets/{table-xLf4iXV8.js → table-DggTSlPh.js} +1 -1
  50. package/dist/assets/{tabs.css-fttLH8Xj.js → tabs.css-CG5ugi0p.js} +1 -1
  51. package/dist/assets/{targeting-DZIwwaYV.js → targeting-CkqRTjnZ.js} +1 -1
  52. package/dist/assets/{tooltip-BKoDpdAC.js → tooltip-BuSsMQ8P.js} +1 -1
  53. package/dist/assets/{update-or-create-name-ChWLK2jI.js → update-or-create-name-B-M46wHl.js} +1 -1
  54. package/dist/assets/useAnalytics-DTf81POS.js +1 -0
  55. package/dist/assets/useButton-CsZ8hBM8.js +1 -0
  56. package/dist/assets/{useConfigList-Du__Gu7q.js → useConfigList-CAf01_dV.js} +1 -1
  57. package/dist/assets/{useConfigVariants-C8frrCcZ.js → useConfigVariants-CLc_hPw1.js} +1 -1
  58. package/dist/assets/{useEnvironments-CYkrqAdO.js → useEnvironments-Bu_0SIUj.js} +1 -1
  59. package/dist/assets/{useFocus-Du1aH2j1.js → useFocus-9TCY0h5x.js} +1 -1
  60. package/dist/assets/{useMutation-VUB-GXkv.js → useMutation-D4JglXWk.js} +1 -1
  61. package/dist/assets/{usePopupAutoResize-ddPHogUJ.js → usePopupAutoResize-D6RSlB-m.js} +1 -1
  62. package/dist/assets/{useRole-DP91D1OX.js → useRole-CiSaVva3.js} +1 -1
  63. package/dist/assets/useSetTargeting-bk0Ixhqq.js +1 -0
  64. package/dist/assets/{useSyncedFloatingRootContext-BzuhbdSw.js → useSyncedFloatingRootContext-BKbVh8Gq.js} +1 -1
  65. package/dist/assets/{useTargetingRules-DS57orU0.js → useTargetingRules-BrgaEdxR.js} +1 -1
  66. package/dist/assets/{useValueChanged-vz8uKgCk.js → useValueChanged-CTjBqaGs.js} +1 -1
  67. package/dist/assets/{user-profile-Bt3_D9Gr.js → user-profile-BB3dPOc5.js} +1 -1
  68. package/dist/assets/{variants-CYXSNKzX.js → variants-BH682hHM.js} +1 -1
  69. package/dist/assets/variants.css-rCWHZycz.js +1 -0
  70. package/dist/assets/{workspace-general-BRMpUqb-.js → workspace-general-DYXfOF9H.js} +1 -1
  71. package/dist/index.cjs +82 -14
  72. package/dist/index.mjs +82 -14
  73. package/package.json +4 -3
  74. package/dist/assets/_environment-zVjmOhBI.js +0 -1
  75. package/dist/assets/_observability-CQ4Ll_WT.js +0 -1
  76. package/dist/assets/check-PaWYhFn6.js +0 -1
  77. package/dist/assets/configs-CtNuMmVR.js +0 -1
  78. package/dist/assets/costs-DwVSRTwW.js +0 -1
  79. package/dist/assets/environments-BB95BiC0.js +0 -1
  80. package/dist/assets/index.esm-COTq2pHX.js +0 -1
  81. package/dist/assets/info-box.css-HIaMvhbC.js +0 -1
  82. package/dist/assets/observability.css-dztiak5K.js +0 -1
  83. package/dist/assets/overview-BwCF8A1G.js +0 -1
  84. package/dist/assets/popupStateMapping-DkOpwBhG.js +0 -1
  85. package/dist/assets/requests-D8wE_E2M.js +0 -1
  86. package/dist/assets/settings-24qWHZEq.js +0 -1
  87. package/dist/assets/settings-BLt538aO.js +0 -1
  88. package/dist/assets/useButton-Ct8hIyjz.js +0 -1
  89. package/dist/assets/useSetTargeting-D1rPM8vz.js +0 -1
  90. package/dist/assets/variants.css-BjGKD3Nv.js +0 -1
@@ -1,4 +1,4 @@
1
- import{X as hg,r as w,j as k,y as wr,l as pg,a as qe,e as mg,I as Gu,Y as Ia,t as yg,i as Fo,g as Yu,Z as _g,d as vg,_ as xg}from"./index-BCY9aD4r.js";import{u as Bs,C as Zu,a as bg,b as Sg,g as Cg,c as Xu,d as Eg,e as Tg,f as wg,h as kg,S as Ng,i as Mo,v as Ra,j as Ag,k as Pg,m as Ig,l as Rg,n as Og,o as Fg,p as Mg,q as $g,r as Lg,s as Dg,t as Bg}from"./useSetTargeting-D1rPM8vz.js";import{e as Qu,i as Zt,u as jg}from"./index.esm-COTq2pHX.js";import{u as zg,a as ec,b as tc,P as nc}from"./popover-CSR0ctop.js";import{f as In,d as rc,m as ys,e as $o,c as bt,b as Ug,E as js,u as tr,a as Fe,h as ji,i as sc,j as Kg,k as Wg,l as Vg,n as fi}from"./useButton-Ct8hIyjz.js";import{z as ic,o as nr,s as Hg,A as qg,c as ct,r as oc,v as Jg,F as Gg,D as Yg,q as Zg,t as br,B as Xg,E as mr,R as Qg,P as eh,d as Le,G as ac,H as lc,I as uc,J as th,u as _s,e as Oa,f as nh,K as zi,L as rh,h as sh,m as ih,k as oh,l as Lo,M as cc,N as ah,O as lh,Q as Qt,S as uh,a as ls,U as ch,V as dh,W as fh,X as gh,Y as hh,Z as Fa,_ as Ma,$ as ph,p as mh,a0 as dc,n as yh,y as fc,a1 as gc,a2 as _h,a3 as vh,a4 as xh,a5 as $a,a6 as hc,a7 as La}from"./popupStateMapping-DkOpwBhG.js";import{g as bh,u as Sh,b as Do}from"./getDisabledMountTransitionStyles-CKUvhO4q.js";import{C as pc,u as Ch,H as mc,E as yc,A as _c,a as vc,b as xc,c as bc}from"./useRole-DP91D1OX.js";import{a as Eh,u as Th}from"./useValueChanged-vz8uKgCk.js";import{C as wh}from"./chevron-right-Dz77YeP_.js";import{C as Sc}from"./check-PaWYhFn6.js";import{C as Cc}from"./chevron-down-BjDiaa62.js";import{F as kh,I as Nh,i as Ah,u as Ph,a as Ih,b as Ec}from"./InternalBackdrop-CXjGP6a9.js";import{p as Rh,c as Oh,a as Fh,b as Mh,u as $h,d as Lh,e as Dh}from"./useSyncedFloatingRootContext-BzuhbdSw.js";import{b as Bh,u as Tc,s as wc}from"./usePopupAutoResize-ddPHogUJ.js";import{u as jh}from"./useFocus-Du1aH2j1.js";import{u as kc}from"./useMutation-VUB-GXkv.js";import{g as zh,u as Uh}from"./useConfigVariants-C8frrCcZ.js";import{u as Kh}from"./useTargetingRules-DS57orU0.js";import{B as gi}from"./button-DftzA6-1.js";import{u as Wh}from"./useEnvironments-CYkrqAdO.js";/* empty css *//* empty css */function Vh(n,e){if(n===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in n)return n;if(typeof n=="function")return{shouldBlockFn:async()=>await n(),enableBeforeUnload:!0,withResolver:!1};const t=!!(n.condition??!0),r=n.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function Hh(n,e){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=Vh(n),o=hg(),{history:a}=o,[l,c]=w.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return w.useEffect(()=>{const u=async f=>{function d(p){const _=o.parseLocation(p),C=o.getMatchedRoutes(_.pathname);return C.foundRoute===void 0?{routeId:"__notFound__",fullPath:_.pathname,pathname:_.pathname,params:C.routeParams,search:o.options.parseSearch(p.search)}:{routeId:C.foundRoute.id,fullPath:C.foundRoute.fullPath,pathname:_.pathname,params:C.routeParams,search:o.options.parseSearch(p.search)}}const h=d(f.currentLocation),g=d(f.nextLocation);if(h.routeId==="__notFound__"&&g.routeId!=="__notFound__")return!1;const m=await t({action:f.action,current:h,next:g});if(!i)return m;if(!m)return!1;const x=await new Promise(p=>{c({status:"blocked",current:h,next:g,action:f.action,proceed:()=>p(!1),reset:()=>p(!0)})});return c({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),x};return s?void 0:a.block({blockerFn:u,enableBeforeUnload:r})},[t,r,s,i,a,o]),l}function Nc(n,e,t=(r,s)=>r===s){return n.length===e.length&&n.every((r,s)=>t(r,e[s]))}const qh=w.createContext(void 0);function zs(n=!0){const e=w.useContext(qh);if(e===void 0&&!n)throw new Error(In(25));return e}const Ac=w.createContext(void 0);function Bo(n){const e=w.useContext(Ac);if(e===void 0&&!n)throw new Error(In(33));return e}const Pc=w.createContext(void 0);function Gt(n){const e=w.useContext(Pc);if(e===void 0&&!n)throw new Error(In(36));return e}const Jh={type:"regular-item"};function Ic(n){const{closeOnClick:e,disabled:t=!1,highlighted:r,id:s,store:i,nativeButton:o,itemMetadata:a,nodeId:l}=n,c=w.useRef(null),u=zs(!0),f=u!==void 0,{events:d}=i.useState("floatingTreeRoot"),{getButtonProps:h,buttonRef:g}=rc({disabled:t,focusableWhenDisabled:!0,native:o}),m=w.useCallback(x=>ys({id:s,role:"menuitem",tabIndex:r?0:-1,onMouseMove(p){l&&d.emit("itemhover",{nodeId:l,target:p.currentTarget})},onMouseEnter(){a.type==="submenu-trigger"&&a.setActive()},onKeyUp(p){p.key===" "&&i.context.typingRef.current&&p.preventBaseUIHandler()},onClick(p){e&&d.emit("close",{domEvent:p,reason:ic})},onMouseUp(p){if(u){const _=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,f&&_&&Math.abs(p.clientX-_.x)<=1&&Math.abs(p.clientY-_.y)<=1)return}c.current&&i.context.allowMouseUpTriggerRef.current&&(!f||p.button===2)&&a.type==="regular-item"&&c.current.click()}},x,h),[s,r,h,e,d,i,f,u,a,l]),y=$o(c,g);return w.useMemo(()=>({getItemProps:m,itemRef:y}),[m,y])}const Gh=w.forwardRef(function(e,t){const{render:r,className:s,id:i,label:o,nativeButton:a=!1,disabled:l=!1,closeOnClick:c=!0,...u}=e,f=Bs({label:o}),d=Bo(!0),h=nr(i),{store:g}=Gt(),m=g.useState("isActive",f.index),y=g.useState("itemProps"),{getItemProps:x,itemRef:p}=Ic({closeOnClick:c,disabled:l,highlighted:m,id:h,store:g,nativeButton:a,nodeId:d?.nodeId,itemMetadata:Jh}),_=w.useMemo(()=>({disabled:l,highlighted:m}),[l,m]);return bt("div",e,{state:_,props:[y,u,x],ref:[p,t,f.ref]})}),Yh={...oc,...Jg},Da=w.forwardRef(function(e,t){const{render:r,className:s,finalFocus:i,...o}=e,{store:a}=Gt(),{side:l,align:c}=Bo(),u=zg()!=null,f=a.useState("open"),d=a.useState("transitionStatus"),h=a.useState("popupProps"),g=a.useState("mounted"),m=a.useState("instantType"),y=a.useState("activeTriggerElement"),x=a.useState("parent"),p=a.useState("lastOpenChangeReason"),_=a.useState("rootId"),C=a.useState("floatingRootContext"),v=a.useState("floatingTreeRoot"),b=a.useState("closeDelay"),S=a.useState("activeTriggerElement");Hg({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}}),w.useEffect(()=>{function R(I){a.setOpen(!1,ct(I.reason,I.domEvent))}return v.events.on("close",R),()=>{v.events.off("close",R)}},[v.events,a]);const T=a.useState("hoverEnabled"),E=a.useState("disabled");Bh(C,{enabled:T&&!E&&x.type!=="context-menu"&&x.type!=="menubar",closeDelay:b});const N=w.useMemo(()=>({transitionStatus:d,side:l,align:c,open:f,nested:x.type==="menu",instant:m}),[d,l,c,f,x.type,m]),P=bt("div",e,{state:N,ref:[t,a.context.popupRef],stateAttributesMapping:Yh,props:[h,{onKeyDown(R){u&&pc.has(R.key)&&R.stopPropagation()}},bh(d),o,{"data-rootownerid":_}]});let $=x.type===void 0||x.type==="context-menu";return(y||x.type==="menubar"&&p!==qg)&&($=!0),k.jsx(kh,{context:C,modal:!1,disabled:!g,returnFocus:i===void 0?$:i,initialFocus:x.type!=="menu",restoreFocus:!0,externalTree:x.type!=="menubar"?v:void 0,previousFocusableElement:S,nextFocusableElement:x.type===void 0?a.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:x.type===void 0?a.context.beforeContentFocusGuardRef:void 0,children:P})}),Rc=w.createContext(void 0);function Zh(){const n=w.useContext(Rc);if(n===void 0)throw new Error(In(32));return n}const Ba=w.forwardRef(function(e,t){const{keepMounted:r=!1,...s}=e,{store:i}=Gt();return i.useState("mounted")||r?k.jsx(Rc.Provider,{value:r,children:k.jsx(Gg,{ref:t,...s})}):null}),ja=w.forwardRef(function(e,t){const{anchor:r,positionMethod:s="absolute",className:i,render:o,side:a,align:l,sideOffset:c=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:d=5,arrowPadding:h=5,sticky:g=!1,disableAnchorTracking:m=!1,collisionAvoidance:y=Yg,...x}=e,{store:p}=Gt(),_=Zh(),C=zs(!0),v=p.useState("parent"),b=p.useState("floatingRootContext"),S=p.useState("floatingTreeRoot"),T=p.useState("mounted"),E=p.useState("open"),N=p.useState("modal"),P=p.useState("activeTriggerElement"),$=p.useState("lastOpenChangeReason"),R=p.useState("floatingNodeId"),I=p.useState("floatingParentNodeId");let j=r,B=c,M=u,U=l,z=y;v.type==="context-menu"&&(j=r??v.context?.anchor,U=U??"start",!a&&U!=="center"&&(M=e.alignOffset??2,B=e.sideOffset??-5));let Z=a,ne=U;v.type==="menu"?(Z=Z??"inline-end",ne=ne??"start",z=e.collisionAvoidance??Zg):v.type==="menubar"&&(Z=Z??"bottom",ne=ne??"start");const J=v.type==="context-menu",q=Sh({anchor:j,floatingRootContext:b,positionMethod:C?"fixed":s,mounted:T,side:Z,sideOffset:B,align:ne,alignOffset:M,arrowPadding:J?0:h,collisionBoundary:f,collisionPadding:d,sticky:g,nodeId:R,keepMounted:_,disableAnchorTracking:m,collisionAvoidance:z,shiftCrossAxis:J,externalTree:S}),H=w.useMemo(()=>{const ie={};return E||(ie.pointerEvents="none"),{role:"presentation",hidden:!T,style:{...q.positionerStyles,...ie}}},[E,T,q.positionerStyles]);w.useEffect(()=>{function ie(V){V.open?(V.parentNodeId===R&&p.set("hoverEnabled",!1),V.nodeId!==R&&V.parentNodeId===p.select("floatingParentNodeId")&&p.setOpen(!1,ct(mr))):V.parentNodeId===R&&V.reason!==mr&&p.set("hoverEnabled",!0)}return S.events.on("menuopenchange",ie),()=>{S.events.off("menuopenchange",ie)}},[p,S.events,R]),w.useEffect(()=>{if(p.select("floatingParentNodeId")==null)return;function ie(V){if(V.open||V.nodeId!==p.select("floatingParentNodeId"))return;const ce=V.reason??mr;p.setOpen(!1,ct(ce))}return S.events.on("menuopenchange",ie),()=>{S.events.off("menuopenchange",ie)}},[S.events,p]),w.useEffect(()=>{function ie(V){!E||V.nodeId!==p.select("floatingParentNodeId")||V.target&&P&&P!==V.target&&p.setOpen(!1,ct(mr))}return S.events.on("itemhover",ie),()=>{S.events.off("itemhover",ie)}},[S.events,E,P,p]),w.useEffect(()=>{const ie={open:E,nodeId:R,parentNodeId:I,reason:p.select("lastOpenChangeReason")};S.events.emit("menuopenchange",ie)},[S.events,E,p,R,I]);const ae=w.useMemo(()=>({open:E,side:q.side,align:q.align,anchorHidden:q.anchorHidden,nested:v.type==="menu"}),[E,q.side,q.align,q.anchorHidden,v.type]),re=w.useMemo(()=>({side:q.side,align:q.align,arrowRef:q.arrowRef,arrowUncentered:q.arrowUncentered,arrowStyles:q.arrowStyles,nodeId:q.context.nodeId}),[q.side,q.align,q.arrowRef,q.arrowUncentered,q.arrowStyles,q.context.nodeId]),le=bt("div",e,{state:ae,stateAttributesMapping:oc,ref:[t,p.useStateSetter("positionerElement")],props:[H,x]}),Q=T&&v.type!=="menu"&&(v.type!=="menubar"&&N&&$!==br||v.type==="menubar"&&v.context.modal);let te=null;return v.type==="menubar"?te=v.context.contentElement:v.type===void 0&&(te=P),k.jsxs(Ac.Provider,{value:re,children:[Q&&k.jsx(Nh,{ref:v.type==="context-menu"||v.type==="nested-context-menu"?v.context.internalBackdropRef:null,inert:Ah(!E),cutout:te}),k.jsx(Xg,{id:R,children:k.jsx(Zu,{elementsRef:p.context.itemDomElements,labelsRef:p.context.itemLabels,children:le})})]})}),Xh=w.createContext(null);function Oc(n){return w.useContext(Xh)}const Qh={...Rh,disabled:Le(n=>n.parent.type==="menubar"&&n.parent.context.disabled||n.disabled),modal:Le(n=>(n.parent.type===void 0||n.parent.type==="context-menu")&&(n.modal??!0)),allowMouseEnter:Le(n=>n.parent.type==="menu"?n.parent.store.select("allowMouseEnter"):n.allowMouseEnter),stickIfOpen:Le(n=>n.stickIfOpen),parent:Le(n=>n.parent),rootId:Le(n=>n.parent.type==="menu"?n.parent.store.select("rootId"):n.parent.type!==void 0?n.parent.context.rootId:n.rootId),activeIndex:Le(n=>n.activeIndex),isActive:Le((n,e)=>n.activeIndex===e),hoverEnabled:Le(n=>n.hoverEnabled),instantType:Le(n=>n.instantType),lastOpenChangeReason:Le(n=>n.openChangeReason),floatingTreeRoot:Le(n=>n.parent.type==="menu"?n.parent.store.select("floatingTreeRoot"):n.floatingTreeRoot),floatingNodeId:Le(n=>n.floatingNodeId),floatingParentNodeId:Le(n=>n.floatingParentNodeId),itemProps:Le(n=>n.itemProps),closeDelay:Le(n=>n.closeDelay),keyboardEventRelay:Le(n=>{if(n.keyboardEventRelay)return n.keyboardEventRelay;if(n.parent.type==="menu")return n.parent.store.select("keyboardEventRelay")})};class jo extends Qg{constructor(e){super({...ep(),...e},{positionerRef:w.createRef(),popupRef:w.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:w.createRef(),beforeContentFocusGuardRef:w.createRef(),onOpenChangeComplete:void 0,triggerElements:new eh},Qh),this.observe(Le(t=>t.allowMouseEnter),(t,r)=>{this.state.parent.type==="menu"&&t!==r&&this.state.parent.store.set("allowMouseEnter",t)}),this.unsubscribeParentListener=this.observe("parent",t=>{if(this.unsubscribeParentListener?.(),t.type==="menu"){this.unsubscribeParentListener=t.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=t.store.context.allowMouseUpTriggerRef;return}t.type!==void 0&&(this.context.allowMouseUpTriggerRef=t.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}static useStore(e,t){return Ug(()=>e??new jo(t)).current}unsubscribeParentListener=null}function ep(){return{...Oh(),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 ac,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:js,keyboardEventRelay:void 0,closeDelay:0}}const Fc=w.createContext(void 0);function Mc(){return w.useContext(Fc)}function $c(n){const{children:e,open:t,onOpenChange:r,onOpenChangeComplete:s,defaultOpen:i=!1,disabled:o=!1,modal:a,loopFocus:l=!0,orientation:c="vertical",actionsRef:u,closeParentOnEsc:f=!1,handle:d,triggerId:h,defaultTriggerId:g=null,highlightItemOnHover:m=!0}=n,y=zs(!0),x=Gt(!0),p=Oc(),_=Mc(),C=w.useMemo(()=>_&&x?{type:"menu",store:x.store}:p?{type:"menubar",context:p}:y&&!x?{type:"context-menu",context:y}:{type:void 0},[y,x,p,_]),v=jo.useStore(d?.store,{parent:C}),b=v.useState("floatingTreeRoot"),S=lc(b),T=uc();tr(()=>{y&&!x?v.update({parent:{type:"context-menu",context:y},floatingNodeId:S,floatingParentNodeId:T}):x&&v.update({floatingNodeId:S,floatingParentNodeId:T})},[y,x,S,T,v]),v.useControlledProp("open",t,i),v.useControlledProp("activeTriggerId",h,g),v.useContextCallback("onOpenChangeComplete",s);const E=v.useState("open"),N=v.useState("activeTriggerElement"),P=v.useState("positionerElement"),$=v.useState("hoverEnabled"),R=v.useState("modal"),I=v.useState("disabled"),j=v.useState("lastOpenChangeReason"),B=v.useState("parent"),M=v.useState("activeIndex"),U=v.useState("payload"),z=v.useState("floatingParentNodeId"),Z=w.useRef(null),ne=z!=null;let J;v.useSyncedValues({disabled:o,modal:B.type===void 0?a:void 0,rootId:th()});const{openMethod:q,triggerProps:H,reset:ae}=Ph(E);Fh(v);const{forceUnmount:re}=Mh(E,v,()=>{v.update({allowMouseEnter:!1,stickIfOpen:!0}),ae()}),le=w.useRef(B.type!=="context-menu"),Q=_s();w.useEffect(()=>{if(E||(Z.current=null),B.type==="context-menu"){if(!E){Q.clear(),le.current=!1;return}Q.start(500,()=>{le.current=!0})}},[Q,E,B.type]),Ih(E&&R&&j!==br&&q!=="touch",P),tr(()=>{!E&&!$&&v.set("hoverEnabled",!0)},[E,$,v]);const te=w.useRef(!0),ie=_s(),V=Fe((de,Y)=>{const Se=Y.reason;if(E===de&&Y.trigger===N||(Y.preventUnmountOnClose=()=>{v.set("preventUnmountingOnClose",!0)},!de&&Y.trigger==null&&(Y.trigger=N??void 0),r?.(de,Y),Y.isCanceled))return;const rt={open:de,nativeEvent:Y.event,reason:Y.reason,nested:ne};J?.emit("openchange",rt);const st=Y.event;if(de===!1&&st?.type==="click"&&st.pointerType==="touch"&&!te.current)return;if(!de&&M!==null){const be=v.context.itemDomElements.current[M];queueMicrotask(()=>{be?.setAttribute("tabindex","-1")})}de&&Se===Oa?(te.current=!1,ie.start(300,()=>{te.current=!0})):(te.current=!0,ie.clear());const cn=(Se===nh||Se===ic)&&st.detail===0&&st?.isTrusted,Hr=!de&&(Se===sh||Se==null);function Ce(){const be={open:de,openChangeReason:Se};Z.current=Y.event??null;const Pe=Y.trigger?.id??null;(Pe||de)&&(be.activeTriggerId=Pe,be.activeTriggerElement=Y.trigger??null),v.update(be)}Se===br?wr.flushSync(Ce):Ce(),B.type==="menubar"&&(Se===Oa||Se===zi||Se===br||Se===rh||Se===mr)?v.set("instantType","group"):cn||Hr?v.set("instantType",cn?"click":"dismiss"):v.set("instantType",void 0)}),ce=w.useCallback(de=>{const Y=ct(de);return Y.preventUnmountOnClose=()=>{v.set("preventUnmountingOnClose",!0)},Y},[v]),he=w.useCallback(()=>{v.setOpen(!1,ce(ih))},[v,ce]);w.useImperativeHandle(u,()=>({unmount:re,close:he}),[re,he]);let Ne;B.type==="context-menu"&&(Ne=B.context),w.useImperativeHandle(Ne?.positionerRef,()=>P,[P]),w.useImperativeHandle(Ne?.actionsRef,()=>({setOpen:V}),[V]);const W=$h({popupStore:v,onOpenChange:V});J=W.context.events,w.useEffect(()=>{const de=({open:Y,eventDetails:Se})=>V(Y,Se);return J.on("setOpen",de),()=>{J?.off("setOpen",de)}},[J,V]);const ue=oh(W,{enabled:!I,bubbles:f&&B.type==="menu",outsidePress(){return B.type!=="context-menu"||Z.current?.type==="contextmenu"?!0:le.current},externalTree:ne?b:void 0}),G=Ch(W,{role:"menu"}),oe=Do(),ee=w.useCallback(de=>{v.select("activeIndex")!==de&&v.set("activeIndex",de)},[v]),Ae=bg(W,{enabled:!I,listRef:v.context.itemDomElements,activeIndex:M,nested:B.type!==void 0,loopFocus:l,orientation:c,parentOrientation:B.type==="menubar"?B.context.orientation:void 0,rtl:oe==="rtl",disabledIndices:ji,onNavigate:ee,openOnArrowKeyDown:B.type!=="context-menu",externalTree:ne?b:void 0,focusItemOnHover:m}),lt=w.useCallback(de=>{v.context.typingRef.current=de},[v]),Ge=Sg(W,{listRef:v.context.itemLabels,activeIndex:M,resetMs:lh,onMatch:de=>{E&&de!==M&&v.set("activeIndex",de)},onTypingChange:lt}),{getReferenceProps:ut,getFloatingProps:Dt,getItemProps:Et,getTriggerProps:me}=Lo([ue,G,Ae,Ge]),Bt=w.useMemo(()=>{const de=ys(ut(),{onMouseEnter(){v.set("hoverEnabled",!0)},onMouseMove(){v.set("allowMouseEnter",!0)}},H);return delete de.role,de},[ut,v,H]),Ye=w.useMemo(()=>{const de=me();if(!de)return de;const Y=ys(de,H);return delete Y.role,delete Y["aria-controls"],Y},[me,H]),Ke=cc(),We=w.useMemo(()=>Dt({onMouseEnter(){B.type==="menu"&&Ke.request(()=>v.set("hoverEnabled",!1))},onMouseMove(){v.set("allowMouseEnter",!0)},onClick(){v.select("hoverEnabled")&&v.set("hoverEnabled",!1)},onKeyDown(de){const Y=v.select("keyboardEventRelay");Y&&!de.isPropagationStopped()&&Y(de)}}),[Dt,B.type,Ke,v]),jt=w.useMemo(()=>Et(),[Et]);v.useSyncedValues({floatingRootContext:W,activeTriggerProps:Bt,inactiveTriggerProps:Ye,popupProps:We,itemProps:jt});const et=w.useMemo(()=>({store:v,parent:C}),[v,C]),Dn=k.jsx(Pc.Provider,{value:et,children:typeof e=="function"?e({payload:U}):e});return B.type===void 0||B.type==="context-menu"?k.jsx(ah,{externalTree:b,children:Dn}):Dn}function tp(n){const e=Gt().store,t=w.useMemo(()=>({parentMenu:e}),[e]);return k.jsx(Fc.Provider,{value:t,children:k.jsx($c,{...n})})}function np(n={}){const{highlightItemOnHover:e,highlightedIndex:t,onHighlightedIndexChange:r}=sc(),{ref:s,index:i}=Bs(n),o=t===i,a=w.useRef(null),l=$o(s,a);return{compositeProps:w.useMemo(()=>({tabIndex:o?0:-1,onFocus(){r(i)},onMouseMove(){const u=a.current;if(!e||!u)return;const f=u.hasAttribute("disabled")||u.ariaDisabled==="true";!o&&!f&&u.focus()}}),[o,r,i,e]),compositeRef:l,index:i}}function rp(n){const{render:e,className:t,state:r=js,props:s=ji,refs:i=ji,metadata:o,stateAttributesMapping:a,tag:l="div",...c}=n,{compositeProps:u,compositeRef:f}=np({metadata:o});return bt(l,n,{state:r,ref:[...i,f],props:[u,...s,c],stateAttributesMapping:a})}function Lc(n){if(Kg(n)&&n.hasAttribute("data-rootownerid"))return n.getAttribute("data-rootownerid")??void 0;if(!Wg(n))return Lc(Vg(n))}function sp(n){const{enabled:e=!0,mouseDownAction:t,open:r}=n,s=w.useRef(!1);return w.useMemo(()=>e?{onMouseDown:i=>{(t==="open"&&!r||t==="close"&&r)&&(s.current=!0,Qt(i.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:i=>{s.current&&(s.current=!1,i.preventBaseUIHandler())}}:js,[e,t,r])}const Gr=2,ip=w.forwardRef(function(e,t){const{render:r,className:s,disabled:i=!1,nativeButton:o=!0,id:a,openOnHover:l,delay:c=100,closeDelay:u=0,handle:f,payload:d,...h}=e,g=Gt(!0),m=f?.store??g?.store;if(!m)throw new Error(In(85));const y=nr(a),x=m.useState("isTriggerActive",y),p=m.useState("floatingRootContext"),_=m.useState("isOpenedByTrigger",y),C=w.useRef(null),v=ap(),b=sc(!0),S=uh(),T=w.useMemo(()=>S??new ac,[S]),E=lc(T),N=uc(),{registerTrigger:P,isMountedByThisTrigger:$}=Lh(y,C,m,{payload:d,closeDelay:u,parent:v,floatingTreeRoot:T,floatingNodeId:E,floatingParentNodeId:N,keyboardEventRelay:b?.relayKeyboardEvent}),R=m.useState("disabled"),I=i||R||v.type==="menubar"&&v.context.disabled,{getButtonProps:j,buttonRef:B}=rc({disabled:I,native:o});w.useEffect(()=>{!_&&v.type===void 0&&(m.context.allowMouseUpTriggerRef.current=!1)},[m,_,v.type]);const M=w.useRef(null),U=_s(),z=Fe(G=>{if(!M.current)return;U.clear(),m.context.allowMouseUpTriggerRef.current=!1;const oe=G.target;if(ls(M.current,oe)||ls(m.select("positionerElement"),oe)||oe===M.current||oe!=null&&Lc(oe)===m.select("rootId"))return;const ee=Cg(M.current);G.clientX>=ee.left-Gr&&G.clientX<=ee.right+Gr&&G.clientY>=ee.top-Gr&&G.clientY<=ee.bottom+Gr||T.events.emit("close",{domEvent:G,reason:ch})});w.useEffect(()=>{_&&m.select("lastOpenChangeReason")===br&&Qt(M.current).addEventListener("mouseup",z,{once:!0})},[_,z,m]);const Z=v.type==="menubar"&&v.context.hasSubmenuOpen,J=Tc(p,{enabled:(l??Z??!1)&&!I&&v.type!=="context-menu"&&(v.type!=="menubar"||Z&&!$),handleClose:wc({blockPointerEvents:v.type!=="menubar"}),mouseOnly:!0,move:!1,restMs:v.type===void 0?c:void 0,delay:{close:u},triggerElementRef:C,externalTree:T,isActiveTrigger:x}),q=op(_,m.select("lastOpenChangeReason")),H=Ec(p,{enabled:!I&&v.type!=="context-menu",event:_&&v.type==="menubar"?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:v.type===void 0?q:!1}),ae=jh(p,{enabled:!I&&(v.type!=="menubar"&&_||Z)}),re=sp({open:_,enabled:v.type==="menubar",mouseDownAction:"open"}),le=Lo([H,ae]),Q=v.type==="menubar",te=w.useMemo(()=>({disabled:I,open:_}),[I,_]),ie=m.useState("triggerProps",$),V=[M,t,B,P,C],ce=[le.getReferenceProps(),J??js,ie,{"aria-haspopup":"menu",id:y,onMouseDown:G=>{if(m.select("open"))return;U.start(200,()=>{m.context.allowMouseUpTriggerRef.current=!0}),Qt(G.currentTarget).addEventListener("mouseup",z,{once:!0})}},Q?{role:"menuitem"}:{},re,h,j],he=w.useRef(null),Ne=Fe(G=>{wr.flushSync(()=>{m.setOpen(!1,ct(zi,G.nativeEvent,G.currentTarget))}),dh(he.current)?.focus()}),W=Fe(G=>{const oe=m.select("positionerElement");if(oe&&fh(G,oe))m.context.beforeContentFocusGuardRef.current?.focus();else{wr.flushSync(()=>{m.setOpen(!1,ct(zi,G.nativeEvent,G.currentTarget))});let ee=gh(C.current);for(;ee!==null&&ls(oe,ee)||ee?.hasAttribute("aria-hidden");){const Ae=ee;if(ee=hh(ee),ee===Ae)break}ee?.focus()}}),ue=bt("button",e,{enabled:!Q,stateAttributesMapping:Fa,state:te,ref:V,props:ce});return Q?k.jsx(rp,{tag:"button",render:r,className:s,state:te,refs:V,props:ce,stateAttributesMapping:Fa}):_?k.jsxs(w.Fragment,{children:[k.jsx(Ma,{ref:he,onFocus:Ne},`${y}-pre-focus-guard`),k.jsx(w.Fragment,{children:ue},y),k.jsx(Ma,{ref:m.context.triggerFocusTargetRef,onFocus:W},`${y}-post-focus-guard`)]}):k.jsx(w.Fragment,{children:ue},y)});function op(n,e){const t=_s(),[r,s]=w.useState(!1);return tr(()=>{n&&e==="trigger-hover"?(s(!0),t.start(ph,()=>{s(!1)})):n||(t.clear(),s(!1))},[n,e,t]),r}function ap(){const n=zs(!0),e=Gt(!0),t=Oc();return w.useMemo(()=>t?{type:"menubar",context:t}:n&&!e?{type:"context-menu",context:n}:{type:void 0},[n,e,t])}const lp=w.forwardRef(function(e,t){const{render:r,className:s,label:i,id:o,nativeButton:a=!1,openOnHover:l=!0,delay:c=100,closeDelay:u=0,disabled:f=!1,...d}=e,h=Bs(),g=Bo(),{store:m}=Gt(),y=nr(o),x=m.useState("open"),p=m.useState("floatingRootContext"),_=m.useState("floatingTreeRoot"),C=Dh(y,m),v=w.useCallback(ae=>{const re=C(ae);return ae!==null&&m.select("open")&&m.select("activeTriggerId")==null&&m.update({activeTriggerId:y,activeTriggerElement:ae,closeDelay:u}),re},[C,u,m,y]),b=w.useRef(null),S=w.useCallback(ae=>{b.current=ae,m.set("activeTriggerElement",ae)},[m]),T=Mc();if(!T?.parentMenu)throw new Error(In(37));m.useSyncedValue("closeDelay",u);const E=T.parentMenu,N=E.useState("itemProps"),P=E.useState("isActive",h.index),$=w.useMemo(()=>({type:"submenu-trigger",setActive:()=>E.set("activeIndex",h.index)}),[E,h.index]),R=m.useState("disabled"),I=f||R,{getItemProps:j,itemRef:B}=Ic({closeOnClick:!1,disabled:I,highlighted:P,id:y,store:m,nativeButton:a,itemMetadata:$,nodeId:g?.nodeId}),M=m.useState("hoverEnabled"),U=m.useState("allowMouseEnter"),z=Tc(p,{enabled:M&&l&&!I&&U,handleClose:wc({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:c,delay:{open:c,close:u},triggerElementRef:b,externalTree:_}),Z=Ec(p,{enabled:!I,event:"mousedown",toggle:!l,ignoreMouse:l,stickIfOpen:!1}),ne=Lo([Z]),J=m.useState("triggerProps",!0);delete J.id;const q=w.useMemo(()=>({disabled:I,highlighted:P,open:x}),[I,P,x]);return bt("div",e,{state:q,stateAttributesMapping:mh,props:[ne.getReferenceProps(),z,J,N,{tabIndex:x||P?0:-1,onBlur(){P&&E.set("activeIndex",null)}},d,j],ref:[t,h.ref,B,v,S]})}),za=new Map;function up(n,e){const t=JSON.stringify({locale:n,options:e}),r=za.get(t);if(r)return r;const s=new Intl.NumberFormat(n,e);return za.set(t,s),s}function us(n,e,t){return n==null?"":up(e,t).format(n)}function Ui(n,e,t){return(n-e)*100/(t-e)}function yt(n,e=Number.MIN_SAFE_INTEGER,t=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(n,t))}function Dc(n,e){return n-e}function cp(n,e,t){const r=n.slice();return r[e]=t,r.sort(Dc)}function Bc(n,e,t,r,s,i){let o=n;return o=yt(o,t,r),s&&(o=cp(i,e,yt(o,i[e-1]||-1/0,i[e+1]||1/0))),o}function jc(n,e,t){if(!Array.isArray(n))return!0;const r=n.reduce((s,i,o,a)=>(o===a.length-1||s.push(Math.abs(i-a[o+1])),s),[]);return Math.min(...r)>=e*t}const Fr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null},zc=w.createContext(void 0);function Us(){const n=w.useContext(zc);if(n===void 0)throw new Error(In(62));return n}function dp(n){return"key"in n?_h:vh}function fp(n,e){return typeof n=="number"&&typeof e=="number"?n===e:Array.isArray(n)&&Array.isArray(e)?Nc(n,e):!1}const gp=w.forwardRef(function(e,t){const{"aria-labelledby":r,className:s,defaultValue:i,disabled:o=!1,id:a,format:l,largeStep:c=10,locale:u,render:f,max:d=100,min:h=0,minStepsBetweenValues:g=0,name:m,onValueChange:y,onValueCommitted:x,orientation:p="horizontal",step:_=1,thumbCollisionBehavior:C="push",thumbAlignment:v="center",value:b,...S}=e,T=nr(a),E=Fe(y),N=Fe(x),{clearErrors:P}=Eh(),{state:$,disabled:R,name:I,setTouched:j,setDirty:B,validityData:M,shouldValidateOnChange:U,validation:z}=Xu(),{labelId:Z}=Eg(),ne=r??Z,J=R||o,q=I??m,[H,ae]=Tg({controlled:b,default:i??h,name:"Slider"}),re=w.useRef(null),le=w.useRef(null),Q=w.useRef([]),te=w.useRef(null),ie=w.useRef(null),V=w.useRef(-1),ce=w.useRef(null),he=w.useRef(null),Ne=w.useRef("none"),W=dc(l),[ue,G]=w.useState(-1),[oe,ee]=w.useState(-1),[Ae,lt]=w.useState(!1),[Ge,ut]=w.useState(()=>new Map),[Dt,Et]=w.useState([void 0,void 0]),me=Fe(Y=>{G(Y),Y!==-1&&ee(Y)});wg({id:T,commit:z.commit,value:H,controlRef:le,name:q,getValue:()=>H}),Th(H,()=>{P(q),U()?z.commit(H):z.commit(H,!0);const Y=M.initialValue;let Se;Array.isArray(H)&&Array.isArray(Y)?Se=!Nc(H,Y):Se=H!==Y,B(Se)});const Bt=Fe(Y=>{Y&&(le.current=Y)}),Ye=Array.isArray(H),Ke=w.useMemo(()=>Ye?H.slice().sort(Dc):[yt(H,h,d)],[d,h,Ye,H]),We=Fe((Y,Se)=>{if(Number.isNaN(Y)||fp(Y,H))return;const rt=Se??ct(yh,void 0,void 0,{activeThumbIndex:-1});Ne.current=rt.reason;const st=new event.constructor(event.type,event);Object.defineProperty(st,"target",{writable:!0,value:{value:Y,name:q}}),rt.event=st,he.current=Y,E(Y,rt),!rt.isCanceled&&ae(Y)}),jt=Fe((Y,Se,rt)=>{const st=Bc(Y,Se,h,d,Ye,Ke);if(jc(st,_,g)){const cn=dp(rt);We(st,ct(cn,rt.nativeEvent,void 0,{activeThumbIndex:Se})),j(!0);const Hr=he.current??st;N(Hr,fc(cn,rt.nativeEvent))}});tr(()=>{const Y=gc(Qt(re.current));J&&Y&&re.current?.contains(Y)&&Y.blur()},[J]),J&&ue!==-1&&me(-1);const et=w.useMemo(()=>({...$,activeThumbIndex:ue,disabled:J,dragging:Ae,orientation:p,max:d,min:h,minStepsBetweenValues:g,step:_,values:Ke}),[$,ue,J,Ae,d,h,g,p,_,Ke]),Dn=w.useMemo(()=>({active:ue,controlRef:le,disabled:J,dragging:Ae,validation:z,formatOptionsRef:W,handleInputChange:jt,indicatorPosition:Dt,inset:v!=="center",labelId:ne,largeStep:c,lastUsedThumbIndex:oe,lastChangedValueRef:he,lastChangeReasonRef:Ne,locale:u,max:d,min:h,minStepsBetweenValues:g,name:q,onValueCommitted:N,orientation:p,pressedInputRef:te,pressedThumbCenterOffsetRef:ie,pressedThumbIndexRef:V,pressedValuesRef:ce,registerFieldControlRef:Bt,renderBeforeHydration:v==="edge",setActive:me,setDragging:lt,setIndicatorPosition:Et,setValue:We,state:et,step:_,thumbCollisionBehavior:C,thumbMap:Ge,thumbRefs:Q,values:Ke}),[ue,le,ne,J,Ae,z,W,jt,Dt,c,oe,he,Ne,u,d,h,g,q,N,p,te,ie,V,ce,Bt,me,lt,Et,We,et,_,C,v,Ge,Q,Ke]),de=bt("div",e,{state:et,ref:[t,re],props:[{"aria-labelledby":ne,id:T,role:"group"},z.getValidationProps,S],stateAttributesMapping:Fr});return k.jsx(zc.Provider,{value:Dn,children:k.jsx(Zu,{elementsRef:Q,onMapChange:ut,children:de})})});function Uc(n){const e=n.getBoundingClientRect();return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function hp(n){if(Math.abs(n)<1){const t=n.toExponential().split("e-"),r=t[0].split(".")[1];return(r?r.length:0)+parseInt(t[1],10)}const e=n.toString().split(".")[1];return e?e.length:0}function Kc(n,e,t){const r=Math.round((n-t)/e)*e+t;return Number(r.toFixed(hp(e)))}function Ua({values:n,index:e,nextValue:t,min:r,max:s,step:i,minStepsBetweenValues:o,initialValues:a}){if(n.length===0)return[];const l=n.slice(),c=i*o,u=l.length-1,f=a??n,d=r+e*c,h=s-(u-e)*c;l[e]=yt(t,d,h);for(let g=e+1;g<=u;g+=1){const m=l[g-1]+c,y=s-(u-g)*c,x=f[g]??l[g];let p=Math.max(l[g],m);x<p&&(p=Math.max(x,m)),l[g]=yt(p,m,y)}for(let g=e-1;g>=0;g-=1){const m=l[g+1]-c,y=r+g*c,x=f[g]??l[g];let p=Math.min(l[g],m);x>p&&(p=Math.min(x,m)),l[g]=yt(p,y,m)}for(let g=0;g<=u;g+=1)l[g]=Number(l[g].toFixed(12));return l}function pp({behavior:n,values:e,currentValues:t,initialValues:r,pressedIndex:s,nextValue:i,min:o,max:a,step:l,minStepsBetweenValues:c}){const u=t??e,f=r??e;if(!(u.length>1))return{value:i,thumbIndex:0,didSwap:!1};const h=l*c;switch(n){case"swap":{const g=u[s],m=1e-7,y=u.slice(),x=y[s-1],p=y[s+1],_=x!=null?x+h:o,C=p!=null?p-h:a,v=yt(i,_,C),b=Number(v.toFixed(12));y[s]=b;const S=i>g,T=i<g,E=S&&p!=null&&i>=p-m,N=T&&x!=null&&i<=x+m;if(!E&&!N)return{value:y,thumbIndex:s,didSwap:!1};const P=E?s+1:s-1,$=y.map((B,M)=>{if(M===s)return b;const U=f[M];return U??u[M]});let R=i;E?R=Math.max(i,y[P]):R=Math.min(i,y[P]);const I=Ua({values:y,index:P,nextValue:R,min:o,max:a,step:l,minStepsBetweenValues:c,initialValues:$}),j=E?P-1:P+1;if(j>=0&&j<I.length){const B=I[j-1],M=I[j+1];let U=B!=null?B+h:o;U=Math.max(U,o+j*h);let z=M!=null?M-h:a;z=Math.min(z,a-(I.length-1-j)*h);const Z=yt(b,U,z);I[j]=Number(Z.toFixed(12))}return{value:I,thumbIndex:P,didSwap:!0}}case"push":return{value:Ua({values:u,index:s,nextValue:i,min:o,max:a,step:l,minStepsBetweenValues:c}),thumbIndex:s,didSwap:!1};case"none":default:{const g=u.slice(),m=g[s-1],y=g[s+1],x=m!=null?m+h:o,p=y!=null?y-h:a,_=yt(i,x,p);return g[s]=Number(_.toFixed(12)),{value:g,thumbIndex:s,didSwap:!1}}}}const mp=2;function yp(n,e){if(!n)return{start:0,end:0};function t(i){const o=i!=null?parseFloat(i):0;return Number.isNaN(o)?0:o}const r=e?"Top":"InlineStart",s=e?"Bottom":"InlineEnd";return{start:t(n[`border${r}Width`])+t(n[`padding${r}`]),end:t(n[`border${s}Width`])+t(n[`padding${s}`])}}function Yr(n,e){if(e.current!=null&&n.changedTouches){const t=n;for(let r=0;r<t.changedTouches.length;r+=1){const s=t.changedTouches[r];if(s.identifier===e.current)return{x:s.clientX,y:s.clientY}}return null}return{x:n.clientX,y:n.clientY}}const _p=w.forwardRef(function(e,t){const{render:r,className:s,...i}=e,{disabled:o,dragging:a,validation:l,inset:c,lastChangedValueRef:u,lastChangeReasonRef:f,max:d,min:h,minStepsBetweenValues:g,onValueCommitted:m,orientation:y,pressedInputRef:x,pressedThumbCenterOffsetRef:p,pressedThumbIndexRef:_,pressedValuesRef:C,registerFieldControlRef:v,renderBeforeHydration:b,setActive:S,setDragging:T,setValue:E,state:N,step:P,thumbCollisionBehavior:$,thumbRefs:R,values:I}=Us(),j=Do(),B=I.length>1,M=y==="vertical",U=w.useRef(null),z=w.useRef(null),Z=Fe(W=>{W&&z.current==null&&z.current==null&&(z.current=getComputedStyle(W))}),ne=w.useRef(null),J=w.useRef(0),q=w.useRef(0),H=dc(I),ae=Fe(W=>{_.current!==W&&(_.current=W);const ue=R.current[W];if(!ue){p.current=null,x.current=null;return}x.current=ue.querySelector('input[type="range"]')}),re=Fe(W=>{const ue=U.current;if(!ue)return null;const{width:G,height:oe,bottom:ee,left:Ae,right:lt}=ue.getBoundingClientRect(),Ge=yp(z.current,M),ut=q.current,Dt=(M?oe:G)-Ge.start-Ge.end-ut*2,Et=p.current??0,me=W.x-Et,Bt=W.y-Et,Ye=M?ee-Bt-Ge.end:(j==="rtl"?lt-me:me-Ae)-Ge.start,Ke=yt((Ye-ut)/Dt,0,1);let We=(d-h)*Ke+h;if(We=Kc(We,P,h),We=yt(We,h,d),!B)return{value:We,thumbIndex:0,didSwap:!1};const jt=_.current;if(jt<0)return null;const et=pp({behavior:$,values:I,currentValues:H.current??I,initialValues:C.current,pressedIndex:jt,nextValue:We,min:h,max:d,step:P,minStepsBetweenValues:g});return $==="swap"&&et.didSwap?ae(et.thumbIndex):_.current=et.thumbIndex,et}),le=Fe(W=>{C.current=B?I.slice():null,H.current=I;const ue=_.current;let G=ue;if(ue>-1&&ue<I.length){if(I[ue]===d){let oe=ue;for(;oe>0&&I[oe-1]===d;)oe-=1;G=oe}}else{const oe=M?"y":"x";let ee;G=-1;for(let Ae=0;Ae<R.current.length;Ae+=1){const lt=R.current[Ae];if(fi(lt)){const Ge=Uc(lt),ut=Math.abs(W[oe]-Ge[oe]);(ee===void 0||ut<=ee)&&(G=Ae,ee=ut)}}}if(G>-1&&G!==ue&&ae(G),c){const oe=R.current[G];if(fi(oe)){const ee=oe.getBoundingClientRect(),Ae=M?"height":"width";q.current=ee[Ae]/2}}}),Q=Fe(W=>{R.current?.[W]?.querySelector('input[type="range"]')?.focus({preventScroll:!0})}),te=Fe(W=>{const ue=Yr(W,ne);if(ue==null)return;if(J.current+=1,W.type==="pointermove"&&W.buttons===0){ie(W);return}const G=re(ue);G!=null&&jc(G.value,P,g)&&(!a&&J.current>mp&&T(!0),E(G.value,ct(xh,W,void 0,{activeThumbIndex:G.thumbIndex})),H.current=Array.isArray(G.value)?G.value:[G.value],G.didSwap&&Q(G.thumbIndex))});function ie(W){S(-1),T(!1),x.current=null,p.current=null,_.current=-1;const ue=Yr(W,ne),G=ue!=null?re(ue):null;if(G!=null){const oe=f.current;l.commit(u.current??G.value),m(u.current??G.value,fc(oe,W))}"pointerType"in W&&U.current?.hasPointerCapture(W.pointerId)&&U.current?.releasePointerCapture(W.pointerId),ne.current=null,C.current=null,ce()}const V=Fe(W=>{if(o)return;const ue=W.changedTouches[0];ue!=null&&(ne.current=ue.identifier);const G=Yr(W,ne);if(G!=null){le(G);const ee=re(G);if(ee==null)return;Q(ee.thumbIndex),E(ee.value,ct($a,W,void 0,{activeThumbIndex:ee.thumbIndex})),H.current=Array.isArray(ee.value)?ee.value:[ee.value],ee.didSwap&&Q(ee.thumbIndex)}J.current=0;const oe=Qt(U.current);oe.addEventListener("touchmove",te,{passive:!0}),oe.addEventListener("touchend",ie,{passive:!0})}),ce=Fe(()=>{const W=Qt(U.current);W.removeEventListener("pointermove",te),W.removeEventListener("pointerup",ie),W.removeEventListener("touchmove",te),W.removeEventListener("touchend",ie),C.current=null}),he=cc();return w.useEffect(()=>{const W=U.current;return W?(W.addEventListener("touchstart",V,{passive:!0}),()=>{W.removeEventListener("touchstart",V),he.cancel(),ce()}):()=>ce()},[ce,V,U,he]),w.useEffect(()=>{o&&ce()},[o,ce]),bt("div",e,{state:N,ref:[t,v,U,Z],props:[{"data-base-ui-slider-control":b?"":void 0,onPointerDown(W){const ue=U.current;if(!ue||o||W.defaultPrevented||!fi(W.target)||W.button!==0)return;const G=Yr(W,ne);if(G!=null){le(G);const ee=re(G);if(ee==null)return;ls(R.current[ee.thumbIndex],gc(Qt(ue)))?W.preventDefault():he.request(()=>{Q(ee.thumbIndex)}),T(!0),p.current!=null||(E(ee.value,ct($a,W.nativeEvent,void 0,{activeThumbIndex:ee.thumbIndex})),H.current=Array.isArray(ee.value)?ee.value:[ee.value],ee.didSwap&&Q(ee.thumbIndex))}W.nativeEvent.pointerId&&ue.setPointerCapture(W.nativeEvent.pointerId),J.current=0;const oe=Qt(U.current);oe.addEventListener("pointermove",te,{passive:!0}),oe.addEventListener("pointerup",ie,{once:!0})},tabIndex:-1},i],stateAttributesMapping:Fr})}),vp=w.forwardRef(function(e,t){const{render:r,className:s,...i}=e,{state:o}=Us();return bt("div",e,{state:o,ref:t,props:[{style:{position:"relative"}},i],stateAttributesMapping:Fr})});let xp=(function(n){return n.index="data-index",n.dragging="data-dragging",n.orientation="data-orientation",n.disabled="data-disabled",n.readonly="data-readonly",n.required="data-required",n.valid="data-valid",n.invalid="data-invalid",n.touched="data-touched",n.dirty="data-dirty",n.focused="data-focused",n})({});const bp='!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();',Wc="PageUp",Vc="PageDown",Sp=new Set([bc,vc,_c,xc,mc,yc,Wc,Vc]);function Cp(n,e,t,r){if(!(e<0))return n.length===2?e===0?`${us(n[e],r,t)} start range`:`${us(n[e],r,t)} end range`:t?us(n[e],r,t):void 0}function Bn(n,e,t,r,s){return t===1?Math.min(n+e,s):Math.max(n-e,r)}const Ep=w.forwardRef(function(e,t){const{render:r,children:s,className:i,"aria-describedby":o,"aria-label":a,"aria-labelledby":l,disabled:c=!1,getAriaLabel:u,getAriaValueText:f,id:d,index:h,inputRef:g,onBlur:m,onFocus:y,onKeyDown:x,tabIndex:p,..._}=e,C=nr(d),{active:v,lastUsedThumbIndex:b,controlRef:S,disabled:T,validation:E,formatOptionsRef:N,handleInputChange:P,inset:$,labelId:R,largeStep:I,locale:j,max:B,min:M,minStepsBetweenValues:U,name:z,orientation:Z,pressedInputRef:ne,pressedThumbCenterOffsetRef:J,pressedThumbIndexRef:q,renderBeforeHydration:H,setActive:ae,setIndicatorPosition:re,state:le,step:Q,values:te}=Us(),ie=Do(),V=c||T,ce=te.length>1,he=Z==="vertical",Ne=ie==="rtl",{setTouched:W,setFocused:ue,validationMode:G}=Xu(),oe=w.useRef(null),ee=w.useRef(null),Ae=nr(),lt=kg(),Ge=ce?Ae:lt,ut=w.useMemo(()=>({inputId:Ge}),[Ge]),{ref:Dt,index:Et}=Bs({metadata:ut}),me=ce?h??Et:0,Bt=me===te.length-1,Ye=te[me],Ke=Ui(Ye,M,B),[We,jt]=w.useState(!1),[et,Dn]=w.useState();hc(()=>jt(!0));const de=b>=0&&b<te.length?b:-1,Y=Fe(()=>{const Ce=S.current,be=oe.current;if(!Ce||!be)return;const Pe=be.getBoundingClientRect(),qr=Ce.getBoundingClientRect(),Jr=he?"height":"width",gg=qr[Jr]-Pe[Jr],ci=(Pe[Jr]/2+gg*Ke/100)/qr[Jr]*100;Dn(ci),me===0?re(di=>[ci,di[1]]):Bt&&re(di=>[di[0],ci])});tr(()=>{$&&queueMicrotask(Y)},[Y,$]),tr(()=>{$&&Y()},[Y,$,Ke]);const Se=w.useCallback(()=>{const Ce=he?"bottom":"insetInlineStart",be=he?"left":"top";let Pe;return ce?v===me?Pe=2:de===me&&(Pe=1):v===me&&(Pe=1),$?{"--position":`${et}%`,visibility:H&&!We||et===void 0?"hidden":void 0,position:"absolute",[Ce]:"var(--position)",[be]:"50%",translate:`${(he||!Ne?-1:1)*50}% ${(he?1:-1)*50}%`,zIndex:Pe}:Number.isFinite(Ke)?{position:"absolute",[Ce]:`${Ke}%`,[be]:"50%",translate:`${(he||!Ne?-1:1)*50}% ${(he?1:-1)*50}%`,zIndex:Pe}:La},[v,me,$,We,et,ce,H,Ne,de,Ke,he]);let rt;Z==="vertical"&&(rt=Ne?"vertical-rl":"vertical-lr");const st=ys({"aria-label":typeof u=="function"?u(me):a,"aria-labelledby":l??R,"aria-describedby":o,"aria-orientation":Z,"aria-valuenow":Ye,"aria-valuetext":typeof f=="function"?f(us(Ye,j,N.current??void 0),Ye,me):Cp(te,me,N.current??void 0,j),disabled:V,id:Ge,max:B,min:M,name:z,onChange(Ce){P(Ce.target.valueAsNumber,me,Ce)},onFocus(){ae(me),ue(!0)},onBlur(){oe.current&&(ae(-1),W(!0),ue(!1),G==="onBlur"&&E.commit(Bc(Ye,me,M,B,ce,te)))},onKeyDown(Ce){if(!Sp.has(Ce.key))return;pc.has(Ce.key)&&Ce.stopPropagation();let be=null;const Pe=Kc(Ye,Q,M);switch(Ce.key){case bc:be=Bn(Pe,Ce.shiftKey?I:Q,1,M,B);break;case xc:be=Bn(Pe,Ce.shiftKey?I:Q,Ne?-1:1,M,B);break;case vc:be=Bn(Pe,Ce.shiftKey?I:Q,-1,M,B);break;case _c:be=Bn(Pe,Ce.shiftKey?I:Q,Ne?1:-1,M,B);break;case Wc:be=Bn(Pe,I,1,M,B);break;case Vc:be=Bn(Pe,I,-1,M,B);break;case yc:be=B,ce&&(be=Number.isFinite(te[me+1])?te[me+1]-Q*U:B);break;case mc:be=M,ce&&(be=Number.isFinite(te[me-1])?te[me-1]+Q*U:M);break}be!==null&&(P(be,me,Ce),Ce.preventDefault())},step:Q,style:{...La,width:"100%",height:"100%",writingMode:rt},tabIndex:p??void 0,type:"range",value:Ye??""},E.getInputValidationProps),cn=$o(ee,E.inputRef,g);return bt("div",e,{state:le,ref:[t,Dt,oe],props:[{[xp.index]:me,children:k.jsxs(w.Fragment,{children:[s,k.jsx("input",{ref:cn,...st}),$&&!We&&H&&Bt&&k.jsx("script",{dangerouslySetInnerHTML:{__html:bp},suppressHydrationWarning:!0})]}),id:C,onBlur:m,onFocus:y,onPointerDown(Ce){if(q.current=me,oe.current!=null){const be=Z==="horizontal"?"x":"y",Pe=Uc(oe.current),qr=(Z==="horizontal"?Ce.clientX:Ce.clientY)-Pe[be];J.current=qr}ee.current!=null&&ne.current!==ee.current&&(ne.current=ee.current)},style:Se(),suppressHydrationWarning:H||void 0,tabIndex:-1},_],stateAttributesMapping:Fr})});function Tp(n,e,t,r,s,i){const o=t===void 0||e&&r===void 0?"hidden":void 0,a=n?"bottom":"insetInlineStart",l=n?"height":"width",u={visibility:s&&!i?"hidden":o,position:n?"absolute":"relative",[n?"width":"height"]:"inherit"};return u["--start-position"]=`${t??0}%`,e?(u["--relative-size"]=`${(r??0)-(t??0)}%`,u[a]="var(--start-position)",u[l]="var(--relative-size)",u):(u[a]=0,u[l]="var(--start-position)",u)}function wp(n,e,t,r){const s=n?"bottom":"insetInlineStart",i=n?"height":"width",a={position:n?"absolute":"relative",[n?"width":"height"]:"inherit"};if(!e)return a[s]=0,a[i]=`${t}%`,a;const l=r-t;return a[s]=`${t}%`,a[i]=`${l}%`,a}const kp=w.forwardRef(function(e,t){const{render:r,className:s,...i}=e,{indicatorPosition:o,inset:a,max:l,min:c,orientation:u,renderBeforeHydration:f,state:d,values:h}=Us(),[g,m]=w.useState(!1);hc(()=>m(!0));const y=u==="vertical",x=h.length>1,p=a?Tp(y,x,o[0],o[1],f,g):wp(y,x,Ui(h[0],c,l),Ui(h[h.length-1],c,l));return bt("div",e,{state:d,ref:t,props:[{"data-base-ui-slider-indicator":f?"":void 0,style:p,suppressHydrationWarning:f||void 0},i],stateAttributesMapping:Fr})});const Np=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],Ap=pg("brain-circuit",Np);var Pp="vpj4en0",Ip="vpj4en1",Rp="vpj4en2",Op="vpj4en3",Fp="vpj4en4",Mp="vpj4en5",$p="vpj4en6";function Zr(n){const e=qe.c(25),{label:t,value:r,defaultValue:s,min:i,max:o,step:a,onValueChange:l,onValueCommitted:c,disabled:u,className:f,showValue:d,formatValue:h}=n,g=i===void 0?0:i,m=o===void 0?100:o,y=a===void 0?1:a,x=u===void 0?!1:u,p=d===void 0?!0:d;let _;e[0]!==l?(_=I=>{typeof I=="number"?l?.(I):Array.isArray(I)&&l?.(I[0])},e[0]=l,e[1]=_):_=e[1];const C=_;let v;e[2]!==c?(v=I=>{typeof I=="number"?c?.(I):Array.isArray(I)&&c?.(I[0])},e[2]=c,e[3]=v):v=e[3];const b=v,S=r??s??g;let T;e[4]!==S||e[5]!==h?(T=h?h(S):String(S),e[4]=S,e[5]=h,e[6]=T):T=e[6];const E=T;let N;e[7]!==f?(N=mg(Pp,f),e[7]=f,e[8]=N):N=e[8];let P;e[9]!==E||e[10]!==t||e[11]!==p?(P=(t||p)&&k.jsxs("div",{className:Ip,children:[t&&k.jsx("span",{children:t}),p&&k.jsx("span",{className:Rp,children:E})]}),e[9]=E,e[10]=t,e[11]=p,e[12]=P):P=e[12];let $;e[13]===Symbol.for("react.memo_cache_sentinel")?($=k.jsx(_p,{className:Op,children:k.jsxs(vp,{className:Fp,children:[k.jsx(kp,{className:Mp}),k.jsx(Ep,{className:$p})]})}),e[13]=$):$=e[13];let R;return e[14]!==s||e[15]!==x||e[16]!==C||e[17]!==b||e[18]!==m||e[19]!==g||e[20]!==y||e[21]!==P||e[22]!==N||e[23]!==r?(R=k.jsxs(gp,{value:r,defaultValue:s,min:g,max:m,step:y,onValueChange:C,onValueCommitted:b,disabled:x,className:N,children:[P,$]}),e[14]=s,e[15]=x,e[16]=C,e[17]=b,e[18]=m,e[19]=g,e[20]=y,e[21]=P,e[22]=N,e[23]=r,e[24]=R):R=e[24],R}var Lp="_7ucatj0",Dp="_7ucatj1",Bp="_7ucatj2",Ka="_7ucatj3",Wa="_7ucatj4",Va="_7ucatj5",Ha="_7ucatj6",qa="_7ucatj7",Ja="_7ucatj8",Ga="_7ucatj9",Ya="_7ucatja",jp="_7ucatjb",zp="_7ucatjc",Up="_7ucatjd",Kp="_7ucatje",Wp="_7ucatjf",Vp="_7ucatjg",Hp="_7ucatjh",qp="_7ucatji";function Jp(n){const e=qe.c(69),{isNewVariant:t,onSave:r,isSaving:s}=n,i=s===void 0?!1:s,[o,a]=w.useState(!1),[l,c]=w.useState(t?"new_variant":"new_version"),[u,f]=w.useState(!1),[d,h]=w.useState(null),{data:g}=Wh();let m;e[0]!==g?(m=g===void 0?[]:g,e[0]=g,e[1]=m):m=e[1];const y=m;let x;e[2]!==u||e[3]!==l||e[4]!==r||e[5]!==d?.id?(x=()=>{r({mode:l,deployToEnvironment:u,environmentId:u?d?.id??null:null}),a(!1)},e[2]=u,e[3]=l,e[4]=r,e[5]=d?.id,e[6]=x):x=e[6];const p=x;let _;e[7]!==t?(_=W=>{a(W),W&&(c(t?"new_variant":"new_version"),f(!1),h(null))},e[7]=t,e[8]=_):_=e[8];const C=_;let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=k.jsx(Gu,{icon:Ng,size:"xs"}),e[9]=v):v=e[9];const b=i?"Saving...":"Save";let S;e[10]!==i||e[11]!==b?(S=k.jsx(ec,{asChild:!0,children:k.jsxs(gi,{variant:"primary",size:"default",type:"button",disabled:i,children:[v,b]})}),e[10]=i,e[11]=b,e[12]=S):S=e[12];let T;e[13]===Symbol.for("react.memo_cache_sentinel")?(T=k.jsx("div",{className:Dp,children:"Save Options"}),e[13]=T):T=e[13];const E=`${Ka} ${l==="new_variant"?Wa:""}`;let N,P;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=()=>c("new_variant"),P=W=>W.key==="Enter"&&c("new_variant"),e[14]=N,e[15]=P):(N=e[14],P=e[15]);const $=l==="new_variant",R=`${Va} ${l==="new_variant"?Ha:""}`;let I;e[16]!==l?(I=l==="new_variant"&&k.jsx("div",{className:qa}),e[16]=l,e[17]=I):I=e[17];let j;e[18]!==R||e[19]!==I?(j=k.jsx("div",{className:R,children:I}),e[18]=R,e[19]=I,e[20]=j):j=e[20];let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=k.jsxs("div",{className:Ja,children:[k.jsx("span",{className:Ga,children:"Save as new variant"}),k.jsx("span",{className:Ya,children:"Creates a new variant with version 1"})]}),e[21]=B):B=e[21];let M;e[22]!==E||e[23]!==$||e[24]!==j?(M=k.jsxs("div",{className:E,onClick:N,onKeyDown:P,role:"radio","aria-checked":$,tabIndex:0,children:[j,B]}),e[22]=E,e[23]=$,e[24]=j,e[25]=M):M=e[25];let U;e[26]!==t||e[27]!==l?(U=!t&&k.jsxs("div",{className:`${Ka} ${l==="new_version"?Wa:""}`,onClick:()=>c("new_version"),onKeyDown:W=>W.key==="Enter"&&c("new_version"),role:"radio","aria-checked":l==="new_version",tabIndex:0,children:[k.jsx("div",{className:`${Va} ${l==="new_version"?Ha:""}`,children:l==="new_version"&&k.jsx("div",{className:qa})}),k.jsxs("div",{className:Ja,children:[k.jsx("span",{className:Ga,children:"Update as new version"}),k.jsx("span",{className:Ya,children:"Creates a new version of this variant"})]})]}),e[26]=t,e[27]=l,e[28]=U):U=e[28];let z;e[29]!==M||e[30]!==U?(z=k.jsxs("div",{className:Bp,children:[M,U]}),e[29]=M,e[30]=U,e[31]=z):z=e[31];const Z=`${Up} ${u?Kp:""}`;let ne,J;e[32]!==u?(ne=()=>f(!u),J=W=>W.key==="Enter"&&f(!u),e[32]=u,e[33]=ne,e[34]=J):(ne=e[33],J=e[34]);let q;e[35]!==u?(q=u&&k.jsx(Sc,{className:Wp}),e[35]=u,e[36]=q):q=e[36];let H;e[37]!==u||e[38]!==Z||e[39]!==ne||e[40]!==J||e[41]!==q?(H=k.jsx("div",{className:Z,onClick:ne,onKeyDown:J,role:"checkbox","aria-checked":u,tabIndex:0,children:q}),e[37]=u,e[38]=Z,e[39]=ne,e[40]=J,e[41]=q,e[42]=H):H=e[42];let ae;e[43]!==u?(ae=k.jsx("span",{className:Vp,onClick:()=>f(!u),children:"Deploy to environment"}),e[43]=u,e[44]=ae):ae=e[44];let re;e[45]!==H||e[46]!==ae?(re=k.jsxs("div",{className:zp,children:[H,ae]}),e[45]=H,e[46]=ae,e[47]=re):re=e[47];let le;e[48]!==u||e[49]!==y||e[50]!==d?(le=u&&k.jsx("div",{className:Hp,children:k.jsx(Mo,{items:y,value:d,onValueChange:h,itemToString:Gp,placeholder:"Select environment"})}),e[48]=u,e[49]=y,e[50]=d,e[51]=le):le=e[51];let Q;e[52]!==re||e[53]!==le?(Q=k.jsxs("div",{className:jp,children:[re,le]}),e[52]=re,e[53]=le,e[54]=Q):Q=e[54];let te;e[55]===Symbol.for("react.memo_cache_sentinel")?(te=k.jsx(gi,{variant:"ghost",scheme:"gray",size:"sm",type:"button",onClick:()=>a(!1),children:"Cancel"}),e[55]=te):te=e[55];const ie=i||u&&!d,V=i?"Saving...":"Confirm";let ce;e[56]!==p||e[57]!==ie||e[58]!==V?(ce=k.jsxs("div",{className:qp,children:[te,k.jsx(gi,{variant:"primary",size:"sm",type:"button",onClick:p,disabled:ie,children:V})]}),e[56]=p,e[57]=ie,e[58]=V,e[59]=ce):ce=e[59];let he;e[60]!==z||e[61]!==Q||e[62]!==ce?(he=k.jsx(tc,{side:"bottom",align:"end",sideOffset:4,children:k.jsxs("div",{className:Lp,children:[T,z,Q,ce]})}),e[60]=z,e[61]=Q,e[62]=ce,e[63]=he):he=e[63];let Ne;return e[64]!==C||e[65]!==o||e[66]!==he||e[67]!==S?(Ne=k.jsxs(nc,{open:o,onOpenChange:C,children:[S,he]}),e[64]=C,e[65]=o,e[66]=he,e[67]=S,e[68]=Ne):Ne=e[68],Ne}function Gp(n){return n?.name||""}const Hc=w.createContext(null);function Yp(n,e){return{getTheme:function(){return e??null}}}function Je(){const n=w.useContext(Hc);return n==null&&(function(e,...t){const r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(const i of t)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),n}function F(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function qc(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const St=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Zp=St&&"documentMode"in document?document.documentMode:null,mt=St&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),xn=St&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),vs=!(!St||!("InputEvent"in window)||Zp)&&"getTargetRanges"in new window.InputEvent("input"),Mr=St&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),or=St&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Xp=St&&/Android/.test(navigator.userAgent),Jc=St&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Za=St&&Xp&&Jc,$r=St&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&mt&&!Jc;function Gc(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const Qp=0,em=1,tm=2,Yc=128,nm=1,rm=2,sm=3,im=4,om=5,am=6,Ks=Mr||or||$r?" ":"​",sn=`
1
+ import{a0 as hg,r as w,j as k,x as wr,l as pg,a as qe,e as mg,I as Gu,a1 as Ia,t as yg,i as Fo,g as Yu,a2 as _g,d as vg,a3 as xg}from"./index-FrTQ7TcS.js";import{u as Bs,a as Zu,b as bg,c as Sg,g as Cg,d as Xu,e as Eg,f as Tg,h as wg,i as kg,j as Mo}from"./combobox-iSbUYz0A.js";import{e as Qu,i as Zt,u as Ng}from"./index.esm-oCSEvUVx.js";import{S as Ag,v as Ra,a as Pg,b as Ig,m as Rg,c as Og,d as Fg,g as Mg,u as $g,e as Lg,f as Dg,h as Bg,i as jg}from"./useSetTargeting-bk0Ixhqq.js";import{u as zg,a as ec,b as tc,P as nc}from"./popover-DXj4s-ni.js";import{f as In,d as rc,m as ys,e as $o,c as bt,b as Ug,E as js,u as tr,a as Fe,h as ji,i as sc,j as Kg,k as Wg,l as Vg,n as fi}from"./useButton-CsZ8hBM8.js";import{z as ic,o as nr,s as Hg,A as qg,c as ct,r as oc,v as Jg,F as Gg,D as Yg,q as Zg,t as br,B as Xg,E as mr,R as Qg,P as eh,d as Le,G as ac,H as lc,I as uc,J as th,u as _s,e as Oa,f as nh,K as zi,L as rh,h as sh,m as ih,k as oh,l as Lo,M as cc,N as ah,O as lh,Q as Qt,S as uh,a as ls,U as ch,V as dh,W as fh,X as gh,Y as hh,Z as Fa,_ as Ma,$ as ph,p as mh,a0 as dc,n as yh,y as fc,a1 as gc,a2 as _h,a3 as vh,a4 as xh,a5 as $a,a6 as hc,a7 as La}from"./popupStateMapping-DolkyTT3.js";import{g as bh,u as Sh,b as Do}from"./getDisabledMountTransitionStyles-TZFYxPIU.js";import{C as pc,u as Ch,H as mc,E as yc,A as _c,a as vc,b as xc,c as bc}from"./useRole-CiSaVva3.js";import{a as Eh,u as Th}from"./useValueChanged-CTjBqaGs.js";import{C as wh}from"./chevron-right-fMWRsRLZ.js";import{C as Sc}from"./check-D9E8RKB4.js";import{C as Cc}from"./chevron-down-BJFxhYkh.js";import{F as kh,I as Nh,i as Ah,u as Ph,a as Ih,b as Ec}from"./InternalBackdrop-Za9lpJi7.js";import{p as Rh,c as Oh,a as Fh,b as Mh,u as $h,d as Lh,e as Dh}from"./useSyncedFloatingRootContext-BKbVh8Gq.js";import{b as Bh,u as Tc,s as wc}from"./usePopupAutoResize-D6RSlB-m.js";import{u as jh}from"./useFocus-9TCY0h5x.js";import{u as kc}from"./useMutation-D4JglXWk.js";import{g as zh,u as Uh}from"./useConfigVariants-CLc_hPw1.js";import{u as Kh}from"./useTargetingRules-BrgaEdxR.js";import{B as gi}from"./button-CMZqhyXB.js";import{u as Wh}from"./useEnvironments-Bu_0SIUj.js";/* empty css *//* empty css */import"./reselect-DVmmTZGf.js";function Vh(n,e){if(n===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in n)return n;if(typeof n=="function")return{shouldBlockFn:async()=>await n(),enableBeforeUnload:!0,withResolver:!1};const t=!!(n.condition??!0),r=n.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function Hh(n,e){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=Vh(n),o=hg(),{history:a}=o,[l,c]=w.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return w.useEffect(()=>{const u=async f=>{function d(p){const _=o.parseLocation(p),C=o.getMatchedRoutes(_.pathname);return C.foundRoute===void 0?{routeId:"__notFound__",fullPath:_.pathname,pathname:_.pathname,params:C.routeParams,search:o.options.parseSearch(p.search)}:{routeId:C.foundRoute.id,fullPath:C.foundRoute.fullPath,pathname:_.pathname,params:C.routeParams,search:o.options.parseSearch(p.search)}}const h=d(f.currentLocation),g=d(f.nextLocation);if(h.routeId==="__notFound__"&&g.routeId!=="__notFound__")return!1;const m=await t({action:f.action,current:h,next:g});if(!i)return m;if(!m)return!1;const x=await new Promise(p=>{c({status:"blocked",current:h,next:g,action:f.action,proceed:()=>p(!1),reset:()=>p(!0)})});return c({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),x};return s?void 0:a.block({blockerFn:u,enableBeforeUnload:r})},[t,r,s,i,a,o]),l}function Nc(n,e,t=(r,s)=>r===s){return n.length===e.length&&n.every((r,s)=>t(r,e[s]))}const qh=w.createContext(void 0);function zs(n=!0){const e=w.useContext(qh);if(e===void 0&&!n)throw new Error(In(25));return e}const Ac=w.createContext(void 0);function Bo(n){const e=w.useContext(Ac);if(e===void 0&&!n)throw new Error(In(33));return e}const Pc=w.createContext(void 0);function Gt(n){const e=w.useContext(Pc);if(e===void 0&&!n)throw new Error(In(36));return e}const Jh={type:"regular-item"};function Ic(n){const{closeOnClick:e,disabled:t=!1,highlighted:r,id:s,store:i,nativeButton:o,itemMetadata:a,nodeId:l}=n,c=w.useRef(null),u=zs(!0),f=u!==void 0,{events:d}=i.useState("floatingTreeRoot"),{getButtonProps:h,buttonRef:g}=rc({disabled:t,focusableWhenDisabled:!0,native:o}),m=w.useCallback(x=>ys({id:s,role:"menuitem",tabIndex:r?0:-1,onMouseMove(p){l&&d.emit("itemhover",{nodeId:l,target:p.currentTarget})},onMouseEnter(){a.type==="submenu-trigger"&&a.setActive()},onKeyUp(p){p.key===" "&&i.context.typingRef.current&&p.preventBaseUIHandler()},onClick(p){e&&d.emit("close",{domEvent:p,reason:ic})},onMouseUp(p){if(u){const _=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,f&&_&&Math.abs(p.clientX-_.x)<=1&&Math.abs(p.clientY-_.y)<=1)return}c.current&&i.context.allowMouseUpTriggerRef.current&&(!f||p.button===2)&&a.type==="regular-item"&&c.current.click()}},x,h),[s,r,h,e,d,i,f,u,a,l]),y=$o(c,g);return w.useMemo(()=>({getItemProps:m,itemRef:y}),[m,y])}const Gh=w.forwardRef(function(e,t){const{render:r,className:s,id:i,label:o,nativeButton:a=!1,disabled:l=!1,closeOnClick:c=!0,...u}=e,f=Bs({label:o}),d=Bo(!0),h=nr(i),{store:g}=Gt(),m=g.useState("isActive",f.index),y=g.useState("itemProps"),{getItemProps:x,itemRef:p}=Ic({closeOnClick:c,disabled:l,highlighted:m,id:h,store:g,nativeButton:a,nodeId:d?.nodeId,itemMetadata:Jh}),_=w.useMemo(()=>({disabled:l,highlighted:m}),[l,m]);return bt("div",e,{state:_,props:[y,u,x],ref:[p,t,f.ref]})}),Yh={...oc,...Jg},Da=w.forwardRef(function(e,t){const{render:r,className:s,finalFocus:i,...o}=e,{store:a}=Gt(),{side:l,align:c}=Bo(),u=zg()!=null,f=a.useState("open"),d=a.useState("transitionStatus"),h=a.useState("popupProps"),g=a.useState("mounted"),m=a.useState("instantType"),y=a.useState("activeTriggerElement"),x=a.useState("parent"),p=a.useState("lastOpenChangeReason"),_=a.useState("rootId"),C=a.useState("floatingRootContext"),v=a.useState("floatingTreeRoot"),b=a.useState("closeDelay"),S=a.useState("activeTriggerElement");Hg({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}}),w.useEffect(()=>{function R(I){a.setOpen(!1,ct(I.reason,I.domEvent))}return v.events.on("close",R),()=>{v.events.off("close",R)}},[v.events,a]);const T=a.useState("hoverEnabled"),E=a.useState("disabled");Bh(C,{enabled:T&&!E&&x.type!=="context-menu"&&x.type!=="menubar",closeDelay:b});const N=w.useMemo(()=>({transitionStatus:d,side:l,align:c,open:f,nested:x.type==="menu",instant:m}),[d,l,c,f,x.type,m]),P=bt("div",e,{state:N,ref:[t,a.context.popupRef],stateAttributesMapping:Yh,props:[h,{onKeyDown(R){u&&pc.has(R.key)&&R.stopPropagation()}},bh(d),o,{"data-rootownerid":_}]});let $=x.type===void 0||x.type==="context-menu";return(y||x.type==="menubar"&&p!==qg)&&($=!0),k.jsx(kh,{context:C,modal:!1,disabled:!g,returnFocus:i===void 0?$:i,initialFocus:x.type!=="menu",restoreFocus:!0,externalTree:x.type!=="menubar"?v:void 0,previousFocusableElement:S,nextFocusableElement:x.type===void 0?a.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:x.type===void 0?a.context.beforeContentFocusGuardRef:void 0,children:P})}),Rc=w.createContext(void 0);function Zh(){const n=w.useContext(Rc);if(n===void 0)throw new Error(In(32));return n}const Ba=w.forwardRef(function(e,t){const{keepMounted:r=!1,...s}=e,{store:i}=Gt();return i.useState("mounted")||r?k.jsx(Rc.Provider,{value:r,children:k.jsx(Gg,{ref:t,...s})}):null}),ja=w.forwardRef(function(e,t){const{anchor:r,positionMethod:s="absolute",className:i,render:o,side:a,align:l,sideOffset:c=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:d=5,arrowPadding:h=5,sticky:g=!1,disableAnchorTracking:m=!1,collisionAvoidance:y=Yg,...x}=e,{store:p}=Gt(),_=Zh(),C=zs(!0),v=p.useState("parent"),b=p.useState("floatingRootContext"),S=p.useState("floatingTreeRoot"),T=p.useState("mounted"),E=p.useState("open"),N=p.useState("modal"),P=p.useState("activeTriggerElement"),$=p.useState("lastOpenChangeReason"),R=p.useState("floatingNodeId"),I=p.useState("floatingParentNodeId");let j=r,B=c,M=u,U=l,z=y;v.type==="context-menu"&&(j=r??v.context?.anchor,U=U??"start",!a&&U!=="center"&&(M=e.alignOffset??2,B=e.sideOffset??-5));let Z=a,ne=U;v.type==="menu"?(Z=Z??"inline-end",ne=ne??"start",z=e.collisionAvoidance??Zg):v.type==="menubar"&&(Z=Z??"bottom",ne=ne??"start");const J=v.type==="context-menu",q=Sh({anchor:j,floatingRootContext:b,positionMethod:C?"fixed":s,mounted:T,side:Z,sideOffset:B,align:ne,alignOffset:M,arrowPadding:J?0:h,collisionBoundary:f,collisionPadding:d,sticky:g,nodeId:R,keepMounted:_,disableAnchorTracking:m,collisionAvoidance:z,shiftCrossAxis:J,externalTree:S}),H=w.useMemo(()=>{const ie={};return E||(ie.pointerEvents="none"),{role:"presentation",hidden:!T,style:{...q.positionerStyles,...ie}}},[E,T,q.positionerStyles]);w.useEffect(()=>{function ie(V){V.open?(V.parentNodeId===R&&p.set("hoverEnabled",!1),V.nodeId!==R&&V.parentNodeId===p.select("floatingParentNodeId")&&p.setOpen(!1,ct(mr))):V.parentNodeId===R&&V.reason!==mr&&p.set("hoverEnabled",!0)}return S.events.on("menuopenchange",ie),()=>{S.events.off("menuopenchange",ie)}},[p,S.events,R]),w.useEffect(()=>{if(p.select("floatingParentNodeId")==null)return;function ie(V){if(V.open||V.nodeId!==p.select("floatingParentNodeId"))return;const ce=V.reason??mr;p.setOpen(!1,ct(ce))}return S.events.on("menuopenchange",ie),()=>{S.events.off("menuopenchange",ie)}},[S.events,p]),w.useEffect(()=>{function ie(V){!E||V.nodeId!==p.select("floatingParentNodeId")||V.target&&P&&P!==V.target&&p.setOpen(!1,ct(mr))}return S.events.on("itemhover",ie),()=>{S.events.off("itemhover",ie)}},[S.events,E,P,p]),w.useEffect(()=>{const ie={open:E,nodeId:R,parentNodeId:I,reason:p.select("lastOpenChangeReason")};S.events.emit("menuopenchange",ie)},[S.events,E,p,R,I]);const ae=w.useMemo(()=>({open:E,side:q.side,align:q.align,anchorHidden:q.anchorHidden,nested:v.type==="menu"}),[E,q.side,q.align,q.anchorHidden,v.type]),re=w.useMemo(()=>({side:q.side,align:q.align,arrowRef:q.arrowRef,arrowUncentered:q.arrowUncentered,arrowStyles:q.arrowStyles,nodeId:q.context.nodeId}),[q.side,q.align,q.arrowRef,q.arrowUncentered,q.arrowStyles,q.context.nodeId]),le=bt("div",e,{state:ae,stateAttributesMapping:oc,ref:[t,p.useStateSetter("positionerElement")],props:[H,x]}),Q=T&&v.type!=="menu"&&(v.type!=="menubar"&&N&&$!==br||v.type==="menubar"&&v.context.modal);let te=null;return v.type==="menubar"?te=v.context.contentElement:v.type===void 0&&(te=P),k.jsxs(Ac.Provider,{value:re,children:[Q&&k.jsx(Nh,{ref:v.type==="context-menu"||v.type==="nested-context-menu"?v.context.internalBackdropRef:null,inert:Ah(!E),cutout:te}),k.jsx(Xg,{id:R,children:k.jsx(Zu,{elementsRef:p.context.itemDomElements,labelsRef:p.context.itemLabels,children:le})})]})}),Xh=w.createContext(null);function Oc(n){return w.useContext(Xh)}const Qh={...Rh,disabled:Le(n=>n.parent.type==="menubar"&&n.parent.context.disabled||n.disabled),modal:Le(n=>(n.parent.type===void 0||n.parent.type==="context-menu")&&(n.modal??!0)),allowMouseEnter:Le(n=>n.parent.type==="menu"?n.parent.store.select("allowMouseEnter"):n.allowMouseEnter),stickIfOpen:Le(n=>n.stickIfOpen),parent:Le(n=>n.parent),rootId:Le(n=>n.parent.type==="menu"?n.parent.store.select("rootId"):n.parent.type!==void 0?n.parent.context.rootId:n.rootId),activeIndex:Le(n=>n.activeIndex),isActive:Le((n,e)=>n.activeIndex===e),hoverEnabled:Le(n=>n.hoverEnabled),instantType:Le(n=>n.instantType),lastOpenChangeReason:Le(n=>n.openChangeReason),floatingTreeRoot:Le(n=>n.parent.type==="menu"?n.parent.store.select("floatingTreeRoot"):n.floatingTreeRoot),floatingNodeId:Le(n=>n.floatingNodeId),floatingParentNodeId:Le(n=>n.floatingParentNodeId),itemProps:Le(n=>n.itemProps),closeDelay:Le(n=>n.closeDelay),keyboardEventRelay:Le(n=>{if(n.keyboardEventRelay)return n.keyboardEventRelay;if(n.parent.type==="menu")return n.parent.store.select("keyboardEventRelay")})};class jo extends Qg{constructor(e){super({...ep(),...e},{positionerRef:w.createRef(),popupRef:w.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:w.createRef(),beforeContentFocusGuardRef:w.createRef(),onOpenChangeComplete:void 0,triggerElements:new eh},Qh),this.observe(Le(t=>t.allowMouseEnter),(t,r)=>{this.state.parent.type==="menu"&&t!==r&&this.state.parent.store.set("allowMouseEnter",t)}),this.unsubscribeParentListener=this.observe("parent",t=>{if(this.unsubscribeParentListener?.(),t.type==="menu"){this.unsubscribeParentListener=t.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=t.store.context.allowMouseUpTriggerRef;return}t.type!==void 0&&(this.context.allowMouseUpTriggerRef=t.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}static useStore(e,t){return Ug(()=>e??new jo(t)).current}unsubscribeParentListener=null}function ep(){return{...Oh(),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 ac,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:js,keyboardEventRelay:void 0,closeDelay:0}}const Fc=w.createContext(void 0);function Mc(){return w.useContext(Fc)}function $c(n){const{children:e,open:t,onOpenChange:r,onOpenChangeComplete:s,defaultOpen:i=!1,disabled:o=!1,modal:a,loopFocus:l=!0,orientation:c="vertical",actionsRef:u,closeParentOnEsc:f=!1,handle:d,triggerId:h,defaultTriggerId:g=null,highlightItemOnHover:m=!0}=n,y=zs(!0),x=Gt(!0),p=Oc(),_=Mc(),C=w.useMemo(()=>_&&x?{type:"menu",store:x.store}:p?{type:"menubar",context:p}:y&&!x?{type:"context-menu",context:y}:{type:void 0},[y,x,p,_]),v=jo.useStore(d?.store,{parent:C}),b=v.useState("floatingTreeRoot"),S=lc(b),T=uc();tr(()=>{y&&!x?v.update({parent:{type:"context-menu",context:y},floatingNodeId:S,floatingParentNodeId:T}):x&&v.update({floatingNodeId:S,floatingParentNodeId:T})},[y,x,S,T,v]),v.useControlledProp("open",t,i),v.useControlledProp("activeTriggerId",h,g),v.useContextCallback("onOpenChangeComplete",s);const E=v.useState("open"),N=v.useState("activeTriggerElement"),P=v.useState("positionerElement"),$=v.useState("hoverEnabled"),R=v.useState("modal"),I=v.useState("disabled"),j=v.useState("lastOpenChangeReason"),B=v.useState("parent"),M=v.useState("activeIndex"),U=v.useState("payload"),z=v.useState("floatingParentNodeId"),Z=w.useRef(null),ne=z!=null;let J;v.useSyncedValues({disabled:o,modal:B.type===void 0?a:void 0,rootId:th()});const{openMethod:q,triggerProps:H,reset:ae}=Ph(E);Fh(v);const{forceUnmount:re}=Mh(E,v,()=>{v.update({allowMouseEnter:!1,stickIfOpen:!0}),ae()}),le=w.useRef(B.type!=="context-menu"),Q=_s();w.useEffect(()=>{if(E||(Z.current=null),B.type==="context-menu"){if(!E){Q.clear(),le.current=!1;return}Q.start(500,()=>{le.current=!0})}},[Q,E,B.type]),Ih(E&&R&&j!==br&&q!=="touch",P),tr(()=>{!E&&!$&&v.set("hoverEnabled",!0)},[E,$,v]);const te=w.useRef(!0),ie=_s(),V=Fe((de,Y)=>{const Se=Y.reason;if(E===de&&Y.trigger===N||(Y.preventUnmountOnClose=()=>{v.set("preventUnmountingOnClose",!0)},!de&&Y.trigger==null&&(Y.trigger=N??void 0),r?.(de,Y),Y.isCanceled))return;const rt={open:de,nativeEvent:Y.event,reason:Y.reason,nested:ne};J?.emit("openchange",rt);const st=Y.event;if(de===!1&&st?.type==="click"&&st.pointerType==="touch"&&!te.current)return;if(!de&&M!==null){const be=v.context.itemDomElements.current[M];queueMicrotask(()=>{be?.setAttribute("tabindex","-1")})}de&&Se===Oa?(te.current=!1,ie.start(300,()=>{te.current=!0})):(te.current=!0,ie.clear());const cn=(Se===nh||Se===ic)&&st.detail===0&&st?.isTrusted,Hr=!de&&(Se===sh||Se==null);function Ce(){const be={open:de,openChangeReason:Se};Z.current=Y.event??null;const Pe=Y.trigger?.id??null;(Pe||de)&&(be.activeTriggerId=Pe,be.activeTriggerElement=Y.trigger??null),v.update(be)}Se===br?wr.flushSync(Ce):Ce(),B.type==="menubar"&&(Se===Oa||Se===zi||Se===br||Se===rh||Se===mr)?v.set("instantType","group"):cn||Hr?v.set("instantType",cn?"click":"dismiss"):v.set("instantType",void 0)}),ce=w.useCallback(de=>{const Y=ct(de);return Y.preventUnmountOnClose=()=>{v.set("preventUnmountingOnClose",!0)},Y},[v]),he=w.useCallback(()=>{v.setOpen(!1,ce(ih))},[v,ce]);w.useImperativeHandle(u,()=>({unmount:re,close:he}),[re,he]);let Ne;B.type==="context-menu"&&(Ne=B.context),w.useImperativeHandle(Ne?.positionerRef,()=>P,[P]),w.useImperativeHandle(Ne?.actionsRef,()=>({setOpen:V}),[V]);const W=$h({popupStore:v,onOpenChange:V});J=W.context.events,w.useEffect(()=>{const de=({open:Y,eventDetails:Se})=>V(Y,Se);return J.on("setOpen",de),()=>{J?.off("setOpen",de)}},[J,V]);const ue=oh(W,{enabled:!I,bubbles:f&&B.type==="menu",outsidePress(){return B.type!=="context-menu"||Z.current?.type==="contextmenu"?!0:le.current},externalTree:ne?b:void 0}),G=Ch(W,{role:"menu"}),oe=Do(),ee=w.useCallback(de=>{v.select("activeIndex")!==de&&v.set("activeIndex",de)},[v]),Ae=bg(W,{enabled:!I,listRef:v.context.itemDomElements,activeIndex:M,nested:B.type!==void 0,loopFocus:l,orientation:c,parentOrientation:B.type==="menubar"?B.context.orientation:void 0,rtl:oe==="rtl",disabledIndices:ji,onNavigate:ee,openOnArrowKeyDown:B.type!=="context-menu",externalTree:ne?b:void 0,focusItemOnHover:m}),lt=w.useCallback(de=>{v.context.typingRef.current=de},[v]),Ge=Sg(W,{listRef:v.context.itemLabels,activeIndex:M,resetMs:lh,onMatch:de=>{E&&de!==M&&v.set("activeIndex",de)},onTypingChange:lt}),{getReferenceProps:ut,getFloatingProps:Dt,getItemProps:Et,getTriggerProps:me}=Lo([ue,G,Ae,Ge]),Bt=w.useMemo(()=>{const de=ys(ut(),{onMouseEnter(){v.set("hoverEnabled",!0)},onMouseMove(){v.set("allowMouseEnter",!0)}},H);return delete de.role,de},[ut,v,H]),Ye=w.useMemo(()=>{const de=me();if(!de)return de;const Y=ys(de,H);return delete Y.role,delete Y["aria-controls"],Y},[me,H]),Ke=cc(),We=w.useMemo(()=>Dt({onMouseEnter(){B.type==="menu"&&Ke.request(()=>v.set("hoverEnabled",!1))},onMouseMove(){v.set("allowMouseEnter",!0)},onClick(){v.select("hoverEnabled")&&v.set("hoverEnabled",!1)},onKeyDown(de){const Y=v.select("keyboardEventRelay");Y&&!de.isPropagationStopped()&&Y(de)}}),[Dt,B.type,Ke,v]),jt=w.useMemo(()=>Et(),[Et]);v.useSyncedValues({floatingRootContext:W,activeTriggerProps:Bt,inactiveTriggerProps:Ye,popupProps:We,itemProps:jt});const et=w.useMemo(()=>({store:v,parent:C}),[v,C]),Dn=k.jsx(Pc.Provider,{value:et,children:typeof e=="function"?e({payload:U}):e});return B.type===void 0||B.type==="context-menu"?k.jsx(ah,{externalTree:b,children:Dn}):Dn}function tp(n){const e=Gt().store,t=w.useMemo(()=>({parentMenu:e}),[e]);return k.jsx(Fc.Provider,{value:t,children:k.jsx($c,{...n})})}function np(n={}){const{highlightItemOnHover:e,highlightedIndex:t,onHighlightedIndexChange:r}=sc(),{ref:s,index:i}=Bs(n),o=t===i,a=w.useRef(null),l=$o(s,a);return{compositeProps:w.useMemo(()=>({tabIndex:o?0:-1,onFocus(){r(i)},onMouseMove(){const u=a.current;if(!e||!u)return;const f=u.hasAttribute("disabled")||u.ariaDisabled==="true";!o&&!f&&u.focus()}}),[o,r,i,e]),compositeRef:l,index:i}}function rp(n){const{render:e,className:t,state:r=js,props:s=ji,refs:i=ji,metadata:o,stateAttributesMapping:a,tag:l="div",...c}=n,{compositeProps:u,compositeRef:f}=np({metadata:o});return bt(l,n,{state:r,ref:[...i,f],props:[u,...s,c],stateAttributesMapping:a})}function Lc(n){if(Kg(n)&&n.hasAttribute("data-rootownerid"))return n.getAttribute("data-rootownerid")??void 0;if(!Wg(n))return Lc(Vg(n))}function sp(n){const{enabled:e=!0,mouseDownAction:t,open:r}=n,s=w.useRef(!1);return w.useMemo(()=>e?{onMouseDown:i=>{(t==="open"&&!r||t==="close"&&r)&&(s.current=!0,Qt(i.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:i=>{s.current&&(s.current=!1,i.preventBaseUIHandler())}}:js,[e,t,r])}const Gr=2,ip=w.forwardRef(function(e,t){const{render:r,className:s,disabled:i=!1,nativeButton:o=!0,id:a,openOnHover:l,delay:c=100,closeDelay:u=0,handle:f,payload:d,...h}=e,g=Gt(!0),m=f?.store??g?.store;if(!m)throw new Error(In(85));const y=nr(a),x=m.useState("isTriggerActive",y),p=m.useState("floatingRootContext"),_=m.useState("isOpenedByTrigger",y),C=w.useRef(null),v=ap(),b=sc(!0),S=uh(),T=w.useMemo(()=>S??new ac,[S]),E=lc(T),N=uc(),{registerTrigger:P,isMountedByThisTrigger:$}=Lh(y,C,m,{payload:d,closeDelay:u,parent:v,floatingTreeRoot:T,floatingNodeId:E,floatingParentNodeId:N,keyboardEventRelay:b?.relayKeyboardEvent}),R=m.useState("disabled"),I=i||R||v.type==="menubar"&&v.context.disabled,{getButtonProps:j,buttonRef:B}=rc({disabled:I,native:o});w.useEffect(()=>{!_&&v.type===void 0&&(m.context.allowMouseUpTriggerRef.current=!1)},[m,_,v.type]);const M=w.useRef(null),U=_s(),z=Fe(G=>{if(!M.current)return;U.clear(),m.context.allowMouseUpTriggerRef.current=!1;const oe=G.target;if(ls(M.current,oe)||ls(m.select("positionerElement"),oe)||oe===M.current||oe!=null&&Lc(oe)===m.select("rootId"))return;const ee=Cg(M.current);G.clientX>=ee.left-Gr&&G.clientX<=ee.right+Gr&&G.clientY>=ee.top-Gr&&G.clientY<=ee.bottom+Gr||T.events.emit("close",{domEvent:G,reason:ch})});w.useEffect(()=>{_&&m.select("lastOpenChangeReason")===br&&Qt(M.current).addEventListener("mouseup",z,{once:!0})},[_,z,m]);const Z=v.type==="menubar"&&v.context.hasSubmenuOpen,J=Tc(p,{enabled:(l??Z??!1)&&!I&&v.type!=="context-menu"&&(v.type!=="menubar"||Z&&!$),handleClose:wc({blockPointerEvents:v.type!=="menubar"}),mouseOnly:!0,move:!1,restMs:v.type===void 0?c:void 0,delay:{close:u},triggerElementRef:C,externalTree:T,isActiveTrigger:x}),q=op(_,m.select("lastOpenChangeReason")),H=Ec(p,{enabled:!I&&v.type!=="context-menu",event:_&&v.type==="menubar"?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:v.type===void 0?q:!1}),ae=jh(p,{enabled:!I&&(v.type!=="menubar"&&_||Z)}),re=sp({open:_,enabled:v.type==="menubar",mouseDownAction:"open"}),le=Lo([H,ae]),Q=v.type==="menubar",te=w.useMemo(()=>({disabled:I,open:_}),[I,_]),ie=m.useState("triggerProps",$),V=[M,t,B,P,C],ce=[le.getReferenceProps(),J??js,ie,{"aria-haspopup":"menu",id:y,onMouseDown:G=>{if(m.select("open"))return;U.start(200,()=>{m.context.allowMouseUpTriggerRef.current=!0}),Qt(G.currentTarget).addEventListener("mouseup",z,{once:!0})}},Q?{role:"menuitem"}:{},re,h,j],he=w.useRef(null),Ne=Fe(G=>{wr.flushSync(()=>{m.setOpen(!1,ct(zi,G.nativeEvent,G.currentTarget))}),dh(he.current)?.focus()}),W=Fe(G=>{const oe=m.select("positionerElement");if(oe&&fh(G,oe))m.context.beforeContentFocusGuardRef.current?.focus();else{wr.flushSync(()=>{m.setOpen(!1,ct(zi,G.nativeEvent,G.currentTarget))});let ee=gh(C.current);for(;ee!==null&&ls(oe,ee)||ee?.hasAttribute("aria-hidden");){const Ae=ee;if(ee=hh(ee),ee===Ae)break}ee?.focus()}}),ue=bt("button",e,{enabled:!Q,stateAttributesMapping:Fa,state:te,ref:V,props:ce});return Q?k.jsx(rp,{tag:"button",render:r,className:s,state:te,refs:V,props:ce,stateAttributesMapping:Fa}):_?k.jsxs(w.Fragment,{children:[k.jsx(Ma,{ref:he,onFocus:Ne},`${y}-pre-focus-guard`),k.jsx(w.Fragment,{children:ue},y),k.jsx(Ma,{ref:m.context.triggerFocusTargetRef,onFocus:W},`${y}-post-focus-guard`)]}):k.jsx(w.Fragment,{children:ue},y)});function op(n,e){const t=_s(),[r,s]=w.useState(!1);return tr(()=>{n&&e==="trigger-hover"?(s(!0),t.start(ph,()=>{s(!1)})):n||(t.clear(),s(!1))},[n,e,t]),r}function ap(){const n=zs(!0),e=Gt(!0),t=Oc();return w.useMemo(()=>t?{type:"menubar",context:t}:n&&!e?{type:"context-menu",context:n}:{type:void 0},[n,e,t])}const lp=w.forwardRef(function(e,t){const{render:r,className:s,label:i,id:o,nativeButton:a=!1,openOnHover:l=!0,delay:c=100,closeDelay:u=0,disabled:f=!1,...d}=e,h=Bs(),g=Bo(),{store:m}=Gt(),y=nr(o),x=m.useState("open"),p=m.useState("floatingRootContext"),_=m.useState("floatingTreeRoot"),C=Dh(y,m),v=w.useCallback(ae=>{const re=C(ae);return ae!==null&&m.select("open")&&m.select("activeTriggerId")==null&&m.update({activeTriggerId:y,activeTriggerElement:ae,closeDelay:u}),re},[C,u,m,y]),b=w.useRef(null),S=w.useCallback(ae=>{b.current=ae,m.set("activeTriggerElement",ae)},[m]),T=Mc();if(!T?.parentMenu)throw new Error(In(37));m.useSyncedValue("closeDelay",u);const E=T.parentMenu,N=E.useState("itemProps"),P=E.useState("isActive",h.index),$=w.useMemo(()=>({type:"submenu-trigger",setActive:()=>E.set("activeIndex",h.index)}),[E,h.index]),R=m.useState("disabled"),I=f||R,{getItemProps:j,itemRef:B}=Ic({closeOnClick:!1,disabled:I,highlighted:P,id:y,store:m,nativeButton:a,itemMetadata:$,nodeId:g?.nodeId}),M=m.useState("hoverEnabled"),U=m.useState("allowMouseEnter"),z=Tc(p,{enabled:M&&l&&!I&&U,handleClose:wc({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:c,delay:{open:c,close:u},triggerElementRef:b,externalTree:_}),Z=Ec(p,{enabled:!I,event:"mousedown",toggle:!l,ignoreMouse:l,stickIfOpen:!1}),ne=Lo([Z]),J=m.useState("triggerProps",!0);delete J.id;const q=w.useMemo(()=>({disabled:I,highlighted:P,open:x}),[I,P,x]);return bt("div",e,{state:q,stateAttributesMapping:mh,props:[ne.getReferenceProps(),z,J,N,{tabIndex:x||P?0:-1,onBlur(){P&&E.set("activeIndex",null)}},d,j],ref:[t,h.ref,B,v,S]})}),za=new Map;function up(n,e){const t=JSON.stringify({locale:n,options:e}),r=za.get(t);if(r)return r;const s=new Intl.NumberFormat(n,e);return za.set(t,s),s}function us(n,e,t){return n==null?"":up(e,t).format(n)}function Ui(n,e,t){return(n-e)*100/(t-e)}function yt(n,e=Number.MIN_SAFE_INTEGER,t=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(n,t))}function Dc(n,e){return n-e}function cp(n,e,t){const r=n.slice();return r[e]=t,r.sort(Dc)}function Bc(n,e,t,r,s,i){let o=n;return o=yt(o,t,r),s&&(o=cp(i,e,yt(o,i[e-1]||-1/0,i[e+1]||1/0))),o}function jc(n,e,t){if(!Array.isArray(n))return!0;const r=n.reduce((s,i,o,a)=>(o===a.length-1||s.push(Math.abs(i-a[o+1])),s),[]);return Math.min(...r)>=e*t}const Fr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null},zc=w.createContext(void 0);function Us(){const n=w.useContext(zc);if(n===void 0)throw new Error(In(62));return n}function dp(n){return"key"in n?_h:vh}function fp(n,e){return typeof n=="number"&&typeof e=="number"?n===e:Array.isArray(n)&&Array.isArray(e)?Nc(n,e):!1}const gp=w.forwardRef(function(e,t){const{"aria-labelledby":r,className:s,defaultValue:i,disabled:o=!1,id:a,format:l,largeStep:c=10,locale:u,render:f,max:d=100,min:h=0,minStepsBetweenValues:g=0,name:m,onValueChange:y,onValueCommitted:x,orientation:p="horizontal",step:_=1,thumbCollisionBehavior:C="push",thumbAlignment:v="center",value:b,...S}=e,T=nr(a),E=Fe(y),N=Fe(x),{clearErrors:P}=Eh(),{state:$,disabled:R,name:I,setTouched:j,setDirty:B,validityData:M,shouldValidateOnChange:U,validation:z}=Xu(),{labelId:Z}=Eg(),ne=r??Z,J=R||o,q=I??m,[H,ae]=Tg({controlled:b,default:i??h,name:"Slider"}),re=w.useRef(null),le=w.useRef(null),Q=w.useRef([]),te=w.useRef(null),ie=w.useRef(null),V=w.useRef(-1),ce=w.useRef(null),he=w.useRef(null),Ne=w.useRef("none"),W=dc(l),[ue,G]=w.useState(-1),[oe,ee]=w.useState(-1),[Ae,lt]=w.useState(!1),[Ge,ut]=w.useState(()=>new Map),[Dt,Et]=w.useState([void 0,void 0]),me=Fe(Y=>{G(Y),Y!==-1&&ee(Y)});wg({id:T,commit:z.commit,value:H,controlRef:le,name:q,getValue:()=>H}),Th(H,()=>{P(q),U()?z.commit(H):z.commit(H,!0);const Y=M.initialValue;let Se;Array.isArray(H)&&Array.isArray(Y)?Se=!Nc(H,Y):Se=H!==Y,B(Se)});const Bt=Fe(Y=>{Y&&(le.current=Y)}),Ye=Array.isArray(H),Ke=w.useMemo(()=>Ye?H.slice().sort(Dc):[yt(H,h,d)],[d,h,Ye,H]),We=Fe((Y,Se)=>{if(Number.isNaN(Y)||fp(Y,H))return;const rt=Se??ct(yh,void 0,void 0,{activeThumbIndex:-1});Ne.current=rt.reason;const st=new event.constructor(event.type,event);Object.defineProperty(st,"target",{writable:!0,value:{value:Y,name:q}}),rt.event=st,he.current=Y,E(Y,rt),!rt.isCanceled&&ae(Y)}),jt=Fe((Y,Se,rt)=>{const st=Bc(Y,Se,h,d,Ye,Ke);if(jc(st,_,g)){const cn=dp(rt);We(st,ct(cn,rt.nativeEvent,void 0,{activeThumbIndex:Se})),j(!0);const Hr=he.current??st;N(Hr,fc(cn,rt.nativeEvent))}});tr(()=>{const Y=gc(Qt(re.current));J&&Y&&re.current?.contains(Y)&&Y.blur()},[J]),J&&ue!==-1&&me(-1);const et=w.useMemo(()=>({...$,activeThumbIndex:ue,disabled:J,dragging:Ae,orientation:p,max:d,min:h,minStepsBetweenValues:g,step:_,values:Ke}),[$,ue,J,Ae,d,h,g,p,_,Ke]),Dn=w.useMemo(()=>({active:ue,controlRef:le,disabled:J,dragging:Ae,validation:z,formatOptionsRef:W,handleInputChange:jt,indicatorPosition:Dt,inset:v!=="center",labelId:ne,largeStep:c,lastUsedThumbIndex:oe,lastChangedValueRef:he,lastChangeReasonRef:Ne,locale:u,max:d,min:h,minStepsBetweenValues:g,name:q,onValueCommitted:N,orientation:p,pressedInputRef:te,pressedThumbCenterOffsetRef:ie,pressedThumbIndexRef:V,pressedValuesRef:ce,registerFieldControlRef:Bt,renderBeforeHydration:v==="edge",setActive:me,setDragging:lt,setIndicatorPosition:Et,setValue:We,state:et,step:_,thumbCollisionBehavior:C,thumbMap:Ge,thumbRefs:Q,values:Ke}),[ue,le,ne,J,Ae,z,W,jt,Dt,c,oe,he,Ne,u,d,h,g,q,N,p,te,ie,V,ce,Bt,me,lt,Et,We,et,_,C,v,Ge,Q,Ke]),de=bt("div",e,{state:et,ref:[t,re],props:[{"aria-labelledby":ne,id:T,role:"group"},z.getValidationProps,S],stateAttributesMapping:Fr});return k.jsx(zc.Provider,{value:Dn,children:k.jsx(Zu,{elementsRef:Q,onMapChange:ut,children:de})})});function Uc(n){const e=n.getBoundingClientRect();return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function hp(n){if(Math.abs(n)<1){const t=n.toExponential().split("e-"),r=t[0].split(".")[1];return(r?r.length:0)+parseInt(t[1],10)}const e=n.toString().split(".")[1];return e?e.length:0}function Kc(n,e,t){const r=Math.round((n-t)/e)*e+t;return Number(r.toFixed(hp(e)))}function Ua({values:n,index:e,nextValue:t,min:r,max:s,step:i,minStepsBetweenValues:o,initialValues:a}){if(n.length===0)return[];const l=n.slice(),c=i*o,u=l.length-1,f=a??n,d=r+e*c,h=s-(u-e)*c;l[e]=yt(t,d,h);for(let g=e+1;g<=u;g+=1){const m=l[g-1]+c,y=s-(u-g)*c,x=f[g]??l[g];let p=Math.max(l[g],m);x<p&&(p=Math.max(x,m)),l[g]=yt(p,m,y)}for(let g=e-1;g>=0;g-=1){const m=l[g+1]-c,y=r+g*c,x=f[g]??l[g];let p=Math.min(l[g],m);x>p&&(p=Math.min(x,m)),l[g]=yt(p,y,m)}for(let g=0;g<=u;g+=1)l[g]=Number(l[g].toFixed(12));return l}function pp({behavior:n,values:e,currentValues:t,initialValues:r,pressedIndex:s,nextValue:i,min:o,max:a,step:l,minStepsBetweenValues:c}){const u=t??e,f=r??e;if(!(u.length>1))return{value:i,thumbIndex:0,didSwap:!1};const h=l*c;switch(n){case"swap":{const g=u[s],m=1e-7,y=u.slice(),x=y[s-1],p=y[s+1],_=x!=null?x+h:o,C=p!=null?p-h:a,v=yt(i,_,C),b=Number(v.toFixed(12));y[s]=b;const S=i>g,T=i<g,E=S&&p!=null&&i>=p-m,N=T&&x!=null&&i<=x+m;if(!E&&!N)return{value:y,thumbIndex:s,didSwap:!1};const P=E?s+1:s-1,$=y.map((B,M)=>{if(M===s)return b;const U=f[M];return U??u[M]});let R=i;E?R=Math.max(i,y[P]):R=Math.min(i,y[P]);const I=Ua({values:y,index:P,nextValue:R,min:o,max:a,step:l,minStepsBetweenValues:c,initialValues:$}),j=E?P-1:P+1;if(j>=0&&j<I.length){const B=I[j-1],M=I[j+1];let U=B!=null?B+h:o;U=Math.max(U,o+j*h);let z=M!=null?M-h:a;z=Math.min(z,a-(I.length-1-j)*h);const Z=yt(b,U,z);I[j]=Number(Z.toFixed(12))}return{value:I,thumbIndex:P,didSwap:!0}}case"push":return{value:Ua({values:u,index:s,nextValue:i,min:o,max:a,step:l,minStepsBetweenValues:c}),thumbIndex:s,didSwap:!1};case"none":default:{const g=u.slice(),m=g[s-1],y=g[s+1],x=m!=null?m+h:o,p=y!=null?y-h:a,_=yt(i,x,p);return g[s]=Number(_.toFixed(12)),{value:g,thumbIndex:s,didSwap:!1}}}}const mp=2;function yp(n,e){if(!n)return{start:0,end:0};function t(i){const o=i!=null?parseFloat(i):0;return Number.isNaN(o)?0:o}const r=e?"Top":"InlineStart",s=e?"Bottom":"InlineEnd";return{start:t(n[`border${r}Width`])+t(n[`padding${r}`]),end:t(n[`border${s}Width`])+t(n[`padding${s}`])}}function Yr(n,e){if(e.current!=null&&n.changedTouches){const t=n;for(let r=0;r<t.changedTouches.length;r+=1){const s=t.changedTouches[r];if(s.identifier===e.current)return{x:s.clientX,y:s.clientY}}return null}return{x:n.clientX,y:n.clientY}}const _p=w.forwardRef(function(e,t){const{render:r,className:s,...i}=e,{disabled:o,dragging:a,validation:l,inset:c,lastChangedValueRef:u,lastChangeReasonRef:f,max:d,min:h,minStepsBetweenValues:g,onValueCommitted:m,orientation:y,pressedInputRef:x,pressedThumbCenterOffsetRef:p,pressedThumbIndexRef:_,pressedValuesRef:C,registerFieldControlRef:v,renderBeforeHydration:b,setActive:S,setDragging:T,setValue:E,state:N,step:P,thumbCollisionBehavior:$,thumbRefs:R,values:I}=Us(),j=Do(),B=I.length>1,M=y==="vertical",U=w.useRef(null),z=w.useRef(null),Z=Fe(W=>{W&&z.current==null&&z.current==null&&(z.current=getComputedStyle(W))}),ne=w.useRef(null),J=w.useRef(0),q=w.useRef(0),H=dc(I),ae=Fe(W=>{_.current!==W&&(_.current=W);const ue=R.current[W];if(!ue){p.current=null,x.current=null;return}x.current=ue.querySelector('input[type="range"]')}),re=Fe(W=>{const ue=U.current;if(!ue)return null;const{width:G,height:oe,bottom:ee,left:Ae,right:lt}=ue.getBoundingClientRect(),Ge=yp(z.current,M),ut=q.current,Dt=(M?oe:G)-Ge.start-Ge.end-ut*2,Et=p.current??0,me=W.x-Et,Bt=W.y-Et,Ye=M?ee-Bt-Ge.end:(j==="rtl"?lt-me:me-Ae)-Ge.start,Ke=yt((Ye-ut)/Dt,0,1);let We=(d-h)*Ke+h;if(We=Kc(We,P,h),We=yt(We,h,d),!B)return{value:We,thumbIndex:0,didSwap:!1};const jt=_.current;if(jt<0)return null;const et=pp({behavior:$,values:I,currentValues:H.current??I,initialValues:C.current,pressedIndex:jt,nextValue:We,min:h,max:d,step:P,minStepsBetweenValues:g});return $==="swap"&&et.didSwap?ae(et.thumbIndex):_.current=et.thumbIndex,et}),le=Fe(W=>{C.current=B?I.slice():null,H.current=I;const ue=_.current;let G=ue;if(ue>-1&&ue<I.length){if(I[ue]===d){let oe=ue;for(;oe>0&&I[oe-1]===d;)oe-=1;G=oe}}else{const oe=M?"y":"x";let ee;G=-1;for(let Ae=0;Ae<R.current.length;Ae+=1){const lt=R.current[Ae];if(fi(lt)){const Ge=Uc(lt),ut=Math.abs(W[oe]-Ge[oe]);(ee===void 0||ut<=ee)&&(G=Ae,ee=ut)}}}if(G>-1&&G!==ue&&ae(G),c){const oe=R.current[G];if(fi(oe)){const ee=oe.getBoundingClientRect(),Ae=M?"height":"width";q.current=ee[Ae]/2}}}),Q=Fe(W=>{R.current?.[W]?.querySelector('input[type="range"]')?.focus({preventScroll:!0})}),te=Fe(W=>{const ue=Yr(W,ne);if(ue==null)return;if(J.current+=1,W.type==="pointermove"&&W.buttons===0){ie(W);return}const G=re(ue);G!=null&&jc(G.value,P,g)&&(!a&&J.current>mp&&T(!0),E(G.value,ct(xh,W,void 0,{activeThumbIndex:G.thumbIndex})),H.current=Array.isArray(G.value)?G.value:[G.value],G.didSwap&&Q(G.thumbIndex))});function ie(W){S(-1),T(!1),x.current=null,p.current=null,_.current=-1;const ue=Yr(W,ne),G=ue!=null?re(ue):null;if(G!=null){const oe=f.current;l.commit(u.current??G.value),m(u.current??G.value,fc(oe,W))}"pointerType"in W&&U.current?.hasPointerCapture(W.pointerId)&&U.current?.releasePointerCapture(W.pointerId),ne.current=null,C.current=null,ce()}const V=Fe(W=>{if(o)return;const ue=W.changedTouches[0];ue!=null&&(ne.current=ue.identifier);const G=Yr(W,ne);if(G!=null){le(G);const ee=re(G);if(ee==null)return;Q(ee.thumbIndex),E(ee.value,ct($a,W,void 0,{activeThumbIndex:ee.thumbIndex})),H.current=Array.isArray(ee.value)?ee.value:[ee.value],ee.didSwap&&Q(ee.thumbIndex)}J.current=0;const oe=Qt(U.current);oe.addEventListener("touchmove",te,{passive:!0}),oe.addEventListener("touchend",ie,{passive:!0})}),ce=Fe(()=>{const W=Qt(U.current);W.removeEventListener("pointermove",te),W.removeEventListener("pointerup",ie),W.removeEventListener("touchmove",te),W.removeEventListener("touchend",ie),C.current=null}),he=cc();return w.useEffect(()=>{const W=U.current;return W?(W.addEventListener("touchstart",V,{passive:!0}),()=>{W.removeEventListener("touchstart",V),he.cancel(),ce()}):()=>ce()},[ce,V,U,he]),w.useEffect(()=>{o&&ce()},[o,ce]),bt("div",e,{state:N,ref:[t,v,U,Z],props:[{"data-base-ui-slider-control":b?"":void 0,onPointerDown(W){const ue=U.current;if(!ue||o||W.defaultPrevented||!fi(W.target)||W.button!==0)return;const G=Yr(W,ne);if(G!=null){le(G);const ee=re(G);if(ee==null)return;ls(R.current[ee.thumbIndex],gc(Qt(ue)))?W.preventDefault():he.request(()=>{Q(ee.thumbIndex)}),T(!0),p.current!=null||(E(ee.value,ct($a,W.nativeEvent,void 0,{activeThumbIndex:ee.thumbIndex})),H.current=Array.isArray(ee.value)?ee.value:[ee.value],ee.didSwap&&Q(ee.thumbIndex))}W.nativeEvent.pointerId&&ue.setPointerCapture(W.nativeEvent.pointerId),J.current=0;const oe=Qt(U.current);oe.addEventListener("pointermove",te,{passive:!0}),oe.addEventListener("pointerup",ie,{once:!0})},tabIndex:-1},i],stateAttributesMapping:Fr})}),vp=w.forwardRef(function(e,t){const{render:r,className:s,...i}=e,{state:o}=Us();return bt("div",e,{state:o,ref:t,props:[{style:{position:"relative"}},i],stateAttributesMapping:Fr})});let xp=(function(n){return n.index="data-index",n.dragging="data-dragging",n.orientation="data-orientation",n.disabled="data-disabled",n.readonly="data-readonly",n.required="data-required",n.valid="data-valid",n.invalid="data-invalid",n.touched="data-touched",n.dirty="data-dirty",n.focused="data-focused",n})({});const bp='!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();',Wc="PageUp",Vc="PageDown",Sp=new Set([bc,vc,_c,xc,mc,yc,Wc,Vc]);function Cp(n,e,t,r){if(!(e<0))return n.length===2?e===0?`${us(n[e],r,t)} start range`:`${us(n[e],r,t)} end range`:t?us(n[e],r,t):void 0}function Bn(n,e,t,r,s){return t===1?Math.min(n+e,s):Math.max(n-e,r)}const Ep=w.forwardRef(function(e,t){const{render:r,children:s,className:i,"aria-describedby":o,"aria-label":a,"aria-labelledby":l,disabled:c=!1,getAriaLabel:u,getAriaValueText:f,id:d,index:h,inputRef:g,onBlur:m,onFocus:y,onKeyDown:x,tabIndex:p,..._}=e,C=nr(d),{active:v,lastUsedThumbIndex:b,controlRef:S,disabled:T,validation:E,formatOptionsRef:N,handleInputChange:P,inset:$,labelId:R,largeStep:I,locale:j,max:B,min:M,minStepsBetweenValues:U,name:z,orientation:Z,pressedInputRef:ne,pressedThumbCenterOffsetRef:J,pressedThumbIndexRef:q,renderBeforeHydration:H,setActive:ae,setIndicatorPosition:re,state:le,step:Q,values:te}=Us(),ie=Do(),V=c||T,ce=te.length>1,he=Z==="vertical",Ne=ie==="rtl",{setTouched:W,setFocused:ue,validationMode:G}=Xu(),oe=w.useRef(null),ee=w.useRef(null),Ae=nr(),lt=kg(),Ge=ce?Ae:lt,ut=w.useMemo(()=>({inputId:Ge}),[Ge]),{ref:Dt,index:Et}=Bs({metadata:ut}),me=ce?h??Et:0,Bt=me===te.length-1,Ye=te[me],Ke=Ui(Ye,M,B),[We,jt]=w.useState(!1),[et,Dn]=w.useState();hc(()=>jt(!0));const de=b>=0&&b<te.length?b:-1,Y=Fe(()=>{const Ce=S.current,be=oe.current;if(!Ce||!be)return;const Pe=be.getBoundingClientRect(),qr=Ce.getBoundingClientRect(),Jr=he?"height":"width",gg=qr[Jr]-Pe[Jr],ci=(Pe[Jr]/2+gg*Ke/100)/qr[Jr]*100;Dn(ci),me===0?re(di=>[ci,di[1]]):Bt&&re(di=>[di[0],ci])});tr(()=>{$&&queueMicrotask(Y)},[Y,$]),tr(()=>{$&&Y()},[Y,$,Ke]);const Se=w.useCallback(()=>{const Ce=he?"bottom":"insetInlineStart",be=he?"left":"top";let Pe;return ce?v===me?Pe=2:de===me&&(Pe=1):v===me&&(Pe=1),$?{"--position":`${et}%`,visibility:H&&!We||et===void 0?"hidden":void 0,position:"absolute",[Ce]:"var(--position)",[be]:"50%",translate:`${(he||!Ne?-1:1)*50}% ${(he?1:-1)*50}%`,zIndex:Pe}:Number.isFinite(Ke)?{position:"absolute",[Ce]:`${Ke}%`,[be]:"50%",translate:`${(he||!Ne?-1:1)*50}% ${(he?1:-1)*50}%`,zIndex:Pe}:La},[v,me,$,We,et,ce,H,Ne,de,Ke,he]);let rt;Z==="vertical"&&(rt=Ne?"vertical-rl":"vertical-lr");const st=ys({"aria-label":typeof u=="function"?u(me):a,"aria-labelledby":l??R,"aria-describedby":o,"aria-orientation":Z,"aria-valuenow":Ye,"aria-valuetext":typeof f=="function"?f(us(Ye,j,N.current??void 0),Ye,me):Cp(te,me,N.current??void 0,j),disabled:V,id:Ge,max:B,min:M,name:z,onChange(Ce){P(Ce.target.valueAsNumber,me,Ce)},onFocus(){ae(me),ue(!0)},onBlur(){oe.current&&(ae(-1),W(!0),ue(!1),G==="onBlur"&&E.commit(Bc(Ye,me,M,B,ce,te)))},onKeyDown(Ce){if(!Sp.has(Ce.key))return;pc.has(Ce.key)&&Ce.stopPropagation();let be=null;const Pe=Kc(Ye,Q,M);switch(Ce.key){case bc:be=Bn(Pe,Ce.shiftKey?I:Q,1,M,B);break;case xc:be=Bn(Pe,Ce.shiftKey?I:Q,Ne?-1:1,M,B);break;case vc:be=Bn(Pe,Ce.shiftKey?I:Q,-1,M,B);break;case _c:be=Bn(Pe,Ce.shiftKey?I:Q,Ne?1:-1,M,B);break;case Wc:be=Bn(Pe,I,1,M,B);break;case Vc:be=Bn(Pe,I,-1,M,B);break;case yc:be=B,ce&&(be=Number.isFinite(te[me+1])?te[me+1]-Q*U:B);break;case mc:be=M,ce&&(be=Number.isFinite(te[me-1])?te[me-1]+Q*U:M);break}be!==null&&(P(be,me,Ce),Ce.preventDefault())},step:Q,style:{...La,width:"100%",height:"100%",writingMode:rt},tabIndex:p??void 0,type:"range",value:Ye??""},E.getInputValidationProps),cn=$o(ee,E.inputRef,g);return bt("div",e,{state:le,ref:[t,Dt,oe],props:[{[xp.index]:me,children:k.jsxs(w.Fragment,{children:[s,k.jsx("input",{ref:cn,...st}),$&&!We&&H&&Bt&&k.jsx("script",{dangerouslySetInnerHTML:{__html:bp},suppressHydrationWarning:!0})]}),id:C,onBlur:m,onFocus:y,onPointerDown(Ce){if(q.current=me,oe.current!=null){const be=Z==="horizontal"?"x":"y",Pe=Uc(oe.current),qr=(Z==="horizontal"?Ce.clientX:Ce.clientY)-Pe[be];J.current=qr}ee.current!=null&&ne.current!==ee.current&&(ne.current=ee.current)},style:Se(),suppressHydrationWarning:H||void 0,tabIndex:-1},_],stateAttributesMapping:Fr})});function Tp(n,e,t,r,s,i){const o=t===void 0||e&&r===void 0?"hidden":void 0,a=n?"bottom":"insetInlineStart",l=n?"height":"width",u={visibility:s&&!i?"hidden":o,position:n?"absolute":"relative",[n?"width":"height"]:"inherit"};return u["--start-position"]=`${t??0}%`,e?(u["--relative-size"]=`${(r??0)-(t??0)}%`,u[a]="var(--start-position)",u[l]="var(--relative-size)",u):(u[a]=0,u[l]="var(--start-position)",u)}function wp(n,e,t,r){const s=n?"bottom":"insetInlineStart",i=n?"height":"width",a={position:n?"absolute":"relative",[n?"width":"height"]:"inherit"};if(!e)return a[s]=0,a[i]=`${t}%`,a;const l=r-t;return a[s]=`${t}%`,a[i]=`${l}%`,a}const kp=w.forwardRef(function(e,t){const{render:r,className:s,...i}=e,{indicatorPosition:o,inset:a,max:l,min:c,orientation:u,renderBeforeHydration:f,state:d,values:h}=Us(),[g,m]=w.useState(!1);hc(()=>m(!0));const y=u==="vertical",x=h.length>1,p=a?Tp(y,x,o[0],o[1],f,g):wp(y,x,Ui(h[0],c,l),Ui(h[h.length-1],c,l));return bt("div",e,{state:d,ref:t,props:[{"data-base-ui-slider-indicator":f?"":void 0,style:p,suppressHydrationWarning:f||void 0},i],stateAttributesMapping:Fr})});const Np=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],Ap=pg("brain-circuit",Np);var Pp="vpj4en0",Ip="vpj4en1",Rp="vpj4en2",Op="vpj4en3",Fp="vpj4en4",Mp="vpj4en5",$p="vpj4en6";function Zr(n){const e=qe.c(25),{label:t,value:r,defaultValue:s,min:i,max:o,step:a,onValueChange:l,onValueCommitted:c,disabled:u,className:f,showValue:d,formatValue:h}=n,g=i===void 0?0:i,m=o===void 0?100:o,y=a===void 0?1:a,x=u===void 0?!1:u,p=d===void 0?!0:d;let _;e[0]!==l?(_=I=>{typeof I=="number"?l?.(I):Array.isArray(I)&&l?.(I[0])},e[0]=l,e[1]=_):_=e[1];const C=_;let v;e[2]!==c?(v=I=>{typeof I=="number"?c?.(I):Array.isArray(I)&&c?.(I[0])},e[2]=c,e[3]=v):v=e[3];const b=v,S=r??s??g;let T;e[4]!==S||e[5]!==h?(T=h?h(S):String(S),e[4]=S,e[5]=h,e[6]=T):T=e[6];const E=T;let N;e[7]!==f?(N=mg(Pp,f),e[7]=f,e[8]=N):N=e[8];let P;e[9]!==E||e[10]!==t||e[11]!==p?(P=(t||p)&&k.jsxs("div",{className:Ip,children:[t&&k.jsx("span",{children:t}),p&&k.jsx("span",{className:Rp,children:E})]}),e[9]=E,e[10]=t,e[11]=p,e[12]=P):P=e[12];let $;e[13]===Symbol.for("react.memo_cache_sentinel")?($=k.jsx(_p,{className:Op,children:k.jsxs(vp,{className:Fp,children:[k.jsx(kp,{className:Mp}),k.jsx(Ep,{className:$p})]})}),e[13]=$):$=e[13];let R;return e[14]!==s||e[15]!==x||e[16]!==C||e[17]!==b||e[18]!==m||e[19]!==g||e[20]!==y||e[21]!==P||e[22]!==N||e[23]!==r?(R=k.jsxs(gp,{value:r,defaultValue:s,min:g,max:m,step:y,onValueChange:C,onValueCommitted:b,disabled:x,className:N,children:[P,$]}),e[14]=s,e[15]=x,e[16]=C,e[17]=b,e[18]=m,e[19]=g,e[20]=y,e[21]=P,e[22]=N,e[23]=r,e[24]=R):R=e[24],R}var Lp="_7ucatj0",Dp="_7ucatj1",Bp="_7ucatj2",Ka="_7ucatj3",Wa="_7ucatj4",Va="_7ucatj5",Ha="_7ucatj6",qa="_7ucatj7",Ja="_7ucatj8",Ga="_7ucatj9",Ya="_7ucatja",jp="_7ucatjb",zp="_7ucatjc",Up="_7ucatjd",Kp="_7ucatje",Wp="_7ucatjf",Vp="_7ucatjg",Hp="_7ucatjh",qp="_7ucatji";function Jp(n){const e=qe.c(69),{isNewVariant:t,onSave:r,isSaving:s}=n,i=s===void 0?!1:s,[o,a]=w.useState(!1),[l,c]=w.useState(t?"new_variant":"new_version"),[u,f]=w.useState(!1),[d,h]=w.useState(null),{data:g}=Wh();let m;e[0]!==g?(m=g===void 0?[]:g,e[0]=g,e[1]=m):m=e[1];const y=m;let x;e[2]!==u||e[3]!==l||e[4]!==r||e[5]!==d?.id?(x=()=>{r({mode:l,deployToEnvironment:u,environmentId:u?d?.id??null:null}),a(!1)},e[2]=u,e[3]=l,e[4]=r,e[5]=d?.id,e[6]=x):x=e[6];const p=x;let _;e[7]!==t?(_=W=>{a(W),W&&(c(t?"new_variant":"new_version"),f(!1),h(null))},e[7]=t,e[8]=_):_=e[8];const C=_;let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=k.jsx(Gu,{icon:Ag,size:"xs"}),e[9]=v):v=e[9];const b=i?"Saving...":"Save";let S;e[10]!==i||e[11]!==b?(S=k.jsx(ec,{asChild:!0,children:k.jsxs(gi,{variant:"primary",size:"default",type:"button",disabled:i,children:[v,b]})}),e[10]=i,e[11]=b,e[12]=S):S=e[12];let T;e[13]===Symbol.for("react.memo_cache_sentinel")?(T=k.jsx("div",{className:Dp,children:"Save Options"}),e[13]=T):T=e[13];const E=`${Ka} ${l==="new_variant"?Wa:""}`;let N,P;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=()=>c("new_variant"),P=W=>W.key==="Enter"&&c("new_variant"),e[14]=N,e[15]=P):(N=e[14],P=e[15]);const $=l==="new_variant",R=`${Va} ${l==="new_variant"?Ha:""}`;let I;e[16]!==l?(I=l==="new_variant"&&k.jsx("div",{className:qa}),e[16]=l,e[17]=I):I=e[17];let j;e[18]!==R||e[19]!==I?(j=k.jsx("div",{className:R,children:I}),e[18]=R,e[19]=I,e[20]=j):j=e[20];let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=k.jsxs("div",{className:Ja,children:[k.jsx("span",{className:Ga,children:"Save as new variant"}),k.jsx("span",{className:Ya,children:"Creates a new variant with version 1"})]}),e[21]=B):B=e[21];let M;e[22]!==E||e[23]!==$||e[24]!==j?(M=k.jsxs("div",{className:E,onClick:N,onKeyDown:P,role:"radio","aria-checked":$,tabIndex:0,children:[j,B]}),e[22]=E,e[23]=$,e[24]=j,e[25]=M):M=e[25];let U;e[26]!==t||e[27]!==l?(U=!t&&k.jsxs("div",{className:`${Ka} ${l==="new_version"?Wa:""}`,onClick:()=>c("new_version"),onKeyDown:W=>W.key==="Enter"&&c("new_version"),role:"radio","aria-checked":l==="new_version",tabIndex:0,children:[k.jsx("div",{className:`${Va} ${l==="new_version"?Ha:""}`,children:l==="new_version"&&k.jsx("div",{className:qa})}),k.jsxs("div",{className:Ja,children:[k.jsx("span",{className:Ga,children:"Update as new version"}),k.jsx("span",{className:Ya,children:"Creates a new version of this variant"})]})]}),e[26]=t,e[27]=l,e[28]=U):U=e[28];let z;e[29]!==M||e[30]!==U?(z=k.jsxs("div",{className:Bp,children:[M,U]}),e[29]=M,e[30]=U,e[31]=z):z=e[31];const Z=`${Up} ${u?Kp:""}`;let ne,J;e[32]!==u?(ne=()=>f(!u),J=W=>W.key==="Enter"&&f(!u),e[32]=u,e[33]=ne,e[34]=J):(ne=e[33],J=e[34]);let q;e[35]!==u?(q=u&&k.jsx(Sc,{className:Wp}),e[35]=u,e[36]=q):q=e[36];let H;e[37]!==u||e[38]!==Z||e[39]!==ne||e[40]!==J||e[41]!==q?(H=k.jsx("div",{className:Z,onClick:ne,onKeyDown:J,role:"checkbox","aria-checked":u,tabIndex:0,children:q}),e[37]=u,e[38]=Z,e[39]=ne,e[40]=J,e[41]=q,e[42]=H):H=e[42];let ae;e[43]!==u?(ae=k.jsx("span",{className:Vp,onClick:()=>f(!u),children:"Deploy to environment"}),e[43]=u,e[44]=ae):ae=e[44];let re;e[45]!==H||e[46]!==ae?(re=k.jsxs("div",{className:zp,children:[H,ae]}),e[45]=H,e[46]=ae,e[47]=re):re=e[47];let le;e[48]!==u||e[49]!==y||e[50]!==d?(le=u&&k.jsx("div",{className:Hp,children:k.jsx(Mo,{items:y,value:d,onValueChange:h,itemToString:Gp,placeholder:"Select environment"})}),e[48]=u,e[49]=y,e[50]=d,e[51]=le):le=e[51];let Q;e[52]!==re||e[53]!==le?(Q=k.jsxs("div",{className:jp,children:[re,le]}),e[52]=re,e[53]=le,e[54]=Q):Q=e[54];let te;e[55]===Symbol.for("react.memo_cache_sentinel")?(te=k.jsx(gi,{variant:"ghost",scheme:"gray",size:"sm",type:"button",onClick:()=>a(!1),children:"Cancel"}),e[55]=te):te=e[55];const ie=i||u&&!d,V=i?"Saving...":"Confirm";let ce;e[56]!==p||e[57]!==ie||e[58]!==V?(ce=k.jsxs("div",{className:qp,children:[te,k.jsx(gi,{variant:"primary",size:"sm",type:"button",onClick:p,disabled:ie,children:V})]}),e[56]=p,e[57]=ie,e[58]=V,e[59]=ce):ce=e[59];let he;e[60]!==z||e[61]!==Q||e[62]!==ce?(he=k.jsx(tc,{side:"bottom",align:"end",sideOffset:4,children:k.jsxs("div",{className:Lp,children:[T,z,Q,ce]})}),e[60]=z,e[61]=Q,e[62]=ce,e[63]=he):he=e[63];let Ne;return e[64]!==C||e[65]!==o||e[66]!==he||e[67]!==S?(Ne=k.jsxs(nc,{open:o,onOpenChange:C,children:[S,he]}),e[64]=C,e[65]=o,e[66]=he,e[67]=S,e[68]=Ne):Ne=e[68],Ne}function Gp(n){return n?.name||""}const Hc=w.createContext(null);function Yp(n,e){return{getTheme:function(){return e??null}}}function Je(){const n=w.useContext(Hc);return n==null&&(function(e,...t){const r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(const i of t)s.append("v",i);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),n}function F(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function qc(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const St=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Zp=St&&"documentMode"in document?document.documentMode:null,mt=St&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),xn=St&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),vs=!(!St||!("InputEvent"in window)||Zp)&&"getTargetRanges"in new window.InputEvent("input"),Mr=St&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),or=St&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Xp=St&&/Android/.test(navigator.userAgent),Jc=St&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Za=St&&Xp&&Jc,$r=St&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&mt&&!Jc;function Gc(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const Qp=0,em=1,tm=2,Yc=128,nm=1,rm=2,sm=3,im=4,om=5,am=6,Ks=Mr||or||$r?" ":"​",sn=`
2
2
 
3
3
  `,lm=xn?" ":Ks,bn={bold:1,capitalize:1024,code:16,highlight:Yc,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},um={directionless:1,unmergeable:2},Xa={center:2,end:6,justify:4,left:1,right:3,start:5},cm={[rm]:"center",[am]:"end",[im]:"justify",[nm]:"left",[sm]:"right",[om]:"start"},dm={normal:0,segmented:2,token:1},fm={[Qp]:"normal",[tm]:"segmented",[em]:"token"},Qa="$config";function Zc(n,e,t,r,s,i){let o=n.getFirstChild();for(;o!==null;){const a=o.__key;o.__parent===e&&(A(o)&&Zc(o,a,t,r,s,i),t.has(a)||i.delete(a),s.push(a)),o=o.getNextSibling()}}let Ki=!1,zo=0;function gm(n){zo=n.timeStamp}function hi(n,e,t){const r=n.nodeName==="BR",s=e.__lexicalLineBreak;return s&&(n===s||r&&n.previousSibling===s)||r&&Qs(n,t)!==void 0}function hm(n,e,t){const r=Ct(ht(t));let s=null,i=null;r!==null&&r.anchorNode===n&&(s=r.anchorOffset,i=r.focusOffset);const o=n.nodeValue;o!==null&&ua(e,o,s,i,!1)}function pm(n,e,t){if(O(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return Yt(e)&&t.isAttached()}function mm(n,e,t,r){for(let s=n;s&&!_y(s);s=zr(s)){const i=Qs(s,e);if(i!==void 0){const o=Ie(i,t);if(o)return pe(o)||!ke(s)?void 0:[s,o]}else if(s===r)return[r,tf(t)]}}function Xc(n,e,t){Ki=!0;const r=performance.now()-zo>100;try{It(n,()=>{const s=D()||(function(d){return d.getEditorState().read(()=>{const h=D();return h!==null?h.clone():null})})(n),i=new Map,o=n.getRootElement(),a=n._editorState,l=n._blockCursorElement;let c=!1,u="";for(let d=0;d<e.length;d++){const h=e[d],g=h.type,m=h.target,y=mm(m,n,a,o);if(!y)continue;const[x,p]=y;if(g==="characterData")r&&L(p)&&Yt(m)&&pm(s,m,p)&&hm(m,p,n);else if(g==="childList"){c=!0;const _=h.addedNodes;for(let b=0;b<_.length;b++){const S=_[b],T=Qd(S),E=S.parentNode;if(E!=null&&S!==l&&T===null&&!hi(S,E,n)){if(xn){const N=(ke(S)?S.innerText:null)||S.nodeValue;N&&(u+=N)}E.removeChild(S)}}const C=h.removedNodes,v=C.length;if(v>0){let b=0;for(let S=0;S<v;S++){const T=C[S];(hi(T,m,n)||l===T)&&(m.appendChild(T),b++)}v!==b&&i.set(x,p)}}}if(i.size>0)for(const[d,h]of i)h.reconcileObservedMutation(d,n);const f=t.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,m=h.target;for(let y=0;y<g.length;y++){const x=g[y],p=x.parentNode;p==null||x.nodeName!=="BR"||hi(x,m,n)||p.removeChild(x)}}t.takeRecords()}s!==null&&(c&&Ue(s),xn&&of(n)&&s.insertRawText(u))})}finally{Ki=!1}}function Qc(n){const e=n._observer;e!==null&&Xc(n,e.takeRecords(),e)}function ed(n){(function(e){zo===0&&ht(e).addEventListener("textInput",gm,!0)})(n),n._observer=new MutationObserver((e,t)=>{Xc(n,e,t)})}let ym=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||bm).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function _m(n,e){return new ym(n,e)}function td(n,e,t="latest"){const r=(t==="latest"?n.getLatest():n).__state;return r?r.getValue(e):e.defaultValue}function pi(n,e,t){let r;if(De(),typeof t=="function"){const i=n.getLatest(),o=td(i,e);if(r=t(o),e.isEqual(o,r))return i}else r=t;const s=n.getWritable();return rd(s).updateFromKnown(e,r),s}function vm(n){const e=new Map,t=new Set;for(let r=typeof n=="function"?n:n.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:s}=ni(r);if(s&&s.stateConfigs)for(const i of s.stateConfigs){let o;"stateConfig"in i?(o=i.stateConfig,i.flat&&t.add(o.key)):o=i,e.set(o.key,o)}}return{flatKeys:t,sharedConfigMap:e}}let xm=class nd{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,r=void 0,s=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=s;const{sharedConfigMap:o}=this.sharedNodeState,a=i!==void 0?i:(function(l,c,u){let f=u.size;if(c)for(const d in c){const h=l.get(d);h&&u.has(h)||f++}return f})(o,r,s);this.size=a}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const s=this.unknownState[e.key];s!==void 0&&(r=e.parse(s)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[r,s]of this.knownState)r.isEqual(s,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(s);for(const r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return el(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;const{sharedNodeState:t,unknownState:r}=this,s=new Map(this.knownState);return new nd(e,t,(function(i,o,a){let l;if(a)for(const[c,u]of Object.entries(a)){const f=i.get(c);f?o.has(f)||o.set(f,f.parse(u)):(l=l||{},l[c]=u)}return l})(t.sharedConfigMap,s,r),s,this.size)}updateFromKnown(e,t){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:s,unknownState:i}=this;s.has(e)||i&&r in i||(i&&(delete i[r],this.unknownState=el(i)),this.size++),s.set(e,t)}updateFromUnknown(e,t){const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[r,s]of Object.entries(e))this.updateFromUnknown(r,s)}};function rd(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new xm(e,sd(e));return e.__state=t,t}function sd(n){return n.__state?n.__state.sharedNodeState:Jd(ti(),n.getType()).sharedNodeState}function el(n){if(n)for(const e in n)return n}function bm(n){return n}function tl(n,e,t){for(const[r,s]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const i=t?t.getValue(r):r.defaultValue;if(i!==s&&!r.isEqual(i,s))return!0}return!1}function nl(n,e,t){const{unknownState:r}=e,s=t?t.unknownState:void 0;if(r){for(const[i,o]of Object.entries(r))if(!n.has(i)&&(n.add(i),o!==(s?s[i]:void 0)))return!0}return!1}function rl(n,e){const t=n.__state;return t&&t.node===n?t.getWritable(e):t}function sl(n,e){const t=n.__mode,r=n.__format,s=n.__style,i=e.__mode,o=e.__format,a=e.__style,l=n.__state,c=e.__state;return(t===null||t===i)&&(r===null||r===o)&&(s===null||s===a)&&(n.__state===null||l===c||(function(u,f){if(u===f)return!0;if(u&&f&&u.size!==f.size)return!1;const d=new Set;return!(u&&tl(d,u,f)||f&&tl(d,f,u)||u&&nl(d,u,f)||f&&nl(d,f,u))})(l,c))}function il(n,e){const t=n.mergeWithSibling(e),r=ve()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function ol(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&L(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(sl(e,r)){r=il(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&L(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(sl(r,t)){r=il(r,t);break}break}t.remove()}}else r.remove()}function Sn(n){return al(n.anchor),al(n.focus),n}function al(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,s;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),s=!0):(r=e.getChildAtIndex(t),s=!1),L(r)){n.set(r.__key,s?r.getTextContentSize():0,"text",!0);break}if(!A(r))break;n.set(r.__key,s?r.getChildrenSize():0,"element",!0)}}let Cn,Ve,kr,Ws,Wi,Vi,En,_t,Hi,Nr,Me="",Tt=null,fn=null,Vt="",Wn=!1,xs=!1;function bs(n,e){const t=En.get(n);if(e!==null){const r=Yi(n);r.parentNode===e&&e.removeChild(r)}if(_t.has(n)||Ve._keyToDOMMap.delete(n),A(t)){const r=Cs(t,En);qi(r,0,r.length-1,null)}t!==void 0&&ca(Nr,kr,Ws,t,"destroyed")}function qi(n,e,t,r){let s=e;for(;s<=t;++s){const i=n[s];i!==void 0&&bs(i,r)}}function dn(n,e){n.setProperty("text-align",e)}const Sm="40px";function id(n,e){const t=Cn.theme.indent;if(typeof t=="string"){const s=n.classList.contains(t);e>0&&!s?n.classList.add(t):e<1&&s&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||Sm;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function od(n,e){const t=n.style;e===0?dn(t,""):e===1?dn(t,"left"):e===2?dn(t,"center"):e===3?dn(t,"right"):e===4?dn(t,"justify"):e===5?dn(t,"start"):e===6&&dn(t,"end")}function Ji(n,e){const t=(function(r){const s=r.__dir;if(s!==null)return s;if($e(r))return null;const i=r.getParentOrThrow();return $e(i)&&i.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function Ss(n,e){const t=_t.get(n);t===void 0&&F(60);const r=t.createDOM(Cn,Ve);if((function(s,i,o){const a=o._keyToDOMMap;(function(l,c,u){const f=`__lexicalKey_${c._key}`;l[f]=u})(i,o,s),a.set(s,i)})(n,r,Ve),L(t)?r.setAttribute("data-lexical-text","true"):pe(t)&&r.setAttribute("data-lexical-decorator","true"),A(t)){const s=t.__indent,i=t.__size;if(Ji(r,t),s!==0&&id(r,s),i!==0){const a=i-1;Gi(Cs(t,_t),t,0,a,t.getDOMSlot(r))}const o=t.__format;o!==0&&od(r,o),t.isInline()||ad(null,t,r),ei(t)&&(Me+=sn,Vt+=sn)}else{const s=t.getTextContent();if(pe(t)){const i=t.decorate(Ve,Cn);i!==null&&ld(n,i),r.contentEditable="false"}Me+=s,Vt+=s}return e!==null&&e.insertChild(r),ca(Nr,kr,Ws,t,"created"),r}function Gi(n,e,t,r,s){const i=Me;Me="";let o=t;for(;o<=r;++o){Ss(n[o],s);const a=_t.get(n[o]);a!==null&&L(a)&&Tt===null&&(Tt=a.getFormat(),fn=a.getStyle())}ei(e)&&(Me+=sn),s.element.__lexicalTextContent=Me,Me=i+Me}function ll(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return Pt(r)?"line-break":pe(r)&&r.isInline()?"decorator":null}return"empty"}return null}function ad(n,e,t){const r=ll(n,En),s=ll(e,_t);r!==s&&e.getDOMSlot(t).setManagedLineBreak(s)}function Cm(n,e,t){var r;Tt=null,fn=null,(function(s,i,o){const a=Me,l=s.__size,c=i.__size;Me="";const u=o.element;if(l===1&&c===1){const f=s.__first,d=i.__first;if(f===d)yr(f,u);else{const g=Yi(f),m=Ss(d,null);try{u.replaceChild(m,g)}catch(y){if(typeof y=="object"&&y!=null){const x=`${y.toString()} Parent: ${u.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(x)}throw y}bs(f,null)}const h=_t.get(d);L(h)&&Tt===null&&(Tt=h.getFormat(),fn=h.getStyle())}else{const f=Cs(s,En),d=Cs(i,_t);if(f.length!==l&&F(227),d.length!==c&&F(228),l===0)c!==0&&Gi(d,i,0,c-1,o);else if(c===0){if(l!==0){const h=o.after==null&&o.before==null&&o.element.__lexicalLineBreak==null;qi(f,0,l-1,h?null:u),h&&(u.textContent="")}}else(function(h,g,m,y,x,p){const _=y-1,C=x-1;let v,b,S=p.getFirstChild(),T=0,E=0;for(;T<=_&&E<=C;){const $=g[T],R=m[E];if($===R)S=mi(yr(R,p.element)),T++,E++;else{v===void 0&&(v=new Set(g)),b===void 0&&(b=new Set(m));const j=b.has($),B=v.has(R);if(j)if(B){const M=Tn(Ve,R);M===S?S=mi(yr(R,p.element)):(p.withBefore(S).insertChild(M),yr(R,p.element)),T++,E++}else Ss(R,p.withBefore(S)),E++;else S=mi(Yi($)),bs($,p.element),T++}const I=_t.get(R);I!==null&&L(I)&&Tt===null&&(Tt=I.getFormat(),fn=I.getStyle())}const N=T>_,P=E>C;if(N&&!P){const $=m[C+1],R=$===void 0?null:Ve.getElementByKey($);Gi(m,h,E,C,p.withBefore(R))}else P&&!N&&qi(g,T,_,p.element)})(i,f,d,l,c,o)}ei(i)&&(Me+=sn),u.__lexicalTextContent=Me,Me=a+Me})(n,e,e.getDOMSlot(t)),r=e,Tt==null||Tt===r.__textFormat||xs||r.setTextFormat(Tt),(function(s){fn==null||fn===s.__textStyle||xs||s.setTextStyle(fn)})(e)}function Cs(n,e){const t=[];let r=n.__first;for(;r!==null;){const s=e.get(r);s===void 0&&F(101),t.push(r),r=s.__next}return t}function yr(n,e){const t=En.get(n);let r=_t.get(n);t!==void 0&&r!==void 0||F(61);const s=Wn||Vi.has(n)||Wi.has(n),i=Tn(Ve,n);if(t===r&&!s){if(A(t)){const o=i.__lexicalTextContent;o!==void 0&&(Me+=o,Vt+=o)}else{const o=t.getTextContent();Vt+=o,Me+=o}return i}if(t!==r&&s&&ca(Nr,kr,Ws,r,"updated"),r.updateDOM(t,i,Cn)){const o=Ss(n,null);return e===null&&F(62),e.replaceChild(o,i),bs(n,null),o}if(A(t)&&A(r)){const o=r.__indent;(Wn||o!==t.__indent)&&id(i,o);const a=r.__format;if((Wn||a!==t.__format)&&od(i,a),s&&(Cm(t,r,i),$e(r)||r.isInline()||ad(t,r,i)),ei(r)&&(Me+=sn,Vt+=sn),(Wn||r.__dir!==t.__dir)&&(Ji(i,r),$e(r)&&!Wn))for(const l of r.getChildren())A(l)&&Ji(Tn(Ve,l.getKey()),l)}else{const o=r.getTextContent();if(pe(r)){const a=r.decorate(Ve,Cn);a!==null&&ld(n,a)}Me+=o,Vt+=o}if(!xs&&$e(r)&&r.__cachedText!==Vt){const o=r.getWritable();o.__cachedText=Vt,r=o}return i}function ld(n,e){let t=Ve._pendingDecorators;const r=Ve._decorators;if(t===null){if(r[n]===e)return;t=ef(Ve)}t[n]=e}function mi(n){let e=n.nextSibling;return e!==null&&e===Ve._blockCursorElement&&(e=e.nextSibling),e}function Em(n,e,t,r,s,i){Me="",Vt="",Wn=r===2,Ve=t,Cn=t._config,kr=t._nodes,Ws=Ve._listeners.mutation,Wi=s,Vi=i,En=n._nodeMap,_t=e._nodeMap,xs=e._readOnly,Hi=new Map(t._keyToDOMMap);const o=new Map;return Nr=o,yr("root",null),Ve=void 0,kr=void 0,Wi=void 0,Vi=void 0,En=void 0,_t=void 0,Cn=void 0,Hi=void 0,Nr=void 0,o}function Yi(n){const e=Hi.get(n);return e===void 0&&F(75,n),e}function X(n){return{type:n}}const ud=X("SELECTION_CHANGE_COMMAND"),Tm=X("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Uo=X("CLICK_COMMAND"),cd=X("BEFORE_INPUT_COMMAND"),dd=X("INPUT_COMMAND"),fd=X("COMPOSITION_START_COMMAND"),gd=X("COMPOSITION_END_COMMAND"),mn=X("DELETE_CHARACTER_COMMAND"),Gn=X("INSERT_LINE_BREAK_COMMAND"),Ar=X("INSERT_PARAGRAPH_COMMAND"),Yn=X("CONTROLLED_TEXT_INSERTION_COMMAND"),Vs=X("PASTE_COMMAND"),Zi=X("REMOVE_TEXT_COMMAND"),Pr=X("DELETE_WORD_COMMAND"),Ir=X("DELETE_LINE_COMMAND"),en=X("FORMAT_TEXT_COMMAND"),hd=X("UNDO_COMMAND"),pd=X("REDO_COMMAND"),md=X("KEYDOWN_COMMAND"),yd=X("KEY_ARROW_RIGHT_COMMAND"),wm=X("MOVE_TO_END"),Ko=X("KEY_ARROW_LEFT_COMMAND"),km=X("MOVE_TO_START"),Wo=X("KEY_ARROW_UP_COMMAND"),Vo=X("KEY_ARROW_DOWN_COMMAND"),Es=X("KEY_ENTER_COMMAND"),Ho=X("KEY_SPACE_COMMAND"),_d=X("KEY_BACKSPACE_COMMAND"),qo=X("KEY_ESCAPE_COMMAND"),vd=X("KEY_DELETE_COMMAND"),Jo=X("KEY_TAB_COMMAND"),xd=X("INSERT_TAB_COMMAND"),Xi=X("INDENT_CONTENT_COMMAND"),Qi=X("OUTDENT_CONTENT_COMMAND"),bd=X("DROP_COMMAND"),Nm=X("FORMAT_ELEMENT_COMMAND"),Sd=X("DRAGSTART_COMMAND"),Cd=X("DRAGOVER_COMMAND"),Am=X("DRAGEND_COMMAND"),Hs=X("COPY_COMMAND"),Go=X("CUT_COMMAND"),eo=X("SELECT_ALL_COMMAND"),Pm=X("FOCUS_COMMAND"),Im=X("BLUR_COMMAND"),Rm=X("KEY_MODIFIER_COMMAND"),zt=Object.freeze({}),to=[["keydown",function(n,e){Rr=n.timeStamp,Ed=n.key,!e.isComposing()&&K(e,md,n)}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;Fn(t)&&r!=="touch"&&r!=="pen"&&n.button===0&&It(e,()=>{Gd(t)||(so=!0)})}],["compositionstart",function(n,e){K(e,fd,n)}],["compositionend",function(n,e){xn?_r=!0:or||!Mr&&!$r?K(e,gd,n):(io=!0,oo=n.data)}],["input",function(n,e){n.stopPropagation(),It(e,()=>{e.dispatchCommand(dd,n)},{event:n}),Vn=null}],["click",function(n,e){It(e,()=>{const t=D(),r=Ct(ht(e)),s=On();if(r){if(O(t)){const i=t.anchor,o=i.getNode();if(i.type==="element"&&i.offset===0&&t.isCollapsed()&&!$e(o)&&we().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&s!==null&&t.is(s))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()){const a=Qe(o,l=>A(l)&&!l.isInline());A(a)&&a.select(0)}}else if(n.pointerType==="touch"||n.pointerType==="pen"){const i=r.anchorNode;(ke(i)||Yt(i))&&Ue(Xo(s,r,e,n))}}K(e,Uo,n)})}],["cut",zt],["copy",zt],["dragstart",zt],["dragover",zt],["dragend",zt],["paste",zt],["focus",zt],["blur",zt],["drop",zt]];vs&&to.push(["beforeinput",(n,e)=>(function(t,r){const s=t.inputType;s==="deleteCompositionText"||xn&&of(r)||s!=="insertCompositionText"&&K(r,cd,t)})(n,e)]);let Rr=0,Ed=null,Td=0,Vn=null;const no=new WeakMap,Ts=new WeakMap;let ro=!1,so=!1,Sr=!1,_r=!1,io=!1,oo="",pn=null,wd=[0,"",0,"root",0];function kd(n,e,t,r,s){const i=n.anchor,o=n.focus,a=i.getNode(),l=ve(),c=Ct(ht(l)),u=c!==null?c.anchorNode:null,f=i.key,d=l.getElementByKey(f),h=t.length;return f!==o.key||!L(a)||(!s&&(!vs||Td<r+50)||a.isDirty()&&h<2||nf(t))&&i.offset!==o.offset&&!a.isComposing()||Wt(a)||a.isDirty()&&h>1||(s||!vs)&&d!==null&&!a.isComposing()&&u!==sr(d)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||a.getFormat()!==n.format||a.getStyle()!==n.style||(function(g,m){if(m.isSegmented())return!0;if(!g.isCollapsed())return!1;const y=g.anchor.offset,x=m.getParentOrThrow(),p=yn(m);return y===0?!m.canInsertTextBefore()||!x.canInsertTextBefore()&&!m.isComposing()||p||(function(_){const C=_.getPreviousSibling();return(L(C)||A(C)&&C.isInline())&&!C.canInsertTextAfter()})(m):y===m.getTextContentSize()&&(!m.canInsertTextAfter()||!x.canInsertTextAfter()&&!m.isComposing()||p)})(n,a)}function ul(n,e){return Yt(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function cl(n,e,t){const{anchorNode:r,anchorOffset:s,focusNode:i,focusOffset:o}=n;ro&&(ro=!1,ul(r,s)&&ul(i,o)&&!pn)||It(e,()=>{if(!t)return void Ue(null);if(!jr(e,r,i))return;let a=D();if(pn&&O(a)&&a.isCollapsed()){const l=a.anchor,c=pn.anchor;(l.key===c.key&&l.offset===c.offset+1||l.offset===1&&c.getNode().is(l.getNode().getPreviousSibling()))&&(a=pn.clone(),Ue(a))}if(pn=null,O(a)){const l=a.anchor,c=l.getNode();if(a.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(a.dirty=!0);const u=ht(e).event,f=u?u.timeStamp:performance.now(),[d,h,g,m,y]=wd,x=we(),p=e.isComposing()===!1&&x.getTextContent()==="";if(f<y+200&&l.offset===g&&l.key===m)cs(a,d,h);else if(l.type==="text")L(c)||F(141),Nd(a,c);else if(l.type==="element"&&!p){A(c)||F(259);const _=l.getNode();_.isEmpty()?(function(C,v){const b=v.getTextFormat(),S=v.getTextStyle();cs(C,b,S)})(a,_):cs(a,0,"")}}else{const u=l.key,f=a.focus.key,d=a.getNodes(),h=d.length,g=a.isBackward(),m=g?o:s,y=g?s:o,x=g?f:u,p=g?u:f;let _=2047,C=!1;for(let v=0;v<h;v++){const b=d[v],S=b.getTextContentSize();if(L(b)&&S!==0&&!(v===0&&b.__key===x&&m===S||v===h-1&&b.__key===p&&y===0)&&(C=!0,_&=b.getFormat(),_===0))break}a.format=C?_:0}}K(e,ud,void 0)})}function cs(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function Nd(n,e){cs(n,e.getFormat(),e.getStyle())}function Ad(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Om(n){const e=n.inputType,t=Ad(n),r=ve(),s=D();if(e==="deleteContentBackward"){if(s===null){const f=On();if(!O(f))return!0;Ue(f.clone())}if(O(s)){const f=s.anchor.key===s.focus.key;if(i=n.timeStamp,Ed==="MediaLast"&&i<Rr+30&&r.isComposing()&&f){if(ze(null),Rr=0,setTimeout(()=>{It(r,()=>{ze(null)})},30),O(s)){const d=s.anchor.getNode();d.markDirty(),L(d)||F(142),Nd(s,d)}}else{ze(null),n.preventDefault();const d=s.anchor.getNode(),h=d.getTextContent(),g=d.canInsertTextAfter(),m=s.anchor.offset===0&&s.focus.offset===h.length;let y=Za&&f&&!m&&g;if(y&&s.isCollapsed()&&(y=!pe(co(s.anchor,!0))),!y){K(r,mn,!0);const x=D();Za&&O(x)&&x.isCollapsed()&&(pn=x,setTimeout(()=>pn=null))}}return!0}}var i;if(!O(s))return!0;const o=n.data;Vn!==null&&la(!1,r,Vn),s.dirty&&Vn===null||!s.isCollapsed()||$e(s.anchor.getNode())||t===null||s.applyDOMRange(t),Vn=null;const a=s.anchor,l=s.focus,c=a.getNode(),u=l.getNode();if(e==="insertText"||e==="insertTranspose"){if(o===`
4
4
  `)n.preventDefault(),K(r,Gn,!1);else if(o===sn)n.preventDefault(),K(r,Ar,void 0);else if(o==null&&n.dataTransfer){const f=n.dataTransfer.getData("text/plain");n.preventDefault(),s.insertRawText(f)}else o!=null&&kd(s,t,o,n.timeStamp,!0)?(n.preventDefault(),K(r,Yn,o)):Vn=o;return Td=n.timeStamp,!0}switch(n.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":K(r,Yn,n);break;case"insertFromComposition":ze(null),K(r,Yn,n);break;case"insertLineBreak":ze(null),K(r,Gn,!1);break;case"insertParagraph":ze(null),Sr&&!or?(Sr=!1,K(r,Gn,!1)):K(r,Ar,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":K(r,Vs,n);break;case"deleteByComposition":(function(f,d){return f!==d||A(f)||A(d)||!yn(f)||!yn(d)})(c,u)&&K(r,Zi,n);break;case"deleteByDrag":case"deleteByCut":K(r,Zi,n);break;case"deleteContent":K(r,mn,!1);break;case"deleteWordBackward":K(r,Pr,!0);break;case"deleteWordForward":K(r,Pr,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":K(r,Ir,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":K(r,Ir,!1);break;case"formatStrikeThrough":K(r,en,"strikethrough");break;case"formatBold":K(r,en,"bold");break;case"formatItalic":K(r,en,"italic");break;case"formatUnderline":K(r,en,"underline");break;case"historyUndo":K(r,hd,void 0);break;case"historyRedo":K(r,pd,void 0)}return!0}function Fm(n){if(ke(n.target)&&Gd(n.target))return!0;const e=ve(),t=D(),r=n.data,s=Ad(n);if(r!=null&&O(t)&&kd(t,s,r,n.timeStamp,!1)){_r&&(ws(e,r),_r=!1);const i=t.anchor.getNode(),o=Ct(ht(e));if(o===null)return!0;const a=t.isBackward(),l=a?t.anchor.offset:t.focus.offset,c=a?t.focus.offset:t.anchor.offset;vs&&!t.isCollapsed()&&L(i)&&o.anchorNode!==null&&i.getTextContent().slice(0,l)+r+i.getTextContent().slice(l+c)===sf(o.anchorNode)||K(e,Yn,r);const u=r.length;xn&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),Mr||or||$r||!e.isComposing()||(Rr=0,ze(null))}else la(!1,e,r!==null?r:void 0),_r&&(ws(e,r||void 0),_r=!1);return(function(){De();const i=ve();Qc(i)})(),!0}function Mm(n){const e=ve(),t=D();if(O(t)&&!e.isComposing()){const r=t.anchor,s=t.anchor.getNode();ze(r.key),(n.timeStamp<Rr+30||r.type==="element"||!t.isCollapsed()||s.getFormat()!==t.format||L(s)&&s.getStyle()!==t.style)&&K(e,Yn,lm)}return!0}function $m(n){return ws(ve(),n.data),!0}function ws(n,e){const t=n._compositionKey;if(ze(null),t!==null&&e!=null){if(e===""){const r=Ie(t),s=sr(n.getElementByKey(t));return void(s!==null&&s.nodeValue!==null&&L(r)&&ua(r,s.nodeValue,null,null,!0))}if(e[e.length-1]===`
@@ -27,4 +27,4 @@ import{X as hg,r as w,j as k,y as wr,l as pg,a as qe,e as mg,I as Gu,Y as Ia,t a
27
27
  `);let c=!1;const u=[];for(let f=0;f<l.length;f++){const d=l[f].trimEnd(),h=u[u.length-1];Lv.test(d)?u.push(d):og.test(d)||Ro.test(d)?(c=!c,u.push(d)):c||d===""||h===""||!h||Io.test(h)||Io.test(d)||ig.test(d)||rg.test(d)||sg.test(d)||$v.test(d)||Dv.test(d)||Bv.test(d)||!a||Bu.test(d)||ju.test(d)||zu(ju).test(h)||zu(Bu).test(h)||Ro.test(h)?u.push(d):u[u.length-1]=h+" "+d.trimStart()}return u.join(`
28
28
  `)})(n,s);return Rv(e,r)(i,t)}function ox(n=Wr,e,t=!1){return(function(s,i=!1){const o=wa(s),a=[...o.multilineElement,...o.element],l=!i,c=o.textFormat.filter(u=>u.format.length===1).sort((u,f)=>Number(u.format.includes("code"))-Number(f.format.includes("code")));return u=>{const f=[],d=(u||we()).getChildren();for(let h=0;h<d.length;h++){const g=d[h],m=Pv(g,a,c,o.textMatch);m!=null&&f.push(l&&h>0&&!Po(g)&&!Po(d[h-1])?`
29
29
  `.concat(m):m)}return f.join(`
30
- `)}})(n,t)(e)}function Ku(n,e){return n.getEditorState().read(()=>{const t=Ie(e);return t!==null&&t.isSelected()})}function ax(n){const[e]=Je(),[t,r]=w.useState(()=>Ku(e,n));return w.useEffect(()=>{let s=!0;const i=e.registerUpdateListener(()=>{s&&r(Ku(e,n))});return()=>{s=!1,i()}},[e,n]),[t,w.useCallback(s=>{e.update(()=>{let i=D();Oe(i)||(i=Zo(),Ue(i)),Oe(i)&&(s?i.add(n):i.delete(n))})},[e,n]),w.useCallback(()=>{e.update(()=>{const s=D();Oe(s)&&s.clear()})},[e])]}function lx({nodeKey:n}){const[e]=Je(),[t,r,s]=ax(n);return w.useEffect(()=>gt(e.registerCommand(Uo,i=>{const o=e.getElementByKey(n);return i.target===o&&(i.shiftKey||s(),r(!t),!0)},Xe)),[s,e,t,n,r]),w.useEffect(()=>{const i=e.getElementByKey(n),o=e._config.theme.hrSelected??"selected";i!==null&&(t?xt(i,o):ii(i,o))},[e,t,n]),null}class Vr extends Kr{static getType(){return"horizontalrule"}static clone(e){return new Vr(e.__key)}static importJSON(e){return ui().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:ux,priority:0})}}decorate(){return k.jsx(lx,{nodeKey:this.__key})}}function ux(){return{node:ui()}}function ui(){return pt(new Vr)}const cx=[{dependencies:[Vr],export:n=>l_(n)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const s=ui();r||n.getNextSibling()!=null?n.replace(s):n.insertBefore(s),s.selectNext()},type:"element"},...Wr];function dx({transformers:n=cx}){const[e]=Je();return w.useEffect(()=>sx(e,n),[e,n]),null}function fx({hasStrictIndent:n=!1}){const[e]=Je();return w.useEffect(()=>{if(!e.hasNodes([Ln,ln]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[e]),w.useEffect(()=>{if(n)return av(e)},[e,n]),(function(t){w.useEffect(()=>ov(t),[t])})(e),null}var gx="uf0wxx0",hx="uf0wxx1",px="uf0wxx2";function mx(n,e,t){w.useEffect(()=>{n.hasNodes([fr])||(function(r,...s){const i=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const a of s)o.append("v",a);throw i.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${i.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(77)}),w.useEffect(()=>Nv(n,{changeHandlers:t?[t]:[],matchers:e}),[n,e,t])}function yx({matchers:n,onChange:e}){const[t]=Je();return mx(t,n,e),null}function _x(){const[n]=Je();return w.useEffect(()=>tv(n),[n]),null}function vx({newTab:n=!0,disabled:e=!1}){const[t]=Je();return w.useEffect(()=>Sv(t,Pf({disabled:e,newTab:n})),[t,n,e]),null}function xx(){const[n]=Je();return w.useEffect(()=>n.registerCommand(o_,e=>{const t=D();if(!O(t))return!1;if(t.focus.getNode()!==null){const r=ui();Vy(r)}return!0},ge),[n]),null}function bx({validateUrl:n,attributes:e}){const[t]=Je();return w.useEffect(()=>{if(!t.hasNodes([un]))throw new Error("LinkPlugin: LinkNode not registered on editor")}),w.useEffect(()=>bv(t,Pf({attributes:e,validateUrl:n})),[t,n,e]),null}function Sx({maxIndent:n}){const[e]=Je();return w.useEffect(()=>u_(e,n),[e,n]),null}const Cx=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function Ex({ignoreHistoryMergeTagChange:n=!0,ignoreSelectionChange:e=!1,onChange:t}){const[r]=Je();return Cx(()=>{if(t)return r.registerUpdateListener(({editorState:s,dirtyElements:i,dirtyLeaves:o,prevEditorState:a,tags:l})=>{e&&i.size===0&&o.size===0||n&&l.has(Xn)||a.isEmpty()||t(s,r,l)})},[r,n,e,t]),null}const Tx=new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/);function wx(n){return n==="https://"||Tx.test(n)}function kx(n){const e=qe.c(4),{hasLinkAttributes:t}=n,r=t===void 0?!1:t;let s;e[0]!==r?(s=r?{rel:"noopener noreferrer",target:"_blank"}:void 0,e[0]=r,e[1]=s):s=e[1];let i;return e[2]!==s?(i=k.jsx(bx,{validateUrl:wx,attributes:s}),e[2]=s,e[3]=i):i=e[3],i}const Nx=new RegExp("((https?:\\/\\/(www\\.)?)|(www\\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)(?<![-.+():%])"),Ax=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,Px=[$u(Nx,n=>n.startsWith("http")?n:`https://${n}`),$u(Ax,n=>`mailto:${n}`)];function Ix(){const n=qe.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=k.jsx(yx,{matchers:Px}),n[0]=e):e=n[0],e}const Rx={...Na,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/},Aa=Wr.map(n=>n===Na?Rx:n),Ox={paragraph:"editor-paragraph",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5",h6:"editor-heading-h6"},text:{bold:"editor-text-bold",italic:"editor-text-italic",underline:"editor-text-underline",strikethrough:"editor-text-strikethrough",code:"editor-text-code"},list:{ul:"editor-list-ul",ol:"editor-list-ol",listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"}},quote:"editor-quote",code:"editor-code",codeHighlight:{},link:"editor-link",horizontalRule:"editor-hr"},Fx=[ai,oi,Ln,ln,li,Ta,un,fr,Vr];function Mx(n){const e=qe.c(2),{text:t}=n;let r;return e[0]!==t?(r=k.jsx("div",{className:px,children:t}),e[0]=t,e[1]=r):r=e[1],r}function $x(n){const e=qe.c(4),{value:t}=n,[r]=Je();let s;e[0]!==r||e[1]!==t?(s=()=>{t!==void 0&&r.update(()=>{ix(t,Aa)})},e[0]=r,e[1]=t,e[2]=s):s=e[2];let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[3]=i):i=e[3],w.useEffect(s,i),null}function Lx(n){const e=qe.c(4),{onChange:t}=n;let r;e[0]!==t?(r=o=>{t&&o.read(()=>{const a=ox(Aa);t(a)})},e[0]=t,e[1]=r):r=e[1];const s=r;let i;return e[2]!==s?(i=k.jsx(Ex,{onChange:s}),e[2]=s,e[3]=i):i=e[3],i}function Dx(n){const e=qe.c(20),{placeholder:t,value:r,onChange:s}=n,i=t===void 0?"Write your content here...":t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={namespace:"MarkdownEditor",theme:Ox,nodes:Fx,onError:Bx},e[0]=o):o=e[0];const a=o;let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=k.jsx(j_,{className:hx}),e[1]=l):l=e[1];let c;e[2]!==i?(c=k.jsx($_,{contentEditable:l,placeholder:k.jsx(Mx,{text:i}),ErrorBoundary:H_}),e[2]=i,e[3]=c):c=e[3];let u,f,d,h,g,m,y,x;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=k.jsx(dx,{transformers:Aa}),g=k.jsx(fx,{}),m=k.jsx(_x,{}),y=k.jsx(Sx,{}),x=k.jsx(vx,{}),u=k.jsx(xx,{}),f=k.jsx(kx,{}),d=k.jsx(Ix,{}),e[4]=u,e[5]=f,e[6]=d,e[7]=h,e[8]=g,e[9]=m,e[10]=y,e[11]=x):(u=e[4],f=e[5],d=e[6],h=e[7],g=e[8],m=e[9],y=e[10],x=e[11]);let p;e[12]!==r?(p=k.jsx($x,{value:r}),e[12]=r,e[13]=p):p=e[13];let _;e[14]!==s?(_=k.jsx(Lx,{onChange:s}),e[14]=s,e[15]=_):_=e[15];let C;return e[16]!==p||e[17]!==_||e[18]!==c?(C=k.jsx("div",{className:gx,children:k.jsxs(Oy,{initialConfig:a,children:[c,h,g,m,y,x,u,f,d,p,_]})}),e[16]=p,e[17]=_,e[18]=c,e[19]=C):C=e[19],C}function Bx(n){console.error("Lexical error:",n)}const jx=n=>{const e=qe.c(4);let t,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=k.jsx("title",{children:"Markdown"}),r=k.jsx("path",{fill:"currentColor",d:"M22.27 19.385H1.73A1.73 1.73 0 010 17.655V6.345a1.73 1.73 0 011.73-1.73h20.54A1.73 1.73 0 0124 6.345v11.308a1.73 1.73 0 01-1.73 1.731zM5.769 15.923v-4.5l2.308 2.885 2.307-2.885v4.5h2.308V8.078h-2.308l-2.307 2.885-2.308-2.885H3.46v7.847zM21.232 12h-2.309V8.077h-2.307V12h-2.308l3.461 4.039z"}),e[0]=t,e[1]=r):(t=e[0],r=e[1]);let s;return e[2]!==n?(s=k.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...n,children:[t,r]}),e[2]=n,e[3]=s):s=e[3],s},zx=n=>{const e=qe.c(7),t=!!(n&&n.length>0);let r,s;e[0]!==n?(r=["provider-models",n],s=async()=>{if(!n)return[];const a=await(await Fo.v1.providers[":providerId"].models.$get({param:{providerId:n}})).json();return"data"in a&&a.data?a.data:[]},e[0]=n,e[1]=r,e[2]=s):(r=e[1],s=e[2]);let i;return e[3]!==t||e[4]!==r||e[5]!==s?(i={queryKey:r,queryFn:s,enabled:t,staleTime:3e5},e[3]=t,e[4]=r,e[5]=s,e[6]=i):i=e[6],yg(i)};var Ux="_1nagll30",cg="_1nagll31",Wu="_1nagll32",Kx="_1nagll33",Wx="_1nagll34",Li="_1nagll35",Di="_1nagll36",Vx="_1nagll37",Hx="_1nagll38",qx="_1nagll39",Jx="_1nagll3d",dg="_1nagll3e",Vu="_1nagll3f",Hu="_1nagll3g",Gx="_1nagll3h",Yx="_1nagll3i",Bi="_1nagll3k",qu="_1nagll3l",Zx="_1nagll3o",Xx="_1nagll3p",Qx="_1nagll3q",Pa="_1nagll3r";const Ju=window.bootstrapData?.llmProviders?.map(n=>({label:n.name,icon:n.imageURI,value:n.key}));function eb(n){const e=qe.c(2),{className:t}=n;let r;return e[0]!==t?(r=k.jsx(Cc,{className:t}),e[0]=t,e[1]=r):r=e[1],r}function tb(n,e){const t=n.split("/");return t.length>1&&t[0].length>0?t[0].charAt(0).toUpperCase()+t[0].slice(1):"Other"}function fg(n){const e=n.split("/");return e.length>1&&e[0].length>0?e[0]:null}function Oo(n){return`https://models.dev/logos/${n}.svg`}function nb(n){const e=qe.c(47),{models:t,isLoading:r,selectedModelName:s,onSelect:i}=n;let o,a,l,c,u,f,d,h,g,m,y,x,p,_;if(e[0]!==r||e[1]!==t||e[2]!==i||e[3]!==s){const T=t?.reduce(rb,{}),E=T?Object.keys(T).sort():[];let N;e[18]!==t||e[19]!==s?(N=t?.find(j=>j.id===s),e[18]=t,e[19]=s,e[20]=N):N=e[20];const $=N?.name||s||"Select a model";c=$c,_=!1;let R;e[21]!==$?(R=k.jsx("span",{className:Bi,children:$}),e[21]=$,e[22]=R):R=e[22];let I;e[23]===Symbol.for("react.memo_cache_sentinel")?(I=k.jsx(Cc,{className:qu}),e[23]=I):I=e[23],e[24]!==R?(f=k.jsxs(ip,{className:dg,children:[R,I]}),e[24]=R,e[25]=f):f=e[25],l=Ba,a=ja,h=Vu,g="bottom",m=4,y="start",x="fixed",p=!0,o=Da,u=Hu,d=r?k.jsx("div",{className:Xx,children:"Loading models..."}):E.length===0?k.jsx("div",{className:Zx,children:"No models available"}):E.map(j=>{const B=T?.[j],M=B?.providerId,U=B?.models;return k.jsxs(tp,{children:[k.jsxs(lp,{className:Yx,openOnHover:!0,delay:100,children:[M&&k.jsx("img",{src:Oo(M),alt:"",className:Pa}),k.jsx("span",{className:Bi,children:j}),k.jsx(wh,{className:qu})]}),k.jsx(Ba,{children:k.jsx(ja,{className:Vu,side:"right",sideOffset:4,align:"start",positionMethod:"fixed",sticky:!0,children:k.jsx(Da,{className:Hu,children:U?.map(z=>{const Z=s===z.id;return k.jsxs(Gh,{className:Gx,onClick:()=>i(z.id),children:[k.jsx("span",{className:Bi,children:z.name.split(":")[1]||z.id}),Z&&k.jsx(Sc,{className:Qx})]},z.id)})})})})]},j)}),e[0]=r,e[1]=t,e[2]=i,e[3]=s,e[4]=o,e[5]=a,e[6]=l,e[7]=c,e[8]=u,e[9]=f,e[10]=d,e[11]=h,e[12]=g,e[13]=m,e[14]=y,e[15]=x,e[16]=p,e[17]=_}else o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],g=e[12],m=e[13],y=e[14],x=e[15],p=e[16],_=e[17];let C;e[26]!==o||e[27]!==u||e[28]!==d?(C=k.jsx(o,{className:u,children:d}),e[26]=o,e[27]=u,e[28]=d,e[29]=C):C=e[29];let v;e[30]!==a||e[31]!==C||e[32]!==h||e[33]!==g||e[34]!==m||e[35]!==y||e[36]!==x||e[37]!==p?(v=k.jsx(a,{className:h,side:g,sideOffset:m,align:y,positionMethod:x,sticky:p,children:C}),e[30]=a,e[31]=C,e[32]=h,e[33]=g,e[34]=m,e[35]=y,e[36]=x,e[37]=p,e[38]=v):v=e[38];let b;e[39]!==l||e[40]!==v?(b=k.jsx(l,{children:v}),e[39]=l,e[40]=v,e[41]=b):b=e[41];let S;return e[42]!==c||e[43]!==f||e[44]!==b||e[45]!==_?(S=k.jsxs(c,{modal:_,children:[f,b]}),e[42]=c,e[43]=f,e[44]=b,e[45]=_,e[46]=S):S=e[46],S}function rb(n,e){const t=tb(e.id),r=fg(e.id);return n[t]||(n[t]={models:[],providerId:r}),n[t].models.push(e),n}function sb(n){const e=qe.c(76),{value:t,onChange:r}=n,{data:s,isLoading:i}=zx(t.provider);let o;e[0]!==t.provider?(o=Ju?.find(V=>V.value===t.provider)||null,e[0]=t.provider,e[1]=o):o=e[1];const a=o,l=t.modelName?t.modelName:(t.provider,"Select model");let c;e[2]!==r||e[3]!==t?(c=V=>{V&&r({...t,provider:V.value,modelName:""})},e[2]=r,e[3]=t,e[4]=c):c=e[4];const u=c;let f;e[5]!==r||e[6]!==t?(f=V=>{r({...t,modelName:V})},e[5]=r,e[6]=t,e[7]=f):f=e[7];const d=f;let h;e[8]!==r||e[9]!==t?(h=(V,ce)=>{r({...t,[V]:ce})},e[8]=r,e[9]=t,e[10]=h):h=e[10];const g=h;let m;if(e[11]!==t.modelName||e[12]!==t.provider){const V=fg(t.modelName);m=V?Oo(V):t.provider?Oo(t.provider):null,e[11]=t.modelName,e[12]=t.provider,e[13]=m}else m=e[13];const y=m;let x;e[14]!==y?(x=y?k.jsx("img",{src:y,alt:"",className:Pa}):k.jsx("span",{className:cg,children:"?"}),e[14]=y,e[15]=x):x=e[15];const p=t.modelName?Wu:`${Wu} ${Kx}`;let _;e[16]!==l||e[17]!==p?(_=k.jsx("span",{className:p,children:l}),e[16]=l,e[17]=p,e[18]=_):_=e[18];let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=k.jsx(eb,{className:Jx}),e[19]=C):C=e[19];let v;e[20]!==x||e[21]!==_?(v=k.jsxs(ec,{className:Ux,children:[x,_,C]}),e[20]=x,e[21]=_,e[22]=v):v=e[22];let b;e[23]===Symbol.for("react.memo_cache_sentinel")?(b=k.jsx("span",{className:Di,children:"Provider"}),e[23]=b):b=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=Ju||[],e[24]=S):S=e[24];let T;e[25]!==u||e[26]!==a?(T=k.jsxs("div",{className:Li,children:[b,k.jsx(Mo,{items:S,value:a,onValueChange:u,itemToString:cb,itemToIcon:ub,placeholder:"Select provider"})]}),e[25]=u,e[26]=a,e[27]=T):T=e[27];let E;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=k.jsx("span",{className:Di,children:"Model"}),e[28]=E):E=e[28];let N;e[29]!==d||e[30]!==i||e[31]!==s||e[32]!==t.modelName||e[33]!==t.provider?(N=k.jsxs("div",{className:Li,children:[E,t.provider?k.jsx(nb,{models:s,isLoading:i,selectedModelName:t.modelName,onSelect:d}):k.jsx("div",{className:dg,style:{color:"var(--gray9)"},children:"Select a provider first"})]}),e[29]=d,e[30]=i,e[31]=s,e[32]=t.modelName,e[33]=t.provider,e[34]=N):N=e[34];let P;e[35]===Symbol.for("react.memo_cache_sentinel")?(P=k.jsx("span",{className:Di,children:"Parameters"}),e[35]=P):P=e[35];const $=t.temperature??1;let R;e[36]!==g?(R=V=>g("temperature",V),e[36]=g,e[37]=R):R=e[37];let I;e[38]!==$||e[39]!==R?(I=k.jsx(Zr,{label:"Temperature",value:$,min:0,max:2,step:.1,onValueChange:R,formatValue:lb}),e[38]=$,e[39]=R,e[40]=I):I=e[40];let j;e[41]===Symbol.for("react.memo_cache_sentinel")?(j=k.jsx("label",{className:qx,children:"Max Tokens"}),e[41]=j):j=e[41];const B=t.maxTokens??"";let M;e[42]!==r||e[43]!==t?(M=V=>{const ce=V.target.value?parseInt(V.target.value,10):void 0;r({...t,maxTokens:ce})},e[42]=r,e[43]=t,e[44]=M):M=e[44];let U;e[45]!==B||e[46]!==M?(U=k.jsxs("div",{className:Hx,children:[j,k.jsx("input",{type:"number",className:Qu,value:B,placeholder:"Default",min:1,onChange:M})]}),e[45]=B,e[46]=M,e[47]=U):U=e[47];const z=t.topP??1;let Z;e[48]!==g?(Z=V=>g("topP",V),e[48]=g,e[49]=Z):Z=e[49];let ne;e[50]!==z||e[51]!==Z?(ne=k.jsx(Zr,{label:"Top P",value:z,min:0,max:1,step:.05,onValueChange:Z,formatValue:ab}),e[50]=z,e[51]=Z,e[52]=ne):ne=e[52];const J=t.frequencyPenalty??0;let q;e[53]!==g?(q=V=>g("frequencyPenalty",V),e[53]=g,e[54]=q):q=e[54];let H;e[55]!==J||e[56]!==q?(H=k.jsx(Zr,{label:"Frequency Penalty",value:J,min:-2,max:2,step:.1,onValueChange:q,formatValue:ob}),e[55]=J,e[56]=q,e[57]=H):H=e[57];const ae=t.presencePenalty??0;let re;e[58]!==g?(re=V=>g("presencePenalty",V),e[58]=g,e[59]=re):re=e[59];let le;e[60]!==ae||e[61]!==re?(le=k.jsx(Zr,{label:"Presence Penalty",value:ae,min:-2,max:2,step:.1,onValueChange:re,formatValue:ib}),e[60]=ae,e[61]=re,e[62]=le):le=e[62];let Q;e[63]!==I||e[64]!==U||e[65]!==ne||e[66]!==H||e[67]!==le?(Q=k.jsxs("div",{className:Li,children:[P,k.jsxs("div",{className:Vx,children:[I,U,ne,H,le]})]}),e[63]=I,e[64]=U,e[65]=ne,e[66]=H,e[67]=le,e[68]=Q):Q=e[68];let te;e[69]!==T||e[70]!==N||e[71]!==Q?(te=k.jsx(tc,{side:"bottom",align:"start",sideOffset:4,positionMethod:"fixed",children:k.jsxs("div",{className:Wx,children:[T,N,Q]})}),e[69]=T,e[70]=N,e[71]=Q,e[72]=te):te=e[72];let ie;return e[73]!==v||e[74]!==te?(ie=k.jsxs(nc,{children:[v,te]}),e[73]=v,e[74]=te,e[75]=ie):ie=e[75],ie}function ib(n){return n.toFixed(1)}function ob(n){return n.toFixed(1)}function ab(n){return n.toFixed(2)}function lb(n){return n.toFixed(1)}function ub(n){return n?.icon?k.jsx("img",{src:n.icon,alt:"",className:Pa}):k.jsx("span",{className:cg,children:n?.label?.charAt(0).toUpperCase()||"?"})}function cb(n){return n?.label||""}const db=n=>{const e=qe.c(48),{form:t,editorKey:r}=n,{setValue:s,control:i}=t;let o;e[0]!==t.control?(o={control:t.control,name:"provider"},e[0]=t.control,e[1]=o):o=e[1];const a=Zt(o);let l;e[2]!==i?(l={control:i,name:"modelName"},e[2]=i,e[3]=l):l=e[3];const c=Zt(l);let u;e[4]!==i?(u={control:i,name:"system_prompt"},e[4]=i,e[5]=u):u=e[5];const f=Zt(u);let d;e[6]!==i?(d={control:i,name:"temperature"},e[6]=i,e[7]=d):d=e[7];const h=Zt(d);let g;e[8]!==i?(g={control:i,name:"maxTokens"},e[8]=i,e[9]=g):g=e[9];const m=Zt(g);let y;e[10]!==i?(y={control:i,name:"topP"},e[10]=i,e[11]=y):y=e[11];const x=Zt(y);let p;e[12]!==i?(p={control:i,name:"frequencyPenalty"},e[12]=i,e[13]=p):p=e[13];const _=Zt(p);let C;e[14]!==i?(C={control:i,name:"presencePenalty"},e[14]=i,e[15]=C):C=e[15];const v=Zt(C),b=a||"",S=c||"";let T;e[16]!==_||e[17]!==m||e[18]!==v||e[19]!==S||e[20]!==b||e[21]!==h||e[22]!==x?(T={provider:b,modelName:S,temperature:h,maxTokens:m,topP:x,frequencyPenalty:_,presencePenalty:v},e[16]=_,e[17]=m,e[18]=v,e[19]=S,e[20]=b,e[21]=h,e[22]=x,e[23]=T):T=e[23];const E=T;let N;e[24]!==_||e[25]!==m||e[26]!==v||e[27]!==c||e[28]!==a||e[29]!==s||e[30]!==h||e[31]!==x?(N=z=>{z.provider!==a&&s("provider",z.provider,{shouldValidate:!0,shouldDirty:!0}),z.modelName!==c&&s("modelName",z.modelName,{shouldValidate:!0,shouldDirty:!0}),z.temperature!==h&&s("temperature",z.temperature,{shouldValidate:!0,shouldDirty:!0}),z.maxTokens!==m&&s("maxTokens",z.maxTokens,{shouldValidate:!0,shouldDirty:!0}),z.topP!==x&&s("topP",z.topP,{shouldValidate:!0,shouldDirty:!0}),z.frequencyPenalty!==_&&s("frequencyPenalty",z.frequencyPenalty,{shouldValidate:!0,shouldDirty:!0}),z.presencePenalty!==v&&s("presencePenalty",z.presencePenalty,{shouldValidate:!0,shouldDirty:!0})},e[24]=_,e[25]=m,e[26]=v,e[27]=c,e[28]=a,e[29]=s,e[30]=h,e[31]=x,e[32]=N):N=e[32];const P=N;let $;e[33]===Symbol.for("react.memo_cache_sentinel")?($=k.jsxs("div",{className:Ra,children:[k.jsx(Gu,{icon:Ap,size:"xs"}),k.jsx("span",{children:"Model"})]}),e[33]=$):$=e[33];let R;e[34]!==P||e[35]!==E?(R=k.jsxs("div",{className:Ag,children:[$,k.jsx("div",{className:Pg,children:k.jsx(sb,{value:E,onChange:P})})]}),e[34]=P,e[35]=E,e[36]=R):R=e[36];let I;e[37]===Symbol.for("react.memo_cache_sentinel")?(I=k.jsx("span",{children:"System"}),e[37]=I):I=e[37];let j;e[38]===Symbol.for("react.memo_cache_sentinel")?(j=k.jsxs("div",{className:Ra,children:[I,k.jsxs("div",{className:Ig,children:[k.jsx(jx,{width:14,height:14}),k.jsx("span",{children:"Markdown Supported"})]})]}),e[38]=j):j=e[38];let B;e[39]!==s?(B=z=>s("system_prompt",z,{shouldValidate:!0,shouldDirty:!0}),e[39]=s,e[40]=B):B=e[40];let M;e[41]!==r||e[42]!==f||e[43]!==B?(M=k.jsxs("div",{className:Rg,children:[j,k.jsx(Dx,{value:f,onChange:B},r)]}),e[41]=r,e[42]=f,e[43]=B,e[44]=M):M=e[44];let U;return e[45]!==R||e[46]!==M?(U=k.jsxs("div",{className:Og,children:[R,M]}),e[45]=R,e[46]=M,e[47]=U):U=e[47],U},fb=["variants-list"],gb=()=>{const n=qe.c(2),e=Yu();let t;return n[0]!==e?(t={mutationFn:hb,onSuccess:(r,s)=>{e.invalidateQueries({queryKey:fb}),e.invalidateQueries({queryKey:zh(s.configId)})}},n[0]=e,n[1]=t):t=n[1],kc(t)};async function hb(n){const t=await(await Fo.v1.configs[":configId"].variants.$post({param:{configId:n.configId},json:{name:n.name,provider:n.provider,modelName:n.modelName,jsonData:n.jsonData}})).json();if("data"in t&&t.data)return t.data}const pb=()=>{const n=qe.c(2),e=Yu();let t;return n[0]!==e?(t={mutationFn:mb,onSuccess:(r,s)=>{e.invalidateQueries({queryKey:Fg(s.variantId)}),e.invalidateQueries({queryKey:["variant",s.variantId]})}},n[0]=e,n[1]=t):t=n[1],kc(t)};async function mb(n){const e=await Fo.v1.variants[":id"].versions.$post({param:{id:n.variantId},json:{provider:n.provider,modelName:n.modelName,jsonData:n.jsonData}}),t=await e.json();if(!e.ok||!("data"in t))throw new Error("message"in t?t.message:"Failed to create variant version");return t.data}function Vb(){const{id:n,variant:e}=_g.useParams(),t=vg(),r=gb(),s=pb(),i=Mg(),{data:o}=xg(e==="new"?"":e),{data:a}=Uh(n),{data:l}=$g(e==="new"?"":e),{data:c}=Kh(n),[u,f]=w.useState("new"),[d,h]=w.useState(null),g=e==="new",m=jg({defaultValues:{variant_name:"",provider:"",modelName:"",system_prompt:"",temperature:void 0,maxTokens:void 0,topP:void 0,frequencyPenalty:void 0,presencePenalty:void 0}}),y=m.formState.isDirty,x=r.isPending||s.isPending||i.isPending,p=l?[...l].sort((b,S)=>S.version-b.version):[];w.useEffect(()=>{if(l&&l.length>0&&!d){const b=a?.find(T=>T.variantId===e),S=c?.find(T=>b&&T.configVariantId===b.id&&T.variantVersionId);if(S?.variantVersionId)h(S.variantVersionId);else{const T=l.reduce((E,N)=>N.version>E.version?N:E);h(T.id)}}},[l,d,a,c,e]),Hh({shouldBlockFn:()=>x?!1:y?!confirm("You have unsaved changes. Are you sure you want to move away from the form?"):!1}),w.useEffect(()=>{if(o&&d&&l){const b=l.find(T=>T.id===d);if(!b)return;const S=typeof b.jsonData=="string"?JSON.parse(b.jsonData):b.jsonData;m.reset({variant_name:o.name||"",provider:b.provider||"",modelName:S?.model||b.modelName||"",system_prompt:S?.system_prompt||"",temperature:S?.temperature,maxTokens:S?.max_tokens,topP:S?.top_p,frequencyPenalty:S?.frequency_penalty,presencePenalty:S?.presence_penalty},{keepDirty:!1}),f(`${o.id}-${d}`)}},[o,d,l]);const _=b=>{const S={system_prompt:b.system_prompt,model:b.modelName};return b.temperature!==void 0&&(S.temperature=b.temperature),b.maxTokens!==void 0&&(S.max_tokens=b.maxTokens),b.topP!==void 0&&(S.top_p=b.topP),b.frequencyPenalty!==void 0&&(S.frequency_penalty=b.frequencyPenalty),b.presencePenalty!==void 0&&(S.presence_penalty=b.presencePenalty),S},C=b=>{if(!a||a.length===0)return b;const S=new Set(a.map(N=>N.name));if(!S.has(b))return b;let T=2,E=`${b} (${T})`;for(;S.has(E);)T++,E=`${b} (${T})`;return E},v=async b=>{const S=m.getValues();if(!(!S.variant_name.trim()||!S.provider||!S.modelName))try{const T=_(S);if(b.mode==="new_variant"||g){const E=b.mode==="new_variant"&&!g?C(S.variant_name):S.variant_name,N=await r.mutateAsync({configId:n,name:E,provider:S.provider,modelName:S.modelName,jsonData:T});b.deployToEnvironment&&b.environmentId&&N&&await i.mutateAsync({environmentId:b.environmentId,configId:n,configVariantId:N.configVariant.id,variantVersionId:N.version.id})}else{const E=await s.mutateAsync({variantId:e,provider:S.provider,modelName:S.modelName,jsonData:T});if(b.deployToEnvironment&&b.environmentId){const N=a?.find(P=>P.variantId===e);N&&E&&await i.mutateAsync({environmentId:b.environmentId,configId:n,configVariantId:N.id,variantVersionId:E.id})}}m.reset(),t({to:"/configs/$id/variants",params:{id:n}})}catch(T){console.error("Error saving variant:",T)}};return k.jsxs("div",{children:[k.jsxs("div",{className:Lg,children:[k.jsx("input",{title:"Variant Name","data-1p-ignore":!0,autoComplete:"off",placeholder:"Variant Name",className:Qu,...m.register("variant_name")}),k.jsxs("div",{className:Dg,children:[!g&&p.length>0&&k.jsx(Mo,{items:p,value:p.find(b=>b.id===d)??null,onValueChange:b=>{(b&&!y||b&&y&&confirm("You have unsaved changes. Switching versions will discard them. Continue?"))&&h(b.id)},placeholder:"Select version...",itemToString:b=>b?`Version ${b.version}`:""}),k.jsx(Jp,{isNewVariant:g,onSave:v,isSaving:x})]})]}),k.jsx("div",{className:Bg,children:k.jsx(db,{form:m,editorKey:u})})]})}export{Vb as component};
30
+ `)}})(n,t)(e)}function Ku(n,e){return n.getEditorState().read(()=>{const t=Ie(e);return t!==null&&t.isSelected()})}function ax(n){const[e]=Je(),[t,r]=w.useState(()=>Ku(e,n));return w.useEffect(()=>{let s=!0;const i=e.registerUpdateListener(()=>{s&&r(Ku(e,n))});return()=>{s=!1,i()}},[e,n]),[t,w.useCallback(s=>{e.update(()=>{let i=D();Oe(i)||(i=Zo(),Ue(i)),Oe(i)&&(s?i.add(n):i.delete(n))})},[e,n]),w.useCallback(()=>{e.update(()=>{const s=D();Oe(s)&&s.clear()})},[e])]}function lx({nodeKey:n}){const[e]=Je(),[t,r,s]=ax(n);return w.useEffect(()=>gt(e.registerCommand(Uo,i=>{const o=e.getElementByKey(n);return i.target===o&&(i.shiftKey||s(),r(!t),!0)},Xe)),[s,e,t,n,r]),w.useEffect(()=>{const i=e.getElementByKey(n),o=e._config.theme.hrSelected??"selected";i!==null&&(t?xt(i,o):ii(i,o))},[e,t,n]),null}class Vr extends Kr{static getType(){return"horizontalrule"}static clone(e){return new Vr(e.__key)}static importJSON(e){return ui().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:ux,priority:0})}}decorate(){return k.jsx(lx,{nodeKey:this.__key})}}function ux(){return{node:ui()}}function ui(){return pt(new Vr)}const cx=[{dependencies:[Vr],export:n=>l_(n)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const s=ui();r||n.getNextSibling()!=null?n.replace(s):n.insertBefore(s),s.selectNext()},type:"element"},...Wr];function dx({transformers:n=cx}){const[e]=Je();return w.useEffect(()=>sx(e,n),[e,n]),null}function fx({hasStrictIndent:n=!1}){const[e]=Je();return w.useEffect(()=>{if(!e.hasNodes([Ln,ln]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[e]),w.useEffect(()=>{if(n)return av(e)},[e,n]),(function(t){w.useEffect(()=>ov(t),[t])})(e),null}var gx="uf0wxx0",hx="uf0wxx1",px="uf0wxx2";function mx(n,e,t){w.useEffect(()=>{n.hasNodes([fr])||(function(r,...s){const i=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const a of s)o.append("v",a);throw i.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${i.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(77)}),w.useEffect(()=>Nv(n,{changeHandlers:t?[t]:[],matchers:e}),[n,e,t])}function yx({matchers:n,onChange:e}){const[t]=Je();return mx(t,n,e),null}function _x(){const[n]=Je();return w.useEffect(()=>tv(n),[n]),null}function vx({newTab:n=!0,disabled:e=!1}){const[t]=Je();return w.useEffect(()=>Sv(t,Pf({disabled:e,newTab:n})),[t,n,e]),null}function xx(){const[n]=Je();return w.useEffect(()=>n.registerCommand(o_,e=>{const t=D();if(!O(t))return!1;if(t.focus.getNode()!==null){const r=ui();Vy(r)}return!0},ge),[n]),null}function bx({validateUrl:n,attributes:e}){const[t]=Je();return w.useEffect(()=>{if(!t.hasNodes([un]))throw new Error("LinkPlugin: LinkNode not registered on editor")}),w.useEffect(()=>bv(t,Pf({attributes:e,validateUrl:n})),[t,n,e]),null}function Sx({maxIndent:n}){const[e]=Je();return w.useEffect(()=>u_(e,n),[e,n]),null}const Cx=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function Ex({ignoreHistoryMergeTagChange:n=!0,ignoreSelectionChange:e=!1,onChange:t}){const[r]=Je();return Cx(()=>{if(t)return r.registerUpdateListener(({editorState:s,dirtyElements:i,dirtyLeaves:o,prevEditorState:a,tags:l})=>{e&&i.size===0&&o.size===0||n&&l.has(Xn)||a.isEmpty()||t(s,r,l)})},[r,n,e,t]),null}const Tx=new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/);function wx(n){return n==="https://"||Tx.test(n)}function kx(n){const e=qe.c(4),{hasLinkAttributes:t}=n,r=t===void 0?!1:t;let s;e[0]!==r?(s=r?{rel:"noopener noreferrer",target:"_blank"}:void 0,e[0]=r,e[1]=s):s=e[1];let i;return e[2]!==s?(i=k.jsx(bx,{validateUrl:wx,attributes:s}),e[2]=s,e[3]=i):i=e[3],i}const Nx=new RegExp("((https?:\\/\\/(www\\.)?)|(www\\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)(?<![-.+():%])"),Ax=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,Px=[$u(Nx,n=>n.startsWith("http")?n:`https://${n}`),$u(Ax,n=>`mailto:${n}`)];function Ix(){const n=qe.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=k.jsx(yx,{matchers:Px}),n[0]=e):e=n[0],e}const Rx={...Na,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/},Aa=Wr.map(n=>n===Na?Rx:n),Ox={paragraph:"editor-paragraph",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5",h6:"editor-heading-h6"},text:{bold:"editor-text-bold",italic:"editor-text-italic",underline:"editor-text-underline",strikethrough:"editor-text-strikethrough",code:"editor-text-code"},list:{ul:"editor-list-ul",ol:"editor-list-ol",listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"}},quote:"editor-quote",code:"editor-code",codeHighlight:{},link:"editor-link",horizontalRule:"editor-hr"},Fx=[ai,oi,Ln,ln,li,Ta,un,fr,Vr];function Mx(n){const e=qe.c(2),{text:t}=n;let r;return e[0]!==t?(r=k.jsx("div",{className:px,children:t}),e[0]=t,e[1]=r):r=e[1],r}function $x(n){const e=qe.c(4),{value:t}=n,[r]=Je();let s;e[0]!==r||e[1]!==t?(s=()=>{t!==void 0&&r.update(()=>{ix(t,Aa)})},e[0]=r,e[1]=t,e[2]=s):s=e[2];let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[3]=i):i=e[3],w.useEffect(s,i),null}function Lx(n){const e=qe.c(4),{onChange:t}=n;let r;e[0]!==t?(r=o=>{t&&o.read(()=>{const a=ox(Aa);t(a)})},e[0]=t,e[1]=r):r=e[1];const s=r;let i;return e[2]!==s?(i=k.jsx(Ex,{onChange:s}),e[2]=s,e[3]=i):i=e[3],i}function Dx(n){const e=qe.c(20),{placeholder:t,value:r,onChange:s}=n,i=t===void 0?"Write your content here...":t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={namespace:"MarkdownEditor",theme:Ox,nodes:Fx,onError:Bx},e[0]=o):o=e[0];const a=o;let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=k.jsx(j_,{className:hx}),e[1]=l):l=e[1];let c;e[2]!==i?(c=k.jsx($_,{contentEditable:l,placeholder:k.jsx(Mx,{text:i}),ErrorBoundary:H_}),e[2]=i,e[3]=c):c=e[3];let u,f,d,h,g,m,y,x;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=k.jsx(dx,{transformers:Aa}),g=k.jsx(fx,{}),m=k.jsx(_x,{}),y=k.jsx(Sx,{}),x=k.jsx(vx,{}),u=k.jsx(xx,{}),f=k.jsx(kx,{}),d=k.jsx(Ix,{}),e[4]=u,e[5]=f,e[6]=d,e[7]=h,e[8]=g,e[9]=m,e[10]=y,e[11]=x):(u=e[4],f=e[5],d=e[6],h=e[7],g=e[8],m=e[9],y=e[10],x=e[11]);let p;e[12]!==r?(p=k.jsx($x,{value:r}),e[12]=r,e[13]=p):p=e[13];let _;e[14]!==s?(_=k.jsx(Lx,{onChange:s}),e[14]=s,e[15]=_):_=e[15];let C;return e[16]!==p||e[17]!==_||e[18]!==c?(C=k.jsx("div",{className:gx,children:k.jsxs(Oy,{initialConfig:a,children:[c,h,g,m,y,x,u,f,d,p,_]})}),e[16]=p,e[17]=_,e[18]=c,e[19]=C):C=e[19],C}function Bx(n){console.error("Lexical error:",n)}const jx=n=>{const e=qe.c(4);let t,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=k.jsx("title",{children:"Markdown"}),r=k.jsx("path",{fill:"currentColor",d:"M22.27 19.385H1.73A1.73 1.73 0 010 17.655V6.345a1.73 1.73 0 011.73-1.73h20.54A1.73 1.73 0 0124 6.345v11.308a1.73 1.73 0 01-1.73 1.731zM5.769 15.923v-4.5l2.308 2.885 2.307-2.885v4.5h2.308V8.078h-2.308l-2.307 2.885-2.308-2.885H3.46v7.847zM21.232 12h-2.309V8.077h-2.307V12h-2.308l3.461 4.039z"}),e[0]=t,e[1]=r):(t=e[0],r=e[1]);let s;return e[2]!==n?(s=k.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...n,children:[t,r]}),e[2]=n,e[3]=s):s=e[3],s},zx=n=>{const e=qe.c(7),t=!!(n&&n.length>0);let r,s;e[0]!==n?(r=["provider-models",n],s=async()=>{if(!n)return[];const a=await(await Fo.v1.providers[":providerId"].models.$get({param:{providerId:n}})).json();return"data"in a&&a.data?a.data:[]},e[0]=n,e[1]=r,e[2]=s):(r=e[1],s=e[2]);let i;return e[3]!==t||e[4]!==r||e[5]!==s?(i={queryKey:r,queryFn:s,enabled:t,staleTime:3e5},e[3]=t,e[4]=r,e[5]=s,e[6]=i):i=e[6],yg(i)};var Ux="_1nagll30",cg="_1nagll31",Wu="_1nagll32",Kx="_1nagll33",Wx="_1nagll34",Li="_1nagll35",Di="_1nagll36",Vx="_1nagll37",Hx="_1nagll38",qx="_1nagll39",Jx="_1nagll3d",dg="_1nagll3e",Vu="_1nagll3f",Hu="_1nagll3g",Gx="_1nagll3h",Yx="_1nagll3i",Bi="_1nagll3k",qu="_1nagll3l",Zx="_1nagll3o",Xx="_1nagll3p",Qx="_1nagll3q",Pa="_1nagll3r";const Ju=window.bootstrapData?.llmProviders?.map(n=>({label:n.name,icon:n.imageURI,value:n.key}));function eb(n){const e=qe.c(2),{className:t}=n;let r;return e[0]!==t?(r=k.jsx(Cc,{className:t}),e[0]=t,e[1]=r):r=e[1],r}function tb(n,e){const t=n.split("/");return t.length>1&&t[0].length>0?t[0].charAt(0).toUpperCase()+t[0].slice(1):"Other"}function fg(n){const e=n.split("/");return e.length>1&&e[0].length>0?e[0]:null}function Oo(n){return`https://models.dev/logos/${n}.svg`}function nb(n){const e=qe.c(47),{models:t,isLoading:r,selectedModelName:s,onSelect:i}=n;let o,a,l,c,u,f,d,h,g,m,y,x,p,_;if(e[0]!==r||e[1]!==t||e[2]!==i||e[3]!==s){const T=t?.reduce(rb,{}),E=T?Object.keys(T).sort():[];let N;e[18]!==t||e[19]!==s?(N=t?.find(j=>j.id===s),e[18]=t,e[19]=s,e[20]=N):N=e[20];const $=N?.name||s||"Select a model";c=$c,_=!1;let R;e[21]!==$?(R=k.jsx("span",{className:Bi,children:$}),e[21]=$,e[22]=R):R=e[22];let I;e[23]===Symbol.for("react.memo_cache_sentinel")?(I=k.jsx(Cc,{className:qu}),e[23]=I):I=e[23],e[24]!==R?(f=k.jsxs(ip,{className:dg,children:[R,I]}),e[24]=R,e[25]=f):f=e[25],l=Ba,a=ja,h=Vu,g="bottom",m=4,y="start",x="fixed",p=!0,o=Da,u=Hu,d=r?k.jsx("div",{className:Xx,children:"Loading models..."}):E.length===0?k.jsx("div",{className:Zx,children:"No models available"}):E.map(j=>{const B=T?.[j],M=B?.providerId,U=B?.models;return k.jsxs(tp,{children:[k.jsxs(lp,{className:Yx,openOnHover:!0,delay:100,children:[M&&k.jsx("img",{src:Oo(M),alt:"",className:Pa}),k.jsx("span",{className:Bi,children:j}),k.jsx(wh,{className:qu})]}),k.jsx(Ba,{children:k.jsx(ja,{className:Vu,side:"right",sideOffset:4,align:"start",positionMethod:"fixed",sticky:!0,children:k.jsx(Da,{className:Hu,children:U?.map(z=>{const Z=s===z.id;return k.jsxs(Gh,{className:Gx,onClick:()=>i(z.id),children:[k.jsx("span",{className:Bi,children:z.name.split(":")[1]||z.id}),Z&&k.jsx(Sc,{className:Qx})]},z.id)})})})})]},j)}),e[0]=r,e[1]=t,e[2]=i,e[3]=s,e[4]=o,e[5]=a,e[6]=l,e[7]=c,e[8]=u,e[9]=f,e[10]=d,e[11]=h,e[12]=g,e[13]=m,e[14]=y,e[15]=x,e[16]=p,e[17]=_}else o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],g=e[12],m=e[13],y=e[14],x=e[15],p=e[16],_=e[17];let C;e[26]!==o||e[27]!==u||e[28]!==d?(C=k.jsx(o,{className:u,children:d}),e[26]=o,e[27]=u,e[28]=d,e[29]=C):C=e[29];let v;e[30]!==a||e[31]!==C||e[32]!==h||e[33]!==g||e[34]!==m||e[35]!==y||e[36]!==x||e[37]!==p?(v=k.jsx(a,{className:h,side:g,sideOffset:m,align:y,positionMethod:x,sticky:p,children:C}),e[30]=a,e[31]=C,e[32]=h,e[33]=g,e[34]=m,e[35]=y,e[36]=x,e[37]=p,e[38]=v):v=e[38];let b;e[39]!==l||e[40]!==v?(b=k.jsx(l,{children:v}),e[39]=l,e[40]=v,e[41]=b):b=e[41];let S;return e[42]!==c||e[43]!==f||e[44]!==b||e[45]!==_?(S=k.jsxs(c,{modal:_,children:[f,b]}),e[42]=c,e[43]=f,e[44]=b,e[45]=_,e[46]=S):S=e[46],S}function rb(n,e){const t=tb(e.id),r=fg(e.id);return n[t]||(n[t]={models:[],providerId:r}),n[t].models.push(e),n}function sb(n){const e=qe.c(76),{value:t,onChange:r}=n,{data:s,isLoading:i}=zx(t.provider);let o;e[0]!==t.provider?(o=Ju?.find(V=>V.value===t.provider)||null,e[0]=t.provider,e[1]=o):o=e[1];const a=o,l=t.modelName?t.modelName:(t.provider,"Select model");let c;e[2]!==r||e[3]!==t?(c=V=>{V&&r({...t,provider:V.value,modelName:""})},e[2]=r,e[3]=t,e[4]=c):c=e[4];const u=c;let f;e[5]!==r||e[6]!==t?(f=V=>{r({...t,modelName:V})},e[5]=r,e[6]=t,e[7]=f):f=e[7];const d=f;let h;e[8]!==r||e[9]!==t?(h=(V,ce)=>{r({...t,[V]:ce})},e[8]=r,e[9]=t,e[10]=h):h=e[10];const g=h;let m;if(e[11]!==t.modelName||e[12]!==t.provider){const V=fg(t.modelName);m=V?Oo(V):t.provider?Oo(t.provider):null,e[11]=t.modelName,e[12]=t.provider,e[13]=m}else m=e[13];const y=m;let x;e[14]!==y?(x=y?k.jsx("img",{src:y,alt:"",className:Pa}):k.jsx("span",{className:cg,children:"?"}),e[14]=y,e[15]=x):x=e[15];const p=t.modelName?Wu:`${Wu} ${Kx}`;let _;e[16]!==l||e[17]!==p?(_=k.jsx("span",{className:p,children:l}),e[16]=l,e[17]=p,e[18]=_):_=e[18];let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=k.jsx(eb,{className:Jx}),e[19]=C):C=e[19];let v;e[20]!==x||e[21]!==_?(v=k.jsxs(ec,{className:Ux,children:[x,_,C]}),e[20]=x,e[21]=_,e[22]=v):v=e[22];let b;e[23]===Symbol.for("react.memo_cache_sentinel")?(b=k.jsx("span",{className:Di,children:"Provider"}),e[23]=b):b=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=Ju||[],e[24]=S):S=e[24];let T;e[25]!==u||e[26]!==a?(T=k.jsxs("div",{className:Li,children:[b,k.jsx(Mo,{items:S,value:a,onValueChange:u,itemToString:cb,itemToIcon:ub,placeholder:"Select provider"})]}),e[25]=u,e[26]=a,e[27]=T):T=e[27];let E;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=k.jsx("span",{className:Di,children:"Model"}),e[28]=E):E=e[28];let N;e[29]!==d||e[30]!==i||e[31]!==s||e[32]!==t.modelName||e[33]!==t.provider?(N=k.jsxs("div",{className:Li,children:[E,t.provider?k.jsx(nb,{models:s,isLoading:i,selectedModelName:t.modelName,onSelect:d}):k.jsx("div",{className:dg,style:{color:"var(--gray9)"},children:"Select a provider first"})]}),e[29]=d,e[30]=i,e[31]=s,e[32]=t.modelName,e[33]=t.provider,e[34]=N):N=e[34];let P;e[35]===Symbol.for("react.memo_cache_sentinel")?(P=k.jsx("span",{className:Di,children:"Parameters"}),e[35]=P):P=e[35];const $=t.temperature??1;let R;e[36]!==g?(R=V=>g("temperature",V),e[36]=g,e[37]=R):R=e[37];let I;e[38]!==$||e[39]!==R?(I=k.jsx(Zr,{label:"Temperature",value:$,min:0,max:2,step:.1,onValueChange:R,formatValue:lb}),e[38]=$,e[39]=R,e[40]=I):I=e[40];let j;e[41]===Symbol.for("react.memo_cache_sentinel")?(j=k.jsx("label",{className:qx,children:"Max Tokens"}),e[41]=j):j=e[41];const B=t.maxTokens??"";let M;e[42]!==r||e[43]!==t?(M=V=>{const ce=V.target.value?parseInt(V.target.value,10):void 0;r({...t,maxTokens:ce})},e[42]=r,e[43]=t,e[44]=M):M=e[44];let U;e[45]!==B||e[46]!==M?(U=k.jsxs("div",{className:Hx,children:[j,k.jsx("input",{type:"number",className:Qu,value:B,placeholder:"Default",min:1,onChange:M})]}),e[45]=B,e[46]=M,e[47]=U):U=e[47];const z=t.topP??1;let Z;e[48]!==g?(Z=V=>g("topP",V),e[48]=g,e[49]=Z):Z=e[49];let ne;e[50]!==z||e[51]!==Z?(ne=k.jsx(Zr,{label:"Top P",value:z,min:0,max:1,step:.05,onValueChange:Z,formatValue:ab}),e[50]=z,e[51]=Z,e[52]=ne):ne=e[52];const J=t.frequencyPenalty??0;let q;e[53]!==g?(q=V=>g("frequencyPenalty",V),e[53]=g,e[54]=q):q=e[54];let H;e[55]!==J||e[56]!==q?(H=k.jsx(Zr,{label:"Frequency Penalty",value:J,min:-2,max:2,step:.1,onValueChange:q,formatValue:ob}),e[55]=J,e[56]=q,e[57]=H):H=e[57];const ae=t.presencePenalty??0;let re;e[58]!==g?(re=V=>g("presencePenalty",V),e[58]=g,e[59]=re):re=e[59];let le;e[60]!==ae||e[61]!==re?(le=k.jsx(Zr,{label:"Presence Penalty",value:ae,min:-2,max:2,step:.1,onValueChange:re,formatValue:ib}),e[60]=ae,e[61]=re,e[62]=le):le=e[62];let Q;e[63]!==I||e[64]!==U||e[65]!==ne||e[66]!==H||e[67]!==le?(Q=k.jsxs("div",{className:Li,children:[P,k.jsxs("div",{className:Vx,children:[I,U,ne,H,le]})]}),e[63]=I,e[64]=U,e[65]=ne,e[66]=H,e[67]=le,e[68]=Q):Q=e[68];let te;e[69]!==T||e[70]!==N||e[71]!==Q?(te=k.jsx(tc,{side:"bottom",align:"start",sideOffset:4,positionMethod:"fixed",children:k.jsxs("div",{className:Wx,children:[T,N,Q]})}),e[69]=T,e[70]=N,e[71]=Q,e[72]=te):te=e[72];let ie;return e[73]!==v||e[74]!==te?(ie=k.jsxs(nc,{children:[v,te]}),e[73]=v,e[74]=te,e[75]=ie):ie=e[75],ie}function ib(n){return n.toFixed(1)}function ob(n){return n.toFixed(1)}function ab(n){return n.toFixed(2)}function lb(n){return n.toFixed(1)}function ub(n){return n?.icon?k.jsx("img",{src:n.icon,alt:"",className:Pa}):k.jsx("span",{className:cg,children:n?.label?.charAt(0).toUpperCase()||"?"})}function cb(n){return n?.label||""}const db=n=>{const e=qe.c(48),{form:t,editorKey:r}=n,{setValue:s,control:i}=t;let o;e[0]!==t.control?(o={control:t.control,name:"provider"},e[0]=t.control,e[1]=o):o=e[1];const a=Zt(o);let l;e[2]!==i?(l={control:i,name:"modelName"},e[2]=i,e[3]=l):l=e[3];const c=Zt(l);let u;e[4]!==i?(u={control:i,name:"system_prompt"},e[4]=i,e[5]=u):u=e[5];const f=Zt(u);let d;e[6]!==i?(d={control:i,name:"temperature"},e[6]=i,e[7]=d):d=e[7];const h=Zt(d);let g;e[8]!==i?(g={control:i,name:"maxTokens"},e[8]=i,e[9]=g):g=e[9];const m=Zt(g);let y;e[10]!==i?(y={control:i,name:"topP"},e[10]=i,e[11]=y):y=e[11];const x=Zt(y);let p;e[12]!==i?(p={control:i,name:"frequencyPenalty"},e[12]=i,e[13]=p):p=e[13];const _=Zt(p);let C;e[14]!==i?(C={control:i,name:"presencePenalty"},e[14]=i,e[15]=C):C=e[15];const v=Zt(C),b=a||"",S=c||"";let T;e[16]!==_||e[17]!==m||e[18]!==v||e[19]!==S||e[20]!==b||e[21]!==h||e[22]!==x?(T={provider:b,modelName:S,temperature:h,maxTokens:m,topP:x,frequencyPenalty:_,presencePenalty:v},e[16]=_,e[17]=m,e[18]=v,e[19]=S,e[20]=b,e[21]=h,e[22]=x,e[23]=T):T=e[23];const E=T;let N;e[24]!==_||e[25]!==m||e[26]!==v||e[27]!==c||e[28]!==a||e[29]!==s||e[30]!==h||e[31]!==x?(N=z=>{z.provider!==a&&s("provider",z.provider,{shouldValidate:!0,shouldDirty:!0}),z.modelName!==c&&s("modelName",z.modelName,{shouldValidate:!0,shouldDirty:!0}),z.temperature!==h&&s("temperature",z.temperature,{shouldValidate:!0,shouldDirty:!0}),z.maxTokens!==m&&s("maxTokens",z.maxTokens,{shouldValidate:!0,shouldDirty:!0}),z.topP!==x&&s("topP",z.topP,{shouldValidate:!0,shouldDirty:!0}),z.frequencyPenalty!==_&&s("frequencyPenalty",z.frequencyPenalty,{shouldValidate:!0,shouldDirty:!0}),z.presencePenalty!==v&&s("presencePenalty",z.presencePenalty,{shouldValidate:!0,shouldDirty:!0})},e[24]=_,e[25]=m,e[26]=v,e[27]=c,e[28]=a,e[29]=s,e[30]=h,e[31]=x,e[32]=N):N=e[32];const P=N;let $;e[33]===Symbol.for("react.memo_cache_sentinel")?($=k.jsxs("div",{className:Ra,children:[k.jsx(Gu,{icon:Ap,size:"xs"}),k.jsx("span",{children:"Model"})]}),e[33]=$):$=e[33];let R;e[34]!==P||e[35]!==E?(R=k.jsxs("div",{className:Pg,children:[$,k.jsx("div",{className:Ig,children:k.jsx(sb,{value:E,onChange:P})})]}),e[34]=P,e[35]=E,e[36]=R):R=e[36];let I;e[37]===Symbol.for("react.memo_cache_sentinel")?(I=k.jsx("span",{children:"System"}),e[37]=I):I=e[37];let j;e[38]===Symbol.for("react.memo_cache_sentinel")?(j=k.jsxs("div",{className:Ra,children:[I,k.jsxs("div",{className:Rg,children:[k.jsx(jx,{width:14,height:14}),k.jsx("span",{children:"Markdown Supported"})]})]}),e[38]=j):j=e[38];let B;e[39]!==s?(B=z=>s("system_prompt",z,{shouldValidate:!0,shouldDirty:!0}),e[39]=s,e[40]=B):B=e[40];let M;e[41]!==r||e[42]!==f||e[43]!==B?(M=k.jsxs("div",{className:Og,children:[j,k.jsx(Dx,{value:f,onChange:B},r)]}),e[41]=r,e[42]=f,e[43]=B,e[44]=M):M=e[44];let U;return e[45]!==R||e[46]!==M?(U=k.jsxs("div",{className:Fg,children:[R,M]}),e[45]=R,e[46]=M,e[47]=U):U=e[47],U},fb=["variants-list"],gb=()=>{const n=qe.c(2),e=Yu();let t;return n[0]!==e?(t={mutationFn:hb,onSuccess:(r,s)=>{e.invalidateQueries({queryKey:fb}),e.invalidateQueries({queryKey:zh(s.configId)})}},n[0]=e,n[1]=t):t=n[1],kc(t)};async function hb(n){const t=await(await Fo.v1.configs[":configId"].variants.$post({param:{configId:n.configId},json:{name:n.name,provider:n.provider,modelName:n.modelName,jsonData:n.jsonData}})).json();if("data"in t&&t.data)return t.data}const pb=()=>{const n=qe.c(2),e=Yu();let t;return n[0]!==e?(t={mutationFn:mb,onSuccess:(r,s)=>{e.invalidateQueries({queryKey:Mg(s.variantId)}),e.invalidateQueries({queryKey:["variant",s.variantId]})}},n[0]=e,n[1]=t):t=n[1],kc(t)};async function mb(n){const e=await Fo.v1.variants[":id"].versions.$post({param:{id:n.variantId},json:{provider:n.provider,modelName:n.modelName,jsonData:n.jsonData}}),t=await e.json();if(!e.ok||!("data"in t))throw new Error("message"in t?t.message:"Failed to create variant version");return t.data}function qb(){const{id:n,variant:e}=_g.useParams(),t=vg(),r=gb(),s=pb(),i=$g(),{data:o}=xg(e==="new"?"":e),{data:a}=Uh(n),{data:l}=Lg(e==="new"?"":e),{data:c}=Kh(n),[u,f]=w.useState("new"),[d,h]=w.useState(null),g=e==="new",m=Ng({defaultValues:{variant_name:"",provider:"",modelName:"",system_prompt:"",temperature:void 0,maxTokens:void 0,topP:void 0,frequencyPenalty:void 0,presencePenalty:void 0}}),y=m.formState.isDirty,x=r.isPending||s.isPending||i.isPending,p=l?[...l].sort((b,S)=>S.version-b.version):[];w.useEffect(()=>{if(l&&l.length>0&&!d){const b=a?.find(T=>T.variantId===e),S=c?.find(T=>b&&T.configVariantId===b.id&&T.variantVersionId);if(S?.variantVersionId)h(S.variantVersionId);else{const T=l.reduce((E,N)=>N.version>E.version?N:E);h(T.id)}}},[l,d,a,c,e]),Hh({shouldBlockFn:()=>x?!1:y?!confirm("You have unsaved changes. Are you sure you want to move away from the form?"):!1}),w.useEffect(()=>{if(o&&d&&l){const b=l.find(T=>T.id===d);if(!b)return;const S=typeof b.jsonData=="string"?JSON.parse(b.jsonData):b.jsonData;m.reset({variant_name:o.name||"",provider:b.provider||"",modelName:S?.model||b.modelName||"",system_prompt:S?.system_prompt||"",temperature:S?.temperature,maxTokens:S?.max_tokens,topP:S?.top_p,frequencyPenalty:S?.frequency_penalty,presencePenalty:S?.presence_penalty},{keepDirty:!1}),f(`${o.id}-${d}`)}},[o,d,l]);const _=b=>{const S={system_prompt:b.system_prompt,model:b.modelName};return b.temperature!==void 0&&(S.temperature=b.temperature),b.maxTokens!==void 0&&(S.max_tokens=b.maxTokens),b.topP!==void 0&&(S.top_p=b.topP),b.frequencyPenalty!==void 0&&(S.frequency_penalty=b.frequencyPenalty),b.presencePenalty!==void 0&&(S.presence_penalty=b.presencePenalty),S},C=b=>{if(!a||a.length===0)return b;const S=new Set(a.map(N=>N.name));if(!S.has(b))return b;let T=2,E=`${b} (${T})`;for(;S.has(E);)T++,E=`${b} (${T})`;return E},v=async b=>{const S=m.getValues();if(!(!S.variant_name.trim()||!S.provider||!S.modelName))try{const T=_(S);if(b.mode==="new_variant"||g){const E=b.mode==="new_variant"&&!g?C(S.variant_name):S.variant_name,N=await r.mutateAsync({configId:n,name:E,provider:S.provider,modelName:S.modelName,jsonData:T});b.deployToEnvironment&&b.environmentId&&N&&await i.mutateAsync({environmentId:b.environmentId,configId:n,configVariantId:N.configVariant.id,variantVersionId:N.version.id})}else{const E=await s.mutateAsync({variantId:e,provider:S.provider,modelName:S.modelName,jsonData:T});if(b.deployToEnvironment&&b.environmentId){const N=a?.find(P=>P.variantId===e);N&&E&&await i.mutateAsync({environmentId:b.environmentId,configId:n,configVariantId:N.id,variantVersionId:E.id})}}m.reset(),t({to:"/configs/$id/variants",params:{id:n}})}catch(T){console.error("Error saving variant:",T)}};return k.jsxs("div",{children:[k.jsxs("div",{className:Dg,children:[k.jsx("input",{title:"Variant Name","data-1p-ignore":!0,autoComplete:"off",placeholder:"Variant Name",className:Qu,...m.register("variant_name")}),k.jsxs("div",{className:Bg,children:[!g&&p.length>0&&k.jsx(Mo,{items:p,value:p.find(b=>b.id===d)??null,onValueChange:b=>{(b&&!y||b&&y&&confirm("You have unsaved changes. Switching versions will discard them. Continue?"))&&h(b.id)},placeholder:"Select version...",itemToString:b=>b?`Version ${b.version}`:""}),k.jsx(Jp,{isNewVariant:g,onSave:v,isSaving:x})]})]}),k.jsx("div",{className:jg,children:k.jsx(db,{form:m,editorKey:u})})]})}export{qb as component};
@@ -1 +1 @@
1
- import{a as o,j as n,O as m}from"./index-BCY9aD4r.js";/* empty css */function c(){const e=o.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(m,{}),e[0]=t):t=e[0],t}export{c as component};
1
+ import{a as o,j as n,O as m}from"./index-FrTQ7TcS.js";/* empty css */function c(){const e=o.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(m,{}),e[0]=t):t=e[0],t}export{c as component};
@@ -1 +1 @@
1
- import{a as u,e as v,j as i,l as _}from"./index-BCY9aD4r.js";var x="na2u4m1 na2u4m0 _1lg22bkw0",g="na2u4m2",h="na2u4m3",f="na2u4m4";const y=r=>{const a=u.c(17);let s,e,l,n;a[0]!==r?({items:e,separator:n,className:s,...l}=r,a[0]=r,a[1]=s,a[2]=e,a[3]=l,a[4]=n):(s=a[1],e=a[2],l=a[3],n=a[4]);const m=n===void 0?"/":n;let t;a[5]!==s?(t=v(x,s),a[5]=s,a[6]=t):t=a[6];let c;if(a[7]!==e||a[8]!==m){let b;a[10]!==e.length||a[11]!==m?(b=(o,k)=>i.jsxs("div",{className:g,children:[o.prefix,i.jsx("div",{className:h,children:o.label}),k<e.length-1&&i.jsx("span",{className:f,"aria-hidden":"true",children:m})]},o.key),a[10]=e.length,a[11]=m,a[12]=b):b=a[12],c=e.map(b),a[7]=e,a[8]=m,a[9]=c}else c=a[9];let d;return a[13]!==l||a[14]!==t||a[15]!==c?(d=i.jsx("nav",{...l,className:t,"aria-label":"Breadcrumb",children:c}),a[13]=l,a[14]=t,a[15]=c,a[16]=d):d=a[16],d};var j="f7jxdn0";const q=r=>{const a=u.c(5);let s;a[0]!==r.className?(s=v(j,r.className),a[0]=r.className,a[1]=s):s=a[1];let e;return a[2]!==r||a[3]!==s?(e=i.jsx("header",{...r,className:s}),a[2]=r,a[3]=s,a[4]=e):e=a[4],e};const p=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],w=_("columns-2",p);var B="_6smcqd0",C="_6smcqd1",E="_6smcqd3",L="_6smcqd4",S="_1aj0kmd0",$="_1aj0kmd2 _1aj0kmd1 _1lg22bkdo _1lg22bkuf _1lg22bk107 _1lg22bk10a _1lg22bkpr _1lg22bk10k";export{y as B,w as C,q as H,B as a,L as b,E as c,S as g,C as h,$ as w};
1
+ import{a as u,e as v,j as i,l as _}from"./index-FrTQ7TcS.js";var x="na2u4m1 na2u4m0 _1lg22bkw0",g="na2u4m2",h="na2u4m3",f="na2u4m4";const y=r=>{const a=u.c(17);let s,e,l,n;a[0]!==r?({items:e,separator:n,className:s,...l}=r,a[0]=r,a[1]=s,a[2]=e,a[3]=l,a[4]=n):(s=a[1],e=a[2],l=a[3],n=a[4]);const m=n===void 0?"/":n;let t;a[5]!==s?(t=v(x,s),a[5]=s,a[6]=t):t=a[6];let c;if(a[7]!==e||a[8]!==m){let b;a[10]!==e.length||a[11]!==m?(b=(o,k)=>i.jsxs("div",{className:g,children:[o.prefix,i.jsx("div",{className:h,children:o.label}),k<e.length-1&&i.jsx("span",{className:f,"aria-hidden":"true",children:m})]},o.key),a[10]=e.length,a[11]=m,a[12]=b):b=a[12],c=e.map(b),a[7]=e,a[8]=m,a[9]=c}else c=a[9];let d;return a[13]!==l||a[14]!==t||a[15]!==c?(d=i.jsx("nav",{...l,className:t,"aria-label":"Breadcrumb",children:c}),a[13]=l,a[14]=t,a[15]=c,a[16]=d):d=a[16],d};var j="f7jxdn0";const q=r=>{const a=u.c(5);let s;a[0]!==r.className?(s=v(j,r.className),a[0]=r.className,a[1]=s):s=a[1];let e;return a[2]!==r||a[3]!==s?(e=i.jsx("header",{...r,className:s}),a[2]=r,a[3]=s,a[4]=e):e=a[4],e};const p=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],w=_("columns-2",p);var B="_6smcqd0",C="_6smcqd1",E="_6smcqd3",L="_6smcqd4",S="_1aj0kmd0",$="_1aj0kmd2 _1aj0kmd1 _1lg22bkdo _1lg22bkuf _1lg22bk107 _1lg22bk10a _1lg22bkpr _1lg22bk10k";export{y as B,w as C,q as H,B as a,L as b,E as c,S as g,C as h,$ as w};
@@ -1 +1 @@
1
- import{r as u,a as d,e as b,ap as B,j as x}from"./index-BCY9aD4r.js";import{d as R,c as E}from"./useButton-Ct8hIyjz.js";const h=u.forwardRef(function(e,t){const{render:l,className:c,disabled:s=!1,focusableWhenDisabled:o=!1,nativeButton:a=!0,...n}=e,r=!!s,{getButtonProps:p,buttonRef:f}=R({disabled:r,focusableWhenDisabled:o,native:a}),m=u.useMemo(()=>({disabled:r}),[r]);return E("button",e,{state:m,ref:[t,f],props:[n,p]})}),N=i=>{const e=d.c(16);let t,l,c,s,o,a;e[0]!==i?({variant:a,scheme:s,size:o,className:l,children:t,...c}=i,e[0]=i,e[1]=t,e[2]=l,e[3]=c,e[4]=s,e[5]=o,e[6]=a):(t=e[1],l=e[2],c=e[3],s=e[4],o=e[5],a=e[6]);let n;e[7]!==l||e[8]!==s||e[9]!==o||e[10]!==a?(n=b(B({variant:a,size:o,scheme:s}),l),e[7]=l,e[8]=s,e[9]=o,e[10]=a,e[11]=n):n=e[11];let r;return e[12]!==t||e[13]!==c||e[14]!==n?(r=x.jsx(h,{...c,className:n,children:t}),e[12]=t,e[13]=c,e[14]=n,e[15]=r):r=e[15],r};export{N as B};
1
+ import{r as u,a as d,e as b,az as B,j as x}from"./index-FrTQ7TcS.js";import{d as R,c as E}from"./useButton-CsZ8hBM8.js";const h=u.forwardRef(function(e,t){const{render:l,className:c,disabled:s=!1,focusableWhenDisabled:o=!1,nativeButton:a=!0,...n}=e,r=!!s,{getButtonProps:f,buttonRef:m}=R({disabled:r,focusableWhenDisabled:o,native:a}),p=u.useMemo(()=>({disabled:r}),[r]);return E("button",e,{state:p,ref:[t,m],props:[n,f]})}),N=i=>{const e=d.c(16);let t,l,c,s,o,a;e[0]!==i?({variant:a,scheme:s,size:o,className:l,children:t,...c}=i,e[0]=i,e[1]=t,e[2]=l,e[3]=c,e[4]=s,e[5]=o,e[6]=a):(t=e[1],l=e[2],c=e[3],s=e[4],o=e[5],a=e[6]);let n;e[7]!==l||e[8]!==s||e[9]!==o||e[10]!==a?(n=b(B({variant:a,size:o,scheme:s}),l),e[7]=l,e[8]=s,e[9]=o,e[10]=a,e[11]=n):n=e[11];let r;return e[12]!==t||e[13]!==c||e[14]!==n?(r=x.jsx(h,{...c,className:n,children:t}),e[12]=t,e[13]=c,e[14]=n,e[15]=r):r=e[15],r};export{N as B};
@@ -0,0 +1 @@
1
+ import{l as c}from"./index-FrTQ7TcS.js";const e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t=c("check",e);export{t as C};
@@ -1 +1 @@
1
- import{l as o}from"./index-BCY9aD4r.js";const n=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],c=o("chevron-down",n);export{c as C};
1
+ import{l as o}from"./index-FrTQ7TcS.js";const n=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],c=o("chevron-down",n);export{c as C};
@@ -1 +1 @@
1
- import{l as o}from"./index-BCY9aD4r.js";const t=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],c=o("chevron-right",t);export{c as C};
1
+ import{l as o}from"./index-FrTQ7TcS.js";const t=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],c=o("chevron-right",t);export{c as C};