(()=>{"use strict";var e,r,t,n={4678(e,r,t){var n=t(5338),i=t(7665),o=t(867),l=t(559),a=t(2658),s=(t(2796),{token:{colorPrimary:"#1F2937",colorPrimaryHover:"#374151",colorPrimaryActive:"#111827",colorLink:"#1F2937",colorLinkHover:"#374151",colorText:"#1A1A1A",colorTextSecondary:"#6B7280",colorTextTertiary:"#9CA3AF",colorBorder:"#E5E7EB",colorBorderSecondary:"#F3F4F6",colorBgLayout:"#F9FAFB",colorBgContainer:"#FFFFFF",borderRadius:6,borderRadiusLG:12,fontFamily:'"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:14,fontSizeHeading1:28,fontSizeHeading2:22,fontSizeHeading3:18,fontWeightStrong:500,controlHeight:36,controlHeightLG:42,paddingContentHorizontal:16},components:{Button:{fontWeight:500,primaryShadow:"none",defaultShadow:"none"},Layout:{headerBg:"#FFFFFF",siderBg:"#F9FAFB",bodyBg:"#F9FAFB",headerHeight:56,headerPadding:"0 24px"},Menu:{itemBg:"transparent",itemSelectedBg:"#F3F4F6",itemSelectedColor:"#1F2937",itemHoverBg:"#F3F4F6",itemHoverColor:"#1F2937",itemHeight:40,iconSize:16},Card:{headerFontSize:16,paddingLG:24},Input:{activeShadow:"0 0 0 2px rgba(31, 41, 55, 0.1)"},Form:{labelColor:"#6B7280",labelFontSize:13,verticalLabelPadding:"0 0 4px"}}}),c=new(t(7865).E)({defaultOptions:{queries:{staleTime:3e4,gcTime:3e5,retry:1,refetchOnWindowFocus:!0},mutations:{retry:0}}}),u=t(4976),d=t(7767),h=t(4992),m=t(677),y=t(327),f=t(4848),p=h.A.Title,v=h.A.Text;function g(){var e=(0,d.g)().id;return(0,f.jsxs)("div",{children:[(0,f.jsx)(p,{level:2,style:{marginTop:0},children:"Ассистент"}),(0,f.jsxs)(v,{type:"secondary",children:["ID: ",e]}),(0,f.jsx)(m.A,{style:{marginTop:24},children:(0,f.jsx)(y.A,{defaultActiveKey:"knowledge",items:[{key:"knowledge",label:"База знаний",children:(0,f.jsx)(v,{type:"secondary",children:"Загрузка документов появится в PR Frontend-2"})},{key:"settings",label:"Настройки",children:(0,f.jsx)(v,{type:"secondary",children:"Промпт и модель — в PR Frontend-2"})},{key:"test-chat",label:"Тест-чат",children:(0,f.jsx)(v,{type:"secondary",children:"Тест-чат — в PR Frontend-2"})}]})})]})}var x=t(8279),A=t(7308),j=(0,t(1621).vt)(e=>({user:null,isAuthenticated:!1,setUser:r=>e({user:r,isAuthenticated:!!r}),reset:()=>e({user:null,isAuthenticated:!1})})),b=t(3930),w=t(6540),C=t(1083),F={API_BASE_URL:null!=="https://cabinet.richat.ru/api"?"https://cabinet.richat.ru/api":"http://localhost:8003",APP_NAME:"RiChat",IS_DEV:!1,IS_PROD:!0};function S(e,r,t,n,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void t(e)}a.done?r(s):Promise.resolve(s).then(n,i)}var E=!1,B=[];function k(e){B.forEach(r=>r(e)),B=[]}var P=C.A.create({baseURL:F.API_BASE_URL,withCredentials:!0,timeout:3e4,headers:{"Content-Type":"application/json"}});P.interceptors.request.use(e=>{var r;return F.IS_DEV&&console.debug("[http]",null===(r=e.method)||void 0===r?void 0:r.toUpperCase(),e.url),e},e=>Promise.reject(e)),P.interceptors.response.use(e=>e,function(){var e,r=(e=function*(e){var r,t,n=e.config;if(!n||401!==(null===(r=e.response)||void 0===r?void 0:r.status)||n._retried)return Promise.reject(e);if(null!==(t=n.url)&&void 0!==t&&t.startsWith("/auth/"))return Promise.reject(e);if(n._retried=!0,E)return new Promise((r,t)=>{B.push(i=>{i?P(n).then(r).catch(t):t(e)})});E=!0;try{return yield P.post("/auth/refresh"),k(!0),P(n)}catch(e){return k(!1),"undefined"==typeof window||window.location.pathname.startsWith("/login")||window.location.assign("/login"),Promise.reject(e)}finally{E=!1}},function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function l(e){S(o,n,i,l,a,"next",e)}function a(e){S(o,n,i,l,a,"throw",e)}l(void 0)})});return function(e){return r.apply(this,arguments)}}());var T=t(3110);function O(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Что-то пошло не так";if(e instanceof T.pe){if(!e.response)return"ECONNABORTED"===e.code?"Сервер не отвечает. Попробуйте ещё раз.":"Нет связи с сервером. Проверьте подключение.";var t=e.response.data;if(null!=t&&t.detail){var n;if("string"==typeof t.detail)return t.detail;if(Array.isArray(t.detail)&&null!==(n=t.detail[0])&&void 0!==n&&n.msg)return t.detail[0].msg}return"Ошибка ".concat(e.response.status)}return e instanceof Error&&e.message||r}function I(e,r,t,n,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void t(e)}a.done?r(s):Promise.resolve(s).then(n,i)}function z(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function l(e){I(o,n,i,l,a,"next",e)}function a(e){I(o,n,i,l,a,"throw",e)}l(void 0)})}}var _=()=>z(function*(){return(yield P.get("/user/",{params:{include:"assistants"}})).data})();function q(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function M(e,r,t){return(r=function(e){var r=function(e){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var R={all:["user"],me:()=>[...R.all,"me"]};var U=h.A.Title,D=h.A.Text;function H(){var e,r=j(e=>e.user),t=null!==(e=null==r?void 0:r.assistants)&&void 0!==e?e:[];return(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:24},children:[(0,f.jsx)(U,{level:2,style:{margin:0},children:"Ассистенты"}),(0,f.jsx)(x.Ay,{type:"primary",disabled:!0,children:"Создать ассистента"})]}),0===t.length?(0,f.jsx)(m.A,{children:(0,f.jsx)(A.A,{description:(0,f.jsxs)("span",{children:[(0,f.jsx)(D,{type:"secondary",children:"Пока ни одного ассистента не создано"}),(0,f.jsx)("br",{}),(0,f.jsx)(D,{type:"secondary",style:{fontSize:12},children:"Создание ассистентов появится в следующих PR"})]})})}):(0,f.jsx)("div",{style:{display:"grid",gap:16,gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))"},children:t.map(e=>(0,f.jsxs)(m.A,{hoverable:!0,children:[(0,f.jsx)(U,{level:5,style:{margin:0},children:e.name}),(0,f.jsxs)(D,{type:"secondary",style:{fontSize:12},children:[e.gpt_model," · ",e.use_new_rag?"новый RAG":"OpenAI Assistants"]})]},e.id))})]})}var L=h.A.Title,Z=h.A.Text;function W(){return(0,f.jsxs)("div",{children:[(0,f.jsx)(L,{level:2,style:{marginTop:0},children:"Биллинг"}),(0,f.jsx)(m.A,{children:(0,f.jsx)(Z,{type:"secondary",children:"Страница биллинга появится в следующих PR."})})]})}var N=t(4293),$=t(4931),V=t(7097);function G(e,r,t,n,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void t(e)}a.done?r(s):Promise.resolve(s).then(n,i)}function K(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function l(e){G(o,n,i,l,a,"next",e)}function a(e){G(o,n,i,l,a,"throw",e)}l(void 0)})}}var Y={register:e=>K(function*(){yield P.post("/auth/email/register",e)})(),verify:e=>K(function*(){return(yield P.post("/auth/email/verify",e)).data})(),login:e=>K(function*(){return(yield P.post("/auth/email/login",e)).data})(),requestPasswordReset:e=>K(function*(){yield P.post("/auth/email/password-reset/request",e)})(),confirmPasswordReset:e=>K(function*(){yield P.post("/auth/email/password-reset/confirm",e)})(),refresh:()=>K(function*(){return(yield P.post("/auth/refresh")).data})(),logout:()=>K(function*(){yield P.delete("/auth/")})()};function Q(){return(0,V.n)({mutationFn:Y.register})}function J(e,r,t,n,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void t(e)}a.done?r(s):Promise.resolve(s).then(n,i)}function X(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);te.setUser),r=(0,i.jE)(),(0,V.n)({mutationFn:Y.login,onSuccess:t=>{e(t.user),r.setQueryData(R.me(),t.user)}})),s=function(){var e,r=(e=function*(e){try{yield a.mutateAsync(e),o("/assistants")}catch(e){}},function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function l(e){J(o,n,i,l,a,"next",e)}function a(e){J(o,n,i,l,a,"throw",e)}l(void 0)})});return function(e){return r.apply(this,arguments)}}(),c=a.error?O(a.error):null;return(0,f.jsxs)("div",{children:[(0,f.jsx)(ee,{level:3,style:{marginTop:0,marginBottom:4},children:"Вход в кабинет"}),(0,f.jsx)(re,{type:"secondary",style:{display:"block",marginBottom:24},children:"Введите email и пароль"}),(0,f.jsxs)(N.A,{form:l,layout:"vertical",onFinish:s,requiredMark:!1,autoComplete:"on",children:[(0,f.jsx)(N.A.Item,{name:"email",label:"Email",rules:[{required:!0,message:"Введите email"},{type:"email",message:"Некорректный email"}],children:(0,f.jsx)($.A,{size:"large",type:"email",placeholder:"user@example.com",autoFocus:!0})}),(0,f.jsx)(N.A.Item,{name:"password",label:"Пароль",rules:[{required:!0,message:"Введите пароль"}],children:(0,f.jsx)($.A.Password,{size:"large",placeholder:"••••••••"})}),c&&(0,f.jsx)("div",{style:{marginBottom:16,color:"#DC2626",fontSize:13},children:c}),(0,f.jsx)(x.Ay,{type:"primary",htmlType:"submit",size:"large",block:!0,loading:a.isPending,children:"Войти"}),(0,f.jsxs)("div",{style:{marginTop:16,display:"flex",justifyContent:"space-between"},children:[(0,f.jsx)(u.N_,{to:"/forgot-password",children:"Забыли пароль?"}),(0,f.jsx)(u.N_,{to:"/register",children:"Создать аккаунт"})]})]})]})}function ne(e,r,t,n,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void t(e)}a.done?r(s):Promise.resolve(s).then(n,i)}function ie(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t{var r=e.getFieldValue;return{validator:(e,t)=>t&&r("password")!==t?Promise.reject(new Error("Пароли не совпадают")):Promise.resolve()}}],children:(0,f.jsx)($.A.Password,{size:"large",placeholder:"••••••••",autoComplete:"new-password"})}),l&&(0,f.jsx)("div",{style:{marginBottom:16,color:"#DC2626",fontSize:13},children:l}),(0,f.jsx)(x.Ay,{type:"primary",htmlType:"submit",size:"large",block:!0,loading:i.isPending,children:"Зарегистрироваться"}),(0,f.jsxs)("div",{style:{marginTop:16,textAlign:"center"},children:[(0,f.jsx)(le,{type:"secondary",children:"Уже есть аккаунт? "}),(0,f.jsx)(u.N_,{to:"/login",children:"Войти"})]})]})]})}function se(e,r,t,n,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void t(e)}a.done?r(s):Promise.resolve(s).then(n,i)}function ce(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function l(e){se(o,n,i,l,a,"next",e)}function a(e){se(o,n,i,l,a,"throw",e)}l(void 0)})}}function ue(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,i,o,l,a=[],s=!0,c=!1;try{if(o=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=o.call(t)).done)&&(a.push(n.value),a.length!==r);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=t.return&&(l=t.return(),Object(l)!==l))return}finally{if(c)throw i}}return a}}(e,r)||function(e,r){if(e){if("string"==typeof e)return de(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?de(e,r):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function de(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);te.setUser),t=(0,i.jE)(),(0,V.n)({mutationFn:Y.verify,onSuccess:e=>{r(e.user),t.setQueryData(R.me(),e.user)}})),s=Q(),c=ue((0,w.useState)(null),2),h=c[0],m=c[1];if(!o)return(0,f.jsxs)("div",{children:[(0,f.jsx)(he,{level:3,style:{marginTop:0},children:"Подтверждение email"}),(0,f.jsx)(me,{type:"secondary",style:{display:"block",marginBottom:16},children:"Сначала зарегистрируйтесь."}),(0,f.jsx)(x.Ay,{type:"primary",size:"large",block:!0,onClick:()=>n("/register"),children:"К регистрации"})]});var y=function(){var e=ce(function*(e){try{yield a.mutateAsync({email:o,code:e.code}),n("/assistants")}catch(e){}});return function(r){return e.apply(this,arguments)}}(),p=function(){var e=ce(function*(){m(null);try{yield s.mutateAsync({email:o,password:"dummy_for_resend_xx"}),m("Код отправлен повторно. Проверьте почту.")}catch(e){m(O(e,"Не удалось отправить код повторно"))}});return function(){return e.apply(this,arguments)}}(),v=a.error?O(a.error):null;return(0,f.jsxs)("div",{children:[(0,f.jsx)(he,{level:3,style:{marginTop:0,marginBottom:4},children:"Подтверждение email"}),(0,f.jsxs)(me,{type:"secondary",style:{display:"block",marginBottom:24},children:["Мы отправили код на ",(0,f.jsx)("b",{style:{color:"#1A1A1A"},children:o}),". Введите его ниже."]}),(0,f.jsxs)(N.A,{form:l,layout:"vertical",onFinish:y,requiredMark:!1,children:[(0,f.jsx)(N.A.Item,{name:"code",label:"Код из письма",rules:[{required:!0,message:"Введите код"},{len:6,message:"Код состоит из 6 цифр"},{pattern:/^\d{6}$/,message:"Только цифры"}],children:(0,f.jsx)($.A,{size:"large",placeholder:"000000",maxLength:6,autoFocus:!0,inputMode:"numeric",style:{letterSpacing:4,fontSize:18,textAlign:"center"}})}),v&&(0,f.jsx)("div",{style:{marginBottom:16,color:"#DC2626",fontSize:13},children:v}),h&&(0,f.jsx)("div",{style:{marginBottom:16,color:"#059669",fontSize:13},children:h}),(0,f.jsx)(x.Ay,{type:"primary",htmlType:"submit",size:"large",block:!0,loading:a.isPending,children:"Подтвердить"}),(0,f.jsx)("div",{style:{marginTop:16,textAlign:"center"},children:(0,f.jsx)(x.Ay,{type:"link",onClick:p,loading:s.isPending,style:{padding:0},children:"Отправить код повторно"})}),(0,f.jsx)("div",{style:{marginTop:8,textAlign:"center"},children:(0,f.jsx)(u.N_,{to:"/login",children:"Назад ко входу"})})]})]})}function fe(e,r,t,n,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void t(e)}a.done?r(s):Promise.resolve(s).then(n,i)}function pe(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);te.length)&&(r=e.length);for(var t=0,n=Array(r);tn("/forgot-password"),children:"Запросить код"})]});var a=function(){var e,r=(e=function*(e){try{yield l.mutateAsync({email:i,code:e.code,new_password:e.new_password}),n("/login",{state:{passwordResetSuccess:!0}})}catch(e){}},function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function l(e){Ae(o,n,i,l,a,"next",e)}function a(e){Ae(o,n,i,l,a,"throw",e)}l(void 0)})});return function(e){return r.apply(this,arguments)}}(),s=l.error?O(l.error):null;return(0,f.jsxs)("div",{children:[(0,f.jsx)(be,{level:3,style:{marginTop:0,marginBottom:4},children:"Новый пароль"}),(0,f.jsxs)(we,{type:"secondary",style:{display:"block",marginBottom:24},children:["Код отправлен на ",(0,f.jsx)("b",{style:{color:"#1A1A1A"},children:i}),". Введите его и новый пароль."]}),(0,f.jsxs)(N.A,{form:o,layout:"vertical",onFinish:a,requiredMark:!1,children:[(0,f.jsx)(N.A.Item,{name:"code",label:"Код из письма",rules:[{required:!0,message:"Введите код"},{len:6,message:"Код состоит из 6 цифр"},{pattern:/^\d{6}$/,message:"Только цифры"}],children:(0,f.jsx)($.A,{size:"large",placeholder:"000000",maxLength:6,autoFocus:!0,inputMode:"numeric",style:{letterSpacing:4,fontSize:18,textAlign:"center"}})}),(0,f.jsx)(N.A.Item,{name:"new_password",label:"Новый пароль",rules:[{required:!0,message:"Придумайте пароль"},{min:8,message:"Минимум 8 символов"},{max:128,message:"Максимум 128 символов"}],children:(0,f.jsx)($.A.Password,{size:"large",placeholder:"••••••••",autoComplete:"new-password"})}),(0,f.jsx)(N.A.Item,{name:"passwordConfirm",label:"Повторите пароль",dependencies:["new_password"],rules:[{required:!0,message:"Повторите пароль"},e=>{var r=e.getFieldValue;return{validator:(e,t)=>t&&r("new_password")!==t?Promise.reject(new Error("Пароли не совпадают")):Promise.resolve()}}],children:(0,f.jsx)($.A.Password,{size:"large",placeholder:"••••••••",autoComplete:"new-password"})}),s&&(0,f.jsx)("div",{style:{marginBottom:16,color:"#DC2626",fontSize:13},children:s}),(0,f.jsx)(x.Ay,{type:"primary",htmlType:"submit",size:"large",block:!0,loading:l.isPending,children:"Сменить пароль"}),(0,f.jsx)("div",{style:{marginTop:16,textAlign:"center"},children:(0,f.jsx)(u.N_,{to:"/login",children:"Назад ко входу"})})]})]})}function Fe(e){var r=e.width,t=void 0===r?120:r,n=e.color,i=void 0===n?"#1F2937":n,o=t/4.8;return(0,f.jsx)("svg",{width:t,height:o,viewBox:"35 118 230 50",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"RiChat",children:(0,f.jsxs)("g",{fill:i,children:[(0,f.jsx)("path",{d:"M45.01,123.65h23.32c3.33,0,6.4,1.54,9.2,4.62,1.66,2.35,2.49,4.55,2.49,6.61v1.58c0,3.13-1.58,6.07-4.75,8.81-1.93,1.22-3.47,1.92-4.62,2.12v.05c4.04,3.53,6.7,5.98,7.97,7.36.56.93.85,1.82.85,2.66,0,2.02-1.15,3.54-3.44,4.54-.46.11-.79.16-1.01.16h-1.09c-1.27,0-2.96-1.11-5.05-3.33-.73-.59-4.86-4.31-12.4-11.15h-6.23v9.86c0,2.09-1.23,3.61-3.69,4.54-.27.05-.5.08-.68.08h-1.09c-1.66,0-3.01-.98-4.07-2.95-.2-.52-.3-.98-.3-1.37v-29.7c0-1.95,1.17-3.39,3.5-4.32.4-.11.76-.16,1.09-.16ZM50.25,133.21v5h17.44c1.38,0,2.5-1.12,2.5-2.5h0c0-1.38-1.12-2.5-2.5-2.5h-17.44Z"}),(0,f.jsx)("path",{d:"M87.47,123.65h.74c1.67,0,3.07.91,4.18,2.74.31.59.46,1.3.46,2.12v29.03c0,2.09-1.26,3.61-3.77,4.54-.29.05-.53.08-.71.08h-1.12c-1.71,0-3.1-.98-4.18-2.95-.22-.52-.33-.98-.33-1.37v-29.7c0-1.95,1.2-3.39,3.6-4.32.4-.11.77-.16,1.12-.16Z"}),(0,f.jsx)("path",{d:"M114.57,123.65h15.65c1.66,0,3.04.96,4.15,2.87.2.59.3,1.05.3,1.37v1.07c0,1.54-.98,2.83-2.95,3.87-.64.25-1.24.38-1.8.38h-13.16c-5.21,0-8.96,2.15-11.25,6.45-.4,1.18-.6,2.32-.6,3.41,0,3.49,2.02,6.29,6.06,8.41,1.79.75,3.51,1.13,5.16,1.13h13.33c2.55,0,4.26,1.19,5.13,3.57l.08.75v1.07c0,1.49-.94,2.75-2.81,3.79-.53.25-1.02.38-1.48.38h-16.3c-4.28,0-8.48-1.69-12.62-5.08-2.35-2.34-3.78-4.19-4.29-5.53-1.4-2.74-2.1-5.37-2.1-7.9v-1.42c0-4.58,1.95-8.91,5.84-12.97,4.19-3.74,8.74-5.61,13.65-5.61Z"}),(0,f.jsx)("path",{d:"M141.09,123.65h.71c1.62,0,2.98.91,4.07,2.74.31.59.46,1.3.46,2.12v9.61h19.94v-9.32c0-2.58,1.27-4.27,3.82-5.08.36-.05.66-.08.87-.08h.68c1.67,0,3.06.96,4.15,2.87.2.59.3,1.05.3,1.37v30.1c0,1.49-.94,2.75-2.81,3.79-.53.25-1.02.38-1.48.38h-1.09c-1.73,0-3.1-1.04-4.12-3.12-.22-.63-.33-1.31-.33-2.04v-9.32h-19.94v9.86c0,2.09-1.23,3.61-3.69,4.54-.27.05-.5.08-.68.08h-1.09c-1.66,0-3.01-.98-4.07-2.95-.2-.52-.3-.98-.3-1.37v-29.7c0-1.95,1.17-3.39,3.5-4.32.4-.11.76-.16,1.09-.16Z"}),(0,f.jsx)("path",{d:"M197.89,123.65h.85c2.02,0,3.65,1.58,4.89,4.75,9.34,18.1,14.15,27.51,14.42,28.23v1.45c0,1.63-1.09,2.94-3.28,3.92-.47.11-.86.16-1.15.16h-.71c-2.04,0-3.69-1.64-4.94-4.92-6.43-12.5-9.69-18.78-9.78-18.85-7.19,14.22-10.99,21.61-11.39,22.18-1.07,1.06-2.18,1.58-3.33,1.58h-.68c-1.66,0-3.02-.98-4.1-2.95-.16-.57-.25-1.03-.25-1.37v-.59c0-.72.93-2.78,2.79-6.2l13.16-25.57c1.04-1.22,2.2-1.83,3.5-1.83Z"}),(0,f.jsx)("path",{d:"M224.57,123.65h30.56c1.67,0,3.06.96,4.15,2.87.2.59.3,1.05.3,1.37v1.07c0,1.54-.98,2.83-2.95,3.87-.64.25-1.24.38-1.8.38h-10.13v24.46c0,1.99-1.19,3.46-3.58,4.4l-.79.08h-1.09c-1.58,0-2.91-.96-3.99-2.87-.25-.63-.38-1.21-.38-1.75v-24.33h-9.89c-2.31,0-3.92-1.14-4.83-3.41-.11-.47-.16-.8-.16-.99v-.67c0-1.95,1.17-3.39,3.5-4.32.4-.11.76-.16,1.09-.16Z"})]})})}function Se(e){var r=e.children;return(0,f.jsxs)("div",{style:{minHeight:"100vh",background:"#F9FAFB",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"24px 16px"},children:[(0,f.jsx)(u.N_,{to:"/",style:{marginBottom:32},children:(0,f.jsx)(Fe,{width:140})}),(0,f.jsx)(m.A,{style:{width:"100%",maxWidth:400,boxShadow:"0 1px 3px rgba(0,0,0,0.04)"},styles:{body:{padding:"32px 28px"}},children:r}),(0,f.jsx)("div",{style:{marginTop:24,color:"#9CA3AF",fontSize:12},children:"© RiChat · Конструктор ИИ-ассистентов"})]})}function Ee(){return(0,f.jsx)(Se,{children:(0,f.jsx)(xe,{})})}var Be=t(7197);function ke(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t{if(o){var e=setTimeout(()=>l(!1),8e3);return()=>clearTimeout(e)}},[o]),(0,f.jsxs)(Se,{children:[o&&(0,f.jsx)(Be.A,{type:"success",message:"Пароль успешно изменён. Войдите с новым паролем.",showIcon:!0,style:{marginBottom:16},closable:!0,onClose:()=>l(!1)}),(0,f.jsx)(te,{})]})}var Te=t(1568);function Oe(){var e=(0,d.Zp)();return(0,f.jsx)(Te.Ay,{status:"404",title:"404",subTitle:"Страница не найдена",extra:(0,f.jsx)(x.Ay,{type:"primary",onClick:()=>e("/"),children:"На главную"})})}function Ie(){return(0,f.jsx)(Se,{children:(0,f.jsx)(ae,{})})}function ze(){return(0,f.jsx)(Se,{children:(0,f.jsx)(Ce,{})})}var _e=h.A.Title,qe=h.A.Text;function Me(){var e,r=j(e=>e.user);return(0,f.jsxs)("div",{children:[(0,f.jsx)(_e,{level:2,style:{marginTop:0},children:"Настройки"}),(0,f.jsxs)(m.A,{children:[(0,f.jsx)(qe,{type:"secondary",children:"ID юзера: "}),(0,f.jsx)(qe,{code:!0,children:null!==(e=null==r?void 0:r.id)&&void 0!==e?e:"—"}),(0,f.jsx)("br",{}),(0,f.jsx)(qe,{type:"secondary",children:"Дата регистрации: "}),(0,f.jsx)(qe,{children:null!=r&&r.joined_at?new Date(r.joined_at).toLocaleDateString("ru-RU"):"—"})]})]})}function Re(){return(0,f.jsx)(Se,{children:(0,f.jsx)(ye,{})})}var Ue=t(5448),De=t(7206),He=t(5779),Le=t(1922);function Ze(e,r,t,n,i,o,l){try{var a=e[o](l),s=a.value}catch(e){return void t(e)}a.done?r(s):Promise.resolve(s).then(n,i)}var We=Ue.A.Sider,Ne=Ue.A.Header,$e=Ue.A.Content;function Ve(){var e,r,t,n,o,l,a=(0,d.Zp)(),s=(0,d.zy)(),c=j(e=>e.user),u=(o=j(e=>e.reset),l=(0,i.jE)(),(0,V.n)({mutationFn:Y.logout,onSettled:()=>{o(),l.clear()}})),h=function(){var e,r=(e=function*(){try{yield u.mutateAsync()}finally{a("/login")}},function(){var r=this,t=arguments;return new Promise(function(n,i){var o=e.apply(r,t);function l(e){Ze(o,n,i,l,a,"next",e)}function a(e){Ze(o,n,i,l,a,"throw",e)}l(void 0)})});return function(){return r.apply(this,arguments)}}(),m=s.pathname.startsWith("/assistants")?"assistants":s.pathname.startsWith("/billing")?"billing":s.pathname.startsWith("/settings")?"settings":"assistants",y=[{key:"assistants",label:"Ассистенты",onClick:()=>a("/assistants")},{key:"billing",label:"Биллинг",onClick:()=>a("/billing")},{key:"settings",label:"Настройки",onClick:()=>a("/settings")}],p=[{key:"logout",label:"Выйти",onClick:h}],v=null!==(e=null==c||null===(r=c.tg_account)||void 0===r?void 0:r.name)&&void 0!==e?e:"Профиль",g=null!==(t=null===(n=v[0])||void 0===n?void 0:n.toUpperCase())&&void 0!==t?t:"У";return(0,f.jsxs)(Ue.A,{style:{minHeight:"100vh"},children:[(0,f.jsxs)(We,{width:240,style:{background:"#FFFFFF",borderRight:"1px solid #E5E7EB"},children:[(0,f.jsx)("div",{style:{padding:"20px 20px 16px",borderBottom:"1px solid #F3F4F6",display:"flex",alignItems:"center"},children:(0,f.jsx)(Fe,{width:110})}),(0,f.jsx)(De.A,{mode:"inline",selectedKeys:[m],items:y,style:{borderInlineEnd:"none",padding:"12px 8px"}})]}),(0,f.jsxs)(Ue.A,{children:[(0,f.jsx)(Ne,{style:{background:"#FFFFFF",borderBottom:"1px solid #E5E7EB",display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"0 24px"},children:(0,f.jsx)(He.A,{menu:{items:p},placement:"bottomRight",children:(0,f.jsxs)(x.Ay,{type:"text",style:{display:"flex",alignItems:"center",gap:8},children:[(0,f.jsx)(Le.A,{size:28,style:{background:"#1F2937",fontSize:13},children:g}),(0,f.jsx)("span",{style:{color:"#1A1A1A",fontWeight:500},children:v})]})})}),(0,f.jsx)($e,{style:{padding:24,background:"#F9FAFB"},children:(0,f.jsx)(d.sv,{})})]})]})}var Ge=t(9029);function Ke(e){var r=e.children,t=(0,d.zy)(),n=j(e=>e.user),i=function(e){var r=j(e=>e.setUser),t=(0,b.I)(function(e){for(var r=1;r_(),staleTime:6e4,retry:(e,r)=>{var t,n=null===(t=r.response)||void 0===t?void 0:t.status;return 401!==n&&403!==n&&e<1}},e));return(0,w.useEffect)(()=>{t.data&&r(t.data)},[t.data,r]),t}({enabled:!n});return n?(0,f.jsx)(f.Fragment,{children:r}):i.isLoading?(0,f.jsx)("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(Ge.A,{size:"large"})}):(0,f.jsx)(d.C5,{to:"/login",replace:!0,state:{from:t.pathname}})}function Ye(e){var r=e.children;return j(e=>e.user)?(0,f.jsx)(d.C5,{to:"/assistants",replace:!0}):(0,f.jsx)(f.Fragment,{children:r})}function Qe(){return(0,f.jsx)(u.Kd,{children:(0,f.jsxs)(d.BV,{children:[(0,f.jsx)(d.qh,{path:"/login",element:(0,f.jsx)(Ye,{children:(0,f.jsx)(Pe,{})})}),(0,f.jsx)(d.qh,{path:"/register",element:(0,f.jsx)(Ye,{children:(0,f.jsx)(Ie,{})})}),(0,f.jsx)(d.qh,{path:"/verify-email",element:(0,f.jsx)(Ye,{children:(0,f.jsx)(Re,{})})}),(0,f.jsx)(d.qh,{path:"/forgot-password",element:(0,f.jsx)(Ye,{children:(0,f.jsx)(Ee,{})})}),(0,f.jsx)(d.qh,{path:"/reset-password",element:(0,f.jsx)(Ye,{children:(0,f.jsx)(ze,{})})}),(0,f.jsxs)(d.qh,{element:(0,f.jsx)(Ke,{children:(0,f.jsx)(Ve,{})}),children:[(0,f.jsx)(d.qh,{index:!0,element:(0,f.jsx)(d.C5,{to:"/assistants",replace:!0})}),(0,f.jsx)(d.qh,{path:"/assistants",element:(0,f.jsx)(H,{})}),(0,f.jsx)(d.qh,{path:"/assistants/:id",element:(0,f.jsx)(g,{})}),(0,f.jsx)(d.qh,{path:"/billing",element:(0,f.jsx)(W,{})}),(0,f.jsx)(d.qh,{path:"/settings",element:(0,f.jsx)(Me,{})})]}),(0,f.jsx)(d.qh,{path:"*",element:(0,f.jsx)(Oe,{})})]})})}var Je=t(5072),Xe=t.n(Je),er=t(7825),rr=t.n(er),tr=t(7659),nr=t.n(tr),ir=t(5056),or=t.n(ir),lr=t(540),ar=t.n(lr),sr=t(1113),cr=t.n(sr),ur=t(6777),dr={};function hr(){return(0,f.jsxs)(i.Ht,{client:c,children:[(0,f.jsx)(o.Ay,{theme:s,locale:a.A,children:(0,f.jsx)(l.A,{children:(0,f.jsx)(Qe,{})})}),!1]})}dr.styleTagTransform=cr(),dr.setAttributes=or(),dr.insert=nr().bind(null,"head"),dr.domAPI=rr(),dr.insertStyleElement=ar(),Xe()(ur.A,dr),ur.A&&ur.A.locals&&ur.A.locals;var mr=document.getElementById("root");if(!mr)throw new Error("Root element #root not found in index.html");(0,n.H)(mr).render((0,f.jsx)(hr,{}))},6777(e,r,t){t.d(r,{A:()=>a});var n=t(1354),i=t.n(n),o=t(6314),l=t.n(o)()(i());l.push([e.id,"/* Глобальные стили — минимум, всё остальное через AntD theme. */\n\n* {\n box-sizing: border-box;\n}\n\nhtml,\nbody,\n#root {\n margin: 0;\n padding: 0;\n height: 100%;\n}\n\nbody {\n font-family:\n 'Inter',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n background: #f9fafb;\n color: #1a1a1a;\n}\n\na {\n color: #1f2937;\n text-decoration: none;\n transition: color 0.15s ease;\n}\n\na:hover {\n color: #374151;\n text-decoration: underline;\n}\n\n/* Скроллбары — тонкие и светло-серые */\n::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n}\n::-webkit-scrollbar-track {\n background: transparent;\n}\n::-webkit-scrollbar-thumb {\n background: #d1d5db;\n border-radius: 4px;\n}\n::-webkit-scrollbar-thumb:hover {\n background: #9ca3af;\n}\n","",{version:3,sources:["webpack://./src/app/styles.css"],names:[],mappings:"AAAA,gEAAgE;;AAEhE;EACE,sBAAsB;AACxB;;AAEA;;;EAGE,SAAS;EACT,UAAU;EACV,YAAY;AACd;;AAEA;EACE;;;;;;cAMY;EACZ,mCAAmC;EACnC,kCAAkC;EAClC,mBAAmB;EACnB,cAAc;AAChB;;AAEA;EACE,cAAc;EACd,qBAAqB;EACrB,4BAA4B;AAC9B;;AAEA;EACE,cAAc;EACd,0BAA0B;AAC5B;;AAEA,uCAAuC;AACvC;EACE,UAAU;EACV,WAAW;AACb;AACA;EACE,uBAAuB;AACzB;AACA;EACE,mBAAmB;EACnB,kBAAkB;AACpB;AACA;EACE,mBAAmB;AACrB",sourcesContent:["/* Глобальные стили — минимум, всё остальное через AntD theme. */\n\n* {\n box-sizing: border-box;\n}\n\nhtml,\nbody,\n#root {\n margin: 0;\n padding: 0;\n height: 100%;\n}\n\nbody {\n font-family:\n 'Inter',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n background: #f9fafb;\n color: #1a1a1a;\n}\n\na {\n color: #1f2937;\n text-decoration: none;\n transition: color 0.15s ease;\n}\n\na:hover {\n color: #374151;\n text-decoration: underline;\n}\n\n/* Скроллбары — тонкие и светло-серые */\n::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n}\n::-webkit-scrollbar-track {\n background: transparent;\n}\n::-webkit-scrollbar-thumb {\n background: #d1d5db;\n border-radius: 4px;\n}\n::-webkit-scrollbar-thumb:hover {\n background: #9ca3af;\n}\n"],sourceRoot:""}]);const a=l}},i={};function o(e){var r=i[e];if(void 0!==r)return r.exports;var t=i[e]={id:e,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.exports}o.m=n,e=[],o.O=(r,t,n,i)=>{if(!t){var l=1/0;for(u=0;u=i)&&Object.keys(o.O).every(e=>o.O[e](t[s]))?t.splice(s--,1):(a=!1,i0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[t,n,i]},o.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return o.d(r,{a:r}),r},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,n){if(1&n&&(e=this(e)),8&n)return e;if("object"==typeof e&&e){if(4&n&&e.__esModule)return e;if(16&n&&"function"==typeof e.then)return e}var i=Object.create(null);o.r(i);var l={};r=r||[null,t({}),t([]),t(t)];for(var a=2&n&&e;("object"==typeof a||"function"==typeof a)&&!~r.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach(r=>l[r]=()=>e[r]);return l.default=()=>e,o.d(i,l),i},o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={792:0};o.O.j=r=>0===e[r];var r=(r,t)=>{var n,i,[l,a,s]=t,c=0;if(l.some(r=>0!==e[r])){for(n in a)o.o(a,n)&&(o.m[n]=a[n]);if(s)var u=s(o)}for(r&&r(t);co(4678));l=o.O(l)})(); //# sourceMappingURL=main.1a424e38.js.map