{"release_id":"01a1998d-9802-0000-b0f7-33a23307f4ed","chunk_id":"01a1998d-98f1-7c23-8f71-af391b3f2fe1","file":"BYE3hI_L.mjs","mappings":"qTAeA,MAAMA,EAAc,aAGb,SAASC,EAAcC,EAAkBC,EAAcC,EAAM,KAAK,MAAa,CACrF,GAAI,CACH,eAAe,QACdJ,EACA,KAAK,UAAU,CAAE,GAAIE,EAAS,cAAe,KAAAC,EAAM,GAAIC,CAAA,CAAK,CAAA,CAE9D,MAAQ,CAER,CACD,CAEO,SAASC,EAAcH,EAAkBE,EAAM,KAAK,MAAsB,CAChF,GAAI,CACH,MAAME,EAAM,eAAe,QAAQN,CAAW,EAC9C,GAAI,CAACM,EAAK,OAAO,KACjB,MAAMC,EAAI,KAAK,MAAMD,CAAG,EAIxB,OAHIC,EAAE,KAAOL,EAAS,YAAA,IACtB,eAAe,WAAWF,CAAW,EACjC,OAAOO,EAAE,MAAS,UAAY,OAAOA,EAAE,IAAO,WAC9CH,EAAMG,EAAE,GAAK,KAAuB,KACjCA,EAAE,KAAK,MAAM,EAAG,GAAG,CAC3B,MAAQ,CACP,OAAO,IACR,CACD","names":["PREFILL_KEY","saveDmPrefill","nickname","text","now","takeDmPrefill","raw","v"],"sources":["../../../../../../src/lib/album-next.ts"],"sourcesContent":["/** The album page, after and around the unlock (RAT-534). Client-safe.\n *\n *  After unlocking, a buyer got nothing new — yet 18% message the creator on\n *  their own within 30 minutes. Short on tokens, they got a generic top-up modal\n *  (3% of which convert) and had to press unlock again after paying. Now:\n *   · unlocked: \"message @creator\" (the first line already written) and \"more\n *     from @creator\";\n *   · short: unlock opens the token packs /pricing lists, and the unlock goes\n *     through on the way back from checkout, no second press. */\n\n// ─── The DM's first line, handed over from the album ──────────────────────────\n// sessionStorage: it survives the navigation, dies with the tab, and is only\n// taken by the DM with the same creator within two minutes. It fills the\n// composer; the buyer still sends it.\n\nconst PREFILL_KEY = 'dm_prefill';\nconst PREFILL_TTL_MS = 2 * 60 * 1000;\n\nexport function saveDmPrefill(nickname: string, text: string, now = Date.now()): void {\n\ttry {\n\t\tsessionStorage.setItem(\n\t\t\tPREFILL_KEY,\n\t\t\tJSON.stringify({ to: nickname.toLowerCase(), text, at: now })\n\t\t);\n\t} catch {\n\t\t// no storage — the DM opens empty, as before\n\t}\n}\n\nexport function takeDmPrefill(nickname: string, now = Date.now()): string | null {\n\ttry {\n\t\tconst raw = sessionStorage.getItem(PREFILL_KEY);\n\t\tif (!raw) return null;\n\t\tconst v = JSON.parse(raw) as { to?: unknown; text?: unknown; at?: unknown };\n\t\tif (v.to !== nickname.toLowerCase()) return null;\n\t\tsessionStorage.removeItem(PREFILL_KEY);\n\t\tif (typeof v.text !== 'string' || typeof v.at !== 'number') return null;\n\t\tif (now - v.at > PREFILL_TTL_MS) return null;\n\t\treturn v.text.slice(0, 500);\n\t} catch {\n\t\treturn null;\n\t}\n}\n"],"version":3}