1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4474],{23953:function(e,t,n){"use strict";var l=n(36734),s=n(51776),i=n(6425),o=n.n(i),c=n(86880),a=n(77913),r=n.n(a);let u=e=>{let{options:t,onSelect:n,renderLabelProp:i,showSearch:a,searchField:u,defaultValue:d,renderListOption:v,placeholder:p,optionClass:m,styleP:h={},onInputChange:_,onValueChange:f}=e,[x,g]=(0,s.useState)(!1),[N,j]=(0,s.useState)([]),[C,E]=(0,s.useState)(d),[S,w]=(0,s.useState)(null),[k,b]=(0,s.useState)(""),L=(0,s.useRef)(null),{t:U}=(0,c.Z)("common");(0,s.useEffect)(()=>{E(d)},[d]),(0,s.useEffect)(()=>{0!==t.length&&t.map((e,t)=>t===C&&w(e))},[t,C]),(0,s.useEffect)(()=>{if(0===t.length)return;let e=t;a&&(e=null==t?void 0:t.filter(e=>{let t=(u||"label").split(",").map(e=>e.trim());return t.some(t=>{var n,l;return null===(l=null===(n=e[t])||void 0===n?void 0:n.toLowerCase())||void 0===l?void 0:l.includes(null==k?void 0:k.toLowerCase())})})),j(e)},[t,u,k,a]),(0,s.useEffect)(()=>{let e=e=>{L.current&&!L.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);let F=()=>{g(!x)},Z=(e,l)=>{let s=t.findIndex(t=>t===e);E(-1!==s?s:l),w(e),g(!1),b(""),n&&n(e)},y=e=>{b(e.target.value),_&&_(e.target.value)},D=()=>{b(""),f("")};return(0,l.jsxs)("div",{className:r().component+" "+((null==h?void 0:h.com)||""),ref:L,children:[(0,l.jsxs)("div",{className:o()([r().option+" "+((null==h?void 0:h.opt)||""),m]),onClick:F,children:[i?i(S):(0,l.jsx)("span",{children:null==S?void 0:S.label}),(0,l.jsx)("i",{className:"iconfont icon-unfold",style:{lineHeight:1,transform:x?"scaleY(-1)":"scaleY(1)"}})]}),x&&(0,l.jsxs)("div",{className:"".concat(r().list," ").concat((null==h?void 0:h.selList)||""),children:[a&&(0,l.jsxs)("div",{className:r().list_input,children:[(0,l.jsx)("input",{type:"text",placeholder:p||"",value:k,onChange:y,autoFocus:!0}),k&&(0,l.jsx)("i",{className:"iconfont icon-shanchu",onClick:D})]}),N.length>0?(0,l.jsx)("ul",{children:N.map((e,t)=>(0,l.jsx)("li",{onClick:()=>Z(e,t),className:t===C?r().current:"",children:(0,l.jsx)("div",{className:r().list_item,children:v?v(e):e.label})},t))}):(0,l.jsx)("div",{className:r().no_matches,children:U("other.noData")})]})]})};t.Z=u},81277:function(e,t,n){"use strict";n.d(t,{S:function(){return i},a:function(){return o}});var l=n(76306),s=n(39949);function i(e){return(0,s.U2)(l.gH,e)}function o(e){return(0,s.U2)(l.e,e)}},4474:function(e,t,n){"use strict";n.r(t);var l=n(36734),s=n(51776),i=n(86880),o=n(67832),c=n.n(o),a=n(33906),r=n(23953),u=n(81277),d=n(54008),v=n(36739),p=n.n(v);let m=()=>{let[e,t]=(0,s.useState)([]),{t:n}=(0,i.Z)("price"),o=(0,a.useRouter)(),v=async()=>{var e;let n=await (0,u.S)(),l=(null==n?void 0:n.code)==0?null==n?void 0:null===(e=n.data)||void 0===e?void 0:e.baseCoins:[];l.map((e,t)=>(!e.isOn||"IDR"===e.coinName)&&l.splice(t,1)),t(l)};(0,s.useEffect)(()=>{v()},[]);let m=e=>(0,l.jsxs)("div",{className:p().search_select,children:[(0,l.jsx)(c(),{src:(0,d.tb)(e.coinName),alt:e.coinName,width:24,height:24,onError:e=>e.target.src="/media/images/default_icon.png"}),(0,l.jsx)("span",{children:e.coinName})]}),h=e=>{var t,n,l;let s="";s=e.etf?"/price/".concat(null==e?void 0:null===(t=e.target)||void 0===t?void 0:t.toUpperCase(),"-ETF-").concat(null==e?void 0:e.leverage).concat(null==e?void 0:null===(n=e.ls)||void 0===n?void 0:n.toUpperCase()):"/price/".concat(null==e?void 0:null===(l=e.coinName)||void 0===l?void 0:l.toUpperCase()),o.push(s)};return(0,l.jsx)(r.Z,{renderLabelProp:e=>e?m(e):"All",showSearch:!0,searchField:"coinName",options:e,onSelect:h,renderListOption:e=>m(e),placeholder:n("placeholder"),optionClass:p().optionHeight})};t.default=m},77913:function(e){e.exports={component:"select_component__z5DgA",option:"select_option__X7ksq",list:"select_list__QF2kS",list_input:"select_list_input__C0Qcu",list_item:"select_list_item__TwxQx",current:"select_current__UgFVf",no_matches:"select_no_matches__5xstd"}}}]);
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.