PageSourceSearch

https://www.bittime.com/_next/static/chunks/pages/trade/[coin]-36b764b53602bcb9.js

js bittime.com collected 2026-09-24 10:01:48 UTC 197,284 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3451],{65752:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/trade/[coin]",function(){return n(49767)}])},49767:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return tp},default:function(){return th}});var r=n(36734),s=n(51776),o=n(33906),a=n(57319),i=n(38698),l=n(6425),c=n.n(l),d=n(48196),u=n(86880),m=n(20150),_=n.n(m),p=n(56562),h=n.n(p),v=n(3420),f=n.n(v),b=n(87057),g=n(54008),x=n(17325);let y=(0,s.createContext)(null);var j=y,C=n(99439),N=n(69844);class k{connect(){if(this.socket)return;let e=window.WebSocket||window.MozWebSocket;this.socket=new e(this.url),this.socket.binaryType="arraybuffer",this.socket.addEventListener("open",()=>{this.isConnected=!0,this.triggerConnectionEvent(!0),this.sendQueuedMessages()}),this.socket.addEventListener("close",()=>{this.isConnected=!1,this.socket=null,this.triggerConnectionEvent(!1),this.reconnect()}),this.socket.addEventListener("message",e=>{let t=new Uint8Array(e.data),n=(0,C.rr)(t,{to:"string"}),r=JSON.parse(n);(null==r?void 0:r.ping)&&this.send({pong:r.ping}),this.triggerMessageEvent(r)})}send(e){this.isConnected?this.socket.send(JSON.stringify(e)):"sub"===e.event&&this.messageQueue.push(e)}onConnectionChange(e){this.connectionChangeCallback=e}onMessage(e){this.messageListeners.push(e)}offMessage(e){this.messageListeners=this.messageListeners.filter(t=>t!==e)}close(){this.socket&&(this.socket.close(),this.socket=null,this.isConnected=!1)}triggerConnectionEvent(e){"function"==typeof this.connectionChangeCallback&&this.connectionChangeCallback(e)}triggerMessageEvent(e){this.messageListeners.forEach(t=>t(e))}sendQueuedMessages(){let e=this.messageQueue;for(let t=0;t<e.length;t++)this.socket.send(JSON.stringify(e[t]))}reconnect(){this.isConnected||setTimeout(()=>this.connect(),this.reconnectInterval)}constructor(){if(k.instance)return k.instance;this.url=N.D.WebSocketDomain||"wss://ws.bittime.com/kline-api/ws",this.socket=null,this.isConnected=!1,this.messageListeners=[],this.messageQueue=[],this.reconnectInterval=3e3,k.instance=this}}var w=k;let S=e=>{let{children:t}=e,[n,o]=(0,s.useState)(!1),[a,i]=(0,s.useState)(null);return(0,s.useEffect)(()=>{let e=new w;e.connect(),e.onConnectionChange(e=>o(e)),i(e)},[]),(0,r.jsx)(j.Provider,{value:{webSocket:a,socketConnected:n},children:t})};var F=S,P=n(9849),A=n.n(P),I=n(77733),L=n.n(I);let U=s.forwardRef(function(e,t){let{children:n,screen:s,...o}=e;return(0,r.jsx)("div",{...o,className:"".concat(L().box," ").concat(L()[s]),ref:t,children:n})});U.defaultProps={screen:"lg"},U.propTypes={screen:A().oneOf(["sm","md","lg"])};var E=U,D=n(507),R=n(54306),O=n(2382),T=n.n(O),B=n(58018);function Z(e,t){let n={...e};for(let r in t)"object"!=typeof e[r]||null===e[r]||Array.isArray(e[r])?void 0!==t[r]&&(n[r]=t[r]):n[r]=Z(e[r],t[r]);return n}let M={width:800,height:500,interval:"1D",timezone:"Etc/UTC",container:"",library_path:"",locale:"en",widgetbar:{details:!1,watchlist:!1,news:!1,datawindow:!1,watchlist_settings:{default_symbols:[]}},overrides:{"mainSeriesProperties.showCountdown":!1},studies_overrides:{},trading_customization:{position:{},order:{}},brokerConfig:{configFlags:{}},fullscreen:!1,autosize:!1,disabled_features:[],enabled_features:[],debug:!1,logo:{},time_frames:[{text:"5y",resolution:"1W"},{text:"1y",resolution:"1W"},{text:"6m",resolution:"120"},{text:"3m",resolution:"60"},{text:"1m",resolution:"30"},{text:"5d",resolution:"5"},{text:"1d",resolution:"1"}],client_id:"0",user_id:"0",charts_storage_api_version:"1.0",favorites:{intervals:[],chartTypes:[],indicators:[],drawingTools:[]}},W=JSON.parse('[{"iso":"ar","dir":"rtl","language":"ar"},{"iso":"pt","dir":"ltr","language":"pt"},{"iso":"ca","dir":"ltr","language":"ca_ES"},{"iso":"cs","dir":"ltr","language":"cs"},{"iso":"de","dir":"ltr","language":"de"},{"iso":"en","dir":"ltr","language":"en"},{"iso":"es","dir":"ltr","language":"es"},{"iso":"fa","dir":"rtl","language":"fa"},{"iso":"fr","dir":"ltr","language":"fr"},{"iso":"he","dir":"rtl","language":"he_IL"},{"iso":"hu","dir":"ltr","language":"hu_HU"},{"iso":"id","dir":"ltr","language":"id_ID"},{"iso":"en","dir":"ltr","language":"en"},{"iso":"it","dir":"ltr","language":"it"},{"iso":"ja","dir":"ltr","language":"ja"},{"iso":"ko","dir":"ltr","language":"ko"},{"iso":"ms","dir":"ltr","language":"ms_MY"},{"iso":"pl","dir":"ltr","language":"pl"},{"iso":"ru","dir":"ltr","language":"ru"},{"iso":"sv","dir":"ltr","language":"sv"},{"iso":"th","dir":"ltr","language":"th"},{"iso":"tr","dir":"ltr","language":"tr"},{"iso":"vi","dir":"ltr","language":"vi"},{"iso":"zh-Hans","dir":"ltr","language":"zh"},{"iso":"zh-Hant","dir":"ltr","language":"zh_TW"},{"iso":"el","dir":"ltr","language":"el"},{"iso":"nl","dir":"ltr","language":"nl_NL"},{"iso":"ro","dir":"ltr","language":"ro"}
1]'),q=!1;function z(){return"CL v25.001 (internal id 8d229e9c @ 2023-06-26T14:38:18.899Z)"}let V=class{setDebugMode(e){this._innerAPI().setDebugMode(e)}onChartReady(e){this._ready?e.call(this):this._readyHandlers.push(e)}headerReady(){return this._innerWindowLoaded.then(()=>this._innerWindow().headerReady())}onGrayedObjectClicked(e){this._doWhenInnerApiLoaded(t=>{t.onGrayedObjectClicked(e)})}onShortcut(e,t){this._doWhenInnerWindowLoaded(n=>{n.createShortcutAction(e,t)})}subscribe(e,t){this._doWhenInnerApiLoaded(n=>{n.subscribe(e,t)})}unsubscribe(e,t){this._doWhenInnerApiLoaded(n=>{n.unsubscribe(e,t)})}chart(e){return this._innerAPI().chart(e)}getLanguage(){return this._options.locale}setSymbol(e,t,n){this._innerAPI().changeSymbol(e,t,n)}remove(){window.removeEventListener("resize",this._onWindowResize),this._readyHandlers.splice(0,this._readyHandlers.length),delete window[this._id],this._iFrame.parentNode&&this._iFrame.parentNode.removeChild(this._iFrame)}closePopupsAndDialogs(){this._doWhenInnerApiLoaded(e=>{e.closePopupsAndDialogs()})}selectLineTool(e,t){this._innerAPI().selectLineTool(e,t)}selectedLineTool(){return this._innerAPI().selectedLineTool()}save(e){this._innerAPI().saveChart(e)}load(e,t){this._innerAPI().loadChart({json:e,extendedData:t})}getSavedCharts(e){this._innerAPI().getSavedCharts(e)}loadChartFromServer(e){this._innerAPI().loadChartFromServer(e)}saveChartToServer(e,t,n){this._innerAPI().saveChartToServer(e,t,n)}removeChartFromServer(e,t){this._innerAPI().removeChartFromServer(e,t)}onContextMenu(e){this._doWhenInnerApiLoaded(t=>{t.onContextMenu(e)})}createButton(e){return this._innerWindow().createButton(e)}createDropdown(e){return this._innerWindow().createDropdown(e)}showNoticeDialog(e){this._doWhenInnerApiLoaded(t=>{t.showNoticeDialog(e)})}showConfirmDialog(e){this._doWhenInnerApiLoaded(t=>{t.showConfirmDialog(e)})}showLoadChartDialog(){this._innerAPI().showLoadChartDialog()}showSaveAsChartDialog(){this._innerAPI().showSaveAsChartDialog()}symbolInterval(){return this._innerAPI().getSymbolInterval()}mainSeriesPriceFormatter(){return this._innerAPI().mainSeriesPriceFormatter()}getIntervals(){return this._innerAPI().getIntervals()}getStudiesList(){return this._innerAPI().getStudiesList()}getStudyInputs(e){return this._innerAPI().getStudyInputs(e)}getStudyStyles(e){return this._innerAPI().getStudyStyles(e)}addCustomCSSFile(e){this._innerWindow().addCustomCSSFile(e)}applyOverrides(e){this._options=Z(this._options,{overrides:e}),this._doWhenInnerWindowLoaded(t=>{t.applyOverrides(e)})}applyStudiesOverrides(e){this._doWhenInnerWindowLoaded(t=>{t.applyStudiesOverrides(e)})}watchList(){return this._innerAPI().watchlist()}news(){return this._innerAPI().news()}widgetbar(){return this._innerAPI().widgetbar()}activeChart(){return this._innerAPI().activeChart()}activeChartIndex(){return this._innerAPI().activeChartIndex()}setActiveChart(e){return this._innerAPI().setActiveChart(e)}chartsCount(){return this._innerAPI().chartsCount()}layout(){return this._innerAPI().layout()}setLayout(e){this._innerAPI().setLayout(e)}layoutName(){return this._innerAPI().layoutName()}changeTheme(e,t){return this._innerWindow().changeTheme(e,t)}getTheme(){return this._innerWindow().getTheme()}takeScreenshot(){this._doWhenInnerApiLoaded(e=>{e.takeScreenshot()})}lockAllDrawingTools(){return this._innerAPI().lockAllDrawingTools()}hideAllDrawingTools(){return this._innerAPI().hideAllDrawingTools()}drawOnAllCharts(e){this._innerAPI().drawOnAllCharts(e)}magnetEnabled(){return this._innerAPI().magnetEnabled()}magnetMode(){return this._innerAPI().magnetMode()}undoRedoState(){return this._innerAPI().undoRedoState()}setIntervalLinkingEnabled(e){this._innerAPI().setIntervalLinkingEnabled(e)}setTimeFrame(e){this._innerAPI().setTimeFrame(e)}symbolSync(){return this._innerAPI().symbolSync()}intervalSync(){return this._innerAPI().intervalSync()}crosshairSync(){return this._innerAPI().crosshairSync()}timeSync(){return this._innerAPI().timeSync()}dateRangeSync(){return this._innerAPI().dateRangeSync()}setFeatureEnabled(e,t){this._innerAPI().setFeatureEnabled(e,t)}getAllFeatures(){return this._innerWindow().getAllFeatures()}clearUndoHistory(){return this._innerAPI().clearUndoHistory()}undo(){return this._innerAPI().undo()}redo(){return this._innerAPI().redo()}startFullscreen(){this._innerAPI().startFullscreen()}exitFullscreen(){this._innerAPI().exitFullscreen()}takeClientScreenshot(e){return this._innerAPI().takeClientScreenshot(e)}navigationButtonsVisibility(){return this._innerWindow().getNavigationButtonsVisibility()}paneButtonsVisibility(){return this._innerWindow().getPaneButtonsVisibility()}dateFormat(){return this._innerWindow().getDateFormat()}timeHoursFormat(){return this._innerWindow().getTimeHoursFormat()}currencyAndUnitVisibility(){return this._innerWindow().getCurrencyAndUnitVisibility()}supportedChartTypes(){return this._innerAPI().supportedChartTypes()}watermark(){return this._innerAPI().watermark()}customSymbolStatus(){return this._innerWindow().customSymbolStatus()}linking(){return this._innerAPI().linking}_innerAPI(){return this._innerWindow().tradingViewApi}_innerWindow(){return this._iFrame.contentWindow}_doWhenInnerWindowLoaded(e){this._ready?e(this._innerWindow()):this._innerWindowLoaded.then(()=>{e(this._innerWindow())})}_doWhenInnerApiLoaded(e){this._doWhenInnerWindowLoaded(t=>{t.doWhenApiIsReady(()=>e(this._innerAPI()))})}_autoResizeChart(){this._options.fullscreen&&(this._iFrame.style.height=window.innerHeight+"px",H&&setTimeout(()=>{this._iFrame.style.height=window.innerHeight+"px"},30))}_create(){var e,t;let n=null!==(t=null===(e=this._options.enabled_features)||void 0===e?void 0:e.includes("iframe_loading_compatibility_mode"))&&void 0!==t&&t,[r,s]=this._render(!n);this._options.container_id&&console.warn("`container_id` is now deprecated. Please use `container` instead to either still pass a string or an `HTMLElement`.");let o=this._options.container_id||this._options.container,a="str
1ing"==typeof o?document.getElementById(o):o;if(null===a)throw Error("There is no such element - #".concat(this._options.container));a.innerHTML=r,this._iFrame=a.querySelector("#".concat(this._id));let i=this._iFrame;n&&(i.contentWindow?(i.contentWindow.document.open(),i.contentWindow.document.write(s),i.contentWindow.document.close()):console.warn("Unable to locate contentWindow for the created iframe. Please try disabling the `iframe_loading_compatibility_mode` featureset.")),(this._options.autosize||this._options.fullscreen)&&(i.style.width="100%",this._options.fullscreen||(i.style.height="100%")),window.addEventListener("resize",this._onWindowResize),this._onWindowResize(),this._innerWindowLoaded=new Promise(e=>{let t=()=>{i.removeEventListener("load",t,!1),e()};i.addEventListener("load",t,!1)}),this._innerWindowLoaded.then(()=>{this._innerWindow().widgetReady(()=>{for(let e of(this._ready=!0,this._readyHandlers))try{e.call(this)}catch(t){console.error(t)}this._innerWindow().initializationFinished()})})}_render(e){let t=window;if(t[this._id]={datafeed:this._options.datafeed,customFormatters:this._options.custom_formatters||this._options.customFormatters,brokerFactory:this._options.broker_factory||this._options.brokerFactory,overrides:this._options.overrides,studiesOverrides:this._options.studies_overrides,tradingCustomization:this._options.trading_customization,disabledFeatures:this._options.disabled_features,enabledFeatures:this._options.enabled_features,brokerConfig:this._options.broker_config||this._options.brokerConfig,restConfig:this._options.restConfig,favorites:this._options.favorites,logo:this._options.logo,numeric_formatting:this._options.numeric_formatting,rss_news_feed:this._options.rss_news_feed,newsProvider:this._options.news_provider,loadLastChart:this._options.load_last_chart,saveLoadAdapter:this._options.save_load_adapter,loading_screen:this._options.loading_screen,settingsAdapter:this._options.settings_adapter,getCustomIndicators:this._options.custom_indicators_getter,additionalSymbolInfoFields:this._options.additional_symbol_info_fields,headerWidgetButtonsMode:this._options.header_widget_buttons_mode,customTranslateFunction:this._options.custom_translate_function,symbolSearchComplete:this._options.symbol_search_complete,contextMenu:this._options.context_menu,settingsOverrides:this._options.settings_overrides,timeframe:this._options.timeframe,customTimezones:this._options.custom_timezones},this._options.saved_data)t[this._id].chartContent={json:this._options.saved_data},this._options.saved_data_meta_info&&(t[this._id].chartContentExtendedData=this._options.saved_data_meta_info);else if(!this._options.load_last_chart&&!this._options.symbol)throw Error("Symbol is not defined: either 'symbol' or 'load_last_chart' option must be set");if(this._options.library_path&&!this._options.library_path.endsWith("/")&&console.warn("library_path option should contain a trailing forward slash"),this._options.locale){let n=encodeURIComponent(this._options.locale);W.findIndex(e=>e.language===n)>=0||(console.warn("locale isn't supported. Using default of `en`."),this._options.locale="en")}let r=function(e,t){var n,r;let s=new URL("".concat(e||""),location.href).href,o=JSON.parse('["bundles/runtime.095dc225a1f6eadde580.js","bundles/__LANG__.505.978e053ffa4899c28da8.js","bundles/6783.6a1bfc6cd105f6a266ca.css","bundles/6783.6a1bfc6cd105f6a266ca.rtl.css","bundles/6151.b56fe9757ecea34523a2.js","bundles/library.c90310477a64f50fbf4b.js"]'),a=encodeURIComponent(t),i=null!==(r=W.find(e=>e.language===a))&&void 0!==r?r:{iso:"en",dir:"ltr"},l='lang="'.concat(i.iso,'" dir="').concat(i.dir,'"'),c="\n".concat(function(e,t,n){if(void 0===e)return"";let r=[],s=[],o=/\.css$/i,a=/\.rtl\.css$/i;for(let i of e)i.endsWith(".js")?r.push('<script defer crossorigin="anonymous" src="'.concat(i.replace("__LANG__",n),'"></script>')):o.test(i)&&t===a.test(i)&&s.push('<link type="text/css" href="'.concat(i,'" rel="stylesheet"/>'));return[...r,...s].join("\n")}(o,"rtl"===i.dir,a),"\n");return"<!DOCTYPE html><html ".concat((n={bundles:c,localeLanguage:a,htmlAttrs:l,libraryPath:s}).htmlAttrs,'><head><base href="').concat(n.libraryPath,'"><meta charset="utf-8"><script>window===window.parent&&(location.href="about:blank")</script>
1 ').concat(n.bundles,' </head><body class="chart-page unselectable on-widget"><div class="loading-indicator" id="loading-indicator"></div><script>var JSServer={},__initialEnabledFeaturesets=["charting_library"]</script><script>(function() {\n		window.urlParams = (function () {\n			var match,\n				pl	 = /\\+/g,  // Regex for replacing addition symbol with a space\n				search = /([^&=]+)=?([^&]*)/g,\n				decode = function (s) { return decodeURIComponent(s.replace(pl, \' \')).replace(/<\\/?[^>]+(>|$)/g, \'\'); },\n				query = function() {\n					// We don\'t use hash on the url because: safari 13 throws an error if you attempt this\n					// on a blob, and safari 14 will strip hash from blob urls.\n					if (frameElement && frameElement.dataset.widgetOptions) {\n						return frameElement.dataset.widgetOptions;\n					} else {\n						throw "Unexpected use of this page";\n					}\n				}(),\n				result = {};\n\n			while (match = search.exec(query)) {\n				result[decode(match[1])] = decode(match[2]);\n			}\n\n			var additionalSettingsObject = window.parent[result.uid];\n\n			var customObjectNames = [\'datafeed\', \'customFormatters\', \'brokerFactory\', \'save_load_adapter\', \'customTranslateFunction\', \'contextMenu\'];\n\n			for (var p in additionalSettingsObject) {\n				if (customObjectNames.indexOf(p) === -1) {\n					result[p] = JSON.stringify(additionalSettingsObject[p]);\n				}\n			}\n\n			return result;\n		})();\n\n		window.locale = urlParams.locale;\n		window.language = urlParams.locale; // a very big attention needed here\n		window.customTranslateFunction = window.parent[urlParams.uid].customTranslateFunction;\n\n		window.addCustomCSSFile = function(href) {\n			var link = document.createElement(\'link\');\n			link.setAttribute(\'type\', \'text/css\');\n			link.setAttribute(\'rel\', \'stylesheet\');\n			link.setAttribute(\'href\', href);\n			link.setAttribute(\'cross-origin\', \'anonymous\');\n\n			window.loadedCustomCss = new Promise((resolve) => {\n				link.onload = resolve;\n				link.onerror = resolve;\n			});\n			document.body.appendChild(link);\n		};\n\n		window.loadedCustomCss = Promise.resolve();\n		if (!!urlParams.customCSS) {\n			window.addCustomCSSFile(urlParams.customCSS);\n		}\n\n		var loadingScreenParams = {};\n\n		if (typeof urlParams.loading_screen === \'string\') {\n			try {\n				loadingScreenParams = JSON.parse(urlParams.loading_screen);\n			} catch(e) {}\n		}\n\n		var loadingIndicatorElement = document.getElementById(\'loading-indicator\');\n\n		if (loadingScreenParams.backgroundColor) {\n			loadingIndicatorElement.style = \'background-color: \' + loadingScreenParams.backgroundColor;\n		}\n\n		!function(){"use strict";var t,e=new WeakMap;!function(t){t[t.Element=1]="Element",t[t.Document=9]="Document"}(t||(t={}));var n={mini:"xsmall",xsmall:"xsmall",small:"small",medium:"medium",large:"large"};var i,s,o,r,l,c=(void 0===l&&(l=""),i=\'<div class="tv-spinner \'.concat(l,\'" role="progressbar"></div>\'),o=function(n,i){var s,o;return s=null==i?document.documentElement:i.nodeType===t.Document?i.documentElement:i,e&&(o=e.get(s)),o||((o=s.ownerDocument.createRange()).selectNodeContents(s),e&&e.set(s,o)),o.createContextualFragment(n)}(i,s),null!==(r=o.firstElementChild)&&o.removeChild(r),r),a=function(){function t(t){this._shown=!1,this._el=c.cloneNode(!0),this.setSize(n[t||"large"])}return t.prototype.spin=function(t){return this._el.classList.add("tv-spinner--shown"),void 0===this._container&&(this._container=t,void 0!==t&&t.appendChild(this._el)),this._shown=!0,this},t.prototype.stop=function(t){return t&&void 0!==this._container&&this._container.removeChild(this._el),this._el&&this._el.classList.remove("tv-spinner--shown"),this._shown=!1,this},t.prototype.setStyle=function(t){var e=this;return Object.keys(t).forEach((function(n){var i=t[n];void 0!==i&&e._el.style.setProperty(n,i)})),this},t.prototype.style=function(){return this._el.style},t.prototype.setSize=function(t){var e=void 0!==t?"tv-spinner--size_".concat(t):"";return this._el.className="tv-spinner ".concat(e," ").concat(this._shown?"tv-spinner--shown":""),this},t.prototype.getEl=function(){return this._el},t.prototype.destroy=function(){this.stop(),delete this._el,delete this._container},t}();window.Spinner=a}();\n\n\n		var spinnerColor = (loadingScreenParams.foregroundColor) ? loadingScreenParams.foregroundColor : undefined;\n\n		var loadingSpinner = new Spinner(\'large\').setStyle({\n			\'--tv-spinner-color\': spinnerColor,\n			zIndex: String(2e9),\n		});\n		loadingSpinner.getEl().classList.add(\'spinner\');\n		loadingSpinner.spin(loadingIndicatorElement);\n	})();</script></body></html>')}(this._options.library_path||"",this._options.locale),s=new URL("about:blank");if(e){let o=new Blob([r],{type:"text/html"}),a=URL.createObjectURL(o);s=new URL(a)}let i="symbol="+encodeURIComponent(this._options.symbol||"")+"&interval="+encodeURIComponent(this._options.interval)+(this._options.toolbar_bg?"&toolbarbg="+encodeURIComponent(this._options.toolbar_bg.replace("#","")):"")+(this._options.studies_access?"&studiesAccess="+encodeURIComponent(JSON.stringify(this._options.studies_access)):"")+"&widgetbar="+encodeURIComponent(JSON.stringify(this._options.widgetbar))+(this._options.drawings_access?"&drawingsAccess="+encodeURIComponent(JSON.stringify(this._options.drawings_access)):"")+"&timeFrames="+encodeURIComponent(JSON.stringify(this._options.time_frames))+"&locale="+encodeURIComponent(this._options.locale)+"&uid="+encodeURIComponent(this._id)+"&clientId="+encodeURIComponent(String(this._options.client_id))+"&userId="+encodeURIComponent(String(this._options.user_id
1))+(this._options.charts_storage_url?"&chartsStorageUrl="+encodeURIComponent(this._options.charts_storage_url):"")+(this._options.charts_storage_api_version?"&chartsStorageVer="+encodeURIComponent(this._options.charts_storage_api_version):"")+(this._options.custom_css_url?"&customCSS="+encodeURIComponent(this._options.custom_css_url):"")+(this._options.custom_font_family?"&customFontFamily="+encodeURIComponent(this._options.custom_font_family):"")+(this._options.auto_save_delay?"&autoSaveDelay="+encodeURIComponent(String(this._options.auto_save_delay)):"")+"&debug="+encodeURIComponent(String(this._options.debug))+(this._options.snapshot_url?"&snapshotUrl="+encodeURIComponent(this._options.snapshot_url):"")+(this._options.timezone?"&timezone="+encodeURIComponent(this._options.timezone):"")+(this._options.study_count_limit?"&studyCountLimit="+encodeURIComponent(String(this._options.study_count_limit)):"")+(this._options.symbol_search_request_delay?"&ssreqdelay="+encodeURIComponent(String(this._options.symbol_search_request_delay)):"")+(this._options.compare_symbols?"&compareSymbols="+encodeURIComponent(JSON.stringify(this._options.compare_symbols)):"")+(this._options.theme?"&theme="+encodeURIComponent(String(this._options.theme)):"")+(this._options.header_widget_buttons_mode?"&header_widget_buttons_mode="+encodeURIComponent(String(this._options.header_widget_buttons_mode)):"")+(this._options.time_scale?"&time_scale="+encodeURIComponent(JSON.stringify(this._options.time_scale)):"");return['<iframe\n		id="'.concat(this._id,'" name="').concat(this._id,'" src="').concat(s.href,'" data-widget-options="').concat(i,'"\n		').concat(this._options.autosize||this._options.fullscreen?"":'width="'.concat(this._options.width,'" height="').concat(this._options.height,'"'),' title="Financial Chart" frameborder="0" allowTransparency="true" scrolling="no" allowfullscreen style="display:block;">\n	</iframe>'),r]}constructor(e){var t,n;if(this._id="tradingview_".concat((1048576*(1+Math.random())|0).toString(16).substring(1)),this._ready=!1,this._readyHandlers=[],this._onWindowResize=this._autoResizeChart.bind(this),!e.datafeed)throw Error("Datafeed is not defined");(null===(t=e.overrides)||void 0===t?void 0:t["mainSeriesProperties.priceAxisProperties.lockScale"])&&(console.warn("mainSeriesProperties.priceAxisProperties.lockScale can not be set to true within the widget constructor"),delete e.overrides["mainSeriesProperties.priceAxisProperties.lockScale"]),this._options=Z(M,e),"dark"===(null!==(n=this._options.theme)&&void 0!==n?n:"light").toLowerCase()&&void 0===this._options.loading_screen&&(this._options.loading_screen={backgroundColor:"#131722"}),this._options.debug&&(q||(q=!0,console.log("Using CL v25.001 (internal id 8d229e9c @ 2023-06-26T14:38:18.899Z)"))),this._create()}};window.TradingView=window.TradingView||{},window.TradingView.version=z;let H=!(!window.navigator||!window.navigator.userAgent)&&window.navigator.userAgent.includes("CriOS");var Q=n(15263),J=n(95291);let{tradeStore:Y}=J.Z,K=new w,G={},X="",$="";(0,Q.EH)(()=>{G={full_name:Y.symbolName,ticker:Y.symbolName,name:Y.symbolAlias||Y.symbolName,description:Y.symbolAlias||Y.symbolName,pricescale:Y.pricescale},X=Y.klineInterval});let ee={supports_search:!1,supports_group_request:!1,supports_marks:!1,supports_timescale_marks:!1,supports_time:!1,exchanges:[{value:"coin",name:"coin",desc:"coin"}],symbolsTypes:[{name:"bitcoin",value:"bitcoin"}]},et=e=>{function t(n){n>=1&&(e[n].time===e[n-1].time&&e.splice(n,1),t(n-1))}return e.sort((e,t)=>((null==e?void 0:e.time)||0)-((null==t?void 0:t.time)||0)),t(e.length-1),e};async function en(e){try{let t=await fetch("".concat(N.D.apiDomain,"kline-api/kline/historyByPage/").concat(e));return t.json()}catch(n){throw Error("CryptoCompare request error: ".concat(n.status))}}let er={onReady(e){setTimeout(()=>e(ee))},async resolveSymbol(e,t,n,r){setTimeout(()=>{let e={type:"bitcoin",session:"24x7",timezone:"UTC",exchange:"Bittime",listed_exchange:"Bittime",minmov:1,has_intraday:!0,has_daily:!0,has_weekly_and_monthly:!0,supported_resolutions:["1","5","15","30","60","120","240","360","480","720","1D","1W"],volume_precision:2,data_status:"streaming"},n=Object.assign(e,G);t(n)},0)}
1,async getBars(e,t,n,r,s){var o;let{from:a,to:i,firstDataRequest:l}=n,c=null==e?void 0:null===(o=e.full_name)||void 0===o?void 0:o.toLowerCase(),d={limit:720};l?$="":d.endTime=$;let u=Object.keys(d).map(e=>"".concat(e,"=").concat(encodeURIComponent(d[e]))).join("&");try{let m=await en("".concat(c,"/market_").concat(c,"_kline_").concat(X,"?").concat(u));if("0"==m.code&&0===m.data.length||"0"!=m.code){r([],{noData:!0});return}let _=[];$=1e3*m.data[0][0]-1e3,m.data.forEach(e=>{_=[..._,{time:1e3*e[0],high:+e[1],open:+e[2],low:+e[3],close:+e[4],volume:+e[5]}]}),r(et(_),{noData:!1})}catch(p){s(p)}},subscribeBars(e,t,n,r,s){var o;let a=null==e?void 0:null===(o=e.full_name)||void 0===o?void 0:o.toLowerCase(),i={event:"sub",params:{cb_id:a,channel:"market_".concat(a,"_kline_").concat(X)}};K.send(i),K.messageQueue.push(i),K.onMessage(e=>{var t;let r=(null==e?void 0:null===(t=e.channel)||void 0===t?void 0:t.split("_"))||[];if(r.indexOf("kline")>-1&&e.tick){let s={time:1e3*e.tick.id,open:e.tick.open,high:e.tick.high,low:e.tick.low,close:e.tick.close,volume:e.tick.vol};n(s)}})},unsubscribeBars(e){var t;if(!e)return;let n=e.split("_")[0].toLowerCase(),r=e.split("_")[2],s=JSON.parse(localStorage.getItem("tradingview.resolution")||"[]"),o=null===(t=s.find(e=>e.interval===r))||void 0===t?void 0:t.value,a={event:"unsub",params:{cb_id:n,channel:"market_".concat(n,"_kline_").concat(o)}},i=a.params.channel;K.send(a),K.messageQueue=K.messageQueue.filter(e=>e.params.channel!==i)}};var es=er,eo=n(35845),ea=n.n(eo);let ei=e=>{var t,n,o;let{symbolInfo:i,interval:l,intervalStr:m,theme:_}=e,{t:p}=(0,u.Z)("trade"),[h,v]=(0,s.useState)(null),[f,y]=(0,s.useState)([]),[j,C]=(0,s.useState)(!1),[N,k]=(0,s.useState)(m),[w,S]=(0,s.useState)(!1),[F,P]=(0,s.useState)(!0),A=(0,s.useRef)(null),{tradeStore:I}=(0,x.oR)(),L=(0,s.useMemo)(()=>null==i?void 0:i.currency,[i]),U=(0,s.useMemo)(()=>{let{currency:e,coinAlias:t,quoteAlias:n}=i||{};return t&&n?"".concat(null==i?void 0:i.coinAlias).concat(null==i?void 0:i.quoteAlias):e},[i]),E=(0,s.useMemo)(()=>{var e;let t=null==i?void 0:null===(e=i.scale)||void 0===e?void 0:e.price;return parseFloat(10**t+"")},[i]);(0,s.useEffect)(()=>{null==I||I.setSymbolName(L),null==I||I.setSymbolAlias(U),null==I||I.setPriceScale(E),null==I||I.setKlineInterval(l)},[L,U,E,l]);let R=(0,s.useCallback)(async()=>{try{var e;let t=await (0,a.GZ)(),n=(null==t?void 0:t.code)==0?null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.kline_config:[];localStorage.setItem("tradingview.resolution",JSON.stringify(n)),y(n)}catch(r){console.log(r)}},[]);function O(e){null==I||I.setKlineInterval(e.value),h.chart().setResolution((null==e?void 0:e.interval)+""),k(e.interval),C(!1),d.Z.set(b.l6,e.value),d.Z.set(b.o1,e.interval)}function T(){C(!0)}function Z(){C(!1)}function M(e){if("draw"===e&&h.chart().executeActionById("drawingToolbarAction"),"target"===e&&h.chart().executeActionById("insertIndicator"),"set"===e&&h.chart().executeActionById("chartProperties"),"save"===e&&q(h),"fullScreen"===e&&((null==document?void 0:document.fullscreenEnabled)||(null==document?void 0:document.webkitFullscreenEnabled)||(null==document?void 0:document.mozFullScreenEnabled)||(null==document?void 0:document.msFullscreenEnabled))){let t=null==document?void 0:document.querySelector("#tv-chart");(null==t?void 0:t.requestFullscreen)?null==t||t.requestFullscreen():(null==t?void 0:t.webkitRequestFullscreen)?null==t||t.webkitRequestFullscreen():(null==t?void 0:t.mozRequestFullScreen)?null==t||t.mozRequestFullScreen():(null==t?void 0:t.msRequestFullscreen)&&(null==t||t.msRequestFullscreen()),S(!0)}if("fullScreenClose"===e){var n=document;(null==n?void 0:n.exitFullscreen)?null==n||n.exitFullscreen():(null==n?void 0:n.mozCancelFullScreen)?null==n||n.mozCancelFullScreen():(null==n?void 0:n.mozExitFullscreen)?null==n||n.mozExitFullscreen():(null==n?void 0:n.webkitCancelFullScreen)?null==n||n.webkitCancelFullScreen():(null==n?void 0:n.webkitExitFullscreen)?null==n||n.webkitExitFullscreen():(null==n?void 0:n.msExitFullscreen)&&(null==n||n.msExitFullscreen()),S(!1)}}function W(e){let t={light:{bg:"#FFF",border:"rgba(210, 215, 220, .2)",line:"rgba(75, 82, 95, .2)",text:"#828C9B"},dark:{bg:"#12161D",border:"rgba(29, 40, 59, .1)",line:"rgba(56, 63, 72, .4)",text:"rgba(197, 208, 218, .5)"}},n=t[e];return{volumePaneSize:"medium","mainSeriesProperties.style":1,"symbolWatermarkProperties.color":"rgba(0, 0, 0, 0)","paneProperties.background":n.bg,"paneProperties.topMargin":20,"paneProperties.bottomMargin":5,"paneProperties.vertGridProperties.color":n.border,"paneProperties.horzGridProperties.color":n.border,"mainSeriesProperties.candleStyle.upColor":"#0ABE82","mainSeriesProperties.candleStyle.downColor":"#F04B55","mainSeriesProperties.candleStyle.drawBorder":!1,"mainSeriesProperties.candleStyle.wickUpColor":"#0ABE82","mainSeriesProperties.candleStyle.wickDownColor":"#F04B55","mainSeriesProperties.candleStyle.borderColor":"#F04B55","mainSeriesProperties.candleStyle.borderUpColor":"#0ABE82","mainSeriesProperties.candleStyle.borderDownColor":"#F04B55","scalesProperties.lineColor":n.line,"scalesProperties.textColor":n.text,"paneProperties.legendProperties.showLegend":!0,"paneProperties.legendProperties.showStudyTitles":!0,"paneProperties.legendProperties.showStudyValues":!0,"mainSeriesProperties.areaStyle.color1":"rgba(71, 78, 112, 0.1)","mainSeriesProperties.areaStyle.color2":"rgba(71, 78, 112, 0.02)","mainSeriesProperties.areaStyle.linecolor":"#9194a4","mainSeriesProperties.areaStyle.linewidth":1,"mainSeriesProperties.areaStyle.priceSource":"close"}}function q(e){e&&(null==e||e.save(e=>{localStorage.setItem("TRADING_VIEW_SETTINGS",JSON.stringify(e))}),(0,B.A)({type:"success",msg:p("tvChartsSaveToast")}))}return(0,s.useEffect)(()=>{R()},[R]),(0,s.useEffect)(()=>
1{if(P(!0),"string"!=typeof(null==I?void 0:I.symbolName)||"number"!=typeof(null==I?void 0:I.pricescale)||"string"!=typeof(null==I?void 0:I.klineInterval))return;let e=Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:"Asia/Shanghai",t=null;try{t=JSON.parse(localStorage.getItem("TRADING_VIEW_SETTINGS")).charts[0]}catch(n){}let r={width:"100%",height:"100%",symbol:L,interval:N,datafeed:es,container:A.current,timezone:e,library_path:"/file/charting_library/",locale:"en",saved_data:t,disabled_features:["header_indicators","header_settings","header_fullscreen_button","header_symbol_search","header_resolutions","header_chart_type","header_undo_redo","header_compare","header_saveload","use_localstorage_for_settings","header_screenshot","timeframes_toolbar","go_to_date","display_market_status","volume_force_overlay","header_widget","timeframes_toolbar"],enabled_features:["hide_last_na_study_output","side_toolbar_in_fullscreen_mode","keep_left_toolbar_visible_on_small_screens","hide_left_toolbar_by_default"],charts_storage_url:"https://saveload.tradingview.com",charts_storage_api_version:"1.1",clientId:"tradingview.com",userId:"public_user_id",fullscreen:!1,autosize:!0,theme:_,overrides:W(_),containerBackground:"#transparent",studies_overrides:{"Moving Average.precision":E},customFormatters:{timeFormatter:{format(e){let t="0".concat(e.getUTCHours()).slice(-2),n="0".concat(e.getUTCMinutes()).slice(-2);return"".concat(t,":").concat(n)}},dateFormatter:{format(e){let t=e.getUTCFullYear(),n="0".concat(e.getUTCMonth()+1).slice(-2),r="0".concat(e.getUTCDate()).slice(-2);return"".concat(t,"-").concat(n,"-").concat(r)}}}},s=(0,g.tq)();s&&(r.preset="mobile",r.fullscreen=!1,r.disabled_features.push("left_toolbar"),r.disabled_features.push("main_series_scale_menu"));let o=new V(r);o.onChartReady(()=>{P(!1),o.subscribe("onAutoSaveNeeded",()=>{q(h)})}),v(o)},[I,L,E]),(0,s.useEffect)(()=>()=>{null!==h&&(h.remove(),v(null))},[]),(0,s.useEffect)(()=>{function e(e){document.fullscreenElement||S(!1)}return document.addEventListener("fullscreenchange",e),()=>{document.removeEventListener("fullscreenchange",e)}},[]),(0,r.jsxs)("div",{className:ea().component,id:"tv-chart",children:[F&&(0,r.jsx)(D.Z,{}),(0,r.jsxs)("div",{className:ea().header,children:[(0,r.jsx)("div",{className:ea().header_interval,children:null===(t=null==f?void 0:f.slice(0,5))||void 0===t?void 0:t.map((e,t)=>(0,r.jsx)("span",{onClick:()=>O(e),className:N==(null==e?void 0:e.interval)?ea().current:"",children:null==e?void 0:e.title},t))}),(0,r.jsxs)("div",{className:c()({[ea().header_more]:!0,[ea().current]:j}),onMouseOver:T,onMouseOut:Z,children:[(0,r.jsxs)("div",{className:ea().header_more_btn,children:[null===(n=null==f?void 0:f.slice(5,(null==f?void 0:f.length)||0))||void 0===n?void 0:n.map((e,t)=>N==(null==e?void 0:e.interval)&&(0,r.jsx)("span",{children:e.title},t)),(0,r.jsx)("i",{className:"iconfont icon-triangle-down",style:{color:"#828c9b"}})]}),(0,r.jsx)("div",{className:ea().header_more_list,children:null===(o=null==f?void 0:f.slice(5,(null==f?void 0:f.length)||0))||void 0===o?void 0:o.map((e,t)=>(0,r.jsx)("span",{onClick:()=>O(e),className:N==(null==e?void 0:e.interval)?"selected":"",children:null==e?void 0:e.title},t))})]}),(0,r.jsxs)("div",{className:ea().header_tool,children:[(0,r.jsxs)("span",{onClick:()=>M("draw"),children:[(0,r.jsx)("i",{className:"iconfont icon-draw-tools"}),(0,r.jsx)("em",{children:p("tvChartsDrawTool")})]}),(0,r.jsxs)("span",{onClick:()=>M("target"),children:[(0,r.jsx)("i",{className:"iconfont icon-target"}),(0,r.jsx)("em",{children:p("tvChartsStudyTool")})]}),(0,r.jsxs)("span",{onClick:()=>M("set"),children:[(0,r.jsx)("i",{className:"iconfont icon-set"}),(0,r.jsx)("em",{children:p("tvChartsSettingTool")})]}),(0,r.jsxs)("span",{onClick:()=>M("save"),children:[(0,r.jsx)("i",{className:"iconfont icon-save"}),(0,r.jsx)("em",{children:p("tvChartsSaveTool")})]}),w?(0,r.jsxs)("span",{onClick:()=>M("fullScreenClose"),children:[(0,r.jsx)("i",{className:"iconfont icon-full-screen-close"}),(0,r.jsx)("em",{children:p("tvChartsExitFullTool")})]}):(0,r.jsxs)("span",{onClick:()=>M("fullScreen"),children:[(0,r.jsx)("i",{className:"iconfont icon-full-screen"}),(0,r.jsx)("em",{children:p("tvChartsFullTool")})]})]})]}),(0,r.jsx)("div",{ref:A,className:ea().container})]})};var el=ei;let ec=(0,R.ZP)(()=>n.e(7546).then(n.bind(n,77546)),{fallback:(0,r.jsx)(D.Z,{})});var ed=function(e){let{symbolInfo:t,interval:n,intervalStr:o,theme:a}
1=e,[i,l]=(0,s.useState)("kline");function c(e){l(e)}return(0,r.jsxs)("div",{className:T().component,children:[(0,r.jsxs)("div",{className:T().tabs,children:[(0,r.jsx)("span",{onClick:()=>c("kline"),className:"kline"===i?T().current:"",children:"Trading View"}),(0,r.jsx)("span",{onClick:()=>c("depth"),className:"depth"===i?T().current:"",children:"Depth"})]}),(0,r.jsxs)("div",{className:T().container,children:["kline"===i&&(0,r.jsx)(el,{symbolInfo:t,interval:n,intervalStr:o,theme:a}),"depth"===i&&(0,r.jsx)(ec,{})]})]})},eu=n(33911),em=n(87582);let e_=(0,eu.zo)("div",{name:"Mask"})(e=>{let{theme:t,open:n}=e;return{height:"100%",width:"100%",position:"fixed",top:0,left:0,zIndex:t.zIndex.drawer,background:(0,em.U1)(t.palette.black,.56),display:n?"block":"none"}}),ep=(0,eu.zo)("div")(e=>{let{theme:t,open:n}=e;return{position:"fixed",inset:0,zIndex:t.zIndex.drawer,display:n?"block":"none"}}),eh=(0,eu.zo)("div")(e=>{let{theme:t}=e;return{position:"absolute",zIndex:t.zIndex.drawer,top:0,right:0,bottom:0,maxWidth:"100vw",width:"400px"}}),ev=(0,eu.zo)("div")(e=>{let{theme:t}=e;return{display:"flex",flexDirection:"column",height:"100%",width:"100%",overflow:"auto",background:"#fff",padding:"".concat(t.spacing(2)," ").concat(t.spacing(3))}}),ef=s.forwardRef(function(e,t){let{open:n,defaultOpen:o,onOk:a,onCancel:i,children:l,maskClosable:c}=e,d=s.useRef(),[u,m]=(0,eu.C8)(o,{value:n}),_=()=>{"open"in e||m(!1),i&&i()},p=e=>{c&&d.current===e.target&&_()};return s.useEffect(()=>(u?document.body.style.overflow="hidden":document.body.style.overflow="auto",()=>{document.body.style.overflow="auto"}),[u]),(0,r.jsx)(eu.h_,{children:(0,r.jsxs)(ep,{ref:t,open:u,children:[(0,r.jsx)(e_,{onClick:p,open:u,ref:d}),(0,r.jsx)(eh,{children:(0,r.jsx)(ev,{children:l})})]})})});ef.defaultProps={maskClosable:!0,defaultOpen:!0};var eb=ef,eg=n(22776),ex=n.n(eg),ey=n(51530),ej=n.n(ey),eC=n(36460),eN=n.n(eC);function ek(e,t,n){let r=Object.keys(e).find(e=>"tradfi"===e.toLowerCase());if(r&&e[r]){let s="".concat(t,"/").concat(n).toUpperCase(),o=e[r].some(e=>(e.name||"").toUpperCase()===s);if(o)return r}return n}var ew=function(e){let{t,lang:n}=(0,u.Z)("trade"),i=(0,o.useRouter)(),{symbolList:l,baseCoin:m,quoteCoin:_,coinRates:p}=e,v="".concat(_).concat(m).toLocaleLowerCase(),[f,x,y]=ej()(v),C=d.Z.get(b.r)||"",[N,k]=(0,s.useState)(C),[w,S]=(0,s.useState)(""),[F,P]=(0,s.useState)("chg"),[A,I]=(0,s.use
1State)(""),[L,U]=(0,s.useState)(""),[E,D]=(0,s.useState)([]),[R,O,T]=ej()([]),[B,Z,M]=ej()([]),[W,q]=(0,s.useState)([]),[z,V,H]=ej()(()=>ek(l,_,m)),[Q,J]=(0,s.useState)(new Date-0),Y=(0,s.useRef)(null),K=(0,s.useRef)(null),G=(0,s.useRef)({active:!1,startX:0,scrollLeft:0,moved:!1}),{webSocket:X,socketConnected:$}=(0,s.useContext)(j);function ee(e){let t=[],n=new Set,r=Object.keys(e);r.forEach(r=>{e[r].forEach(e=>{n.has(e.key)||(n.add(e.key),t.push(e))})}),O(t)}(0,s.useEffect)(()=>{let e=Object.keys(l);q(e);let t=l[z];Z(t),ee(l),ei()},[]),(0,s.useEffect)(()=>{if(!i.isReady||0===W.length)return;let e=i.query.market,t=e&&W.some(t=>t.toLowerCase()===String(e).toLowerCase());if(!t){let n=(i.asPath.split("?")[1]||"").toLowerCase();e=W.slice().sort((e,t)=>t.length-e.length).find(e=>n.includes("market=".concat(e.toLowerCase())))}if(!e)return;let r=W.find(t=>t.toLowerCase()===String(e).toLowerCase());r&&ea(r)},[i.isReady,i.asPath,W]);let et=e=>{S(e.target.value);let t=e.target.value.toLowerCase(),n=[];if(t){let r=[...T.current];n=r.filter(e=>{let n=e.name.split("/")[0].toLowerCase(),r=(e.coinFullName||"").toLowerCase(),s=(e.coinAlias||"").toLowerCase();return -1!==n.indexOf(t)||-1!==r.indexOf(t)||-1!==s.indexOf(t)})}else{let s=[];E.map(e=>s.push({key:e})),n="fav"==z?s:l[z]}let o=el(n);Z(o),eh(o)},en=w.length>0;function er(){S(""),Y.current.value="";let e={target:{value:""}};et(e)}let es=e=>{let t=""!==A?"":L;if(e||(e="chg"===F?"vol":"chg"),P(e),t){let n=(0,g.Ok)([...T.current],e,t);O(n);let r=el([...M.current]);Z(r)}else ee(l)},eo=(e,t)=>{let n="name"===e?""===t?"desc":"desc"===t?"asc":"":"",r="name"!==e?""===t?"desc":"desc"===t?"asc":"":"";I(n),U(r);let s="name"===e?n:r;if(""===s)ee(l);else{let o=(0,g.Ok)([...T.current],e,s);O(o)}let a=el([...M.current]);Z(a)},ea=e=>{let t=[];if(Y.current.value="",S(""),"fav"===e){let n=[];E.map(e=>n.push({key:e}));let r=el(n);Z(r),t=el(n)}else{let s=el(l[e]);Z(s),t=el(l[e])}V(e),eh(t)};function ei(){if(N)(0,a.QR)().then(e=>{let t="0"===e.code?e.data.optionalSymbols:[];D(t)});else{let e=localStorage.getItem("favorites")?JSON.parse(localStorage.getItem("favorites")):[];D(e)}}function el(e){let t=[],n=T.current;return n.map(n=>{e&&e.map(e=>{n.key===e.key&&t.push(n)})}),t}function ec(e){let t=[...E];if(t.length>0&&t.indexOf(e.key)>-1){let n=t.indexOf(e.key);t.splice(n,1),N&&(0,a.Jd)({operation:2,symbol:e.key})}else t.push(e.key),N&&(0,a.Jd)({operation:1,symbol:e.key});if(N||localStorage.setItem("favorites",JSON.stringify(t)),"fav"===z){let r=[];Y.current.value?r=[...M.current]:t.map(e=>r.push({key:e}));let s=el(r);Z(s)}D(t)}let[ed,eu,em]=ej()([]);function e_(){let e=[];try{e=[...l[H.current]]}catch(t){e=[...l.NEW]}eu(e),ep("sub")}function ep(e){if(!$)return;let t=em.current;t.map(t=>{X.send({event:e,params:{cb_id:t.key,channel:"market_".concat(t.key,"_ticker")}})})}let eh=e=>{ep("unsub");let t=[...e];eu(t),ep("sub")};function ev(e){let n=new Date-0,r=y.current;if(e.tick&&e.channel){let s=e.channel.split("_")[1],o=e.channel.split("_")[2];if("ticker"!==o)return;let a=[...T.current],i=a.map(o=>{if(o.key===s){let a=0;a="{}"!==JSON.stringify(p)&&o.name.split("/")[1]&&p[o.name.split("/")[1]]&&parseFloat((e.tick.close*p[o.name.split("/")[1]].IDR).toFixed(4));let i=(0,g.oU)(e.tick.close||0,o.scale.price);o.prevPirce=o.price||i,o.price=i,o.chg=parseFloat((Math.round(1e4*(e.tick.rose||0))/100).toFixed(2)),o.vol=parseFloat(e.tick.vol||0),o.value=a||0,o.low=(0,g.oU)(e.tick.low||0,o.scale.price),o.high=(0,g.oU)(e.tick.high||0,o.scale.price),o.amount=e.tick.amount||0}return o.key===r&&n-Q>=300&&(document.title=o.price?t("seo.title",{price:(0,g.uf)(o.price),symbolName:(null==o?void 0:o.name)||""}):t("seo.untitle",{symbolName:(null==o?void 0:o.name)||"",coin:null==_?void 0:_.toUpperCase(),base:null==m?void 0:m.toUpperCase()})),o});if(n-Q>=250){O(i),J(n);let c=""!==A?"":L;if(c){let d=el([...M.current],F,c);Z(d)}else ee(l)}}}(0,s.useEffect)(()=>{if(!$)return;e_();let e=e=>ev(e);return X.onMessage(e),()=>{X.offMessage(e)}},[$]),(0,s.useEffect)(()=>(i.events.on("beforeHistoryChange",ef),()=>{i.events.off("beforeHistoryChange",ef)}));let ef=e=>{ep("unsub")};return(0,s.useEffect)(()=>{let e="".concat(_).concat(m).toLocaleLowerCase();x(e),e_()},[_,m]),(0,r.jsx)("div",{className:eN().component,children:(0,r.jsxs)("div",{className:eN().boxSizing,children:[(0,r.jsx)("div",{className:eN().filter,children:(0,r.jsxs)("div",{className:eN().filterName,children:[(0,r.jsx)("i",{className:"iconfont icon-search"}),(0,r.jsx)("input",{type:"text",placeholder:t("coinSearch"),onChange:e=>et(e),ref:Y,className:eN().searchInput}),en&&(0,r.jsx)("i",{onClick:()=>er(),className:c()(["iconfont","icon-clearup",eN().clear])})]})}),(0,r.jsx)("div",{className:eN().title_outer,children:(0,r.jsx)("div",{className:eN().title,id:eN().titleScroll,ref:K,onMouseDown(e){G.current={active:!0,startX:e.pageX-K.current.offsetLeft,scrollLeft:K.current.scrollLeft,moved:!1}},onMouseMove(e){if(!G.current.active)return;let t=e.pageX-K.current.offsetLeft-G.current.startX;Math.abs(t)>5&&(G.current.moved=!0),K.current.scrollLeft=G.current.scrollLeft-t},onMouseUp(){G.current.active=!1},onMouseLeave(){G.current.active=!1},children:(0,r.jsxs)("ul",{className:eN().tabs,children:[(0,r.jsx)("li",{className:c()({[eN().coin]:!0,[eN().cfav]:!0,[eN().current]:"fav"==z}),onClick(){G.current.moved||ea("fav")},children:(0,r.jsx)("i",{className:"iconfont icon-star"})}),W.map((e,t)=>(0,r.jsx)("li",{className:c()({[eN().current]:e===z,[eN().coin]:!0}),onClick(){G.current.moved||ea(e)},children:e.toUpperCase()},t))]})})}),(0,r.jsxs)("div",{className:eN().lists,children:[(0,r.jsxs)("div",{className:eN().theader,children:[(0,r.jsxs)("span",{className:c()({[eN().col1]:!0,[eN().sort]:!0}),onClick:()=>eo("name",A),children:[t("market"),(0,r.jsx)("em",{className:c()({[eN().asc]:"asc"===A,[eN().desc]:"desc"===A})})]}),(0,r.jsx)("span",{className:eN().col2,children:t("newestPrice")}),(0,r.jsxs)("span",{className:c()({[eN().col3]:!0,[eN().sort1]:!0}),onClick:()=>eo(F,L),children:[(0,r.jsx)("span",{className:eN().value,children:"chg"===F?"".concat(t("downUpRate")):"".concat(t("dayVolume"))}),(0,r.jsx)("em",{className:c()({[eN().asc]:"asc"===L,[eN().desc]:"desc"===L})})]}),(0,r.jsx)("span",{className:c()({[eN().col4]:!0,[eN().sort]:!0}),children:(0,r.jsx)("i",{onClick:()=>es(""),className:"iconfont icon-qiehuan"})})]}),(0,r.jsx)("div",{className:eN().tbody,children:(0,r.jsx)("ul",{children:null==B?void 0:B.map((t,n)=>{let s=t.name.split("/")[0],o=t.name.split("/")[1],a=void 0!==t.price?void 0!==t.scale.price&&Number(t.price).toFixed(t.scale.price):t.lastPrice?Number(t.lastPrice).toFixed(t.scale.price):0,i=void 0!==t.vol?(0,g.uf)(t.vol,t.scale.volume):"-";return(0,r.jsx)(h(),{href:"/trade/".concat(t.name.replace("/","-")),children:(0,r.jsxs)("li",{onClick(){e.closeFn&&e.closeFn()},className:c()({[eN().current]:t.key===f,[eN().liItem]:!0}),children:[(0,r.jsxs)("span",{className:eN().col1,children:[(0,r.jsx)("i",{className:c()({iconfont:!0,"icon-star":!0,[eN().fav]:E.indexOf(t.key)>-1}),onClick(e){e.preventDefault(),e.stopPropagation(),ec(t)}}),t.leverage&&t.longShortDirection?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("var",{children:t.coinAlias||s}),(0,r.jsxs)("b",{children:[t.leverage||0,"-1"===t.longShortDirection?"XS":"
1XL"]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:eN().coinName,children:t.coinAlias||s}),(0,r.jsxs)("em",{children:["/",t.quoteAlias||o]})]})]}),(0,r.jsx)("span",{className:eN().col2,children:(0,g.uf)(a)||"-"}),"chg"===F&&(0,r.jsxs)("span",{className:c()({[eN().col3]:!0,[eN().rose]:void 0!==t.chg?parseFloat(t.chg)>0:parseFloat(t.rate)>0,[eN().fall]:void 0!==t.chg?0>parseFloat(t.chg):0>parseFloat(t.rate)}),children:[void 0!==t.chg?Number(t.chg)>0&&"+":Number(t.rate)>0&&"+",void 0!==t.chg?(1*t.chg).toFixed(2):(100*Number(t.rate)).toFixed(2),"%"]}),"vol"===F&&(0,r.jsx)("span",{className:eN().col3,children:i})]})},n)})})})]})]})})},eS=n(84574),eF=n(36311),eP=n.n(eF);function eA(e){let{arr:t,symbolInfo:n,depthVal:r=0}=e,s=[],o=n.depth2&&"undefined"!=n.depth2[r]?n.depth2[r]:1,a=(String(o).split(".")[1]||[]).length||0;return t.map(e=>{s.push({price:e[0],amount:e[1],priceAmount:e[3],averagePrice:Number(e[4]).toFixed(a),baseCoinCountPrice:n.scale&&void 0!==n.scale.volume&&(0,g.hu)(Number(e[2]).toFixed(n.scale.volume))||(0,g.Hf)(e[2]||0),quoteCoinCountPrice:n.scale&&void 0!==n.scale.amount&&(0,g.hu)(Number(e[5]).toFixed(n.scale.amount))||(0,g.Hf)(e[5])})}),s}let eI=e=>{let t=(0,o.useRouter)(),{t:n,lang:i}=(0,u.Z)("trade"),{symbolInfo:l,quoteCoin:d,baseCoin:m,coinRates:_}=e,[p,h,v]=ej()("all"),[f,b]=(0,s.useState)(!1),[y,C]=(0,s.useState)(0),[N,k,w]=ej()([]),[S,F,P]=ej()([]),[A,I]=(0,s.use
1State)([]),[L,U]=(0,s.useState)([]),{tradeStore:E}=(0,x.oR)(),{webSocket:D,socketConnected:R}=(0,s.useContext)(j),[O,T,B]=ej()({}),Z="".concat(d).concat(m).toLocaleLowerCase(),[M,W,q]=ej()(Z);function z(e,t){let n="".concat(d).concat(m).toLocaleLowerCase();R&&D.send({event:e,params:{channel:"market_".concat(n,"_depth_step").concat(t),cb_id:n}})}function V(e){if(e.tick&&e.tick.asks&&e.tick.buys){let{asks:t,buys:n}=e.tick;J(t,n),E.setDepthData({a:t,b:n}),"ask"===en.current&&er.current<=w.current.length?($.current=w.current[er.current],$.current.baseCoinCountPrice=$.current.baseCoinCountPrice.replace(/,/g,""),$.current.quoteCoinCountPrice=$.current.quoteCoinCountPrice.replace(/,/g,""),ee.current=er.current):"buy"===en.current&&er.current<=P.current.length?($.current=P.current[er.current],$.current.baseCoinCountPrice=$.current.baseCoinCountPrice.replace(/,/g,""),$.current.quoteCoinCountPrice=$.current.quoteCoinCountPrice.replace(/,/g,""),et.current=er.current):($.current=null,ee.current=-1,et.current=-1)}if(e.tick&&e.channel){let r=q.current,s=e.channel.split("_")[1],o=e.channel.split("_")[2];if(s===r&&"ticker"===o){let a={prevPirce:0,price:0},i=e.tick.close||0;a.prevPirce=B.current.price||i,a.price=i,T(a)}}}(0,s.useEffect)(()=>{function e(){b(!1)}return document.addEventListener("click",e,!1),()=>{document.removeEventListener("click",e,!1)}},[]),(0,s.useEffect)(()=>(t.events.on("beforeHistoryChange",H),t.events.on("routeChangeStart",e=>{}),()=>{t.events.off("beforeHistoryChange",H)}));let H=e=>{z("unsub",y),b(!1),C(0)};(0,s.useEffect)(()=>{if(!R)return;z("sub",0);let e=e=>V(e);return D.onMessage(e),()=>{D.offMessage(e)}},[R,D]);let Q=e=>{let t;h(e),t="ask"===e?A.length:"buy"===e?L.length:17;let n=eA({arr:A,symbolInfo:l,depthVal:y}),r=eA({arr:L,symbolInfo:l,depthVal:y}),s=n.slice(0,t).reverse(),o=r.slice(0,t);k(s),F(o)},J=(e,t)=>{let n;I(e),U(t),n="ask"===v.current?e.length:"buy"===v.current?t.length:17;let r=eA({arr:e,symbolInfo:l,depthVal:y}),s=eA({arr:t,symbolInfo:l,depthVal:y}),o=r.slice(0,n).reverse(),a=s.slice(0,n);k(o),F(a)},Y=()=>{b(!f)};function K(e){e.nativeEvent.stopImmediatePropagation()}let G=e=>{z("unsub",y),z("sub",e),b(!1),C(e)};async function X(){try{var e;let t="".concat(d).concat(m).toLocaleLowerCase(),n=await (0,a.io)({symbol:t}),r=(null==n?void 0:null===(e=n.data)||void 0===e?void 0:e.tick)||{};E.setDepthData(r),I(r.a||[]),U(r.b||[]);let s=eA({arr:r.a||[],symbolInfo:l,depthVal:0}).reverse(),o=eA({arr:r.b||[],symbolInfo:l,depthVal:0});k(s),F(o)}catch(i){console.log(i)}}(0,s.useEffect)(()=>{z("sub",y),X();let e="".concat(d).concat(m).toLocaleLowerCase();W(e),T({})},[d,m]);let $=(0,s.useRef)(null),ee=(0,s.useRef)(-1),et=(0,s.useRef)(-1),en=(0,s.useRef)(""),er=(0,s.useRef)(-1),es=(0,s.useRef)(0),eo=(0,s.useRef)(!1),ea=(e,t,n)=>{let r=n.target.parentNode.offsetTop-26.5;n.target.parentNode.parentNode.parentNode.scrollTop;let s=r;er.current=e,en.current=t,es.current=s,"ask"===en.current&&er.current<=w.current.length?($.current=w.current[er.current],$.current.baseCoinCountPrice=$.current.baseCoinCountPrice.replace(/,/g,""),$.current.quoteCoinCountPrice=$.current.quoteCoinCountPrice.replace(/,/g,""),ee.current=er.current):"buy"===en.current&&er.current<=P.current.length?($.current=P.current[er.current],$.current.baseCoinCountPrice=$.current.baseCoinCountPrice.replace(/,/g,""),$.current.quoteCoinCountPrice=$.current.quoteCoinCountPrice.replace(/,/g,""),et.current=er.current):($.current=null,ee.current=-1,et.current=-1),eo.current=!0},ei=()=>{er.current=-1,en.current="",es.current=0,eo.current=!1},el=parseFloat(B.current.prevPirce||0),ec=parseFloat(B.current.price||0),ed=l.depth2&&"undefined"!=l.depth2[y]?l.depth2[y]:1,eu=(String(ed).split(".")[1]||[]).length||0;return(0,r.jsxs)("div",{className:eP().orderBookWrap,children:[(0,r.jsxs)("div",{className:c()(eP().title,eP().pankou),children:[(0,r.jsx)("div",{className:eP().switch,children:(0,r.jsxs)("ul",{children:[(0,r.jsxs)("li",{className:c()({[eP().current]:"all"===p}),onClick:()=>Q("all"),children:[(0,r.jsx)("span",{}),(0,r.jsx)("span",{}),(0,r.jsx)("span",{}),(0,r.jsx)("span",{})]}),(0,r.jsxs)("li",{className:c()({[eP().current]:"ask"===p}),onClick:()=>Q("ask"),children:[(0,r.jsx)("span",{}),(0,r.jsx)("span",{}),(0,r.jsx)("span",{}),(0,r.jsx)("span",{})]}),(0,r.jsxs)("li",{className:c()({[eP().current]:"buy"===p}),onClick:()=>Q("buy"),children:[(0,r.jsx)("span",{}),(0,r.jsx)("span",{}),(0,r.jsx)("span",{}),(0,r.jsx)("span",{})]})]})}),l.depth2&&l.depth2.length>0&&(0,r.jsxs)("div",{className:eP().decimals,children:[(0,r.jsx)("span",{children:n("concatDeep")}),(0,r.jsxs)("div",{className:eP().dropdown,onClick:e=>K(e),children:[(0,r.jsxs)("div",{onClick:Y,children:[(0,r.jsxs)("em",{children:[(0,g.uf)(l.depth2[y],void 0,i),""]}),(0,r.jsx)("i",{className:"iconfont icon-triangle-down"})]}),f&&(0,r.jsx)("div",{className:eP().dropdownlist,children:l.depth2.map((e,t)=>(0,r.jsxs)("p",{className:c()({[eP().current]:y===t}),onClick:()=>G(t),children:[(0,g.uf)(e),""]},t))})]})]})]}),(0,r.jsxs)("div",{className:eP().lists,children:[(0,r.jsxs)("div",{className:eP().theader,children:[(0,r.jsxs)("span",{className:eP().col1,children:[n("price")," (",(null==l?void 0:l.quoteAlias)||m.toUpperCase(),")"]}),(0,r.jsxs)("span",{className:eP().col2,children:[n("num")," (",(null==l?void 0:l.coinAlias)||d.toUpperCase(),")"]}),(0,r.jsx)("span",{className:eP().col3,children:n("dayVolume")})]}),(0,r.jsxs)("div",{className:eP().tbody,children:[(0,r.jsx)("div",{className:c()({[eP().md_scroll]:"all"==p,[eP().scroll]:"ask"===p}),style:{display:"all"===p||"ask"===p?"block":"none"},children:(0,r.jsx)("ul",{children:N&&N.length>0&&N.map((e,t)=>{let n=N.map(e=>e.amount),s=Math.max.apply(null,n),o=e.priceAmount,a=new eS.Z(e.amount).div(s).times(1).decimalPlaces(2).toNumber(),i=l.scale&&void 0!==l.scale.volume&&(Number(e.amount-0).toFixed(l.scale.volume)||0)||e.amount,d=l.scale&&void 0!==l.scale.amount&&(Number(o).toFixed(l.scale.amount)||0)||o;return(0,r.jsxs)("li",{onClick:()=>null==E?void 0:E.setStrikePrice(e.price),onMouseOver:e=>ea(t,"ask",e),onMouseOut:e=>ei(e),className:c()({[eP().lmask]:ee>=0&&ee<=t,[eP().li]:!0}),children:[(0,r.jsx)("span",{className:c()({[eP().rorder]:e.isMyOrder,[eP().fall]:!0,[eP().col1]:!0}),children:(0,g.uf)(e.price,eu)}),(0,r.jsx)("span",{className:eP().col2,children:(0,g.uf)(i)}),(0,r.jsx)("span",{className:eP().col3,children:(0,g.uf)(d)}),(0,r.jsx)("div",{style:{transform:"scaleX(".concat(a,")")},className:c()([eP().progress,eP().progressAsk])})]},t)})})}),(0,r.jsx)("div",{className:eP().price,children:(0,r.jsx)("span",{className:c()({[eP()["text-up"]]:ec>el,[eP().rose]:ec>el,[eP()["text-down"]]:ec<el,[eP().fall]:ec<el}),children:(0,g.uf)(O.price||E.latestPrice||0,l.scale.price,i)})}),(0,r.jsx)("div",{className:c()({[eP().md_scroll]:"all"==p,[eP().scroll]:"buy"===p}),style:{display:["all","buy"].includes(p)?"block":"none"},children:(0,r.jsx)("ul",{children:S&&S.length>0&&S.map((e,t)=>{let n=S.map(e=>e.amount),s=Math.max.apply(null,n),o=e.priceAmount,a=new eS.Z(e.amount).div(s).times(1).decimalPlaces(2).toNumber();return(0,r.jsxs)("li",{onClick:()=>null==E?void 0:E.setStrikePrice(e.price),onMouseOver:e=>ea(t,"buy",e),onMouseOut:e=>ei(e),className:c()({[eP().lmask]:et>=0&&et>=t}),children:[(0,r.jsx)("span",{className:c()({[eP().rorder]:e.isMyOrder,[eP().rose]:!0,[eP().col1]:!0}),children:(0,g.uf)(e.price,eu)}),(0,r.jsx)("span",{className:eP().col2,children:l.scale&&void 0!==l.scale.volume&&(0,g.uf)(e.amount,l.
1scale.volume)||0}),(0,r.jsx)("span",{className:eP().col3,children:l.scale&&void 0!==l.scale.amount&&(0,g.uf)(o,l.scale.amount)||0}),(0,r.jsx)("div",{style:{transform:"scaleX(".concat(a,")")},className:c()([eP().progress,eP().progressBuy])})]},t)})})}),$.current&&eo.current&&(0,r.jsxs)("div",{className:eP().convert,style:{top:"".concat(es.current,"px")},children:[(0,r.jsxs)("p",{className:eP().clearFix,children:[(0,r.jsxs)("span",{children:[n("avgPrice"),":"]}),(0,r.jsxs)("em",{children:["≈ ",(0,g.uf)($.current.averagePrice||0)]})]}),(0,r.jsxs)("p",{className:eP().clearFix,children:[(0,r.jsxs)("span",{children:[n("priceSum")," ",(null==l?void 0:l.coinAlias)||d.toUpperCase(),":"]}),(0,r.jsx)("em",{children:(0,g.uf)($.current.baseCoinCountPrice||0)})]}),(0,r.jsxs)("p",{className:eP().clearFix,children:[(0,r.jsxs)("span",{children:[n("priceSum")," ",(null==l?void 0:l.quoteAlias)||m.toUpperCase(),":"]}),(0,r.jsx)("em",{children:(0,g.uf)($.current.quoteCoinCountPrice||0)})]})]})]})]})]})};var eL=eI,eU=n(93767),eE=n(70477),eD=n(82124);n(30939);var eR=n(59670),eO=n(23953),eT=n(75152),eB=n(71136),eZ=n(92561),eM=n.n(eZ),eW=function(e){let t=!0,{baseCoin:n,symbolInfo:o,quoteCoin:i,balance:l,token:d,coinRates:m,strikePrice:_,latestPrice:p,mdTabType:v,isCd:f}=e,{t:b,lang:y}=(0,u.Z)("trade"),{tradeStore:j}=(0,x.oR)();(0,s.useEffect)(()=>{},[]),(0,s.useEffect)(()=>{d&&(D||(ea.current.value=_),O||(el.current.value=_),ei.current.value="",ec.current.value="",F(0),A(0),L(0),E(0))},[_]),(0,s.useEffect)(()=>{ea.current&&(ea.current.value=D?eI("buy",Z):""),el.current&&(el.current.value=O?eI("sell",W):""),ei.current.value="",ec.current.value="",F(0),A(0),L(0),E(0)},[i]);let C=(null==o?void 0:o.quoteAlias)||n.toUpperCase(),N=(null==o?void 0:o.coinAlias)||i.toUpperCase(),[k,w]=(0,s.useState)(""),[S,F]=(0,s.use
1State)(0),[P,A]=(0,s.useState)(0),[I,L]=(0,s.useState)(0),[U,E]=(0,s.useState)(0),[D,R]=(0,eE.Z)("trade_limit_bbo_buy_mode",{defaultValue:!1}),[O,T]=(0,eE.Z)("trade_limit_bbo_sell_mode",{defaultValue:!1}),[Z,M]=(0,eE.Z)("trade_limit_bbo_buy_value",{defaultValue:"Counterparty 1"}),[W,q]=(0,eE.Z)("trade_limit_bbo_sell_value",{defaultValue:"Counterparty 1"}),[z,V]=(0,s.useState)(!1),[H,Q]=(0,s.useState)(""),[J,Y]=(0,s.useState)(""),[K,G]=(0,s.useState)(""),[X,$]=(0,s.useState)(""),[ee,et]=(0,s.useState)(!1),[en,er]=(0,s.useState)(!1),[es,eo]=(0,s.useState)(null),ea=(0,s.useRef)(null),ei=(0,s.useRef)(null),el=(0,s.useRef)(null),ec=(0,s.useRef)(null),ed=D?eI("buy",Z):null,eu=O?eI("sell",W):null;function em(){V(!1),$(""),Q(""),G(""),Y("")}function e_(){"BUY"===X&&eC(ea.current.value,ei.current.value,"BUY"),"SELL"===X&&eC(el.current.value,ec.current.value,"SELL"),em()}(0,s.useEffect)(()=>{if(ed&&ea.current){var e;ea.current.value=ed;let t=parseFloat(null===(e=ei.current)||void 0===e?void 0:e.value);if(t>0){let n=o.scale&&o.scale.price||0,r=o.scale&&o.scale.volume||0,s=new eS.Z(t).times(ed).dp(n,eS.Z.ROUND_DOWN).toNumber();A((0,g.Hf)(s));let a=l.countCoinBalance||0,i=new eS.Z(a).div(ed).dp(r,eS.Z.ROUND_DOWN).toNumber(),c=i>0?new eS.Z(t).times(ed).div(a).times(100).integerValue(eS.Z.ROUND_DOWN).toNumber():0;F(c>100?100:c)}}},[ed]),(0,s.useEffect)(()=>{if(eu&&el.current){var e;el.current.value=eu;let t=parseFloat(null===(e=ec.current)||void 0===e?void 0:e.value);if(t>0){let n=o.scale&&o.scale.price||0,r=new eS.Z(t).times(eu).dp(n,eS.Z.ROUND_DOWN).toNumber();E((0,g.Hf)(r))}}},[eu]);let ep=(e,t,r,s)=>{let a=o.scale&&o.scale.price||0,i=o.scale&&o.scale.volume||0,c="price"===s?a:i,d=l.baseCoinBalance||0,u=l.countCoinBalance||0,_=parseFloat(e.target.value);_<0||_+""=="NaN"?e.target.value="":e.target.value.length>14&&(e.target.value=e.target.value.slice(0,14)),e.target.value!=_&&""!=e.target.value&&(e.target.value=_);let p=e.target.value.split(".")[0],h=e.target.value.split(".")[1];h&&(c>0&&h.length>c&&(e.target.value="".concat(p,".").concat(h.slice(0,c))),0==c&&(e.target.value=e.target.value.split(".")[0]));let v=0,f=0;if("buy"===r&&e.target.value&&t&&("price"===s&&(ei.current.value="",v=0,f=0),"volume"===s)){let b=new eS.Z(u).div(t).dp(i,eS.Z.ROUND_DOWN).toNumber()||0;b>0?parseFloat(e.target.value)>b&&(e.target.value=b):e.target.value=0,v=b>0?new eS.Z(e.target.value).times(t).dp(a,eS.Z.ROUND_DOWN).toNumber():0,f=b>0?new eS.Z(e.target.value).times(t).div(u).times(100).integerValue(eS.Z.ROUND_DOWN).toNumber():0}if("sell"===r&&("price"===s&&t&&(v=parseFloat(d)>0?new eS.Z(e.target.value||0).times(t).dp(a,eS.Z.ROUND_DOWN).toNumber():0,f=parseFloat(d)>0?new eS.Z(t).div(d).times(100).integerValue(eS.Z.ROUND_DOWN).toNumber():0),"volume"===s&&(parseFloat(d)>0?parseFloat(e.target.value)>parseFloat(d)&&(e.target.value=d):e.target.value=0,v=parseFloat(d)>0?new eS.Z(e.target.value).times(t||0).dp(a,eS.Z.ROUND_DOWN).toNumber():0,f=parseFloat(d)>0?new eS.Z(e.target.value).div(d).times(100).integerValue(eS.Z.ROUND_DOWN).toNumber():0)),"buy"===r?(A((0,g.Hf)(v)),F(f>100?100:f)):(E((0,g.Hf)(v)),L(f>100?100:f)),"price"===s){let x="{}"!==JSON.stringify(m)&&n&&m[n.toUpperCase()].IDR||0,y=parseFloat((e.target.value*x).toFixed(4))||0;ex(y)}};function eh(e){ep(e,ei.current.value,"buy","price")}function ev(e){ep(e,ea.current.value,"buy","volume")}function ef(e){ep(e,ec.current.value,"sell","price")}function eb(e){ep(e,el.current.value,"sell","volume")}let[eg,ex]=(0,s.useState)(0);function ey(e,t){let r="{}"!==JSON.stringify(m)&&n&&m[n.toUpperCase()].IDR||0,s=parseFloat((t.target.value*r).toFixed(4))||0;ex(s),w(e)}function ej(){ex(0),w("")}function eC(r,s,o){let l="".concat(i).concat(n).toLocaleLowerCase(),c="BUY"===o,d=c?D:O,u=c?Z:W,m={symbol:l,type:1,price:r,volume:s,side:o,...d?eA(c?"buy":"sell",u):{}};if(!t)return!1;t=!1,"BUY"===o&&(0,eT.Z)("spot_sub_buy_action",{bb_trademode:"limit",buy_price:r,buy_number:s,tradepair_name:l,trans_amount:r*s}),"SELL"===o&&(0,eT.Z)("spot_sub_sell_action",{bb_trademode:"limit",sell_price:r,sell_number:s,tradepair_name:l,trans_amount:r*s}),(0,a.NO)(m).then(r=>{if(t=!0,"200"===r.code)(0,B.A)({type:"success",msg:b("delegateSuccess")}),e.mdMenuClose&&e.mdMenuClose(),e.onOkCb(),"BUY"===o&&(ei.current.value="",F(0),A(0)),"SELL"===o&&(ec.current.value="",L(0),E(0));else if("3"===r.code||"403"===r.code||"100006"===r.code)location.href="/login?callBackPath=/trade";else if("5"===r.code)(0,B.A)({type:"error",msg:b("orderFail")});else if("9"===r.code)(0,B.A)({type:"error",msg:b("userAccountFrozen")});else if("25"===r.code){if(parseFloat(r.params_num)>0){let s=(0,g.uf)(r.params[0]),a=(0,g.uf)(r.params[1]),i="".concat(b("orderPlaceBuy1")," ").concat(s," ").concat(b("orderPlaceBuy2")," ").concat(a," ").concat(b("orderPlaceBuy3"));(0,B.A)({type:"error",msg:i})}}else if("26"===r.code){if(parseFloat(r.params_num)>0){let l=(0,g.uf)(r.params[0]),c=(0,g.uf)(r.params[1]),d="".concat(b("orderPlaceSell1")," ").concat(l," ").concat(b("orderPlaceBuy2")," ").concat(c," ").concat(b("orderPlaceBuy3"));(0,B.A)({type:"error",msg:d})}}else if("150004"===r.code)V(!0),$("toKyc"),Q(""),G(b("noCertification")),Y(b("goCertification"));else if("150005"===r.code){let u=b("countryLimit",{coinName:n});(0,B.A)({type:"error",msg:u})}else if("150007"===r.code){let m=b("minimumAmount",{amount:r.msg});(0,B.A)({type:"error",msg:m})}else if("401"===r.code){let _=r.msg&&r.msg.toUpperCase()||"-",p=b("limitTip",{total:_.replace(n.toUpperCase(),C)});(0,B.A)({type:"error",msg:p})}else(0,B.A)({type:"error",msg:b("orderFail")})})}function eN(e){if(1==f){(0,B.A)({type:"error",msg:b("countDown.tradingCurrentlyUnavailable")});return}if("Buy"===e){if(""===ea.current.value||0>=parseFloat(ea.current.value))return(0,B.A)({type:"error",msg:b("buyPrice")}),!1;if(""===ei.current.value||0>=parseFloat(ei.current.value))return(0,B.A)({type:"error",msg:b("numNotEmpty")}),!1}if("Sell"===e){if(""===el.current.value||0>=parseFloat(el.current.value))return(0,B.A)({type:"error",msg:b("buyPrice")}),!1;if(""===ec.current.value||0>=parseFloat(ec.current.value))return(0,B.A)({type:"error",msg:b("numNotEmpty")}),!1}if("Buy"===e){let t=()=>{let e=parseFloat(ea.current.value),t=new eS.Z(p||0).times(1.3).toNumber(),n=new eS.Z(p||0).times(1.05).toNumber();e>n&&e<=t?(V(!0),$("BUY"),Q(b("priceTipBuy",{percent:"5%"})),G(b("cancel")),Y(b("sure"))):eC(ea.current.value,ei.current.value,"BUY")};(0,a.Fe)({coin:i}).then(e=>{e&&!0===e.data?t():(eo(()=>t),er(!1),et(!0))}).catch(()=>{t()});return}if("Sell"===e){let n=()=>{let e=parseFloat(el.current.value),t=new eS.Z(p||0).times(.95).toNumber(),n=new eS.Z(p||0).times(.7).toNumber();e>=n&&e<t?(V(!0),$("SELL"),Q(b("priceTipSell",{percent:"5%"})),G(b("cancel")),Y(b("sure"))):eC(el.current.value,ec.current.value,"SELL")};(0,a.Fe)({coin:i}).then(e=>{e&&!0===e.data?n():(eo(()=>n),er(!1),et(!0))}).catch(()=>{n()});return}}let ek=l.baseCoinBalance||0,ew=l.countCoinBalance||0,eF=e=>{let t=l.countCoinBalance||0,n=o.scale&&o.scale.price||0,r=o.scale&&o.scale.volume||0;if(parseFloat(ea.current.value)>0){let s=new eS.Z(t).div(ea.current.value).dp(r,eS.Z.ROUND_DOWN).toNumber()||0,a=new eS.Z(s).div(100).times(e).dp(r,eS.Z.ROUND_DOWN).toNumber()||0,i=new eS.Z(ea.current.value).times(a).dp(n,eS.Z.ROUND_DOWN).toNumber();ei.current.value=(0,g.Hf)(a);let c=(0,g.Hf)(i);A(c)}F(e)};function eP(e){let t=l.baseCoinBalance||0,n=o.scale&&o.scale.price||0,r=o.scale&&o.scale.volume||0,s=new eS.Z(t).div(100).times(e).dp(r,eS.Z.ROUND_DOWN).toString()||0,a=new eS.Z(el.current.value||0).times(s).dp(n,eS.Z.ROUND_DOWN).toString();ec.current.value=(0,g.Hf)(s);let i=(0,g.Hf)(a);E(i),L(e)}function eA(e,t){let n,r;let s="buy"===e;switch(t){case"Counterparty 1":default:n=s?"2":"1",r=1;break;case"Counterparty 5":n=s?"2":"1",r=5;break;case"Queue 1":n=s?"1":"2",r=1;break;case"Queue 5":n=s?"1":"2",r=5}return{pegType:n,pegOffset:r}}function eI(e,t){var n,r,s,o,a,i,l,c,d,u;let m;let _=j.depthData,h=(null==_?void 0:_.a)||[],v=(null==_?void 0:_.b)||[],f=p||"",b="buy"===e;switch(t){case"Counterparty 1":m=b?null===(n=h[0])||void 0===n?void 0:n[0]:null===(r=v[0])||void 0===r?void 0:r[0];break;case"Counterparty 5":m=b?null===(s=h[4])||void 0===s?void 0:s[0]:null===(o=v[4])||void 0===o?void 0:o[0];break;case"Queue 1":m=b?null===(a=v[0])||void 0===a?void 0:a[0]:null===(i=h[0])||void 0===i?void 0:i[0];break;case"Queue 5":m=b?null===(l=v[4])||void 0===l?void 0:l[0]:null===(c=h[4])||void 0===c?void 0:c[0];break;default:m=b?null===(d=h[0])||void 0===d?void 0:d[0]:null===(u=v[0])||void 0===u?void 0:u[0]}return console.log("price--->",m," / ",f),m||f}function eL(){D?(R(!1),ea.current.value=p||"",ei.current.value="",F(0),A(0)):(ea.current.value=eI("buy",Z),R(!0),ei.current.value="",F(0),A(0))}function eU(){O?(T(!1),el.current.value=p||"",ec.current.value="",L(0),E(0)):(el.current.value=eI("sell",W),T(!0),ec.current.value="",L(0),E(0))}function eZ(){et(!1),er(!1),eo(null)}function eW(){if(!en)return;let e=es;(0,a.JV)({coin:i}).finally(()=>{eZ(),e&&e()})}return(0,r.jsxs)("div",{className:eM().component,children:[(0,r.jsxs)("div",{style:{display:v?"buy"==v?"block":"none":"block"},className:eM()["orderform-box"],children:[(0,r.jsxs)("div",{className:eM()["orderform-title"],children:[(0,r.jsxs)("div",{className:eM().rose,children:[b("buy")," ",N]}),(0,r.jsxs)("div",{className:eM().amount,children:[(0,r.jsxs)("span",{children:[C," ",b("available")]})," ",d?(0,g.uf)(ew):"--"]})]}),(0,r.jsxs)("div",{className:eM()["price-input-wrapper"],children:[D&&(0,r.jsx)("div",{className:eM()["bbo-select-container"],children:(0,r.jsx)(eO.Z,{options:[{label:b("bboCounterparty1"),value:"Counterparty 1"},{label:b("bboCounterparty5"),value:"Counterparty 5"},{label:b("bboQueue1"),value:"Queue 1"},{label:b("bboQueue5"),value:"Queue 5"}],defaultValue:["Counterparty 1","Counterparty 5","Queue 1","Queue 5"].indexOf(Z),styleP:{selList:eM()["bbo-select-panel"],opt:eM()["bbo-trigger"]},onSelect(e){M(e.value),ea.current.value=eI("buy",e.value)},renderListOption:e=>(0,r.jsxs)("div",{className:eM()["bbo-option"],children:[(0,r.jsx)("span",{className:e.value===Z?eM()["bbo-option-active"]:"",children:e.label}
1),e.value===Z&&(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0893 4.41073C18.4148 4.73617 18.4148 5.26381 18.0893 5.58925L8.67859 15C8.02772 15.6509 6.97244 15.6509 6.32157 15L1.91083 10.5892C1.58539 10.2638 1.58539 9.73617 1.91083 9.41073C2.23626 9.0853 2.7639 9.0853 3.08934 9.41073L7.50008 13.8215L16.9108 4.41073C17.2363 4.0853 17.7639 4.0853 18.0893 4.41073Z",fill:"#0A5AF8"})})]})})}),(0,r.jsxs)("div",{className:eM()["orderform-input"],style:{display:D?"none":""},children:[(0,r.jsx)("div",{className:eM()["orderform-input-name"],children:b("price")}),(0,r.jsxs)("div",{className:eM()["orderform-input-value"],children:[(0,r.jsx)("input",{type:"text",placeholder:b("buyPrice"),disabled:!d,ref:ea,onChange:e=>eh(e),onFocus:e=>ey("buy",e),onBlur:()=>ej()}),"IDR"!==C&&"buy"===k&&(0,r.jsxs)("div",{className:eM().convert,children:["≈ Rp",(0,g.uf)(eg)]})]}),(0,r.jsx)("div",{className:eM()["orderform-input-coin"],children:(null==o?void 0:o.quoteAlias)||C})]}),(0,r.jsxs)("div",{className:eM()["bbo-btn-wrapper"],children:[(0,r.jsx)("button",{type:"button",className:c()(eM()["bbo-btn"],{[eM()["bbo-btn-active"]]:D}),onClick:eL,children:b("bboBtn")}),(0,r.jsx)("div",{className:eM()["bbo-tooltip"],children:b("bboHint")})]})]}),(0,r.jsxs)("div",{className:eM()["orderform-input"],children:[(0,r.jsx)("div",{className:eM()["orderform-input-name"],children:b("num")}),(0,r.jsx)("div",{className:eM()["orderform-input-value"],children:(0,r.jsx)("input",{type:"text",disabled:!d,ref:ei,onChange:e=>ev(e)})}),(0,r.jsx)("div",{className:eM()["orderform-input-coin"],children:N})]}),(0,r.jsxs)("div",{className:c()([eM()["orderform-progress"],eM().buy]),children:[(0,r.jsx)("div",{className:eM()["progress-bar"],children:(0,r.jsx)(eD.Z,{min:0,max:100,marks:{0:" ",25:" ",50:" ",75:" ",100:" "},defaultValue:0,railStyle:{backgroundColor:"#b0b9c3"},trackStyle:{backgroundColor:"#0abe82"},dotStyle:{borderColor:"#b0b9c3"},activeDotStyle:{borderColor:"#0abe82",backgroundColor:"#0abe82"},handleStyle:{borderColor:"#0abe82",boxShadow:"none"},step:1,value:d&&parseFloat(ew)>0?S:0,onChange:e=>eF(e)})}),(0,r.jsxs)("div",{className:c()([eM()["progress-number"]]),children:[d&&parseFloat(ew)>0?S:0,"%"]})]}),(0,r.jsxs)("div",{className:eM()["orderform-price"],children:[(0,r.jsx)("span",{children:b("dealMoney")}),d?(0,g.uf)(P):"--"," ",C]}),d?(0,r.jsxs)("div",{className:c()([eM()["orderform-footer"],eM()["orderform-btn"],eM().buy]),onClick:()=>eN("Buy"),children:[b("buy")," ",N]}):(0,r.jsxs)("div",{className:c()(eM()["orderform-footer"],eM()["orderform-login"]),children:[(0,r.jsx)(h(),{href:"/login?callBackPath=/trade",children:b("login")})," ",b("or")," ",(0,r.jsx)(h(),{href:"/register",children:b("signUp")})]})]}),(0,r.jsxs)("div",{className:eM()["orderform-box"],style:{display:v?"sell"==v?"block":"none":"block"},children:[(0,r.jsxs)("div",{className:eM()["orderform-title"],children:[(0,r.jsxs)("div",{className:eM().fall,children:[b("sell")," ",N]}),(0,r.jsxs)("div",{className:eM().amount,children:[(0,r.jsxs)("span",{children:[N," ",b("available")]})," ",d?(0,g.uf)(ek):"--"]})]}),(0,r.jsxs)("div",{className:eM()["price-input-wrapper"],children:[O&&(0,r.jsx)("div",{className:eM()["bbo-select-container"],children:(0,r.jsx)(eO.Z,{options:[{label:b("bboCounterparty1"),value:"Counterparty 1"},{label:b("bboCounterparty5"),value:"Counterparty 5"},{label:b("bboQueue1"),value:"Queue 1"},{label:b("bboQueue5"),value:"Queue 5"}],defaultValue:["Counterparty 1","Counterparty 5","Queue 1","Queue 5"].indexOf(W),styleP:{selList:eM()["bbo-select-panel"],opt:eM()["bbo-trigger"]},onSelect(e){q(e.value),el.current.value=eI("sell",e.value)},renderListOption:e=>(0,r.jsxs)("div",{className:eM()["bbo-option"],children:[(0,r.jsx)("span",{className:e.value===W?eM()["bbo-option-active"]:"",children:e.label}),e.value===W&&(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0893 4.41073C18.4148 4.73617 18.4148 5.26381 18.0893 5.58925L8.67859 15C8.02772 15.6509 6.97244 15.6509 6.32157 15L1.9
11083 10.5892C1.58539 10.2638 1.58539 9.73617 1.91083 9.41073C2.23626 9.0853 2.7639 9.0853 3.08934 9.41073L7.50008 13.8215L16.9108 4.41073C17.2363 4.0853 17.7639 4.0853 18.0893 4.41073Z",fill:"#0A5AF8"})})]})})}),(0,r.jsxs)("div",{className:eM()["orderform-input"],style:{display:O?"none":""},children:[(0,r.jsx)("div",{className:eM()["orderform-input-name"],children:b("price")}),(0,r.jsxs)("div",{className:eM()["orderform-input-value"],children:[(0,r.jsx)("input",{type:"text",placeholder:b("sellPrice"),disabled:!d,ref:el,onChange:e=>ef(e),onFocus:e=>ey("sell",e),onBlur:()=>ej()}),"IDR"!==C&&"sell"===k&&(0,r.jsxs)("div",{className:eM().convert,children:["≈ Rp",(0,g.uf)(eg)]})]}),(0,r.jsx)("div",{className:eM()["orderform-input-coin"],children:C})]}),(0,r.jsxs)("div",{className:eM()["bbo-btn-wrapper"],children:[(0,r.jsx)("button",{type:"button",className:c()(eM()["bbo-btn"],{[eM()["bbo-btn-active"]]:O}),onClick:eU,children:b("bboBtn")}),(0,r.jsx)("div",{className:eM()["bbo-tooltip"],children:b("bboHint")})]})]}),(0,r.jsxs)("div",{className:eM()["orderform-input"],children:[(0,r.jsx)("div",{className:eM()["orderform-input-name"],children:b("num")}),(0,r.jsx)("div",{className:eM()["orderform-input-value"],children:(0,r.jsx)("input",{type:"text",disabled:!d,ref:ec,onChange:e=>eb(e)})}),(0,r.jsx)("div",{className:eM()["orderform-input-coin"],children:N})]}),(0,r.jsxs)("div",{className:c()([eM()["orderform-progress"],eM().sell]),children:[(0,r.jsx)("div",{className:eM()["progress-bar"],children:(0,r.jsx)(eD.Z,{min:0,max:100,marks:{0:" ",25:" ",50:" ",75:" ",100:" "},defaultValue:0,railStyle:{backgroundColor:"#b0b9c3"},trackStyle:{backgroundColor:"#F54B55"},dotStyle:{borderColor:"#b0b9c3"},activeDotStyle:{borderColor:"#F54B55",backgroundColor:"#F54B55"},handleStyle:{borderColor:"#F54B55",boxShadow:"none"},step:1,value:d&&parseFloat(ek)>0?I:0,onChange:e=>eP(e)})}),(0,r.jsxs)("div",{className:c()([eM()["progress-number"]]),children:[d&&parseFloat(ek)>0?I:0,"%"]})]}),(0,r.jsxs)("div",{className:eM()["orderform-price"],children:[(0,r.jsx)("span",{children:b("dealMoney")}),d?(0,g.uf)(U):"--"," ",C]}),d?(0,r.jsxs)("div",{className:c()([eM()["orderform-footer"],eM()["orderform-btn"],eM().sell]),onClick:()=>eN("Sell"),children:[b("sell")," ",N]}):(0,r.jsxs)("div",{className:c()([eM()["orderform-footer"],eM()["orderform-login"]]),children:[(0,r.jsx)(h(),{href:"/login?callBackPath=/trade",children:b("login")})," ",b("or")," ",(0,r.jsx)(h(),{onClick(){(0,eT.Z)("register_action",{trigger:"trade"})},href:"/register",children:b("signUp")})]})]}),(0,r.jsx)(eR.Z,{visible:z&&"toKyc"!==X,title:b("popWarnTitle"),content:H,onCancel:()=>em(),cancelText:K,onOk:()=>e_(),okText:J}),z&&"toKyc"===X&&(0,r.jsx)(eB.Z,{cancelCb:()=>em()}),(0,r.jsx)(eR.Z,{visible:ee,title:b("tradeConfirmTitle"),close:!0,closeFn:eZ,headerClass:eM()["trade-confirm-header"],footerClass:eM()["trade-confirm-footer"],onOk:eW,okText:b("tradeConfirmBtn"),okButtonProps:{disabled:!en,className:eM()["trade-confirm-ok-btn"]},children:(0,r.jsxs)("div",{className:eM()["modal-main"],children:[(0,r.jsx)("p",{children:b("tradeConfirmDesc")}),(0,r.jsxs)("div",{className:eM().tips,onClick:()=>er(!en),children:[(0,r.jsx)("i",{className:en?"iconfont icon-selected":"iconfont icon-unselected"}),b("tradeConfirmCheckbox")]})]})})]})};function eq(e){let t=!0,{baseCoin:n,symbolInfo:o,quoteCoin:i,balance:l,token:d,mdTabType:m,isCd:_}=e,{tradeStore:p}=(0,x.oR)(),{t:v,lang:f}=(0,u.Z)("trade"),b=(0,s.useRef)(null),y=(0,s.useRef)(null),[j,C]=(0,s.useState)(!1),[N,k]=(0,s.useState)(!1),[w,S]=(0,s.useState)(!1),[F,P]=(0,s.useState)(null),[A,I]=(0,s.use
1State)(0),[L,U]=(0,s.useState)(0),[E,D]=(0,s.useState)(0),[R,O]=(0,s.useState)(0),[T,Z]=(0,s.useState)(!1),[M,W]=(0,s.useState)(""),[q,z]=(0,s.useState)(""),[V,H]=(0,s.useState)(""),[Q,J]=(0,s.useState)(""),Y=(null==o?void 0:o.quoteAlias)||n.toLocaleUpperCase(),K=(null==o?void 0:o.coinAlias)||i.toLocaleUpperCase(),G=l.baseCoinBalance||0,X=l.countCoinBalance||0,[$,ee]=(0,s.useState)("");function et(e,t){let n=o.scale&&o.scale.volume||0,r=l.baseCoinBalance||0,s=l.countCoinBalance||0,a=parseFloat(e.target.value);a<0||a+""=="NaN"?e.target.value="":e.target.value.length>14&&(e.target.value=e.target.value.slice(0,14));let i=e.target.value.split(".")[0],c=e.target.value.split(".")[1];c&&(n>0&&c.length>n&&(e.target.value="".concat(i,".").concat(c.slice(0,n))),0==n&&(e.target.value=e.target.value.split(".")[0]));let d=0;if("buy"===t&&e.target.value){let u=o.price||p.latestPrice||0,m=new eS.Z(s).div(u).dp(n,eS.Z.ROUND_DOWN).toNumber()||0;m>0?(parseFloat(e.target.value)>m&&(e.target.value=m),d=new eS.Z(e.target.value).div(m).times(100).integerValue().toNumber()):(e.target.value=0,d=0)}"sell"===t&&e.target.value&&(parseFloat(r)>0?(parseFloat(e.target.value)>parseFloat(r)&&(e.target.value=r),d=new eS.Z(e.target.value).div(r).times(100).integerValue().toNumber()):(e.target.value=0,d=0)),"sell"===t?D(d>100?100:d):I(d>100?100:d)}function en(e){if(ee(e),1==_){(0,B.A)({type:"error",msg:v("countDown.tradingCurrentlyUnavailable")});return}if("Buy"===e&&(!parseFloat(b.current.value)||0>=parseFloat(b.current.value))||"Sell"===e&&(!parseFloat(y.current.value)||0>=parseFloat(y.current.value)))return(0,B.A)({type:"error",msg:v("numNotEmpty")}),!1;if("Sell"===e){let t=()=>{let e=localStorage.getItem("TRADE_MARKET_ORDER_TIPS")||"";e?er(y.current.value,"SELL"):(Z(!0),J("riskTips"),W(""),H(v("cancel")),z(v("sure")))};(0,a.Fe)({coin:i}).then(e=>{e&&!0===e.data?t():(P(()=>t),S(!1),k(!0))}).catch(()=>{t()});return}let n=()=>{let e=localStorage.getItem("TRADE_MARKET_ORDER_TIPS")||"";e?er(b.current.value,"BUY"):(Z(!0),J("riskTips"),W(""),H(v("cancel")),z(v("sure")))};(0,a.Fe)({coin:i}).then(e=>{e&&!0===e.data?n():(P(()=>n),S(!1),k(!0))}).catch(()=>{n()})}function er(e,t){if(o.price)es(e,t);else{let r="".concat(i).concat(n).toLocaleLowerCase();(0,a.NP)({symbol:r}).then(n=>{let r=(n.data||{}).ticker.c;es(e,t,r)}).catch(e=>{console.log(e)})}}function es(r,s,l){let c="".concat(i).concat(n).toLocaleLowerCase(),d={symbol:c,type:2,price:o.price||l,volume:r,side:s};if(!t)return!1;t=!1,"BUY"===s&&(0,eT.Z)("spot_sub_buy_action",{bb_trademode:"market",buy_price:l,buy_number:r,tradepair_name:c,trans_amount:l*r}),"SELL"===s&&(0,eT.Z)("spot_sub_sell_action",{bb_trademode:"market",sell_price:l,sell_number:r,tradepair_name:c,trans_amount:l*r}),(0,a.NO)(d).then(r=>{if(t=!0,"200"===r.code)(0,B.A)({type:"success",msg:v("delegateSuccess")}),e.mdMenuClose&&e.mdMenuClose(),e.onOkCb(),"BUY"===s&&(b.current.value="",I(0),U(0)),"SELL"===s&&(y.current.value="",D(0),O(0));else if("3"===r.code||"403"===r.code||"100006"===r.code)location.href="/login?callBackPath=/trade";else if("5"===r.code)(0,B.A)({type:"error",msg:v("orderFail")});else if("9"===r.code)(0,B.A)({type:"error",msg:v("userAccountFrozen")});else if("25"===r.code){if(parseFloat(r.params_num)>0){let o=(0,g.uf)(r.params[0]),a=(0,g.uf)(r.params[1]),i="".concat(v("orderPlaceBuy1")," ").concat(o," ").concat(v("orderPlaceBuy2")," ").concat(a," ").concat(v("orderPlaceBuy3"));(0,B.A)({type:"error",msg:i})}}else if("26"===r.code){if(parseFloat(r.params_num)>0){let l=(0,g.uf)(r.params[0]),c=(0,g.uf)(r.params[1]),d="".concat(v("orderPlaceSell1")," ").concat(l," ").concat(v("orderPlaceBuy2")," ").concat(c," ").concat(v("orderPlaceBuy3"));(0,B.A)({type:"error",msg:d})}}else if("150004"===r.code)Z(!0),J("toKyc"),W(""),H(v("noCertification")),z(v("goCertification"));else if("150005"===r.code){let u=v("countryLimit",{coinName:n});(0,B.A)({type:"error",msg:u})}else if("150007"===r.code){let m=v("minimumAmount",{amount:r.msg});(0,B.A)({type:"error",msg:m})}else if("401"===r.code){let _=r.msg&&r.msg.toUpperCase()||"-",p=v("limitTip",{total:_.replace(n.toUpperCase(),Y)});(0,B.A)({type:"error",msg:p})}else(0,B.A)({type:"error",msg:v("orderFail")})})}function eo(){Z(!1),J(""),W(""),H(""),z("")}function ea(){"riskTips"===Q&&(j&&localStorage.setItem("TRADE_MARKET_ORDER_TIPS","know"),"Buy"===$&&er(b.current.value,"BUY"),"Sell"===$&&er(y.current.value,"SELL")),eo()}function ei(){k(!1),S(!1),P(null)}function el(){if(!w)return;let e=F;(0,a.JV)({coin:i}).finally(()=>{ei(),e&&e()})}function ec(){C(!j)}function ed(e){et(e,"buy")}
1function eu(e){et(e,"sell")}(0,s.useEffect)(()=>{b.current.value="",y.current.value="",I(0),U(0),D(0),O(0)},[i]);let em=e=>{let t=l.countCoinBalance||0,n=o.scale&&o.scale.volume||0,r=o.price||p.latestPrice||0;if(parseFloat(r)>0){let s=new eS.Z(t).div(r).dp(n,eS.Z.ROUND_DOWN).toNumber()||0,a=new eS.Z(s).div(100).times(e).dp(n,eS.Z.ROUND_DOWN).toNumber()||0;b.current.value=a}I(e)};function e_(e){let t=l.baseCoinBalance||0,n=o.scale&&o.scale.volume||0,r=new eS.Z(t).div(100).times(e).dp(n,eS.Z.ROUND_DOWN).toNumber()||0;y.current.value=r,D(e)}return(0,r.jsxs)("div",{className:eM().component,children:[(0,r.jsxs)("div",{className:eM()["orderform-box"],style:{display:m?"buy"==m?"block":"none":"block"},children:[(0,r.jsxs)("div",{className:eM()["orderform-title"],children:[(0,r.jsxs)("div",{className:eM().rose,children:[v("buy")," ",K]}),(0,r.jsxs)("div",{className:eM().amount,children:[(0,r.jsxs)("span",{children:[Y," ",v("available")]})," ",d?(0,g.uf)(X):"--"]})]}),(0,r.jsxs)("div",{className:eM()["orderform-input"],children:[(0,r.jsx)("div",{className:eM()["orderform-input-name"],children:v("price")}),(0,r.jsx)("div",{className:eM()["orderform-input-value"],children:(0,r.jsx)("input",{type:"text",placeholder:v("marketPrice"),disabled:!0})}),(0,r.jsx)("div",{className:eM()["orderform-input-coin"],children:Y})]}),(0,r.jsxs)("div",{className:eM()["orderform-input"],children:[(0,r.jsx)("div",{className:eM()["orderform-input-name"],children:v("num")}),(0,r.jsx)("div",{className:eM()["orderform-input-value"],children:(0,r.jsx)("input",{type:"text",disabled:!d,ref:b,onChange:e=>ed(e)})}),(0,r.jsx)("div",{className:eM()["orderform-input-coin"],children:K})]}),(0,r.jsxs)("div",{className:c()([eM()["orderform-progress"],eM().buy]),children:[(0,r.jsx)("div",{className:eM()["progress-bar"],children:(0,r.jsx)(eD.Z,{min:0,max:100,marks:{0:" ",25:" ",50:" ",75:" ",100:" "},defaultValue:0,railStyle:{backgroundColor:"#b0b9c3"},trackStyle:{backgroundColor:"#0abe82"},dotStyle:{borderColor:"#b0b9c3"},activeDotStyle:{borderColor:"#0abe82",backgroundColor:"#0abe82"},handleStyle:{borderColor:"#0abe82",boxShadow:"none"},step:1,value:d&&parseFloat(X)>0?A:0,onChange:e=>em(e)})}),(0,r.jsxs)("div",{className:eM()["progress-number"],children:[d&&parseFloat(X)>0?A:0,"%"]})]}),d?(0,r.jsxs)("div",{className:c()(eM()["orderform-footer"],eM()["orderform-btn"],eM().buy,eM().mt39),onClick:()=>en("Buy"),children:[v("buy")," ",K]}):(0,r.jsxs)("div",{className:c()([eM()["orderform-footer"],eM()["orderform-login"],eM().mt39]),children:[(0,r.jsx)(h(),{href:"/login?callBackPath=/trade",children:v("login")})," ",v("or")," ",(0,r.jsx)(h(),{href:"/register",children:v("signUp")})]})]}),(0,r.jsxs)("div",{className:eM()["orderform-box"],style:{display:m?"sell"==m?"block":"none":"block"},children:[(0,r.jsxs)("div",{className:eM()["orderform-title"],children:[(0,r.jsxs)("div",{className:eM().fall,children:[v("sell")," ",K]}),(0,r.jsxs)("div",{className:eM().amount,children:[(0,r.jsxs)("span",{children:[K," ",v("available")]})," ",d?(0,g.uf)(G):"--"]})]}),(0,r.jsxs)("div",{className:eM()["orderform-input"],children:[(0,r.jsx)("div",{className:eM()["orderform-input-name"],children:v("price")}),(0,r.jsx)("div",{className:eM()["orderform-input-value"],children:(0,r.jsx)("input",{type:"text",placeholder:v("marketPrice"),disabled:!0})}),(0,r.jsx)("div",{className:eM()["orderform-input-coin"],children:Y})]}),(0,r.jsxs)("div",{className:eM()["orderform-input"],children:[(0,r.jsx)("div",{className:eM()["orderform-input-name"],children:v("num")}),(0,r.jsx)("div",{className:eM()["orderform-input-value"],children:(0,r.jsx)("input",{type:"text",disabled:!d,ref:y,onChange:e=>eu(e)})}),(0,r.jsx)("div",{className:eM()["orderform-input-coin"],children:K})]}),(0,r.jsxs)("div",{className:c()([eM()["orderform-progress"],eM().sell]),children:[(0,r.jsx)("div",{className:eM()["progress-bar"],children:(0,r.jsx)(eD.Z,{min:0,max:100,marks:{0:" ",25:" ",50:" ",75:" ",100:" "},defaultValue:0,railStyle:{backgroundColor:"#b0b9c3"},trackStyle:{backgroundColor:"#F54B55"},dotStyle:{borderColor:"#b0b9c3"},activeDotStyle:{borderColor:"#F54B55",backgroundColor:"#F54B55"},handleStyle:{borderColor:"#F54B55",boxShadow:"none"},step:1,value:d&&parseFloat(G)>0?E:0,onChange:e=>e_(e)})}),(0,r.jsxs)("div",{className:eM()["progress-number"],children:[d&&parseFloat(G)>0?E:0,"%"]})]}),d?(0,r.jsxs)("div",{className:c()([eM()["orderform-footer"],eM()["orderform-btn"],eM().sell,eM().mt39]),onClick:()=>en("Sell"),children:[v("sell")," ",K]}):(0,r.jsxs)("div",{className:c()([eM()["orderform-footer"],eM()["orderform-login"],eM().mt39]),children:[(0,r.jsx)(h(),{href:"/login?callBackPath=/trade",children:v("login")})," ",v("or")," ",(0,r.jsx)(h(),{onClick(){(0,eT.Z)("register_action",{trigger:"trade"})},href:"/register",children:v("signUp")})]})]}),(0,r.jsx)(eR.Z,{visible:T&&"toKyc"!==Q,title:v("popWarnTitle"),content:M,onCancel:()=>eo(),cancelText:V,onOk:()=>ea(),okText:q,children:"riskTips"===Q&&(0,r.jsxs)("div",{className:eM()["modal-main"],children:[(0,r.jsxs)("h3",{children:[(0,r.jsx)("i",{className:"iconfont icon-exclamation"}),v("marketPriceTip1"),"\xa0",v("marketPriceTip2")]}),(0,r.jsxs)("p",{className:"tips",onClick:()=>ec(),children:[(0,r.jsx)("i",{className:j?"iconfont icon-select":"iconfont icon-unchecked"}),v("marketPriceTipNotDisplay")]})]})}),T&&"toKyc"===Q&&(0,r.jsx)(eB.Z,{cancelCb:()=>eo()}),(0,r.jsx)(eR.Z,{visible:N,title:v("tradeConfirmTitle"),close:!0,closeFn:ei,headerClass:eM()["trade-confirm-header"],footerClass:eM()["trade-confirm-footer"],onOk:el,okText:v("tradeConfirmBtn"),okButtonProps:{disabled:!w,className:eM()["trade-confirm-ok-btn"]},children:(0,r.jsxs)("div",{className:eM()["modal-main"],children:[(0,r.jsx)("p",{children:v("tradeConfirmDesc")}),(0,r.jsxs)("div",{className:eM().tips,onClick:()=>S(!w),children:[(0,r.jsx)("i",{className:w?"iconfont icon-selected":"iconfont icon-unselected"}),v("tradeConfirmCheckbox")]})]})})]})}function ez(e){let{t,lang:n}=(0,u.Z)("trade"),{tradeStore:o}=(0,x.oR)(),i=!0,{baseCoin:l="",symbolInfo:d,quoteCoin:m="",balance:_,token:p,coinRates:v,strikePrice:f,latestPrice:b,mdTabType:y,isCd:j}=e;(0,s.useEffect)(()=>{p&&(C.current.value=f,w.current.value=f,W||(N.current.value=f),z||(S.current.value=f),k.current.value="",F.current.value="",E(0),R(0),T(0),M(0))},[f]),(0,s.useEffect)(()=>{C.current.value="",w.current.value="",N.current&&(N.current.value=W?eH("buy",H):""),S.current&&(S.current.value=z?eH("sell",J):""),k.current.value="",F.current.value="",E(0),R(0),T(0),M(0)},[m]);let C=(0,s.useRef)(null),N=(0,s.useRef)(null),k=(0,s.useRef)(null),w=(0,s.useRef)(null),S=(0,s.useRef)(null),F=(0,s.useRef)(null),[P,A]=(0,s.use
1State)(""),[I,L]=(0,s.useState)(0),[U,E]=(0,s.useState)(0),[D,R]=(0,s.useState)(0),[O,T]=(0,s.useState)(0),[Z,M]=(0,s.useState)(0),[W,q]=(0,eE.Z)("trade_trigger_bbo_buy_mode",{defaultValue:!1}),[z,V]=(0,eE.Z)("trade_trigger_bbo_sell_mode",{defaultValue:!1}),[H,Q]=(0,eE.Z)("trade_trigger_bbo_buy_value",{defaultValue:"Counterparty 1"}),[J,Y]=(0,eE.Z)("trade_trigger_bbo_sell_value",{defaultValue:"Counterparty 1"}),[K,G]=(0,s.useState)(!1),[X,$]=(0,s.useState)(""),[ee,et]=(0,s.useState)(""),[en,er]=(0,s.useState)(""),[es,eo]=(0,s.useState)(""),[ea,ei]=(0,s.useState)(""),[el,ec]=(0,s.useState)(!1),[ed,eu]=(0,s.useState)(!1),[em,e_]=(0,s.useState)(null),ep=W?eH("buy",H):null,eh=z?eH("sell",J):null;(0,s.useEffect)(()=>{ep&&N.current&&(N.current.value=ep)},[ep]),(0,s.useEffect)(()=>{eh&&S.current&&(S.current.value=eh)},[eh]);let ev=_.baseCoinBalance||0,ef=_.countCoinBalance||0,eb=l.toUpperCase(),eg=m.toUpperCase(),ex=(null==d?void 0:d.quoteAlias)||eb,ey=(null==d?void 0:d.coinAlias)||eg;function ej(){G(!1),$(""),et(""),eo(""),er(""),ei("")}function eC(){"BUY"===ea&&eq(N.current.value,k.current.value,"BUY",C.current.value),"SELL"===ea&&eq(S.current.value,F.current.value,"SELL",w.current.value),ej()}function eN(e){let t=d.scale&&d.scale.price||0,n=parseFloat(e.target.value);n<0||n+""=="NaN"?e.target.value="":e.target.value.length>14&&(e.target.value=e.target.value.slice(0,14));let r=e.target.value.split(".")[0],s=e.target.value.split(".")[1];s&&s.length>t&&(e.target.value="".concat(r,".").concat(s.slice(0,t)));let o=e.target===C.current,a=e.target.value;if(o&&W&&a&&k.current.value){let i=d.scale&&d.scale.price||0,l=d.scale&&d.scale.volume||0,c=k.current.value,u=new eS.Z(ef).div(a).dp(l,eS.Z.ROUND_DOWN).toNumber()||0,m=parseFloat(c)>u?u:c;parseFloat(c)>u&&(k.current.value=u);let _=new eS.Z(m).times(a).dp(i,eS.Z.ROUND_DOWN).toNumber(),p=parseFloat(ef)>0?new eS.Z(m).times(a).div(ef).times(100).integerValue(eS.Z.ROUND_DOWN).toNumber():0;R((0,g.Hf)(_)),E(p>100?100:p)}else if(!o&&z&&a&&F.current.value){let h=d.scale&&d.scale.price||0,f=F.current.value,b=new eS.Z(f).times(a).dp(h,eS.Z.ROUND_DOWN).toNumber(),x=parseFloat(ev)>0?new eS.Z(f).div(ev).times(100).integerValue(eS.Z.ROUND_DOWN).toNumber():0;M((0,g.Hf)(b)),T(x>100?100:x)}let y="{}"!==JSON.stringify(v)&&eb&&v[eb.toUpperCase()].IDR||0;L(parseFloat((e.target.value*y).toFixed(4))||0)}function ek(e){eA(e,k.current.value,"buy","price")}function ew(e){let t=W?C.current.value:N.current.value;eA(e,t,"buy","volume")}function eF(e){eA(e,F.current.value,"sell","price")}function eP(e){let t=z?w.current.value:S.current.value;eA(e,t,"sell","volume")}function eA(e,t,n,r){let s=d.scale&&d.scale.price||0,o=d.scale&&d.scale.volume||0,a="price"===r?s:o,i=_.baseCoinBalance||0,l=_.countCoinBalance||0,c=parseFloat(e.target.value);c<0||c+""=="NaN"?e.target.value="":e.target.value.length>14&&(e.target.value=e.target.value.slice(0,14));let u=e.target.value.split(".")[0],m=e.target.value.split(".")[1];m&&(a>0&&m.length>a&&(e.target.value="".concat(u,".").concat(m.slice(0,a))),0==a&&(e.target.value=e.target.value.split(".")[0]));let p=0,h=0;if("buy"===n&&e.target.value&&t&&("price"===r&&(k.current.value="",p=0,h=0),"volume"===r)){let f=new eS.Z(l).div(t).dp(o,eS.Z.ROUND_DOWN).toNumber()||0;f>0?parseFloat(e.target.value)>f&&(e.target.value=f):e.target.value=0,p=f>0?new eS.Z(e.target.value).times(t).dp(s,eS.Z.ROUND_DOWN).toNumber():0,h=f>0?new eS.Z(e.target.value).times(t).div(l).times(100).integerValue(eS.Z.ROUND_DOWN).toNumber():0}if("sell"===n&&("price"===r&&t&&(p=parseFloat(i)>0?new eS.Z(e.target.value||0).times(t).dp(s,eS.Z.ROUND_DOWN).toNumber():0,h=parseFloat(i)>0?new eS.Z(t).div(i).times(100).integerValue(eS.Z.ROUND_DOWN).toNumber():0),"volume"===r&&(parseFloat(i)>0?parseFloat(e.target.value)>parseFloat(i)&&(e.target.value=i):e.target.value=0,p=parseFloat(i)>0?new eS.Z(e.target.value).times(t||0).dp(s,eS.Z.ROUND_DOWN).toNumber():0,h=parseFloat(i)>0?new eS.Z(e.target.value).div(i).times(100).integerValue(eS.Z.ROUND_DOWN).toNumber():0)),"buy"===n?(R((0,g.Hf)(p)),E(h>100?100:h)):(M((0,g.Hf)(p)),T(h>100?100:h)),"price"===r){let b="{}"!==JSON.stringify(v)&&eb&&v[eb.toUpperCase()].IDR||0;L(parseFloat((e.target.value*b).toFixed(4))||0)}}function eI(e){if(1==j){(0,B.A)({type:"error",msg:t("countDown.tradingCurrentlyUnavailable")});return}if("Buy"===e){if(!parseFloat(C.current.value)||0>=parseFloat(C.current.value))return(0,B.A)({type:"error",msg:t("inputTriggerPrice")}),!1;if(!parseFloat(N.current.value)||0>=parseFloat(N.current.value))return(0,B.A)({type:"error",msg:t("buyPrice")}),!1;if(!parseFloat(k.current.value)||0>=parseFloat(k.current.value))return(0,B.A)({type:"error",msg:t("numNotEmpty")}),!1}if("Sell"===e){if(!parseFloat(w.current.value)||0>=parseFloat(w.current.value))return(0,B.A)({type:"error",msg:t("inputTriggerPrice")}),!1;if(!parseFloat(S.current.value)||0>=parseFloat(S.current.value))return(0,B.A)({type:"error",msg:t("buyPrice")}),!1;if(!parseFloat(F.current.value)||0>=parseFloat(F.current.value))return(0,B.A)({type:"error",msg:t("numNotEmpty")}),!1}if("Buy"===e){let n=()=>{let e=b||0,n=parseFloat(C.current.value)>=parseFloat(e)?t("stopLimitAbove"):t("stopLimitBelow"),r=(0,g.uf)(C.current.value),s=W?ez(H):(0,g.uf)(N.current.value),o=(0,g.uf)(k.current.value),a=ey,i=ex,l=W?"":i,c=t("stopLimitConfirmBuy",{compare:n,trigger:r,price:s,volume:o,symbolA:a,symbolB:i,priceSymbol
1:l});ei("BUY"),G(!0),$(t("stopLimitConfirmTitle")),et(c),eo(t("cancel")),er(t("sure"))};(0,a.Fe)({coin:eg.toLowerCase()}).then(e=>{e&&!0===e.data?n():(e_(()=>n),eu(!1),ec(!0))}).catch(()=>{n()});return}if("Sell"===e){let r=()=>{let e=b||0,n=parseFloat(w.current.value)>=parseFloat(e)?t("stopLimitAbove"):t("stopLimitBelow"),r=(0,g.uf)(w.current.value),s=z?ez(J):(0,g.uf)(S.current.value),o=F.current.value,a=ey,i=ex,l=z?"":i,c=t("stopLimitConfirmSell",{compare:n,trigger:r,price:s,volume:o,symbolA:a,symbolB:i,priceSymbol:l});G(!0),ei("SELL"),$(t("stopLimitConfirmTitle")),et(c),eo(t("cancel")),er(t("sure"))};(0,a.Fe)({coin:eg.toLowerCase()}).then(e=>{e&&!0===e.data?r():(e_(()=>r),eu(!1),ec(!0))}).catch(()=>{r()});return}}function eL(){ec(!1),eu(!1),e_(null)}function eU(){if(!ed)return;let e=em;(0,a.JV)({coin:eg.toLowerCase()}).finally(()=>{eL(),e&&e()})}function eZ(e){let t=_.countCoinBalance||0,n=d.scale&&d.scale.price||0,r=d.scale&&d.scale.volume||0,s=W?C.current.value:N.current.value;if(parseFloat(s)>0){let o=new eS.Z(t).div(s).dp(r,eS.Z.ROUND_DOWN).toNumber()||0,a=new eS.Z(o).div(100).times(e).dp(r,eS.Z.ROUND_DOWN).toNumber()||0,i=new eS.Z(s).times(a).dp(n,eS.Z.ROUND_DOWN).toNumber();k.current.value=a,R((0,g.Hf)(i))}E(e)}function eW(e){let t=_.baseCoinBalance||0,n=d.scale&&d.scale.price||0,r=d.scale&&d.scale.volume||0,s=z?w.current.value||0:S.current.value||0,o=new eS.Z(t).div(100).times(e).dp(r,eS.Z.ROUND_DOWN).toNumber()||0,a=new eS.Z(s).times(o).dp(n,eS.Z.ROUND_DOWN).toNumber();F.current.value=o,M((0,g.Hf)(a)),T(e)}function eq(n,r,s,o){let c="".concat(m).concat(l).toLocaleLowerCase(),d="BUY"===s,u=d?W:z,_=d?H:J,p={symbol:c,type:3,price:n,volume:r,side:s,triggerPrice:o,...u?eV(d?"buy":"sell",_):{}};if(!i)return!1;i=!1,"BUY"===s&&(0,eT.Z)("spot_sub_buy_action",{bb_trademode:"triger",buy_price:n,buy_number:r,tradepair_name:c,trans_amount:n*r,trigger_price:o}),"SELL"===s&&(0,eT.Z)("spot_sub_sell_action",{bb_trademode:"triger",sell_price:n,sell_number:r,tradepair_name:c,trans_amount:n*r,trigger_price:o}),(0,a.NO)(p).then(n=>{if(i=!0,"200"===n.code)(0,B.A)({type:"success",msg:t("delegateSuccess")}),e.mdMenuClose&&e.mdMenuClose(),e.onOkCb(),"BUY"===s&&(k.current.value="",E(0),R(0)),"SELL"===s&&(F.current.value="",T(0),M(0));else if("3"===n.code||"403"===n.code||"100006"===n.code)location.href="/login?callBackPath=/trade";else if("5"===n.code)(0,B.A)({type:"error",msg:t("orderFail")});else if("9"===n.code)(0,B.A)({type:"error",msg:t("userAccountFrozen")});else if("25"===n.code){if(parseFloat(n.params_num)>0){let r=(0,g.uf)(n.params[0]),o=(0,g.uf)(n.params[1]),a="".concat(t("orderPlaceBuy1")," ").concat(r," ").concat(t("orderPlaceBuy2")," ").concat(o," ").concat(t("orderPlaceBuy3"));(0,B.A)({type:"error",msg:a})}}else if("26"===n.code){if(parseFloat(n.params_num)>0){let c=(0,g.uf)(n.params[0]),d=(0,g.uf)(n.params[1]),u="".concat(t("orderPlaceSell1")," ").concat(c," ").concat(t("orderPlaceBuy2")," ").concat(d," ").concat(t("orderPlaceBuy3"));(0,B.A)({type:"error",msg:u})}}else if("150004"===n.code)G(!0),ei("toKyc"),et(""),eo(t("noCertification")),er(t("goCertification"));else if("150005"===n.code){let m=t("countryLimit",{coinName:l});(0,B.A)({type:"error",msg:m})}else if("150007"===n.code){let _=t("minimumAmount",{amount:n.msg});(0,B.A)({type:"error",msg:_})}else if("401"===n.code){let p=n.msg&&n.msg.toUpperCase()||"-",h=t("limitTip",{total:p.replace(eb.toUpperCase(),ex)});(0,B.A)({type:"error",msg:h})}else(0,B.A)({type:"error",msg:t("orderFail")})})}function ez(e){let n={"Counterparty 1":t("bboCounterparty1"),"Counterparty 5":t("bboCounterparty5"),"Queue 1":t("bboQueue1"),"Queue 5":t("bboQueue5")};return n[e]||e}function eV(e,t){let n,r;let s="buy"===e;switch(t){case"Counterparty 1":default:n=s?"2":"1",r=1;break;case"Counterparty 5":n=s?"2":"1",r=5;break;case"Queue 1":n=s?"1":"2",r=1;break;case"Queue 5":n=s?"1":"2",r=5}return{pegType:n,pegOffset:r}}function eH(e,t){var n,r,s,a,i,l,c,d,u,m;let _;let p=o.depthData,h=(null==p?void 0:p.a)||[],v=(null==p?void 0:p.b)||[],f=b||"",g="buy"===e;switch(t){case"Counterparty 1":_=g?null===(n=h[0])||void 0===n?void 0:n[0]:null===(r=v[0])||void 0===r?void 0:r[0];break;case"Counterparty 5":_=g?null===(s=h[4])||void 0===s?void 0:s[0]:null===(a=v[4])||void 0===a?void 0:a[0];break;case"Queue 1":_=g?null===(i=v[0])||void 0===i?void 0:i[0]:null===(l=h[0])||void 0===l?void 0:l[0];break;case"Queue 5":_=g?null===(c=v[4])||void 0===c?void 0:c[0]:null===(d=h[4])||void 0===d?void 0:d[0];break;default:_=g?null===(u=h[0])||void 0===u?void 0:u[0]:null===(m=v[0])||void 0===m?void 0:m[0]}return console.log("price--->",_," / ",f),_||f}function eQ(){W?(q(!1),N.current.value=b||"",k.current.value="",E(0),R(0)):(N.current.value=eH("buy",H),q(!0),k.current.value="",E(0),R(0))}function eJ(){z?(V(!1),S.current.value=b||"",F.current.value="",T(0),M(0)):(S.current.value=eH("sell",J),V(!0),F.current.value="",T(0),M(0))}function eY(e,t){let n="{}"!==JSON.stringify(v)&&eb&&v[eb.toUpperCase()].IDR||0;L(parseFloat((t.target.value*n).toFixed(4))||0),A(e)}function eK(){A(""),L(0)}return(0,r.jsxs)("div",{className:eM().component,children:[(0,r.jsxs)("div",{className:eM()["orderform-box"],style:{display:y?"buy"==y?"block":"none":"block"},children:[(0,r.jsxs)("div",{className:eM()["orderform-title"],children:[(0,r.jsxs)("div",{className:eM().rose,children:[t("buy")," ",(null==d?void 0:d.coinAlias)||eg]}),(0,r.jsxs)("div",{className:eM().amount,children:[(0,r.jsxs)("span",{children:[(null==d?void 0:d.quoteAlias)||eb," ",t("available")]})," ",p?(0,g.uf)(ef):"--"]})]}),(0,r.jsxs)("div",{className:eM()["orderform-input"],children:[(0,r.jsx)("div",{className:eM()["orderform-input-name"],children:t("triggerPrice")}),(0,r.jsxs)("div",{className:eM()["orderform-input-value"],children:[(0,r.jsx)("input",{type:"text",placeholder:t("inputTriggerPrice"),disabled:!p,ref:C,onChange:e=>eN(e),onFocus:e=>eY("triggerBuy",e),onBlur:()=>eK()}),"IDR"!==eb&&"triggerBuy"===P&&(0,r.jsxs)("div",{className:eM().convert,children:["≈ Rp",(0,g.uf)(I)]})]}),(0,r.jsx)("div",{className:eM()["orderform-input-coin"],children:(null==d?void 0:d.quoteAlias)||eb})]}),(0,r.jsxs)("div",{className:eM()["price-input-wrapper"],children:[W&&(0,r.jsx)("div",{className:eM()["bbo-select-container"],children:(0,r.jsx)(eO.Z,{options:[{label:t("bboCounterparty1"),value:"Counterparty 1"},{label:t("bboCounterparty5"),value:"Counterparty 5"},{label:t("bboQueue1"),value:"Queue 1"},{label:t("bboQueue5"),value:"Queue 5"}],defaultValue:["Counterparty 1","Counterparty 5","Queue 1","Queue 5"].indexOf(H),styleP:{selList:eM()["bbo-select-panel"],opt:eM()["bbo-trigger"]},onSelect(e){Q(e.value),N.current.value=eH("buy",e.value)},renderListOption:e=>(0,r.jsxs)("div",{className:eM()["bbo-option"],children:[(0,r.jsx)("span",{className:e.value===H?eM()["bbo-option-active"]:"",children:e.label}),e.value===H&&(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0893 4.41073C18.4148 4.73617 18.4148 5.26381 18.0893 5.58925L8.67859 15C8.02772 15.6509 6.97244 15.6509 6.32157 15L1.9
11083 10.5892C1.58539 10.2638 1.58539 9.73617 1.91083 9.41073C2.23626 9.0853 2.7639 9.0853 3.08934 9.41073L7.50008 13.8215L16.9108 4.41073C17.2363 4.0853 17.7639 4.0853 18.0893 4.41073Z",fill:"#0A5AF8"})})]})})}),(0,r.jsxs)("div",{className:eM()["orderform-input"],style:{display:W?"none":""},children:[(0,r.jsx)("div",{className:eM()["orderform-input-name"],children:t("Limit")}),(0,r.jsxs)("div",{className:eM()["orderform-input-value"],children:[(0,r.jsx)("input",{type:"text",placeholder:t("inputLimitPrice"),disabled:!p,ref:N,onChange:e=>ek(e),onFocus:e=>eY("buy",e),onBlur:()=>eK()}),"IDR"!==eb&&"buy"===P&&(0,r.jsxs)("div",{className:eM().convert,children:["≈ Rp",(0,g.uf)(I)]})]}),(0,r.jsx)("div",{className:eM()["orderform-input-coin"],children:(null==d?void 0:d.quoteAlias)||eb})]}),(0,r.jsxs)("div",{className:eM()["bbo-btn-wrapper"],children:[(0,r.jsx)("button",{type:"button",className:c()(eM()["bbo-btn"],{[eM()["bbo-btn-active"]]:W}),onClick:eQ,children:t("bboBtn")}),(0,r.jsx)("div",{className:eM()["bbo-tooltip"],children:t("bboHint")})]})]}),(0,r.jsxs)("div",{className:eM()["orderform-input"],children:[(0,r.jsx)("div",{className:eM()["orderform-input-name"],children:t("num")}),(0,r.jsx)("div",{className:eM()["orderform-input-value"],children:(0,r.jsx)("input",{type:"text",disabled:!p,ref:k,onChange:e=>ew(e)})}),(0,r.jsx)("div",{className:eM()["orderform-input-coin"],children:(null==d?void 0:d.coinAlias)||eg})]}),(0,r.jsxs)("div",{className:c()(eM()["orderform-progress"],eM().buy),children:[(0,r.jsx)("div",{className:eM()["progress-bar"],children:(0,r.jsx)(eD.Z,{min:0,max:100,marks:{0:" ",25:" ",50:" ",75:" ",100:" "},defaultValue:0,railStyle:{backgroundColor:"#b0b9c3"},trackStyle:{backgroundColor:"#0abe82"},dotStyle:{borderColor:"#b0b9c3"},activeDotStyle:{borderColor:"#0abe82",backgroundColor:"#0abe82"},handleStyle:{borderColor:"#0abe82",boxShadow:"none"},step:1,value:p&&parseFloat(ef)>0?U:0,onChange:e=>eZ(e)})}),(0,r.jsxs)("div",{className:eM()["progress-number"],children:[p&&parseFloat(ef)>0?U:0,"%"]})]}),(0,r.jsxs)("div",{className:eM()["orderform-price"],children:[(0,r.jsx)("span",{children:t("dealMoney")}),p?(0,g.uf)(D):"--"," ",(null==d?void 0:d.quoteAlias)||eb]}),p?(0,r.jsxs)("div",{className:c()(eM()["orderform-footer"],eM()["orderform-btn"],eM().buy),onClick:()=>eI("Buy"),children:[t("buy")," ",(null==d?void 0:d.coinAlias)||eg]}):(0,r.jsxs)("div",{className:c()(eM()["orderform-footer"],eM()["orderform-login"]),children:[(0,r.jsx)(h(),{href:"/login?callBackPath=/trade",children:t("login")})," ",t("or")," ",(0,r.jsx)(h(),{href:"/register",children:t("signUp")})]})]}),(0,r.jsxs)("div",{className:eM()["orderform-box"],style:{display:y?"sell"==y?"block":"none":"block"},children:[(0,r.jsxs)("div",{className:eM()["orderform-title"],children:[(0,r.jsxs)("div",{className:eM().fall,children:[t("sell")," ",(null==d?void 0:d.coinAlias)||eg]}),(0,r.jsxs)("div",{className:eM().amount,children:[(0,r.jsxs)("span",{children:[(null==d?void 0:d.coinAlias)||eg," ",t("available")]})," ",p?(0,g.uf)(ev):"--"]})]}),(0,r.jsxs)("div",{className:eM()["orderform-input"],children:[(0,r.jsx)("div",{className:eM()["orderform-input-name"],children:t("triggerPrice")}),(0,r.jsxs)("div",{className:eM()["orderform-input-value"],children:[(0,r.jsx)("input",{type:"text",placeholder:t("inputTriggerPrice"),disabled:!p,ref:w,onChange:e=>eN(e),onFocus:e=>eY("triggerSell",e),onBlur:()=>eK()}),"IDR"!==eb&&"triggerSell"===P&&(0,r.jsxs)("div",{className:eM().convert,children:["≈ Rp",(0,g.uf)(I)]})]}),(0,r.jsx)("div",{className:eM()["orderform-input-coin"],children:(null==d?void 0:d.quoteAlias)||eb})]}),(0,r.jsxs)("div",{className:eM()["price-input-wrapper"],children:[z&&(0,r.jsx)("div",{className:eM()["bbo-select-container"],children:(0,r.jsx)(eO.Z,{options:[{label:t("bboCounterparty1"),value:"Counterparty 1"},{label:t("bboCounterparty5"),value:"Counterparty 5"},{label:t("bboQueue1"),value:"Queue 1"},{label:t("bboQueue5"),value:"Queue 5"}],defaultValue:["Counterparty 1","Counterparty 5","Queue 1","Queue 5"].indexOf(J),styleP:{selList:eM()["bbo-select-panel"],opt:eM()["bbo-trigger"]},onSelect(e){Y(e.value),S.current.value=eH("sell",e.value)},renderListOption:e=>(0,r.jsxs)("div",{className:eM()["bbo-option"],children:[(0,r.jsx)("span",{className:e.value===J?eM()["bbo-option-active"]:"",children:e.label}),e.value===J&&(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0893 4.41073C18.4148 4.73617 18.4148 5.26381 18.0893 5.58925L8.67859 15C8.02772 15.6509 6.97244 15.6509 6.32157 15L1.9
11083 10.5892C1.58539 10.2638 1.58539 9.73617 1.91083 9.41073C2.23626 9.0853 2.7639 9.0853 3.08934 9.41073L7.50008 13.8215L16.9108 4.41073C17.2363 4.0853 17.7639 4.0853 18.0893 4.41073Z",fill:"#0A5AF8"})})]})})}),(0,r.jsxs)("div",{className:eM()["orderform-input"],style:{display:z?"none":""},children:[(0,r.jsx)("div",{className:eM()["orderform-input-name"],children:t("Limit")}),(0,r.jsxs)("div",{className:eM()["orderform-input-value"],children:[(0,r.jsx)("input",{type:"text",placeholder:t("inputLimitPrice"),disabled:!p,ref:S,onChange:e=>eF(e),onFocus:e=>eY("sell",e),onBlur:()=>eK()}),"IDR"!==eb&&"sell"===P&&(0,r.jsxs)("div",{className:eM().convert,children:["≈ Rp",(0,g.uf)(I)]})]}),(0,r.jsx)("div",{className:eM()["orderform-input-coin"],children:(null==d?void 0:d.quoteAlias)||eb})]}),(0,r.jsxs)("div",{className:eM()["bbo-btn-wrapper"],children:[(0,r.jsx)("button",{type:"button",className:c()(eM()["bbo-btn"],{[eM()["bbo-btn-active"]]:z}),onClick:eJ,children:t("bboBtn")}),(0,r.jsx)("div",{className:eM()["bbo-tooltip"],children:t("bboHint")})]})]}),(0,r.jsxs)("div",{className:eM()["orderform-input"],children:[(0,r.jsx)("div",{className:eM()["orderform-input-name"],children:t("num")}),(0,r.jsx)("div",{className:eM()["orderform-input-value"],children:(0,r.jsx)("input",{type:"text",disabled:!p,ref:F,onChange:e=>eP(e)})}),(0,r.jsx)("div",{className:eM()["orderform-input-coin"],children:(null==d?void 0:d.coinAlias)||eg})]}),(0,r.jsxs)("div",{className:c()([eM()["orderform-progress"],eM().sell]),children:[(0,r.jsx)("div",{className:eM()["progress-bar"],children:(0,r.jsx)(eD.Z,{min:0,max:100,marks:{0:" ",25:" ",50:" ",75:" ",100:" "},defaultValue:0,railStyle:{backgroundColor:"#b0b9c3"},trackStyle:{backgroundColor:"#F54B55"},dotStyle:{borderColor:"#b0b9c3"},activeDotStyle:{borderColor:"#F54B55",backgroundColor:"#F54B55"},handleStyle:{borderColor:"#F54B55",boxShadow:"none"},step:1,value:p&&parseFloat(ev)>0?O:0,onChange:e=>eW(e)})}),(0,r.jsxs)("div",{className:eM()["progress-number"],children:[p&&parseFloat(ev)>0?O:0,"%"]})]}),(0,r.jsxs)("div",{className:eM()["orderform-price"],children:[(0,r.jsx)("span",{children:t("dealMoney")}),p?(0,g.uf)(Z):"--"," ",(null==d?void 0:d.quoteAlias)||eb]}),p?(0,r.jsxs)("div",{className:c()(eM()["orderform-footer"],eM()["orderform-btn"],eM().sell),onClick:()=>eI("Sell"),children:[t("sell")," ",(null==d?void 0:d.coinAlias)||eg]}):(0,r.jsxs)("div",{className:c()(eM()["orderform-footer"],eM()["orderform-login"]),children:[(0,r.jsx)(h(),{href:"/login?callBackPath=/trade",children:t("login")})," ",t("or")," ",(0,r.jsx)(h(),{onClick(){(0,eT.Z)("register_action",{trigger:"trade"})},href:"/register",children:t("signUp")})]})]}),(0,r.jsx)(eR.Z,{visible:K&&"toKyc"!==ea,title:X,content:ee,onCancel:()=>ej(),cancelText:es,onOk:()=>eC(),okText:en}),K&&"toKyc"===ea&&(0,r.jsx)(eB.Z,{cancelCb:()=>ej()}),(0,r.jsx)(eR.Z,{visible:el,title:t("tradeConfirmTitle"),close:!0,closeFn:eL,headerClass:eM()["trade-confirm-header"],footerClass:eM()["trade-confirm-footer"],onOk:eU,okText:t("tradeConfirmBtn"),okButtonProps:{disabled:!ed,className:eM()["trade-confirm-ok-btn"]},children:(0,r.jsxs)("div",{className:eM()["modal-main"],children:[(0,r.jsx)("p",{children:t("tradeConfirmDesc")}),(0,r.jsxs)("div",{className:eM().tips,onClick:()=>eu(!ed),children:[(0,r.jsx)("i",{className:ed?"iconfont icon-selected":"iconfont icon-unselected"}),t("tradeConfirmCheckbox")]})]})})]})}var eV=n(40569),eH=n.n(eV);function eQ(e){let{t,lang:n}=(0,u.Z)("trade"),{baseCoin:o,symbolInfo:i,quoteCoin:l,coinRates:m,mdTabType:_,isCd:p}=e,{tradeStore:h}=(0,x.oR)(),[v,f]=(0,s.useState)("limit"),g="".concat(l).concat(o).toLocaleLowerCase(),[y,j]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=d.Z.get(b.r);j(e)},[]);let C=()=>{(0,a.PQ)({symbol:g}).then(e=>{"3"===e.code?(d.Z.remove(b.r),j("")):"0"===e.code?h.setBalance(e.data||{}):(h.setBalance({}),(0,B.A)({type:"error",msg:e.msg}))})};return(0,s.useEffect)(()=>{b.r&&C()},[l,o]),(0,r.jsx)("div",{className:eH().component,children:(0,r.jsxs)("div",{className:eH()["box-sizing"],children:[(0,r.jsx)("div",{className:c()([eH().title,eH()["title-min"]]),children:(0,r.jsxs)("ul",{className:eH().tabs,children:[(0,r.jsx)("li",{className:c()({[eH().current]:"limit"===v}),onClick:()=>f("limit"),children:t("limitDeal")}),(0,r.jsxs)("li",{className:c()({[eH().current]:"market"===v}),onClick:()=>f("market"),children:[t("marketDeal"),(0,r.jsx)(eU.Z,{cls:eH().tips,content:t("marketDesc")})]}),(0,r.jsxs)("li",{className:c()({[eH().current]:"trigger"===v}),onClick:()=>f("trigger"),children:[t("stopLimitPrice"),(0,r.jsx)(eU.Z,{cls:eH().tips,content:t("stopLimitDesc")})]})]})}
1),(0,r.jsxs)("div",{className:eH()["orderform-content"],children:[(0,r.jsx)("div",{style:{display:"limit"===v?"block":"none"},children:(0,r.jsx)(eW,{token:y,coinRates:m,symbolInfo:i,baseCoin:o,quoteCoin:l,strikePrice:h.strikePrice,latestPrice:h.latestPrice,balance:h.balance,onOkCb:()=>C(),mdTabType:_,mdMenuClose:e.mdMenuClose,isCd:p})}),(0,r.jsx)("div",{style:{display:"market"===v?"block":"none"},children:(0,r.jsx)(eq,{token:y,symbolInfo:i,balance:h.balance,baseCoin:o,quoteCoin:l,onOkCb:()=>C(),mdTabType:_,mdMenuClose:e.mdMenuClose,isCd:p})}),(0,r.jsx)("div",{style:{display:"trigger"===v?"block":"none"},children:(0,r.jsx)(ez,{token:y,coinRates:m,symbolInfo:i,baseCoin:o,quoteCoin:l,strikePrice:h.strikePrice,latestPrice:h.latestPrice,balance:h.balance,onOkCb:()=>C(),mdTabType:_,mdMenuClose:e.mdMenuClose,isCd:p})})]})]})})}var eJ=(0,x.Pi)(eQ),eY=n(31927),eK=n.n(eY);function eG(e){let{t}=(0,u.Z)("trade"),{symbolName:n,otherSymbol:o,token:i}=e,{tradeStore:l}=(0,x.oR)(),[m,_]=(0,s.useState)(!1),[p,h]=(0,s.useState)(0),[v,f]=(0,s.useState)(!1),[y,j]=(0,s.useState)([]),[C,N]=(0,s.useState)(""),[k,w]=(0,s.useState)([]),S=[{text:t("allStatus"),val:[2,4,9]},{text:t("allOrderStatus"),val:[2]},{text:t("someOrderStatus"),val:[4]},{text:t("cancelOrderStatus"),val:[4,9]}],F=()=>{(0,a.oF)().then(e=>{var t;let n=(null===(t=e.data)||void 0===t?void 0:t.orderList)||[];j(n)})},P=()=>{(0,a.PQ)({symbol:n}).then(e=>{"3"===e.code?d.Z.remove(b.r):"0"===e.code?l.setBalance(e.data||{}):(l.setBalance({}),(0,B.A)({type:"error",msg:e.msg}))})};(0,s.useEffect)(()=>{let e;function t(){_(!1)}return f(!0),F(),i&&(e=setInterval(()=>{F(),P()},5e3)),document.addEventListener("click",t,!1),()=>{clearInterval(e),document.removeEventListener("click",t,!1)}},[n]);let A=()=>{_(!m)};function I(e){e.nativeEvent.stopImmediatePropagation()}let L=(e,t,n,s)=>e&&t&&3===s?0===n||1===n||2===n||3===n||4===n?(0,r.jsxs)("span",{children:[(0,r.jsx)("i",{className:eK()["stop-state-green"]}),e,(0,g.uf)(t)]}):(0,r.jsxs)("span",{children:[e,(0,g.uf)(t)]}):(0,r.jsx)("span",{children:"-"}),U=e=>{let t={orderId:e.orderId,symbolName:"".concat(e.baseCoin||"").concat(e.countCoin||"")};if(e.orderId===C)return N(""),!1;(0,a.qV)(t).then(t=>{var n;w((null===(n=t.data)||void 0===n?void 0:n.resultList)||[]),N(e.orderId)})},D=y;if(o&&(D=D.filter(e=>(e.symbol="".concat(e.baseCoin).concat(e.countCoin),-1!==e.symbol.indexOf(n)))),p>0){let R=S[p].val;D=D.filter(e=>2==p?-1!==R.indexOf(e.status)&&parseFloat(e.deal_volume)>0:3==p?-1!==R.indexOf(e.status)&&0==e.deal_volume:-1!==R.indexOf(e.status))}function O(e,n,r){let s="BUY"===e,o=s?"2"==n:"1"==n,a=5===parseInt(r);return o?a?t("bboCounterparty5"):t("bboCounterparty1"):a?t("bboQueue5"):t("bboQueue1")}function T(e){if(3==e.type&&"0"==e.price&&e.pegOffset)return O(e.side,e.pegType,e.pegOffset);if(e.pegType&&e.pegOffset){let n=O(e.side,e.pegType,e.pegOffset);return"-1"===e.price?t("marketPrice"):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:(0,g.uf)(e.price)}),(0,r.jsx)("br",{}),(0,r.jsxs)("span",{children:["(",n,")"]})]})}return"-1"===e.price?t("marketPrice"):(0,g.uf)(e.price)}return(0,r.jsxs)("div",{className:eK().ordersWrap,children:[(0,r.jsxs)(E,{screen:"lg",children:[(0,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:t("delegateTime")}),(0,r.jsx)("td",{children:t("market")}),(0,r.jsx)("td",{children:t("delegateType")}),(0,r.jsx)("td",{children:t("buyAndSell")}),(0,r.jsx)("td",{children:t("delegatePrice")}),(0,r.jsx)("td",{children:t("deletageNum")}),(0,r.jsx)("td",{children:t("orderAverPrice")}),(0,r.jsx)("td",{children:t("historyTradeNum")}),(0,r.jsx)("td",{children:t("dealAmount")}),(0,r.jsxs)("td",{children:[t("triggerCondition"),(0,r.jsx)(eU.Z,{cls:eK().tips,content:t("triggerConditionTips")})]}),(0,r.jsx)("td",{children:i&&v?(0,r.jsxs)("div",{className:eK().dropdown,onClick:e=>I(e),children:[(0,r.jsxs)("div",{className:eK().dropdowntitle,onClick:()=>A(),children:[t("status"),": ",S[p].text,(0,r.jsx)("i",{className:c()(["iconfont icon-triangle-down"])})]}),m&&(0,r.jsx)("div",{className:eK().dropdownlist,children:S.map((e,t)=>(0,r.jsx)("p",{className:c()({[eK().current]:p===t}),onClick(){h(t),_(!1)},children:e.text},t))})]}):t("status")})]})}),(0,r.jsx)("tbody",{style:{display:"".concat(0===D.length?"none":"block")},children:D.length>0&&D.map((e,n)=>{var o,a;let i=(4===e.status||9===e.status)&&0>=parseFloat(e.deal_volume);return(0,r.jsxs)(s.Fragment,{children:[(0,r.jsxs)("tr",{className:c()({[eK().trcontent]:!0,[eK().trcancel]:i}),children:[(0,r.jsx)("td",{children:(0,g.p6)(e.ctimeLocalDate,"yyyy-MM-dd hh:mm:ss")}),(0,r.jsx)("td",{children:(0,r.jsxs)("a",{href:"/trade/".concat(e.baseCoin&&e.countCoin&&e.baseCoin.toUpperCase()+"-"+e.countCoin.toUpperCase()),className:eK().linkStyle,children:[(0,r.jsx)("span",{children:"".concat(null===(o=(null==e?void 0:e.baseCoinAlias)||(null==e?void 0:e.baseCoin))||void 0===o?void 0:o.toUpperCase(),"/").concat(null===(a=(null==e?void 0:e.countCoinAlias)||e.countCoin)||void 0===a?void 0:a.toUpperCase())}),(0,r.jsx)("span",{className:eK().rightIcon,children:(0,r.jsx)("i",{className:"iconfont icon-arrow-right"})})]})}),(0,r.jsxs)("td",{children:[1===e.type&&t("limitPrice"),2===e.type&&t("marketPrice"),3===e.type&&t("stopLimitPrice")]}),(0,r.jsxs)("td",{children:["BUY"===e.side&&(0,r.jsx)("span",{className:"rose",children:t("buy")}),"SELL"===e.side&&(0,r.jsx)("span",{className:"fall",children:t("sell")})]}),(0,r.jsx)("td",{children:T(e)}),(0,r.jsx)("td",{children:(0,g.uf)(e.volume)}),(0,r.jsx)("td",{children:(0,g.uf)(e.avg_price)}),(0,r.jsx)("td",{children:(0,g.uf)(e.deal_volume)}),(0,r.jsx)("td",{children:e.countCoin&&"".concat((0,g.uf)(e.deal_money)," ").concat((e.countCoinAlias||e.countCoin).toUpperCase())}),(0,r.jsx)("td",{children:L(e.stop_condition,e.stop_condition_price,e.status,e.type)}),(0,r.jsxs)("td",{children:[!i&&(0,r.jsxs)("span",{className:eK().deal,onClick:()=>U(e),children:[2===e.status&&t("allOrderStatus"),(4===e.status||9===e.status)&&parseFloat(e.deal_volume)>0&&t("someOrderStatus"),(0,r.jsx)("i",{className:c()({iconfont:!0,"icon-arrow-up":C===e.orderId,"icon-arrow-down":C!==e.orderId})})]}
1),i&&t("cancelOrderStatus")]})]}),C===e.orderId&&(0,r.jsx)("tr",{className:eK().trdetail,children:(0,r.jsx)("td",{children:(0,r.jsxs)("p",{className:eK().detail,children:[(0,r.jsxs)("p",{className:eK().detailtotal,children:[t("orderTotal"),":",e.countCoin&&"".concat((0,g.uf)(e.deal_money)," ").concat((e.countCoinAlias||(null==e?void 0:e.countCoin)).toUpperCase())]}),(0,r.jsxs)("ul",{children:[(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{children:t("dealTime")}),(0,r.jsx)("span",{children:t("dealPrice")}),(0,r.jsx)("span",{children:t("dealNum")}),(0,r.jsx)("span",{children:t("dealAmount")}),(0,r.jsx)("span",{children:t("fees")})]}),k.map((t,n)=>(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{children:(0,g.p6)(t.ctimeLocalDate,"yyyy-MM-dd hh:mm:ss")}),(0,r.jsx)("span",{children:(0,g.uf)(t.price)}),(0,r.jsx)("span",{children:(0,g.uf)(t.volume)}),(0,r.jsx)("span",{children:e.countCoin&&"".concat((0,g.uf)(t.deal_price)," ").concat((e.countCoinAlias||e.countCoin).toUpperCase())}),(0,r.jsx)("span",{children:t.feeCoin&&"".concat((0,g.uf)(t.fee)," ").concat((t.feeCoinAlias||t.feeCoin).toUpperCase())})]},n))]})]})})})]},n)})})]}),v&&0===D.length&&(0,r.jsx)("div",{className:eK().orderempty,children:(0,r.jsxs)("p",{children:[(0,r.jsx)("i",{className:"iconfont icon-empty"})," ",(0,r.jsx)("span",{children:t("noDelegation")})]})})]}),(0,r.jsxs)(E,{screen:"md",children:[(0,r.jsxs)("table",{children:[(0,r.jsxs)("colgroup",{children:[(0,r.jsx)("col",{}),(0,r.jsx)("col",{}),(0,r.jsx)("col",{}),(0,r.jsx)("col",{})]}),(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:t("delegateTime")}),(0,r.jsx)("td",{children:t("market")}),(0,r.jsx)("td",{children:t("delegateType")}),(0,r.jsx)("td",{children:t("buyAndSell")}),(0,r.jsxs)("td",{children:[t("delegatePrice")," / ",t("deletageNum")]}),(0,r.jsxs)("td",{children:[t("orderAverPrice")," / ",t("historyTradeNum")]}),(0,r.jsx)("td",{children:t("dealAmount")}),(0,r.jsxs)("td",{children:[t("triggerCondition"),(0,r.jsx)(eU.Z,{cls:eK().tips,content:t("triggerConditionTips")})]}),(0,r.jsx)("td",{children:i&&v?(0,r.jsxs)("div",{className:eK().dropdown,onClick:e=>I(e),children:[(0,r.jsxs)("div",{onClick:()=>A(),children:[t("status"),":",(0,r.jsxs)("div",{className:eK().md_status_wrap,children:[(0,r.jsx)("div",{children:S[p].text}),(0,r.jsx)("i",{className:c()(["iconfont icon-triangle-down"])})]})]}),m&&(0,r.jsx)("div",{className:eK().dropdownlist,children:S.map((e,t)=>(0,r.jsx)("p",{className:c()({[eK().current]:p===t}),onClick(){h(t),_(!1)},children:e.text},t))})]}):t("status")})]})}),(0,r.jsx)("tbody",{style:{display:"".concat(0===D.length?"none":"block")},children:D.length>0&&D.map((e,n)=>{var o,a;let i=(4===e.status||9===e.status)&&0>=parseFloat(e.deal_volume);return(0,r.jsxs)(s.Fragment,{children:[(0,r.jsxs)("tr",{className:c()({[eK().trcontent]:!0,[eK().trcancel]:i}),children:[(0,r.jsx)("td",{children:(0,g.p6)(e.ctimeLocalDate,"yyyy-MM-dd hh:mm:ss")}),(0,r.jsx)("td",{children:(0,r.jsxs)("a",{href:"/trade/".concat(e.baseCoin&&e.countCoin&&e.baseCoin.toUpperCase()+"-"+e.countCoin.toUpperCase()),className:eK().linkStyle,children:[(0,r.jsx)("span",{children:"".concat(null===(o=(null==e?void 0:e.baseCoinAlias)||(null==e?void 0:e.baseCoin))||void 0===o?void 0:o.toUpperCase(),"/").concat(null===(a=(null==e?void 0:e.countCoinAlias)||e.countCoin)||void 0===a?void 0:a.toUpperCase())}),(0,r.jsx)("span",{className:eK().rightIcon,children:(0,r.jsx)("i",{className:"iconfont icon-arrow-right"})})]})}),(0,r.jsxs)("td",{children:[1===e.type&&t("limitPrice"),2===e.type&&t("marketPrice"),3===e.type&&t("stopLimitPrice")]}),(0,r.jsxs)("td",{children:["BUY"===e.side&&(0,r.jsx)("span",{className:"rose",children:t("buy")}),"SELL"===e.side&&(0,r.jsx)("span",{className:"fall",children:t("sell")})]}),(0,r.jsxs)("td",{children:[(0,r.jsx)("div",{children:T(e)}),(0,r.jsx)("div",{children:(0,g.uf)(e.volume)})]}),(0,r.jsxs)("td",{children:[(0,r.jsx)("div",{children:(0,g.uf)(e.avg_price)}),(0,r.jsx)("div",{children:(0,g.uf)(e.deal_volume)})]}),(0,r.jsx)("td",{children:e.countCoin&&"".concat((0,g.uf)(e.deal_money)," ").concat((e.countCoinAlias||e.countCoin).toUpperCase())}),(0,r.jsx)("td",{children:L(e.stop_condition,e.stop_condition_price,e.status,e.type)}),(0,r.jsxs)("td",{children:[!i&&(0,r.jsxs)("span",{className:eK().deal,onClick:()=>U(e),children:[2===e.status&&t("allOrderStatus"),(4===e.status||9===e.status)&&parseFloat(e.deal_volume)>0&&t("someOrderStatus"),(0,r.jsx)("i",{className:c()({iconfont:!0,"icon-arrow-up":C===e.orderId,"icon-arrow-down":C!==e.orderId})})]}
1),i&&t("cancelOrderStatus")]})]}),C===e.orderId&&(0,r.jsx)("tr",{className:eK().trdetail,children:(0,r.jsx)("td",{children:(0,r.jsxs)("p",{className:eK().detail,children:[(0,r.jsxs)("p",{className:eK().detailtotal,children:[t("orderTotal"),":",e.countCoin&&"".concat((0,g.uf)(e.deal_money)," ").concat((e.countCoinAlias||e.countCoin).toUpperCase())]}),(0,r.jsxs)("ul",{children:[(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{children:t("dealTime")}),(0,r.jsx)("span",{children:t("dealPrice")}),(0,r.jsx)("span",{children:t("dealNum")}),(0,r.jsx)("span",{children:t("dealAmount")}),(0,r.jsx)("span",{children:t("fees")})]}),k.map((t,n)=>(0,r.jsxs)("li",{children:[(0,r.jsx)("span",{children:(0,g.p6)(t.ctimeLocalDate,"yyyy-MM-dd hh:mm:ss")}),(0,r.jsx)("span",{children:(0,g.uf)(t.price)}),(0,r.jsx)("span",{children:(0,g.uf)(t.volume)}),(0,r.jsx)("span",{children:e.countCoin&&"".concat((0,g.uf)(t.deal_price)," ").concat((e.countCoinAlias||e.countCoin).toUpperCase())}),(0,r.jsx)("span",{children:t.feeCoin&&"".concat((0,g.uf)(t.fee)," ").concat((t.feeCoinAlias||t.feeCoin).toUpperCase())})]},n))]})]})})})]},n)})})]}),v&&0===D.length&&(0,r.jsx)("div",{className:eK().orderempty,children:(0,r.jsxs)("p",{children:[(0,r.jsx)("i",{className:"iconfont icon-empty"})," ",(0,r.jsx)("span",{children:t("noDelegation")})]})})]})]})}function eX(e){let{t,lang:n}=(0,u.Z)("trade"),{symbolName:o,otherSymbol:i,token:l}
1=e,[m,_]=(0,s.useState)([]),[p,h]=(0,s.useState)(!1),[v,f]=(0,s.useState)(!1),[b,y]=(0,s.useState)(""),[j,C]=(0,s.useState)(""),[N,k]=(0,s.useState)(""),[w,S]=(0,s.useState)(""),[F,P]=(0,s.useState)(""),[A,I]=(0,s.useState)(""),{tradeStore:L}=(0,x.oR)();function U(){(0,a.c2)().then(e=>{if("0"===e.code){let t=e.data.orderList||[];t.map(e=>(e.symbol="".concat(e.baseCoin).concat(e.countCoin),e)),_(t)}}).catch(e=>{console.log(e)})}let D=(e,t,n,s)=>e&&t&&3===s?0===n||1===n||2===n||3===n||4===n?(0,r.jsxs)("span",{children:[(0,r.jsx)("i",{className:eK()["stop-state-green"]}),e,(0,g.uf)(t)]}):(0,r.jsxs)("span",{children:[e,(0,g.uf)(t)]}):(0,r.jsx)("span",{children:"-"}),R=()=>{(0,a.PQ)({symbol:o}).then(e=>{"3"===e.code?d.Z.remove(l):"0"===e.code?L.setBalance(e.data||{}):(L.setBalance({}),(0,B.A)({type:"error",msg:e.msg}))})},O=e=>{let n=e.orderId,r="".concat(e.baseCoin).concat(e.countCoin);I(n),P(r),S("cancel"),y(t("cancelDelegation")),C(t("sure")),k(t("cancel")),f(!0)},T=()=>{f(!1),k(""),C(""),y(""),S("")},Z=()=>{if("cancel"===w){let e={symbolName:F,orderId:A};(0,a.p_)(e).then(e=>{"200"==e.code?((0,B.A)({type:"success",msg:t("cancelOrderSuccess")}),U(),R()):(0,B.A)({type:"error",msg:t("cancelOrderFail")})})}if("cancelAll"===w){let n={symbol:i?o:""};(0,a.cX)(n).then(e=>{"200"===e.code?((0,B.A)({type:"success",msg:t("cancelAllProcess")}),U(),R()):(0,B.A)({type:"error",msg:t("cancelOrderFail")})})}T()},M=()=>{S("cancelAll"),y(t("cancelAllDelegation")),C(t("sure")),k(t("cancel")),f(!0)};function W(e,n,r){let s="BUY"===e,o=s?"2"==n:"1"==n,a=5===parseInt(r);return o?a?t("bboCounterparty5"):t("bboCounterparty1"):a?t("bboQueue5"):t("bboQueue1")}function q(e){if(3==e.type&&"0"==e.price&&e.pegOffset)return W(e.side,e.pegType,e.pegOffset);if(e.pegType&&e.pegOffset){let n=W(e.side,e.pegType,e.pegOffset);return"-1"===e.price?t("marketPrice"):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:(0,g.uf)(e.price)}),(0,r.jsx)("br",{}),(0,r.jsxs)("span",{children:["(",n,")"]})]})}return"-1"===e.price?t("marketPrice"):(0,g.uf)(e.price)}(0,s.useEffect)(()=>{let e;return U(),h(!0),l&&(e=setInterval(()=>{U(),R()},5e3)),()=>{clearInterval(e)}},[o]);let z=m;return i&&(z=z.filter(e=>-1!==e.symbol.indexOf(o))),(0,r.jsxs)("div",{className:eK().ordersWrap,children:[(0,r.jsxs)(E,{screen:"lg",children:[(0,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:t("deleteTime")}),(0,r.jsx)("td",{children:t("market")}),(0,r.jsx)("td",{children:t("delegateType")}),(0,r.jsx)("td",{children:t("buyAndSell")}),(0,r.jsx)("td",{children:t("delegatePrice")}),(0,r.jsx)("td",{children:t("deletageNum")}),(0,r.jsx)("td",{children:t("tradeNum")}),(0,r.jsx)("td",{children:t("turnoverRate")}),(0,r.jsx)("td",{children:t("telegateAmount")}),(0,r.jsxs)("td",{children:[t("triggerCondition"),(0,r.jsx)(eU.Z,{cls:eK().tips,content:t("triggerConditionTips")})]}),(0,r.jsxs)("td",{children:[l&&m.length>0&&(0,r.jsx)("span",{className:eK().deal,onClick:()=>M(),children:t("cancelAll")}),(!l||0===m.length)&&t("operate")]})]})}),z.length>0&&(0,r.jsx)("tbody",{children:z.map((e,n)=>{var s,o;return(0,r.jsxs)("tr",{className:eK().trcontent,children:[(0,r.jsx)("td",{children:(0,g.p6)(e.ctimeLocalDate,"yyyy-MM-dd hh:mm:ss")}),(0,r.jsx)("td",{children:(0,r.jsxs)("a",{href:"/trade/".concat(e.baseCoin&&e.countCoin&&e.baseCoin.toUpperCase()+"-"+e.countCoin.toUpperCase()),className:eK().linkStyle,children:[(0,r.jsx)("span",{children:"".concat(null===(s=(null==e?void 0:e.baseCoinAlias)||(null==e?void 0:e.baseCoin))||void 0===s?void 0:s.toUpperCase(),"/").concat(null===(o=(null==e?void 0:e.countCoinAlias)||(null==e?void 0:e.countCoin))||void 0===o?void 0:o.toUpperCase())}),(0,r.jsx)("span",{className:eK().rightIcon,children:(0,r.jsx)("i",{className:"iconfont icon-arrow-right"})})]})}),(0,r.jsxs)("td",{children:[1===e.type&&t("limitPrice"),2===e.type&&t("marketPrice"),3===e.type&&t("stopLimitPrice")]}),(0,r.jsxs)("td",{children:["BUY"===e.side&&(0,r.jsx)("span",{className:"rose",children:t("buy")}),"SELL"===e.side&&(0,r.jsx)("span",{className:"fall",children:t("sell")})]}),(0,r.jsx)("td",{children:q(e)}),(0,r.jsx)("td",{children:(0,g.uf)(e.volume)}),(0,r.jsx)("td",{children:(0,g.uf)(e.deal_volume)}),(0,r.jsxs)("td",{children:[new eS.Z(e.deal_volume).div(e.volume).times(100).decimalPlaces(2).toNumber()||0,"%"]}),(0,r.jsx)("td",{children:e.countCoin&&"".concat((0,g.uf)(e.total_price)," ").concat((e.countCoinAlias||e.countCoin).toUpperCase())}),(0,r.jsx)("td",{children:D(e.stop_condition,e.stop_condition_price,e.status,e.type)}),(0,r.jsx)("td",{children:(0,r.jsx)("span",{className:eK().deal,onClick:()=>O(e),children:t("cancel")})})]},n)})})]}),p&&0==z.length&&(0,r.jsx)("div",{className:eK().orderempty,children:(0,r.jsxs)("p",{children:[(0,r.jsx)("i",{className:"iconfont icon-empty"})," ",(0,r.jsx)("span",{children:t("noDelegation")})]})})]}),(0,r.jsxs)(E,{screen:"md",children:[(0,r.jsxs)("table",{children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:t("deleteTime")}),(0,r.jsx)("td",{children:t("market")}),(0,r.jsx)("td",{children:t("delegateType")}),(0,r.jsx)("td",{children:t("buyAndSell")}),(0,r.jsxs)("td",{children:[t("delegatePrice"),"/",t("deletageNum")]}),(0,r.jsxs)("td",{children:[t("tradeNum"),"/",t("turnoverRate")]}),(0,r.jsx)("td",{children:t("telegateAmount")}),(0,r.jsxs)("td",{children:[t("triggerCondition"),(0,r.jsx)(eU.Z,{cls:eK().tips,content:t("triggerConditionTips")})]}),(0,r.jsxs)("td",{children:[l&&m.length>0&&(0,r.jsx)("span",{className:eK().deal,onClick:()=>M(),children:t("cancelAll")}),(!l||0===m.length)&&t("operate")]})]})}),z.length>0&&(0,r.jsx)("tbody",{children:z.map((e,n)=>{var s,o;return(0,r.jsxs)("tr",{className:eK().trcontent,children:[(0,r.jsx)("td",{children:(0,g.p6)(e.ctimeLocalDate,"yyyy-MM-dd hh:mm:ss")}),(0,r.jsx)("td",{children:(0,r.jsxs)("a",{href:"/trade/".concat(e.baseCoin&&e.countCoin&&e.baseCoin.toUpperCase()+"-"+e.countCoin.toUpperCase()),className:eK().linkStyle,children:[(0,r.jsx)("span",{children:"".concat(null===(s=(null==e?void 0:e.baseCoinAlias)||(null==e?void 0:e.baseCoin))||void 0===s?void 0:s.toUpperCase(),"/").concat(null===(o=(null==e?void 0:e.countCoinAlias)||(null==e?void 0:e.countCoin))||void 0===o?void 0:o.toUpperCase())}),(0,r.jsx)("span",{className:eK().rightIcon,children:(0,r.jsx)("i",{className:"iconfont icon-arrow-right"})})]})}),(0,r.jsxs)("td",{children:[1===e.type&&t("limitPrice"),2===e.type&&t("marketPrice"),3===e.type&&t("stopLimitPrice")]}),(0,r.jsxs)("td",{children:["BUY"===e.side&&(0,r.jsx)("span",{className:"rose",children:t("buy")}),"SELL"===e.side&&(0,r.jsx)("span",{className:"fall",children:t("sell")})]}),(0,r.jsxs)("td",{children:[(0,r.jsx)("div",{children:q(e)}),(0,r.jsx)("div",{children:(0,g.uf)(e.volume)})]}),(0,r.jsxs)("td",{children:[(0,r.jsx)("div",{children:(0,g.uf)(e.deal_volume)}),(0,r.jsxs)("div",{children:[new eS.Z(e.deal_volume).div(e.volume).times(100).decimalPlaces(2).toNumber()||0,"%"]})]}),(0,r.jsx)("td",{children:e.countCoin&&"".concat((0,g.uf)(e.total_price)," ").concat((e.countCoinAlias||e.countCoin).toUpperCase())}),(0,r.jsx)("td",{children:D(e.stop_condition,e.stop_condition_price,e.status,e.type)}),(0,r.jsx)("td",{children:(0,r.jsx)("span",{className:eK().deal,onClick:()=>O(e),children:t("cancel")})})]},n)})})]}),p&&0==z.length&&(0,r.jsx)("div",{className:eK().orderempty,children:(0,r.jsxs)("p",{children:[(0,r.jsx)("i",{className:"iconfont icon-empty"})," ",(0,r.jsx)("span",{children:t("noDelegation")})]})})]}),(0,r.jsxs)(E,{screen:"sm",children:[z.length>0&&(0,r.jsxs)("div",{className:eK().ms_header,children:[(0,r.jsx)("div",{}),(0,r.jsx)("div",{onClick:()=>M(),className:eK().ms_cancelAll,children:t("cancelAll")})]}),z.length>0&&z.map((e,n)=>{var s,o;return(0,r.jsxs)("div",{className:eK().ms_content,children:[(0,r.jsxs)("div",{className:eK().ms_content_title,children:[(0,r.jsx)("div",{children:"".concat(null===(s=(null==e?void 0:e.baseCoinAlias)||(null==e?void 0:e.baseCoin))||void 0===s?void 0:s.toUpperCase(),"/").concat(null===(o=(null==e?void 0:e.countCoinAlias)||(null==e?void 0:e.countCoin))||void 0===o?void 0:o.toUpperCase())}),(0,r.jsx)("div",{className:eK().ms_cancel,onClick:()=>O(e),children:t("cancel")})]}),(0,r.jsxs)("div",{className:eK().ms_content_1,children:["BUY"===e.side&&(0,r.jsxs)("span",{className:c()({[eK().rose]:!0,[eK().ms_content_1_span]:!0}),children:[t("buy")," /",1===e.type&&t("limitPrice"),2===e.type&&t("marketPrice"),3===e.type&&t("stopLimitPrice")]}),"SELL"===e.side&&(0,r.jsxs)("span",{className:c()({[eK().fall]:!0,[eK().ms_content_1_span]:!0}),children:[t("sell")," /",1===e.type&&t("limitPrice"),2===e.type&&t("marketPrice"),3===e.type&&t("stopLimitPrice")]}),(0,r.jsx)("span",{className:eK().ms_content_1_time,children:(0,g.p6)(e.ctimeLocalDate,"yyyy-MM-dd hh:mm:ss")})]}),(0,r.jsxs)("div",{className:eK().ms_content_2,children:[(0,r.jsx)("div",{children:t("delegatePrice")}),(0,r.jsx)("div",{children:q(e)})]}),(0,r.jsxs)("div",{className:eK().ms_content_2,children:[(0,r.jsx)("div",{children:t("deletageNum")}),(0,r.jsx)("div",{children:(0,g.uf)(e.volume)})]}),(0,r.jsxs)("div",{className:eK().ms_content_2,children:[(0,r.jsx)("div",{children:t("tradeNum")}),(0,r.jsx)("div",{children:(0,g.uf)(e.deal_volume)})]}),(0,r.jsxs)("div",{className:eK().ms_content_2,children:[(0,r.jsx)("div",{children:t("turnoverRate")}),(0,r.jsxs)("div",{children:[new eS.Z(e.deal_volume).div(e.volume).times(100).decimalPlaces(2).toNumber()||0,"%"]})]}),(0,r.jsxs)("div",{className:eK().ms_content_2,children:[(0,r.jsx)("div",{children:t("telegateAmount")}),(0,r.jsx)("div",{children:e.countCoin&&"".concat((0,g.uf)(e.total_price)," ").concat((e.countCoinAlias||e.countCoin).toUpperCase())})]}),(0,r.jsxs)("div",{className:eK().ms_content_2,children:[(0,r.jsx)("div",{children:t("triggerCondition")}),(0,r.jsx)("div",{children:D(e.stop_condition,e.stop_condition_price,e.status,e.type)})]})]},n)}),p&&0==z.length&&(0,r.jsx)("div",{className:eK().orderempty,children:(0,r.jsxs)("p",{children:[(0,r.jsx)("i",{className:"iconfont icon-empty"})," ",(0,r.jsx)("span",{children:t("noDelegation")})]})})]}),(0,r.jsx)(eR.Z,{visible:v,title:t("popTitle"),content:b,okText:j,cancelText:N,onCancel:()=>T(),onOk:()=>Z()})]})}var e$=n(32844),e0=n.n(e$);function e1(e){let{quoteCoin:t,baseCoin:n}
1=e,o=d.Z.get(b.r)||"",[a,i]=(0,s.useState)(o),[l,m]=(0,s.useState)(!1),{t:_,lang:p}=(0,u.Z)("trade");(0,s.useEffect)(()=>{m(!0)},[]);let v="".concat(t).concat(n).toLocaleLowerCase(),[f,g]=(0,s.useState)("open"),[x,y]=(0,s.useState)(!1),[j,C]=(0,s.useState)(!1),N=e=>{"open"===e?y(!x):C(!j)};return(0,r.jsxs)("div",{className:e0().orderFromWrap,children:[(0,r.jsx)("div",{className:e0().title,children:(0,r.jsxs)("div",{className:e0().title_contant,children:[(0,r.jsx)("div",{onClick:()=>g("open"),className:c()({[e0().current]:"open"===f,[e0().title_item]:!0}),children:_("currentDelegationg")}),(0,r.jsx)("li",{onClick:()=>g("history"),className:c()({[e0().current]:"history"===f,[e0().title_item]:!0,[e0().sm_hostory_tab]:!0}),children:_("orderHistoryTitle")}),"open"===f&&a&&l&&(0,r.jsx)("div",{className:e0().actions,children:(0,r.jsxs)("div",{className:e0().actionssymbol,onClick:()=>N("open"),children:[(0,r.jsx)("i",{className:c()({iconfont:!0,"icon-select":x,"icon-unchecked":!x,[e0().icon]:x})})," ",_("hideOtherCoin")]})}),"history"===f&&a&&l&&(0,r.jsxs)("div",{className:c()({[e0().actions]:!0,[e0().sm_hostory_tab]:!0}),children:[(0,r.jsxs)("div",{className:e0().actionssymbol,onClick:()=>N("history"),children:[(0,r.jsx)("i",{className:c()({iconfont:!0,"icon-select":j,"icon-unchecked":!j,[e0().icon]:j})})," ",_("hideOtherCoin")]}),(0,r.jsx)("div",{className:e0().actionsLink,children:(0,r.jsxs)(h(),{href:"/orders/spot/history",children:[_("orderListMore")," >"]})})]})]})}),(0,r.jsxs)("div",{className:e0().orderlist,children:["open"===f&&(0,r.jsx)(eX,{otherSymbol:x,symbolName:v,token:a}),"history"===f&&(0,r.jsx)(eG,{symbolName:v,token:a,otherSymbol:j})]})]})}var e2=n(81277),e3=n(15241),e5=n(64156),e6=n(78507),e4=n(86465),e8=n(75056),e7=n.n(e8);let e9="bittime_mining_point_update";var te=function(e){let{className:t}=e,{t:n}=(0,u.Z)("points"),{locale:a}=(0,o.useRouter)(),[i,l]=(0,s.useState)(""),[c,m]=(0,s.useState)(null),[_,p]=(0,s.useState)(null);(0,s.useEffect)(()=>{let e=d.Z.get(b.r);l(e);let t=localStorage.getItem(e9)||null;m(+t)},[]),(0,e3.QT)(e6.e9,{onSuccess(e){let{code:t,data:n}=e;t===e5.G&&p(n)},ready:!!i});let h=()=>{m(_.tradingEntryUpdateTime),localStorage.setItem(e9,_.tradingEntryUpdateTime)},v=()=>{window.location.href=e4.Z.genLangPath("/mining-points",a)};return(null==_?void 0:_.tradingEntryOn)&&!(null==_?void 0:_.isBlacklist)?(0,r.jsxs)("div",{className:"".concat(e7().pointWrapper," ").concat(t),children:[(0,r.jsxs)("div",{className:e7().pointEntry,onClick:v,children:[(0,r.jsx)("i",{className:e7().pointIcon}),(0,r.jsx)("span",{children:n("points_entry")})]}),_.tradingEntryUpdateTime!==c&&_.tradingEntryText&&(0,r.jsxs)("div",{className:e7().pointTip,children:[(0,r.jsx)("span",{children:_.tradingEntryText}),(0,r.jsx)("i",{className:e7().close,onClick:h})]})]}):null},tt=n(42688),tn=n.n(tt),tr=function(e){let{theme:t,coinRates:n}=e,{t:i,lang:l}=(0,u.Z)("trade");(0,o.useRouter)();let{symbolInfo:d,quoteCoin:m,baseCoin:_}=e,[p,v,f]=ej()({}),{tradeStore:b}=(0,x.oR)(),[y,C,N]=ej()(),{webSocket:k,socketConnected:w}=(0,s.useContext)(j);(0,s.useEffect)(()=>{if(!w)return;let e=e=>S(e);return k.onMessage(e),()=>{k.offMessage(e)}},[w]);let S=e=>{if(e.tick&&e.channel){let t=e.channel.split("_")[1],r=e.channel.split("_")[2],s=N.current;if(t===s&&"ticker"===r){let o={prevPirce:0,price:0},a=_.toLocaleUpperCase(),i=0;i="{}"!==JSON.stringify(n)&&n[a]&&parseFloat((e.tick.close*n[a].IDR).toFixed(4));let l=e.tick.close||0;o.prevPirce=f.current.price||l,o.price=l,o.value=i||0,o.chg=parseFloat((Math.round(1e4*(e.tick.rose||0))/100).toFixed(2)),o.vol=parseFloat(e.tick.vol||0),o.low=(0,g.oU)(e.tick.low||0,d.scale.price),o.high=(0,g.oU)(e.tick.high||0,d.scale.price),o.amount=e.tick.amount||0,v(o),null==b||b.setLatestPrice(l)}}},[F,P]=ej()({}),A=async()=>{try{let e={coinName:m.toLocaleUpperCase(),language:l},t=await (0,e2.a)(e),n=(null==t?void 0:t.code)==0?null==t?void 0:t.data:{},r=(null==n?void 0:n.etf)?null==n?void 0:n.etfCoinInfo:null==n?void 0:n.commonCoinInfo,s=m;if((null==r?void 0:r.marketTag)==="etf"){let o=m.length,a=m.slice(0,o-2),i=m.slice(o-2);s="".concat(a,"-ETF-").concat(i)}let c="id"===l?"/price/".concat(s.toLocaleUpperCase()):"/".concat(l,"/price/").concat(s.toLocaleUpperCase());r.toPriceUrl=c,P(r)}catch(d){console.log(d)}},I=parseFloat(f.current.prevPirce),L=parseFloat(f.current.price),U=(0,s.useCallback)(()=>{let e="".concat(m).concat(_).toLocaleLowerCase();
1(0,a.NP)({symbol:e}).then(e=>{let{ticker:t={}}=e.data||{},{c:n,r,h:s,l:o,v:a,a:i,o:l}=t,c={amount:i,chg:100*r,high:s,low:o,price:n,vol:a};v(c),null==b||b.setLatestPrice(t.c),null==b||b.setStrikePrice(t.c)}).catch(e=>{console.log(e)})});return(0,s.useEffect)(()=>{U(),C("".concat(m).concat(_).toLocaleLowerCase()),v({}),A()},[m,_]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eu.xu,{display:{sm:"none",md:"block",lg:"block"},children:(0,r.jsxs)("div",{className:tn()["ticker-header-wrap"],children:[(0,r.jsxs)("div",{className:tn()["ticker-header"],children:[(0,r.jsxs)("div",{className:c()([tn().item,tn().showDetail]),children:[(0,r.jsxs)("div",{className:c()([tn().hb,tn().coin]),onClick:()=>null==e?void 0:e.mdIconClick(),children:[(0,r.jsx)("span",{className:tn().coinText,children:(null==d?void 0:d.coinAlias)&&(null==d?void 0:d.quoteAlias)?"".concat(d.coinAlias,"/").concat(d.quoteAlias):d.name}),(0,r.jsx)("span",{className:c()({[tn().ic_arr]:!(null==e?void 0:e.marketListShow),[tn().ic_arr_up]:null==e?void 0:e.marketListShow})})]}),F&&F.coinFullName&&(0,r.jsxs)("div",{className:tn()["coin-detail"],children:[(0,r.jsx)("i",{className:"iconfont icon-shu"}),(0,r.jsx)(h(),{href:F.toPriceUrl,target:"_blank",children:F.coinFullName||""})]})]}),(0,r.jsxs)("div",{className:tn().item,children:[(0,r.jsx)("div",{className:tn().def,children:i("newestPrice")}),(0,r.jsx)("div",{className:c()({[tn().price]:!0,[tn().rose]:L>I,[tn().fall]:L<I,[tn().hb]:L==I}),children:d.scale&&void 0!==d.scale.price&&p.price&&(0,g.uf)(p.price,d.scale.price)||0})]}),(0,r.jsxs)("div",{className:tn().item,children:[(0,r.jsx)("div",{className:tn().def,children:i("dayUpDown")}),(0,r.jsxs)("div",{className:c()({[tn().rose]:Number(p.chg)>0,[tn().fall]:0>Number(p.chg),[tn().hb]:0==Number(p.chg)}),children:[Number(p.chg)>0&&"+",(1*Number(p.chg||0)).toFixed(2)||0,"%"]})]}),(0,r.jsxs)("div",{className:tn().item,children:[(0,r.jsx)("div",{className:tn().def,children:i("dayHigh")}),(0,r.jsx)("div",{className:c()([tn().text,tn().hb]),children:d.scale&&void 0!==d.scale.price&&p.high&&(0,g.uf)(p.high,d.scale.price)||0})]}),(0,r.jsxs)("div",{className:tn().item,children:[(0,r.jsx)("div",{className:tn().def,children:i("dayLow")}),(0,r.jsx)("div",{className:c()([tn().text,tn().hb]),children:d.scale&&void 0!==d.scale.price&&p.low&&(0,g.uf)(p.low,d.scale.price)||0})]}),(0,r.jsxs)("div",{className:tn().item,children:[(0,r.jsxs)("div",{className:tn().def,children:[i("dayDeal"),"(",(null==d?void 0:d.coinAlias)||m.toLocaleUpperCase(),")"]}),(0,r.jsx)("div",{className:c()([tn().text,tn().hb]),children:d.scale&&void 0!==d.scale.volume&&p.vol&&(0,g.uf)(p.vol,d.scale.volume)||0})]}),(0,r.jsxs)("div",{className:tn().item,children:[(0,r.jsxs)("div",{className:tn().def,children:[i("dayVolume"),"(",(null==d?void 0:d.quoteAlias)||_.toLocaleUpperCase(),")"]}),(0,r.jsx)("div",{className:c()([tn().text,tn().hb]),children:d.scale&&void 0!==d.scale.amount&&p.amount&&(0,g.uf)(p.amount,d.scale.amount)||0})]})]}),(0,r.jsx)(te,{className:tn().entry})]})}),(0,r.jsx)(eu.xu,{display:{sm:"block",md:"none",lg:"none"},children:(0,r.jsx)("div",{className:tn()["ticker-header-wrap"],children:(0,r.jsxs)("div",{className:tn()["ticker-header"],children:[(0,r.jsxs)("div",{className:tn().sm_block,children:[(0,r.jsx)("div",{className:c()([tn().item,tn().showDetail]),children:(0,r.jsxs)("div",{className:c()([tn().hb,tn().coin]),onClick:()=>null==e?void 0:e.mdIconClick(),children:[d.name,(0,r.jsx)("span",{className:c()({[tn().ic_arr]:!(null==e?void 0:e.marketListShow),[tn().ic_arr_up]:null==e?void 0:e.marketListShow})})]})}),(0,r.jsx)("div",{className:c()({[tn().price]:!0,[tn().rose]:L>I,[tn().fall]:L<I,[tn().hb]:L==I}),children:d.scale&&void 0!==d.scale.price&&p.price&&(0,g.uf)(p.price,d.scale.price)||0}),(0,r.jsxs)("div",{className:c()({[tn().rose]:Number(p.chg)>0,[tn().fall]:0>Number(p.chg),[tn().hb]:0==Number(p.chg)}),children:[Number(p.chg)>0&&"+",(1*Number(p.chg||0)).toFixed(2)||0,"%"]})]}),(0,r.jsxs)("div",{className:tn().sm_block,children:[(0,r.jsxs)("div",{className:tn().item,children:[(0,r.jsx)("div",{className:tn().def,children:i("dayHigh")}),(0,r.jsx)("div",{className:c()([tn().text,tn().hb]),children:d.scale&&void 0!==d.scale.price&&p.high&&(0,g.uf)(p.high,d.scale.price)||0})]}),(0,r.jsxs)("div",{className:tn().item,children:[(0,r.jsx)("div",{className:tn().def,children:i("dayLow")}),(0,r.jsx)("div",{className:c()([tn().text,tn().hb]),children:d.scale&&void 0!==d.scale.price&&p.low&&(0,g.uf)(p.low,d.scale.price)||0})]})]}),(0,r.jsxs)("div",{className:tn().sm_block,children:[(0,r.jsxs)("div",{className:tn().item,children:[(0,r.jsxs)("div",{className:tn().def,children:[i("dayDeal"),"(",m.toLocaleUpperCase(),")"]}),(0,r.jsx)("div",{className:c()([tn().text,tn().hb]),children:d.scale&&void 0!==d.scale.volume&&p.vol&&(0,g.uf)(p.vol,d.scale.volume)||0})]}),(0,r.jsxs)("div",{className:tn().item,children:[(0,r.jsxs)("div",{className:tn().def,children:[i("dayVolume"),"(",_.toLocaleUpperCase(),")"]}),(0,r.jsx)("div",{className:c()([tn().text,tn().hb]),children:d.scale&&void 0!==d.scale.amount&&p.amount&&(0,g.uf)(p.amount,d.scale.amount)||0})]})]})]})})})]})},ts=n(18704),to=n(45133),ta=n.n(to);let ti=e=>{let{className:t,symbolInfo:n,klineMaskVisible:o,onFinished:i}=e,{t:l}
1=(0,u.Z)("trade"),[d,m]=(0,s.useState)(null),[_,p]=(0,s.useState)(""),[h,v]=(0,s.useState)(""),[f,b]=(0,s.useState)(!0),g=(0,s.useRef)(null),x=(0,s.useRef)(null),y=(0,s.useRef)(!1),C=(0,s.useRef)(!1),{webSocket:N,socketConnected:k}=(0,s.useContext)(j),w=(0,s.useCallback)(()=>{if(!(null==n?void 0:n.key))return;let e={...n};e.isCd=!1,ts.Z.setSymbolIsCdProp(e.key,!1)},[n]),S=(0,s.useCallback)(e=>{if(C.current||y.current)return;x.current&&clearInterval(x.current);let t=()=>{if(e<=0){y.current=!0,clearInterval(x.current),null==i||i();return}let t=Math.floor(e/1e3/60/60/24),n=Math.floor(e/1e3/60/60%24),r=Math.floor(e/1e3/60%60),s=Math.floor(e/1e3%60),o=24*t+n;m({hh:o<10?"0".concat(o):"".concat(o),mm:r<10?"0".concat(r):"".concat(r),ss:s<10?"0".concat(s):"".concat(s)}),b(!1),e-=1e3};t(),x.current=setInterval(t,1e3)},[i]),F=(0,s.useCallback)(()=>{(null==n?void 0:n.key)&&(b(!0),(0,a.WR)({source:"pc",symbols:n.key}).then(e=>{var t;let r=null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.find(e=>e.n===n.key);if(!r)return;if(1!==r.isCd){w(),null==i||i();return}let s=Math.max(r.ot-(e.ts||Date.now()),0);y.current=!1,S(s),(null==n?void 0:n.name)&&p(n.name.toUpperCase()),v(r.url)}).catch(console.error))},[n,S,w,i]),P=(0,s.useCallback)(e=>{var t;if(!(null==e?void 0:null===(t=e.d)||void 0===t?void 0:t.ot))return;let n=e.d.ot-Date.now();S(n),1!==e.d.isCd&&(w(),null==i||i())},[S,w,i]);return(0,s.useEffect)(()=>(C.current=!1,F(),()=>{C.current=!0,x.current&&clearInterval(x.current)}),[F]),(0,s.useEffect)(()=>{N&&(g.current=N,g.current.onMessage(P))},[N,P]),(0,s.useEffect)(()=>{k&&g.current&&(null==n?void 0:n.key)&&g.current.send({event:"sub",params:{channel:"market_".concat(n.key,"_countdown"),cb_id:n.key}})},[k,null==n?void 0:n.key]),(0,s.useEffect)(()=>
1{(null==n?void 0:n.name)&&(b(!0),m(null),p(n.name.toUpperCase()))},[null==n?void 0:n.name]),(0,r.jsx)("div",{className:t,children:(0,r.jsx)("div",{className:ta().wrap,children:(0,r.jsx)("div",{className:"box-sizing cdcbox",children:(0,r.jsx)("div",{className:ta().cd_content_wrapper,children:f||!d?(0,r.jsx)(D.Z,{}):(0,r.jsx)("div",{className:ta().cd_content,children:(0,r.jsxs)("div",{className:ta().cd_info,children:[(0,r.jsx)("div",{className:ta().coinPair,children:_}),(0,r.jsx)("div",{className:ta().cd_text,children:l("countDown.tradingWillBeOpenedAfterTheCountdownEnds")}),(0,r.jsx)("div",{className:ta().cd_time,children:(0,r.jsxs)("div",{className:c()(ta().datebox,ta().show),children:[(0,r.jsx)("div",{className:ta().date_info,children:(0,r.jsx)("div",{className:c()(ta().infov,ta().infov_hh),children:d.hh})}),(0,r.jsx)("div",{className:ta().gap,children:":"}),(0,r.jsx)("div",{className:ta().date_info,children:(0,r.jsx)("div",{className:ta().infov,children:d.mm})}),(0,r.jsx)("div",{className:ta().gap,children:":"}),(0,r.jsx)("div",{className:ta().date_info,children:(0,r.jsx)("div",{className:ta().infov,children:d.ss})})]})}),h&&(0,r.jsxs)("a",{className:ta().more,href:h,target:"_blank",rel:"noreferrer",children:[l("countDown.cdDetail"),(0,r.jsx)("i",{className:"iconfont icon-arrow-right"})]})]})})})})})})};var tl=ti,tc=n(98928),td=n.n(tc),tu=function(e){let t=(0,o.useRouter)(),{quoteCoin:n="",baseCoin:i="",symbolInfo:l}=e,[d,m,_]=ej()([]),[p,h,v]=ej()("".concat(n).concat(i).toLocaleLowerCase()),{t:f,lang:b}=(0,u.Z)("trade"),{tradeStore:y}=(0,x.oR)(),{webSocket:C,socketConnected:N}=(0,s.useContext)(j),k=()=>{let e="".concat(n).concat(i).toLocaleLowerCase();(0,a.f5)({symbol:e}).then(e=>{let{list:t=[]}=e.data||{};m(t)}).catch(e=>{console.log(e)})};(0,s.useEffect)(()=>{if(!N)return;S("sub");let e=e=>F(e);return C.onMessage(e),()=>{C.offMessage(e)}},[N]);let w=e=>{null==y||y.setStrikePrice(e)};function S(e){let t="".concat(n).concat(i).toLocaleLowerCase(),r={channel:"market_".concat(t,"_trade_ticker"),cb_id:t};N&&C.send({event:e,params:r})}function F(e){if(e.tick&&e.tick.data&&e.channel&&e.channel.indexOf("trade_ticker")>-1){let t=v.current,n=e.channel&&e.channel.split("_")[1];if(n===t){let r=[...e.tick.data,..._.current].slice(0,20);m(r)}}}(0,s.useEffect)(()=>(t.events.on("beforeHistoryChange",P),()=>{t.events.off("beforeHistoryChange",P)})),(0,s.useEffect)(()=>{k(),S("sub");let e="".concat(n).concat(i).toLocaleLowerCase();h(e)},[n,i]);let P=e=>{e.includes("/trade/")||(S("unsub"),m([]))};return(0,r.jsxs)("div",{className:td().tradesWrap,children:[(0,r.jsx)("div",{className:c()([td().title,td().title_min]),children:f("realTimeDeal")}),(0,r.jsxs)("div",{className:td().lists,children:[(0,r.jsxs)("div",{className:td().theader,children:[(0,r.jsxs)("span",{className:td().col1,children:[f("price")," (",(null==l?void 0:l.quoteAlias)||i.toUpperCase(),")"]}),(0,r.jsxs)("span",{className:td().col2,children:[f("volTitle")," (",(null==l?void 0:l.coinAlias)||n.toUpperCase(),")"]}),(0,r.jsx)("span",{className:td().col3,children:f("time")})]}),(0,r.jsx)("div",{className:td().tbody,children:(0,r.jsx)("ul",{children:d&&d.length>0&&d.map((e,t)=>{let n=void 0!==e.price?l.scale&&void 0!==l.scale.price&&Number(e.price).toFixed(l.scale.price):e.p,s=void 0!==e.vol?l.scale&&void 0!==l.scale.volume&&Number(e.vol).toFixed(l.scale.volume):e.v;return(0,r.jsxs)("li",{onClick:()=>w(e.price||e.p),children:[(0,r.jsx)("span",{className:c()([td().col1,"SELL"==e.side||"SELL"==e.s?td().fall:td().rose]),children:(0,g.uf)(n)}),(0,r.jsx)("span",{className:td().col2,children:(0,g.uf)(s)}),(0,r.jsx)("span",{className:td().col3,children:(0,g.p6)(e.ts,"hh:mm:ss")})]},t)})})})]})]})},tm=function(e){let{theme:t,baseCoin:n,quoteCoin:o,symbolList:a,symbolInfo:i,interval:l,intervalStr:m,coinRates:p}=e,{tradeStore:v}=(0,x.oR)(),{t:y}=(0,u.Z)("trade"),{t:j}=(0,u.Z)("common"),[C,N]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=d.Z.get(b.r);N(e)},[]),(0,s.useEffect)(()=>{if(!n||!o)return;let e="".concat(null==o?void 0:o.toUpperCase(),"-").concat(null==n?void 0:n.toUpperCase());d.Z.set("symbol",e)},[n,o]),(0,s.useEffect)(()=>(document.body.style.backgroundColor="#f4f5f6",()=>{document.body.style.backgroundColor="#fff"}),[]);let k=[{key:"chart",name:y("chart")},{key:"order",name:y("order")},{key:"trade",name:y("realTimeDeal")}
1],[w,S]=(0,s.useState)(0),P=e=>{S(e)},[A,I]=(0,s.useState)(!1),[L,U]=(0,s.useState)(""),D=e=>{I(!0),U(e),document.body.style.overflow="hidden"},R=()=>{I(!1),U(""),document.body.style.overflow=""},[O,T]=(0,s.useState)(!1),B=()=>{T(!O),document.body.style.overflow=O?"":"hidden"},Z=(0,s.useRef)(),M=e=>{Z.current===e.target&&(T(!1),document.body.style.overflow="")},[W,q]=(0,s.useState)(!1),[z,V]=(0,s.useState)(""),H=e=>{q(!0),V(e),document.body.style.overflow="hidden"},Q=()=>{q(!1),V(""),document.body.style.overflow=""},[J,Y]=(0,s.useState)(null),[K,G]=(0,s.useState)(0);(0,s.useEffect)(()=>{if(!a||!n||!o)return;let e="".concat(o.toUpperCase(),"/").concat(n.toUpperCase()),t=null,r=0;for(let s in a){let i=a[s];if(Array.isArray(i)){let l=i.find(t=>t.name&&t.name.toUpperCase()===e);if(l){t=l,r=l.isCd||0;break}}}Y(t),G(r)},[a,n,o]);let X=(0,s.useCallback)(()=>{G(0)},[]),[$,ee]=(0,s.useState)(null);return(0,s.useEffect)(()=>{let e=window.matchMedia("(min-width: 1025px)"),t=window.matchMedia("(max-width: 1024px) and (min-width: 768px)");function n(){e.matches?ee("lg"):t.matches?ee("md"):ee("sm")}return n(),e.addEventListener("change",n),t.addEventListener("change",n),()=>{e.removeEventListener("change",n),t.removeEventListener("change",n)}},[]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(_(),{children:[(0,r.jsx)("link",{rel:"prefetch",href:"https://static.bittime.com/static/source/echarts.min.js",as:"script"}),(null==i?void 0:i.lastPrice)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("title",{children:y("seo.title",{symbolName:(null==i?void 0:i.name)||"",price:(0,g.uf)(null==i?void 0:i.lastPrice)})}),(0,r.jsx)("meta",{name:"description",content:y("seo.description",{coin:null==o?void 0:o.toUpperCase(),symbolName:null==i?void 0:i.name,price:(0,g.uf)(null==i?void 0:i.lastPrice),vol24h:i.amount})})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("title",{children:y("seo.untitle",{symbolName:(null==i?void 0:i.name)||"",coin:null==o?void 0:o.toUpperCase(),base:null==n?void 0:n.toUpperCase()})}),(0,r.jsx)("meta",{name:"description",content:y("seo.undescription",{coin:null==o?void 0:o.toUpperCase(),base:null==n?void 0:n.toUpperCase()})})]}),(0,r.jsx)("meta",{name:"keywords",content:y("seo.keywords",{coin:null==o?void 0:o.toUpperCase(),base:null==n?void 0:n.toUpperCase()})})]}),(0,r.jsxs)(F,{children:[(0,r.jsx)(E,{screen:"lg",children:(0,r.jsxs)("div",{className:ex().tradeWrap,children:[(0,r.jsxs)("div",{className:ex().left,children:[(0,r.jsx)(ew,{coinRates:p,symbolList:a,baseCoin:n,quoteCoin:o}),(0,r.jsx)(tu,{symbolInfo:i,baseCoin:n,quoteCoin:o})]}),(0,r.jsx)("div",{className:ex().middle,children:(0,r.jsx)(tr,{coinRates:p,theme:t,symbolInfo:i,baseCoin:n,quoteCoin:o,mdIconCl
1ick(){}})}),(0,r.jsx)("div",{className:ex().right,children:(0,r.jsx)(eL,{coinRates:p,symbolInfo:i,baseCoin:n,quoteCoin:o})}),(0,r.jsxs)("div",{className:ex().center,children:[1==K?(0,r.jsx)(tl,{symbolInfo:i,theme:t,onFinished:X}):"lg"===$&&(0,r.jsx)(ed,{symbolInfo:i,interval:l,intervalStr:m,theme:t}),(0,r.jsx)(eJ,{coinRates:p,baseCoin:n,quoteCoin:o,symbolInfo:i,isCd:K})]}),(0,r.jsx)("div",{className:ex().list,children:"lg"===$&&(0,r.jsx)(e1,{baseCoin:n,quoteCoin:o})})]})}),(0,r.jsxs)(E,{screen:"md",children:[(0,r.jsx)("div",{className:ex().md_tradeWrap,children:(0,r.jsx)(tr,{coinRates:p,theme:t,symbolInfo:i,baseCoin:n,quoteCoin:o,mdIconClick:B,marketListShow:O})}),(0,r.jsx)("div",{className:ex().tabs,children:k.map((e,t)=>(0,r.jsx)("div",{className:c()({[ex().tab]:!0,[ex().active]:t===w}),onClick:()=>P(t),children:e.name},t))}),(0,r.jsxs)("div",{className:ex().md_tab_contant,children:[(0,r.jsx)("div",{className:c()({[ex().md_tab_contant_item]:!0,[ex().md_block]:0===w}),children:1==K?(0,r.jsx)(tl,{symbolInfo:i,theme:t,onFinished:X}):"md"===$&&(0,r.jsx)(ed,{symbolInfo:i,interval:l,intervalStr:m,theme:t})}),(0,r.jsx)("div",{className:c()({[ex().md_tab_contant_item]:!0,[ex().md_block]:1==w}),children:(0,r.jsx)(eL,{coinRates:p,symbolInfo:i,baseCoin:n,quoteCoin:o})}),(0,r.jsx)("div",{className:c()({[ex().md_tab_contant_item]:!0,[ex().md_block]:2==w}),children:(0,r.jsx)(tu,{symbolInfo:i,baseCoin:n,quoteCoin:o})})]}),(0,r.jsx)("div",{className:ex().md_orders_list,children:"md"===$&&(0,r.jsx)(e1,{baseCoin:n,quoteCoin:o})}),C&&(0,r.jsxs)("div",{className:ex().md_bottom,children:[(0,r.jsx)("div",{className:ex().md_btn_buy,onClick:()=>D("buy"),children:y("buy")}),(0,r.jsx)("div",{className:ex().md_btn_sell,onClick:()=>D("sell"),children:y("sell")})]}),!C&&(0,r.jsxs)("div",{className:ex().md_bottom,children:[(0,r.jsx)(h(),{href:"/login?callBackPath=/trade",className:ex().md_btn_login,children:j("header.login")}),(0,r.jsx)(h(),{href:"/register?callBackPath=/trade",className:ex().md_btn_res,children:j("header.register")})]}),(0,r.jsxs)(eb,{open:A,maskClosable:A,defaultOpen:!1,onCancel:R,children:[(0,r.jsxs)("div",{className:ex().md_menu_tabs,children:[(0,r.jsx)("div",{className:c()({[ex().md_menu_tab_buy]:!0,[ex().md_menu_tab_buy_active]:"buy"===L}),onClick:()=>U("buy"),children:y("buy")}),(0,r.jsx)("div",{onClick:()=>U("sell"),className:c()({[ex().md_menu_tab_sell]:!0,[ex().md_menu_tab_sell_active]:"sell"===L}),children:y("sell")})]}),(0,r.jsx)(eJ,{coinRates:p,baseCoin:n,quoteCoin:o,symbolInfo:i,mdTabType:L,mdMenuClose:R,isCd:K}),(0,r.jsx)("div",{className:ex().md_menuCloseWrap,children:(0,r.jsx)("div",{className:ex().md_menuClose,onClick:R,children:y("cancel")})})]}),(0,r.jsx)("div",{className:ex().md_market,ref:Z,onClick:M,style:{display:O?"block":"none"},children:(0,r.jsx)(ew,{coinRates:p,symbolList:a,baseCoin:n,quoteCoin:o,closeFn:B})})]}),(0,r.jsxs)(E,{screen:"sm",children:[(0,r.jsx)("div",{className:ex().md_tradeWrap,children:(0,r.jsx)(tr,{coinRates:p,theme:t,symbolInfo:i,baseCoin:n,quoteCoin:o,mdIconCl
1ick:B,marketListShow:O})}),(0,r.jsx)("div",{className:ex().tabs,children:k.map((e,t)=>(0,r.jsx)("div",{className:c()({[ex().tab]:!0,[ex().active]:t===w}),onClick:()=>P(t),children:e.name},t))}),(0,r.jsxs)("div",{className:ex().md_tab_contant,children:[(0,r.jsx)("div",{className:c()({[ex().md_tab_contant_item]:!0,[ex().md_block]:0===w}),children:1==K?(0,r.jsx)(tl,{symbolInfo:i,theme:t,onFinished:X}):"sm"===$&&(0,r.jsx)(ed,{symbolInfo:i,interval:l,intervalStr:m,theme:t})}),(0,r.jsx)("div",{className:c()({[ex().md_tab_contant_item]:!0,[ex().md_block]:1==w}),children:(0,r.jsx)(eL,{coinRates:p,symbolInfo:i,baseCoin:n,quoteCoin:o})}),(0,r.jsx)("div",{className:c()({[ex().md_tab_contant_item]:!0,[ex().md_block]:2==w}),children:(0,r.jsx)(tu,{symbolInfo:i,baseCoin:n,quoteCoin:o})})]}),(0,r.jsx)("div",{className:ex().md_orders_list,children:"sm"===$&&(0,r.jsx)(e1,{baseCoin:n,quoteCoin:o})}),C&&(0,r.jsxs)("div",{className:ex().md_bottom,children:[(0,r.jsx)("div",{className:ex().md_btn_buy,onClick:()=>H("buy"),children:y("buy")}),(0,r.jsx)("div",{className:ex().md_btn_sell,onClick:()=>H("sell"),children:y("sell")})]}),!C&&(0,r.jsxs)("div",{className:ex().md_bottom,children:[(0,r.jsx)(h(),{href:"/login?callBackPath=/trade",className:ex().md_btn_login,children:j("header.login")}),(0,r.jsx)(h(),{href:"/register?callBackPath=/trade",className:ex().md_btn_res,children:j("header.register")})]}),(0,r.jsx)("div",{style:{display:W?"block":"none"},children:(0,r.jsx)("div",{className:c()({[ex().md_menu]:!0,[ex().md_menu_visible]:W}),children:(0,r.jsxs)("div",{className:c()({[ex().md_menu_root]:!0,[ex().md_menu_root_visible]:W}),children:[(0,r.jsxs)("div",{className:ex().ms_cancel_tabs,children:[(0,r.jsx)("div",{onClick:Q,children:(0,r.jsx)("i",{className:c()(["iconfont","icon-close"])})}),(0,r.jsx)("div",{children:y("orderConfirmation")}),(0,r.jsx)("div",{})]}),(0,r.jsxs)("div",{className:ex().md_menu_tabs,children:[(0,r.jsx)("div",{className:c()({[ex().md_menu_tab_buy]:!0,[ex().md_menu_tab_buy_active]:"buy"===z}),onClick:()=>H("buy"),children:y("buy")}),(0,r.jsx)("div",{className:c()({[ex().md_menu_tab_sell]:!0,[ex().md_menu_tab_sell_active]:"sell"===z}),onClick:()=>H("sell"),children:y("sell")})]}),(0,r.jsx)(eJ,{coinRates:p,baseCoin:n,quoteCoin:o,symbolInfo:i,mdTabType:z,mdMenuClose:R,isCd:K})]})})}),(0,r.jsx)("div",{className:c()({[ex().ms_market]:!0,[ex().ms_market_visible]:O}),children:(0,r.jsxs)("div",{className:c()({[ex().ms_market_root]:!0,[ex().ms_market_root_visible]:O}),children:[(0,r.jsxs)("div",{className:c()({[ex().ms_cancel_tabs]:!0,[ex().ms_market_tabs]:!0}),children:[(0,r.jsx)("div",{onClick:B,children:(0,r.jsx)("i",{className:c()(["iconfont","icon-close"])})}),(0,r.jsx)("div",{children:y("market")}),(0,r.jsx)("div",{})]}),(0,r.jsx)(ew,{coinRates:p,symbolList:a,baseCoin:n,quoteCoin:o,closeFn:B})]})})]})]}),(0,r.jsx)(f(),{src:"https://static.bittime.com/static/source/echarts.min.js",onLoad:()=>v.setEchartsSdkLoad()})]})};let t_=e=>{let{theme:t,quoteCoin:n,baseCoin:l,symbolInfo:c,interval:d,intervalStr:u,coinRates:m}=e,{dispatch:_}
1=(0,s.useContext)(i.I),[p,h]=(0,s.useState)([]),v=(0,o.useRouter)();return(0,s.useEffect)(()=>(_({type:"layout",payload:{layoutFooter:!1}}),()=>{_({type:"layout",payload:{layoutFooter:!0}})}),[_]),(0,s.useEffect)(()=>{let e=async()=>{let e="".concat(n).concat(l),t=[];try{let r=await (0,a.SW)();t=(null==r?void 0:r.code)==200?null==r?void 0:r.data:[],Object.keys(t).forEach(e=>{t[e].map((n,r)=>{var s,o;t[e][r].name=n.n,t[e][r].coinAlias=null===(s=n.ca)||void 0===s?void 0:s.toUpperCase(),t[e][r].quoteAlias=null===(o=n.qa)||void 0===o?void 0:o.toUpperCase(),t[e][r].key=n.k,t[e][r].currency=n.k.toUpperCase(),t[e][r].depth=n.depth,t[e][r].marketTag=n.m,t[e][r].secondTag=n.s,t[e][r].scale.price=n.scale.p,t[e][r].scale.volume=n.scale.v,t[e][r].scale.amount=n.scale.a,t[e][r].amount=n.a||0,t[e][r].lastPrice=n.c||0,t[e][r].rate=n.r||0,t[e][r].chg=n.r||0,t[e][r].vol=n.v||0,t[e][r].isCd=n.isCd||"",delete n.n,delete n.ca,delete n.qa,delete n.m,delete n.a,delete n.c,delete n.lo,delete n.le,delete n.k,delete n.r,delete n.s,delete n.v,delete n.depth,delete n.scale.p,delete n.scale.v,delete n.scale.a})}),localStorage.setItem("symbolList",JSON.stringify(t))}catch(o){let s=localStorage.getItem("symbolList")||[];t=JSON.parse(s)}let i=Object.keys(t),c=[];for(let d=0;d<i.length;d++){let u=i[d];for(let m=0;m<t[u].length;m++){let _=t[u][m];c.push(_)}}let p=c.find(t=>t.key===e);if(!p)return v.replace("/trade/USDT-IDR");h(t)};e()},[l,n,v]),(0,r.jsx)(r.Fragment,{children:Object.keys(p).length>0&&(0,r.jsx)(tm,{theme:t,quoteCoin:n,baseCoin:l,symbolList:p,symbolInfo:c,interval:d,intervalStr:u,coinRates:m})})};var tp=!0,th=t_},507:function(e,t,n){"use strict";var r=n(36734),s=n(71069),o=n.n(s);let a=e=>{let{className:t,bgColor:n="",style:s}=e;return(0,r.jsx)("div",{className:"".concat(o().component," ").concat(t),style:n?{...s,background:n}:{...s},children:(0,r.jsx)("span",{className:o().loader})})};t.Z=a},59670:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(36734),s=n(51776),o=n(6425),a=n.n(o),i=n(86880),l=n(31024),c=n.n(l);function d(e){let{className:t,visible:n,children:o,title:l,content:d,onCancel:u,cancelText:m,onOk:_,okText:p,close:h,closeFn:v,hasHeader:f,modalClass:b,headerClass:g,footerClass:x,onBack:y,showBackBtn:j=!1,hasTitle:C=!0,okButtonProps:N={},cancelButtonProps:k={}}=e,{t:w}=(0,i.Z)("common");return(0,s.useEffect)(()=>{n?document.body.classList.add("no-scroll"):document.body.classList.remove("no-scroll")},[n]),(0,r.jsx)("div",{className:t,children:n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"".concat(c().modal," ").concat(b),children:[f?"":(0,r.jsxs)("div",{className:"".concat(c().modalheader," ").concat(g),children:[j&&(0,r.jsx)("span",{className:c().backBtn,onClick:y,children:(0,r.jsx)("svg",{t:"1760328531604",className:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"11187",width:"200",height:"200",children:(0,r.jsx)("path",{d:"M418.474667 225.834667a42.666667 42.666667 0 0 1 0 60.330666L235.306667 469.333333H900.266667a42.666667 42.666667 0 1 1 0 85.333334H235.306667l183.168 183.168a42.666667 42.666667 0 0 1-60.373334 60.330666l-256-256-0.085333-0.085333a42.538667 42.538667 0 0 1 0-60.16l0.085333-0.085333 256-256a42.666667 42.666667 0 0 1 60.373334 0z","p-id":"11188"})})}),C&&(0,r.jsx)("span",{className:c().title,children:l||w("modal.title")}),h&&(0,r.jsx)("span",{className:c().closeBtn,onClick:v,children:(0,r.jsx)("i",{className:"iconfont icon-close"})})]}),o||(0,r.jsx)("div",{className:c().modalcontent,dangerouslySetInnerHTML:{__html:d}}),(u||_)&&(0,r.jsxs)("div",{className:"".concat(c().modalfooter," ").concat(x),children:[u&&(0,r.jsx)("div",{className:a()({[c().modalbtn]:!0,[c().modalbtncancel]:!0},null==k?void 0:k.className),onClick:(null==k?void 0:k.disabled)?void 0:u,children:m||w("modal.cancelText")}),_&&(0,r.jsx)("div",{className:a()({[c().modalbtn]:!0,[c().modalbtnok]:!0,[c().disabled]:null==N?void 0:N.disabled},null==N?void 0:N.className),onClick:(null==N?void 0:N.disabled)?void 0:_,children:p||w("modal.okText")})]})]}),(0,r.jsx)("div",{className:c().modalmask})]})})}},23953:function(e,t,n){"use strict";var r=n(36734),s=n(51776),o=n(6425),a=n.n(o),i=n(86880),l=n(77913),c=n.n(l);let d=e=>{let{options:t,onSelect:n,renderLabelProp:o,showSearch:l,searchField:d,defaultValue:u,renderListOption:m,placeholder:_,optionClass:p,styleP:h={},onInputChange:v,onValueChange:f}
1=e,[b,g]=(0,s.useState)(!1),[x,y]=(0,s.useState)([]),[j,C]=(0,s.useState)(u),[N,k]=(0,s.useState)(null),[w,S]=(0,s.useState)(""),F=(0,s.useRef)(null),{t:P}=(0,i.Z)("common");(0,s.useEffect)(()=>{C(u)},[u]),(0,s.useEffect)(()=>{0!==t.length&&t.map((e,t)=>t===j&&k(e))},[t,j]),(0,s.useEffect)(()=>{if(0===t.length)return;let e=t;l&&(e=null==t?void 0:t.filter(e=>{let t=(d||"label").split(",").map(e=>e.trim());return t.some(t=>{var n,r;return null===(r=null===(n=e[t])||void 0===n?void 0:n.toLowerCase())||void 0===r?void 0:r.includes(null==w?void 0:w.toLowerCase())})})),y(e)},[t,d,w,l]),(0,s.useEffect)(()=>{let e=e=>{F.current&&!F.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);let A=()=>{g(!b)},I=(e,r)=>{let s=t.findIndex(t=>t===e);C(-1!==s?s:r),k(e),g(!1),S(""),n&&n(e)},L=e=>{S(e.target.value),v&&v(e.target.value)},U=()=>{S(""),f("")};return(0,r.jsxs)("div",{className:c().component+" "+((null==h?void 0:h.com)||""),ref:F,children:[(0,r.jsxs)("div",{className:a()([c().option+" "+((null==h?void 0:h.opt)||""),p]),onClick:A,children:[o?o(N):(0,r.jsx)("span",{children:null==N?void 0:N.label}),(0,r.jsx)("i",{className:"iconfont icon-unfold",style:{lineHeight:1,transform:b?"scaleY(-1)":"scaleY(1)"}})]}),b&&(0,r.jsxs)("div",{className:"".concat(c().list," ").concat((null==h?void 0:h.selList)||""),children:[l&&(0,r.jsxs)("div",{className:c().list_input,children:[(0,r.jsx)("input",{type:"text",placeholder:_||"",value:w,onChange:L,autoFocus:!0}),w&&(0,r.jsx)("i",{className:"iconfont icon-shanchu",onClick:U})]}),x.length>0?(0,r.jsx)("ul",{children:x.map((e,t)=>(0,r.jsx)("li",{onClick:()=>I(e,t),className:t===j?c().current:"",children:(0,r.jsx)("div",{className:c().list_item,children:m?m(e):e.label})},t))}):(0,r.jsx)("div",{className:c().no_matches,children:P("other.noData")})]})]})};t.Z=d},58018:function(e,t,n){"use strict";let r;n.d(t,{A:function(){return d}});var s=n(36734),o=n(50278),a=n(22667);let i=[],l=e=>{if(e){try{o.createRoot(e).unmount()}catch(t){console.warn("Toast React unmount failed:",t)}try{e.parentNode&&document.contains(e)?e.parentNode.removeChild(e):e.remove&&e.remove()}catch(s){try{document.body.contains(e)&&document.body.removeChild(e)}catch(r){try{e.style.display="none",e.style.visibility="hidden",e.style.pointerEvents="none",e.style.zIndex="-9999"}catch(n){console.warn("Toast cleanup completely failed:",n)}}}}},c=()=>{for(;i.length>0;){let e=i.pop();if(!e)break;l(e)}},d=e=>{let{msg:t,type:n,duration:i=5e3,afterClose:l}=e,d=document.createElement("div");document.body.appendChild(d),r&&window.clearTimeout(r),r=window.setTimeout(c,i),o.createRoot(d).render((0,s.jsx)(a.Z,{visible:!0,type:n,msg:t,duration:i,afterClose:l}))}},22667:function(e,t,n){"use strict";var r=n(36734),s=n(51776),o=n(6425),a=n.n(o),i=n(48272),l=n.n(i);let c=e=>{let{type:t,duration:n=1500,msg:o,afterClose:i,visible:c=!1}=e,[d,u]=(0,s.useState)(!1),m=(0,s.useRef)(null),_=()=>{m.current&&(clearTimeout(m.current),m.current=void 0)};return(0,s.useEffect)(()=>{u(!!c)},[c]),(0,s.useEffect)(()=>{n&&d&&(m.current=setTimeout(()=>{u(!1),i&&i(),_()},n))},[n,d,i]),d?(0,r.jsx)("div",{className:l().component,children:(0,r.jsxs)("div",{className:a()({[l().toast]:!0,[l()["toast_".concat(t)]]:!!t}),children:[!!t&&(0,r.jsx)("i",{className:"iconfont icon-toast-".concat(t)}),(0,r.jsx)("div",{className:l().toast_msg,children:o})]})}):null};t.Z=c},93767:function(e,t,n){"use strict";var r=n(36734),s=n(6425),o=n.n(s),a=n(12534),i=n.n(a);function l(e){let{cls:t,title:n,content:s,contentStyle:a}=e;return(0,r.jsxs)("div",{className:o()([i().tooltips_wrap,t]),children:[n||(0,r.jsx)("i",{className:"iconfont icon-help"}),(0,r.jsx)("em",{style:a,children:s})]})}t.Z=l},64156:function(e,t,n){"use strict";n.d(t,{G:function(){return s},_:function(){return r}});let r={FUTURE_LANDING_COMING_SOON_EN:"https://m-static.bittime.com/m-static/BTFC-ComingSoon-EN.png",FUTURE_LANDING_COMING_SOON_ID:"https://m-static.bittime.com/m-static/BTFC-ComingSoon-ID.png",FUTURE_LANDING_ON_GOING_EN:"https://m-static.bittime.com/m-static/BTFC-Beginning-EN.png",FUTURE_LANDING_ON_GOING_ID:"https://m-static.bittime.com/m-static/BTFC-Beginning-ID.png"},s="200"},78507:function(e,t,n){"use strict";n.d(t,{Dd:function(){return j},e9:function(){return k},no:function(){return y},I9:function(){return b},RZ:function(){return f},mv:function(){return g},Sd:function(){return x},qp:function(){return v},E4:function(){return N},Zd:function(){return C}});var r=n(69844);let s="".concat(r.D.apiDomain,"exchange-web-gateway/"),o="".concat(s,"point/activity-list"),a="".concat(s,"point/title-url"),i="".concat(s,"point/dashboard"),l="".concat(s,"point/detail"),c="".concat(s,"point/exchange-detail"),d="".concat(s,"point/exchange"),u="".concat(s,"point/activity-detail"),m="".concat(s,"point/special-symbol-list"),_="".concat(s,"point/ranking-list"),p="".concat(s,"point/trading-entry");var h=n(39949);function v(e,t){return(0,h.U2)(o,e,t)}function f(e){return(0,h.U2)(a,e)}function b(e,t){return(0,h.U2)(u,e,t)}function g(e,t){return(0,h.U2)(i,e,t)}function x(e,t){return(0,h.U2)(l,e,t)}function y(e,t){return(0,h.U2)(c,e,t)}function j(e,t){return(0,h.v_)(d,e,t)}function C(e){return(0,h.U2)(m,e)}function N(e){return(0,h.U2)(_,e)}function k(e){return(0,h.U2)(p,e)}},81277:function(e,t,n){"use strict";n.d(t,{S:function(){return o},a:function(){return a}});var r=n(76306),s=n(39949);function o(e){return(0,s.U2)(r.gH,e)}function a(e){return(0,s.U2)(r.e,e)}},57319:function(e,t,n){"use strict";n.d(t,{Fe:function(){return x},GZ:function(){return f},JV:function(){return y},Jd:function(){return v},NO:function(){return p},NP:function(){return l},PQ:function(){return h},QR:function(){return b},SW:function(){return o},WR:function(){return g},c2:function(){return c},cX:function(){return u},f5:function(){return i},io:function(){return a},oF:function(){return m},p_:function(){return d},qV:function(){return _}});var r=n(76306),s=n(66320);function o(){return(0,s.U2)(r.ew,{source:"pc"})}function a(e){return(0,s.U2)(r.cF,e)}function i(e){return(0,s.U2)(r.$,e)}function l(e){return(0,s.U2)(r.I_,e)}function c(e){return(0,s.U2)(r._F,e)}function d(e){return(0,s.v_)(r.NV,e)}function u(e){return(0,s.v_)(r.p9,e)}function m(e){return(0,s.U2)(r._q,e)}function _(e){return(0,s.U2)(r.UR,e)}function p(e){return(0,s.v_)(r._D,e)}function h(e){return(0,s.U2)(r.Gr,e)}function v(e){return(0,s.v_)(r.hX,e)}function f(e){return(0,s.U2)(r.Jw,e)}function b(e){return(0,s.U2)(r.MW,e)}function g(e){return(0,s.U2)(r.bL,e)}function x(e){return(0,s.U2)(r.lA,e)}function y(e){return(0,s.U2)(r.Gx,e)}},18704:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";var bignumber_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(84574),common={updateURLParameter:function(e,t,n){if(e&&t&&n){let r="",s=e.split("?"),o=s[0],a=s[1],i="";if(a){s=a.split("&");for(let l=0;l<s.length;l++)s[l].split("=")[0]!==t&&(r+=i+s[l],i="&")}
1return"".concat(o,"?").concat(r).concat(i).concat(t,"=").concat(n)}return e},strFormatDigit:function(e,t){let n=e+="",r=e.split(".");if("string"==typeof e&&(e.indexOf("E-")>-1||e.indexOf("e-")>-1)){let s=e.indexOf("E-")>-1?e.split("E-"):e.split("e-"),o=s[0],a=parseInt(s[1]),i=[],l;for(l=0;l<a-1;l++)i[l]=0;n="0."+i.join("")+o.replace(".",""),t&&(n=parseFloat(n).toFixed(t))}else if(r[1]&&t){if(r[1].length>t){var c=parseFloat(n).toFixed(t+1);n=c.slice(0,c.length-1)}else n=parseFloat(e).toFixed(t)}else t&&(n=parseFloat(e).toFixed(t));return 0===parseFloat(n)&&(n=0),n},subStringNum:function(e,t){let n;let r=typeof e;"number"==r?n=e.toString().split("."):"string"==r&&(n=e.split(".")),n.length>1&&(e=n[0]+"."+n[1].substr(0,t));let s=e.toString(),o;-1==s.indexOf(".")?(o=t,s+="."):o=t-(s.length-1-s.indexOf("."));for(let a=0;a<o;a++)s+="0";return s},toNonExponential:function(e){if("number"!=typeof e&&!parseFloat(e))return e;e.toExponential||(e=Number(e));var t=e.toExponential().match(/\d(?:\.(\d*))?e([+-]\d+)/);return e.toFixed(Math.max(0,(t[1]||"").length-t[2]))},accurateDecimal:function(e,t){let n,r=1;for(let s=0;s<t;s++)r*=10;let o=(e=Math.round(e*r)/r).toString();-1==o.indexOf(".")?(n=t,o+="."):n=t-(o.length-1-o.indexOf("."));for(let a=0;a<n;a++)o+="0";return o},arrCompareSort:function(e,t,n){if(!(e instanceof Array)||0===e.length||!t||!n||"def"===n)return e;let r="number"==typeof e[0][t]||!isNaN(e[0][t]);return r?e.sort(function(e,r){let s=new bignumber_js__WEBPACK_IMPORTED_MODULE_0__.Z(parseFloat(e[t]||0)),o=new bignumber_js__WEBPACK_IMPORTED_MODULE_0__.Z(parseFloat(r[t]||0));return s.isZero()&&o.isZero()?(e.name||"").localeCompare(r.name||""):"asc"===n?s.minus(o).toNumber():"desc"===n?o.minus(s).toNumber():void 0}):e.sort(function(e,r){let s=e[t]||"",o=r[t]||"";return""===s&&""===o?(e.name||"").localeCompare(r.name||""):"asc"===n?s.localeCompare(o):"desc"===n?o.localeCompare(s):void 0}),e},getParameterByName:function(e,t){var n=RegExp("[\\?&]"+(e=e.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"))+"=([^&#]*)").exec(t||window.location.search);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))},paramsStr:function(e){let t="";return"object"==typeof e&&Object.keys(e).forEach(n=>{let r=e[n];(r||0==r)&&(t+=t?"&".concat(n,"=").concat(r):"?".concat(n,"=").concat(r))}),t},throttle:function(e,t,n){var r,s,o,a={now:function(){return new Date-0}},i=null,l=0;n||(n={});var c=function(){l=!1===n.leading?0:a.now(),i=null,o=e.apply(r,s),i||(r=s=null)};return function(){var d=a.now();l||!1!==n.leading||(l=d);var u=t-(d-l);return r=this,s=arguments,u<=0||u>t?(clearTimeout(i),i=null,l=d,o=e.apply(r,s),i||(r=s=null)):i||!1===n.trailing||(i=setTimeout(c,u)),o}},debounce:function(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500;return function(r){clearTimeout(t),r.persist&&r.persist(),t=setTimeout(()=>{e(r)},n)}},padLeft:function(e){return e>10?"".concat(e):"0".concat(e)},getCoinPrecision:function(e,t,n){let r=8;return Object.keys(e).map(s=>{s===t&&(r=e[s][n])}),r},splitNumPrecision:function(e,t){let n=e,r=e.toString().split(".")[1];if(r){let s=e.toString().split(".")[0],o=r.substring(0,t);0==(n=s+"."+o)&&(t=8,n=s+"."+(o=r.substring(0,t)))}return n},tranNumber:function(e,t){let n=e.toString().split(".")[0];if(n.length<8)return this.formatNumSplit(e);if(n.length>7&&n.length<10){let r=n.substring(n.length-6,n.length-6+t);return"".concat("".concat(parseInt(e/1e6),".").concat(r)," M")}if(n.length>9){let s=n.substring(n.length-9,n.length-9+t),o=this.formatNumSplit(parseInt(e/1e9));return"".concat("".concat(o,".").concat(s)," B")}},tranNumberHome:function(e,t){t||(t=2);let n=e.toString().split(".")[0];if(n.length<5)return e>1&&(e=(e-0).toFixed(t)),this.formatNumSplit(e);if(n.length>=5&&n.length<7){let r=n.substring(n.length-3,n.length-3+t);return"".concat("".concat(parseInt(e/1e3),".").concat(r)," K")}if(n.length>=7&&n.length<=9){let s=n.substring(n.length-6,n.length-6+t);return"".concat("".concat(parseInt(e/1e6),".").concat(s)," M")}if(n.length>9){let o=n.substring(n.length-9,n.length-9+t),a=this.formatNumSplit(parseInt(e/1e9));return"".concat("".concat(a,".").concat(o)," B")}},tranNumber2:function(e,t){t||0===t||(t=2);let n=e.toString().split(".")[0];if(n.length<7)return this.formatNumSplit(e);
1if(n.length>=7&&n.length<=9){let r=n.substring(n.length-6,n.length-6+t);return"".concat("".concat(parseInt(e/1e6),".").concat(r)," M")}if(n.length>9){let s=n.substring(n.length-9,n.length-9+t),o=this.formatNumSplit(parseInt(e/1e9));return"".concat("".concat(o,".").concat(s)," B")}},formatNumSplit:function(e){return parseFloat(e)?e.toString().replace(/\d+/,function(e){return e.replace(/(\d)(?=(\d{3})+$)/g,function(e){return e+","})}):e},coinPic:function(e){if(e)return"//cdn.bitrue.com/icon/icon_".concat(e.toUpperCase(),".png")},formatTimestamp:function(e){if(!parseInt(e))return e;let t=8,n=new Date().getTimezoneOffset();return parseInt(e)+6e4*n+36e5*t},formatDate:function(time,fmt){if(null!=time){var fmt=fmt||"yyyy-MM-dd",time=new Date(time),z={M:time.getMonth()+1,d:time.getDate(),h:time.getHours(),m:time.getMinutes(),s:time.getSeconds()};return fmt=fmt.replace(/(M+|d+|h+|m+|s+)/g,function(v){return((v.length>1?"0":"")+eval("z."+v.slice(-1))).slice(-2)}),fmt.replace(/(y+)/g,function(e){return time.getFullYear().toString().slice(-e.length)})}},getBeforeDate:function(e){var t=new Date,n=new Date(e),r=t.getFullYear(),s=t.getMonth()+1,o=t.getDate(),a=n.getFullYear(),i=n.getMonth()+1,l=n.getDate(),c=0;function d(e,t){return 32-new Date(e,t-1,32).getDate()}if(n.getTime()-t.getTime()<0){var u=l,m=i,_=a;l=o,i=s,a=r,o=u,s=m,r=_}if(r==a){if(s==i)c+=l-o;else{c+=d(r,s)-o+1;for(var p=1;p<i-s;p++)c+=d(r,s+p);c+=l-1}}else{c+=d(r,s)-o+1;for(var h=1;h<12-s;h++)c+=d(r,s+h);for(var v=1;v<a-r;v++)(r+v)%400==0||(r+v)%4==0&&(r+v)%100!=0?c+=366:c+=365;for(var f=1;f<=i;f++)c+=d(a,f);c+=l-1}return n.getTime()-t.getTime()<0?-c:c},mapCookieToCms:function(e){let t={en_US:"en",zh_CN:"zh-CN",tw_TW:"zh-TW",ja_JP:"ja",es_ES:"es"};return t[e]},mapLocalesIdToNext:function(e){let t={en_US:"en",tw_TW:"zh-hant",es_ES:"es",id_ID:"id",ar_AR:"ar",pl_PL:"pl",tr_TR:"tr",fr_FR:"fr",de_DE:"de",th_TH:"th",nl_NL:"nl",pt_PT:"pt",ru_RU:"ru",vi_VN:"vi",sv_SE:"sv"};return t[e]||"en"},setObjToLocalStorage:function(e,t,n){if(__CLIENT__){let r=localStorage.getItem(e);(r=r?JSON.parse(r):{})[t]=n,localStorage.setItem(e,JSON.stringify(r))}},formatCookieStr:function(e,t){let n=e.split("; ");for(let r=0;r<n.length;r++){let s=n[r].split("=");if(s[0]==t)return unescape(s[1])}},getObjInLocalStorage:function(e,t){if(__CLIENT__){let n=localStorage.getItem(e);if(n){let r=JSON.parse(n);return r[t]}}},loadScript:function(e,t){let n=document.createElement("script");n.type="text/javascript",n.readyState?n.onreadystatechange=function(){("loaded"==n.readyState||"complete"==n.readyState)&&(n.onreadystatechange=null,t(n))}:n.onload=function(){t(n)},n.src=e,document.getElementsByTagName("head")[0].appendChild(n)},parseString:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.toString().replace(/\{\{(.*?)\}\}/g,(e,n)=>t[n.trim()])},subStringNum:function(e,t){let n;let r=typeof e;"number"==r?n=e.toString().split("."):"string"==r&&(n=e.split(".")),n.length>1&&(e=n[0]+"."+n[1].substr(0,t));let s=e.toString(),o;-1==s.indexOf(".")?(o=t,s+="."):o=t-(s.length-1-s.indexOf("."));for(let a=0;a<o;a++)s+="0";return s},capitalizeFirstLetter:function(e){return e.replace(/\b(\w)/g,function(e,t){return t.toUpperCase()})},firstLetterCapitalize:function(e){return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e},getIntervalKey:function(e,t){let n;let r=new Date(e);if(t>=1440&&t<10080)n=new Date(r.getFullYear(),r.getMonth(),r.getDate());else if(t>=10080){let s=r.getDay(),o=r.getDate()-s;n=new Date(r.getFullYear(),r.getMonth(),o)}else{let a=Math.floor(r.getTime()/1e3),i=60*t;return Math.floor(a/i)*i}return Math.floor(n.getTime()/1e3)},setRem:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:750,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1100;var n,r=document,s=window,o=r.documentElement,a=document.createElement("style");function i(){var n=o.getBoundingClientRect().width;n>(t=t||540)&&(n=t);var r=100*n/e;a.innerHTML="html{font-size:"+r+"px;}"}if(o.firstElementChild)o.firstElementChild.appendChild(a);else{var l=r.createElement("div");l.appendChild(a),r.write(l.innerHTML),l=null}i(),s.addEventListener("resize",function(){clearTimeout(n),n=setTimeout(i,300)},!1),s.addEventListener("pageshow",function(e){e.persisted&&(clearTimeout(n),n=setTimeout(i,300))},!1),"complete"===r.readyState?r.body.style.fontSize="16px":r.addEventListener("DOMContentLoaded",function(e){r.body.style.fontSize="16px"},!1)},digitFormat:function(e,t){if(!e||e+""=="0")return"--";var n=parseFloat(e)+"";if("NaN"===n)return"--";var r=n,s=n.split(".");if(n.indexOf("E-")>-1||n.indexOf("e-")>-1){var o,a=n.indexOf("E-")>-1?n.split("E-"):n.split("e-"),i=a[0],l=parseInt(a[1]),c=[];for(o=0;o<l-1;o++)c[o]=0;
1r=parseFloat(r="0."+c.join("")+i.replace(".","")).toFixed(t),0===parseFloat(r)&&(r=0)}else if(t&&s[1]){if(s[1].length>t){var d=parseFloat(r).toFixed(t+1);r=d.slice(0,d.length-1)}else r=parseFloat(r).toFixed(t)}else r=parseFloat(r).toFixed(t);return r},getKeywords:function(e){let t="";switch(e){case"staking":t="stake, staking, return, APR, APY, ETH, ethereum, DeFi, altcoin, BNB, Cardano, ADA, Solana, SOL, Polkadot, DOT, Avalanche, AVAX, NEAR Protocol, Cosmos, ATOM, interest, income, invest, investment, yield, savings, crypto, cryptocurrency, PoS, Proof of Stake";break;case"partners":t="bitrue partners, bitrue, partners, invitees, inviters, invite, inviter, bitrue super partners, super partners";break;default:t="Crypto Exchange,Cryptocurrency Exchange,Bitcoin Exchange"}return t},getMetaContent:function(){let e="Bitrue is the most secure and advanced online platform for buying, selling, transferring, and storing digital currency.We provide exchanges of Bitcoin, Bitcoin Cash, Ethereum, USDT and Litecoin with fiat currencies worldwide";return e},getMetaTitle:function(){let e="Crypto Exchange | XRP Exchange | XRP Trade | Bitrue";return e},digitFormatVol:function(e,t,n){let r,s="1";if(t>0)for(var o=0;o<t;o++)s+="0";return n?("ceil"==n&&(r=Math.ceil(e*s)/s),"round"==n&&(r=Math.round(e*s)/s)):r=Math.floor(e*s)/s,r},subStringNum:function(e,t){let n;let r=typeof e;"number"==r?n=e.toString().split("."):"string"==r&&(n=e.split(".")),n.length>1&&(e=n[0]+"."+n[1].substr(0,t));let s=e.toString(),o;-1==s.indexOf(".")?(o=t,s+="."):o=t-(s.length-1-s.indexOf("."));for(let a=0;a<o;a++)s+="0";return s},gtagEventLog:function(e,t){let n=location.host.indexOf("bitrue.com")>-1;n||console.log("log",e,t),gtag&&(t?gtag("event",e,{event_name:t}):gtag("event",e))},countFloatNum:function(e,t,n){let r="1";if(n>0)for(let s=0;s<n;s++)r+="0";r=parseInt(r);let o=Math.round(e*r),a=Math.round(t*r);return(o-a)/r},checkDate:function(e){if(""==e||null==e)return!1;e=e.replace(/-/g,"/");var t=new Date(e);if(isNaN(t))return!1;var n=e.split("/");return parseInt(n[0],10)==t.getFullYear()&&parseInt(n[1],10)==t.getMonth()+1&&parseInt(n[2],10)==t.getDate()},isInScope:function(e){let t=["en_US","vi_VN","pt_PT","nl_NL","th_TH","tw_TW","de_DE","fr_FR","tr_TR","pl_PL","ar_AR","ru_RU","id_ID","es_ES"];return t.includes(e)},getQueryString:function(e,t){let n=new URLSearchParams(t),r=n.get(e);return r},getSymboleInfo:function(e){let t="{}";try{t=localStorage.getItem("BITRUE_MARKET_LIST")||"{}"}catch(n){}let r=Object.values(JSON.parse(t)).flat(),s=r.find(t=>e==t.key);return s||{}},setSymboleInfo:function(e,t){try{let n=localStorage.getItem("BITRUE_MARKET_LIST")||"{}",r=JSON.parse(n),s=Object.keys(r);s.map(n=>{r[n].map((s,o)=>{s.key==e&&(r[n][o]=t)})}),localStorage.setItem("BITRUE_MARKET_LIST",JSON.stringify(r))}catch(o){}},setSymbolIsCdProp:function(e,t){try{let n=localStorage.getItem("BITRUE_MARKET_LIST")||"{}",r=JSON.parse(n),s=Object.keys(r);s.map(n=>{r[n].map((s,o)=>{s.key==e&&(r[n][o].isCd=t)})}),localStorage.setItem("BITRUE_MARKET_LIST",JSON.stringify(r))}catch(o){}},pathNameFix:function(e){let t="",n=e.split("-"),r=n[1],s=n[2];return t="USD"===s?"".concat(r,"-USD-PERPETUAL"):"USDC"===s?"".concat(r,"-").concat(s):r,"/futures/".concat(t)},importScript:(e,t)=>new Promise((n,r)=>{let s=document.createElement("script");s.setAttribute("src",e),document.head.appendChild(s),s.addEventListener("load",()=>{document.head.removeChild(s);let e=window[t]||{},r=e.default?e.default:e;n(r)}),s.addEventListener("error",e=>{r(e)})}),getResolution(e){let t=+e;return t%10080==0?t="".concat(t/10080,"W"):t%1440==0&&(t="".concat(t/1440,"D")),"".concat(t)},resolveResolution(e){let t=/^(\d+)([WD]?)$/,n=e.match(t);if(!n)throw Error("Invalid resolution format");let r=parseInt(n[1],10),s=n[2],o=0;return o="W"===s?10080*r:"D"===s?1440*r:r,"".concat(o)},fixNum:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(0===e||"0"===e)return 0;if(!e)return"--";{let r=e.toString(),s=r.indexOf(".");if(Number(t)>0){if(s>-1){let o=r.substr(0,s),a=r.substr(s,t+1);!n&&t>a.length-1&&(a+=l(t-a.length+1)+""),r=o+a}else n||(r=r+"."+l(t))}else if(s>-1){let i=r.substr(0,s);r=i}return r;function l(e){return Math.pow(10,e).toString().replace(/1/g,"")}}}};__webpack_exports__.Z=common},17325:function(e,t,n){"use strict";n.d(t,{Pi:function(){return o.Pi},ZN:function(){return s.ZN},oR:function(){return i}});var r=n(51776),s=n(15263),o=n(93274),a=n(77595);function i(){let e=(0,r.useContext)(a.Z);return e}},66320:function(e,t,n){"use strict";n.d(t,{U2:function(){return m},hQ:function(){return p},v_:function(){return _}});var r=n(37746),s=n(48196),o=n(53488),a=n(58018);n(69844);var i=n(87057),l=n(86465),c=n(72249);r.Z.defaults.timeout=1e4,r.Z.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8";let d={};{let u=(0,c.Z)();
1d={appName:navigator.appName,appCodeName:navigator.appCodeName,appVersion:navigator.appVersion,userAgent:navigator.userAgent,cookieEnabled:navigator.cookieEnabled,platform:navigator.platform,userLanguage:navigator.language,vendor:navigator.vendor,onLine:navigator.onLine,product:navigator.product,productSub:navigator.productSub,mimeTypesLen:navigator.mimeTypes.length,pluginsLen:navigator.plugins.length,javaEnbled:navigator.javaEnabled(),windowScreenWidth:window.screen.width,windowScreenHeight:window.screen.height,windowColorDepth:window.screen.colorDepth,declarelan:l.Z.mapLangToLocaleId(s.Z.get("lang"))||"id_ID",duid:u},window.currencyexchange||(d.token=s.Z.get(i.r)||"")}r.Z.interceptors.request.use(e=>(e.params=e.params?Object.assign({},d,e.params):d,e),e=>{window.sentryHelper&&window.sentryHelper.reportApiError(e)}),r.Z.interceptors.response.use(e=>{if(!e)return!1;if(200!==e.status)return Promise.reject(e);if(200===e.status){let{code:t,data:n}=e.data}return Promise.resolve(e)},e=>{var t;return window.sentryHelper&&window.sentryHelper.reportApiError(e),(null==e?void 0:null===(t=e.message)||void 0===t?void 0:t.includes("timeout"))&&(0,a.A)({type:"error",msg:"Network timeout please refresh and try again!"}),Promise.reject(e)});let m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((s,o)=>{r.Z.get(e,{params:t,headers:n}).then(e=>{e?s(e.data):o(e)}).catch(e=>{o(e)})})},_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((s,a)=>{r.Z.post(e,o.Z.stringify(t,{indices:!1}),{headers:n}).then(e=>{e&&s(e.data)}).catch(e=>{a(e)})})},p=function(e,t,n){return new Promise((s,o)=>{(0,r.Z)({url:e,method:"post",headers:n,data:t}).then(e=>{e&&s(e.data)}).catch(e=>{o(e)})})};t.ZP={get:m,post:_,postArr:p,publicParams:d}},75152:function(e,t){"use strict";function n(e,t){try{window.sensors&&"function"==typeof window.sensors.track&&window.sensors.track(e,t),"function"==typeof window.gtag&&(t&&"string"==typeof t&&(t={event_parameters:t}),window.gtag("event",e,t))}catch(n){console.error("Error in sendEvent: ".concat(n.message),{event_name:e,event_parameters:t,error:n})}}t.Z=n},71136:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(36734);n(51776);var s=n(6425),o=n.n(s),a=n(86880),i=n(38606),l=n.n(i);function c(e){let{t,lang:n}=(0,a.Z)("trade"),{cancelCb:s,title:i,tips:c,sure:d}=e;return(0,r.jsx)("div",{children:(0,r.jsx)("div",{className:l().kyc_modal_wrap,children:(0,r.jsxs)("div",{className:l().kyc_modal,children:[(0,r.jsxs)("div",{className:l().title,children:[null!=i?i:t("kycLint"),(0,r.jsx)("div",{className:l().close,onClick:s})]}),(0,r.jsx)("div",{className:l().subtitle,children:null!=c?c:t("kycTips")}),(0,r.jsxs)("div",{className:l().contant,children:[(0,r.jsxs)("div",{className:l().item,children:[(0,r.jsx)("a",{href:"https://apps.apple.com/id/app/bittime/id1641059360",target:"_blank",rel:"noopener noreferrer",children:(0,r.jsxs)("div",{className:l().item_left,children:[(0,r.jsx)("div",{className:l().apple}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:l().down,children:t("kycAppTips")}),(0,r.jsx)("div",{className:l().app,children:"App Store"})]})]})}),(0,r.jsx)("a",{href:"https://play.google.com/store/apps/details?id=com.bittime.currency.exchange&pli=1",target:"_blank",rel:"noopener noreferrer",children:(0,r.jsxs)("div",{className:o()([l().item_left,l().line]),children:[(0,r.jsx)("div",{className:l().google}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:l().down,children:t("kycGoogleTips")}),(0,r.jsx)("div",{className:l().app,children:"Google Play"})]})]})})]}),(0,r.jsx)("div",{className:l().item,children:(0,r.jsxs)("div",{className:l().item_right,children:[(0,r.jsx)("div",{className:l().qrcode}),(0,r.jsx)("div",{className:l().title,children:t("kycQRCode")})]})})]}),(0,r.jsx)("div",{className:l().btn,onClick:s,children:null!=d?d:t("kycSure")})]})})})}},77733:function(e){e.exports={box:"Box_box__fLrAP",sm:"Box_sm__Bec0D",md:"Box_md__TRv9k",lg:"Box_lg__6vsjY"}},71069:function(e){e.exports={component:"loading_component__Dl3uy",loader:"loading_loader__URhEN",rotation:"loading_rotation__3tkdC",animloader:"loading_animloader__PP1q_"}},31024:function(e){e.exports={modal:"modal_modal__9T95U",modalmask:"modal_modalmask__KQLcG",modalheader:"modal_modalheader__PeigR",title:"modal_title__dBAkg",closeBtn:"modal_closeBtn__f2IPv","icon-close":"modal_icon-close__ziVHW",backBtn:"modal_backBtn__xq1_K",modalcontent:"modal_modalcontent__CXuRE",modalfooter:"modal_modalfooter__FJCXG",modalbtn:"modal_modalbtn__yDBsd",modalbtncancel:"modal_modalbtncancel__7KgmQ",modalbtnok:"modal_modalbtnok__CB20L",disabled:"modal_disabled__MxXa7"}},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"}},48272:function(e){e.exports={component:"toast_component__13Yv6",move:"toast_move__yCf01",toast:"toast_toast__IhOCu",toast_msg:"toast_toast_msg__YZJM3",toast_success:"toast_toast_success__xtyJK",toast_warn:"toast_toast_warn__UYZgz",toast_info:"toast_toast_info__iV0_9",toast_error:"toast_toast_error__Ntkjl"}},12534:function(e){e.exports={tooltips_wrap:"tooltips_tooltips_wrap__Q20KT",tips:"tooltips_tips__GYO9I"}}
1,2382:function(e){e.exports={component:"chart_component__yIN4B",tabs:"chart_tabs__b9_qX",current:"chart_current__hntRr",container:"chart_container__KrBEJ"}},35845:function(e){e.exports={component:"kline_component__Ujekq",header:"kline_header__jBHdc",header_interval:"kline_header_interval__Sl4Jn",current:"kline_current__I9Wsv",header_more:"kline_header_more__HP0uq",header_more_btn:"kline_header_more_btn__oFlv_",header_more_list:"kline_header_more_list__d0gMQ",selected:"kline_selected__ZeDVi",header_tool:"kline_header_tool__MtFiy",container:"kline_container__yn2F9"}},22776:function(e){e.exports={tradeWrap:"trade_tradeWrap__apA4D",left:"trade_left__o6eHu",middle:"trade_middle__qfomN",center:"trade_center__W9KdZ",right:"trade_right__jeXvy",list:"trade_list__uI0R3","box-sizing":"trade_box-sizing__c0m7k",rose:"trade_rose__EcEKp",fall:"trade_fall__TR3fx",title:"trade_title__FacDJ",pankou:"trade_pankou__kU3aK",tabs:"trade_tabs__qpYX8",current:"trade_current___zATE",coin:"trade_coin__b1J8m","title-min":"trade_title-min__Ma88A",lists:"trade_lists__zL7Iq","col-1":"trade_col-1__9e_xA","col-2":"trade_col-2__9I07L","col-3":"trade_col-3__2J04S",theader:"trade_theader__UacQo",tbody:"trade_tbody__lpy1Z",md_tradeWrap:"trade_md_tradeWrap__WqbL2",tab:"trade_tab___TaED",active:"trade_active__F158D",md_tab_contant_item:"trade_md_tab_contant_item__OW5_x",md_none:"trade_md_none__WwZbu",md_block:"trade_md_block__lyhsK",md_orders_list:"trade_md_orders_list__TKenW",md_bottom:"trade_md_bottom___HboD",md_btn_buy:"trade_md_btn_buy__Ccf5_",md_btn_sell:"trade_md_btn_sell__vV9Nb",md_btn_login:"trade_md_btn_login__ZAT7p",md_btn_res:"trade_md_btn_res__FRFcS",md_menu:"trade_md_menu__dEgkf",md_menu_visible:"trade_md_menu_visible__sQuSk",md_menu_root:"trade_md_menu_root__mj67h",md_menu_root_visible:"trade_md_menu_root_visible__UTTS5",md_menuCloseWrap:"trade_md_menuCloseWrap__43XwV",md_menuClose:"trade_md_menuClose__ZcUMb",md_menu_tabs:"trade_md_menu_tabs__tk6ch",md_menu_tab_buy:"trade_md_menu_tab_buy__4zvsc",md_menu_tab_buy_active:"trade_md_menu_tab_buy_active__G2PiF",md_menu_tab_sell:"trade_md_menu_tab_sell__KJN_M",md_menu_tab_sell_active:"trade_md_menu_tab_sell_active__XFub_",md_market:"trade_md_market__In0ph",ms_cancel_tabs:"trade_ms_cancel_tabs__81fGa",ms_market:"trade_ms_market__rRt_e",ms_market_visible:"trade_ms_market_visible__jb38K",ms_market_root:"trade_ms_market_root__Ht_Nc",ms_market_root_visible:"trade_ms_market_root_visible__zvAmc",ms_market_tabs:"trade_ms_market_tabs__3osMn"}},36460:function(e){e.exports={component:"market_component__dEZ3p",filter:"market_filter__X_rF6",filterName:"market_filterName__t6dJx",searchInput:"market_searchInput__aL_uL",clear:"market_clear__HSXpP",filterSwitch:"market_filterSwitch__9vFfX","icon-select":"market_icon-select__jg9_X",boxSizing:"market_boxSizing__EGOp8",title:"market_title__vOWsk",tabs:"market_tabs__RnsVy",cfav:"market_cfav___23KH",coin:"market_coin__TLC_V",titleScroll:"market_titleScroll__s_MNi",all:"market_all__cs3d3",current:"market_current__TOLqe",liItem:"market_liItem__z0pMY",lists:"market_lists__C5OWd",theader:"market_theader__On3Fl",col1:"market_col1__Wh1ql",coinName:"market_coinName__951GZ",col2:"market_col2__nVZR9",col3:"market_col3__yFVSp",value:"market_value__Bj7Ib",col4:"market_col4__dUZhF",sort:"market_sort__Wou4j",asc:"market_asc__bJtLJ",desc:"market_desc__Fjpl4",sort1:"market_sort1__RIUed",tbody:"market_tbody__9oWJI","icon-star":"market_icon-star__6jvae",rose:"market_rose__70TEO",fall:"market_fall__OM4P0",fav:"market_fav__eyCop"}},75056:function(e){e.exports={pointWrapper:"mining-points_pointWrapper__5Buz1",pointEntry:"mining-points_pointEntry__bVlFj",pointIcon:"mining-points_pointIcon__EOe5x",pointTip:"mining-points_pointTip__i3IFX",close:"mining-points_close__kUYbT"}},36311:function(e){e.exports={orderBookWrap:"orderbook_orderBookWrap__EaBnC",title:"orderbook_title__7hPxw",pankou:"orderbook_pankou__yTJac",switch:"orderbook_switch__CZqI6",decimals:"orderbook_decimals__Er3XO",current:"orderbook_current__VeGTN",dropdown:"orderbook_dropdown__PnD1i",iconfont:"orderbook_iconfont__sRYAu",dropdownlist:"orderbook_dropdownlist__uVAx6",lists:"orderbook_lists__l797g",col1:"orderbook_col1__KfQjJ",col2:"orderbook_col2__PFANZ",col3:"orderbook_col3__NJnAk",fall:"orderbook_fall__I2LsJ",rose:"orderbook_rose__KNW7k",theader:"orderbook_theader__GdNVl",tbody:"orderbook_tbody__r9WCp",price:"orderbook_price__FmhsI","text-up":"orderbook_text-up__BMKkp","text-down":"orderbook_text-down__a9axz",networth:"orderbook_networth__7V3OM",rorder:"orderbook_rorder__7x1U3",yorder:"orderbook_yorder__yjpFH",lmask:"orderbook_lmask__46XtF",progress:"orderbook_progress__W4qzR",progressAsk:"orderbook_progressAsk__s_GPd",progressBuy:"orderbook_progressBuy__uKo8_",scroll:"orderbook_scroll__EFOTn",convert:"orderbook_convert__hSDOa",clearFix:"orderbook_clearFix__4PBIn",md_scroll:"orderbook_md_scroll__XFLji"}},92561:function(e){e.exports={component:"orders_component__tR0fZ","orderform-box":"orders_orderform-box__PKplC","orderform-title":"orders_orderform-title__it9eS",amount:"orders_amount__9Uwzi","orderform-input"
1:"orders_orderform-input__RDzfK","orderform-input-name":"orders_orderform-input-name__Np9yH","orderform-input-value":"orders_orderform-input-value__GZ0_X",convert:"orders_convert__WIwfH","orderform-input-coin":"orders_orderform-input-coin__Qognt","orderform-progress":"orders_orderform-progress__mD_4d",buy:"orders_buy__gSGqd","progress-number":"orders_progress-number__2rldf",sell:"orders_sell__wuUpR","progress-bar":"orders_progress-bar__Cqy33","rc-slider-disabled":"orders_rc-slider-disabled__4I12s",ffCss:"orders_ffCss__VqZDV","orderform-price":"orders_orderform-price__ofhbS","orderform-footer":"orders_orderform-footer__Jix6h","orderform-login":"orders_orderform-login__vBEp4","orderform-btn":"orders_orderform-btn__b5bx5",mt39:"orders_mt39__lIrgp",rose:"orders_rose__jYT4W",fall:"orders_fall___4tQJ","modal-content":"orders_modal-content__Q_foP","trade-confirm-header":"orders_trade-confirm-header__OMCbE","trade-confirm-footer":"orders_trade-confirm-footer__mexMc","modal-main":"orders_modal-main__ZixlD",tips:"orders_tips__X2IQy","trade-confirm-ok-btn":"orders_trade-confirm-ok-btn__b7dQB","price-input-wrapper":"orders_price-input-wrapper__VB_TQ","bbo-btn-wrapper":"orders_bbo-btn-wrapper__AJmQ5","bbo-tooltip":"orders_bbo-tooltip__R8rq_","bbo-btn":"orders_bbo-btn__a3TBs","bbo-btn-active":"orders_bbo-btn-active__BlQ6E","bbo-select-container":"orders_bbo-select-container__lxSKs","bbo-trigger":"orders_bbo-trigger__sDjM8","bbo-select-panel":"orders_bbo-select-panel__Jcv6K","bbo-option":"orders_bbo-option__Kane_","bbo-option-active":"orders_bbo-option-active__OyYS5"}},40569:function(e){e.exports={component:"orderform_component__aOzGk",mr10:"orderform_mr10__DmR35",tips:"orderform_tips__IMlfH",title:"orderform_title__2rCRc",tabs:"orderform_tabs__CApwg",actions:"orderform_actions__2HMr9","actions-btn":"orderform_actions-btn__7pWPX",long:"orderform_long__fHUKu",short:"orderform_short__m3QwV",futures:"orderform_futures__5cm48","actions-link":"orderform_actions-link__7EwLJ","etf-introduce":"orderform_etf-introduce___zFAj","orderform-content":"orderform_orderform-content__cBNkz","box-sizing":"orderform_box-sizing__znHDR",rose:"orderform_rose__2juJ2",fall:"orderform_fall__s_8Rt",pankou:"orderform_pankou__XzUeI",current:"orderform_current__EgEKp",coin:"orderform_coin__rEdC_","title-min":"orderform_title-min__kN0Sc",lists:"orderform_lists__lURhT","col-1":"orderform_col-1__KUjnJ","col-2":"orderform_col-2__oFMqA","col-3":"orderform_col-3__wREYa",theader:"orderform_theader__z9ZPi",tbody:"orderform_tbody___Y1Vd"}},38606:function(e){e.exports={kyc_modal_wrap:"modal_kyc_modal_wrap__Fkxu7",kyc_modal:"modal_kyc_modal__45tfU",title:"modal_title__w7G8B",close:"modal_close__hbbl_",subtitle:"modal_subtitle__DZEpt",contant:"modal_contant__zuwY7",item_right:"modal_item_right__72B5E",qrcode:"modal_qrcode__kIyoI",line:"modal_line__UNLMt",item_left:"modal_item_left__5P3Sh",apple:"modal_apple__Rv0JR",google:"modal_google__kSEoO",down:"modal_down__3UZna",app:"modal_app__dYFmG",btn:"modal_btn__dbsDb"}},31927:function(e){e.exports={ordersWrap:"content_ordersWrap__p5s7O",deal:"content_deal__hMi14",tips:"content_tips__pyhx6",dropdown:"content_dropdown__9lE1J",dropdowntitle:"content_dropdowntitle__5M_Vw",iconfont:"content_iconfont__VJlUF",dropdownlist:"content_dropdownlist__EabeV",current:"content_current__Jel8q",trcontent:"content_trcontent__NshLa",linkStyle:"content_linkStyle__w6QLu",rightIcon:"content_rightIcon__9iwtc","stop-state-green":"content_stop-state-green__VXKhy",trcancel:"content_trcancel__H4AaI",trdetail:"content_trdetail___luA4",detail:"content_detail__YIMuJ",detailtotal:"content_detailtotal__Ytppn",orderempty:"content_orderempty__0Mode",fall:"content_fall__GXnyD",rose:"content_rose__muhjQ",md_status_wrap:"content_md_status_wrap__B513Z",ms_header:"content_ms_header__MWnRn",ms_cancelAll:"content_ms_cancelAll__yKP8X",ms_content:"content_ms_content__2MQ4A",ms_content_title:"content_ms_content_title__hucHa",ms_content_1:"content_ms_content_1__cX4kA",ms_content_1_time:"content_ms_content_1_time__44jG_",ms_content_1_span:"content_ms_content_1_span__fbajk",ms_content_2:"content_ms_content_2__kmgs3",ms_cancel:"content_ms_cancel__UQ3ek"}},32844:function(e){e.exports={orderFromWrap:"orders_orderFromWrap__2Vvzs",title:"orders_title__KfuWQ",title_contant:"orders_title_contant__yfzOb",title_item:"orders_title_item__Tb71K",current:"orders_current__7JJfx",actions:"orders_actions__b1Bn_",actionssymbol:"orders_actionssymbol__7a4Sv",icon:"orders_icon__HhyZ0",actionsLink:"orders_actionsLink__c90t2",orderlist:"orders_orderlist__1vfEH",sm_hostory_tab:"orders_sm_hostory_tab__o1e56"}},42688:function(e){e.exports={"ticker-header-wrap":"ticker-header_ticker-header-wrap__Mgxts","ticker-header":"ticker-header_ticker-header__xoock",item:"ticker-header_item__q7Y2w",text:"ticker-header_text__g2WiD",def:"ticker-header_def__vu2CO",hb:"ticker-header_hb__vWvtc",coin:"ticker-header_coin__i_eyv",coinText:"ticker-header_coinText__9q2FC",price:"ticker-header_price__UoPPM",level:"ticker-header_level___48ol",tips:"ticker-header_tips__rr4ck",showDetail:"ticker-header_showDetail__6pcmA","currency-intro":"ticker-header_currency-intro__H8mUp","coin-detail":"ticker-header_coin-detail__3AZl0",rains:"ticker-header_rains__9HGHC",overHidden:"ticker-header_overHidden__tSXqy",subTitle:"ticker-header_subTitle__LLeBZ",goalItem:"ticker-header_goalItem__WBluq",right:"ticker-header_right__jgW0_",levelAAA:"ticker-header_levelAAA__3R6Ia",levelAA:"ticker-header_levelAA__tf5vg",levelA:"ticker-header_levelA__S_pEr",levelBBB:"ticker-header_levelBBB__4s9h9",levelBB:"ticker-header_levelBB__Z5g_G",levelB:"ticker-header_levelB__qx4YM",levelCCC:"ticker-header_levelCCC__r3lNY",levelCC:"ticker-header_levelCC__yni_F",levelC:"ticker-header_levelC__cx2mh",levelD:"ticker-header_levelD__BCUEm",theme:"ticker-header_theme__JQgYc",entry:"ticker-header_entry__dGH7T",rose:"ticker-header_rose__t3UUX",fall:"ticker-header_fall__3nWbK",ic_arr:"ticker-header_ic_arr__O9exZ",ic_arr_up:"ticker-header_ic_arr_up__7_Ef4",sm_block:"ticker-header_sm_block__thgdQ"}},45133:function(e){e.exports={wrap:"countDown_wrap___MFgj",cdcbox:"countDown_cdcbox__IS2xM",cd_content_wrapper:"countDown_cd_content_wrapper__QclhL",cd_content:"countDown_cd_content__dV_eZ",cd_info:"countDown_cd_info__GtCaR",coinPair:"countDown_coinPair__Vjgqc",cd_text:"countDown_cd_text__m15A5",cd_time:"countDown_cd_time__3_SN2",datebox:"countDown_datebox__of4VV",dpnone:"countDown_dpnone__dksqz",date_info:"countDown_date_info__OHNEe",infov:"countDown_infov__8SnAe",infov_hh:"c
1ountDown_infov_hh__XMFnS",gap:"countDown_gap__3EPRr",desc:"countDown_desc__Ex5vG",more:"countDown_more__fSDcy",switch:"countDown_switch__ZhXeG",current:"countDown_current__Hbawz",new_coin_info:"countDown_new_coin_info__8UizD",dark:"countDown_dark__EAj2V"}},98928:function(e){e.exports={tradesWrap:"trades_tradesWrap__Gc9Rh",title_min:"trades_title_min__Fw5E3",title:"trades_title__elAos",lists:"trades_lists___6Jop",theader:"trades_theader__Pznld",col1:"trades_col1__URoj9",col2:"trades_col2__BAFmU",col3:"trades_col3__hggkI",tbody:"trades_tbody__pWO_a",fall:"trades_fall__BZhMw",rose:"trades_rose__Bk30H"}}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[2655,3911,6336,1172,9774,2888,179],function(){return t(65752)}),_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.