{"version":3,"file":"CurrentPage-CPxTcc6t.js","sources":["../../../app/frontend/javascript/app/features/CurrentPage.js"],"sourcesContent":["export default class CurrentPage {\n static hasHash(string) {\n return window.location.hash === `#${string}`;\n }\n\n static setHash(string) {\n window.location.hash = `#${string}`;\n }\n\n static isArticle() {\n return window.ENV.article && window.ENV.article.id > 0;\n }\n\n static getArticleId() {\n if (this.isArticle()) {\n return window.ENV.article.id;\n } else {\n return -1;\n }\n }\n\n static getArticleAuthorId() {\n if (this.isArticle()) {\n return window.ENV.article.authorId;\n } else {\n return -1;\n }\n }\n\n static getArticleConversationHostId() {\n if (this.isArticle()) {\n return window.ENV.article.conversationHostId;\n } else {\n return -1;\n }\n }\n\n static getArticleUrl() {\n if (this.isArticle()) {\n return window.ENV.article.url;\n } else {\n return '';\n }\n }\n\n static getArticleUrlSafeTitle() {\n if (this.isArticle()) {\n return window.ENV.article.urlSafeTitle;\n } else {\n return '';\n }\n }\n\n static getTrackMetricsActionPath() {\n return window.ENV.trackMetricsActionPath;\n }\n\n static getUserGoalMarkTrackedActionPath() {\n return window.ENV.userGoalMarkTrackedActionPath;\n }\n\n static hasShareUrl() {\n return typeof window.ENV.shareUrl.id == 'number';\n }\n\n static getShareUrl() {\n return window.ENV.shareUrl;\n }\n\n static isUtmSourceFromPocket() {\n return (\n window.ENV.paywallIframe && window.ENV.paywallIframe.isUtmSourceFromPocket\n );\n }\n\n static isPaywallIframeLocked() {\n return window.ENV.paywallIframe && !window.ENV.paywallIframe.isUnlocked;\n }\n\n static paywallIframeSrc() {\n return window.ENV.paywallIframe.src;\n }\n\n static paywallIframeId() {\n return window.ENV.paywallIframe.id;\n }\n\n // Returns the current URL without the anchor.\n static getUrl() {\n return window.location.href.match(/(^[^#]*)/)[0];\n }\n}\n"],"names":["CurrentPage","string"],"mappings":"AAAe,MAAMA,CAAY,CAC/B,OAAO,QAAQC,EAAQ,CACrB,OAAO,OAAO,SAAS,OAAS,IAAIA,CAAM,EAC9C,CAEE,OAAO,QA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