PageSourceSearch

https://www.teliaplay.se/oneweb/sdk.aeb85361.js

js teliaplay.se collected 2026-10-01 15:57:30 UTC 219,571 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunk_telia_company_tv_web_logged_in=globalThis.webpackChunk_telia_company_tv_web_logged_in||[]).push([[249],{"../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/client-common.js"(e,t,o){var n=this&&this.__rest||function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(o[n[a]]=e[n[a]])}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.createCommonApolloClient=void 0;const a=o("../../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_react-_23af7fe1a84405345a895683eefe299d/node_modules/@apollo/client/core/index.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/error-link.js"),c=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/functional.js"),i=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/http-link.js"),m=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/query-link.js");t.createCommonApolloClient=e=>{var{graphqlUrl:t,showRequestLogs:o,cache:d,defaultOptions:r,persistedQueryOptions:l,link:p,onError:u,isSecureRequest:v}=e,y=n(e,["graphqlUrl","showRequestLogs","cache","defaultOptions","persistedQueryOptions","link","onError","isSecureRequest"]);const k=[(0,s.createErrorLink)({onError:u}),(0,m.createPersistedQueryLink)({enabled:null==l?void 0:l.enabled,useGETForHashedQueries:null==l?void 0:l.useGETForHashedQueries}),(0,i.createDataManagerHttpLink)({graphqlUrl:t,showRequestLogs:o,isSecureRequest:v})].filter(c.nonNullable);return p&&k.push(p),new a.ApolloClient(Object.assign({cache:d,link:a.ApolloLink.from(k),defaultOptions:Object.assign({query:{errorPolicy:"all"},watchQuery:{errorPolicy:"all"}},r)},y))}},"../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/client-no-auth.js"(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))(function(a,s){function c(e){try{m(n.next(e))}catch(e){s(e)}}function i(e){try{m(n.throw(e))}catch(e){s(e)}}function m(e){var t;e.done?a(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(c,i)}m((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.createApolloClientNoAuth=void 0;const a=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/client-common.js");t.createApolloClientNoAuth=e=>(0,a.createCommonApolloClient)(Object.assign(Object.assign({},e),{isSecureRequest:()=>n(void 0,void 0,void 0,function*(){return!1})}))},"../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/client.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.createApolloClient=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/Authentication.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/client-common.js");t.createApolloClient=e=>(0,a.createCommonApolloClient)(Object.assign(Object.assign({},e),{isSecureRequest:()=>n.Authentication.instance().isLoggedin()}))},"../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/error-link.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.createErrorLink=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js"),a=o("../../../node_modules/.pnpm/[email protected]/node_modules/graphql/index.mjs"),s=o("../../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_react-_23af7fe1a84405345a895683eefe299d/node_modules/@apollo/client/link/error/index.js"),c=o("../../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_react-_23af7fe1a84405345a895683eefe299d/node_modules/@apollo/client/core/index.js");t.createErrorLink=({onError:e})=>new s.ErrorLink(({error:t})=>{c.ServerError.is(t)&&(t instanceof n.RequestNotAuthenticatedError||t instanceof n.RequestContentNotFoundError||t instanceof n.RequestServerError||t instanceof n.RequestUnspecifiedError)&&e(t),c.CombinedGraphQLErrors.is(t)&&t.errors&&t.errors.length&&t.errors.forEach(t=>{t instanceof a.GraphQLError&&e(t)})})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/exceptions.js"(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.UnsupportedFetchMethodError=void 0;class o extends Error{constructor(e){super(`Unsupported fetch method: ${e}`),this.name="UnsupportedFetchMethodError"}}t.UnsupportedFetchMethodError=o},"../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/functional.js"(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.nonNullable=void 0;t.nonNullable=e=>null!=e},"../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/http-link.js"(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))(function(a,s){function c(e){try{m(n.next(e))}catch(e){s(e)}}function i(e){try{m(n.throw(e))}catch(e){s(e)}}function m(e){var t;e.done?a(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(c,i)}m((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.createDataManagerHttpLink=function({graphqlUrl:e,showRequestLogs:t,isSecureRequest:o}){return new a.HttpLink({uri:e,fetch:(e,a)=>n(this,void 0,void 0,function*(){const n=s.DataManager.instance();if(a&&"POST"!==(null==a?void 0:a.method)&&"GET"!==(null==a?void 0:a.method))throw new l.UnsupportedFetchMethodError(null==a?void 0:a.method);let u="Unnamed";if(t&&a&&a.body){const e=JSON.parse(a.body);u=e.operationName,["IntrospectionQuery"].includes(u)||(console.groupCollapsed(`%cRequest: ${u}`,"color:#F57C00"),console.log("variables",e.variables),console.log(JSON.parse(a.body).query),console.groupEnd())}const v="POST"===(null==a?void 0:a.method)?n.sendPost:n.sendGet,[y,k,_]=yield Promise.all([i.ClientInformationIF.resolve().getClientInformation(),m.PlatformInformationIF.resolve().getPlatformInformation(),d.DeviceInformationIF.resolve().getDeviceInformation()]),f=r.Lifecycle.instance().getDeviceStatus().network.provider;try{p++;const n=`[${p}] Response time`;console.time(n);const s="string"==typeof e?e:e instanceof URL?e.toString():e instanceof Request?e.url:String(e),i=yield v(s,"graphql-do-not-cache-this",{postAsJson:!0,secure:yield o(),post:null==a?void 0:a.body,responseType:"HTTP_RESPONSE",headers:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({"x-country":y.country,"tv-client-boot-id":c.Boot.instance().getBootId(),"tv-client-tz":Intl.DateTimeFormat().resolvedOptions().timeZone,"tv-client-name":y.client.toLowerCase(),"tv-client-version":y.version,"tv-client-os-name":k.name,"tv-client-os-version":k.version},k.browser&&{"tv-client-browser":k.browser}),k.browserVersion&&{"tv-client-browser-version":k.browserVersion}),_.vendor&&{"tv-client-vendor":_.vendor}),_.vendorModel&&{"tv-client-vendor-model":_.vendorModel}),f&&{"tv-client-network-provider":f})});return t&&(["IntrospectionQuery"].includes(u)||(console.groupCollapsed(`%cResponse: ${u}`,"color:#388E3C"),console.timeEnd(n),console.log(i),console.groupCollapsed("Stringified response"),console.log(JSON.stringify(i)),console.groupEnd(),console.groupEnd())),new Response(i.text,{status:i.status,headers:i.headers})}catch(e){throw t&&(console.groupCollapsed(`ERROR Response: ${u}`),console.groupEnd()),e}})})};const a=o("../../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_react-_23af7fe1a84405345a895683eefe299d/node_modules/@apollo/client/core/index.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Boot.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js"),m=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/PlatformInformationIF.js"),d=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/device/DeviceInformationIF.js"),r=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Lifecycle.js"),l=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/exceptions.js");let p=0},"../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/index.js"(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var a=Object.getOwnPropertyDescriptor(t,o);
1a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,a)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),a=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),a(o("../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/client.js"),t),a(o("../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/client-no-auth.js"),t)},"../../../node_modules/.pnpm/@[email protected]_@[email protected]_graphql-ws@_e1aa4566d905a07d2ff969d0d950473e/node_modules/@telia-company/tv.common-sdk-apollo-react-client/dist/query-link.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.createPersistedQueryLink=function({useGETForHashedQueries:e=!0,enabled:t=!0}){return t?new n.PersistedQueryLink({sha256:a.sha256,useGETForHashedQueries:e}):null};const n=o("../../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_react-_23af7fe1a84405345a895683eefe299d/node_modules/@apollo/client/link/persisted-queries/index.js"),a=o("../../../node_modules/.pnpm/[email protected]/node_modules/js-sha256/src/sha256.js")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/Account.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/data/AccountIF.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/AccountConfig.js");t.Account=(0,n.createSingleton)("@telia-company/tv.common-sdk-authentication/dist/Account.Account",e=>{const t=a.AccountIF.resolve(),o=async()=>{try{const e=await t.getAccountInformation();return(0,s.setAccountConfig)(e),e}catch(e){throw(0,s.setAccountConfig)(void 0),e}};return{getAccountInformation:o,setEmail:async(n,a)=>{await t.setEmail(n,a),await o(),e.events.accountInformation.emit({})},setName:async(n,a)=>{await t.setName(n,a),await o(),e.events.accountInformation.emit({})},setPassword:async(e,o)=>{await t.setPassword(e,o)},changeUsername:async(o,n)=>{await t.changeUsername(o,n),e.events.accountInformation.emit({})}}},{events:{accountInformation:new n.Event}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/AccountConfig.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.setAccountConfig=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Config.js");t.setAccountConfig=e=>{n.Config.setConfigs({"common-sdk-authentication/account/id":null==e?void 0:e.id,"common-sdk-authentication/account/tvAccountId":null==e?void 0:e.tvAccountId,"common-sdk-authentication/account/username":null==e?void 0:e.username,"common-sdk-authentication/account/email":null==e?void 0:e.email,"common-sdk-authentication/account/firstName":null==e?void 0:e.firstName,"common-sdk-authentication/account/lastName":null==e?void 0:e.lastName,"common-sdk-authentication/account/serviceProfiles":(null==e?void 0:e.serviceProfiles)&&[...e.serviceProfiles],"common-sdk-authentication/account/internal":null==e?void 0:e.internal,"common-sdk-authentication/account/testUser":null==e?void 0:e.testUser})}},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/Authentication.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.Authentication=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenCredentialStorageIF.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenAccessStorageIF.js"),c=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/Profile.js"),i=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/data/AuthenticationIF.js"),m=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/client/AuthenticateIF.js"),d=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/data/PartnerIF.js"),r=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/data/DeviceIF.js"),l=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/ErrorTypes.js"),p=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js"),u=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/CacheManager.js");t.Authentication=(0,n.createSingleton)("@telia-company/tv.common-sdk-authentication/dist/Authentication.Authentication",e=>{const{events:o}=e,n=a.TokenCredentialStorageIF.resolve(),v=s.TokenAccessStorageIF.resolveOptional(),y=i.AuthenticationIF.resolve(),k=m.AuthenticateIF.resolve(),_=d.PartnerIF.resolve(),f=p.Log.instance()(t.Authentication),g=c.Profile.instance(),h=u.CacheManager.instance(),b=r.DeviceIF.resolve(),j=async()=>{const e=await y.getSessionInfo();if(e)return e;const t=await(async()=>{const e=await n.getCredentials();if(e)return e.token})();return t?{refreshToken:t,geoblock:!1}:void 0},w=async()=>!!await j(),I=async()=>{await Promise.all([g.clearToken(),n.removeCredentials(),null==v?void 0:v.removeToken()])};let P,C,S=0,A=!1,E=!1;const O=e=>{void 0!==e&&e!==S||(A=!1,E=!1,C=void 0,P=()=>{})};function T(e,t){e.autoLogin&&n.storeCredentials({type:"TOKEN",token:t.refreshToken,autoLogin:!0})}function F(e){if(A){f.error(e);const t=P;O(),t(new l.AuthenticationCancelledError(e))}}return w().then(async e=>{if(e){const[e,t]=await Promise.all([g.hasToken(),j()]);o.authentication.emit({loggedin:!0,hasProfileToken:e,sessionInfo:t})}}),{login:e=>{if(!e&&C&&E)return C;const t=!!e,a=++S;let s,c;E=t;const i=new Promise((e,t)=>{s=e,c=t});return C=i,(async()=>{const i=await w(),m=e?void 0:await n.getCredentials();let d;if(F("Login aborted due to new login"),P=c,A=!0,E=t,e||m)try{e?(await I(),d=await y.login(e),T(e,d)):m&&(d=await y.login(m))}catch(t){if(e)return O(a),void c(t);m&&(t instanceof l.AuthenticationOAuthTokenError||t instanceof l.AuthenticationClosedAccountError)&&await I()}try{d||(d=await async function(){const e="Authentication cancelled by AuthenticateIF.requestCredentials (gave undefined)";let t,o;await k.authenticateStart();try{if(o=await k.requestCredentials(),!o)throw new l.AuthenticationCancelledError(e);for(;!t;)try{t=await y.login(o),T(o,t)}catch(t){if(o=await k.requestCredentials(t instanceof l.AuthenticationError?t:void 0),!o)throw new l.AuthenticationCancelledError(e)}
1await k.authenticateEnd(void 0)}catch(e){throw await k.authenticateEnd(e instanceof l.AuthenticationError?e:void 0),e}return t}()),i||o.authentication.emit({loggedin:!0,hasProfileToken:!1,sessionInfo:d}),o.session.emit({sessionInfo:d}),O(a),s(d)}catch(e){O(a),c(e)}})(),i},logout:async()=>{const e=await w();F("Login aborted due to logout"),h.clear();try{await y.logout()}finally{await I()}e&&o.authentication.emit({loggedin:!1})},logoutOtherDevices:async()=>{await y.logoutOtherDevices()},isLoggedin:w,getSessionInfo:j,getCredentialsForBrand:async e=>(e=>y.getCredentialsForBrand(e))(e),getPartnerAuthInfo:async e=>_.getPartnerAuthInfo(e),getOAuthInfo:async e=>y.getOAuthInfo(e),getCompanionDeviceInfo:async e=>y.getCompanionDeviceInfo(e),registerDevice:()=>b.registerDevice()}},{events:{authentication:new n.Event,session:new n.Event}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/AuthenticationListener.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/Account.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/AccountConfig.js");o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/Authentication.js").Authentication.statics.events.authentication.on(async e=>{const t=n.Log.instance()("common-sdk-authentication/dist/AccountConfig");if(e.loggedin)try{(0,s.setAccountConfig)(await a.Account.instance().getAccountInformation())}catch(e){(0,s.setAccountConfig)(void 0),t.error("Failed to get account information",e)}else(0,s.setAccountConfig)(void 0)})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/ErrorTypes.js"(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AccountWrongPasswordError=t.AccountUsernameExistsError=t.AccountUsernameFormatError=t.AccountNewPasswordError=t.AccountOldPasswordError=t.RegisterDeviceTooManyDevicesError=t.RegisterDeviceError=t.AuthenticationTooManyDevicesError=t.AuthenticationLogoutError=t.AuthenticationCancelledError=t.AuthenticationCompanionDeviceUserCodeError=t.AuthenticationOAuthTokenError=t.AuthenticationUserNotApplicableError=t.AuthenticationPartnerNoEngagementError=t.AuthenticationDeviceTypeError=t.AuthenticationMaxDevicesError=t.AuthenticationBlockedAccountError=t.AuthenticationClosedAccountError=t.AuthenticationCredentialsError=t.AuthenticationMaxAttemptsReachedError=t.AuthenticationUnspecifiedError=t.AuthenticationError=void 0;class o extends Error{constructor(e){super(e),this.name="AuthenticationError",Object.setPrototypeOf(this,o.prototype)}}t.AuthenticationError=o;class n extends o{constructor(e){super(e),this.name="AuthenticationUnspecifiedError",Object.setPrototypeOf(this,n.prototype)}}t.AuthenticationUnspecifiedError=n;class a extends o{constructor(e){super(e),this.name="AuthenticationMaxAttemptsReachedError",Object.setPrototypeOf(this,a.prototype)}}t.AuthenticationMaxAttemptsReachedError=a;class s extends o{constructor(e){super(e),this.name="AuthenticationCredentialsError",Object.setPrototypeOf(this,s.prototype)}}t.AuthenticationCredentialsError=s;class c extends o{constructor(e){super(e),this.name="AuthenticationClosedAccountError",Object.setPrototypeOf(this,c.prototype)}}t.AuthenticationClosedAccountError=c;class i extends o{constructor(e){super(e),this.name="AuthenticationBlockedAccountError",Object.setPrototypeOf(this,i.prototype)}}t.AuthenticationBlockedAccountError=i;class m extends o{constructor(e){super(e),this.name="AuthenticationMaxDevicesError",Object.setPrototypeOf(this,m.prototype)}}t.AuthenticationMaxDevicesError=m;class d extends o{constructor(e){super(e),this.name="AuthenticationDeviceTypeError",Object.setPrototypeOf(this,d.prototype)}}t.AuthenticationDeviceTypeError=d;class r extends o{constructor(e){super(e),this.name="AuthenticationPartnerNoEngagementError",Object.setPrototypeOf(this,r.prototype)}}t.AuthenticationPartnerNoEngagementError=r;class l extends o{constructor(e){super(e),this.name="AuthenticationUserNotApplicableError",Object.setPrototypeOf(this,l.prototype)}}t.AuthenticationUserNotApplicableError=l;class p extends o{constructor(e){super(e),this.name="AuthenticationOAuthTokenError",Object.setPrototypeOf(this,p.prototype)}}t.AuthenticationOAuthTokenError=p;class u extends o{constructor(e){super(e),this.name="AuthenticationCompanionDeviceUserCodeError",Object.setPrototypeOf(this,u.prototype)}}t.AuthenticationCompanionDeviceUserCodeError=u;class v extends o{constructor(e){super(e),this.name="AuthenticationCancelledError",Object.setPrototypeOf(this,v.prototype)}}t.AuthenticationCancelledError=v;class y extends o{constructor(e){super(e),this.name="AuthenticationLogoutError",Object.setPrototypeOf(this,y.prototype)}}t.AuthenticationLogoutError=y;
1class k extends Error{constructor(e){super(e),this.name="AuthenticationTooManyDevicesError",Object.setPrototypeOf(this,k.prototype)}}t.AuthenticationTooManyDevicesError=k;class _ extends Error{constructor(e){super(e),this.name="RegisterDeviceError",Object.setPrototypeOf(this,_.prototype)}}t.RegisterDeviceError=_;class f extends _{constructor(e){super(e),this.name="RegisterDeviceTooManyDevicesError",Object.setPrototypeOf(this,f.prototype)}}t.RegisterDeviceTooManyDevicesError=f;class g extends Error{constructor(e){super(e),this.name="AccountOldPasswordError",Object.setPrototypeOf(this,g.prototype)}}t.AccountOldPasswordError=g;class h extends Error{constructor(e){super(e),this.name="AccountNewPasswordError",Object.setPrototypeOf(this,h.prototype)}}t.AccountNewPasswordError=h;class b extends Error{constructor(e){super(e),this.name="AccountUsernameFormatError",Object.setPrototypeOf(this,b.prototype)}}t.AccountUsernameFormatError=b;class j extends Error{constructor(e){super(e),this.name="AccountUsernameExistsError",Object.setPrototypeOf(this,j.prototype)}}t.AccountUsernameExistsError=j;class w extends Error{constructor(e){super(e),this.name="AccountWrongPasswordError",Object.setPrototypeOf(this,w.prototype)}}t.AccountWrongPasswordError=w},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/Profile.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.Profile=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenProfileStorageIF.js");t.Profile=(0,n.createSingleton)("@telia-company/tv.common-sdk-authentication/dist/Profile.Profile",e=>{const t=a.TokenProfileStorageIF.resolve();return{async setToken(o){await t.storeToken(o),e.events.tokenSet.emit(o)},getToken:async()=>t.getToken(),async hasToken(){return void 0!==await this.getToken()},async clearToken(){await t.removeToken(),e.events.tokenCleared.emit()}}},{events:{tokenCleared:new n.Event,tokenSet:new n.Event}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/client/AuthenticateIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.AuthenticateIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.AuthenticateIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk-authentication/dist/abstractions/client/AuthenticateIF.AuthenticateIF")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenAccessStorageIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.TokenAccessStorageIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.TokenAccessStorageIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenAccessStorageIF.TokenAccessStorageIF")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenCredentialStorageIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.TokenCredentialStorageIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.TokenCredentialStorageIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenCredentialStorageIF.TokenCredentialStorageIF")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenProfileStorageIF.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.TokenProfileStorageIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.TokenProfileStorageIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenProfileStorageIF.TokenProfileStorageIF")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/data/AccountIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.AccountIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.AccountIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk-authentication/abstractions/data/AccountIF.AccountIF")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/data/AuthenticationIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.AuthenticationIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.AuthenticationIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk/dist/abstractions/data/AuthenticationIF.AuthenticationIF")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/data/DeviceIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.DeviceIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk-authentication/dist/abstractions/data/DeviceIF.DeviceIF")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/data/PartnerIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.PartnerIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.PartnerIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk-authentication/dist/abstractions/data/PartnerIF.PartnerIF")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/CookieValueStore.js"(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.createCookieValueStore=void 0;const o=31536e3,n=async e=>(await e.getDocumentLocation()).domain.split(".").reverse().splice(0,2).reverse().join(".");t.createCookieValueStore=(e,t)=>({get:async()=>{const a=await e.get(t);if(void 0===a)return;const s=decodeURIComponent(a);return await e.set(t,a,{path:"/",domain:await n(e),maxAge:o}),s},set:async a=>e.set(t,encodeURIComponent(a),{path:"/",domain:await n(e),maxAge:o}),remove:async()=>e.remove(t,{path:"/",domain:await n(e)})})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/implementations/client/CookieTokenAccessStorage.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenAccessStorageIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/CookieStorageIF.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/CookieValueStore.js");n.TokenAccessStorageIF.implement(()=>{const e=a.CookieStorageIF.resolveOptional();if(!e)return;const t=(0,s.createCookieValueStore)(e,"__sid");return{getToken:async()=>{const e=await t.get();if(e)try{return JSON.parse(e)}catch{return}},storeToken:async e=>t.set(JSON.stringify(e)),removeToken:()=>t.remove()}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/implementations/client/CookieTokenCredentialStorage.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenCredentialStorageIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js");n.TokenCredentialStorageIF.implement(()=>{const e=a.DataManager.instance(),t=i.ClientInformationIF.resolve(),o=s.ServiceConfig.getService("logingateway"),n=c.Log.instance()("common-sdk-authentication/cookiesupport/implementations/client/CookieTokenCredentialStorage");let m,d=!1;return{getCredentials:async()=>{if(d)return m;try{const n=await e.sendGet(o.getUrl("/rest/v1/authtokencookie/info"),"common-sdk-authentication/abstractions/client/TokenCredentialStorageIF",{headers:{"tv-client-name":(await t.getClientInformation()).client.toLowerCase()}});m=(null==n?void 0:n.refreshToken)?{autoLogin:!0,token:n.refreshToken,type:"TOKEN"}:void 0,d=!0}catch(e){d=!1,m=void 0,n.error("Failed to request cookie information from logingateway",e)}return m},storeCredentials:async e=>{d=!1},removeCredentials:async()=>{d=!1}}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/implementations/client/CookieTokenProfileStorage.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/CookieStorageIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenProfileStorageIF.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/CookieValueStore.js");a.TokenProfileStorageIF.implement(()=>{const e=n.CookieStorageIF.resolveOptional();if(!e)return;const t=(0,s.createCookieValueStore)(e,"profile-token");return{getToken:()=>t.get(),storeToken:e=>t.set(e),removeToken:()=>t.remove()}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/implementations/client/index.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/implementations/client/CookieTokenAccessStorage.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/implementations/client/CookieTokenCredentialStorage.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/implementations/client/CookieTokenProfileStorage.js")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/implementations/data/LoginGatewayHttpRequestInterceptor.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/HttpRequestInterceptors.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js");n.HttpRequestInterceptors.provide(()=>{const e=a.ServiceConfig.getService("logingateway");return[{interceptRequest(t){t.url.startsWith(e.getUrl(""))&&(t.withCredentials=!0)}}]})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/implementations/data/index.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/implementations/data/LoginGatewayHttpRequestInterceptor.js")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/implementations/index.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/implementations/client/index.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/implementations/data/index.js")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/index.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/cookiesupport/implementations/index.js")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/AuthenticationWrapper.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/AuthenticationWrapperIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/data/AuthenticationIF.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/Authentication.js");n.AuthenticationWrapperIF.implement(()=>{const e=a.AuthenticationIF.resolve(),t=s.Authentication.instance(),o=[];let n=!1;async function c(a,s){await e.prepareRequest(a);const c=async function(t,n){return new Promise((a,s)=>{o.push({resolve:a,reject:s,requestOptions:t,retryCounter:n}),e.isRequestValid(t)&&0===n&&a()})}(a,s);if(function(t,o){return(!e.isRequestValid(t)||o>0)&&!n}(a,s)){n=!0;try{await t.login(),n=!1,o.forEach(async t=>{await e.prepareRequest(t.requestOptions),t.resolve()})}catch(e){n=!1,o.forEach(t=>{t.reject(e)})}}return c}return{request:async(e,t)=>c(e,t),response:async(t,n)=>{const a=o.findIndex(e=>e.requestOptions===t),s=o.splice(a,1)[0];return{retryRequest:!e.isAuthenticated(t,n)&&s&&s.retryCounter<1}},finally:e=>{o.splice(0)}}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/client/DefaultTokenAccessStorage.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenAccessStorageIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/LocalStorage.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js");n.TokenAccessStorageIF.implementDefault(()=>{const e=a.LocalStorage.instance(),t=s.Log.instance()("common-sdk-authentication/implementations/client/DefaultTokenAccessStorage"),o="token-storage",n="auth";return{getToken:async()=>{const a=await e.get(o,n);if(a)try{return JSON.parse(a)}catch(e){return void t.error("Failed to parse token from TokenAccessStorage",a,e)}},storeToken:async t=>e.set(o,n,JSON.stringify(t)),removeToken:()=>e.set(o,n,void 0)}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/client/DefaultTokenCredentialStorage.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenCredentialStorageIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/LocalStorage.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js");n.TokenCredentialStorageIF.implementDefault(()=>{const e=a.LocalStorage.instance(),t=s.Log.instance()("common-sdk-authentication/implementations/client/DefaultTokenCredentialStorage"),o="token-storage",n="refresh-token";return{getCredentials:async()=>{const a=await e.get(o,n);if(a)try{return JSON.parse(a)}catch(e){return void t.error("Failed to parse credentials from TokenCredentialStorage",a)}},storeCredentials:t=>e.set(o,n,JSON.stringify(t)),removeCredentials:()=>e.set(o,n,void 0)}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/client/DefaultTokenProfileStorage.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenProfileStorageIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/LocalStorage.js");n.TokenProfileStorageIF.implementDefault(()=>{const e=a.LocalStorage.instance(),t="token-storage",o="profile-token";return{getToken:async()=>await e.get(t,o),storeToken:n=>e.set(t,o,n),removeToken:()=>e.set(t,o,void 0)}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/client/index.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/client/DefaultTokenAccessStorage.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/client/DefaultTokenCredentialStorage.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/client/DefaultTokenProfileStorage.js")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/EngagementGatewayAccount.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/data/AccountIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/CacheManager.js"),m=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js"),d=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js"),r=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/ErrorTypes.js"),l=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/NetworkIF.js");n.AccountIF.implement(()=>{const e=a.DataManager.instance(),t=s.Log.instance()("common-sdk-authentication/implementations/data/EngagementGatewayAccount"),o=m.ServiceConfig.getService("engagementgateway"),n=m.ServiceConfig.getService("engagementinformationgateway"),p=c.ClientInformationIF.resolve(),u=l.NetworkIF.resolve(),v=i.CacheManager.instance(),y="common-sdk-authentication/abstractions/data/AccountIF",k=e=>{if(e instanceof d.RequestServerError&&e.responseText)try{const t=JSON.parse(e.responseText);if(t.errorCode)switch(t.errorCode){case"62007":return new r.AccountUsernameFormatError("Invalid new username");case"62008":return new r.AccountWrongPasswordError("Wrong password");case"62009":return new r.AccountUsernameExistsError("Username already exists")}switch(t.message){case"Old password is incorrect":case"Password does not match!":return new r.AccountOldPasswordError(t.message);
1case"New password is invalid!":case"New password is too short!":return new r.AccountNewPasswordError(t.message)}}catch(o){throw t.error("Failed to parse response",o),e}throw e},_=async()=>{var o,a,s,c;try{const[t,i]=await Promise.all([p.getClientInformation(),u.getNetworkInfo()]),m=n.getUrl("/rest/secure/v2/engagementinfo"),d=await e.sendGet(m,y,{secure:!0,query:{tvClientName:t.client.toLowerCase(),tvClientNetworkProvider:null!==(o=i.provider)&&void 0!==o?o:"%other"}});return{id:d.username,tvAccountId:d.tvAccountId,username:d.customerUsername,email:d.email,...d.firstName&&{firstName:d.firstName},...d.lastName&&{lastName:d.lastName},serviceProfiles:null!==(a=d.serviceProfiles)&&void 0!==a?a:[],internal:null!==(s=d.internal)&&void 0!==s&&s,testUser:null!==(c=d.testUser)&&void 0!==c&&c}}catch(e){throw t.error("Failed to fetch account information for authenticated account"),e}};return{getAccountInformation:_,setEmail:async(n,a)=>{try{const t=o.getUrl("/rest/secure/v2/settings/changeEmail"),{whiteLabelBrand:s}=await p.getClientInformation();await e.sendPost(t,y,{post:{newEmail:n,password:a,whiteLabelBrand:s},postAsJson:!0,secure:!0}),v.clearCacheClass(y)}catch(e){throw t.error("Failed to set email for user"),e}},setName:async(n,a)=>{try{const t=o.getUrl("/rest/secure/v2/settings/changeName"),{whiteLabelBrand:s}=await p.getClientInformation();await e.sendPost(t,y,{post:{firstName:n,lastName:a,whiteLabelBrand:s},postAsJson:!0,secure:!0}),v.clearCacheClass(y)}catch(e){throw t.error("Failed to set name for user"),e}},setPassword:async(n,a)=>{try{const t=o.getUrl("/rest/secure/v2/password/change"),{whiteLabelBrand:s}=await p.getClientInformation();await e.sendPost(t,y,{post:{newPassword:n,oldPassword:a,whiteLabelBrand:s},postAsJson:!0,secure:!0})}catch(e){throw t.error("Failed to change user's password"),k(e)}},changeUsername:async(n,a)=>{try{const t=o.getUrl("/rest/secure/v2/username/change"),[s,{whiteLabelBrand:c}]=await Promise.all([_(),p.getClientInformation()]);await e.sendPost(t,y,{post:{oldUsername:s.username,newUsername:n,password:a,whiteLabelBrand:c},postAsJson:!0,secure:!0}),v.clearCacheClass(y)}catch(e){throw t.error("Failed to change user's username"),k(e)}}}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/EngagementGatewayTvClientBootIdRequestHeader.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/HttpRequestInterceptors.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Boot.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js");n.HttpRequestInterceptors.provide(()=>{const e=s.ServiceConfig.getService("engagementgateway"),t=a.Boot.instance();return[{interceptRequest(o){o.url.startsWith(e.getUrl(""))&&(o.headers["tv-client-boot-id"]=t.getBootId())}}]})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/EngagementInfoGatewayTvClientBootIdRequestHeader.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/HttpRequestInterceptors.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Boot.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js");n.HttpRequestInterceptors.provide(()=>{const e=s.ServiceConfig.getService("engagementinformationgateway"),t=a.Boot.instance();return[{interceptRequest(o){o.url.startsWith(e.getUrl(""))&&(o.headers["tv-client-boot-id"]=t.getBootId())}}]})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/LoginGatewayAuthentication.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/data/AuthenticationIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/HttpRequest.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/device/DeviceInformationIF.js"),m=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/device/DeviceIdentificationIF.js"),d=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/LoginGatewayErrorHelper.js"),r=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/ErrorTypes.js"),l=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/LoginGatewayErrorTypes.js"),p=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js"),u=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/Profile.js"),v=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenCredentialStorageIF.js"),y=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/client/TokenAccessStorageIF.js"),k=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js"),_=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js");n.AuthenticationIF.implement(()=>{const e=a.Log.instance()("common-sdk-authentication/implementations/LogingatewayAuthentication"),t=s.HttpRequest.instance(),o=i.DeviceInformationIF.resolve(),n=m.DeviceIdentificationIF.resolve(),f=c.ClientInformationIF.resolve(),g=d.LoginGatewayErrorHelper.instance(),h=k.ServiceConfig.getService("logingateway"),b=u.Profile.instance(),j=v.TokenCredentialStorageIF.resolve(),w=y.TokenAccessStorageIF.resolve(),I="common-sdk-authentication/abstractions/data/AuthenticationIF",P=()=>h.getUrl("/rest/v1/login/refresh"),C=()=>h.getUrl("/rest/v1/device/token");let S,A,E,O,T,F,M,D;function L(e){let t,o;return{promise:new Promise((n,a)=>{t=setTimeout(()=>{n()},e),o=a}),cancel:()=>{clearTimeout(t),o(new r.AuthenticationCancelledError),o=()=>{}}}}async function R(){const{client:e,country:t}=await f.getClientInformation();return{"tv-client-name":e.toLowerCase(),"x-country":t}}function q(){A&&A.cancel()}function x(e){const t=new Date(e).getTime()-Date.now(),o=Math.max(.75*t,6e4),n=Math.max(.9*t,6e4);return Math.floor(Math.random()*(n-o+1)+o)}const N=e=>e.status>=200&&e.status<300;function U(a){const{accessToken:s,validTo:c,refreshToken:i,geoblock:m}=a;return E={geoblock:!!m,refreshToken:i},async function({refreshToken:a,accessToken:s,validTo:c}){let i=!1,m=c;S=s;let d=a;await w.storeToken({token:S,validTo:m});for(;!i;){q();try{A=L(x(m)),await A.promise;await R();const a=P(),s=await t.sendRequest("POST",a,I,{headers:{"content-type":"application/json",...await R()},postData:JSON.stringify({deviceId:await n.getDeviceId(),deviceType:(await o.getDeviceInformation()).deviceType,refreshToken:d})});if(N(s))try{const e=JSON.parse(s.text);S=e.accessToken,m=e.validTo,d=e.refreshToken,await j.getCredentials()&&await Promise.all([j.storeCredentials({type:"TOKEN",token:d,autoLogin:!0}),w.storeToken({token:S,validTo:m})])}catch(t){throw t instanceof SyntaxError?e.error("Failed to refresh access token, parse exception",t):e.error("Failed to refresh access token",t),t}else{const e=await B(s.text);if(!e)throw new p.RequestServerError(a,s.status,s.text,void 0,s.headers);S=e.token,m=e.validTo,i=!0}}catch(t){t instanceof r.AuthenticationCancelledError||e.error("Failed to refresh access token",t),i=!0}}}({refreshToken:i,validTo:c,accessToken:s}),E}async function H(a){try{const[e,{deviceType:s},{whiteLabelBrand:c,client:i,country:m}]=await Promise.all([n.getDeviceId(),o.getDeviceInformation(),f.getClientInformation()]),d=(({deviceId:e,returnUrl:t,whiteLabelBrand:o,deviceType:n})=>h.getUrl("/rest/v1/oauth/authorize?deviceId={deviceId}&redirectUri={returnUrl}&whiteLabelBrand={whiteLabelBrand}").replace("{deviceId}",encodeURIComponent(e)).replace("{returnUrl}",encodeURIComponent(t)).replace("{whiteLabelBrand}",encodeURIComponent(o))+(n?`&deviceType=${encodeURIComponent(n)}`:""))({deviceId:e,returnUrl:a.returnUrl,whiteLabelBrand:c,deviceType:s}),r=await t.sendRequest("GET",d,I,{headers:await R()}),l=JSON.parse(r.text);if(N(r)){const{loginPageUri:e,resetPasswordUri:t,createAccountPageUri:o,operatorPageUri:n,forgotUsernameUri:a}=l;return{loginUrl:e,resetPasswordUrl:t,...o&&{createAccountUrl:o},...n&&{operatorUrl:n},...a&&{forgotUsernameUrl:a}}}throw new p.RequestServerError(d,r.status,r.text,void 0,r.headers)}catch(t){if(t instanceof Error)throw g.getAuthenticationError(t,e);throw t}}async function B(e){var t;const o=null===(t=(e=>{try{return JSON.parse(e)}catch{return}})(e))||void 0===t?void 0:t.errorCode;if(!o||"50008"===o){const e=await w.getToken();if(e&&new Date(e.validTo)>new Date)return e}}async function G(o){const n=(({authorizationGrant:e})=>h.getUrl("/rest/v1/oauth/token?code={authorizationGrant}").replace("{authorizationGrant}",encodeURIComponent(e)))({authorizationGrant:o.authorizationGrant}),a=await t.sendRequest("POST",n,I,{headers:{accept:"application/json",...await R()}});if(N(a))return U(JSON.parse(a.text));throw g.getAuthenticationError(new p.RequestServerError(n,a.status,a.text,void 0,a.headers),e)}async function J(o){if(o.userCode!==D)throw new r.AuthenticationCompanionDeviceUserCodeError("Invalid user code");return async function(){let o;for(;!o;)try{if(O=L(T),await O.promise,Date.now()>=F)throw new r.AuthenticationCompanionDeviceUserCodeError("User code expired");const n=await t.sendRequest("POST",C(),I,{postData:"deviceCode="+encodeURIComponent(M),headers:{"content-type":"application/x-www-form-urlencoded",...await R()}});if(!N(n))throw g.getAuthenticationError(new p.RequestServerError(C(),n.status,n.text,void 0,n.headers),e);o=JSON.parse(n.text)}catch(e){if(e instanceof l.AuthenticationBackoffPollingError)T+=5e3;else if(!(e instanceof l.AuthenticationPendingError||e instanceof r.AuthenticationUnspecifiedError||e instanceof l.AuthenticationBackoffPollingError))throw e}return U(o)}()}async function $(a){const[s,{deviceType:c},{whiteLabelBrand:i}]=await Promise.all([n.getDeviceId(),o.getDeviceInformation(),f.getClientInformation()]),m=h.getUrl("/rest/v1/login");try{const e=await t.sendRequest("POST",m,I,{headers:{"content-type":"application/json",...await R()},postData:JSON.stringify({deviceId:s,username:a.username.toLowerCase(),password:a.password,deviceType:c,whiteLabelBrand:i})});if(N(e))return U(JSON.parse(e.text));throw new p.RequestServerError(m,e.status,e.text,void 0,e.headers)}catch(t){if(t instanceof Error)throw g.getAuthenticationError(t,e);throw t}}async function V(a){const[s,{deviceType:c},{whiteLabelBrand:i}]=await Promise.all([n.getDeviceId(),o.getDeviceInformation(),f.getClientInformation()]);let m=(({deviceId:e,deviceType:t,whiteLabelBrand:o})=>h.getUrl("/rest/v1/device/authorization?deviceId={deviceId}&deviceType={deviceType}&whiteLabelBrand={whiteLabelBrand}").replace("{deviceId}",encodeURIComponent(e)).replace("{deviceType}",encodeURIComponent(null!=t?t:"")).replace("{whiteLabelBrand}",encodeURIComponent(o)))({deviceId:s,deviceType:c,whiteLabelBrand:i});a.returnUrl&&(m+="&returnUrl="+encodeURIComponent(a.returnUrl)),O&&O.cancel();try{const e=await t.sendRequest("GET",m,I,{headers:await R()}),o=JSON.parse(e.text);if(N(e)){M=o.deviceCode,D=o.userCode,T=1e3*o.interval;const e=1e3*o.expiresIn;return F=Date.now()+e,{userCode:D,verificationUri:o.verificationUri,verificationUriComplete:o.verificationUriComplete,expires
1In:e}}throw new p.RequestServerError(m,e.status,e.text,void 0,e.headers)}catch(t){if(t instanceof Error)throw g.getAuthenticationError(t,e);throw t}}return{login:async a=>{if("OAUTH"===a.type)return G(a);if("COMPANION_DEVICE"===a.type)return J(a);if("TOKEN"===a.type)return async function(a){const[s,{deviceType:c}]=await Promise.all([n.getDeviceId(),o.getDeviceInformation()]),i=P();try{const e=await t.sendRequest("POST",i,I,{headers:{"content-type":"application/json",...await R()},postData:JSON.stringify({deviceId:s,deviceType:c,refreshToken:a.token})});if(N(e))return U(JSON.parse(e.text));const o=await B(e.text);if(o&&new Date(o.validTo)>new Date)return U({accessToken:o.token,refreshToken:a.token,validTo:o.validTo});throw new p.RequestServerError(i,e.status,e.text,void 0,e.headers)}catch(t){if(t instanceof Error)throw g.getAuthenticationError(t,e);throw t}}(a);if("BASIC"===a.type)return $(a);const s=`Unsupported credential type "${a.type} "`;throw e.error(s),new r.AuthenticationCredentialsError(s)},logout:async()=>{const t=_.DataManager.instance();q();try{await t.sendDelete(h.getUrl("/rest/secure/v1/logout"),I,{headers:await R(),secure:!0}),E=void 0,S=void 0}catch(t){throw e.error("Failed to logout user on server, user is successfully logged out on client",t),t}},logoutOtherDevices:async()=>{const t=_.DataManager.instance();if(!E||!E.refreshToken)throw new r.AuthenticationLogoutError("No refresh token to determine other devices to logout");try{await t.sendDelete(h.getUrl("/rest/secure/v1/logoutAllExceptCurrent"),I,{secure:!0,postAsJson:!0,headers:await R(),query:{currentDeviceId:await n.getDeviceId()},post:{refreshToken:E.refreshToken}})}catch(t){throw e.error("Failed to logout other devices",t),t}},getSessionInfo:()=>Promise.resolve(E),getCredentialsForBrand:async t=>{const o=`Retrieving credentials for brand ${t} not supported`;throw e.error(o),new r.AuthenticationUnspecifiedError(o)},prepareRequest:async e=>{await async function(e){if(S){e.authorization="Bearer "+S;const t=await b.getToken();void 0!==t?e["x-profile"]=`Bearer ${t}`:delete e["x-profile"]}else delete e.authorization,delete e["x-profile"]}(e.headers)},isAuthenticated:(e,t)=>401!==t.status,isRequestValid:e=>!!S&&e.headers.authorization==="Bearer "+S,getOAuthInfo:async e=>await H(e),getCompanionDeviceInfo:async e=>await V(e)}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/LoginGatewayErrorHelper.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.LoginGatewayErrorHelper=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/ErrorTypes.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/LoginGatewayErrorTypes.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js");t.LoginGatewayErrorHelper=(0,n.createSingleton)("@telia-company/tv.common-sdk-authentication/dist/implementations/data/LoginGatewayErrorHelper.LoginGatewayErrorHelper",e=>({getAuthenticationError:(e,t)=>{if(e instanceof c.RequestError)try{const o=function(e,t){try{const t=JSON.parse(e.responseText);return"number"==typeof t.errorCode&&(t.errorCode=t.errorCode.toString()),t}catch(o){const n="Failed to parse server error response for url "+e.url;throw t.error(n),new a.AuthenticationUnspecifiedError(n)}}(e,t);return function(e,t){let o="";switch(e){case"9020":return o="Login tries exceeded",t.error(o),new a.AuthenticationMaxAttemptsReachedError(o);case"9050":return o="Missing credentials",t.error(o),new a.AuthenticationCredentialsError(o);case"50002":return o="Incorrect username or password",t.error(o),new a.AuthenticationCredentialsError(o);case"50003":return o="Account is blocked",t.error(o),new a.AuthenticationBlockedAccountError(o);case"50004":return o="Account is closed",t.error(o),new a.AuthenticationClosedAccountError(o);case"50005":return o="Illegal refresh token",t.error(o),new a.AuthenticationOAuthTokenError(o);case"50007":return o="Empty refresh token",t.error(o),new a.AuthenticationOAuthTokenError(o);case"50008":return o="Token not found",t.error(o),new a.AuthenticationOAuthTokenError(o);case"50009":return o="Device type not supported",t.error(o),new a.AuthenticationDeviceTypeError(o);case"50010":return o="Failed to get partner oAuth information, account have no engagement with partner",t.error(o),new a.AuthenticationPartnerNoEngagementError(o);case"50011":return o="User not applicable",t.error(o),new a.AuthenticationUserNotApplicableError(o);case"50012":return o="Country not supported",t.error(o),new a.AuthenticationUnspecifiedError(o);case"50015":return new s.AuthenticationPendingError;case"50016":return new s.AuthenticationBackoffPollingError;case"50017":return o="Token expired",t.error(o),new a.AuthenticationOAuthTokenError(o);case"50021":return o="Logged in on too many devices",t.error(o),new a.AuthenticationTooManyDevicesError(o);default:return o="Authentication unspecified error, errorCode "+e,t.error(o),new a.AuthenticationUnspecifiedError(o)}}(o.errorCode,t)}catch(e){return e}const o="Authentication unspecified error";return t.error(o),new a.AuthenticationUnspecifiedError(o)}}),{})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/LoginGatewayErrorTypes.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.AuthenticationBackoffPollingError=t.AuthenticationPendingError=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/ErrorTypes.js");class a extends n.AuthenticationError{constructor(e){super(e),this.name="AuthenticationPendingError",Object.setPrototypeOf(this,a.prototype)}}t.AuthenticationPendingError=a;class s extends n.AuthenticationError{constructor(e){super(e),this.name="AuthenticationBackoffPollingError",Object.setPrototypeOf(this,s.prototype)}}t.AuthenticationBackoffPollingError=s},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/LoginGatewayPartner.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/data/PartnerIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js"),i=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/LoginGatewayErrorHelper.js"),m=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js");n.PartnerIF.implement(()=>{const e=a.DataManager.instance(),t=i.LoginGatewayErrorHelper.instance(),o=s.ClientInformationIF.resolve(),n=c.Log.instance()("common-sdk-authentication/implementations/data/LoginGatewayPartner"),d=m.ServiceConfig.getService("logingateway");return{getPartnerAuthInfo:async a=>{const{client:s,country:c}=await o.getClientInformation();try{const t=d.getUrl("/rest/secure/v1/partner/{partnerId}/login").replace("{partnerId}",a);return{token:(await e.sendPost(t,"common-sdk-authentication/abstractions/data/PartnerIF",{secure:!0,headers:{"tv-client-name":s.toLowerCase(),"x-country":c}})).partnerToken,partnerId:a}}catch(e){if(n.error("Failed to get partner auth info",e),e instanceof Error)throw t.getAuthenticationError(e,n);throw e}}}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/LoginGatewayTvClientBootIdRequestHeader.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/HttpRequestInterceptors.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Boot.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js");n.HttpRequestInterceptors.provide(()=>{const e=s.ServiceConfig.getService("logingateway"),t=a.Boot.instance();return[{interceptRequest(o){o.url.startsWith(e.getUrl(""))&&(o.headers["tv-client-boot-id"]=t.getBootId())}}]})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/TvClientGatewayDevice.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/abstractions/data/DeviceIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js"),i=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/ErrorTypes.js"),m=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/device/DeviceIdentificationIF.js"),d=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js"),r=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/PlatformInformationIF.js"),l=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/device/DeviceInformationIF.js"),p=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Lifecycle.js"),u=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js"),v=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Boot.js");n.DeviceIF.implement(()=>{const e=a.DataManager.instance(),t=s.ServiceConfig.getService("tvclientgateway"),o=m.DeviceIdentificationIF.resolve(),n=d.ClientInformationIF.resolve(),y=r.PlatformInformationIF.resolve(),k=l.DeviceInformationIF.resolve(),_=p.Lifecycle.instance(),f=u.Log.instance()("common-sdk-authentication/implementations/data/TvClientGatewayDevice");return{registerDevice:async()=>{var a;try{const a=t.getUrl("/rest/secure/v1/register"),[s,c,i,m]=await Promise.all([o.getDeviceId(),n.getClientInformation(),y.getPlatformInformation(),k.getDeviceInformation()]),d=v.Boot.instance().getBootId(),{client:r,version:l}=c,{name:p,version:u,browser:f,browserVersion:g}=i,{vendor:h,vendorModel:b}=m,{type:j,provider:w}=_.getDeviceStatus().network;await e.sendPost(a,"common-sdk-authentication/abstractions/data/DeviceIF",{secure:!0,postAsJson:!0,post:{deviceId:s,tvClient:{bootId:d,name:r.toLowerCase(),version:l,os:p,osVersion:u,browser:f,browserVersion:g,vendor:h,vendorModel:b,networkType:j.toLowerCase(),networkProvider:w}}})}catch(e){if(e instanceof c.RequestError){let t;try{t=JSON.parse(e.responseText),t.errorCode=null===(a=t.errorCode)||void 0===a?void 0:a.toString()}catch(e){throw f.error(`Failed to register device - unable to parse response: ${e instanceof Error?e.message:"unknown reason"}`),e}if("61004"===t.errorCode)throw f.error(`Failed to register device (too many devices): ${t.errorMessage||"unknown reason"}`),new i.RegisterDeviceTooManyDevicesError(t.errorMessage);throw f.error(`Failed to register device: ${t.errorMessage||"unknown reason"}`),new i.RegisterDeviceError(t.errorMessage)}throw e instanceof Error&&f.error(`Failed to register device - unrecognized error type: ${e.message||"unknown reason"}`),e}}}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/TvClientGatewayTvClientBootIdRequestHeader.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/HttpRequestInterceptors.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Boot.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js");n.HttpRequestInterceptors.provide(()=>{const e=s.ServiceConfig.getService("tvclientgateway"),t=a.Boot.instance();return[{interceptRequest(o){o.url.startsWith(e.getUrl(""))&&(o.headers["tv-client-boot-id"]=t.getBootId())}}]})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/index.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/LoginGatewayAuthentication.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/LoginGatewayPartner.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/LoginGatewayTvClientBootIdRequestHeader.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/EngagementGatewayAccount.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/EngagementGatewayTvClientBootIdRequestHeader.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/EngagementInfoGatewayTvClientBootIdRequestHeader.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/TvClientGatewayDevice.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/TvClientGatewayTvClientBootIdRequestHeader.js")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/index.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/AuthenticationWrapper.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/client/index.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/data/index.js")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/index.js"(e,t,o){o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/implementations/index.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/providers/index.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/Profile.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/AuthenticationListener.js")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/providers/HttpStatisticsObfuscator.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/StatisticsHttpBlacklisters.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js");n.StatisticsHttpBlacklisters.provide(()=>{const e=a.ServiceConfig.getService("logingateway"),t=a.ServiceConfig.getService("engagementgateway");return[{prepareStatistics(o){const{url:n}=o.request;if(n===e.getUrl("/rest/v1/login/refresh")&&o.request.postData)try{const e=JSON.parse(o.request.postData);e.refreshToken="[secret]",o.request.postData=JSON.stringify(e)}catch(e){}else if(n===e.getUrl("/rest/secure/v1/logoutAllExceptCurrent")&&o.request.postData)try{const e=JSON.parse(o.request.postData);e.refreshToken="[secret]",o.request.postData=JSON.stringify(e)}catch(e){}else if(n===e.getUrl("/rest/v1/login")&&o.request.postData)try{const e=JSON.parse(o.request.postData);e.password="[secret]",o.request.postData=JSON.stringify(e)}catch(e){}else if(n===t.getUrl("/rest/secure/v2/settings/changeEmail")&&o.request.postData)try{const e=JSON.parse(o.request.postData);e.password="[secret]",o.request.postData=JSON.stringify(e)}catch(e){}else if(n===t.getUrl("/rest/secure/v2/password/change")&&o.request.postData)try{const e=JSON.parse(o.request.postData);e.oldPassword="[secret]",e.newPassword="[secret]",o.request.postData=JSON.stringify(e)}catch(e){}}}]})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/providers/index.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/providers/HttpStatisticsObfuscator.js")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-data-manager-fetch/dist/dataManagerFetch.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.dataManagerFetch=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-data-manager-fetch/dist/utils/index.js");t.dataManagerFetch=async(e,t)=>{if("string"!=typeof e)throw new Error("Only string input is currently supported.");const o=(0,a.getDataManagerSendMethod)(t),s=(0,a.normalizeRequestHeaders)(null==t?void 0:t.headers),c=Boolean(null==s?void 0:s.authorization);try{const n=await o(e,"no-cache",{postAsJson:!0,secure:c,post:null==t?void 0:t.body,responseType:"HTTP_RESPONSE",headers:s});return new Response(n.text||null,{status:n.status,headers:n.headers})}catch(e){if(e instanceof n.RequestUnspecifiedError)throw Error(e.responseText);if(e instanceof n.RequestError)return new Response(e.responseText||null,{headers:e.responseHeaders,status:e.status});throw e}}},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-data-manager-fetch/dist/index.js"(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var a=Object.getOwnPropertyDescriptor(t,o);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,a)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),a=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),a(o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-data-manager-fetch/dist/dataManagerFetch.js"),t)},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-data-manager-fetch/dist/utils/getDataManagerSendMethod/getDataManagerSendMethod.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.getDataManagerSendMethod=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js");t.getDataManagerSendMethod=e=>{const t=n.DataManager.instance(),o=((null==e?void 0:e.method)||"GET").toLowerCase();return"post"===o?t.sendPost:"put"===o?t.sendPut:"delete"===o?t.sendDelete:t.sendGet}},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-data-manager-fetch/dist/utils/getDataManagerSendMethod/index.js"(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var a=Object.getOwnPropertyDescriptor(t,o);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,a)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),a=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),a(o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-data-manager-fetch/dist/utils/getDataManagerSendMethod/getDataManagerSendMethod.js"),t)},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-data-manager-fetch/dist/utils/index.js"(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var a=Object.getOwnPropertyDescriptor(t,o);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,a)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),a=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),a(o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-data-manager-fetch/dist/utils/normalizeRequestHeaders/index.js"),t),a(o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-data-manager-fetch/dist/utils/getDataManagerSendMethod/index.js"),t)},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-data-manager-fetch/dist/utils/normalizeRequestHeaders/index.js"(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var a=Object.getOwnPropertyDescriptor(t,o);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,a)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),a=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),a(o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-data-manager-fetch/dist/utils/normalizeRequestHeaders/normalizeRequestHeaders.js"),t)},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-data-manager-fetch/dist/utils/normalizeRequestHeaders/normalizeRequestHeaders.js"(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeRequestHeaders=void 0;const o=e=>e.reduce((e,t)=>({...e,[t[0]]:t[1]}),{});t.normalizeRequestHeaders=e=>{if(!e)return;let t;return t=e instanceof Array?o(e):e instanceof Headers?o([...e.entries()]):e,Object.keys(t).reduce((e,o)=>({...e,[o.toLowerCase()]:t[o]}),{})}},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/Credentials.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.Credentials=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/CacheManager.js"),i=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/TvClientBootIdHeader.js"),m=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/Account.js"),d=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/device/DeviceInformationIF.js"),r=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js");t.Credentials=(0,n.createSingleton)("common-sdk-legacy-pack/Credentials",()=>{const e="common-sdk-authentication/abstractions/data/AccountIF",t=a.ServiceConfig.getService("engagementinformationgateway"),o=a.ServiceConfig.getService("engagementgateway"),n=s.DataManager.instance(),l=c.CacheManager.instance(),p=m.Account.instance(),u=d.DeviceInformationIF.resolve(),v=r.ClientInformationIF.resolve();async function y(){const o=t.getUrl("/rest/secure/v2/engagementinfo");return await n.sendGet(o,e,{secure:!0})}return i.TvClientBootIdHeader.addService(t),i.TvClientBootIdHeader.addService(o),{isPinActive:async()=>(await y()).pinActivated,async setPinActive(t,a){const s=o.getUrl("/rest/secure/v1/pin/1/activation"),c={pinCode:a,activatePinCode:t};await n.sendPost(s,e,{secure:!0,post:c,postAsJson:!0}),l.clearCacheClass(e)},isPinSet:async()=>(await y()).pinCodeSet,async createPin(t,a){const s=o.getUrl("/rest/secure/v1/pin/1");await n.sendPost(s,e,{secure:!0,post:{newPinCode:t},postAsJson:!0}),a&&await this.setPinActive(!0,t)},async changePin(t,a){const s=o.getUrl("rest/secure/v1/pin/1");await n.sendPost(s,e,{secure:!0,post:{newPinCode:t,verificationPinCode:a},postAsJson:!0})},async resetPin(t,a){const{country:s}=await v.getClientInformation(),c=o.getUrl("/rest/v1/pin/reset/exchange");await n.sendPost(c,e,{secure:!1,post:{newPinCode:t,token:a},headers:{"x-country":s},postAsJson:!0})},async forgotPin(){const[{username:t},{deviceType:a}]=await Promise.all([p.getAccountInformation(),u.getDeviceInformation()]),s=o.getUrl("/rest/secure/v1/pin/reset/1");await n.sendPost(s,e,{secure:!0})},async validatePin(t){const a=o.getUrl("/rest/secure/v1/pin/1/validation"),s=await n.sendPost(a,e,{secure:!0,postAsJson:!0,post:{verificationPinCode:t}});return!(!s||!s.validated)}}},{})},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/DevicePreferencesStorage.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.DevicePreferencesStorage=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/CookieStorageIF.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/LocalStorageIF.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js");t.DevicePreferencesStorage=(0,c.createStartupSingleton)("DevicePreferencesStorage",()=>{const e=a.CookieStorageIF.resolveOptional(),t=s.LocalStorageIF.resolve(),o=i.Log.instance()("DevicePreferencesStorage"),c=async()=>e?(await e.getDocumentLocation()).domain.split(".").reverse().splice(0,2).reverse().join("."):"",m=c().then(e=>({path:"/",domain:e,maxAge:31536e3})),d=async(t,o)=>{null==e||e.set(t,o,await m)},r=async(o,n,a)=>{var s;if(!e)return null!==(s=await t.getItem(n))&&void 0!==s?s:await a();await _;let c=await e.get(o);return c||(c=await t.getItem(n)),c||(c=await a()),await d(o,c),t.removeItem(n),c},l=async(o,n,a)=>e?d(o,a):t.setItem(n,a),p=async(o,n)=>{if(!e)return t.removeItem(n);await _,await e.remove(o,{path:"/",domain:await c()})},u={SE:"sv",FI:"fi",DK:"da",NO:"no",LT:"lt"},v=async()=>n.ClientInformationIF.resolve().getClientInformation().then(e=>u[e.country]),y={getPreferredAudioLanguage:async()=>await r("PreferredAudioLanguage","preferredAudioLanguage",v),setPreferredAudioLanguage:async e=>e?l("PreferredAudioLanguage","preferredAudioLanguage",e):p("PreferredAudioLanguage","preferredAudioLanguage"),getPreferredSubtitleLanguage:async()=>await r("PreferredSubtitleLanguage","preferredSubtitleLanguage",v),setPreferredSubtitleLanguage:async e=>e?l("PreferredSubtitleLanguage","preferredSubtitleLanguage",e):p("PreferredSubtitleLanguage","preferredSubtitleLanguage"),getPreferredRegionalChannels:async()=>{const e=await r("RegionalChannels","RegionalChannelsPreference",async()=>"{}");try{return{...JSON.parse(e)}}catch(t){return o.error(`Failed to parse the regional channel cookie value "${e}"`,t),{}}},setPreferredRegionalChannels:async e=>l("RegionalChannels","RegionalChannelsPreference",JSON.stringify(e)),setPreferredAppLanguage:async e=>e?l("AppLanguage","appLanguage",e):p("AppLanguage","appLanguage"),getPreferredAppLanguage:async()=>
1await r("AppLanguage","appLanguage",v)},k=async t=>{const o=await(null==e?void 0:e.get(t));void 0!==o&&await d(t,o)},_=Promise.all([k("PreferredAudioLanguage"),k("PreferredSubtitleLanguage"),k("RegionalChannels"),k("PreferredAppLanguage")]);return y},{})},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/ErrorTypes.js"(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.PurchaseNotAllowedAccountRestrictedError=t.PurchaseNotAllowedClientRestrictedError=t.PurchaseNotAllowedCollectiveCustomerError=t.PurchaseNotAllowedError=t.PurchaseAlreadyChargedError=t.RentNotAllowedPrepaidError=t.RentNotAllowedClientRestrictedError=t.PinCodeError=t.NoPrepaidsError=void 0;class o extends Error{constructor(e){super(e),this.name="NoPrepaidsError",Object.setPrototypeOf(this,o.prototype)}}t.NoPrepaidsError=o;class n extends Error{constructor(e){super(e),this.name="PinCodeError",Object.setPrototypeOf(this,n.prototype)}}t.PinCodeError=n;class a extends Error{constructor(e){super(e),this.name="RentNotAllowedClientRestrictedError",Object.setPrototypeOf(this,a.prototype)}}t.RentNotAllowedClientRestrictedError=a;class s extends Error{constructor(e){super(e),this.name="RentNotAllowedPrepaidError",Object.setPrototypeOf(this,s.prototype)}}t.RentNotAllowedPrepaidError=s;class c extends Error{constructor(e){super(e),this.name="PurchaseAlreadyChargedError",Object.setPrototypeOf(this,c.prototype)}}t.PurchaseAlreadyChargedError=c;class i extends Error{constructor(e){super(e),this.name="PurchaseNotAllowedError",Object.setPrototypeOf(this,i.prototype)}}t.PurchaseNotAllowedError=i;class m extends Error{constructor(e){super(e),this.name="PurchaseNotAllowedCollectiveCustomerError",Object.setPrototypeOf(this,m.prototype)}}t.PurchaseNotAllowedCollectiveCustomerError=m;class d extends Error{constructor(e){super(e),this.name="PurchaseNotAllowedClientRestrictedError",Object.setPrototypeOf(this,d.prototype)}}t.PurchaseNotAllowedClientRestrictedError=d;class r extends Error{constructor(e){super(e),this.name="PurchaseNotAllowedAccountRestrictedError",Object.setPrototypeOf(this,r.prototype)}}t.PurchaseNotAllowedAccountRestrictedError=r},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/FormattedText.js"(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.FormattedText=void 0,t.FormattedText={convert:e=>e.split(/\r?\n/).filter(e=>e.trim().length>0).map(e=>{const t=e.match(/^\s*(#+)\s*(.*)$/);if(t){let o="HEADER3";switch(e=t[2],t[1]){case"#":o="HEADER1";break;case"##":o="HEADER2"}return{type:o,text:e}}const o=e.match(/^\s*\*\s*(.*)$/);return o?{type:"BULLETITEM",text:o[1]}:{type:"PARAGRAPH",text:e}})}},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/MediaPurchases.js"(e,t,o){t.J=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/MediaPurchaseIF.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/PrepaidIF.js");t.J=(0,n.createSingleton)("common-sdk-legacy-pack/MediaPurchases",()=>{const e=a.MediaPurchaseIF.resolve(),t=s.PrepaidIF.resolve();return{async getRentalPrepaids(){const e=Date.now();let o=0,n=0;return(await t.getPrepaids()).forEach(t=>{var a,s,c;"TVOD"===t.type&&(a=e,s=t.validFrom,c=t.validTo,(void 0===s||a>=s)&&(void 0===c||a<c))&&(o+=t.total,n+=t.remaining)}),{total:o,remaining:n}},preparePurchase:async(t,o)=>e.preparePurchase(t,o),commitPurchase:async(t,o)=>e.commitPurchase(t,o)}},{})},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/PreferredLanguages.js"(e,t,o){t.jf=t.LM=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/DevicePreferencesStorage.js");t.LM=["sv","fi","da","en","no","nb","lt"],t.LM,t.LM,t.jf=(0,n.createSingleton)("common-sdk-legacy-pack/PreferredLanguages",()=>
1{const e=a.DevicePreferencesStorage.instance();return{getPreferredAudioLanguage:()=>e.getPreferredAudioLanguage(),setPreferredAudioLanguage:t=>e.setPreferredAudioLanguage(t),getPreferredSubtitleLanguage:()=>e.getPreferredSubtitleLanguage(),setPreferredSubtitleLanguage:t=>e.setPreferredSubtitleLanguage(t),setPreferredAppLanguage:t=>e.setPreferredAppLanguage(t),getPreferredAppLanguage:()=>e.getPreferredAppLanguage()}},{})},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/PreferredRegionalChannels.js"(e,t,o){t.Z=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/DevicePreferencesStorage.js");t.Z=(0,n.createSingleton)("common-sdk-legacy-pack/RegionalChannels",()=>{const e=a.DevicePreferencesStorage.instance();return{getPreferredRegionalChannels:async()=>e.getPreferredRegionalChannels(),setPreferredRegionalChannels:t=>e.setPreferredRegionalChannels(t)}},{})},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/ServiceMessages.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceMessages.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/PrepaidIF.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/PurchasedProductIF.js");n.ServiceMessages.statics.events.rental.on(()=>{a.PrepaidIF.resolve().dataChange()}),n.ServiceMessages.statics.events.purchase.on(()=>{s.PurchasedProductIF.resolve().dataChange()})},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/TvClientBootIdHeader.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.TvClientBootIdHeader=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Boot.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/HttpRequestInterceptors.js"),s=new Set;a.HttpRequestInterceptors.provide(()=>{const e=n.Boot.instance();return[{interceptRequest(t){for(const o of s)if(t.url.startsWith(o.getUrl(""))){t.headers["tv-client-boot-id"]=e.getBootId();break}}}]}),t.TvClientBootIdHeader={addService(e){s.add(e)}}},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/TvPackages.js"(e,t,o){t.O=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/TvPackageIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js");t.O=(0,a.createSingleton)("common-sdk-legacy-pack/TvPackagePurchases",()=>{const e=n.TvPackageIF.resolve();return{preparePurchase:t=>e.preparePurchase(t),commitPurchase:(t,o)=>e.commitPurchase(t,o||{})}},{})},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/MediaPurchaseIF.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.MediaPurchaseIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.MediaPurchaseIF=(0,n.createAbstraction)("common-sdk-legacy-pack/abstractions/data/MediaPurchaseIF")},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/OfferingIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.OfferingIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.OfferingIF=(0,n.createAbstraction)("common-sdk-legacy-pack/abstractions/data/OfferingIF")},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/PrepaidIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.PrepaidIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.PrepaidIF=(0,n.createAbstraction)("common-sdk-legacy-pack/abstractions/data/PrepaidIF")},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/PriceIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.PriceIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.PriceIF=(0,n.createAbstraction)("common-sdk-legacy-pack/data/PriceIF")},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/PurchasedProductIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.PurchasedProductIF=t.PurchaseNotAllowedClientRestrictedError=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");var a=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/ErrorTypes.js");Object.defineProperty(t,"PurchaseNotAllowedClientRestrictedError",{enumerable:!0,get:function(){return a.PurchaseNotAllowedClientRestrictedError}}),t.PurchasedProductIF=(0,n.createAbstraction)("common-sdk-legacy-pack/abstractions/data/PurchasedProductIF")},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/TvPackageIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.TvPackageIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.TvPackageIF=(0,n.createAbstraction)("common-sdk-legacy-pack/abstractions/data/TvPackageIF")},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/implementations/data/MediaPurchase.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/MediaPurchaseIF.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js"),c=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/TvClientBootIdHeader.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js"),m=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/utils/index.js"),d=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/PrepaidIF.js"),r=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/ErrorTypes.js"),l=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js"),p="common-sdk-legacy-pack/abstractions/data/MediaPurchaseIF";a.MediaPurchaseIF.implement(()=>{const e=n.DataManager.instance(),t=s.ServiceConfig.getService("purchasegateway"),o=i.ClientInformationIF.resolve(),a=d.PrepaidIF.resolve();return c.TvClientBootIdHeader.addService(t),{preparePurchase:async(n,a)=>{const s=t.getUrl("/rest/secure/v1/mediaaccess/prepare"),c=t.getHeaders()||{},{transactionId:i,price:d,currency:r,chargingTypes:l,duration:u}=await e.sendPost(s,p,{headers:{...c,"tv-client-name":(await o.getClientInformation()).client.toLowerCase()},secure:!0,postAsJson:!0,post:{priceId:a,mediaId:n}});return{transactionId:i,chargingTypes:l,priceReadable:(0,m.getReadablePrice)(d,r),duration:u}},commitPurchase:async({transactionId:n},{pinCode:s,usePrepaid:c})=>{const i=t.getUrl("/rest/secure/v1/mediaaccess/commit"),m=t.getHeaders()||{};try{await e.sendPost(i,p,{headers:{...m,"tv-client-name":(await o.getClientInformation()).client.toLowerCase()},secure:!0,postAsJson:!0,post:{transactionId:n,...s&&{purchasePinCode:s},...c&&{usePersonalVoucher:c}}}),c&&a.dataChange()}catch(e){const t=(e=>{if(e instanceof l.RequestError)try{return JSON.parse(e.responseText)}catch(e){}})(e);if(t)switch(t.errorCode){case 709:throw new r.PinCodeError("Wrong pin code");case 1002:throw new r.NoPrepaidsError("No prepaid exist to rent item");case 20016:throw new r.RentNotAllowedClientRestrictedError("Client restricted from renting");case 20017:case 20021:throw new r.RentNotAllowedPrepaidError("Cannot use prepaid for the item")}throw e}}}})},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/implementations/data/Offering.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/OfferingIF.js"),c=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/TvClientBootIdHeader.js");s.OfferingIF.implement(()=>{const e=a.DataManager.instance(),t=n.ServiceConfig.getService("commercegateway");return c.TvClientBootIdHeader.addService(t),{async getOfferingMap(){const o=t.getUrl("/rest/v1/offerings"),n=await e.sendGet(o,"common-sdk-legacy-pack/abstractions/data/OfferingIF"),a={};return n.forEach(e=>{a[e.id]={id:e.id,type:e.type,description:e.description||[],legalInformation:e.legalInformation||[],purchaseInformation:e.purchaseInformation||[],purchasable:e.purchasable||!1,test:e.test||!1,price:e.price,priceInCents:"CENT"===e.currencyUnit,currency:e.currency,chargingTypes:e.chargingTypes,title:e.title,...e.purchaseDuration&&{purchaseDuration:e.purchaseDuration},...e.validFrom&&{validFrom:e.validFrom},...e.validTo&&{validTo:e.validTo}}}),a}}})},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/implementations/data/Prepaid.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/TvClientBootIdHeader.js"),c=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/PrepaidIF.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/CacheManager.js");c.PrepaidIF.implement(()=>{const e="common-sdk-legacy-pack/abstractions/data/PrepaidIF",t=i.CacheManager.instance(),o=a.DataManager.instance(),c=n.ServiceConfig.getService("purchasegateway");return s.TvClientBootIdHeader.addService(c),{async getPrepaids(){const t=c.getUrl("/rest/secure/v1/mediaprepaids"),n=[];return(await o.sendGet(t,e,{secure:!0,query:{listAllActive:!0}})).mediaPrepaids.forEach(e=>{"VOD"!==e.mediaType&&"PPV"!==e.mediaType||"ACTIVE"!==e.mediaPrepaidStatus&&"NOT_PRESENT"!==e.mediaPrepaidStatus||!(0===e.endTime||e.endTime>Date.now())||n.push(function(e){return{type:"VOD"===e.mediaType?"TVOD":"PPV",validFrom:e.startTime,total:e.quantity,remaining:e.timesLeft,...e.endTime&&{validTo:e.endTime}}}(e))}),n},dataChange(){t.clearCacheClass(e)}}})},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/implementations/data/Price.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/CacheManager.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/PriceIF.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"),c=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/TvClientBootIdHeader.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js"),m=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js"),d=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/utils/index.js"),r=({id:e,amount:t,currencyCode:o,priceType:n,accessType:a,val
1idFrom:s,validTo:c})=>({id:e,amount:t,currency:o,accessType:a,priceReadable:(0,d.getReadablePrice)(t,o),priceType:n,validFrom:new Date(s),validTo:new Date(c)});a.PriceIF.implement(()=>{n.CacheManager.instance();const e=s.DataManager.instance(),t=i.ServiceConfig.getService("purchasegateway");return c.TvClientBootIdHeader.addService(t),{getPrices:async()=>{const o=await m.ClientInformationIF.resolve().getClientInformation(),n=t.getUrl("/rest/v1/prices");return(await e.sendGet(n,"common-sdk-legacy-pack/abstractions/data/PriceIF",{headers:{...t.getHeaders(),"X-Country":o.country}})).map(r)}}})},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/implementations/data/PurchasedProduct.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/CacheManager.js"),c=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/TvClientBootIdHeader.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js"),m=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/PurchasedProductIF.js"),d=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/FormattedText.js"),r=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/utils/index.js");function l(e){return{id:e.product.id,offeringId:e.offering.id,purchaseTimestamp:new Date(e.purchaseDate).getTime(),...e.validFrom&&{validFrom:new Date(e.validFrom).getTime()},...e.validTo&&{validTo:new Date(e.validTo).getTime()}}}m.PurchasedProductIF.implement(()=>{const e="common-sdk-legacy-pack/abstractions/data/PurchasedProductIF",t=s.CacheManager.instance(),o=a.DataManager.instance(),m=i.ClientInformationIF.resolve(),p=n.ServiceConfig.getService("commercegateway"),u=n.ServiceConfig.getService("purchasegateway");return c.TvClientBootIdHeader.addService(p),c.TvClientBootIdHeader.addService(u),{async getPurchasedProducts(){const t=p.getUrl("/rest/secure/v1/product/subscribed");return(await o.sendGet(t,e,{secure:!0})).map(l)},async preparePurchase(t){const n=u.getUrl("/rest/secure/v1/purchase/telia/prepare");let a;try{a=await o.sendPost(n,e,{post:{type:"PRODUCT",id:t},postAsJson:!0,secure:!0,headers:{"tv-client-name":(await m.getClientInformation()).client.toLowerCase()}})}catch(e){if(e instanceof Error)throw(0,r.convertPurchaseGatewayError)(e);throw e}return{transactionId:a.transactionId,currency:a.currency,price:a.price,priceInCents:"CENT"===a.currencyUnit,chargingTypes:a.chargingTypes||[],terms:d.FormattedText.convert(a.terms)}},async commitPurchase(n,a){const s={};"VOUCHER"===a.chargingType?(s.type="VOUCHERID",s.value=a.voucherId):"INVOICE"===a.chargingType&&a.pinCode&&(s.type="PIN",s.value=a.pinCode);const c=u.getUrl("/rest/secure/v1/purchase/telia/commit");await o.sendPost(c,e,{post:{transactionId:n.transactionId,chargingType:a.chargingType,credentials:s},postAsJson:!0,secure:!0}),t.clearCacheClass(e)},dataChange(){t.clearCacheClass(e)}}})},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/implementations/data/TvPackage.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/ErrorTypes.js"),c=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/abstractions/data/TvPackageIF.js"),i=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/FormattedText.js"),m=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js"),d=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/Credentials.js"),r=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/utils/convertPurchaseGatewayError.js"),l=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/utils/index.js");c.TvPackageIF.implement(()=>{const e="common-sdk-legacy-pack/abstractions/data/TvPackageIF",t=a.ServiceConfig.getService("purchasegateway"),o=n.DataManager.instance(),c=m.ClientInformationIF.resolve(),p=d.Credentials.instance();return{async preparePurchase(n){const a=t.getUrl("/rest/secure/v1/purchase/tvpackage/prepare");try{const t=await o.sendPost(a,e,{post:{tvPackageId:n},postAsJson:!0,secure:!0,headers:{"tv-client-name":(await c.getClientInformation()).client.toLowerCase()}}),{transactionId:s,terms:m,detailedTerms:{newCommitmentPeriodEndDate:d,existingCommitmentPeriodEndDate:r,currencyCode:p,addPackage:{name:u,monthlyBasePrice:v,monthlyDiscountedPrice:y,monthlyDiscountLengthInMonths:k,oneTimeBasePrice:_,oneTimeDiscountedPrice:f,commitmentPeriodInMonths:g},deletePackages:h}}=t;return{transactionId:s,terms:i.FormattedText.convert(m),...d&&{newCommitmentPeriodEndDate:new Date(d)},...r&&{existingCommitmentPeriodEndDate:new Date(r)},newPackage:{name:u,priceReadable:(0,l.getReadablePrice)(v,p),...!!y&&{discountedPriceReadable:(0,l.getReadablePrice)(y,p)},...!!_&&{oneTimePriceReadable:(0,l.getReadablePrice)(_,p)},...!!f&&{oneTimeDiscountedPriceReadable:(0,l.getReadablePrice)(f,p)},...!!k&&{discountedMonths:k},commitmentPeriodInMonths:g},deletePackages:h.map(({name:e,monthlyBasePrice:t,commitmentEndDate:o})=>({name:e,priceReadable:(0,l.getReadablePrice)(t,p),...o&&{commitmentEndDate:new Date(o)}}))}}catch(e){if(e instanceof Error)throw(0,r.convertPurchaseGatewayError)(e);throw e}},async commitPurchase({transactionId:n},{pinCode:a}){const c=await p.isPinActive();if(c&&!a||a&&(!c||!await p.validatePin(a)))throw new s.PinCodeError;const i=t.getUrl("/rest/secure/v1/purchase/tvpackage/commit");try{await o.sendPost(i,e,{post:{transactionId:n},postAsJson:!0,secure:!0})}catch(e){if(e instanceof Error)throw(0,r.convertPurchaseGatewayError)(e);throw e}}}})},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/implementations/data/index.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/implementations/data/Offering.js"),o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/implementations/data/Prepaid.js"),o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/implementations/data/PurchasedProduct.js"),o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/implementations/data/TvPackage.js"),o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/implementations/data/Price.js"),o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/implementations/data/MediaPurchase.js")},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/implementations/index.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/implementations/data/index.js")},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/index.js"(e,t,o){o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/implementations/index.js"),o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/ServiceMessages.js"),o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/DevicePreferencesStorage.js")},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/utils/convertPurchaseGatewayError.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.convertPurchaseGatewayError=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/ErrorTypes.js");t.convertPurchaseGatewayError=e=>{if(e instanceof n.RequestServerError)try{switch(JSON.parse(e.responseText).errorCode){case 20011:return new a.PurchaseAlreadyChargedError;case 20012:return new a.PurchaseNotAllowedAccountRestrictedError;case 20013:case 20015:return new a.PurchaseNotAllowedError;case 20014:return new a.PurchaseNotAllowedCollectiveCustomerError;case 20016:return new a.PurchaseNotAllowedClientRestrictedError;default:return e}}catch(e){}return e}},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/utils/getReadablePrice.js"(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getReadablePrice=void 0;const o={SEK:"kr",DKK:"kr",NOK:"kr",EUR:"€"};t.getReadablePrice=(e,t)=>{const n=Math.round(e).toString(),a=n.slice(0,-2)||"0",s=("00"+n).slice(-2),c=o[t];let i=a;return"00"!==s&&(i+=`.${s}`),c&&(i+=` ${c}`),i}},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/utils/index.js"(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var a=Object.getOwnPropertyDescriptor(t,o);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,a)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),a=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),a(o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/utils/convertPurchaseGatewayError.js"),t),a(o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-authenticat_eff6e477fccb3c1035e3d63ff0e72c04/node_modules/@telia-company/tv.common-sdk-legacy-pack/dist/utils/getReadablePrice.js"),t)},"../../../node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@telia-company/tv.common-sdk-link-tracker/dist/getDeviceInfo.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.getDeviceInfo=t.clientPlatformMap=t.bowserPlatformMap=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js"),a=o("../../../node_modules/.pnpm/[email protected]/node_modules/bowser/es5.js");t.bowserPlatformMap={tv:"bigscreen",desktop:"computer",tablet:"tablet",mobile:"mobile"},t.clientPlatformMap={WEB:"computer",MARKETWEB:"computer",WEBPLAYER:"computer",ANDROIDTV:"bigscreen",ANDROIDSTB:"bigscreen",ANDROIDMOB:"mobile",IOS:"mobile",TVOS:"bigscreen",CCR:"bigscreen",SSTV:"bigscreen",IPTVSTB:"bigscreen",AISTB:"bigscreen",LGTV:"bigscreen",STBAPP:"bigscreen",ACCOUNTWEB:"computer",ADMINUI:"computer",CHECKOUTWEB:"computer",SETTINGSWEB:"computer"};t.getDeviceInfo=async()=>{var e;const o=n.ClientInformationIF.resolve(),{client:s}=await o.getClientInformation(),c=(0,a.getParser)(window.navigator.userAgent),i=c.getOSName().toLowerCase().replace(/\s/g,""),m=null===(e=c.getPlatformType())||void 0===e?void 0:e.toLowerCase().replace(/\s/g,""),d=await(async(e,o)=>o&&"undefined"!==o?t.bowserPlatformMap[o]||o:t.clientPlatformMap[e]||"computer")(s,m);return{os:i,platform:d,client:s}}},"../../../node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@telia-company/tv.common-sdk-link-tracker/dist/getLinkTrackerUrl.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.getLinkTrackerUrl=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js"),a={STAGE:{DK:"https://telia-play-link-tracker-dk.t6a-stage.net/event",FI:"https://telia-play-link-tracker-fi.t6a-stage.net/event",SE:"https://telia-play-link-tracker-se.t6a-stage.net/event",NO:"https://telia-play-link-tracker-no.t6a-stage.net/event"},PROD:{DK:"https://telia-play-link-tracker-dk.t6a.net/event",FI:"https://telia-play-link-tracker-fi.t6a.net/event",SE:"https://telia-play-link-tracker-se.t6a.net/event",NO:"https://telia-play-link-tracker-no.t6a.net/event"}};t.getLinkTrackerUrl=async()=>{var e;const t=n.ClientInformationIF.resolve(),{country:o,environment:s}=await t.getClientInformation(),c=null===(e=a[s])||void 0===e?void 0:e[o];if(!c)throw new Error(`No url found for country ${o} and environment ${s}`);return c}},"../../../node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@telia-company/tv.common-sdk-link-tracker/dist/index.js"(e,t,o){t.cI=void 0;var n=o("../../../node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@telia-company/tv.common-sdk-link-tracker/dist/trackDeepLink.js");Object.defineProperty(t,"cI",{enumerable:!0,get:function(){return n.trackDeepLink}});var a=o("../../../node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@telia-company/tv.common-sdk-link-tracker/dist/trackEvent.js")},"../../../node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@telia-company/tv.common-sdk-link-tracker/dist/trackDeepLink.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.trackDeepLink=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@telia-company/tv.common-sdk-link-tracker/dist/trackEvent.js");t.trackDeepLink=async({applicationId:e,mediaId:t})=>(0,n.trackEvent)({type:"deeplink",target_service:e,media_id:t})},"../../../node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@telia-company/tv.common-sdk-link-tracker/dist/trackEvent.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.trackEvent=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@telia-company/tv.common-sdk-link-tracker/dist/getDeviceInfo.js"),c=o("../../../node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@telia-company/tv.common-sdk-link-tracker/dist/getLinkTrackerUrl.js");t.trackEvent=async e=>{const t=await(0,c.getLinkTrackerUrl)(),{os:o,platform:i,client:m}=await(0,s.getDeviceInfo)(),d=n.DataManager.instance();try{await d.sendPost(t,"common-sdk-link-tracker",{post:{...e,os:o,platform:i},postAsJson:!0,responseType:"HTTP_RESPONSE",secure:!0,headers:{client:m}})}catch(e){if(e instanceof a.RequestError&&e.responseText)throw new Error(e.responseText);throw e}}},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-log/dist/HttpStatisticsBlacklister.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.addUrl=function(e){a.push(e)},t.removeUrl=function(e){const t=a.indexOf(e);-1!==t&&a.splice(t,1)};const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/StatisticsHttpBlacklisters.js"),a=[];n.StatisticsHttpBlacklisters.provide(()=>[{isStatisticsBlacklisted:e=>-1!==a.indexOf(e.request.url)}])},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-log/dist/index.js"(e,t,o){o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-log/dist/HttpStatisticsBlacklister.js")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-log/dist/providers/remoteclientlog/InformationCache.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.InformationCache=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/device/DeviceIdentificationIF.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/PlatformInformationIF.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/device/DeviceInformationIF.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js");t.InformationCache=(0,i.createStartupSingleton)("common-sdk-log/providers/remoteclientlog/LogObjectHelper.init",()=>{const e=c.DeviceInformationIF.resolve(),t=s.PlatformInformationIF.resolve(),o=n.ClientInformationIF.resolve();let i,m,d,r;return a.DeviceIdentificationIF.resolve().getDeviceId().then(e=>{i=e}).catch(e=>{i=e}),e.getDeviceInformation().then(e=>{m=e}).catch(e=>{m=e}),t.getPlatformInformation().then(e=>{d=e}).catch(e=>{d=e}),o.getClientInformation().then(e=>{r=e}).catch(e=>{r=e}),{getDeviceId:()=>i,getDeviceInformation:()=>m,getClientInformation:()=>r,getPlatformInformation:()=>d}},{})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-log/dist/providers/remoteclientlog/LogAppender.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Config.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/LogAppenders.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-log/dist/HttpStatisticsBlacklister.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/BeaconIF.js"),m=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-log/dist/providers/remoteclientlog/LogObjectHelper.js"),d=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js");a.LogAppenders.provide(()=>{const e=i.BeaconIF.resolveOptional(),t=c.DataManager.instance(),o=m.LogObjectHelper.instance();let a="";return[{isEnabled:()=>!0,log:(c,i,m,r,l,...p)=>{const u={sequence:c,timestamp:i,level:m,loggerId:r,message:l,args:p.map(e=>JSON.stringify(e))},v=(()=>{const e=n.Config.get("common-sdk/services/remoteclientlog/url");if(!e)throw new d.ConfigurationError('Missing configuration for "common-sdk/services/remoteclientlog/url" - it should point to the url used for logging to a remote client log');return e!==a&&(a.length>0&&s.removeUrl(a),s.addUrl(e),a=e),e})(),y=(e=>{const t=o.getLogObjectInfo(),{bootId:n,networkType:a,deviceId:s,deviceInformation:c,platformInformation:i,clientInformation:m,accountInformation:d}=t,[r,l,p]="<error>"===c||"<unknown>"===c?[c,c,c]:[c.deviceType,c.model,c.version],[u,v,y]="<error>"===i||"<unknown>"===i?[i,i,i]:[i.productName,i.name,i.version],[k,_,f,g,h,b]="<error>"===m||"<unknown>"===m?[m,m,m,m,m,m]:[m.name,m.client,m.version,m.environment,m.country,m.whiteLabelBrand],[j,w]=[null==d?void 0:d.id,null==d?void 0:d.username];return{bootId:n,networkType:a,deviceId:s,deviceType:r,model:l,productName:u,platformName:v,platformVersion:y,nativeVersion:p,uiName:k,client:_,uiVersion:f,environment:g,country:h,brand:b,accountId:j,username:w,logType:"LOG",payloads:[e]}})(u);if(e)try{if(e.sendBeacon(v,JSON.stringify(y)))return}catch{}t.sendPost(v,"common-sdk/collections/LogAppenders",{post:y,postAsJson:!0}).catch(()=>{})}}]})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-log/dist/providers/remoteclientlog/LogObjectHelper.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.LogObjectHelper=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Lifecycle.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Config.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-log/dist/providers/remoteclientlog/InformationCache.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Boot.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js");t.LogObjectHelper=(0,i.createSingleton)("common-sdk-log/providers/remoteclientlog/LogObjectHelper",()=>{const e=n.Lifecycle.instance(),t=c.Boot.instance(),o=s.InformationCache.instance();let i,m;return{getLogObjectInfo(){const n=o.getDeviceInformation(),s=o.getPlatformInformation(),c=o.getClientInformation(),d=o.getDeviceId(),r=function(){if(!i)try{return t.getBootId()}catch(e){e instanceof Error&&(i=e)}return i}(),l=function(){if(!m)try{return e.getDeviceStatus().network.type}catch(e){e instanceof Error&&(m=e)}return m}(),p=function(){const e=a.Config.get("common-sdk-authentication/account/id");if(void 0!==e)return{id:e,username:a.Config.get("common-sdk-authentication/account/username")}}();return{deviceInformation:n instanceof Error?"<error>":null!=n?n:"<unknown>",platformInformation:s instanceof Error?"<error>":null!=s?s:"<unknown>",clientInformation:c instanceof Error?"<error>":null!=c?c:"<unknown>",deviceId:d instanceof Error?"<error>":null!=d?d:"<unknown>",accountInformation:p,bootId:r instanceof Error?"<error>":r,networkType:l instanceof Error?"<error>":l}}}},{})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-log/dist/providers/remoteclientlog/index.js"(e,t,o){o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-log/dist/providers/remoteclientlog/LogAppender.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-log/dist/providers/remoteclientlog/InformationCache.js")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/Beacon.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/BeaconIF.js");"undefined"!=typeof navigator&&void 0!==navigator.sendBeacon&&n.BeaconIF.implement(()=>({sendBeacon(e,t){try{return navigator.sendBeacon(e,t)}catch(e){return!1}}}))},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/CookieStorage.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/CookieStorageIF.js").CookieStorageIF.implement(()=>{const e=()=>{const e={},t=document.cookie.split(";");for(let o of t){const[t,n]=o.split("=");void 0!==n&&(e[t.trim()]=n.trim())}return e},t=(e,t,o,n,a)=>{document.cookie=`${e}=${t}${o?`;path=${o}`:""}${n?`;domain=${n}`:""}${void 0!==a?`;Max-Age=${a}`:""};`};return{getDocumentLocation:async()=>({domain:document.domain,path:document.location.pathname}),get:async t=>e()[t],getAll:async()=>e(),remove:async(e,o)=>{const{path:n,domain:a}=o;t(e,"",n,a,0)},set:async(e,o,n)=>{const{domain:a,path:s,maxAge:c}=n;t(e,o,s,a,c)}}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/HttpRequest.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/HttpRequestIF.js");if("undefined"!=typeof fetch){const e=e=>{let t=[];for(const[o,n]of e.entries())t.push(`${o}: ${n}`);return t.join("\r\n")};n.HttpRequestIF.implement(()=>({send:async({method:t,headers:o,abortSignal:a,withCredentials:s},c,i)=>new Promise((m,d)=>{const r=new AbortController;null==a||a.listen(e=>{d(new n.AbortError(e||void 0)),r.abort()}),fetch(c,{method:t,signal:r.signal,headers:o,...s&&{credentials:"include"},..."GET"!==t&&i&&{body:i}}).then(async t=>{const{status:o,headers:n}=t;m({status:o,headers:e(n),text:await t.text()})}).catch(e=>{m({status:0,headers:"",text:e.message})})})}))}},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/Lifecycle.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/LifecycleIF.js").LifecycleIF.implement(()=>{let e,t="ACTIVE";function o(o){o!==t&&(t=o,e&&e())}return window.addEventListener("load",()=>o("ACTIVE")),window.addEventListener("unload",()=>o("INACTIVE")),window.addEventListener("beforeunload",()=>o("INACTIVE")),window.addEventListener("pageshow",()=>o("ACTIVE")),window.addEventListener("pagehide",()=>o("INACTIVE")),document.addEventListener("visibilitychange",()=>{switch(document.visibilityState){case"hidden":o("INACTIVE");break;case"visible":o("ACTIVE")}},!1),{getLifecycleInfo:()=>({state:t}),setChangeCallback:t=>e=t}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/LocalStorage.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/LocalStorageIF.js").LocalStorageIF.implement(()=>({getItem:async e=>window.localStorage.getItem(e)||void 0,setItem:async(e,t)=>{window.localStorage.setItem(e,t)},removeItem:async e=>{window.localStorage.removeItem(e)},listKeys:async()=>Object.keys(window.localStorage),listItems:async e=>{const t={};return e.forEach(e=>{t[e]=window.localStorage[e]}),t}}))},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/Network.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/NetworkIF.js").NetworkIF.implement(()=>{let e,t="UNKNOWN";function o(){e&&e()}return window.addEventListener("online",()=>{t="UNKNOWN",o()},!1),window.addEventListener("offline",()=>{t="NONE",o()},!1),{getNetworkInfo:()=>({type:t}),setChangeCallback:t=>e=t}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/PlatformInformation.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/PlatformInformationIF.js"),a=o("../../../node_modules/.pnpm/[email protected]/node_modules/bowser/es5.js");n.PlatformInformationIF.implement(()=>{const e=a.parse(window.navigator.userAgent),t="unknown";return{getPlatformInformation:async()=>{const o=e.os.name||t,n=e.os.version||t;let a=t;return e.browser.name&&e.browser.version?a=e.browser.name+" "+e.browser.version:e.browser.name&&(a=e.browser.name),{name:o,version:n,productName:a,browser:e.browser.name,browserVersion:e.browser.version}}}})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/Screen.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0});o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/ScreenIF.js").ScreenIF.implement(()=>({getDeviceResolution:()=>({width:window.screen.availWidth,height:window.screen.availHeight})}))},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/index.js"(e,t,o){o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/Screen.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/Network.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/Lifecycle.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/HttpRequest.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/LocalStorage.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/PlatformInformation.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/CookieStorage.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-platform-bom/dist/Beacon.js")},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-au_6ac7ec7dafe15e752f37f16cbd810432/node_modules/@telia-company/tv.common-sdk-remote-client-events/dist/MessageDispatcher.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingService=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-au_6ac7ec7dafe15e752f37f16cbd810432/node_modules/@telia-company/tv.common-sdk-remote-client-events/dist/abstractions/data/MessagingServiceIF.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceMessages.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/device/DeviceIdentificationIF.js");t.MessagingService=(0,n.createStartupSingleton)("common-sdk-remote-client-events/dist/MessagingService.MessagingService",()=>{const e=a.MessagingServiceIF.resolve(),o=s.Log.instance()(t.MessagingService.id),n=i.DeviceIdentificationIF.resolve(),m={MY_LIST:{version:"v1",emit:({payload:e})=>{c.ServiceMessages.statics.events.myList.emit(e)}},PURCHASE:{version:"v1",emit:({payload:e})=>{c.ServiceMessages.statics.events.purchase.emit(e)}},CONTINUE_WATCHING:{version:"v2",emit:({payload:e})=>{c.ServiceMessages.statics.events.continueWatching.emit(e)}},RENTAL:{version:"v1",emit:({payload:e})=>{c.ServiceMessages.statics.events.rental.emit(e)}},EST:{version:"v1",emit:({payload:e})=>{c.ServiceMessages.statics.events.est.emit(e)}},CONCURRENT_STREAMS:{version:"v1",emit:({payload:e})=>{c.ServiceMessages.statics.events.concurrentStream.emit(e)}},NPVR:{version:"v1",emit:({payload:e})=>{c.ServiceMessages.statics.events.npvr.emit(e)}},LOGOUT:{version:"v1",emit:()=>{c.ServiceMessages.statics.events.logout.emit({})}},LOGOUT_DEVICE:{version:"v1",emit:({payload:{deviceId:e}},{deviceId:t})=>{e==t&&c.ServiceMessages.statics.events.logout.emit({})}},FAVORITE_CHANNELS:{version:"v1",emit:({payload:e})=>{c.ServiceMessages.statics.events.favoriteChannels.emit(e)}},PROFILE:{version:"v1",emit:({payload:e})=>{c.ServiceMessages.statics.events.profile.emit(e)}},SELECTIONMENU_PURCHASE:{version:"v1",emit:({payload:e})=>{c.ServiceMessages.statics.events.selectionMenu.emit(e)}},COMMAND:{version:"v1",emit:({payload:e},{deviceId:t})=>{if(e.deviceIds&&e.deviceIds.length>0&&!e.deviceIds.includes(t))return;const{deviceIds:o,...n}=e;c.ServiceMessages.statics.events.command.emit(n)}},CONFIG:{version:"v1",emit:({payload:e},{deviceId:t})=>{if(e.deviceIds&&e.deviceIds.length>0&&!e.deviceIds.includes(t))return;const{deviceIds:o,...n}=e;c.ServiceMessages.statics.events.config.emit(n)}},ENGAGEMENT_ACCESS:{version:"v1",emit:({payload:e})=>{c.ServiceMessages.statics.events.engagementAccess.emit(e)}},FAVORITE_TEAMS:{version:"v1",emit:({payload:e})=>{c.ServiceMessages.statics.events.favoriteTeams.emit(e)}}};e.setMessageCallback(async e=>{const t=await n.getDeviceId();
1e.forEach(e=>{if(o.info("received message",e),t!==e.deviceId){const n=e.type;m[n]&&e.version===m[n].version&&(o.info("dispatching event for message",e),m[n].emit(e,{deviceId:t}))}})})},{})},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-au_6ac7ec7dafe15e752f37f16cbd810432/node_modules/@telia-company/tv.common-sdk-remote-client-events/dist/abstractions/data/MessagingServiceIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.MessagingServiceIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.MessagingServiceIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk-remote-client-events/dist/abstractions/data/MessagingServiceIF.MessagingServiceIF")},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-au_6ac7ec7dafe15e752f37f16cbd810432/node_modules/@telia-company/tv.common-sdk-remote-client-events/dist/implementations/data/BackoffHelper.js"(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getBackoffTimeoutMs=void 0;const o=1.5,n=2,a=1e3,s=6e5;t.getBackoffTimeoutMs=(e=0)=>{const t=Math.random()*(n-o)+o,c=Math.max(a,e);return c*t<=s?Math.round(c*t):c}},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-au_6ac7ec7dafe15e752f37f16cbd810432/node_modules/@telia-company/tv.common-sdk-remote-client-events/dist/implementations/data/MessagingService.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js"),a=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-au_6ac7ec7dafe15e752f37f16cbd810432/node_modules/@telia-company/tv.common-sdk-remote-client-events/dist/abstractions/data/MessagingServiceIF.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-authentication/dist/Authentication.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"),m=o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-au_6ac7ec7dafe15e752f37f16cbd810432/node_modules/@telia-company/tv.common-sdk-remote-client-events/dist/implementations/data/BackoffHelper.js"),d=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js");a.MessagingServiceIF.implement(()=>{const e=d.ClientInformationIF.resolve().getClientInformation(),t=s.Authentication.instance(),o=i.DataManager.instance(),a=c.Log.instance()("common-sdk-remote-client-events/implementations/data/MessagingService"),r=n.ServiceConfig.getService("remoteclientevents");let l,p,u,v,y;const k=()=>{v=(0,m.getBackoffTimeoutMs)(v),u=setTimeout(_,v)};async function _(){if(clearTimeout(u),await t.isLoggedin())try{const t=r.getUrl("/rest/secure/v1/authorize"),{key:n}=await o.sendPost(t,"common-sdk-remote-client-events/abstractions/data/MessagingServiceIF",{secure:!0,headers:{"tv-client-name":(await e).client.toLowerCase(),"x-country":(await e).country}});let s=r.getUrl(`/rest/v1/subscribe/${n}`);l&&(s+=`?lastEventId=${l}`),null==p||p.close(),p=new EventSource(s),p.onmessage=e=>{v=0,e.lastEventId&&(l=e.lastEventId);try{const t=JSON.parse(e.data);if("MESSAGE"!==t.type)return;const o=JSON.parse(t.message);try{null==y||y([o])}catch{}}catch(e){a.error("Failed to parse message from remote-client-events",e)}},p.onopen=()=>{},p.onerror=()=>{k()}}catch(e){a.error("Failed to authorize towards remote-client-events",e),k()}else null==p||p.close()}return s.Authentication.statics.events.authentication.on(()=>{_()}),{setMessageCallback:e=>{if(y)throw new Error("setMessageCallback is already set, please use common-sdk/ServiceMessages for consuming events");y=e}}})},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-au_6ac7ec7dafe15e752f37f16cbd810432/node_modules/@telia-company/tv.common-sdk-remote-client-events/dist/implementations/data/index.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-au_6ac7ec7dafe15e752f37f16cbd810432/node_modules/@telia-company/tv.common-sdk-remote-client-events/dist/implementations/data/MessagingService.js")},"../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-au_6ac7ec7dafe15e752f37f16cbd810432/node_modules/@telia-company/tv.common-sdk-remote-client-events/dist/index.js"(e,t,o){o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-au_6ac7ec7dafe15e752f37f16cbd810432/node_modules/@telia-company/tv.common-sdk-remote-client-events/dist/MessageDispatcher.js"),o("../../../node_modules/.pnpm/@[email protected]_@telia-company+tv.common-sdk-au_6ac7ec7dafe15e752f37f16cbd810432/node_modules/@telia-company/tv.common-sdk-remote-client-events/dist/implementations/data/index.js")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-statistics-http/dist/HttpStatisticsBlacklister.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.addUrl=function(e){a.push(e)},t.removeUrl=function(e){const t=a.indexOf(e);-1!==t&&a.splice(t,1)};const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/StatisticsHttpBlacklisters.js"),a=[];n.StatisticsHttpBlacklisters.provide(()=>[{isStatisticsBlacklisted:e=>-1!==a.indexOf(e.request.url)}])},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-statistics-http/dist/helpers/AccountInfoHelper.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.AccountInfoHelper=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Config.js");t.AccountInfoHelper=(0,n.createSingleton)("common-sdk-statistics-http/dist/helpers/AccountHelper",()=>({getAccountInformation:()=>{const[e,t]=[a.Config.get("common-sdk-authentication/account/id"),a.Config.get("common-sdk-authentication/account/username")];if(void 0!==e)return{id:e,username:t}}}),{})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-statistics-http/dist/index.js"(e,t,o){o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-statistics-http/dist/HttpStatisticsBlacklister.js")},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-statistics-http/dist/providers/remoteclientlog/InformationCache.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.InformationCache=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/device/DeviceIdentificationIF.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/PlatformInformationIF.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/device/DeviceInformationIF.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js");t.InformationCache=(0,i.createStartupSingleton)("common-sdk-statistics-http/providers/remoteclientlog/LogObjectHelper.init",()=>{const e=c.DeviceInformationIF.resolve(),t=s.PlatformInformationIF.resolve(),o=n.ClientInformationIF.resolve();let i,m,d,r;return a.DeviceIdentificationIF.resolve().getDeviceId().then(e=>{i=e}).catch(e=>{i=e}),e.getDeviceInformation().then(e=>{m=e}).catch(e=>{m=e}),t.getPlatformInformation().then(e=>{d=e}).catch(e=>{d=e}),o.getClientInformation().then(e=>{r=e}).catch(e=>{r=e}),{getDeviceId:()=>i,getDeviceInformation:()=>m,getClientInformation:()=>r,getPlatformInformation:()=>d}},{})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-statistics-http/dist/providers/remoteclientlog/StatisticsHttpAppender.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/StatisticsHttpAppenders.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Config.js"),s=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-statistics-http/dist/HttpStatisticsBlacklister.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Lifecycle.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Boot.js"),m=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"),d=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-statistics-http/dist/helpers/AccountInfoHelper.js"),r=o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-statistics-http/dist/providers/remoteclientlog/InformationCache.js"),l=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/BeaconIF.js"),p=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js"),u="common-sdk-statistics-http/remoteclientlog/postInterval",v="common-sdk-statistics-http/remoteclientlog/maxPayloads";a.Config.setDefault(u,6e4),a.Config.setDefault(v,5),n.StatisticsHttpAppenders.provide(()=>{const e=c.Lifecycle.instance(),t=i.Boot.instance(),o=r.InformationCache.instance(),n=d.AccountInfoHelper.instance(),y=l.BeaconIF.resolveOptional(),k=m.DataManager.instance(),_=[];let f,g="";const h=()=>{if(_.length>0){const c=(()=>{const e=a.Config.get("common-sdk/services/remoteclientlog/url");if(!e)throw new p.ConfigurationError('Missing configuration for "common-sdk/services/remoteclientlog/url" - it should point to the url used for logging to a remote client log');return e!==g&&(g.length>0&&s.removeUrl(g),s.addUrl(e),g=e),e})(),i=(a=>{const s=o.getDeviceInformation(),c=o.getPlatformInformation(),i=o.getClientInformation(),m=o.getDeviceId(),d=n.getAccountInformation(),[r,l,p]=s instanceof Error?["<error>","<error>","<error>"]:s?[s.deviceType,s.model,s.version]:["<unknown>","<unknown>","<unknown>"],[u,v,y]=c instanceof Error?["<error>","<error>","<error>"]:c?[c.productName,c.name,c.version]:["<unknown>","<unknown>","<unknown>"],[k,_,f,g,h,b]=i instanceof Error?["<error>","<error>","<error>","<error>","<error>","<error>"]:i?[i.name,i.client,i.version,i.environment,i.country,i.whiteLabelBrand]:["<unknown>","<unknown>","<unknown>","<unknown>","<unknown>","<unknown>"],[j,w]=[null==d?void 0:d.id,null==d?void 0:d.username];return{bootId:t.getBootId(),networkType:e.getDeviceStatus().network.type,deviceId:m instanceof Error?"<error>":null!=m?m:"<unknown>",deviceType:r,model:l,productName:u,platformName:v,platformVersion:y,nativeVersion:p,uiName:k,client:_,uiVersion:f,environment:g,country:h,brand:b,accountId:j,username:w,logType:"STATISTICS_HTTP",payloads:a}})(_.splice(0));y&&y.sendBeacon(c,JSON.stringify(i))||k.sendPost(c,"common-sdk/collections/StatisticsHttpAppenders",{post:i,postAsJson:!0}).catch(e=>{})}clearTimeout(f),f=void 0};return c.Lifecycle.statics.events.deviceLifecycle.on(e=>{"ACTIVE"!==e.lifecycle.state&&h()}),[{isEnabled:()=>!0,log:(t,o,n)=>{_.push({timestamp:o,sequence:t,request:n.request,response:n.response}),_.length>=Math.min(a.Config.get(v),5)||"ACTIVE"!==e.getDeviceStatus().lifecycle.state?h():!f&&a.Config.get(u)&&(f=setTimeout(h,a.Config.get(u)))}}]})},"../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-statistics-http/dist/providers/remoteclientlog/index.js"(e,t,o){o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-statistics-http/dist/providers/remoteclientlog/StatisticsHttpAppender.js"),o("../../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@telia-company/tv.common-sdk-statistics-http/dist/providers/remoteclientlog/InformationCache.js")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.createAbstraction=t.Abstraction=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js");class a{constructor(e){this.id=e,this.resolving=!1,this.resolved=!1,this.interceptors=[]}implementDefault(e){if(this.resolved)throw new Error(`The abstraction ${this.id} has been resolved. No default implementers allowed`);if(this.defaultImplementer)throw new Error(`There is already a default implementer for the abstraction ${this.id}`);this.defaultImplementer=e}implement(e){if(this.resolved)throw new Error(`The abstraction ${this.id} has been resolved. No implementers allowed`);if(this.implementer)throw new Error(`There is already an implementer for the abstraction ${this.id}`);this.implementer=e}override(e){if(this.resolved)throw new Error(`The abstraction ${this.id} has been resolved. No overriders allowed`);if(this.overrider)throw new Error(`There is already an overrider for the abstraction ${this.id}`);this.overrider=e}intercept(e){if(this.resolved)throw new Error(`The abstraction ${this.id} has been resolved. No interceptors allowed`);this.interceptors.push(e)}resolve(){if(!this.resolved){if(this.resolving)throw new Error(`Circular dependency detected - the abstraction ${this.id} is already being resolved`);this.resolving=!0;try{let e;this.overrider&&(e=this.overrider()),!e&&this.implementer&&(e=this.implementer()),!e&&this.defaultImplementer&&(e=this.defaultImplementer()),e&&this.interceptors.forEach(t=>{const o=t(e);o&&(e=o)}),this.resolved=!0,this.resolvedImplementation=e}finally{this.resolving=!1}}if(!this.resolvedImplementation)throw new n.NoImplementationError(this,`No implementation found for abstraction ${this.id}`);return this.resolvedImplementation}resolveOptional(){try{return this.resolve()}catch(e){if(e instanceof n.NoImplementationError&&e.abstraction===this)return;throw e}}async resolveLazy(){return this.resolved?this.resolve():Promise.resolve().then(()=>{try{return Promise.resolve(this.resolve())}catch(e){return Promise.reject(e)}})}async resolveOptionalLazy(){return this.resolved?this.resolveOptional():Promise.resolve().then(()=>{try{return Promise.resolve(this.resolveOptional())}catch(e){return Promise.reject(e)}})}}t.Abstraction=a;t.createAbstraction=e=>new a(e)},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/AdaptiveDate.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.AdaptiveDate=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js");t.AdaptiveDate=(0,n.createSingleton)("@telia-company/tv.common-sdk/dist/AdaptiveDate.AdaptiveDate",()=>{let e=0;const t=Date,o=function(...n){if(!new.target)return(new o).toString();switch(n.length){case 0:return new t(t.now()+e);case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3]);case 5:return new t(n[0],n[1],n[2],n[3],n[4]);case 6:return new t(n[0],n[1],n[2],n[3],n[4],n[5]);case 7:return new t(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}};o.now=function(){return t.now()+e},o.UTC=function(...e){return t.UTC.apply(this,e)},o.parse=function(e){return t.parse(e)},o.prototype=Date.prototype,Date=o;return{setTime:o=>{e=new t(o).getTime()-t.now()},reset:()=>{e=0},getDeltaTime:()=>e}},{})},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Boot.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.Boot=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/UuidIF.js");t.Boot=(0,n.createSingleton)("@telia-company/tv.common-sdk/dist/Boot.Boot",()=>{const e=a.UuidIF.resolve().createUuid();return{getBootId:()=>e}},{})},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/CacheManager.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.CacheManager=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Config.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js"),c="common-sdk-base/CacheManager/maxSize";a.Config.setDefault(c,1048576),t.CacheManager=(0,n.createSingleton)("@telia-company/tv.common-sdk/dist/CacheManager.CacheManager",({events:e})=>{const o=s.Log.instance()(t.CacheManager),n={};let i={},m=[],d=0;function r(e){d-=i[e].dataSize,delete i[e],m.splice(m.indexOf(e),1)}function l(e){var t;return(null===(t=i[e])||void 0===t?void 0:t.expireTs)<Date.now()}function p(){r(m[m.length-1])}function u(e,t){for(!function(e,t){for(let e in i)if(l(e)&&(r(e),d+t<=a.Config.get(c)))break}(0,t);y.getCurrentSize()&&y.getCurrentSize()+t>a.Config.get(c);)p()}function v(e,t){n[e]=n[e]||[];const o=n[e].indexOf(t);-1!==o&&n[e].splice(o,1),n[e].unshift(t)}const y={getMaxSize:()=>a.Config.get(c),getCurrentSize:()=>d,clear:()=>{const t=Object.keys(n);i={},m=[],d=0,e.clearCacheClass.emit({cacheClasses:t})},clearCacheKey:e=>{i[e]&&r(e)},clearCacheClass:t=>{n[t]&&(n[t].forEach(e=>{y.clearCacheKey(e)}),delete n[t]),e.clearCacheClass.emit({cacheClasses:[t]})},isCacheValid:e=>!l(e),get:e=>{var t;const o=null===(t=i[e])||void 0===t?void 0:t.value;if(o&&(m.splice(m.indexOf(e),1),m.unshift(e)),!o||!l(e))return o},set:(e,t,n,s)=>{const l=function(e){var t,o=encodeURI(e);return o.includes("%")?(t=o.split("%").length-1,t+=o.length-3*t):t=o.length,t}(n);l<=a.Config.get(c)?(u(0,l),function(e,t,o,n,a){const s=Date.now()+n;m.includes(t)&&r(t),m.unshift(t),v(e,t),i[t]={value:o,dataSize:a,expireTs:s},d+=a}(e,t,n,s,l)):o.warn("Failed to store value in cache. The value exceeded the maximum allowed size",t)},addToCacheClass:(e,t)=>{i[t]?v(e,t):o.warn(`Failed to add cache key "${t}" to cache class "${e}" - there is no value stored for the cache key`)}};return y},{events:{clearCacheClass:new n.Event}})},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Collection.js"(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.createCollection=t.Collection=void 0;class o{constructor(e){this.id=e,this.collecting=!1,this.collected=!1,this.items=[],this.providers=[],this.interceptors=[]}provide(e){if(this.collected)throw new Error("The collection has been collected - no more providers allowed");this.providers.push(e)}intercept(e){if(this.collected)throw new Error("The collection has been collected - no more interceptors allowed");this.interceptors.push(e)}collect(){if(!this.collected){if(this.collecting)throw new Error(`Circular dependency detected - the collection ${this.id} is already being collected`);this.collecting=!0;try{let e=[];this.providers.forEach(t=>{e=e.concat(t())}),this.interceptors.forEach(t=>{const o=t(e);o&&(e=o)}),this.collected=!0,this.items=e}finally{this.collecting=!1}}return this.items.slice()}async collectLazy(){return this.collected?this.collect():Promise.resolve().then(()=>{try{return Promise.resolve(this.collect())}catch(e){return Promise.reject(e)}})}}t.Collection=o;t.createCollection=e=>new o(e)},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/CollectionGroup.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.createCollectionGroup=t.CollectionGroup=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Collection.js");class a{constructor(e){this.id=e,this.keyedCollections={}}getCollection(e){const t=this.keyedCollections[e];if(t)return t;const o=(0,n.createCollection)(e);return this.keyedCollections[e]=o,o}provide(e,t){this.getCollection(e).provide(t)}keys(){return Object.keys(this.keyedCollections)}collect(e){return this.getCollection(e).collect()}collectLazy(e){return this.getCollection(e).collectLazy()}intercept(e,t){this.getCollection(e).intercept(t)}}t.CollectionGroup=a;t.createCollectionGroup=e=>new a(e)},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Config.js"(e,t){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.Config=void 0;const o={};t.Config={get:e=>o[e],set:(e,t)=>{o[e]=t},setConfigs:e=>{for(let o in e)t.Config.set(o,e[o])},setDefault:(e,n)=>{e in o||t.Config.set(e,n)},setDefaults:e=>{for(let o in e)t.Config.setDefault(o,e[o])},getKeys:()=>Object.keys(o)}},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/DataManager.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.DataManager=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/AuthenticationWrapperIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/HttpRequest.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js"),m=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/utils/index.js");t.DataManager=(0,c.createSingleton)("@telia-company/tv.common-sdk/dist/DataManager.DataManager",()=>{const e=a.HttpRequest.instance(),o=n.AuthenticationWrapperIF.resolveOptionalLazy(),c=s.Log.instance()(t.DataManager),d=e=>encodeURIComponent(e).replace(/%2C/g,",");let r=!1;function l(e){const t=[];for(let o in e){const n=e[o];if(n instanceof Array)if(0===n.length)t[t.length]=o+"=";else for(let e of n)t[t.length]=o+"="+d(e);else void 0!==n&&(t[t.length]=o+"="+d(String(n)))}return t.join("&")}async function p(t,n,a,s={}){const d={method:t,url:n,requestData:s,headers:(0,m.normalizeHeaders)(s.headers||{})},p=await o,u=p&&s.secure;!s.secure||p||r||(r=!0,c.warn("Secure request attempted, but no AuthenticationWrapperIF implementation available"));try{let t,o=0;const m=async()=>{let n;u&&await p.request(d,o);let c=d.url;const i=l(d.requestData.query||{});if(i&&(c=function(e,t){var o=e.indexOf("?"),n=e.indexOf("#"),a=-1===n?"":e.substr(n),s=a?e.substr(0,n):e;return-1===o?s+"?"+t+a:s+"&"+t+a}(c,i)),d.requestData.postAsJson){const e=d.requestData.post||"{}";d.headers["content-type"]="application/json",n="string"==typeof e?e:JSON.stringify(e)}else{let e;"string"==typeof d.requestData.post?n=d.requestData.post:d.requestData.post&&(e=d.requestData.post,n=l(e)),n&&(d.headers["content-type"]="application/x-www-form-urlencoded")}if(t=await e.sendRequest(d.method,c,a,{postData:n,headers:d.headers,abortSignal:s.abortSignal}),u){(await p.response(d,t)).retryRequest&&(o+=1,await m())}};return await m(),function(e,t,o){const{status:n}=o;if(0===n)throw new i.RequestUnspecifiedError(e,o.status,o.text,void 0,o.headers);if(401===n)throw new i.RequestNotAuthenticatedError(e,o.status,o.text,void 0,o.headers);if(404===n)throw new i.RequestContentNotFoundError(e,o.status,o.text,void 0,o.headers);if(n<200||n>299)throw new i.RequestServerError(e,o.status,o.text,void 0,o.headers);if((!t.responseType||"JSON"===t.responseType)&&function(e){var t=function(e,t){e=e.toLowerCase();for(let o in t)if(o.toLowerCase()===e)return t[o]}("content-type",e);return!(!t||"application/json"!==t.split(";")[0].trim())}(o.headers)){if(""===o.text.trim())return;try{return JSON.parse(o.text)}catch(t){if(!(t instanceof Error))throw"Not Error";throw c.error(`Failed to parse JSON response for url: ${e}`,t.message),new i.RequestParseError(e,o.status,o.text,void 0,o.headers)}}return o}(n,s,t)}finally{u&&p.finally(d)}}return{sendPost:async(e,t,o)=>p("POST",e,t,o),sendPut:async(e,t,o)=>p("PUT",e,t,o),sendGet:async(e,t,o)=>p("GET",e,t,o),sendDelete:async(e,t,o)=>p("DELETE",e,t,o),sendPatch:async(e,t,o)=>p("PATCH",e,t,o),createAbortSignal:()=>e.createAbortSignal()}},{})},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js"(e,t){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.ConfigurationError=t.SignalAlreadyEmittedError=t.AbortError=t.NoImplementationError=t.RequestServerError=t.RequestParseError=t.RequestContentNotFoundError=t.RequestNotAuthenticatedError=t.RequestUnspecifiedError=t.RequestError=void 0;class o extends Error{constructor(e,t,n,a,s){super(a),this.url=e,this.status=t,this.responseText=n,this.name="RequestError",this.responseHeaders=s,Object.setPrototypeOf(this,o.prototype)}}t.RequestError=o;class n extends o{constructor(e,t,o,a,s){super(e,t,o,a,s),this.name="RequestUnspecifiedError",Object.setPrototypeOf(this,n.prototype)}}t.RequestUnspecifiedError=n;class a extends o{constructor(e,t,o,n,s){super(e,t,o,n,s),this.name="RequestNotAuthenticatedError",Object.setPrototypeOf(this,a.prototype)}}t.RequestNotAuthenticatedError=a;class s extends o{constructor(e,t,o,n,a){super(e,t,o,n,a),this.name="RequestContentNotFoundError",Object.setPrototypeOf(this,s.prototype)}}t.RequestContentNotFoundError=s;class c extends o{constructor(e,t,o,n,a){super(e,t,o,n,a),this.name="RequestParseError",Object.setPrototypeOf(this,c.prototype)}}t.RequestParseError=c;class i extends o{constructor(e,t,o,n,a){super(e,t,o,n,a),this.name="RequestServerError",Object.setPrototypeOf(this,i.prototype)}}t.RequestServerError=i;class m extends Error{constructor(e,t){super(t),this.abstraction=e,this.name="NoImplementationError",Object.setPrototypeOf(this,m.prototype)}}t.NoImplementationError=m;class d extends Error{constructor(e){super(e),this.name="AbortError",Object.setPrototypeOf(this,d.prototype)}}t.AbortError=d;class r extends Error{constructor(e){super(e),this.name="SignalAlreadyEmittedError",Object.setPrototypeOf(this,r.prototype)}}t.SignalAlreadyEmittedError=r;class l extends Error{constructor(e){super(e),this.name="ConfigurationError",Object.setPrototypeOf(this,l.prototype)}}t.ConfigurationError=l},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/HttpRequest.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRequest=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Config.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/CacheManager.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/AdaptiveDate.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Statistics.js"),m=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/HttpRequestIF.js"),d=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/HttpRequestInterceptors.js"),r=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/StatisticsHttpAppenders.js"),l=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Lifecycle.js"),p=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/utils/index.js"),u=/\r?\n/g,v="common-sdk/HttpRequest/timeout",y="common-sdk/HttpRequest/baseUrl";a.Config.setDefault(v,6e4),a.Config.setDefault(y,""),t.HttpRequest=(0,n.createSingleton)("@telia-company/tv.common-sdk/dist/HttpRequest.HttpRequest",()=>{const e=c.AdaptiveDate.instance(),t=s.CacheManager.instance(),o=i.Statistics.instance(),n=m.HttpRequestIF.resolve(),k=d.HttpRequestInterceptors.collect(),_={};let f;function g(){const t=Date.now()-e.getDeltaTime();for(let e in _){const o=_[e],n=o[0];n&&t>=n.expireAtTimestamp&&(o.shift(),n.abortSignal.emit("Aborted due to timeout"))}f&&clearTimeout(f),f=setTimeout(g,1e3)}function h(e){const t={};
1return e.split(u).filter(Boolean).forEach(e=>{const[o,...n]=e.split(":");t[o.trim().toLowerCase()]=n.join(":").trim()}),t}function b(e){for(let[t,o]of Object.entries(e))if("cache-control"===t.toLowerCase())for(let e of o.split(","))if(e=e.trim().toLowerCase(),e.startsWith("max-age="))return 1e3*parseInt(e.substring(8),10)}function j(e,t,n,a,s,c){const i={method:a.method,url:e,headers:{...a.headers},timestamp:t,cancelled:s};a.postData&&(i.postData=a.postData);const m=c&&!w(c)&&function(e){const t={message:""};try{const o=JSON.parse(e);for(let[e,n]of Object.entries(o))"errorCode"===e&&void 0!==n?t.code=String(n):"errorMessage"===e&&void 0!==n?t.message=String(n):t[e]=n}catch(o){t.message=e}return t}(c.text)||void 0,d={timestamp:n};c&&(d.status=c.status,d.headers={...c.headers}),m&&(d.error=m),o.log(r.StatisticsHttpAppenders,{request:i,response:d})}function w(e){return[200,201,204].includes(e.status)}l.Lifecycle.statics.events.deviceStatus.on(e=>{var t;"ACTIVE"===(null===(t=e.lifecycle)||void 0===t?void 0:t.state)&&g()});return{async sendRequest(o,s,c,i={}){g();const d=i.headers||{},r=i.abortSignal||new m.AbortSignal,l=(i.postData,{method:o,headers:(0,p.normalizeHeaders)(d),url:s,postData:i.postData,withCredentials:i.withCredentials});let u,f;for(let e of k){if(e.interceptRequest){const t=e.interceptRequest(l);l.headers=(0,p.normalizeHeaders)(l.headers),t&&(u=t)}if(e.interceptRequestQueue){const t=e.interceptRequestQueue(l);t&&(f=t)}}try{await async function(t,o,n={}){const s=Date.now()-e.getDeltaTime();let c;if(n.timeout)c=n.timeout+s;else if(0!==n.timeout){const e=a.Config.get(v);e&&(c=e+s)}return new Promise((e,n)=>{const a={expireAtTimestamp:c,abortSignal:o,executeRequest:e};_[t]=_[t]||[],_[t].push(a),o.listen(e=>{const o=_[t].indexOf(a);o>0&&_[t].splice(o,1),n(e?new m.AbortError(e):new m.AbortError)}),1===_[t].length&&e()})}(l.url,r,f);const i=Date.now()-e.getDeltaTime();try{const m="GET"===o&&0!==b(d)?t.get(s):void 0;let v;if(m)v=JSON.parse(m);else if(u)v=u,v.headers=(0,p.normalizeHeaders)(v.headers);else{const e=/^https?:\/\//i.test(l.url)?l.url:a.Config.get(y)+l.url,t=await n.send({method:l.method,headers:l.headers,abortSignal:r,withCredentials:l.withCredentials},e,l.postData);v={status:t.status,headers:h(t.headers),text:t.text}}j(s,i,Date.now()-e.getDeltaTime(),l,!1,v),v.headers=(0,p.normalizeHeaders)(v.headers);for(let e of k)e.interceptResponse&&(e.interceptResponse(l,v),v.headers=(0,p.normalizeHeaders)(v.headers));return m?t.addToCacheClass(c,s):function(e,o,n,a){if("GET"===e&&w(a)){const e=b(a.headers)||0;e>0&&t.set(n,o,JSON.stringify(a),e)}}(l.method,s,c,v),v}catch(e){throw e instanceof m.AbortError?j(s,i,Date.now(),l,!0):j(s,i,Date.now(),l,!1),e}}finally{!function(e){_[e].shift(),_[e].length&&_[e][0].executeRequest()}(l.url)}},createAbortSignal:()=>new m.AbortSignal}},{})},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Lifecycle.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.Lifecycle=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Config.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/AdaptiveDate.js"),i=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/NetworkIF.js"),m=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/LifecycleIF.js"),d=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/SystemIF.js"),r="common-sdk/Lifecycle/TimeService/adaptiveDate",l="common-sdk/Lifecycle/TimeService/margin";s.Config.setDefault(r,!1),s.Config.setDefault(l,3e4),t.Lifecycle=(0,n.createStartupSingleton)("@telia-company/tv.common-sdk/dist/Lifecycle.Lifecycle",({events:e})=>{const o=a.Log.instance(),n=c.AdaptiveDate.instance(),p=d.SystemIF.resolveOptional(),u=i.NetworkIF.resolveOptional(),v=m.LifecycleIF.resolveOptional(),y=o(t.Lifecycle);function k(){const t={};u&&(t.network=u.getNetworkInfo()),v&&(t.lifecycle=v.getLifecycleInfo()),e.deviceStatus.emit(t)}null==u||u.setChangeCallback(function(){k(),e.deviceNetwork.emit({network:u.getNetworkInfo()})}),null==v||v.setChangeCallback(function(){k(),e.deviceLifecycle.emit({lifecycle:v.getLifecycleInfo()})}),null==p||p.getSystemInfo().then(({time:e})=>{var t;t=e,s.Config.get(r)&&Math.abs(t-Date.now())>s.Config.get(l)&&(y.info("Client time inaccurate, client time was "+Date.now()+", adjusting to server time "+t),n.setTime(t))});return{getDeviceStatus:()=>({network:u?u.getNetworkInfo():{type:"UNKNOWN"},lifecycle:v?v.getLifecycleInfo():{state:"ACTIVE"}}),getSystemInfo:async()=>await(null==p?void 0:p.getSystemInfo())}},{events:{deviceNetwork:new n.Event,deviceLifecycle:new n.Event,deviceStatus:new n.Event}})},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/LocalStorage.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.LocalStorage=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/LocalStorageIF.js");t.LocalStorage=(0,n.createSingleton)("@telia-company/tv.common-sdk/dist/LocalStorage.LocalStorage",()=>{const e=a.LocalStorageIF.resolve(),t=e=>`${e}#`,o=(e,o)=>`${t(e)}${o}`,n={get:async(t,n)=>e.getItem(o(t,n)),set:async(t,n,a)=>{void 0!==a?await e.setItem(o(t,n),a):await e.removeItem(o(t,n))},list:async e=>{const o=a.LocalStorageIF.resolve(),n=t(e);return(await o.listKeys()).filter(e=>e.startsWith(n)).map(e=>e.substring(n.length))},clear:async t=>{const a=(await n.list(t)).map(n=>e.removeItem(o(t,n)));await Promise.all(a)}};return n},{})},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.Log=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Config.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/LogAppenders.js");a.Config.setDefault("common-sdk/Log/logLevel","ERROR");const c={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,FATAL:5};t.Log=(0,n.createSingleton)("@telia-company/tv.common-sdk/dist/Log.Log",()=>{function e(e){const t=a.Config.get("common-sdk/Log/logLevel");return c[t]<=c[e]}function t(t,o,n,a,c){const i=s.LogAppenders.collect();for(let s of i)try{s.isEnabled()&&e(n)&&s.log(o,Date.now(),n,t,a,...c)}catch(e){}}return function(e){let o=0,n="string"==typeof e?e:e.id;return{trace:(e,...a)=>{t(n,++o,"TRACE",e,a)},debug:(e,...a)=>{t(n,++o,"DEBUG",e,a)},info:(e,...a)=>{t(n,++o,"INFO",e,a)},warn:(e,...a)=>{t(n,++o,"WARN",e,a)},error:(e,...a)=>{t(n,++o,"ERROR",e,a)},fatal:(e,...a)=>{t(n,++o,"FATAL",e,a)}}}},{})},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceConfig=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Config.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js"),s=/^common-sdk\/services\/(.+)\/url$/;function c(e){const t=n.Config.get(`common-sdk/services/${e}/url`);if(!t)throw new a.ConfigurationError(`Missing configuration for service '${e}' base url. Configure 'common-sdk/services/${e}/url' to point to a valid base url`);return t}t.ServiceConfig={getService:e=>(c(e),{getUrl(t){let o=c(e);return o.endsWith("/")&&(o=o.slice(0,-1)),t.startsWith("/")||(t=`/${t}`),`${o}${t}`},getHeaders:()=>n.Config.get(`common-sdk/services/${e}/headers`)}),getServiceMap(){const e=n.Config.getKeys().map(e=>e.match(s)),t={};return e.forEach(e=>{if(e){const o=e[1];t[o]=this.getService(o)}}),t}}},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceMessageConfigHandler.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceMessageConfigHandler=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Config.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js");t.ServiceMessageConfigHandler=(0,a.createSingleton)("ServiceMessageConfigHandler",()=>({handleConfigServiceMessage:e=>{n.Config.setConfigs(e)}}),{})},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceMessageConfigListener.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceMessageConfigHandler.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceMessages.js");(0,o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js").createStartupSingleton)("ServiceMessageConfigHandler",()=>{a.ServiceMessages.statics.events.config.on(e=>n.ServiceMessageConfigHandler.instance().handleConfigServiceMessage(e))},{})},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceMessages.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.ServiceMessages=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js");t.ServiceMessages=(0,n.createSingleton)("@telia-company/tv.common-sdk/dist/ServiceMessages.ServiceMessages",()=>{},{events:{continueWatching:new n.Event,concurrentStream:new n.Event,myList:new n.Event,purchase:new n.Event,rental:new n.Event,selectionMenu:new n.Event,est:new n.Event,npvr:new n.Event,logout:new n.Event,favoriteChannels:new n.Event,profile:new n.Event,config:new n.Event,command:new n.Event,engagementAccess:new n.Event,favoriteTeams:new n.Event}})},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Signal.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.Signal=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js");t.Signal=class{constructor(){this.listeners=[],this.emitted=!1}listen(e){this.emitted?e(this.emitReason):this.listeners.push(e)}isEmitted(){return this.emitted}emit(e){if(this.emitted)throw new n.SignalAlreadyEmittedError("The signal has already been emitted");this.emitted=!0,this.emitReason=e,this.listeners.forEach(t=>t(e)),this.listeners=[]}}},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var a=Object.getOwnPropertyDescriptor(t,o);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,a)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[t.length]=o);return t},e(t)};return function(t){if(t&&t.__esModule)return t;var o={};if(null!=t)for(var s=e(t),c=0;c<s.length;c++)"default"!==s[c]&&n(o,t,s[c]);return a(o,t),o}}();Object.defineProperty(t,"__esModule",{value:!0}),t.event=t.createStartupSingleton=t.createSingleton=t.Singleton=t.Event=void 0;const c=Promise.resolve().then(()=>s(o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js")));let i=[],m=!1;class d{constructor(){this.listenerReferenceId=0,this.listeners=[]}on(e,...t){const o={id:++this.listenerReferenceId};return this.listeners.push({reference:o,callback:e,args:t}),o}off(e){const t=this.listeners.findIndex(t=>t.reference===e);-1!==t&&this.listeners.splice(t,1)}once(e,...t){const o=this.on((t,...n)=>{this.off(o),e(t,...n)},...t);return o}emit(e){this.listeners.forEach(t=>{try{t.callback(e,...t.args)}catch(t){c.then(({Log:o})=>{o.instance()("Event").error("Failed to emit event",e,t)})}})}}t.Event=d;class r{constructor(e,t,o){this.id=e,this.creator=t,this.statics=o,this.interceptors=[],this.instancing=!1}intercept(e){if(this.createdInstance)throw new Error("Cannot intercept an already instanced singleton");this.interceptors.push(e)}
1instance(){if(m||(m=!0,i.forEach(e=>{e!==this&&e.instance()}),i=[]),!this.createdInstance){if(this.instancing)throw new Error(`Circular dependency detected - the singleton ${this.id} is already being instanced`);this.instancing=!0;try{this.createdInstance=this.creator(this.statics),this.interceptors.forEach(e=>{const t=e(this.createdInstance);t&&(this.createdInstance=t)})}finally{this.instancing=!1}}return this.createdInstance}async instanceLazy(){return this.createdInstance?this.instance():Promise.resolve().then(()=>{try{return Promise.resolve(this.instance())}catch(e){return Promise.reject(e)}})}}t.Singleton=r;t.createSingleton=(e,t,o)=>new r(e,t,o);t.createStartupSingleton=(e,t,o)=>{const n=new r(e,t,o);return i.push(n),n};t.event=()=>new d},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Statistics.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.Statistics=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Singleton.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Log.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/StatisticsBlacklisters.js");t.Statistics=(0,n.createSingleton)("@telia-company/tv.common-sdk/dist/Statistics.Statistics",()=>{const e=a.Log.instance()(t.Statistics),o=[];return{log:(t,n)=>{const a=++function(e){let t=o.find(t=>t.collection===e);return t||(t={collection:e,sequence:0},o.push(t)),t}(t).sequence,c=Date.now(),i=t.collect(),m=s.StatisticsBlacklisters.collect(t.id);for(let e of m)if(e.isStatisticsBlacklisted&&e.isStatisticsBlacklisted(n))return;for(let e of m)if(e.prepareStatistics)try{e.prepareStatistics(n)}catch(e){}for(let t of i)try{t.isEnabled()&&t.log(a,c,n)}catch(t){e.error("Failed to log statistics",t)}}}},{})},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/AuthenticationWrapperIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.AuthenticationWrapperIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.AuthenticationWrapperIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk/dist/abstractions/AuthenticationWrapperIF.AuthenticationWrapperIF")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/SystemIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.SystemIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.SystemIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk/dist/abstractions/SystemIF.SystemIF")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/UuidIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.UuidIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.UuidIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk/dist/abstractions/UuidIF.UuidIF")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.ClientInformationIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.ClientInformationIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk/dist/abstractions/client/ClientInformationIF.ClientInformationIF")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/device/DeviceIdentificationIF.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.DeviceIdentificationIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.DeviceIdentificationIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk/dist/abstractions/device/DeviceIdentificationIF.DeviceIdentificationIF")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/device/DeviceInformationIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.DeviceInformationIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.DeviceInformationIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk/dist/abstractions/device/DeviceInformationIF.DeviceInformationIF")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/BeaconIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.BeaconIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.BeaconIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk/dist/abstractions/platform/BeaconIF.BeaconIF")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/CookieStorageIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.CookieStorageIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.CookieStorageIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk/dist/abstractions/platform/CookieStorageIF.CookieStorageIF")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/HttpRequestIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRequestIF=t.AbortSignal=t.AbortError=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Signal.js");var s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ErrorTypes.js");Object.defineProperty(t,"AbortError",{enumerable:!0,get:function(){return s.AbortError}});class c extends a.Signal{}t.AbortSignal=c,t.HttpRequestIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk/dist/abstractions/platform/HttpRequestIF.HttpRequestIF")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/LifecycleIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.LifecycleIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.LifecycleIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk/dist/abstractions/platform/LifecycleIF.LifecycleIF")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/LocalStorageIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.LocalStorageIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.LocalStorageIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk/dist/abstractions/platform/LocalStorageIF.LocalStorageIF")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/NetworkIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.NetworkIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk/dist/abstractions/platform/NetworkIF.NetworkIF")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/PlatformInformationIF.js"(e,t,o){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.PlatformInformationIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.PlatformInformationIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk/dist/abstractions/platform/PlatformInformationIF.PlatformInformationIF")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/ScreenIF.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenIF=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Abstraction.js");t.ScreenIF=(0,n.createAbstraction)("@telia-company/tv.common-sdk/dist/abstractions/platfrom/ScreenIF.ScreenIF")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/HttpRequestInterceptors.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRequestInterceptors=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Collection.js");t.HttpRequestInterceptors=(0,n.createCollection)("@telia-company/tv.common-sdk/dist/collections/HttpRequestInterceptors.HttpRequestInterceptors")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/LogAppenders.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.LogAppenders=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Collection.js");t.LogAppenders=(0,n.createCollection)("@telia-company/tv.common-sdk/dist/collections/LogAppenders.LogAppenders")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/StatisticsBlacklisters.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.createStatisticsBlacklistCollection=t.StatisticsBlacklisters=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/CollectionGroup.js");t.StatisticsBlacklisters=(0,n.createCollectionGroup)("@telia-company/tv.common-sdk/dist/collections/StatisticsBlacklisters.StatisticsBlacklisters");t.createStatisticsBlacklistCollection=e=>t.StatisticsBlacklisters.getCollection(e.id)},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/StatisticsHttpAppenders.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.StatisticsHttpAppenders=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/Collection.js");t.StatisticsHttpAppenders=(0,n.createCollection)("@telia-company/tv.common-sdk/dist/collections/StatisticsHttpAppenders.StatisticsHttpAppenders")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/StatisticsHttpBlacklisters.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),t.StatisticsHttpBlacklisters=void 0;const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/StatisticsBlacklisters.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/StatisticsHttpAppenders.js");t.StatisticsHttpBlacklisters=(0,n.createStatisticsBlacklistCollection)(a.StatisticsHttpAppenders)},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/implementations/DeviceIdentification.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/device/DeviceIdentificationIF.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/LocalStorage.js"),s=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/platform/CookieStorageIF.js"),c=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/UuidIF.js");n.DeviceIdentificationIF.implementDefault(()=>{const e=a.LocalStorage.instance(),t=s.CookieStorageIF.resolveOptional(),o=c.UuidIF.resolve(),n=async(e,t)=>{const o=(await e.getDocumentLocation()).domain.split(".").reverse().splice(0,2).reverse().join(".");await e.set("common-sdk-device-id",t,{domain:o,path:"/",maxAge:31536e3})};return{getDeviceId:async()=>
1{if(t){const o=await t.get("common-sdk-device-id");if(o)return e.set("common-sdk","deviceId",void 0),await n(t,o),o}let a=await e.get("common-sdk","deviceId");return a&&t?(await e.set("common-sdk","deviceId",void 0),await n(t,a),a):(a||(a=o.createUuid(),t?await n(t,a):await e.set("common-sdk","deviceId",a)),a)}}})},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/implementations/Uuid.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/abstractions/UuidIF.js").UuidIF.implementDefault(()=>({createUuid:()=>{const e=[];for(var t=0;t<16;t++)e.push(Math.floor(256*Math.random()));return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){const t=[];for(var o=0;o<256;++o)t[o]=(o+256).toString(16).substr(1);let n=0;return t[e[n++]]+t[e[n++]]+t[e[n++]]+t[e[n++]]+"-"+t[e[n++]]+t[e[n++]]+"-"+t[e[n++]]+t[e[n++]]+"-"+t[e[n++]]+t[e[n++]]+"-"+t[e[n++]]+t[e[n++]]+t[e[n++]]+t[e[n++]]+t[e[n++]]+t[e[n++]]}(e)}}))},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/implementations/index.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/implementations/Uuid.js"),o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/implementations/DeviceIdentification.js")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/index.js"(e,t,o){o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/implementations/index.js"),o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/providers/index.js"),o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceMessageConfigListener.js")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/providers/ServiceHeaderHttpRequestInterceptor.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0});const n=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/collections/HttpRequestInterceptors.js"),a=o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/ServiceConfig.js");n.HttpRequestInterceptors.provide(()=>[{interceptRequest(e){const t=a.ServiceConfig.getServiceMap();for(let[o,n]of Object.entries(t)){const t=n.getHeaders();t&&e.url.startsWith(n.getUrl(""))&&(e.headers={...e.headers,...t})}}}])},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/providers/index.js"(e,t,o){Object.defineProperty(t,"__esModule",{value:!0}),o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/providers/ServiceHeaderHttpRequestInterceptor.js")},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/utils/index.js"(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var a=Object.getOwnPropertyDescriptor(t,o);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,a)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),a=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),a(o("../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/utils/normalizeHeaders.js"),t)},"../../../node_modules/.pnpm/@[email protected]/node_modules/@telia-company/tv.common-sdk/dist/utils/normalizeHeaders.js"(e,t){Object.defineProperty(t,"__esMo
1dule",{value:!0}),t.normalizeHeaders=void 0;t.normalizeHeaders=e=>{const t={};for(const[o,n]of Object.entries(e))t[o.toLowerCase()]=n;return t}}}]);

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.