{"version":3,"file":"client.mjs","sources":["../app/constants.ts","../app/utils.ts","../app/blackweek.client.ts"],"sourcesContent":["const PSS_URL_PROD = 'https://internet.check24.de/';\nconst PSS_URL_TEST = 'https://internet.check24-test.de/';\n\n/** Known non-production host environments use the shared Internet test API. */\nexport function getPssUrl(environment?: string | null): string {\n    return environment === 'dev' || environment === 'int' || environment === 'test' ? PSS_URL_TEST : PSS_URL_PROD;\n}\n\nfunction getApiUrl(path: string, environment?: string | null): string {\n    // Only the local Vite demo uses same-origin mock endpoints.\n    if (import.meta.env.DEV && import.meta.env.MODE === 'demo') return `/api/${path}`;\n    return `${getPssUrl(environment)}api/${path}`;\n}\n\n/** Public cashback endpoint, requested in parallel as the fallback for unavailable personalization. */\nexport function getMaxCashbackApiUrl(environment?: string | null): string {\n    return getApiUrl('max-cashback', environment);\n}\n\n/** Promotion endpoint, always requested with credentials so the server can authorize personalization. */\nexport function getPromotionApiUrl(environment?: string | null): string {\n    return getApiUrl('promotion', environment);\n}\n\nexport const CASHBACK_FALLBACK = 415;\n\n/** Tracking values of the jump-in link. Keep them in sync with `extraVars.href` in manifest.json. */\nexport const JUMP_IN = {\n    tid3: 'webteaser_blackweek',\n    source: 'home',\n} as const;\n\n/**\n * Plectrum light sweep: frames 44–85 of the 24 fps video, stored as a sprite sheet of 7×6 frames.\n * Each 140×92 frame stores white light with alpha transparency, painted without blend modes or masks.\n */\nexport const SWEEP = {\n    fps: 24,\n    firstFrame: 44,\n    frameCount: 42,\n    columns: 7,\n    rows: 6,\n} as const;\n\nexport const labels = {\n    cashbackLabelTop: 'Bis zu',\n    discountLabelBottom: 'Rabatt',\n    linkLabel: 'Zum Black Week Angebot',\n} as const;\n","import {\n    CASHBACK_FALLBACK,\n    getMaxCashbackApiUrl,\n    getPromotionApiUrl,\n    getPssUrl,\n    JUMP_IN,\n    labels,\n    SWEEP,\n} from './constants';\n\nexport function isHeroSlot(slotWidth: number, viewportWidth: number = globalThis.innerWidth ?? 0): boolean {\n    return viewportWidth >= 1024 && slotWidth >= 400 && slotWidth <= 559;\n}\n\n/** Sprite frame for a video time, or `null` while the sweep is not playing. */\nexport function sweepFrameIndex(mediaTime: number): number | null {\n    const index = Math.floor(mediaTime * SWEEP.fps + 0.01) - SWEEP.firstFrame;\n    return index >= 0 && index < SWEEP.frameCount ? index : null;\n}\n\n/** `background-position` that shows one frame of the sprite sheet. */\nexport function sweepSpritePosition(index: number): string {\n    const column = index % SWEEP.columns;\n    const row = Math.floor(index / SWEEP.columns);\n    return `${(column * 100) / (SWEEP.columns - 1)}% ${(row * 100) / (SWEEP.rows - 1)}%`;\n}\n\nconst amountFormat = new Intl.NumberFormat('de-DE');\n\n/** Whole euros with a German thousands separator, e.g. `1.250`. */\nexport function formatAmount(value: number): string {\n    return amountFormat.format(value);\n}\n\nexport function formatCashback(value: number): string {\n    return `${formatAmount(value)}€`;\n}\n\ntype MaxCashbackResponse = {\n    readonly value?: unknown;\n};\n\ntype PromotionResponse = {\n    readonly total?: unknown;\n    readonly zip?: unknown;\n    readonly parameters?: unknown;\n};\n\n/** Query parameters of the Internet comparison box, e.g. `{ zip: '80636', customerType: 'change' }`. */\nexport type JumpInParams = Readonly<Record<string, string>>;\n\nexport type CashbackBadge = {\n    readonly amount: number;\n    readonly label: string;\n    /** Present only for a personalized badge whose parameters the comparison box can express. */\n    readonly jumpInParams?: JumpInParams;\n};\n\nconst isFilled = (value: unknown): value is string => typeof value === 'string' && value.trim() !== '';\n\n/**\n * Maps the `parameters` of the promotion response to the query keys of the comparison box,\n * so the landing page calculates with the inputs the API used. Values the box cannot express\n * are left out and stay with its own logic.\n */\nexport function toComparisonQueryParams(parameters: unknown): JumpInParams {\n    if (typeof parameters !== 'object' || parameters === null || Array.isArray(parameters)) return {};\n    const p = parameters as Record<string, unknown>;\n    const query: Record<string, string> = {};\n\n    if (typeof p.tv === 'boolean') query.tariffType = p.tv ? 'tv' : 'internet';\n\n    // The API calls a provider change `changer`, the box calls it `change`. `upgrade` has no counterpart.\n    const customerType = p.customerType === 'new' ? 'new' : p.customerType === 'changer' ? 'change' : undefined;\n    if (customerType) query.customerType = customerType;\n\n    // The box ignores an address with a missing part, so send all four values or none.\n    const { zip, city, street, streetNumber } = p;\n    if (\n        typeof zip === 'string' &&\n        /^\\d{5}$/.test(zip) &&\n        isFilled(city) &&\n        isFilled(street) &&\n        isFilled(streetNumber)\n    ) {\n        Object.assign(query, { zip, city, street, streetNumber });\n    }\n\n    if (typeof p.router === 'boolean') query.router = String(p.router);\n    // Known age: young below 31, as in Go. Unknown age (`young: null`): leave `young` out.\n    const young =\n        typeof p.young === 'boolean' ? String(p.young) : typeof p.age === 'number' ? String(p.age < 31) : undefined;\n    if (young) query.young = young;\n\n    // A leadId makes the name optional; without one the box needs the name.\n    if (customerType === 'change') {\n        if (isFilled(p.leadId)) query.leadId = p.leadId;\n        if (isFilled(p.providerText)) query.currentProviderName = p.providerText;\n        if (typeof p.providerId === 'number' && p.providerId > 0) query.currentProviderId = String(p.providerId);\n    }\n\n    return query;\n}\n\n/** Landing page URL with the comparison parameters. The tracking values always win. */\nexport function buildJumpInUrl(environment: string | null | undefined, params: JumpInParams): string {\n    const url = new URL(getPssUrl(environment));\n    for (const [key, value] of Object.entries(params)) url.searchParams.set(key, value);\n    url.searchParams.set('tid3', JUMP_IN.tid3);\n    url.searchParams.set('source', JUMP_IN.source);\n    return url.toString();\n}\n\n/**\n * Fail fast when the API is slow or unreachable (e.g. Factory layout check on localhost).\n * The badge is hidden until the call settles, so the wait stays short.\n */\nconst FETCH_TIMEOUT_MS = 300;\n\n/** Parsed JSON body, or `null` on network errors, timeouts, non-2xx responses and invalid JSON. */\nasync function fetchJson(url: string, init: RequestInit = {}): Promise<unknown> {\n    try {\n        const timeout = AbortSignal.timeout(FETCH_TIMEOUT_MS);\n        const signal = init.signal ? AbortSignal.any([init.signal, timeout]) : timeout;\n        const response = await fetch(url, { ...init, signal });\n        return response.ok ? await response.json() : null;\n    } catch {\n        return null;\n    }\n}\n\n/** Public cashback in whole euros, used when no personalized discount is available; errors use the fallback. */\nexport async function fetchMaxCashback(environment?: string | null, signal?: AbortSignal): Promise<number> {\n    const data = (await fetchJson(getMaxCashbackApiUrl(environment), { signal })) as MaxCashbackResponse | null;\n    return typeof data?.value === 'number' ? data.value : CASHBACK_FALLBACK;\n}\n\n/**\n * Always attempt session-authorized personalization; return `null` when unavailable.\n * A valid `total` is delivered in whole euros and takes priority over public cashback.\n */\nexport async function fetchPromotionDiscount(\n    environment?: string | null,\n): Promise<{ amount: number; zip?: string; params?: JumpInParams } | null> {\n    const data = (await fetchJson(getPromotionApiUrl(environment), {\n        credentials: 'include',\n    })) as PromotionResponse | null;\n    const total = data?.total;\n    if (typeof total !== 'number' || !Number.isFinite(total)) return null;\n\n    if (total <= 0) return null;\n    const zip = typeof data?.zip === 'string' && /^\\d{5}$/.test(data.zip) ? data.zip : undefined;\n    const params = toComparisonQueryParams(data?.parameters);\n    return {\n        amount: total,\n        ...(zip ? { zip } : {}),\n        ...(Object.keys(params).length > 0 ? { params } : {}),\n    };\n}\n\n/** Fetch in parallel; a valid personalized discount cancels the public cashback request. */\nexport async function fetchCashbackBadge(environment?: string | null): Promise<CashbackBadge> {\n    const cashbackController = new AbortController();\n    const discountRequest = fetchPromotionDiscount(environment);\n    const cashbackRequest = fetchMaxCashback(environment, cashbackController.signal);\n    const discount = await discountRequest;\n    if (discount !== null) {\n        cashbackController.abort();\n        return {\n            amount: discount.amount,\n            label: discount.zip ? `${labels.discountLabelBottom} in ${discount.zip}` : labels.discountLabelBottom,\n            ...(discount.params ? { jumpInParams: discount.params } : {}),\n        };\n    }\n    return { amount: await cashbackRequest, label: labels.discountLabelBottom };\n}\n","import type { SiteEngineObservedAttribute } from '@check24/vanilla-component-types/client';\nimport { labels } from './constants';\nimport {\n    buildJumpInUrl,\n    fetchCashbackBadge,\n    formatAmount,\n    formatCashback,\n    isHeroSlot,\n    sweepFrameIndex,\n    sweepSpritePosition,\n} from './utils';\nimport clientStyles from './assets/blackweek.css?inline';\nimport sweepSprite from './assets/blackweek-plectrum-sweep.webp?inline';\n\nexport default class BlackweekTile extends HTMLElement {\n    private shadow: ShadowRoot | null = null;\n    private requestId = 0;\n    private resizeObserver: ResizeObserver | null = null;\n    private stopSweep: (() => void) | null = null;\n\n    static get observedAttributes(): SiteEngineObservedAttribute[] {\n        return ['vanilla-home-env'];\n    }\n\n    connectedCallback(): void {\n        if (!this.shadow) {\n            this.shadow = this.attachShadow({ mode: 'closed' });\n            this.shadow.innerHTML = `\n                <style>${clientStyles}</style>\n                <section class=\"mw-root\">\n                    <header class=\"mw-headline\">\n                        <h2 class=\"mw-title\">Internet</h2>\n                        <p class=\"mw-subline\"><span>Bis zu <span class=\"mw-headline-amount\"></span> Rabatt und</span><br>BlackTrikot sichern</p>\n                    </header>\n                    <div class=\"mw-loading\" aria-hidden=\"true\">\n                        <div class=\"mw-loading-subline\">\n                            <span class=\"mw-loading-line mw-loading-bar\">Bis zu 1.250 € Rabatt und</span>\n                            <span class=\"mw-loading-line mw-loading-bar\">BlackTrikot sichern</span>\n                        </div>\n                        <div class=\"mw-loading-badge\">\n                            <div class=\"mw-loading-label mw-loading-bar\"></div>\n                            <div class=\"mw-loading-amount mw-loading-bar\"></div>\n                            <div class=\"mw-loading-label mw-loading-bar\"></div>\n                        </div>\n                    </div>\n                    <div class=\"mw-sweep\" aria-hidden=\"true\"></div>\n                    <div class=\"mw-cashback\">\n                        <span class=\"mw-cashback-label\">${labels.cashbackLabelTop}</span>\n                        <span class=\"mw-cashback-amount\"></span>\n                        <span class=\"mw-cashback-label mw-cashback-kind\"></span>\n                    </div>\n                    <a class=\"mw-link\" aria-label=\"${labels.linkLabel}\"></a>\n                </section>\n            `;\n        }\n        this.updatePromotion();\n        window.addEventListener('resize', this.updatePromotion);\n        this.resizeObserver ??= new ResizeObserver(this.updatePromotion);\n        this.resizeObserver.observe(this.assignedSlot?.parentElement ?? this.parentElement ?? this);\n        this.startSweep();\n        void this.loadBadge();\n    }\n\n    disconnectedCallback(): void {\n        ++this.requestId;\n        this.stopSweep?.();\n        this.stopSweep = null;\n        window.removeEventListener('resize', this.updatePromotion);\n        this.resizeObserver?.disconnect();\n        this.resizeObserver = null;\n    }\n\n    attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void {\n        if (oldValue !== newValue && this.isConnected && this.shadow) void this.loadBadge();\n    }\n\n    private updatePromotion = (): void => {\n        const parent = this.assignedSlot?.parentElement ?? this.parentElement ?? this;\n        if (isHeroSlot(parent.clientWidth, window.innerWidth)) this.setAttribute('data-promotion', 'top');\n        else this.removeAttribute('data-promotion');\n    };\n\n    /**\n     * Follows the decoded frame of the host video, so the sweep stays in sync with the plectrum even when playback\n     * stalls. Factory mounts the widget inside a Shadow DOM, outside the video's light DOM container.\n     */\n    private startSweep(): void {\n        this.stopSweep?.();\n        this.stopSweep = null;\n        const container = this.findVideoContainer();\n        const sweep = this.shadow?.querySelector<HTMLElement>('.mw-sweep');\n        if (!container || !sweep) return;\n        sweep.style.backgroundImage = `url(${sweepSprite})`;\n\n        const render = (mediaTime: number): void => {\n            const index = sweepFrameIndex(mediaTime);\n            if (index !== null) sweep.style.backgroundPosition = sweepSpritePosition(index);\n            sweep.style.visibility = index === null ? 'hidden' : 'visible';\n        };\n        let activeVideo: HTMLVideoElement | null = null;\n        let stopFrames: (() => void) | null = null;\n        const bindVideo = (): void => {\n            const video = container.querySelector('video');\n            if (video === activeVideo) return;\n            stopFrames?.();\n            stopFrames = null;\n            activeVideo = video;\n            sweep.style.visibility = 'hidden';\n            if (!video) return;\n            const hasVideoFrameCallback = typeof video.requestVideoFrameCallback === 'function';\n            let handle = 0;\n            const onFrame = (_now: number, metadata?: VideoFrameCallbackMetadata): void => {\n                render(metadata?.mediaTime ?? video.currentTime);\n                handle = hasVideoFrameCallback\n                    ? video.requestVideoFrameCallback(onFrame)\n                    : window.requestAnimationFrame(onFrame);\n            };\n            onFrame(0);\n            stopFrames = () => {\n                if (hasVideoFrameCallback) video.cancelVideoFrameCallback(handle);\n                else window.cancelAnimationFrame(handle);\n            };\n        };\n        // The host can insert or replace its video after connectedCallback has run.\n        const observer = new MutationObserver(bindVideo);\n        observer.observe(container, { childList: true, subtree: true });\n        bindVideo();\n        this.stopSweep = () => {\n            observer.disconnect();\n            stopFrames?.();\n            sweep.style.visibility = 'hidden';\n        };\n    }\n\n    private findVideoContainer(): Element | null {\n        let node: Element | null = this.assignedSlot ?? this;\n        while (node) {\n            const tile = node.closest('[data-teaser-video-tile]');\n            if (tile) return tile;\n            const root = node.getRootNode();\n            node = root instanceof ShadowRoot ? root.host : null;\n        }\n        // The local demo mounts the video and widget directly in the same slot.\n        return this.assignedSlot?.parentElement ?? this.parentElement;\n    }\n\n    private async loadBadge(): Promise<void> {\n        const requestId = ++this.requestId;\n        // Keep the loading bars visible until the new value or fallback is ready.\n        this.shadow?.querySelector('.mw-root')?.removeAttribute('data-ready');\n        const loading = this.shadow?.querySelector<HTMLElement>('.mw-loading');\n        if (loading) loading.hidden = false;\n        // Until the call settles the link has no href and blocks clicks (see blackweek.css). If the API gives\n        // no parameters it stays without href and clicks reach the host link with the default URL.\n        const link = this.shadow?.querySelector('.mw-link');\n        link?.removeAttribute('href');\n        const environment = this.getAttribute('vanilla-home-env');\n        const badge = await fetchCashbackBadge(environment);\n        if (!this.isConnected || requestId !== this.requestId) return;\n        if (badge.jumpInParams) link?.setAttribute('href', buildJumpInUrl(environment, badge.jumpInParams));\n        const amount = this.shadow?.querySelector('.mw-cashback-amount');\n        const kind = this.shadow?.querySelector('.mw-cashback-kind');\n        const headlineAmount = this.shadow?.querySelector('.mw-headline-amount');\n        if (amount) amount.textContent = formatCashback(badge.amount);\n        if (headlineAmount) headlineAmount.textContent = `${formatAmount(badge.amount)} €`;\n        if (kind) kind.textContent = badge.label;\n        this.shadow?.querySelector('.mw-root')?.setAttribute('data-ready', '');\n        if (loading) loading.hidden = true;\n    }\n}\n\ncustomElements.define('dsl-blackweek', BlackweekTile);\n"],"names":["getPssUrl","environment","getApiUrl","path","JUMP_IN","SWEEP","labels","amountFormat","Intl","NumberFormat","formatAmount","value","format","isFilled","trim","fetchJson","_0","__async","this","arguments","url","init","timeout","AbortSignal","signal","any","response","fetch","ok","json","e","fetchMaxCashback","data","getMaxCashbackApiUrl","fetchPromotionDiscount","getPromotionApiUrl","credentials","total","Number","isFinite","zip","test","params","parameters","Array","isArray","p","query","tv","tariffType","customerType","city","street","streetNumber","Object","assign","router","String","young","age","leadId","providerText","currentProviderName","providerId","currentProviderId","toComparisonQueryParams","__spreadValues","amount","keys","length","BlackweekTile","HTMLElement","constructor","super","__publicField","_a","_b","_c","slotWidth","viewportWidth","globalThis","innerWidth","isHeroSlot","assignedSlot","parentElement","clientWidth","window","removeAttribute","setAttribute","observedAttributes","connectedCallback","_d","shadow","attachShadow","mode","innerHTML","updatePromotion","addEventListener","resizeObserver","ResizeObserver","observe","startSweep","loadBadge","disconnectedCallback","requestId","stopSweep","call","removeEventListener","disconnect","attributeChangedCallback","_name","oldValue","newValue","isConnected","container","findVideoContainer","sweep","querySelector","style","backgroundImage","render","mediaTime","index","Math","floor","sweepFrameIndex","backgroundPosition","column","row","sweepSpritePosition","visibility","activeVideo","stopFrames","bindVideo","video","hasVideoFrameCallback","requestVideoFrameCallback","handle","onFrame","_now","metadata","currentTime","requestAnimationFrame","cancelVideoFrameCallback","cancelAnimationFrame","observer","MutationObserver","childList","subtree","node","tile","closest","root","getRootNode","ShadowRoot","host","_e","_f","_g","_h","_i","loading","hidden","link","getAttribute","badge","cashbackController","AbortController","discountRequest","cashbackRequest","discount","abort","label","jumpInParams","fetchCashbackBadge","URL","key","entries","searchParams","set","toString","buildJumpInUrl","kind","headlineAmount","textContent","customElements","define"],"mappings":"+nBAIO,SAASA,EAAUC,GACtB,MAAuB,QAAhBA,GAAyC,QAAhBA,GAAyC,SAAhBA,EAJxC,oCADA,8BAMrB,CAEA,SAASC,EAAUC,EAAcF,GAG7B,MAAO,GAAGD,EAAUC,SAAmBE,GAC3C,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