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EAAG,mCAAmC,EACtCA,EAAG,4CAA4C,CAAA,EAEnD,KACJ,OAAO8B,GAAOC,EAAU,CAAE,IAAAD,EAAK,QAAAC,GAAY,IAC5C","names":["playLinkStep","q","handed","vs","PLAY_WHO","whoLabel","w","tr","english","playWhoOf","PRESENCE","sexCta","compareCta","quickieCta","defaultWho","me","last","practicePartner","tab","bodies","p","canCompare","them","canQuickie","isShe","who","body","isScissor","pairLine","emptyLine","hasPractice","cardCta","o","owner","viewer","open","nickname","sex","compare"],"sources":["../../../../../../src/lib/sculpt/play.ts"],"sourcesContent":["// The editor's Play entry (fleet tasks/2026-11-29-sculpt-play-button): which games a sculpt can play,\n// where the Play sheet opens, and the deep links that open it (the play mock's table). Pure, so the\n// editor, the sheet and the tests share one reading.\n\nimport { english, type Params } from '$lib/i18n/translate';\n\nexport type PlayGame = 'clash' | 'duet' | 'scissor';\n/** 'menu': the games (step 1); a game: its picker (step 2) */\nexport type PlayStep = 'menu' | PlayGame;\n\n/** Clash is dick vs dick, Scissor (RAT-678) pussy vs pussy; Duet needs one of each and the duet switch\n *  on. A dick's Clash comes first (RAT-653), a pussy's Duet: that is who there is to play with. */\nexport function playGames(body: 'penis' | 'vulva', duetOn: boolean): PlayGame[] {\n\tif (body === 'penis') return duetOn ? ['clash', 'duet'] : ['clash'];\n\treturn duetOn ? ['duet', 'scissor'] : ['scissor'];\n}\n\n/** The step the sheet opens on for a wanted one: a single game opens straight (no menu, no Back), a\n *  game this sculpt can't play shows what it can. Clash and Scissor are one link (?clash=1: the game\n *  between two of a kind), so each stands in for the other. Null: nothing to play. */\nexport function playStart(want: PlayStep, games: PlayGame[]): PlayStep | null {\n\tif (!games.length) return null;\n\tif (games.length === 1) return games[0];\n\tconst kin = { clash: 'scissor', scissor: 'clash' } as const;\n\tconst w = want !== 'menu' && want !== 'duet' && !games.includes(want) ? kin[want] : want;\n\treturn w !== 'menu' && games.includes(w) ? w : 'menu';\n}\n\n/** ?clash=1 (the /p \"clash someone\" / \"scissor someone\" row) and ?duet-pick=1 (the duet page's Change\n *  partner, also handed over in sessionStorage): the step they ask for. ?clash=1 means nothing next to\n *  ?vs (that one is the direct \"Clash @nick\"). The caller strips them with replaceState. */\nexport function playLinkStep(\n\tq: URLSearchParams,\n\thanded: URLSearchParams | null,\n\tvs: string | null\n): PlayGame | null {\n\tif (q.get('duet-pick') === '1' || handed?.get('duet-pick') === '1') return 'duet';\n\tif (q.get('clash') === '1' && !vs) return 'clash';\n\treturn null;\n}\n\n// ---------- RAT-719: the one Play screen ----------\n\n/** A translator: the page passes `t` ($lib/i18n); tests and the server get the English (`english`).\n *  The strings stay literal `tr('…')` calls so the i18n check finds them (common.json). */\nexport type Tr = (source: string, params?: Params) => string;\n\n/** The segmented control: who the player wants to play with. A sculpt's `who` (man, woman, trans);\n *  an old sculpt without one is its body's default (duet-cast.ts whoOf). */\nexport type PlayWho = 'man' | 'woman' | 'trans';\nexport const PLAY_WHO: readonly PlayWho[] = ['man', 'woman', 'trans'];\nexport const PLAY_WHO_LABEL: Record<PlayWho, string> = {\n\tman: 'Men',\n\twoman: 'Women',\n\ttrans: 'Trans'\n};\n/** The tab's label in the page's language. */\nexport function whoLabel(w: PlayWho, tr: Tr = english): string {\n\treturn w === 'man' ? tr('Men') : w === 'woman' ? tr('Women') : tr('Trans');\n}\nexport const playWhoOf = (w: unknown): PlayWho | null =>\n\tw === 'man' || w === 'woman' || w === 'trans' ? w : null;\n\n/** Presence: the lease the server keeps (sculpt-presence.ts) and how often a sculpt page renews\n *  it. The lease outlives two missed beats, so a slow phone doesn't flicker out of the list. */\nexport const PRESENCE = { leaseSec: 90, beatMs: 30_000, listMax: 30 } as const;\n\n/** The main button, everywhere (the word \"Duet\" is never shown). */\nexport const SEX_CTA = 'Have sex';\nexport const COMPARE_CTA = 'Compare';\nexport const sexCta = (tr: Tr = english) => tr('Have sex');\nexport const compareCta = (tr: Tr = english) => tr('Compare');\nexport const QUICKIE_CTA = 'Quickie';\nexport const quickieCta = (tr: Tr = english) => tr('Quickie');\n\n/** The tab the sheet opens on: the last one chosen, else the other body's usual people. */\nexport function defaultWho(me: 'penis' | 'vulva', last: PlayWho | null): PlayWho {\n\treturn last ?? (me === 'penis' ? 'woman' : 'man');\n}\n\n/** The practice round's built-in partner on a tab (builtin-partners.ts): Average guy for Men, The\n *  Muse for Women, Sasha (a trans woman) for Trans. A same-body built-in needs the full bodies\n *  (RAT-696). */\nexport function practicePartner(\n\ttab: PlayWho,\n\tme: 'penis' | 'vulva',\n\tbodies: boolean\n): { kind: 'avg' | 'muse' | 'trans'; name: string; body: 'penis' | 'vulva'; she: boolean } | null {\n\tconst p =\n\t\ttab === 'man'\n\t\t\t? { kind: 'avg' as const, name: 'Average guy', body: 'penis' as const, she: false }\n\t\t\t: tab === 'woman'\n\t\t\t\t? { kind: 'muse' as const, name: 'The Muse', body: 'vulva' as const, she: true }\n\t\t\t\t: { kind: 'trans' as const, name: 'Sasha', body: 'penis' as const, she: true };\n\tif (!p || (!bodies && p.body === me)) return null;\n\treturn p;\n}\n\n/** Compare (the size clash) is only ever the second button, and only where there are two dicks: on\n *  the Men and Trans tabs, when the player's sculpt is a dick too. */\nexport const canCompare = (tab: PlayWho, me: 'penis' | 'vulva', them: 'penis' | 'vulva') =>\n\ttab !== 'woman' && me === 'penis' && them === 'penis';\n\n/** Quickie: the round as it plays on production today, the torsos only (no full bodies, the duet's\n *  ?quick=1). That one scene is a dick in a pussy, so it is offered on the Men and Women tabs for a\n *  pair with one of each; never on Trans. */\nexport const canQuickie = (tab: PlayWho, me: 'penis' | 'vulva', them: 'penis' | 'vulva') =>\n\ttab !== 'trans' && me !== them;\n\n/** A partner's pronoun from who they are and their body (duet-cast.ts pronounOf): a trans woman has a\n *  dick and is she, a trans man has a pussy and is he. */\nexport const isShe = (who: PlayWho, body: 'penis' | 'vulva') =>\n\twho === 'trans' ? body === 'penis' : who === 'woman';\n\n/** Two pussies, and she is a woman: they scissor (RAT-708, the round's ?act=scissor). A trans man's\n *  pussy keeps the strap-on default, chosen on the round's page. */\nexport const isScissor = (me: 'penis' | 'vulva', them: { body: 'penis' | 'vulva'; she: boolean }) =>\n\tme === 'vulva' && them.body === 'vulva' && them.she;\n\n/** What the round is, in the two bodies' words: \"Your dick, her pussy.\" Two of a kind choose on the\n *  next screen who's on top (or, two pussies, how). */\nexport function pairLine(\n\tme: 'penis' | 'vulva',\n\tthem: { body: 'penis' | 'vulva'; she: boolean },\n\ttr: Tr = english\n): string {\n\t// whole sentences, one per pair: every language words them its own way\n\tif (me === 'penis')\n\t\treturn them.body === 'vulva'\n\t\t\t? them.she\n\t\t\t\t? tr('Your dick, her pussy.')\n\t\t\t\t: tr('Your dick, his pussy.')\n\t\t\t: them.she\n\t\t\t\t? tr('Your dick, her dick. You pick who tops.')\n\t\t\t\t: tr('Your dick, his dick. You pick who tops.');\n\treturn them.body === 'penis'\n\t\t? them.she\n\t\t\t? tr('Your pussy, her dick.')\n\t\t\t: tr('Your pussy, his dick.')\n\t\t: isScissor(me, them)\n\t\t\t? tr('Your pussy, her pussy. You scissor.')\n\t\t\t: tr('Your pussy, his pussy. You pick how.');\n}\n\n/** The tab's empty state. */\nexport function emptyLine(hasPractice: boolean, tr: Tr = english): string {\n\treturn hasPractice\n\t\t? tr(\"Nobody's around right now. Try a practice round or share your link.\")\n\t\t: tr(\"Nobody's around right now. Share your link.\");\n}\n\nexport interface CardCta {\n\t/** the main button: sex with the owner's sculpt (null: the owner is closed for it); `scissor`: two\n\t *  women, the round opens as a scissor */\n\tsex: { sub: string; scissor?: true } | null;\n\t/** the second button: Compare (two dicks only) */\n\tcompare: { sub: string } | null;\n}\n\n/** The sculpt card's buttons (profile + share page), by the two bodies. Sex is the main one while the\n *  owner is open for it; Compare is the second, only for two dicks (signed out or without a sculpt only\n *  the owner's body is known: his offers it, since the viewer's first sculpt can be a dick). */\nexport function cardCta(\n\to: {\n\t\towner: 'penis' | 'vulva';\n\t\t/** who the owner is (their sculpt's `who`; old sculpts: their body's default) */\n\t\townerWho?: PlayWho | null;\n\t\tviewer: 'penis' | 'vulva' | null;\n\t\tloggedIn: boolean;\n\t\t/** duets on and the owner open for them */\n\t\topen: boolean;\n\t\tnickname: string;\n\t},\n\ttr: Tr = english\n): CardCta | null {\n\tconst { owner, viewer, open, nickname } = o;\n\tconst who = o.ownerWho ?? (owner === 'vulva' ? 'woman' : 'man');\n\tconst sex = !open\n\t\t? null\n\t\t: viewer\n\t\t\t? {\n\t\t\t\t\tsub: pairLine(viewer, { body: owner, she: isShe(who, owner) }, tr),\n\t\t\t\t\t...(isScissor(viewer, { body: owner, she: isShe(who, owner) })\n\t\t\t\t\t\t? { scissor: true as const }\n\t\t\t\t\t\t: {})\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tsub: o.loggedIn\n\t\t\t\t\t\t? tr('Sculpt yours, then play with @{nickname}', { nickname })\n\t\t\t\t\t\t: tr('One round, 45 seconds, no account.')\n\t\t\t\t};\n\tconst compare =\n\t\towner === 'penis' && viewer !== 'vulva'\n\t\t\t? {\n\t\t\t\t\tsub: viewer\n\t\t\t\t\t\t? tr(\"Your sculpt next to @{nickname}'s\", { nickname })\n\t\t\t\t\t\t: o.loggedIn\n\t\t\t\t\t\t\t? tr(\"Make yours, then see who's bigger\")\n\t\t\t\t\t\t\t: tr(\"Build yours. See who's bigger, no account.\")\n\t\t\t\t}\n\t\t\t: null;\n\treturn sex || compare ? { sex, compare } : null;\n}\n"],"version":3}