PageSourceSearch

https://cdn-mp.dmarket.com/prod/static/chunk-24CUCEO5.js

js dmarket.com collected 2026-10-01 12:00:30 UTC 13,439 bytes, 1 lines download raw bytes

1import{a as we}from"./chunk-WBJXEC3V.js";import"./chunk-WRKQ72SA.js";import{a as Ee}from"./chunk-3GB2HDYA.js";import{a as Ce,b as ve}from"./chunk-X7BECOKI.js";import"./chunk-XINB46AC.js";import"./chunk-SSUUXPZC.js";import"./chunk-GEPGTU6T.js";import{a as xe}from"./chunk-WURVYSBZ.js";import"./chunk-XBZG2YOR.js";import{b as Se}from"./chunk-WLFXXOKW.js";import{a as ge}from"./chunk-UOXXNKQG.js";import"./chunk-3YW5ZQ2F.js";import"./chunk-6NXIOYBT.js";import"./chunk-YGZED4M3.js";import"./chunk-6T3JPYOH.js";import"./chunk-QYBM7ARD.js";import{d as fe}from"./chunk-F6BXBXEZ.js";import{c as ue}from"./chunk-EGDXODY6.js";import"./chunk-R6K3LN3J.js";import"./chunk-7DA5TMOK.js";import"./chunk-USO7UDL4.js";import"./chunk-EGRHWZRV.js";import"./chunk-XWOFDSC4.js";import"./chunk-4NGXKNQT.js";import"./chunk-FF4DVN4O.js";import"./chunk-6KZ5E2JO.js";import"./chunk-C4D3OINQ.js";import"./chunk-76U5IEON.js";import"./chunk-OLREH2LN.js";import"./chunk-ULCFTYPT.js";import"./chunk-DSNGNY2N.js";import"./chunk-R7G37BHB.js";import"./chunk-N5EVLFMV.js";import"./chunk-23BYS4UU.js";import{i as A}from"./chunk-PJKQZJJZ.js";import"./chunk-LRQMLUXO.js";import"./chunk-GD642OZI.js";import{d as P}from"./chunk-EM3O57HT.js";import"./chunk-V5GMAM2J.js";import"./chunk-K6N2LRW5.js";import"./chunk-BFB3ZWQU.js";import"./chunk-RKYH5BUH.js";import"./chunk-VGD6U42S.js";import"./chunk-MPTBXOQX.js";import"./chunk-QQY5USOI.js";import{a as de,b}from"./chunk-FHNFLYSA.js";import"./chunk-4OJY3MD4.js";import"./chunk-CSP5HATW.js";import"./chunk-XAA7S2WJ.js";import{i as le,z as me}from"./chunk-72AV3I3Q.js";import"./chunk-RJ3TZPH3.js";import{m as F,n as ce,o as se}from"./chunk-IFKV2DTZ.js";import"./chunk-UG3332RX.js";import"./chunk-HWHQ25OU.js";import"./chunk-7NTTZVDK.js";import"./chunk-BCREOCRG.js";import"./chunk-XLGLQZ3M.js";import"./chunk-PWI4LBWJ.js";import"./chunk-AZNEAOKG.js";import"./chunk-GYXPBKOT.js";import"./chunk-XLT3OEB7.js";import"./chunk-EGRHWZRV.js";import"./chunk-36YU4LOM.js";import"./chunk-V4HZXMQP.js";import"./chunk-R2XCNMIZ.js";import"./chunk-PTYQ2FTN.js";import"./chunk-BZBPPWGG.js";import"./chunk-AX37GTZI.js";import"./chunk-3JVCM7V5.js";import"./chunk-KJUD54TR.js";import"./chunk-6K4RRW4O.js";import{b as ae}from"./chunk-S46OKC2S.js";import"./chunk-4D2J2JE5.js";import{w as re,za as k}from"./chunk-Q4K2XBFW.js";import"./chunk-AZIARD32.js";import"./chunk-RLJWZLZK.js";import"./chunk-VOVXNCGX.js";import"./chunk-YNLW4HML.js";import{i as pe,j as _e,k as he}from"./chunk-GXXRNSBZ.js";import"./chunk-RM7WRR2P.js";import"./chunk-4P64UJ3G.js";import"./chunk-4AF3WJLT.js";import"./chunk-HQZTCEQF.js";import"./chunk-N4TGNBOK.js";import"./chunk-RM2GT4QJ.js";import{Aa as oe,Fa as N,Oa as y,ua as ne}from"./chunk-UOCVC65W.js";import"./chunk-LOEMP4YU.js";import{R as ie,a as C,m as M}from"./chunk-JNGJABXR.js";import"./chunk-GLQ2GEPF.js";import"./chunk-ADGZKV2X.js";import"./chunk-P4S4MVU6.js";import{h as te}from"./chunk-LC35BJX7.js";import"./chunk-H7FJWLCW.js";import{ga as ee}from"./chunk-VMOL7TFU.js";import{Bc as q,Cc as J,Dc as Q,Ec as E,Ga as g,Ha as S,Lc as x,Nc as o,Qb as Y,Vb as W,Wb as D,Xa as L,Xb as G,Y as H,a as $,ad as f,bd as T,cd as w,ec as K,ee as Z,hc as z,nc as p,pc as _,sa as I,uc as u,ud as X,vc as l,wc as h,xa as r,xc as R,zb as c}from"./chunk-YO2RX74J.js";import{a as j,b as U,i as B}from"./chunk-CJN3JB5D.js";var Te=(()=>{class t{constructor(){this.hotjarService=r(ce),this.bulkAnalyticsService=r(ve),this.googleLayerService=r(b),this.flowStateStore=r(A),this.remarketingService=r(se)}submitSuccessAnalytics(e,i,n){if(n.failedOrders.length===0&&n.failedOffers.length===0){let a=i.assets.length-n.failedOrders.length,m=i.offers.length-n.failedOffers.length;a>0&&m>0&&this.bulkAnalyticsService.sendFlowResultBulkEvents(Ce.ExchangeSuccessFlow,this.calculateOfferExchangeSum(i.offers))}this.submitHotjarSuccessEvent(),this.submitResponseAnalytics(n)}calculateOfferExchangeSum(e){return e.reduce((i,n)=>N([i,n.price?.amount??"0"]),"0")}submitResponseAnalytics(e){let i=this.flowStateStore.cachedState().startItems.market.filter(m=>this.flowStateStore.cachedState().items.market.some(v=>v.itemId===m.itemId)),n=[],a="0";if(e.failedOrders.length||(a=this.calculateUnitOffersSum(i),n=i),this.remarketingService.sendBoughtOffers(n),a){let m={event:"GeneralEvent",conversionID:de,conversionLabel:"VD1GCPPiyLgDEN-n2vkC",transaction_id:e.txId,conversionValue:ne(a,ie.CurrencyEnum.USD),currencyCode:"USD"};this.googleLayerService.addToDataLayer(m)}}submitHotjarSuccessEvent(){this.flowStateStore.cachedState().completedStepsHistory.includes(P.BalanceDepositUSDStep)?this.hotjarService.initPoll(F.SuccessExchangeWithRefillFlow):this.hotjarService.initPoll(F.ExchangeSuccess)}submitFailedAnalytics(){this.hotjarService.initPoll(F.ExchangeFail)}calculateUnitOffersSum(e){return e.length?e.reduce((i,n)=>N([i,k(n)]),"0"):"0"}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=I({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var V=(()=>{class t{constructor(){this.http=r(te),this.env=r(ae),this.rootPath=this.env.exchangeApiUrl()}createExchange(e,i){return this.http.post(`${this.rootPath}/exchange-trade`,{assets:e,offers:i})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=I({token:t,factory:t.\u0275fac})}}return t})();var ye=()=>[import("./chunk-2PYREIKH.js").then(t=>t.FlowStepHeaderComponent)];function ke(t,s){if(t&1){let e=E();l(0,"flow-step-header",7),x("close",function(){g(e);let n=o(2);return S(n.closeFlow())}),h()}if(t&2){let e=o(2);u("flowConfig",e.flowConfig)("allowClose",e.exchangeSub.closed)}}function Fe(t,s){t&1&&R(0,"div")}function Ae(t,s){}function be(t,s){t&1&&Q(0)}function Pe(t,s){if(t&1&&D(0,be,1,0,"ng-container",8),t&2){let e=o(2);u("ngTemplateOutlet",e.stepperTemplate)}}function Oe(t,s){if(t&1&&(l(0,"flow-step-notificator",3)(1,"p",9)(2,"span"),f(3),h()()()),t&2){let e=o().$implicit,i=o();u("type",i.STEP_NOTIFICATIONS_TYPES.loading),c(3),T(e("Exchanging items"))}}function De(t,s){if(t&1&&R(0,"rematch-additional-income",10),t&2){let e=o(3);u("income",e.income)}}function Re(t,s){if(t&1&&p(0,De,1,1,"rematch-additional-income",10),t&2){let e=o(2);_(e.hasAdditionalIncome?0:-1)}}function Me(t,s){if(t&1&&(l(0,"flow-step-notificator",3)(1,"p",9),f(2),h()()),t&2){let e=o().$implicit,i=o();u("type",i.STEP_NOTIFICATIONS_TYPES.warning),c(2),w(" ",e("Your selected item may have experienced a price change or might not be available now. Rest assured, your item is still in DMarket inventory. Please check for alternative options we have in store for you!")," ")}}function Ne(t,s){if(t&1&&(l(0,"span"),f(1),h()),t&2){let e=o(2).$implicit;
1c(),T(e("Something went wrong. Please try again or contact support."))}}function Ve(t,s){if(t&1&&(l(0,"span"),f(1),h()),t&2){let e=o(2).$implicit;c(),T(e("Can't buy own offer"))}}function je(t,s){if(t&1&&(l(0,"flow-step-notificator",3)(1,"p",9),p(2,Ne,2,1,"span"),p(3,Ve,2,1,"span"),h()()),t&2){let e=o(2);u("type",e.STEP_NOTIFICATIONS_TYPES.error),c(2),_((e.unknownError==null?null:e.unknownError.code)!=="OWN_OFFER"?2:-1),c(),_((e.unknownError==null?null:e.unknownError.code)==="OWN_OFFER"?3:-1)}}function Ue(t,s){if(t&1){let e=E();l(0,"button",11),x("click",function(){g(e);let n=o(2);return S(n.closeFlow())}),f(1),h()}if(t&2){let e=o().$implicit;c(),w(" ",e("Close")," ")}}function Be(t,s){if(t&1){let e=E();l(0,"div",12)(1,"dm-trustpilot-button",13),x("clickEvent",function(){g(e);let n=o(3);return S(n.openTrustpilot())}),h(),l(2,"button",14),x("click",function(){g(e);let n=o(3);return S(n.toMyItems())}),f(3),h()()}if(t&2){let e=o(2).$implicit;c(3),w(" ",e("Go to my items")," ")}}function $e(t,s){if(t&1){let e=E();l(0,"button",11),x("click",function(){g(e);let n=o(3);return S(n.checkUpdates())}),f(1),h()}if(t&2){let e=o(2).$implicit;c(),w(" ",e("Continue Shopping")," ")}}function He(t,s){if(t&1&&(p(0,Be,4,1,"div",12),p(1,$e,2,1,"button",6)),t&2){let e=o(2);_(e.exchangeSub.closed&&!e.unknownError&&!e.isSomethingFail?0:-1),c(),_(e.isSomethingFail?1:-1)}}function Le(t,s){if(t&1&&(q(0),l(1,"div",1),G(2,ke,1,2)(3,Fe,1,0)(4,Ae,0,0),K(5,2,ye,null,3,4),z(0,-1),l(7,"div",2),p(8,Pe,1,1,"ng-container"),p(9,Oe,4,2,"flow-step-notificator",3),p(10,Re,1,1),p(11,Me,3,2,"flow-step-notificator",3),p(12,je,4,3,"flow-step-notificator",3),l(13,"div",4)(14,"div",5),p(15,Ue,2,1,"button",6)(16,He,2,2),h()()()(),J()),t&2){let e=o();c(8),_(e.stepperTemplate?8:-1),c(),_(e.exchangeSub.closed?-1:9),c(),_(e.exchangeSub.closed&&!e.unknownError&&!e.isSomethingFail?10:-1),c(),_(e.isSomethingFail?11:-1),c(),_(e.unknownError?12:-1),c(3),_(e.hasAdditionalIncome?15:16)}}var Pt=(()=>{class t extends xe{constructor(){super(...arguments),this.exchangeService=r(V),this.flowStateStore=r(A),this.exchangeAnalyticsService=r(Te),this.userTabsService=r(ue),this.assetsManagementService=r(fe),this.cdr=r(Z),this.googleAnalyticsService=r(b),this.#e=r(le),this.#t=r(me),this.STEP_NOTIFICATIONS_TYPES=ge,this.exchangeSub=$.EMPTY,this.hasAdditionalIncome=!1}#e;#t;ngOnInit(){this.createExchange()}
1createExchange(){let e={instant:"instantPrice",exchange:"exchangePrice"};this.doExchange(this.prepareTradeAssets(y,e))}closeFlow(e=!1){(e||this.isSomethingFail)&&this.assetsManagementService.resetPropose(C.market),e&&this.assetsManagementService.resetPropose(C.user),this.googleAnalyticsService.sendTradeFlowData("flow_close",{items:{market:null,user:null}}),this.isSomethingFail||this.unknownError?this.endFlow$.emit():this.completeFlow$.emit()}openTrustpilot(){this.completeStep$.emit()}toMyItems(){this.closeFlow(!0),this.userTabsService.navigateToTab(M.Items)}checkUpdates(){this.closeFlow(!0)}doExchange(e){let i={market:this.getMarketItems(),user:this.flowStateStore.cachedState().startItems.user},n=this.getAssetsWithInstantPrice(e.assets);this.exchangeSub=this.exchangeService.createExchange(n,e.offers).pipe(H(()=>this.cdr.markForCheck())).subscribe({next:a=>B(this,null,function*(){let m=!!a.failedOffers.length,d=!!a.failedOrders.length;this.isSomethingFail=m||d,this.exchangeAnalyticsService.submitSuccessAnalytics(n,e,a),this.isSomethingFail?this.handleFailedResponse(a):(this.detectAdditionalIncome(),this.sendSuccessAnalyticData(a.txId,i),this.hasAdditionalIncome||this.completeStep$.emit({nextStep:P.PurchaseAndExchangeSuccessStep}),yield this.#e.updateUserData(),yield this.#t.updateUserKycData())}),error:a=>{this.sendFailAnalyticData(i.market,a.message),this.exchangeAnalyticsService.submitFailedAnalytics(),this.unknownError=a}})}detectAdditionalIncome(){let{startItems:e,items:i}=this.flowStateStore.cachedState();this.income=(e?.user??[]).reduce((n,a)=>{let m=a?.exchangePriceInitial?.[y]??0,v=(i?.user??[]).find(O=>O.itemId===a.itemId)?.exchangePrice?.[y]??0;return U(j({},n),{additional:(n?.additional??0)+(Number(v)-Number(m)),total:(n?.total??0)+Number(v)})},{}),this.hasAdditionalIncome=this.income.additional>0,this.cdr.markForCheck()}handleFailedResponse(e){let i=this.flowStateStore.cachedState().startItems.market.filter(d=>this.flowStateStore.cachedState().items.market.some(O=>O.itemId===d.itemId)),n=[],a=[],m=[];e.failedOrders.forEach(d=>{d.assetId&&n.push(d.assetId),a.push(d.error)}),n.length?(i.forEach(d=>{n.includes(d.itemId)&&m.push(d)}),this.sendFailAnalyticData(m,a.toString())):this.sendFailAnalyticData(i,a.toString())}prepareTradeAssets(e,i){return{assets:this.flowStateStore.cachedState().startItems.user.map(n=>({assetId:n.itemId,instantPrice:{currency:e,amount:n[i.instant]?.[e]},exchangePrice:{currency:e,amount:n[i.exchange]?.[e]}})),offers:this.getMarketItems().map(n=>({offerId:re(n),price:{currency:e,amount:k(n,e)}}))}}getAssetsWithInstantPrice(e){return e.filter(i=>!oe(i.instantPrice?.amount))}getMarketItems(){return this.flowStateStore.cachedState().items.market}sendSuccessAnalyticData(e,i){if(this.googleAnalyticsService.sendTradeFlowData("items_were_exchanged_successfully",{items:{market:this.getMarketItems(),user:this.flowStateStore.cachedState().startItems.user}}),this.googleAnalyticsService.isBuySellOrTradeFlow(this.userTabsService.getActiveTab())){let n=this.googleAnalyticsService.getSitePlace(this.userTabsService.getActiveTab(),"page");this.googleAnalyticsService.sendTradeFlowData("purchase",{items:i,txId:e},C.market,{site_place:n}),this.googleAnalyticsService.sendTradeFlowData("purchase",{items:i,txId:e},C.user,{site_place:n})}}sendFailAnalyticData(e,i){this.userTabsService.getActiveTab()===M.Exchange&&this.googleAnalyticsService.sendTradeFlowData("flow_error",{items:{market:e,user:[]},error:i},C.market)}static{this.\u0275fac=(()=>{let e;return function(n){return(e||(e=L(t)))(n||t)}})()}static{this.\u0275cmp=Y({type:t,selectors:[["exchange-result-step"]],features:[X([V,{provide:pe,useValue:"flows"}]),W],decls:1,vars:1,consts:[[4,"transloco","translocoRead"],[1,"c-dialog__inner"],[1,"c-dialog__body"],[3,"type"],[1,"c-dialog__footer"],[1,"c-dialog__buttons"],[1,"c-dialog__button","o-dmButton","o-dmButton--green"],[1,"c-dialogExchange__stepper",3,"close","flowConfig","allowClose"],[4,"ngTemplateOutlet"],[1,"c-dialogStatus__text"],[3,"income"],[1,"c-dialog__button","o-dmButton","o-dmButton--green",3,"click"],[1,"c-dialog__buttons","c-dialog__buttons--vertical"],[3,"clickEvent"],[1,"c-dialog__button","o-dmButton",3,"click"]],template:function(i,n){i&1&&D(0,Le,17,6,"ng-container",0),i&2&&u("translocoRead","flows")},dependencies:[he,_e,ee,Se,we,Ee],encapsulation:2,changeDetection:0})}}return t})();export{Pt as ExchangeResultStepComponent};

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.