"use strict";(self.webpackChunkbackend_ai_webui_react=self.webpackChunkbackend_ai_webui_react||[]).push([[268],{23623:(e,n,t)=>{t.d(n,{A:()=>i});var s=t(76998);const o=(e,n,t)=>{const[o,i]=(0,s.useState)(e());return(0,s.useEffect)((()=>{t&&i(e())}),[t]),function(e,n){const t=(0,s.useRef)();(0,s.useEffect)((()=>{t.current=e})),(0,s.useEffect)((()=>{if(null!==n){let e=setInterval((function(){var e;null===(e=t.current)||void 0===e||e.call(t)}),n);return()=>clearInterval(e)}}),[n])}((()=>{const n=e();n!==o&&i(n)}),n),o},i=e=>{let{callback:n,delay:t,triggerKey:s}=e;return o(n,t,s)}},83268:(e,n,t)=>{t.r(n),t.d(n,{default:()=>g});var s=t(23623),o=t(42989),i=t(91412),a=t(29871),r=t(40379),l=t(50840),c=t(24128),d=t(87627),u=t(14455),f=t.n(u),h=t(76998),v=t(77678),S=t(23446);const g=e=>{let{...n}=e;const{t:t}=(0,v.Bd)(),{token:u}=l.A.useToken(),[g,{toggle:A}]=(0,r.A)(!1),[p,x]=h.useState(),{dispatchEvent:y}=(0,i.useWebComponentInfo)(),b=e=>{x(e),y("change",e)};return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(c.A.Text,{type:"secondary",style:{fontSize:u.fontSizeSM},children:t("session.launcher.SessionStartTime")}),(0,S.jsxs)(a.A,{align:"start",gap:"sm",children:[(0,S.jsx)(d.A,{checked:g,onClick:e=>{A();const n=e?f()().add(2,"minutes").toISOString():void 0;b(n)},children:t("session.launcher.Enable")}),(0,S.jsxs)(a.A,{direction:"column",align:"end",children:[(0,S.jsx)(o.A,{...n,popupStyle:{position:"fixed"},disabledDate:e=>e.isBefore(f()().startOf("minute")),disabled:!g,showTime:{hideDisabledOptions:!0},value:g?p:void 0,onChange:e=>{b(e)},onBlur:()=>{b(p)},status:g&&!p?"warning":f()(p).isBefore(f()())?"error":void 0}),g&&p&&(0,S.jsxs)(c.A.Text,{type:"secondary",style:{fontSize:u.fontSizeSM-2},children:["(",t("session.launcher.StartAfter"),(0,S.jsx)(s.A,{callback:()=>(f()(p).diff(f()())<0&&b(f()(p).add(2,"minutes").toISOString()),f()(p).fromNow()),delay:1e3}),")"]}),g&&!p&&(0,S.jsx)(c.A.Text,{type:"warning",style:{fontSize:u.fontSizeSM-2},children:t("session.launcher.StartTimeDoesNotApply")})]})]})]})}},42989:(e,n,t)=>{t.d(n,{A:()=>d});var s=t(66464),o=t(60708),i=t(14455),a=t.n(i),r=t(45901),l=t.n(r),c=(t(76998),t(23446));const d=e=>{let{value:n,onChange:t,localFormat:i,...r}=e;const[,d]=(0,s.A)({value:n,onChange:t});return(0,c.jsx)(o.A,{value:n?a()(n):void 0,onChange:e=>{var n,t,s;l().isArray(e)&&(e=e[0]);const o=i?null===(n=e)||void 0===n?void 0:n.format():null===(t=e)||void 0===t||null===(s=t.tz())||void 0===s?void 0:s.toISOString();d(o)},...r})}}}]);
//# sourceMappingURL=268.5c18b94b.chunk.js.map