PageSourceSearch

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

js dmarket.com collected 2026-09-24 09:43:36 UTC 6,500 bytes, 1 lines download raw bytes

1import{a as R}from"./chunk-ASCBDVXF.js";import{a as M}from"./chunk-BSKQTWNX.js";import{i as L}from"./chunk-2N6HA2XW.js";import{a as W,b}from"./chunk-R7FBI6FH.js";import{l as z}from"./chunk-X5BKZFF2.js";import{db as T}from"./chunk-NPLYHJWT.js";import{qb as h}from"./chunk-DQCMG7P5.js";import{h as U}from"./chunk-D7ZWZD6W.js";import{a as n,c as v}from"./chunk-YOLZNQ4M.js";import{K as k,N as g,Na as A,Qa as _,R as p,Ta as S,db as N,h as E,ha as m,ka as f,q as o,ta as a,wa as O,y as d,ya as s}from"./chunk-HSO33GGI.js";import{i as I}from"./chunk-CJN3JB5D.js";var $=(()=>{class i extends b{constructor(){super(W.Account),this.http=s(U)}getZDSsoToken(e){return this.http.get(this.rootPath+"/token/zendesk/sso",{headers:{Authorization:e}})}getZDMessagingToken(e){return this.http.get(this.rootPath+"/token/zendesk/live-chat",{headers:{Authorization:e}})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=a({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Z=300,y="/sso/login",D="/sso/logout",Y=1e3*Z,l=new O("ZENDESK_MESSAGING_OPTIONS");var x=(()=>{class i{constructor(){this.api=s($),this.options=s(l),this.iframe=null,this.#s=S(null),this.#t=S(null),this.#e=h()}#s;#t;#e;get isSsoLogoutRoute(){return this.#e?!1:location?.href.includes(D)}get isSsoLoginRoute(){return this.#e?!1:location?.href.includes(y)}get hcUrl(){return this.options.returnUrl+"/hc"}get requestsUrl(){return this.options.returnUrl+"/requests"}get loginUrl(){return`${this.options.authDomainUrl}/access/jwt`}get logoutUrl(){return`${this.options.authDomainUrl}/access/logout`}pageInIframe(){return this.#e?!1:window.location!==window.parent.location}openHelpCenter(e){this.#e||(e?location.assign(`${this.loginUrl}?jwt=${e}&return_to=${this.hcUrl}`):location.assign(this.hcUrl))}openUserRequests(e){this.#e||(e?location.assign(`${this.loginUrl}?jwt=${e}&return_to=${this.requestsUrl}`):this.openHelpCenter(null))}getSsoToken(e){return this.#s()?o(this.#s()):this.api.getZDSsoToken(e).pipe(d(t=>t.jwt),f(t=>{this.#s.set(t)}),g(this.handleError.bind(this)))}getMessagingToken(e){return this.#t()?o(this.#t()):this.api.getZDMessagingToken(e).pipe(d(t=>t.jwt),f(t=>{this.#t.set(t)}),g(this.handleError.bind(this)))}ssoLogin(e){if(this.#e)return;let t=`${this.loginUrl}?jwt=${e}&return_to=${this.hcUrl}`;this.createIframe(t)}ssoLogout(){if(this.#e)return;let e=`${this.logoutUrl}?return_to=${this.hcUrl}`;this.createIframe(e)}createIframe(e){if(this.iframe||this.pageInIframe())return;let t=document.createElement("iframe");this.iframe=t,t.id="zd-frame",t.name="zd-iframe",t.style.height="0",t.style.width="0",t.src=e,t.style.visibility="hidden",t.style.position="absolute",t.addEventListener("load",()=>this.iframeCallback(t)),t.addEventListener("error",()=>this.iframeCallback(t)),document.querySelector("body")?.appendChild(t)}iframeCallback(e){document.querySelector("body")?.removeChild(e),this.iframe=null,(this.isSsoLoginRoute||this.isSsoLogoutRoute)&&location.assign(this.hcUrl)}handleError(){return o(null)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=a({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var r={MAX_WAIT_TIMEOUT:4e3,HANDLER_INIT_TIMEOUT:2e3,WAIT_INTERVAL:100,INSTANCE_READY_NAMES:["R","P","L"],STORAGE_TOKEN_KEY:"zdMessagingToken"},Te=(()=>{class i{constructor(){this.#s=s(N),this.#t=s(A),this.#e=s(_),this.#o=s(z),this.#n=s(R),this.#a=s(l),this.#i=s(x),this.#r=s(M),this.#h=s(L),this.unreadMessages=new E(null),this.unreadMessages$=this.unreadMessages.asObservable(),this.zendeskWidget=null,this.totalTimeoutTime=0,this.userData$=v(this.#h.dmarketUserInfo).pipe(T(),k(e=>!!e?.id),n()),this.loginOnWidgetInit=!1,this.#l=h()}#s;#t;#e;#o;#n;#a;#i;#r;#h;#l;openHelpCenter(){this.#r.userToken?this.#i.getSsoToken(this.#r.userToken).pipe(p(1),n(this.#t)).subscribe(e=>this.#i.openHelpCenter(e)):this.#i.openHelpCenter(null)}openUserRequests(){this.#r.userToken?this.#i.getSsoToken(this.#r.userToken).pipe(p(1),n(this.#t)).subscribe(e=>this.#i.openUserRequests(e)):this.#i.openHelpCenter(null)}init(){this.#l||this.initializeWidget(this.#a)}showWidget(){this.executeWidgetAction("show")}hideWidget(){this.executeWidgetAction("hide")}openWidget(){this.executeWidgetAction("open")}
1closeWidget(){this.executeWidgetAction("close")}loginUser(e){this.zendeskWidget?this.zendeskWidget("messenger","loginUser",t=>I(this,null,function*(){yield this.#e.runOutsideAngular(()=>t(e))}),t=>{if(t){let{type:u,reason:c,message:G}=t;console.error(`Zendesk login error: ${u} - ${c} - ${G}`)}}):this.loginOnWidgetInit=!0}logoutUser(){localStorage?.removeItem(r.STORAGE_TOKEN_KEY),this.hideWidget(),this.executeWidgetAction("logoutUser")}executeWidgetAction(e){this.zendeskWidget?.("messenger",e)}initializeWidget(e){this.userData$.pipe(m(()=>this.zendeskWidget?o(null):this.#n.loadScript(`${e.url}?key=${e.key}`,{id:e.id}))).subscribe(()=>{this.waitForWidgetInitialization(),this.setupAuthListeners()})}waitForWidgetInitialization(){this.#e.runOutsideAngular(()=>{let e=setInterval(()=>{let t=window?.zE?.name;this.zendeskWidget=t&&r.INSTANCE_READY_NAMES.includes(t)?window?.zE:null,this.totalTimeoutTime+=r.WAIT_INTERVAL,this.totalTimeoutTime>=r.MAX_WAIT_TIMEOUT?(console.warn("Zendesk widget load error"),clearInterval(e),this.loginOnWidgetInit=!1):this.zendeskWidget&&(clearInterval(e),this.loginOnWidgetInit&&(this.loginUser(localStorage?.getItem(r.STORAGE_TOKEN_KEY)||""),this.loginOnWidgetInit=!1),this.showWidget(),this.setupWidgetHandlers())},r.WAIT_INTERVAL)})}setupWidgetHandlers(){this.#o.langChanges$.pipe(n(this.#t)).subscribe(()=>this.updateLocale()),this.zendeskWidget?.("messenger:on","open",()=>this.unreadMessages.next(null)),this.zendeskWidget?.("messenger:on","close",()=>this.unreadMessages.next(null)),setTimeout(()=>{this.zendeskWidget?.("messenger:on","unreadMessages",e=>this.unreadMessages.next(e))},r.HANDLER_INIT_TIMEOUT)}updateLocale(){this.zendeskWidget?.("messenger:set","locale",this.#o.currentLanguage)}setupAuthListeners(){this.userData$.pipe(m(e=>{let t=this.#r.userToken,{isEmailVerified:u,email:c}=e;return t&&u&&c?this.#i.getMessagingToken(t):o(null)}),n(this.#t)).subscribe(e=>{e&&(localStorage?.setItem(r.STORAGE_TOKEN_KEY,e),this.loginUser(e))}),this.#r.logoutEvent$.pipe(T(this.#s),n(this.#t)).subscribe(this.logoutUser.bind(this))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=a({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{Y as a,l as b,x as c,Te as d};

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.