PageSourceSearch

https://buki.com.ua/_next/static/chunks/pages/panel/admins_show/[id]-f31d317aeae08c95.js

js buki.com.ua collected 2026-10-02 10:01:07 UTC 17,950 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="15101198-91f6-4dd7-b8c8-f22bace62f2d",e._sentryDebugIdIdentifier="sentry-dbid-15101198-91f6-4dd7-b8c8-f22bace62f2d")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[959,3376],{8272:e=>{e.exports={"gilroy-text":"styles_gilroy-text__KYSTC",form:"styles_form__MDqXS",adminInfo:"styles_adminInfo__f5OMy",panelBox:"styles_panelBox__cV71g",panelTitle:"styles_panelTitle__taTJi",avatarBox:"styles_avatarBox__wKcp_",fieldWrapper:"styles_fieldWrapper__l81sy",hide:"styles_hide__X6GtO",inputBox:"styles_inputBox__tlmWS",orderRow:"styles_orderRow__bLbua",statusPanel:"styles_statusPanel___N_Fp",buttonContainer:"styles_buttonContainer__2jBfl",buttonWrapper:"styles_buttonWrapper__W_D3k",hint:"styles_hint__ySq5f",statusButton:"styles_statusButton__Q5dPp",mark:"styles_mark__B3z3c",markOn:"styles_markOn__FoMla",activeTutorOff:"styles_activeTutorOff__tDjB7",activeTutorOn:"styles_activeTutorOn__CvQdK",getOrders:"styles_getOrders__zKvRG",atNight:"styles_atNight__Hnr_X",department1:"styles_department1__m_xLT",department2:"styles_department2__KyYPc",department3:"styles_department3__Fc1JQ",active:"styles_active__Pd40d",eventButton:"styles_eventButton__RHlNr"}},12352:(e,a,s)=>{"use strict";s.d(a,{W:()=>r});let t=e=>!!e&&"object"==typeof e&&(null==e?void 0:e.status)==="fail"&&"statusCode"in e,r=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};arguments.length>2&&arguments[2];let s=a.defaults||{},r={},n={};for(let[a,i]of Object.entries(e))t(i)?(r[a]=i,n[a]=Object.prototype.hasOwnProperty.call(s,a)?s[a]:{}):n[a]=null!=i?i:Object.prototype.hasOwnProperty.call(s,a)?s[a]:i;return Object.keys(r).length>0?{...(e=>{let a=Object.values(e).map(e=>{if(e&&e.statusCode)return e.statusCode});if(a.includes(404))return{statusCode:404,notFound:!0};if(a.includes(429))return{statusCode:429};if(a.includes(403))return{statusCode:403};if(a.includes(410))return{statusCode:410};if(a.includes(0))return{statusCode:0};else return{statusCode:500}})(r),hasErrors:!0}:{data:n,hasErrors:!1,statusCode:200}}},43376:e=>{"use strict";e.exports=JSON.parse('{"main_info_title":"Основна інформація","access_panel":"Доступ до панелі керування","login":{"header":"Логін адміністратора:","placeholder":"Вкажіть логін","required":"Необхідно заповнити","warning":"Не більше 150 символів","warningUnique":"Цей логін вже зайнятий"},"password":{"header":"Пароль адміністратора:","placeholder":"Пароль","min":"Має містити не меншe 8 символів","max":"Має містити не більше 30 символів","required":"Необхідно заповнити"},"name":{"header":"ПІБ адміністратора:","placeholder":"Вкажіть ПІБ","required":"Необхідно заповнити","max":"Не більше 100 символів"},"email":{"header":"E-mail:","placeholder":"E-mail","required":"Необхідно заповнити","max":"Має містити не більше 100 символів","warning":"Введіть коректну email адресу","warningUnique":"Цей Email вже зайнятий"},"contacts":{"header":"Контакти адміністратора:","placeholder":"Контакти","max":"Має містити не більше 150 символів"},"level":{"header":"Рівень адміністратора:","placeholder":"Рівень","warning":"Має бути вказаний один з рівнів","level_1":"половина робочого дня","level_2":"повний робочий день"},"binotel_number":{"header":"Внутрішній номер Binotel:","placeholder":"номер Binotel...","integer":"Має бути ціле число"},"ringostat_number":{"header":"Внутрішній номер Ringostat:","placeholder":"номер або сіп-логін","integer":"Має бути ціле число"},"telegram_chat_id":{"header":"Телеграм бот ID:","placeholder":"id...","integer":"Має бути ціле число"},"status":{"header":"Статус адміністратора:","placeholder":"Оберіть статус","required":"Обов\'язкове поле","options":{"1":"суперадмін","2":"менеджер","3":"контент-менеджер","4":"адмін"}},"popup_accept":"Підтвердити","popup_cancel":"Відмінити","delete_confirmation_title":"Підтвердження видалення","delete_confirmation_message":"Ви дійсно бажаєте видалити обраний запис?","board_text_filter_label":"Пошук:","board_text_filter_placeholder":"Пошук...","admin_status_title":"Статус"}')},51714:(e,a,s)=>{"use strict";s.d(a,{O:()=>t});let t=e=>
1e.req?{cookie:e.req.headers.cookie}:void 0},65716:(e,a,s)=>{"use strict";s.d(a,{P:()=>i});var t=s(14232),r=s(89099),n=s.n(r);let i=(e,a)=>{(0,t.useEffect)(()=>{let s=()=>{localStorage.setItem("last_visited_".concat(e),a)};return n().router.events.on("beforeHistoryChange",s),()=>{n().router.events.off("beforeHistoryChange",s)}},[])}},75756:(e,a,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/panel/admins_show/[id]",function(){return s(86129)}])},86129:(e,a,s)=>{"use strict";s.r(a),s.d(a,{default:()=>X});var t=s(37876),r=s(14232),n=s(89099),i=s(48230),l=s.n(i),d=s(95062),o=s.n(d),c=s(50223),m=s(34906),p=s.n(m),u=s(24467),h=s(54443),x=s(63436),_=s(8272),j=s.n(_),v=s(75597),f=s(57491),N=s(65716),y=s(18772),b=s(39091);let{login:g,password:w,name:k,email:B,contacts:C,level:E,binotel_number:O,telegram_chat_id:q,status:W}=s(43376),D=()=>b.Ik().shape({login:b.Yj().max(150,g.max).required(g.required),password:b.Yj().when(["action"],{is:e=>!!e,then:b.Yj().min(8,w.min).max(30,w.max).required(w.required),otherwise:b.Yj()}),name:b.Yj().max(100,k.max).required(k.required),email:b.Yj().matches(/^[A-Z0-9._%+-]+@[A-Z0-9-]+.+[A-Z]{2,4}$/i,B.warning).max(150,B.max).required(B.required),contacts:b.Yj().max(150,C.max),binotel_number:b.ai().typeError(O.integer).integer(O.integer),telegram_chat_id:b.ai().typeError(q.integer).integer(q.integer).min(0),level:b.ai().oneOf([1,2],E.warning).required(E.required),status:b.ai().oneOf([1,2,3,4],W.required).required(W.required)}),R={newAdmin:{login:"",password:"",name:"",email:"",contacts:"",level:0,binotel_number:"",ringostat_number:"",active:0,at_work:0,night_work:0,department_1:0,department_2:0,department_3:0,avatar:null,status:0}},T=p().bind(j()),S=e=>{let{errors:a,values:s,setFieldValue:n,isSubmitting:i,isValidating:d,submitCount:o,formData:m,textDataAvatar:p,router:h,action:_,savingErrors:f,initialValues:b}=e,{status:g,login:w,password:k,name:B,email:C,contacts:E,level:O,binotel_number:q,ringostat_number:W,telegram_chat_id:D,main_info_title:R,access_panel:S}=m,{startFetching:I,stopFetching:P}=(0,r.useContext)(x.A),[K,A]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=localStorage.getItem("admin_mark-".concat(s.id));e&&A(e)});let H=async(e,a)=>{I();let t=await y.H.changeCheckout({admin_id:s.id,field:e,value:a});"success"===t.status?(n(e,a),P({type:"success",message:""})):(P({type:"error",message:t.error}),console.log(t.error),t.error&&"unauthorized admin"===t.error&&h.push(h.asPath))},Y=async()=>{await H("at_work",+!s.at_work)},z=async()=>{await H("active",+!s.active)},L=async()=>{await H("night_work",+!s.night_work)},X=async()=>{await H("department_1",+!s.department_1)},F=async()=>{await H("department_2",+!s.department_2)},J=async()=>{await H("department_3",+!s.department_3)};return(0,r.useEffect)(()=>{if(i&&!d){let e=Object.keys(a);e.length>0&&window.scrollTo(0,(0,v.kt)(e[0]))}},[a,i,d]),(0,N.P)("admin",s.id),(0,t.jsxs)(c.lV,{className:j().form,children:[(0,t.jsx)("section",{className:j().adminInfo,children:(0,t.jsxs)("div",{className:j().panelBox,children:[(0,t.jsxs)("div",{className:j().orderRow,children:[(0,t.jsx)("p",{className:j().panelTitle,children:R}),b.id&&(0,t.jsx)("p",{children:"# ".concat(b.id)})]}),!_&&(0,t.jsxs)("div",{className:j().statusPanel,children:[(0,t.jsx)("div",{className:j().buttonContainer,children:(0,t.jsxs)("div",{className:j().buttonWrapper,children:[(0,t.jsx)("button",{className:T({statusButton:!0,[K?"markOn":"mark"]:!0,active:!0}),type:"button",onClick:()=>{K?localStorage.removeItem("admin_mark-".concat(s.id)):localStorage.setItem("admin_mark-".concat(s.id),!K),A(!K)}}),(0,t.jsx)("span",{className:j().hint,children:"Службова позначка"})]})}),(0,t.jsx)("div",{className:j().buttonContainer,children:(0,t.jsxs)("div",{className:j().buttonWrapper,children:[(0,t.jsx)("button",{className:T({statusButton:!0,activeTutorOff:!!s.active,activeTutorOn:!s.active,active:!0}),type:"button",onClick:z}),(0,t.jsx)("span",{className:j().hint,children:"Активний адміністратор"})]})}),(0,t.jsx)("div",{className:j().buttonContainer,children:(0,t.jsxs)("div",{className:j().buttonWrapper,children:[(0,t.jsx)("button",{className:T({statusButton:!0,getOrders:!0,active:!!s.at_work}),type:"button",onClick:Y}),(0,t.jsx)("span",{className:j().hint,children:"Бере заявки"})]})}),(0,t.jsx)("div",{className:j().buttonContainer,children:(0,t.jsxs)("div",{className:j().buttonWrapper,children:[(0,t.jsx)("button",{className:T({statusButton:!0,atNight:!0,active:!!s.night_work}),type:"button",onClick:L}),(0,t.jsx)("span",{className:j().hint,children:"Нічний час"})]})}),(0,t.jsx)("div",{className:j().buttonContainer,children:(0,t.jsxs)("div",{className:j().buttonWrapper,children:[(0,t.jsx)("button",{className:T({statusButton:!0,department1:!0,active:!!s.department_1}),type:"button",onClick:X}),(0,t.jsx)("span",{className:j().hint,children:"1 відділ"})]})}),(0,t.jsx)("div",{className:j().buttonContainer,children:(0,t.jsxs)("div",{className:j().buttonWrapper,children:[(0,t.jsx)("button",{className:T({statusButton:!0,department2:!0,active:!!s.department_2}),type:"button",onClick:F}),(0,t.jsx)("span",{className:j().hint,children:"2 відділ"})]})}),(0,t.jsx)("div",{className:j().buttonContainer,children:(0,t.jsxs)("div",{className:j().buttonWrapper,children:[(0,t.jsx)("button",{className:T({statusButton:!0,department3:!0,active:!!s.department_3}),type:"button",onClick:J}),(0,t.jsx)("span",{className:j().hint,children:"3 відділ"})]})})]}),(0,t.jsx)("div",{className:j().fieldWrapper,children:(0,t.jsx)(l(),{legacyBehavior:!0,href:"/auth_as_user/?admin=".concat(s.id),children:(0,t.jsx)("a",{children:"Авторизуватися"})})}),(0,t.jsxs)("div",{className:j().fieldWrapper,children:[(0,t.jsx)("p",{children:g.header}),(0,t.jsx)("div",{className:j().inputBox,children:(0,t.jsxs)(c.D0,{component:"select",name:"status",children:[(0,t.jsx)("option",{value:"",hidden:!0,children:g.placeholder}),Object.entries(g.options).map(e=>{let[a,s]=e;return(0,t.jsx)("option",{value:a,children:s},a)})]})}),(0,t.jsx)(c.Kw,{className:"fieldError",component:"div",name:"status"})]}),(0,t.jsx)("div",{className:j().orderRow,children:(0,t.jsxs)("div",{className:j().fieldWrapper,children:[(0,t.jsx)("p",{children:O.header}),(0,t.jsxs)("div",{className:j().inputBox,children:[(0,t.jsxs)(c.D0,{component:"select",name:"level",children:[(0,t.jsx)("option",{value:"",hidden:!0,children:O.placeholder}),(0,t.jsx)("option",{value:1,children:O.level_1}),(0,t.jsx)("option",{value:2,children:O.level_2})]}),(0,t.jsx)(c.Kw,{className:"fieldError",component:"div",name:"level"})]})]})}),(0,t.jsx)("div",{className:j().orderRow,children:(0,t.jsxs)("div",{className:j().fieldWrapper,children:[(0,t.jsx)("p",{children:w.header}),(0,t.jsxs)("div",{className:j().inputBox,children:[(0,t.jsx)(c.D0,{name:"login",placeholder:w.placeholder}),f.login?(0,t.jsx)("div",{className:"fieldError",children:"".concat(f.login)}):(0,t.jsx)(c.Kw,{className:"fieldError",component:"div",name:"login"})]})]})}),(0,t.jsx)(c.D0,{type:"hidden",name:"action",value:!!b.action}),(0,t.jsx)("div",{className:j().orderRow,children:(0,t.jsxs)("div",{className:T({fieldWrapper:!0}),children:[(0,t.jsx)("p",{children:k.header}),(0,t.jsxs)("div",{className:j().inputBox,children:[(0,t.jsx)(c.D0,{name:"password",placeholder:k.placeholder}),(0,t.jsx)(c.Kw,{className:"fieldError",component:"div",name:"password"})]})]})}),(0,t.jsx)("div",{className:j().orderRow,children:(0,t.jsxs)("div",{className:j().fieldWrapper,children:[(0,t.jsx)("p",{children:B.header}),(0,t.jsx)("div",{className:j().inputBox,children:(0,t.jsx)(c.D0,{name:"name",placeholder:B.placeholder})}),(0,t.jsx)(c.Kw,{className:"fieldError",component:"div",name:"name"})]})}),(0,t.jsx)("div",{className:j().orderRow,children:(0,t.jsxs)("div",{className:j().fieldWrapper,children:[(0,t.jsx)("p",{children:E.header}),(0,t.jsxs)("div",{className:j().inputBox,children:[(0,t.jsx)(c.D0,{name:"contacts",placeholder:E.placeholder}),(0,t.jsx)(c.Kw,{className:"fieldError",component:"div",name:"contacts"})]})]})}),(0,t.jsx)("div",{className:j().orderRow,children:(0,t.jsxs)("div",{className:j().fieldWrapper,children:[(0,t.jsx)("p",{children:C.header}),(0,t.jsxs)("div",{className:j().inputBox,children:[(0,t.jsx)(c.D0,{name:"email",placeholder:C.placeholder}),f.email?(0,t.jsx)("div",{className:"fieldError",children:"".concat(f.email)}):(0,t.jsx)(c.Kw,{className:"fieldError",component:"div",name:"email"})]})]})}),(0,t.jsx)("div",{className:j().orderRow,children:(0,t.jsxs)("div",{className:j().fieldWrapper,children:[(0,t.jsx)("p",{children:q.header}),(0,t.jsx)("div",{className:j().inputBox,children:(0,t.jsx)(c.D0,{name:"binotel_number",placeholder:q.placeholder})}),(0,t.jsx)(c.Kw,{className:"fieldError",component:"div",name:"binotel_number"})]})}),(0,t.jsx)("div",{className:j().orderRow,children:(0,t.jsxs)("div",{className:j().fieldWrapper,children:[(0,t.jsx)("p",{children:W.header}),(0,t.jsx)("div",{className:j().inputBox,children:(0,t.jsx)(c.D0,{name:"ringostat_number",placeholder:W.placeholder})}),(0,t.jsx)(c.Kw,{className:"fieldError",component:"div",name:"ringostat_number"})]})}),(0,t.jsx)("div",{className:j().orderRow,children:(0,t.jsxs)("div",{className:j().fieldWrapper,children:[(0,t.jsx)("p",{children:D.header}),(0,t.jsx)("div",{className:j().inputBox,children:(0,t.jsx)(c.D0,{name:"telegram_chat_id",placeholder:D.placeholder})}),(0,t.jsx)(c.Kw,{className:"fieldError",component:"div",name:"telegram_chat_id"})]})})]})}),(0,t.jsxs)("section",{className:j().adminInfo,children:[(0,t.jsxs)("div",{className:j().panelBox,children:[(0,t.jsx)("h3",{children:"Статуси"}),(0,t.jsx)("p",{children:"1 - супер адмін"}),(0,t.jsx)("p",{children:"2 - менеджер по роботі з клієнтами"}),(0,t.jsx)("p",{children:"3 - контент менеджер"})]}),(0,t.jsx)("div",{className:j().panelBox,children:(0,t.jsx)("div",{className:j().orderRow,children:(0,t.jsx)("p",{className:j().panelTitle,children:S})})}),b.id&&(0,t.jsxs)("div",{className:j().panelBox,children:[(0,t.jsx)("p",{className:j().panelTitle,children:"Avatar"}),(0,t.jsx)("div",{className:T({avatarBox:!0,orderRow:!0}),children:(0,t.jsx)(u.A,{id:s.id,avatar:s.avatar,role:"admin",textData:p})})]})]})]})},I=e=>{let a=(0,n.useRouter)(),{startFetching:s,stopFetching:i}=(0,r.useContext)(x.A),l={..."create"!==e.action?e.profile:R.newAdmin,...{password:""},...{action:e.action}},[d,o]=(0,r.useState)(l),[m,p]=(0,r.useState)(!1),[u,_]=(0,r.useState)(""),v=async t=>{let r;if(s(),"success"===(r="copy"!==e.action&&"create"!==e.action||d.id?await y.H.save(t):await y.H.create(t)).status){if(o(r.data.admin),i({type:"success",message:"Нові дані успішно збережені"}),m){if("schedule"===a.query.source)a.push("/panel/admins_schedule/");else{let e=(0,f.R)(a);a.push({pathname:a.pathname.slice(0,-5),query:e})}return}if(e.action){let e=(0,f.R)(a);a.push({pathname:a.pathname,query:{id:r.data.admin.id,...e}});return}u&&_("")}else _(r.error),i({type:"error",message:r.error}),r.error&&"unauthorized admin"===r.error&&a.push(a.asPath)};return(0,t.jsx)("div",{className:j().form,children:(0,t.jsx)(c.l1,{initialValues:d,validationSchema:D,onSubmit:v,enableReinitialize:!0,component:s=>(0,t.jsxs)("div",{children:[(0,t.jsx)(h.A,{router:a,title:void 0===e.action?"#".concat(d.id," - ").concat(d.name):"Створення адміністратора",type:"single",formikProps:s,savingErrors:u,setSavingErrors:_,setIsSaveExit:p}),(0,t.jsx)(S,{formData:e.formData,textDataAvatar:e.textDataAvatar,action:e.action,router:a,...s,savingErrors:u,setSavingErrors:_,setIsSaveExit:p})]})})})};I.propTypes={errors:o().objectOf(o().string),touched:o().objectOf(o().bool)};var P=s(50925),K=s(39511),A=s(51714),H=s(12352),Y=s(51218),z=s.n(Y);let L=e=>e.authError?(0,t.jsx)("div",{className:z().adminLayout,children:(0,t.jsx)(P.A,{})}):e.access_error?(0,t.jsx)("div",{className:z().adminLayout,children:(0,t.jsx)(K.A,{})}):(0,t.jsx)("div",{className:z().adminLayout,children:(0,t.jsx)(I,{...e})});L.getInitialProps=async e=>{var a;let t,r,{ctx:n}=e,i=(0,A.O)(n),l=await Promise.resolve().then(s.t.bind(s,43376,19)),d=await s.e(8060).then(s.t.bind(s,68060,19));"copy"===n.query.action?(r="copy",t=await y.H.get(i,n.query.id)):"create"===n.query.action?r="create":t=await y.H.get(i,n.query.id);let{hasErrors:o,statusCode:c}=(0,H.W)({adminProfile:t});return o?(n.res&&(n.res.statusCode=c),{statusCode:c}):"create"!==r&&t.error&&"unauthorized admin"===t.error?{authError:!0}:(null==t?void 0:t.error)&&(null==t?void 0:t.error)==="forbidden"?{access_error:!0}:{profile:null==t||null==(a=t.data)?void 0:a.admin,action:r,formData:l,textDataAvatar:d}};let X=L}},e=>{e.O(0,[223,9091,8072,5862,7418,639,233,2918,4467,636,6593,8792],()=>e(e.s=75756)),_N_E=e.O()}]);

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