binance-fiat-widget
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.binanceFiatWidget=t():e.binanceFiatWidget=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){(function(r){var i;!function(r){"use strict";function o(e){var t=e&&e.Promise||r.Promise,n=e&&e.XMLHttpRequest||r.XMLHttpRequest,i=r;return function(){var e=Object.create(i,{fetch:{value:void 0,writable:!0}});return function(e){if(!e.fetch){var r="URLSearchParams"in e,i="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in e,s="ArrayBuffer"in e;if(s)var p=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=function(e){return e&&DataView.prototype.isPrototypeOf(e)},c=ArrayBuffer.isView||function(e){return e&&p.indexOf(Object.prototype.toString.call(e))>-1};x.prototype.append=function(e,t){e=h(e),t=f(t);var n=this.map[e];this.map[e]=n?n+","+t:t},x.prototype.delete=function(e){delete this.map[h(e)]},x.prototype.get=function(e){return e=h(e),this.has(e)?this.map[e]:null},x.prototype.has=function(e){return this.map.hasOwnProperty(h(e))},x.prototype.set=function(e,t){this.map[h(e)]=f(t)},x.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},x.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),b(e)},x.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),b(e)},x.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),b(e)},i&&(x.prototype[Symbol.iterator]=x.prototype.entries);var l=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];S.prototype.clone=function(){return new S(this,{body:this._bodyInit})},v.call(S.prototype),v.call(L.prototype),L.prototype.clone=function(){return new L(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new x(this.headers),url:this.url})},L.error=function(){var e=new L(null,{status:0,statusText:""});return e.type="error",e};var d=[301,302,303,307,308];L.redirect=function(e,t){if(-1===d.indexOf(t))throw new RangeError("Invalid status code");return new L(null,{status:t,headers:{location:e}})},e.Headers=x,e.Request=S,e.Response=L,e.fetch=function(e,r){return new t((function(t,i){var a=new S(e,r),s=new n;s.onload=function(){var e,n,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",n=new x,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var t=e.split(":"),r=t.shift().trim();if(r){var i=t.join(":").trim();n.append(r,i)}})),n)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;t(new L(i,r))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),s.send(void 0===a._bodyInit?null:a._bodyInit)}))},e.fetch.polyfill=!0}function h(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function f(e){return"string"!=typeof e&&(e=String(e)),e}function b(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}function x(e){this.map={},e instanceof x?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function g(e){if(e.bodyUsed)return t.reject(new TypeError("Already read"));e.bodyUsed=!0}function y(e){return new t((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function w(e){var t=new FileReader,n=y(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(o&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(a&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(r&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(s&&o&&u(e))this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!s||!ArrayBuffer.prototype.isPrototypeOf(e)&&!c(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=m(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=g(this);if(e)return e;if(this._bodyBlob)return t.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return t.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?g(this)||t.resolve(this._bodyArrayBuffer):this.blob().then(w)}),this.text=function(){var e,n,r,i=g(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,n=new FileReader,r=y(n),n.readAsText(e),r;if(this._bodyArrayBuffer)return t.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return t.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(C)}),this.json=function(){return this.text().then(JSON.parse)},this}function S(e,t){var n,r,i=(t=t||{}).body;if(e instanceof S){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new x(e.headers)),this.method=e.method,this.mode=e.mode,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new x(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),l.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function C(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function L(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new x(t.headers),this.url=t.url||"",this._initBody(e)}}(void 0!==e?e:this),{fetch:e.fetch,Headers:e.Headers,Request:e.Request,Response:e.Response}}()}void 0===(i=function(){return o}.call(t,n,t,e))||(e.exports=i)}("undefined"!=typeof self?self:void 0!==r?r:this)}).call(this,n(1))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t),n.d(t,"Widget",(function(){return L})),n.d(t,"unloadWidget",(function(){return B}));var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function i(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{p(r.next(e))}catch(e){o(e)}}function s(e){try{p(r.throw(e))}catch(e){o(e)}}function p(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}p((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var a=function(){return p("div")};function s(e,t){Object.keys(t).map((function(n){e.style[n]=t[n]}))}function p(e){var t=document.createElement(e);return s(t,{boxSizing:"border-box"}),t}var u={dark:{bg:"#0B0E11",activeTabColor:"#F0B90B",tabBorder:"#848E9C",labelColor:"#FFFFFF",poweredBy:"#D8D8D8",placeholder:"#FFFFFF",inputBg:"#333333",inputBorder:"#333",coinColor:"#fff",breakColor:"#fff",boxShadow:"0px 6px 20px rgba(0, 0, 0, 0.08)",buySubmitColor:"#212833",arrowIconColor:"#fff",dropDownbg:"#EAECEF",extraLabelColor:"#848E9C"},light:{bg:"FFFFFF",activeTabColor:"#F0B90B",tabBorder:"rgba(132, 142, 156, 0.2)",labelColor:"#848E9C",poweredBy:"#848E9C",placeholder:"#848E9C",inputBg:"#ffffff",inputBorder:"rgba(132, 142, 156, 0.2)",coinColor:"#212833",breakColor:"#333",boxShadow:"0px 0px 4px rgba(0, 0, 0, 0.08), 0px 0px 4px rgba(0, 0, 0, 0.08)",buySubmitColor:"#212833",arrowIconColor:"#212833",dropDownbg:"#EAECEF",extraLabelColor:"#848E9C"}},c=n(0),l=n.n(c)()().fetch,d=console.log,h=["/api","/exchange-api/v1/public","/gateway-api/v1/public","/info-api/v1/public"],f=["/gateway-api/v1/public/authcenter/login","/gateway-api/v1/public/authcenter/auth"],b=function(e,t){return l(function(e){return"undefined"!=typeof window&&h.find((function(t){return e.startsWith(t)}))&&!f.find((function(t){return e.startsWith(t)}))?"https://i18n.bnbstatic.com"+e:e}(e),t)},x=function(e,t,n){return void 0===t&&(t=!1),i(void 0,void 0,void 0,(function(){var r,a,s,p,u,c;return o(this,(function(l){switch(l.label){case 0:n=n||{},l.label=1;case 1:return l.trys.push([1,5,,6]),r=Date.now(),[4,b(e,{})];case 2:return a=l.sent(),s=Date.now(),p=s-r,[4,(h=a,i(void 0,void 0,void 0,(function(){var e,t;return o(this,(function(n){switch(n.label){case 0:if(h.status>=200&&h.status<300)return[2,h];if(401===h.status)return[2,h];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,h.json()];case 2:throw e=n.sent(),new Error(e.message);case 3:throw n.sent(),(t=new Error(h.statusText||String(h.status))).name=String(h.status),t.response=h,t;case 4:return[2]}}))})))];case 3:return l.sent(),[4,a.json()];case 4:return u=l.sent(),t&&d("\n Request url: {"+e+"},\n duration time is "+p+",\n "+(p>500?"more than 500ms, ":"")),[2,u];case 5:throw c=l.sent(),d("\n BAD REQUEST:\n Request url: {"+e+"},\n parse ERROR is "+JSON.stringify(c)),c;case 6:return[2]}var h}))}))},g=function(e){var t=e.locale;return i(void 0,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,x("https://i18n.bnbstatic.com/i18n/api/v1/"+("out/web2.0/"+t))];case 1:return e=n.sent(),0!==Object.keys(e).length?[3,3]:[4,x("https://i18n.bnbstatic.com/i18n/api/v1/"+"out/web2.0/en")];case 2:e=n.sent(),n.label=3;case 3:return[2,["exchange-home-wantSpend","exchange-home-wantBuy","exchange-home-SearchFiat","exchange-home-SearchCrypto","exchange-home-fiatTitle","exchange-home-cryptoTitle","exchange-home-forUSResidents","exchange-home-forNonUSResidents","exchange-buySell-buyType","exchange-home-enterAmount","exchange-buySell-sellType","exchange-creditcard-poweredBy","exchange-widget-buyCryptocurrency"].reduce((function(t,n){return t[n]=e[n],t}),{})]}}))}))},y=function(e,t){return void 0===e&&(e="en"),void 0===t&&(t="https://www.binance.com"),i(void 0,void 0,void 0,(function(){var n,r;return o(this,(function(i){switch(i.label){case 0:n=[],i.label=1;case 1:return i.trys.push([1,3,,4]),[4,x(t+"/gateway-api/v1/public/fiat-channel-gateway/get-simple-selector?lang="+e,!1,{headers:{lang:e}})];case 2:return r=i.sent(),n=r.data||[],[3,4];case 3:return i.sent(),n=[],[3,4];case 4:return[2,n]}}))}))},w=function(e,t){return void 0===e&&(e="en"),void 0===t&&(t="https://www.binance.us"),i(void 0,void 0,void 0,(function(){var n,r;return o(this,(function(i){switch(i.label){case 0:n=[],i.label=1;case 1:return i.trys.push([1,3,,4]),[4,x(t+"/gateway-api/v1/public/fiat-channel-gateway/get-simple-selector?lang="+e,!1,{headers:{lang:e}})];case 2:return r=i.sent(),n=r.data||[],[3,4];case 3:return i.sent(),n=[],[3,4];case 4:return[2,n]}}))}))},m=function(e){var t=e.locale,n=void 0===t?"en":t,a=e.api_host,s=e.us_api_host,p=e.coinInfo;return i(void 0,void 0,void 0,(function(){var e,t,i,u;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),[4,g({locale:n})];case 1:return e=o.sent(),[4,y(n,a)];case 2:return t=o.sent(),[4,w(n,s)];case 3:return i=o.sent(),u=function(e,t,n){var i;if(e.isInUS)i=0;else{var o=t.buySelector.findIndex((function(e){return"USD"===e.assetCode}));i=o>0?o:0}t.buySelector.forEach((function(e){return e.isInUS=!1}));var a=n.buySelector.find((function(e){return"USD"===e.assetCode}))||{};return Object.keys(a).length>0&&t.buySelector.splice(i,0,r(r({},a),{isInUS:!0})),t}(p,t,i),[2,{i18n:e,coinList:u}];case 4:return o.sent(),[2,{i18n:{},coinList:[]}];case 5:return[2]}}))}))},v=function(e,t,n){return void 0===t&&(t={}),t[e]||n||e},S=(Object.freeze({en:"en-us",cn:"zh-cn",tw:"zh-tw",kr:"ko",ru:"ru",vn:"vi",it:"it",es:"es",de:"de",fr:"fr"}),{space:{container:{padding:"20px 16px 24px 16px"},head:{btnSpace:"8px"},input1:{mt:"18px",rightWidth:"64px",pl:"8px",pr:"9px",coinMl:"4px",height:26,labelLineHeight:"16px",space:"4px"},input2:{mt:"24px",pl:"8px",pr:"9px",labelLineHeight:"16px",height:"26px"},buySubmit:{mt:"24px"},logo:{mt:"16px",logoSpace:"4px",height:"16px"},dropDown:{height:"162px",pl:"8px"}},size:{fontSize:"12px",extraFontSize:"12px",coinFontSize:"14px",titleFontSize:"14px",tabBtn:{width:"40px",height:"20px"},buySubmit:{height:"24px"}}}),C=0,L=function(e,t){var n=!1,c=!1;C++;var l,d=null,h={locale:"en",width:(d="string"==typeof e?document.querySelector(e):e).offsetWidth||d.clientWidth||200,theme:"light",coinInfo:{fiat:"",crypto:"",isInUS:!1},urlParmas:{ref:"",us_ref:"",utm_source:""},api_host:"https://www.binance.com",us_api_host:"https://www.binance.us",skeletonScreen:!0},f=h.width,b=h.locale,x=h.theme,g=h.urlParmas,y=h.api_host,w=h.us_api_host,L=h.skeletonScreen,T=h.coinInfo;t&&(f=t.width||f,b=t.locale||b,x=t.theme||x,g=t.urlParmas||g,T=t.coinInfo||T,l=T.isInUS,y=t.api_host||y,w=t.us_api_host||w,L=void 0===t.skeletonScreen?L:t.skeletonScreen);var F,H,E,_=g.ref,I=g.us_ref,A=g.utm_source;f<200&&(f=200),f>500&&(f=500);var U={subSelector:[],assetCode:""},R={assetCode:""},z=function(e){return v(e,H)};function k(){var e=u[x],t=function(e){var t=S;return e<=300?(t.space={container:{padding:"20px 16px 24px 16px"},head:{btnSpace:"8px"},input1:{mt:"18px",rightWidth:"64px",pl:"8px",pr:"9px",coinMl:"4px",height:26,labelLineHeight:"16px",space:"4px"},input2:{mt:"24px",pl:"8px",pr:"9px",labelLineHeight:"16px",height:"26px"},buySubmit:{mt:"24px"},logo:{mt:"16px",logoSpace:"4px",height:"16px"},dropDown:{height:"162px",pl:"8px"}},t.size={fontSize:"12px",extraFontSize:"12px",coinFontSize:"12px",titleFontSize:"14px",tabBtn:{width:"40px",height:"20px"},buySubmit:{height:"24px"}}):e>300&&e<=450?(t.space={container:{padding:"32px 16px 32px 16px"},head:{btnSpace:"16px"},input1:{mt:"24px",rightWidth:"79px",pl:"16px",pr:"16px",coinMl:"8px",height:40,labelLineHeight:"18px",space:"4px"},input2:{mt:"32px",pl:"16px",pr:"16px",labelLineHeight:"18px",height:"40px"},buySubmit:{mt:"32px"},logo:{mt:"24px",logoSpace:"8px",height:"18px"},dropDown:{height:"235px",pl:"16px"}},t.size={fontSize:"14px",extraFontSize:"12px",coinFontSize:"14px",titleFontSize:"18px",tabBtn:{width:"56px",height:"32px"},buySubmit:{height:"40px"}}):(t.space={container:{padding:"32px 24px 32px 24px"},head:{btnSpace:"16px"},input1:{mt:"24px",rightWidth:"84px",pl:"16px",pr:"21px",coinMl:"8px",height:40,labelLineHeight:"18px",space:"4px"},input2:{mt:"32px",pl:"16px",pr:"21px",labelLineHeight:"18px",height:"40px"},buySubmit:{mt:"32px"},logo:{mt:"24px",logoSpace:"8px",height:"18px"},dropDown:{height:"235px",pl:"16px"}},t.size={fontSize:"14px",coinFontSize:"14px",extraFontSize:"12px",titleFontSize:"24px",tabBtn:{width:"56px",height:"32px"},buySubmit:{height:"40px"}}),t}(f),h=t.size,g=t.space,B=p("style"),k=function(){var t=a();return t.className+="binance-fiat-widget",B.innerHTML+="\n .binance-fiat-widget {\n font-family: DINNext,IBMPlexSans,Arial,PingFangSC-Regular,'Microsoft YaHei',sans-serif !important;\n }\n .binance-fiat-widget-modal {\n font-family: DINNext,IBMPlexSans,Arial,PingFangSC-Regular,'Microsoft YaHei',sans-serif !important;\n }\n ",s(t,{width:f+"px",position:"relative",left:0,right:0,borderRadius:"4px",background:e.bg,padding:g.container.padding,display:"flex",flexDirection:"column",boxSizing:"border-box",boxShadow:e.boxShadow}),t}(),j=function(){var t=a();return s(t,{display:"flex",fontSize:h.titleFontSize,color:e.coinColor,whiteSpace:"nowrap"}),t}(),M=function(){var e=a(),t=a();return s(e,{marginTop:g.input1.mt,position:"relative"}),s(t,{marginTop:g.input2.mt,cursor:"pointer"}),{input1:e,input2:t}}(),O=M.input1,D=M.input2,P=function(){var t=a(),n=a(),r={color:e.labelColor,fontSize:h.fontSize,display:"flex",textAlign:"left",justifyContent:"space-between",lineHeight:g.input1.labelLineHeight,height:g.input1.labelLineHeight};return f<245&&Object.assign(r,{width:"125%",transform:"scale(0.8)","-webkit-transform":"scale(0.8)","transform-origin-x":0,"-webkit-transform-origin-x":0}),s(t,r),s(n,r),{input1Label:t,input2Label:n}}(),V=P.input1Label,N=P.input2Label,W=function(){var t=a(),n=p("input"),i=pe(!0),o=pe();n.onkeypress=function(e){(46!=e.keyCode&&e.keyCode<48||e.keyCode>57)&&(e.returnValue=!1)},t.appendChild(n),t.appendChild(o),s(t,{display:"flex",alignItems:"center",justifyContent:"left"});var u={width:"calc(100% - "+g.input1.rightWidth+")",height:g.input1.height+"px",border:"1px solid "+e.inputBorder,backgroundColor:e.inputBg,borderRadius:"3px",marginTop:g.input1.space,paddingLeft:g.input1.pl,fontFamily:"inherit",WebkitAppearance:"none",outline:"none"};return s(n,r(r({},u),{borderTopRightRadius:0,borderBottomRightRadius:0,borderRight:"0 none",color:e.coinColor,fontWeight:500})),s(o,{boxSizing:"border-box",borderTopLeftRadius:0,borderBottomLeftRadius:0,borderleft:"0 none",color:e.coinColor,fontSize:h.coinFontSize,height:g.input1.height+"px",lineHeight:g.input1.height+"px",textAlign:"left"}),s(i,r(r({},u),{width:"100%",color:e.coinColor,fontSize:h.coinFontSize,height:g.input1.height+"px",lineHeight:g.input1.height+"px",textAlign:"left"})),n.className="binance-fiat-widget-input-focus\n binance-fiat-widget-input-active\n binance-fiat-widget-input-placeholder",B.innerText+="\n .binance-fiat-widget-input-focus:focus {\n outline: none;\n }\n .binance-fiat-widget-input-focus:active {\n outline: none;\n }\n .binance-fiat-widget-input-placeholder {\n padding: 0;\n color: "+e.placeholder+";\n font-size: "+h.fontSize+";\n }\n .binance-fiat-widget-input-coin-placeholder {\n padding: 0;\n color: #848E9C;\n font-size: 12px;\n }\n ",{input1Input:t,input2Input:i,select:o}}(),q=W.input1Input,Z=W.input2Input,G=W.select,Y=function(){var t=a();return s(t,{cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",outline:"none",fontWeight:500,fontSize:h.fontSize,lineHeight:h.buySubmit.height,backgroundColor:"#F0B90B",height:h.buySubmit.height,borderRadius:"4px",marginTop:g.buySubmit.mt,color:e.buySubmitColor}),t}(),X=function(){var e=a();return s(e,{marginTop:g.logo.mt,display:"flex",justifyContent:"center"}),e}(),J=function(){var t=a();return s(t,{fontSize:h.fontSize,marginRight:g.logo.logoSpace,color:e.poweredBy,height:g.logo.height,lineHeight:g.logo.height}),t}(),K=function(){var e=a();return s(e,{height:g.logo.height,lineHeight:g.logo.height,display:"flex",alignItems:"center"}),e.innerHTML='<svg width="70" height="14" viewBox="0 0 70 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M3.1582 7L1.58594 8.57227L0 7L1.58594 5.41406L3.1582 7ZM7 3.1582L9.70703 5.86523L11.293 4.2793L7 0L2.70703 4.29297L4.29297 5.87891L7 3.1582ZM12.4141 5.41406L10.8418 7L12.4277 8.58594L14.0137 7L12.4141 5.41406ZM7 10.8418L4.29297 8.12109L2.70703 9.70703L7 14L11.293 9.70703L9.70703 8.12109L7 10.8418ZM7 8.57227L8.58594 6.98633L7 5.41406L5.41406 7L7 8.57227ZM23.6797 8.73633V8.70898C23.6797 7.68359 23.1328 7.16406 22.2441 6.82227C22.791 6.52148 23.2559 6.0293 23.2559 5.16797V5.14062C23.2559 3.9375 22.2852 3.1582 20.7266 3.1582H17.1582V10.8281H20.8086C22.5449 10.8418 23.6797 10.1309 23.6797 8.73633ZM21.5742 5.45508C21.5742 6.0293 21.1094 6.26172 20.3574 6.26172H18.7988V4.63477H20.4668C21.1777 4.63477 21.5742 4.92188 21.5742 5.42773V5.45508ZM21.998 8.51758C21.998 9.0918 21.5469 9.35156 20.8086 9.35156H18.7988V7.66992H20.7539C21.6152 7.66992 21.998 7.98438 21.998 8.50391V8.51758ZM27.2207 10.8418V3.1582H25.5254V10.8281H27.2207V10.8418ZM36.2988 10.8418V3.1582H34.6309V7.88867L31.0352 3.1582H29.4766V10.8281H31.1445V5.96094L34.8633 10.8418H36.2988ZM45.6504 10.8418L42.3555 3.11719H40.7969L37.502 10.8418H39.2383L39.9355 9.11914H43.1758L43.873 10.8418H45.6504ZM42.5742 7.62891H40.5371L41.5625 5.14062L42.5742 7.62891ZM53.7031 10.8418V3.1582H52.0352V7.88867L48.4395 3.1582H46.8809V10.8281H48.5488V5.96094L52.2676 10.8418H53.7031ZM62.4121 9.59766L61.332 8.51758C60.7305 9.06445 60.1973 9.41992 59.3086 9.41992C57.9961 9.41992 57.0801 8.32617 57.0801 7.01367V6.97266C57.0801 5.66016 58.0098 4.58008 59.3086 4.58008C60.0742 4.58008 60.6758 4.9082 61.2773 5.44141L62.3574 4.19727C61.6465 3.5 60.7852 3.00781 59.3359 3.00781C56.9844 3.00781 55.3301 4.79883 55.3301 6.97266V7C55.3301 9.20117 57.0117 10.9512 59.2676 10.9512C60.7441 10.9648 61.6191 10.4453 62.4121 9.59766ZM69.6172 10.8418V9.33789H65.4473V7.72461H69.0703V6.2207H65.4473V4.66211H69.5625V3.1582H63.7793V10.8281H69.6172V10.8418Z" fill="#F0B90B" />\n </svg>',e}();function Q(){G.addEventListener("click",(function(e){return oe(e)}),!0),Z.addEventListener("click",(function(e){return ae(e)}),!0),Y.onclick=ue,window.addEventListener("click",(function(e){n&&oe(e),c&&ae(e)}),!0)}return X.appendChild(J),X.appendChild(K),O.appendChild(V),O.appendChild(q),D.appendChild(N),D.appendChild(Z),k.appendChild(B),k.appendChild(j),k.appendChild(O),k.appendChild(D),k.appendChild(Y),k.appendChild(X),L?(null==d||d.append(k),ee(T).then((function(){return Q()}))):ee(T).then((function(){Q(),null==d||d.append(k)}));function $(e){if("USD"===e){var t=z(l?"exchange-home-forUSResidents":"exchange-home-forNonUSResidents");V.innerHTML=z("exchange-home-wantSpend")+"<span>"+t+"</span>"}else V.innerText=z("exchange-home-wantSpend")}function ee(e){return i(this,void 0,void 0,(function(){var t,n,r,i,a,s,p;return o(this,(function(o){switch(o.label){case 0:return[4,m({locale:b,api_host:y,us_api_host:w,coinInfo:e})];case 1:return t=o.sent(),n=t.i18n,r=t.coinList,H=n,E=r,N.innerText=z("exchange-home-wantBuy"),q.children[0].placeholder=z("exchange-home-enterAmount"),J.innerText=z("exchange-creditcard-poweredBy"),j.innerText=z("exchange-widget-buyCryptocurrency"),F=E.buySelector,i=function(e,t){var n=e.fiat,r=e.crypto,i=e.isInUS,o=t.find((function(e){return e.assetCode===n&&e.isInUS===i}));return!!o&&!!o.subSelector.find((function(e){return e.assetCode===r}))}(e,F),a=F.find((function(t){return t.assetCode===e.fiat&&t.isInUS===e.isInUS})),U=i?a:F[0],ne(s=i?e.fiat:U.assetCode),$(s),R=i?ie(U.subSelector,e.crypto):U.subSelector[0],p=i?e.crypto:R.assetCode,te(F,U.subSelector,s,p),re(p),[2]}}))}))}function te(e,t,n,r){var i=G.children[1];i.innerHTML="",e.forEach((function(e){var t=se(e.assetCode,e.isInUS);e.assetCode===n&&("USD"!==n||"USD"===n&&e.isInUS===l)&&s(t,{color:"#F0B90B"}),i.appendChild(t)}));var o=Z.children[1];o.innerHTML="",t.forEach((function(e){var t=se(e.assetCode);e.assetCode===r&&s(t,{color:"#F0B90B"}),o.appendChild(t)}))}function ne(e){G.children[2].innerHTML=e}function re(e){void 0===e&&(e=""),Y.innerText=v("exchange-buySell-buyType",H)+" "+e,Z.children[2].innerHTML=e}function ie(e,t){return e.find((function(e){return e.assetCode===t}))}function oe(t){var r,i=t.target,o=i.className;if("SPAN"===i.nodeName&&(o=(null==(i=i.parentElement)?void 0:i.className)||""),/binance-fiat-widget-dropdown-item/.test(o)){var a=i.dataset.assetCode||"";r=i.dataset.isInUs,l=!(!r||"false"===r);var p=(U=F.find((function(e){return e.assetCode===a&&e.isInUS===l}))).assetCode,u=U.subSelector[0].assetCode;R=U.subSelector[0],ne(p),$(p),re(u),te(F,U.subSelector,p,u)}n=!n,s(G.children[0],{borderWidth:n?"0 4px 5px 4px":"5px 4px 0 4px",borderColor:n?"transparent transparent "+e.arrowIconColor+" transparent":e.arrowIconColor+" transparent transparent transparent"}),s(G.children[1],{display:n?"block":"none"}),t.stopPropagation()}function ae(t){var n=t.target.className;if(/binance-fiat-widget-dropdown-item/.test(n)){var r=t.target.innerText;re((R=ie(U.subSelector,r)).assetCode),te(F,U.subSelector,U.assetCode,R.assetCode)}c=!c,s(Z.children[0],{borderWidth:c?"0 4px 5px 4px":"5px 4px 0 4px",borderColor:c?"transparent transparent "+e.arrowIconColor+" transparent":e.arrowIconColor+" transparent transparent transparent"}),s(Z.children[1],{display:c?"block":"none"}),t.stopPropagation()}function se(t,n){var r=a();if("USD"===t){var i=z(n?"exchange-home-forUSResidents":"exchange-home-forNonUSResidents");r.innerHTML=t+'<span style="font-size: '+h.extraFontSize+"; color: "+e.extraLabelColor+'; margin-left: 4px;">'+i+"</span>"}else r.innerText=t;return s(r,{display:"flex",alignItems:"center",fontSize:h.coinFontSize,color:e.buySubmitColor,textAlign:"left",paddingLeft:"8px",height:"40px",lineHeight:"40px"}),r.dataset.isInUs=n,r.dataset.assetCode=t,r.className+="binance-fiat-widget-dropdown-item",B.innerText+="\n .binance-fiat-widget-dropdown-item:hover {\n background: #EAECEF;\n font-weight: 500;\n }\n ",r}function pe(t){var r,i=a(),o=a(),c=(s(r=p("i"),{width:0,height:0,borderWidth:n?"0 4px 5px 4px":"5px 4px 0 4px",borderStyle:"solid",borderColor:n?"transparent transparent "+e.arrowIconColor+" transparent":e.arrowIconColor+" transparent transparent transparent",borderRadius:"2px",position:"absolute",right:"12px",top:(g.input1.height-5)/2+"px"}),r),l=function(){var e=a();return s(e,{width:"184px",minHeight:"40px",maxHeight:f<=300?"160px":"235px",background:"#fff",boxShadow:"0px 0px 20px rgba(0, 0, 0, 0.1)",borderRadius:"4px",position:"absolute",zIndex:9,top:g.input1.height+2+"px",right:0,overflowY:"auto",display:"none",fontWeight:"normal"}),e}();return s(i,{width:g.input1.rightWidth,height:g.input1.height+"px",border:"1px solid "+e.inputBorder,backgroundColor:e.inputBg,borderRadius:"3px",borderLeft:"0 none",paddingLeft:g.input1.coinMl,marginTop:g.input1.space,position:"relative",cursor:"pointer",fontWeight:f>300?500:"normal"}),t||(i.className="binance-fiat-widget-select-before-"+C+" "+("dark"===x?"binance-fiat-widget-select-dark":"binance-fiat-widget-select-light"),B.innerText+="\n .binance-fiat-widget-select-before-"+C+":before {\n content: '';\n height: 16px;\n display: inline-block;\n position: absolute;\n left: -1px;\n width: 1px;\n opacity: 0.2;\n top: "+(g.input1.height-16)/2+"px;\n }\n .binance-fiat-widget-select-dark:before {\n background: "+u.dark.breakColor+";\n }\n .binance-fiat-widget-select-light:before {\n background: "+u.light.breakColor+";\n }\n "),i.appendChild(c),i.appendChild(l),i.appendChild(o),i}function ue(){if(U&&U.assetCode&&R&&R.assetCode){if("CNY"===U.assetCode)window.open("https://c2c.binancezh.com/");else{var e=q.children[0].value,t=l&&"USD"===U.assetCode,n=(t?"https://www.binance.us":"https://www.binance.com")+"/"+(t?"en":b)+"/buy-sell-crypto?fiat="+U.assetCode+"&crypto="+R.assetCode+"&amount="+e,r=l?I:_;r&&(n+="&ref="+r),A&&(n+="&utm_source="+A),window.open(n)}}}}return k(),{setTheme:function(e){return x=e,this},setLocale:function(e){return b=e,this},render:function(){return B(),k()}}},B=function(){document.querySelectorAll(".binance-fiat-widget").forEach((function(e){return e.remove()})),document.querySelectorAll(".binance-fiat-widget-modal").forEach((function(e){return e.remove()}))}}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.binanceFiatWidget=t():e.binanceFiatWidget=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){(function(r){var i;!function(r){"use strict";function o(e){var t=e&&e.Promise||r.Promise,n=e&&e.XMLHttpRequest||r.XMLHttpRequest,i=r;return function(){var e=Object.create(i,{fetch:{value:void 0,writable:!0}});return function(e){if(!e.fetch){var r="URLSearchParams"in e,i="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in e,s="ArrayBuffer"in e;if(s)var p=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=function(e){return e&&DataView.prototype.isPrototypeOf(e)},c=ArrayBuffer.isView||function(e){return e&&p.indexOf(Object.prototype.toString.call(e))>-1};x.prototype.append=function(e,t){e=h(e),t=f(t);var n=this.map[e];this.map[e]=n?n+","+t:t},x.prototype.delete=function(e){delete this.map[h(e)]},x.prototype.get=function(e){return e=h(e),this.has(e)?this.map[e]:null},x.prototype.has=function(e){return this.map.hasOwnProperty(h(e))},x.prototype.set=function(e,t){this.map[h(e)]=f(t)},x.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},x.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),b(e)},x.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),b(e)},x.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),b(e)},i&&(x.prototype[Symbol.iterator]=x.prototype.entries);var l=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];S.prototype.clone=function(){return new S(this,{body:this._bodyInit})},v.call(S.prototype),v.call(L.prototype),L.prototype.clone=function(){return new L(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new x(this.headers),url:this.url})},L.error=function(){var e=new L(null,{status:0,statusText:""});return e.type="error",e};var d=[301,302,303,307,308];L.redirect=function(e,t){if(-1===d.indexOf(t))throw new RangeError("Invalid status code");return new L(null,{status:t,headers:{location:e}})},e.Headers=x,e.Request=S,e.Response=L,e.fetch=function(e,r){return new t((function(t,i){var a=new S(e,r),s=new n;s.onload=function(){var e,n,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",n=new x,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var t=e.split(":"),r=t.shift().trim();if(r){var i=t.join(":").trim();n.append(r,i)}})),n)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;t(new L(i,r))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),s.send(void 0===a._bodyInit?null:a._bodyInit)}))},e.fetch.polyfill=!0}function h(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function f(e){return"string"!=typeof e&&(e=String(e)),e}function b(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}function x(e){this.map={},e instanceof x?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function g(e){if(e.bodyUsed)return t.reject(new TypeError("Already read"));e.bodyUsed=!0}function y(e){return new t((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function w(e){var t=new FileReader,n=y(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(o&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(a&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(r&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(s&&o&&u(e))this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!s||!ArrayBuffer.prototype.isPrototypeOf(e)&&!c(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=m(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=g(this);if(e)return e;if(this._bodyBlob)return t.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return t.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?g(this)||t.resolve(this._bodyArrayBuffer):this.blob().then(w)}),this.text=function(){var e,n,r,i=g(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,n=new FileReader,r=y(n),n.readAsText(e),r;if(this._bodyArrayBuffer)return t.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return t.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(C)}),this.json=function(){return this.text().then(JSON.parse)},this}function S(e,t){var n,r,i=(t=t||{}).body;if(e instanceof S){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new x(e.headers)),this.method=e.method,this.mode=e.mode,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new x(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),l.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function C(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function L(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new x(t.headers),this.url=t.url||"",this._initBody(e)}}(void 0!==e?e:this),{fetch:e.fetch,Headers:e.Headers,Request:e.Request,Response:e.Response}}()}void 0===(i=function(){return o}.call(t,n,t,e))||(e.exports=i)}("undefined"!=typeof self?self:void 0!==r?r:this)}).call(this,n(1))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t),n.d(t,"Widget",(function(){return L})),n.d(t,"unloadWidget",(function(){return B}));var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function i(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{p(r.next(e))}catch(e){o(e)}}function s(e){try{p(r.throw(e))}catch(e){o(e)}}function p(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}p((r=r.apply(e,t||[])).next())}))}function o(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var a=function(){return p("div")};function s(e,t){Object.keys(t).map((function(n){e.style[n]=t[n]}))}function p(e){var t=document.createElement(e);return s(t,{boxSizing:"border-box"}),t}var u={dark:{bg:"#0B0E11",activeTabColor:"#F0B90B",tabBorder:"#848E9C",labelColor:"#FFFFFF",poweredBy:"#D8D8D8",placeholder:"#FFFFFF",inputBg:"#333333",inputBorder:"#333",coinColor:"#fff",breakColor:"#fff",boxShadow:"0px 6px 20px rgba(0, 0, 0, 0.08)",buySubmitColor:"#212833",arrowIconColor:"#fff",dropDownbg:"#EAECEF",extraLabelColor:"#848E9C"},light:{bg:"FFFFFF",activeTabColor:"#F0B90B",tabBorder:"rgba(132, 142, 156, 0.2)",labelColor:"#848E9C",poweredBy:"#848E9C",placeholder:"#848E9C",inputBg:"#ffffff",inputBorder:"rgba(132, 142, 156, 0.2)",coinColor:"#212833",breakColor:"#333",boxShadow:"0px 0px 4px rgba(0, 0, 0, 0.08), 0px 0px 4px rgba(0, 0, 0, 0.08)",buySubmitColor:"#212833",arrowIconColor:"#212833",dropDownbg:"#EAECEF",extraLabelColor:"#848E9C"}},c=n(0),l=n.n(c)()().fetch,d=console.log,h=["/api","/exchange-api/v1/public","/gateway-api/v1/public","/info-api/v1/public"],f=["/gateway-api/v1/public/authcenter/login","/gateway-api/v1/public/authcenter/auth"],b=function(e,t){return l(function(e){return"undefined"!=typeof window&&h.find((function(t){return e.startsWith(t)}))&&!f.find((function(t){return e.startsWith(t)}))?"https://i18n.bnbstatic.com"+e:e}(e),t)},x=function(e,t,n){return void 0===t&&(t=!1),i(void 0,void 0,void 0,(function(){var r,a,s,p,u,c;return o(this,(function(l){switch(l.label){case 0:n=n||{},l.label=1;case 1:return l.trys.push([1,5,,6]),r=Date.now(),[4,b(e,{})];case 2:return a=l.sent(),s=Date.now(),p=s-r,[4,(h=a,i(void 0,void 0,void 0,(function(){var e,t;return o(this,(function(n){switch(n.label){case 0:if(h.status>=200&&h.status<300)return[2,h];if(401===h.status)return[2,h];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,h.json()];case 2:throw e=n.sent(),new Error(e.message);case 3:throw n.sent(),(t=new Error(h.statusText||String(h.status))).name=String(h.status),t.response=h,t;case 4:return[2]}}))})))];case 3:return l.sent(),[4,a.json()];case 4:return u=l.sent(),t&&d("\n Request url: {"+e+"},\n duration time is "+p+",\n "+(p>500?"more than 500ms, ":"")),[2,u];case 5:throw c=l.sent(),d("\n BAD REQUEST:\n Request url: {"+e+"},\n parse ERROR is "+JSON.stringify(c)),c;case 6:return[2]}var h}))}))},g=function(e){var t=e.locale;return i(void 0,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,x("https://i18n.bnbstatic.com/i18n/api/v1/"+("out/web2.0/"+t))];case 1:return e=n.sent(),0!==Object.keys(e).length?[3,3]:[4,x("https://i18n.bnbstatic.com/i18n/api/v1/"+"out/web2.0/en")];case 2:e=n.sent(),n.label=3;case 3:return[2,["exchange-home-wantSpend","exchange-home-wantBuy","exchange-home-SearchFiat","exchange-home-SearchCrypto","exchange-home-fiatTitle","exchange-home-cryptoTitle","exchange-home-forUSResidents","exchange-home-forNonUSResidents","exchange-buySell-buyType","exchange-home-enterAmount","exchange-buySell-sellType","exchange-creditcard-poweredBy","exchange-widget-buyCryptocurrency"].reduce((function(t,n){return t[n]=e[n],t}),{})]}}))}))},y=function(e,t){return void 0===e&&(e="en"),void 0===t&&(t="https://www.binance.com"),i(void 0,void 0,void 0,(function(){var n,r;return o(this,(function(i){switch(i.label){case 0:n=[],i.label=1;case 1:return i.trys.push([1,3,,4]),[4,x(t+"/gateway-api/v1/public/fiat-channel-gateway/get-simple-selector?lang="+e,!1,{headers:{lang:e}})];case 2:return r=i.sent(),n=r.data||[],[3,4];case 3:return i.sent(),n=[],[3,4];case 4:return[2,n]}}))}))},w=function(e,t){return void 0===e&&(e="en"),void 0===t&&(t="https://www.binance.us"),i(void 0,void 0,void 0,(function(){var n,r;return o(this,(function(i){switch(i.label){case 0:n=[],i.label=1;case 1:return i.trys.push([1,3,,4]),[4,x(t+"/gateway-api/v1/public/fiat-channel-gateway/get-simple-selector?lang="+e,!1,{headers:{lang:e}})];case 2:return r=i.sent(),n=r.data||[],[3,4];case 3:return i.sent(),n=[],[3,4];case 4:return[2,n]}}))}))},m=function(e){var t=e.locale,n=void 0===t?"en":t,a=e.api_host,s=e.us_api_host,p=e.coinInfo;return i(void 0,void 0,void 0,(function(){var e,t,i,u;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),[4,g({locale:n})];case 1:return e=o.sent(),[4,y(n,a)];case 2:return t=o.sent(),[4,w(n,s)];case 3:return i=o.sent(),u=function(e,t,n){var i;if(e.isInUS)i=0;else{var o=t.buySelector.findIndex((function(e){return"USD"===e.assetCode}));i=o>0?o:0}t.buySelector.forEach((function(e){return e.isInUS=!1}));var a=n.buySelector.find((function(e){return"USD"===e.assetCode}))||{};return Object.keys(a).length>0&&t.buySelector.splice(i,0,r(r({},a),{isInUS:!0})),t}(p,t,i),[2,{i18n:e,coinList:u}];case 4:return o.sent(),[2,{i18n:{},coinList:[]}];case 5:return[2]}}))}))},v=function(e,t,n){return void 0===t&&(t={}),t[e]||n||e},S=(Object.freeze({en:"en-us",cn:"zh-cn",tw:"zh-tw",kr:"ko",ru:"ru",vn:"vi",it:"it",es:"es",de:"de",fr:"fr"}),{space:{container:{padding:"20px 16px 24px 16px"},head:{btnSpace:"8px"},input1:{mt:"18px",rightWidth:"64px",pl:"8px",pr:"9px",coinMl:"4px",height:26,labelLineHeight:"16px",space:"4px"},input2:{mt:"24px",pl:"8px",pr:"9px",labelLineHeight:"16px",height:"26px"},buySubmit:{mt:"24px"},logo:{mt:"16px",logoSpace:"4px",height:"16px"},dropDown:{height:"162px",pl:"8px"}},size:{fontSize:"12px",extraFontSize:"12px",coinFontSize:"14px",titleFontSize:"14px",tabBtn:{width:"40px",height:"20px"},buySubmit:{height:"24px"}}}),C=0,L=function(e,t){var n=!1,c=!1;C++;var l,d=null,h={locale:"en",width:(d="string"==typeof e?document.querySelector(e):e).offsetWidth||d.clientWidth||200,theme:"light",coinInfo:{fiat:"",crypto:"",isInUS:!1},urlParmas:{ref:"",us_ref:"",utm_source:""},api_host:"https://www.binance.com",us_api_host:"https://www.binance.us",skeletonScreen:!0},f=h.width,b=h.locale,x=h.theme,g=h.urlParmas,y=h.api_host,w=h.us_api_host,L=h.skeletonScreen,T=h.coinInfo;t&&(f=t.width||f,b=t.locale||b,x=t.theme||x,g=t.urlParmas||g,T=t.coinInfo||T,l=T.isInUS,y=t.api_host||y,w=t.us_api_host||w,L=void 0===t.skeletonScreen?L:t.skeletonScreen);var F,H,E,_=g.ref,I=g.us_ref,A=g.utm_source;f<200&&(f=200),f>500&&(f=500);var U={subSelector:[],assetCode:""},R={assetCode:""},z=function(e){return v(e,H)};function k(){var e=u[x],t=function(e){var t=S;return e<=300?(t.space={container:{padding:"20px 16px 24px 16px"},head:{btnSpace:"8px"},input1:{mt:"18px",rightWidth:"64px",pl:"8px",pr:"9px",coinMl:"4px",height:26,labelLineHeight:"16px",space:"4px"},input2:{mt:"24px",pl:"8px",pr:"9px",labelLineHeight:"16px",height:"26px"},buySubmit:{mt:"24px"},logo:{mt:"16px",logoSpace:"4px",height:"16px"},dropDown:{height:"162px",pl:"8px"}},t.size={fontSize:"12px",extraFontSize:"12px",coinFontSize:"12px",titleFontSize:"14px",tabBtn:{width:"40px",height:"20px"},buySubmit:{height:"24px"}}):e>300&&e<=450?(t.space={container:{padding:"32px 16px 32px 16px"},head:{btnSpace:"16px"},input1:{mt:"24px",rightWidth:"79px",pl:"16px",pr:"16px",coinMl:"8px",height:40,labelLineHeight:"18px",space:"4px"},input2:{mt:"32px",pl:"16px",pr:"16px",labelLineHeight:"18px",height:"40px"},buySubmit:{mt:"32px"},logo:{mt:"24px",logoSpace:"8px",height:"18px"},dropDown:{height:"235px",pl:"16px"}},t.size={fontSize:"14px",extraFontSize:"12px",coinFontSize:"14px",titleFontSize:"18px",tabBtn:{width:"56px",height:"32px"},buySubmit:{height:"40px"}}):(t.space={container:{padding:"32px 24px 32px 24px"},head:{btnSpace:"16px"},input1:{mt:"24px",rightWidth:"84px",pl:"16px",pr:"21px",coinMl:"8px",height:40,labelLineHeight:"18px",space:"4px"},input2:{mt:"32px",pl:"16px",pr:"21px",labelLineHeight:"18px",height:"40px"},buySubmit:{mt:"32px"},logo:{mt:"24px",logoSpace:"8px",height:"18px"},dropDown:{height:"235px",pl:"16px"}},t.size={fontSize:"14px",coinFontSize:"14px",extraFontSize:"12px",titleFontSize:"24px",tabBtn:{width:"56px",height:"32px"},buySubmit:{height:"40px"}}),t}(f),h=t.size,g=t.space,B=p("style"),k=function(){var t=a();return t.className+="binance-fiat-widget",B.innerHTML+="\n .binance-fiat-widget {\n font-family: DINNext,IBMPlexSans,Arial,PingFangSC-Regular,'Microsoft YaHei',sans-serif !important;\n }\n .binance-fiat-widget-modal {\n font-family: DINNext,IBMPlexSans,Arial,PingFangSC-Regular,'Microsoft YaHei',sans-serif !important;\n }\n ",s(t,{width:f+"px",position:"relative",left:0,right:0,borderRadius:"4px",background:e.bg,padding:g.container.padding,display:"flex",flexDirection:"column",boxSizing:"border-box",boxShadow:e.boxShadow}),t}(),j=function(){var t=a();return s(t,{display:"flex",fontSize:h.titleFontSize,color:e.coinColor,whiteSpace:"nowrap"}),t}(),M=function(){var e=a(),t=a();return s(e,{marginTop:g.input1.mt,position:"relative"}),s(t,{marginTop:g.input2.mt,cursor:"pointer"}),{input1:e,input2:t}}(),O=M.input1,D=M.input2,P=function(){var t=a(),n=a(),r={color:e.labelColor,fontSize:h.fontSize,display:"flex",textAlign:"left",justifyContent:"space-between",lineHeight:g.input1.labelLineHeight,height:g.input1.labelLineHeight};return f<245&&Object.assign(r,{width:"125%",transform:"scale(0.8)","-webkit-transform":"scale(0.8)","transform-origin-x":0,"-webkit-transform-origin-x":0}),s(t,r),s(n,r),{input1Label:t,input2Label:n}}(),V=P.input1Label,N=P.input2Label,W=function(){var t=a(),n=p("input"),i=pe(!0),o=pe();n.onkeypress=function(e){(46!=e.keyCode&&e.keyCode<48||e.keyCode>57)&&(e.returnValue=!1)},t.appendChild(n),t.appendChild(o),s(t,{display:"flex",alignItems:"center",justifyContent:"left"});var u={width:"calc(100% - "+g.input1.rightWidth+")",height:g.input1.height+"px",border:"1px solid "+e.inputBorder,backgroundColor:e.inputBg,borderRadius:"3px",marginTop:g.input1.space,paddingLeft:g.input1.pl,fontFamily:"inherit",WebkitAppearance:"none",outline:"none"};return s(n,r(r({},u),{borderTopRightRadius:0,borderBottomRightRadius:0,borderRight:"0 none",color:e.coinColor,fontWeight:500})),s(o,{boxSizing:"border-box",borderTopLeftRadius:0,borderBottomLeftRadius:0,borderleft:"0 none",color:e.coinColor,fontSize:h.coinFontSize,height:g.input1.height+"px",lineHeight:g.input1.height+"px",textAlign:"left"}),s(i,r(r({},u),{width:"100%",color:e.coinColor,fontSize:h.coinFontSize,height:g.input1.height+"px",lineHeight:g.input1.height+"px",textAlign:"left"})),n.className="binance-fiat-widget-input-focus\n binance-fiat-widget-input-active\n binance-fiat-widget-input-placeholder",B.innerText+="\n .binance-fiat-widget-input-focus:focus {\n outline: none;\n }\n .binance-fiat-widget-input-focus:active {\n outline: none;\n }\n .binance-fiat-widget-input-placeholder {\n padding: 0;\n color: "+e.placeholder+";\n font-size: "+h.fontSize+";\n }\n .binance-fiat-widget-input-coin-placeholder {\n padding: 0;\n color: #848E9C;\n font-size: 12px;\n }\n ",{input1Input:t,input2Input:i,select:o}}(),q=W.input1Input,Z=W.input2Input,G=W.select,Y=function(){var t=a();return s(t,{cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",outline:"none",fontWeight:500,fontSize:h.fontSize,lineHeight:h.buySubmit.height,backgroundColor:"#F0B90B",height:h.buySubmit.height,borderRadius:"4px",marginTop:g.buySubmit.mt,color:e.buySubmitColor}),t}(),X=function(){var e=a();return s(e,{marginTop:g.logo.mt,display:"flex",justifyContent:"center"}),e}(),J=function(){var t=a();return s(t,{fontSize:h.fontSize,marginRight:g.logo.logoSpace,color:e.poweredBy,height:g.logo.height,lineHeight:g.logo.height}),t}(),K=function(){var e=a();return s(e,{height:g.logo.height,lineHeight:g.logo.height,display:"flex",alignItems:"center"}),e.innerHTML='<svg width="70" height="14" viewBox="0 0 70 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M3.1582 7L1.58594 8.57227L0 7L1.58594 5.41406L3.1582 7ZM7 3.1582L9.70703 5.86523L11.293 4.2793L7 0L2.70703 4.29297L4.29297 5.87891L7 3.1582ZM12.4141 5.41406L10.8418 7L12.4277 8.58594L14.0137 7L12.4141 5.41406ZM7 10.8418L4.29297 8.12109L2.70703 9.70703L7 14L11.293 9.70703L9.70703 8.12109L7 10.8418ZM7 8.57227L8.58594 6.98633L7 5.41406L5.41406 7L7 8.57227ZM23.6797 8.73633V8.70898C23.6797 7.68359 23.1328 7.16406 22.2441 6.82227C22.791 6.52148 23.2559 6.0293 23.2559 5.16797V5.14062C23.2559 3.9375 22.2852 3.1582 20.7266 3.1582H17.1582V10.8281H20.8086C22.5449 10.8418 23.6797 10.1309 23.6797 8.73633ZM21.5742 5.45508C21.5742 6.0293 21.1094 6.26172 20.3574 6.26172H18.7988V4.63477H20.4668C21.1777 4.63477 21.5742 4.92188 21.5742 5.42773V5.45508ZM21.998 8.51758C21.998 9.0918 21.5469 9.35156 20.8086 9.35156H18.7988V7.66992H20.7539C21.6152 7.66992 21.998 7.98438 21.998 8.50391V8.51758ZM27.2207 10.8418V3.1582H25.5254V10.8281H27.2207V10.8418ZM36.2988 10.8418V3.1582H34.6309V7.88867L31.0352 3.1582H29.4766V10.8281H31.1445V5.96094L34.8633 10.8418H36.2988ZM45.6504 10.8418L42.3555 3.11719H40.7969L37.502 10.8418H39.2383L39.9355 9.11914H43.1758L43.873 10.8418H45.6504ZM42.5742 7.62891H40.5371L41.5625 5.14062L42.5742 7.62891ZM53.7031 10.8418V3.1582H52.0352V7.88867L48.4395 3.1582H46.8809V10.8281H48.5488V5.96094L52.2676 10.8418H53.7031ZM62.4121 9.59766L61.332 8.51758C60.7305 9.06445 60.1973 9.41992 59.3086 9.41992C57.9961 9.41992 57.0801 8.32617 57.0801 7.01367V6.97266C57.0801 5.66016 58.0098 4.58008 59.3086 4.58008C60.0742 4.58008 60.6758 4.9082 61.2773 5.44141L62.3574 4.19727C61.6465 3.5 60.7852 3.00781 59.3359 3.00781C56.9844 3.00781 55.3301 4.79883 55.3301 6.97266V7C55.3301 9.20117 57.0117 10.9512 59.2676 10.9512C60.7441 10.9648 61.6191 10.4453 62.4121 9.59766ZM69.6172 10.8418V9.33789H65.4473V7.72461H69.0703V6.2207H65.4473V4.66211H69.5625V3.1582H63.7793V10.8281H69.6172V10.8418Z" fill="#F0B90B" />\n </svg>',e}();function Q(){G.addEventListener("click",(function(e){return oe(e)}),!0),Z.addEventListener("click",(function(e){return ae(e)}),!0),Y.onclick=ue,window.addEventListener("click",(function(e){n&&oe(e),c&&ae(e)}),!0)}return X.appendChild(J),X.appendChild(K),O.appendChild(V),O.appendChild(q),D.appendChild(N),D.appendChild(Z),k.appendChild(B),k.appendChild(j),k.appendChild(O),k.appendChild(D),k.appendChild(Y),k.appendChild(X),L?(null==d||d.append(k),ee(T).then((function(){return Q()}))):ee(T).then((function(){Q(),null==d||d.append(k)}));function $(e){if("USD"===e){var t=z(l?"exchange-home-forUSResidents":"exchange-home-forNonUSResidents");V.innerHTML=z("exchange-home-wantSpend")+"<span>"+t+"</span>"}else V.innerText=z("exchange-home-wantSpend")}function ee(e){return i(this,void 0,void 0,(function(){var t,n,r,i,a,s,p;return o(this,(function(o){switch(o.label){case 0:return[4,m({locale:b,api_host:y,us_api_host:w,coinInfo:e})];case 1:return t=o.sent(),n=t.i18n,r=t.coinList,H=n,E=r,N.innerText=z("exchange-home-wantBuy"),q.children[0].placeholder=z("exchange-home-enterAmount"),J.innerText=z("exchange-creditcard-poweredBy"),j.innerText=z("exchange-widget-buyCryptocurrency"),F=E.buySelector,i=function(e,t){var n=e.fiat,r=e.crypto,i=e.isInUS,o=t.find((function(e){return e.assetCode===n&&e.isInUS===i}));return!!o&&!!o.subSelector.find((function(e){return e.assetCode===r}))}(e,F),a=F.find((function(t){return t.assetCode===e.fiat&&t.isInUS===e.isInUS})),U=i?a:F[0],ne(s=i?e.fiat:U.assetCode),$(s),R=i?ie(U.subSelector,e.crypto):U.subSelector[0],p=i?e.crypto:R.assetCode,te(F,U.subSelector,s,p),re(p),[2]}}))}))}function te(e,t,n,r){var i=G.children[1];i.innerHTML="",e.forEach((function(e){var t=se(e.assetCode,e.isInUS);e.assetCode===n&&("USD"!==n||"USD"===n&&e.isInUS===l)&&s(t,{color:"#F0B90B"}),i.appendChild(t)}));var o=Z.children[1];o.innerHTML="",t.forEach((function(e){var t=se(e.assetCode);e.assetCode===r&&s(t,{color:"#F0B90B"}),o.appendChild(t)})),B.innerText+="\n .binance-fiat-widget-dropdown-item:hover {\n background: #EAECEF;\n font-weight: 500;\n }\n "}function ne(e){G.children[2].innerHTML=e}function re(e){void 0===e&&(e=""),Y.innerText=v("exchange-buySell-buyType",H)+" "+e,Z.children[2].innerHTML=e}function ie(e,t){return e.find((function(e){return e.assetCode===t}))}function oe(t){var r,i=t.target,o=i.className;if("SPAN"===i.nodeName&&(o=(null==(i=i.parentElement)?void 0:i.className)||""),/binance-fiat-widget-dropdown-item/.test(o)){var a=i.dataset.assetCode||"";r=i.dataset.isInUs,l=!(!r||"false"===r);var p=(U=F.find((function(e){return e.assetCode===a&&e.isInUS===l}))).assetCode,u=U.subSelector[0].assetCode;R=U.subSelector[0],ne(p),$(p),re(u),te(F,U.subSelector,p,u)}n=!n,s(G.children[0],{borderWidth:n?"0 4px 5px 4px":"5px 4px 0 4px",borderColor:n?"transparent transparent "+e.arrowIconColor+" transparent":e.arrowIconColor+" transparent transparent transparent"}),s(G.children[1],{display:n?"block":"none"}),t.stopPropagation()}function ae(t){var n=t.target.className;if(/binance-fiat-widget-dropdown-item/.test(n)){var r=t.target.innerText;re((R=ie(U.subSelector,r)).assetCode),te(F,U.subSelector,U.assetCode,R.assetCode)}c=!c,s(Z.children[0],{borderWidth:c?"0 4px 5px 4px":"5px 4px 0 4px",borderColor:c?"transparent transparent "+e.arrowIconColor+" transparent":e.arrowIconColor+" transparent transparent transparent"}),s(Z.children[1],{display:c?"block":"none"}),t.stopPropagation()}function se(t,n){var r=a();if("USD"===t){var i=z(n?"exchange-home-forUSResidents":"exchange-home-forNonUSResidents");r.innerHTML=t+'<span style="font-size: '+h.extraFontSize+"; color: "+e.extraLabelColor+'; margin-left: 4px;">'+i+"</span>"}else r.innerText=t;return s(r,{display:"flex",alignItems:"center",fontSize:h.coinFontSize,color:e.buySubmitColor,textAlign:"left",paddingLeft:"8px",height:"40px",lineHeight:"40px"}),r.dataset.isInUs=n,r.dataset.assetCode=t,r.className+="binance-fiat-widget-dropdown-item",r}function pe(t){var r,i=a(),o=a(),c=(s(r=p("i"),{width:0,height:0,borderWidth:n?"0 4px 5px 4px":"5px 4px 0 4px",borderStyle:"solid",borderColor:n?"transparent transparent "+e.arrowIconColor+" transparent":e.arrowIconColor+" transparent transparent transparent",borderRadius:"2px",position:"absolute",right:"12px",top:(g.input1.height-5)/2+"px"}),r),l=function(){var e=a();return s(e,{width:"184px",minHeight:"40px",maxHeight:f<=300?"160px":"235px",background:"#fff",boxShadow:"0px 0px 20px rgba(0, 0, 0, 0.1)",borderRadius:"4px",position:"absolute",zIndex:9,top:g.input1.height+2+"px",right:0,overflowY:"auto",display:"none",fontWeight:"normal"}),e}();return s(i,{width:g.input1.rightWidth,height:g.input1.height+"px",border:"1px solid "+e.inputBorder,backgroundColor:e.inputBg,borderRadius:"3px",borderLeft:"0 none",paddingLeft:g.input1.coinMl,marginTop:g.input1.space,position:"relative",cursor:"pointer",fontWeight:f>300?500:"normal"}),t||(i.className="binance-fiat-widget-select-before-"+C+" "+("dark"===x?"binance-fiat-widget-select-dark":"binance-fiat-widget-select-light"),B.innerText+="\n .binance-fiat-widget-select-before-"+C+":before {\n content: '';\n height: 16px;\n display: inline-block;\n position: absolute;\n left: -1px;\n width: 1px;\n opacity: 0.2;\n top: "+(g.input1.height-16)/2+"px;\n }\n .binance-fiat-widget-select-dark:before {\n background: "+u.dark.breakColor+";\n }\n .binance-fiat-widget-select-light:before {\n background: "+u.light.breakColor+";\n }\n "),i.appendChild(c),i.appendChild(l),i.appendChild(o),i}function ue(){if(U&&U.assetCode&&R&&R.assetCode){if("CNY"===U.assetCode)window.open("https://c2c.binancezh.com/");else{var e=q.children[0].value,t=l&&"USD"===U.assetCode,n=(t?"https://www.binance.us":"https://www.binance.com")+"/"+(t?"en":b)+"/buy-sell-crypto?fiat="+U.assetCode+"&crypto="+R.assetCode+"&amount="+e,r=l?I:_;r&&(n+="&ref="+r),A&&(n+="&utm_source="+A),window.open(n)}}}}return k(),{setTheme:function(e){return x=e,this},setLocale:function(e){return b=e,this},render:function(){return B(),k()}}},B=function(){document.querySelectorAll(".binance-fiat-widget").forEach((function(e){return e.remove()})),document.querySelectorAll(".binance-fiat-widget-modal").forEach((function(e){return e.remove()}))}}])})); |
{ | ||
"name": "binance-fiat-widget", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/bundle.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
43755
1