PageSourceSearch

https://ok4u.club/_next/static/chunks/pages/ideas/[id]-e27b7246f3110e08.js

js ok4u.club collected 2026-10-07 18:06:30 UTC 6,702 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9841],{11657:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/ideas/[id]",function(){return t(4915)}])},4915:function(e,s,t){"use strict";t.r(s),t.d(s,{__N_SSP:function(){return S},default:function(){return k}});var n=t(85893),i=t(67294),a=t(12918),l=t.n(a),c=t(9008),r=t.n(c),d=t(33916),x=t(18810),o=t(16318),m=t(10675),u=t(99737),h=t(76720),j=t(56236),v=t(27346),p=t(98186);function f(e){let{idea:s,comment:t,onHide:a,onSuccess:l}=e,[c,r]=(0,i.useState)(t||""),[d,x]=(0,i.useState)({}),o=async()=>{let e=await (0,m.K_)(s.id,c),t=await e.json();e.ok?(l&&l(t.comment),a()):x(t)};return(0,n.jsxs)(v.Z,{show:!0,centered:!0,className:"modal--fancy modal-enrollment",onHide:a,children:[(0,n.jsx)(v.Z.Header,{closeButton:!0,children:(0,n.jsx)(v.Z.Title,{as:"h5",children:"Комментарий к идее"})}),(0,n.jsx)(v.Z.Body,{children:(0,n.jsx)("div",{className:"mx-auto text-start text-condensed text-lg",children:(0,n.jsx)(j.Z,{onSubmit:o,children:(0,n.jsxs)(j.Z.Group,{children:[(0,n.jsx)(j.Z.Control,{as:"textarea",rows:6,value:c,size:"lg",isInvalid:d.comment,onChange:e=>r(e.target.value)}),(0,n.jsx)(p.Z,{errors:d.comment})]})})})}),(0,n.jsx)(v.Z.Footer,{children:(0,n.jsxs)("div",{className:"pt-3 pb-2 d-flex flex-wrap justify-content-center",children:[(0,n.jsx)("div",{className:"mx-3 mb-3",children:(0,n.jsx)(h.Z,{variant:"outline-primary",onClick:a,children:"Закрыть"})}),(0,n.jsx)("div",{className:"mx-3 mb-3",children:(0,n.jsx)(h.Z,{variant:"primary",onClick:o,children:"Сохранить"})})]})})]})}var N=t(36686),_=t(22745),y=t(28504);function g(e){let{idea:s,canEdit:t,onIdeaEdit:a}=e,[l,c]=(0,i.useState)(!1);return(0,n.jsxs)("div",{className:"d-flex",children:[(0,n.jsx)(x.Z,{player:s.author,size:66,className:"players-table__participant__avatar"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"pt-2 text-preline",children:s.short_description}),(0,n.jsx)("hr",{}),(0,n.jsx)("div",{className:"mt-3 text-preline",children:s.description}),t&&(0,n.jsx)("div",{className:"mt-3",children:(0,n.jsx)("button",{className:"btn btn-primary btn-sm",onClick:()=>c(!0),children:"Изменить"})}),(0,n.jsxs)("div",{className:"mt-3 d-flex align-items-center",children:[(0,n.jsx)(u.Z,{positiveVotes:s.num_positive_votes,negativeVotes:s.num_negative_votes}),(0,n.jsxs)("div",{className:"ms-2 text-nowrap",children:[(0,n.jsxs)("span",{className:"text-success",children:["+",s.num_positive_votes]})," /"," ",(0,n.jsxs)("span",{className:"text-danger",children:["-",s.num_negative_votes]})]})]})]}),l&&(0,n.jsx)(N.Z,{idea:s,onSuccess:a,onHide:()=>c(!1)})]})}function Z(e){let{idea:s,myVote:t,onVoteChange:a}=e,[l,c]=(0,i.useState)(t?t.is_positive:null),[r,x]=(0,i.useState)(t?t.comment:""),[o,u]=(0,i.useState)(!1),h=async e=>{let t=null;"null"!==e&&(t="true"==e),c(t);let n=await (0,m.zb)(s.id,t),i=await n.json();n.ok&&c(i.is_positive),a&&a()},j=null===l?"null":l.toString();return(0,n.jsxs)("div",{className:"mt-4",children:[(0,n.jsxs)("div",{className:"d-flex justify-content-center align-items-center",children:[(0,n.jsx)("div",{className:" me-2",children:"Проголосовать: "}),(0,n.jsxs)(d.Z,{as:"ul",className:"nav nav-pills",activeKey:j,onSelect:h,children:[(0,n.jsx)(d.Z.Item,{as:"li",children:(0,n.jsx)(d.Z.Link,{eventKey:"true",children:"ЗА"})}),(0,n.jsx)(d.Z.Item,{as:"li",children:(0,n.jsx)(d.Z.Link,{eventKey:"false",children:"ПРОТИВ"})}),(0,n.jsx)(d.Z.Item,{as:"li",children:(0,n.jsx)(d.Z.Link,{eventKey:"null",children:"Не знаю"})})]})]}),(0,n.jsxs)("div",{className:"d-flex bg-light p-3 mt-3 rounded-3",children:[(0,n.jsx)("div",{className:"text-preline flex-grow-1",children:r&&r.length>0?r:(0,n.jsx)("a",{href:"#",className:"my-2 d-block text-decoration-none text-muted",onClick:e=>{e.preventDefault(),u(!0)},children:(0,n.jsx)("i",{children:"Нет комментария"})})}),(0,n.jsx)("div",{children:(0,n.jsx)("button",{className:"btn btn-primary btn-sm ms-2",onClick:()=>{u(!0)},children:"Изменить"})})]}),o&&(0,n.jsx)(f,{idea:s,comment:r,onSuccess:x,onHide:()=>u(!1)})]})}function b(e){let{vote:s,expandedVotes:t,onExpandVote:i}=e,a=s.comment,l=!1;if(!t[s.id]){let e=(0,_.JJ)(a,400,5);e!=a&&(a=e,l=!0)}return(0,n.jsxs)("div",{className:"d-flex mt-3",children:[(0,n.jsx)(x.Z,{player:s.player,size:66,className:"players-table__participant__avatar"}),(0,n.jsxs)("div",{className:"flex-grow-1",children:[(0,n.jsxs)("div",{className:"d-flex align-items-center",children:[(0,n.jsxs)("div",{className:"h5 mb-0",children:[s.player.name,s.updated_at&&(0,n.jsxs)("span",{className:"text-muted small",children:[" / ",s.updated_at]})]}),0!=s.weight&&(0,n.jsx)("div",{className:"flex-grow-1 fs-5 fw-bold text-end "+(s.is_positive?"text-success":"text-danger"),children:s.weight})]}),a&&a.length>0&&(0,n.jsxs)("div",{className:"mt-2 text-preline",children:[a,l&&(0,n.jsx)("a",{href:"#",className:"ms-2",onClick:e=>{e.preventDefault(),i(s)},children:"Развернуть"})]})]})]})}function w(e){let{votes:s,orderBy:t,setOrderBy:i,expandedVotes:a,onExpandVote:l}=e;return s&&0!=s.length?(0,n.jsxs)("div",{className:"mt-4",children:[s.length>1&&(0,n.jsxs)("div",{className:"d-flex justify-content-center align-items-center mb-4",children:[(0,n.jsx)("div",{children:"Сортировка:"}),(0,n.jsxs)(d.Z,{as:"ul",className:"nav nav-pills ms-1",activeKey:t,onSelect:i,children:[(0,n.jsx)(d.Z.Item,{as:"li",children:(0,n.jsx)(d.Z.Link,{eventKey:"date",children:"Дата"})}),(0,n.jsx)(d.Z.Item,{as:"li",children:(0,n.jsx)(d.Z.Link,{eventKey:"weight",children:"Вес"})})]})]}),s.map(e=>(0,n.jsx)(b,{vote:e,expandedVotes:a,onExpandVote:l},e.player.id))]}):null}var S=!0;function k(e){let{layoutProps:s,errorCode:t,idea:a,votes:c,my_vote:d,can_edit_idea:x}=e,[u,h]=(0,i.useState)(a),[j,v]=(0,i.useState)(c),[p,f]=(0,i.useState)(d),[N,_]=(0,i.useState)("date"),[b,S]=(0,i.useState)({}),k=async()=>{h(await (0,m.yK)(a.id))},C=async()=>{v(await (0,m.NS)(a.id,N))},E=(0,i.useRef)(!0);return((0,i.useEffect)(()=>{E.current?E.current=!1:C()},[N]),t)?403==t?(0,n.jsx)(o.Z,{pageClass:"page-staticpage",...s,children:(0,n.jsx)(y.Z,{})}):(0,n.jsx)(l(),{statusCode:t}):(0,n.jsxs)(o.Z,{pageClass:"page-idea",...s,children:[(0,n.jsx)(r(),{children:(0,n.jsx)("title",{children:a.short_description})}),(0,n.jsxs)("div",{className:"container-fluid mt-4 mb-5",style:{maxWidth:"900px"},children:[(0,n.jsx)(g,{idea:u,canEdit:x,onIdeaEdit:k}),(0,n.jsx)(Z,{idea:u,myVote:p,onVoteChange:k}),(0,n.jsx)(w,{votes:j,orderBy:N,setOrderBy:_,expandedVotes:b,onExpandVote:e=>{S({...b,[e.id]:!0})}})]})]})}}},function(e){e.O(0,[7776,2888,9774,179],function(){return e(e.s=11657)}),_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.