1import{r as d,j as e}from"./vendor-react-BGN68_Lp.js";import{b as P,a as _,u as z}from"./vendor-redux-D8sX5Eqv.js";import{g as r}from"./vendor-styled-pkIKgjgv.js";import{V as I,x as N,N as R,g as A,b as L,v as j,D as u,s as M,af as m,ag as O,ah as B}from"./index-uear5Vpj.js";import{u as D}from"./vendor-i18n-BWleq_Sd.js";import"./vendor-socket-DSYo_sTV.js";import"./vendor-router-CYD8mbvC.js";const V=r.div` 2 border-radius: 15px; 3 background: #171c2a; 4 padding: 40px; 5 width: 500px; 6 7 @media all and (max-width: 650px) { 8 width: 90%; 9 padding: 24px; 10 } 11`,F=r.h1` 12 font-weight: 700; 13 font-size: 24px; 14 color: #ecf1f8; 15 text-align: center; 16 text-transform: none; 17 margin-bottom: 8px; 18`,H=r.p` 19 text-align: center; 20 21 &, 22 span { 23 font-weight: 400; 24 font-size: 15px; 25 line-height: 150%; 26 color: #6f7a8c; 27 } 28 29 a { 30 opacity: 0.7; 31 } 32`,K=r.div` 33 margin-top: 24px; 34 35 & > div { 36 height: 56px; 37 border-radius: 8px; 38 background: rgba(93, 108, 146, 0.05); 39 padding: 0 18px; 40 margin-bottom: 8px; 41 display: flex; 42 align-items: center; 43 justify-content: flex-end; 44 overflow: hidden; 45 } 46 47 input { 48 height: 100%; 49 background: transparent; 50 color: #fff; 51 min-width: 100px; 52 53 &, 54 &::placeholder { 55 font-weight: 400; 56 font-size: 14px; 57 } 58 59 &::placeholder { 60 color: #9fb1c9; 61 } 62 } 63`,U=r.div` 64 height: 26px; 65 background: rgba(96, 128, 255, 0.12); 66 border-radius: 6px; 67 padding: 3px 10px; 68 font-weight: 400; 69 font-size: 14px; 70 line-height: 20px; 71 color: #6080ff; 72 display: flex; 73 align-items: center; 74 white-space: nowrap; 75 76 img { 77 width: 8px; 78 margin-left: 10px; 79 } 80 81 &:not(:last-of-type) { 82 margin-right: 12px; 83 } 84`,W=r.div` 85 margin-top: 24px; 86 width: 100%; 87 display: grid; 88 grid-template-columns: 1fr; 89 gap: 6px; 90 91 button { 92 width: 100%; 93 height: 56px; 94 font-size: 16px; 95 font-weight: 700; 96 letter-spacing: 0.16px; 97 text-align: center; 98 background: transparent; 99 border-radius: 8px; 100 font-family: 'Roboto'; 101 102 &:first-child { 103 background: #6080ff; 104 color: #fff; 105 } 106 107 &:last-child { 108 border: 1px solid #2e364b; 109 color: #a5b2c3; 110 } 111 } 112`,Y=p=>{const{t:a}=D(),s=_(),y=z(t=>t.auth.steamid64),[c,v]=d.useState(null),[o,h]=d.useState([]),[x,b]=d.useState(""),[C,w]=d.useState(!1);let T=/[^a-zA-Zа-ÑÐ-Я0-9\s]+/giu;d.useEffect(()=>{h([])},[]);const{actionType:n,id:g}=p.data,f=()=>{s(L(null))},k=async()=>{if(!C){if(!c)return j(a("EnterName"));w(!0);try{const t=c.replace(T,"");if(n=="publish"){const i=o.length==0?x.trim()==""?[]:[x]:o;await u.publish(g,t,i)&&(M(a("CollectionPublished")),s(m({data:{id:g,is_public:!0,name:t}})))}else if(n=="rename")await u.rename(g,t)&&s(m({data:{id:g,name:c}}));else{const i=await u.create(t);if(!i)s(O());else{const l={id:i.data.id_collection,name:c,collection:[],steamid64:y,type:0};s(m({data:l})),await u.use(l.id)&&s(B(l))}}f()}finally{w(!1)}}},S=t=>{if((t.code=="Enter"||t.code=="Space")&&o.length<10&&t.target.value){let i=t.target.value.trim();if(i.length<3||i.length>12)return j(a("InvalidTagLength"));i!=""&&(h([...o,t.target.value.trim()]),b(""))}},E=t=>{let i=[...o],l=i.indexOf(t);i.splice(l,1),h(i)};return e.jsxs(V,{children:[e.jsx(N,{}),e.jsx(F,{children:n=="publish"?a("Publishing"):n=="rename"?a("Renaming"):a("Creation")}),n!="rename"&&e.jsx(H,{children:n=="publish"?e.jsxs(e.Fragment,{children:[a("PostingCollectionYouAccept")," ",e.jsx(R,{to:"/learn/198",click:f,children:a("PublishRules")}),"."," ",e.jsx("span",{dangerouslySetInnerHTML:{__html:a("PublishingText")}})]}):a("CreatingText")}),e.jsxs(K,{children:[e.jsx("div",{children:e.jsx("input",{type:"text",value:c,onChange:t=>t.target.value.length<32&&v(t.target.value),placeholder:a("EnterName")})}),n=="publish"&&e.jsxs("div",{children:[o.map(t=>e.jsxs(U,{children:[t,e.jsx("img",{loading:"lazy",src:A("/img/icons/skinchanger/delete.svg"),alt:"",onClick:()=>E(t)})]},t)),e.jsx("input",{type:"text",placeholder:a("EnterTag"),onKeyPress:t=>S(t),value:x,onChange:t=>b(t.target.value)})]})]}),e.jsxs(W,{children:[e.jsx("button",{onClick:k,disabled:C,children:n=="publish"?a("Publish"):n=="rename"?a("Accept2"):a("Create")}),e.jsx("button",{onClick:f,children:a("Back")})]})]})};let Z=p=>({data:p.modals.data.CREATE_COLLECTION,viewedCollection:I(p)});const at=P(Z,null)(Y);export{at as default};
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.