@aparte/n8n-chat 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +35 -19
- package/dist/cdn/chunks/chunk-4MZPEZPE.js +209 -0
- package/dist/cdn/chunks/chunk-4MZPEZPE.js.map +7 -0
- package/dist/cdn/chunks/{chunk-UCBMONE6.js → chunk-HASLYSSG.js} +2 -2
- package/dist/cdn/chunks/{chunk-UCBMONE6.js.map → chunk-HASLYSSG.js.map} +1 -1
- package/dist/cdn/chunks/{chunk-WCZRD7U7.js → chunk-KPADIE5S.js} +1 -1
- package/dist/cdn/chunks/{chunk-WCZRD7U7.js.map → chunk-KPADIE5S.js.map} +1 -1
- package/dist/cdn/chunks/{chunk-EKOAQWDB.js → chunk-LGVX5DQP.js} +2 -2
- package/dist/cdn/chunks/{chunk-EKOAQWDB.js.map → chunk-LGVX5DQP.js.map} +1 -1
- package/dist/cdn/chunks/{chunk-FPBJCFJN.js → chunk-PPDOW5CO.js} +2 -2
- package/dist/cdn/chunks/{chunk-FPBJCFJN.js.map → chunk-PPDOW5CO.js.map} +1 -1
- package/dist/cdn/chunks/{chunk-75MBZEMR.js → chunk-XY3GEFGN.js} +2 -2
- package/dist/cdn/chunks/{chunk-75MBZEMR.js.map → chunk-XY3GEFGN.js.map} +1 -1
- package/dist/cdn/chunks/de-VHSIFTGU.js +2 -0
- package/dist/cdn/chunks/de-VHSIFTGU.js.map +7 -0
- package/dist/cdn/chunks/es-CSDZBDZK.js +2 -0
- package/dist/cdn/chunks/es-CSDZBDZK.js.map +7 -0
- package/dist/cdn/chunks/fr-A7LKKK4U.js +2 -0
- package/dist/cdn/chunks/fr-A7LKKK4U.js.map +7 -0
- package/dist/cdn/chunks/{highlight-W7QGGHNK.js → highlight-KR6IJJGG.js} +2 -2
- package/dist/cdn/chunks/{highlight-W7QGGHNK.js.map → highlight-KR6IJJGG.js.map} +2 -2
- package/dist/cdn/chunks/it-4UDH2XVX.js +2 -0
- package/dist/cdn/chunks/it-4UDH2XVX.js.map +7 -0
- package/dist/cdn/chunks/{items-X2D73Z5A.js → items-FFNVAESC.js} +2 -2
- package/dist/cdn/chunks/{items-X2D73Z5A.js.map → items-FFNVAESC.js.map} +1 -1
- package/dist/cdn/chunks/ja-5FMFPBXT.js +2 -0
- package/dist/cdn/chunks/ja-5FMFPBXT.js.map +7 -0
- package/dist/cdn/chunks/ko-KXXFK5U7.js +2 -0
- package/dist/cdn/chunks/ko-KXXFK5U7.js.map +7 -0
- package/dist/cdn/chunks/{link-LNDRLLUH.js → link-3AMG5PIK.js} +2 -2
- package/dist/cdn/chunks/{link-LNDRLLUH.js.map → link-3AMG5PIK.js.map} +1 -1
- package/dist/cdn/chunks/{media-JDTPNZHJ.js → media-F3HYZLYR.js} +2 -2
- package/dist/cdn/chunks/{media-JDTPNZHJ.js.map → media-F3HYZLYR.js.map} +1 -1
- package/dist/cdn/chunks/{order-HS6FXBIB.js → order-L6GKT5I6.js} +2 -2
- package/dist/cdn/chunks/{order-HS6FXBIB.js.map → order-L6GKT5I6.js.map} +1 -1
- package/dist/cdn/chunks/{place-N3E7T2EV.js → place-J7BDZGKL.js} +2 -2
- package/dist/cdn/chunks/{place-N3E7T2EV.js.map → place-J7BDZGKL.js.map} +1 -1
- package/dist/cdn/chunks/{plan-TCWRW3OC.js → plan-BAI6GY4A.js} +2 -2
- package/dist/cdn/chunks/{plan-TCWRW3OC.js.map → plan-BAI6GY4A.js.map} +1 -1
- package/dist/cdn/chunks/{product-JH7QUP6I.js → product-VOKQKP4K.js} +2 -2
- package/dist/cdn/chunks/{product-JH7QUP6I.js.map → product-VOKQKP4K.js.map} +1 -1
- package/dist/cdn/chunks/pt-BR-T2PIW5LH.js +2 -0
- package/dist/cdn/chunks/pt-BR-T2PIW5LH.js.map +7 -0
- package/dist/cdn/chunks/ru-CWHLBHXX.js +2 -0
- package/dist/cdn/chunks/ru-CWHLBHXX.js.map +7 -0
- package/dist/cdn/chunks/{score-GUHJWHW3.js → score-IPBHXWWN.js} +2 -2
- package/dist/cdn/chunks/{score-GUHJWHW3.js.map → score-IPBHXWWN.js.map} +1 -1
- package/dist/cdn/chunks/{stats-UIVYR2CG.js → stats-V6H3J3WL.js} +2 -2
- package/dist/cdn/chunks/{stats-UIVYR2CG.js.map → stats-V6H3J3WL.js.map} +1 -1
- package/dist/cdn/chunks/{stock-PV4GC573.js → stock-UNSEZYGA.js} +2 -2
- package/dist/cdn/chunks/{stock-PV4GC573.js.map → stock-UNSEZYGA.js.map} +1 -1
- package/dist/cdn/chunks/{weather-7L3Y3DNB.js → weather-4IMAIRYF.js} +2 -2
- package/dist/cdn/chunks/{weather-7L3Y3DNB.js.map → weather-4IMAIRYF.js.map} +1 -1
- package/dist/cdn/chunks/zh-CN-UEBLECMR.js +2 -0
- package/dist/cdn/chunks/zh-CN-UEBLECMR.js.map +7 -0
- package/dist/cdn/latest.js +11 -0
- package/dist/cdn/n8n-chat.js +2 -2
- package/dist/cdn/n8n-chat.js.map +2 -2
- package/dist/highlight-DDyMJYBk.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +7 -7
- package/dist/cdn/chunks/chunk-FZXRS5MT.js +0 -208
- package/dist/cdn/chunks/chunk-FZXRS5MT.js.map +0 -7
- package/dist/cdn/chunks/de-7JCOF7FR.js +0 -2
- package/dist/cdn/chunks/de-7JCOF7FR.js.map +0 -7
- package/dist/cdn/chunks/es-KUX7YCK6.js +0 -2
- package/dist/cdn/chunks/es-KUX7YCK6.js.map +0 -7
- package/dist/cdn/chunks/fr-VYD7EC55.js +0 -2
- package/dist/cdn/chunks/fr-VYD7EC55.js.map +0 -7
- package/dist/cdn/chunks/it-BXNO2THQ.js +0 -2
- package/dist/cdn/chunks/it-BXNO2THQ.js.map +0 -7
- package/dist/cdn/chunks/ja-6VGJFQ66.js +0 -2
- package/dist/cdn/chunks/ja-6VGJFQ66.js.map +0 -7
- package/dist/cdn/chunks/ko-HUU4F44X.js +0 -2
- package/dist/cdn/chunks/ko-HUU4F44X.js.map +0 -7
- package/dist/cdn/chunks/pt-BR-SNSDLB4C.js +0 -2
- package/dist/cdn/chunks/pt-BR-SNSDLB4C.js.map +0 -7
- package/dist/cdn/chunks/ru-QE2LLTEY.js +0 -2
- package/dist/cdn/chunks/ru-QE2LLTEY.js.map +0 -7
- package/dist/cdn/chunks/zh-CN-WKC5MGZY.js +0 -2
- package/dist/cdn/chunks/zh-CN-WKC5MGZY.js.map +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../node_modules/.pnpm/@aparte+plugin-cards@1.
|
|
3
|
+
"sources": ["../../../node_modules/.pnpm/@aparte+plugin-cards@1.1.2_@aparte+core@1.1.2/node_modules/@aparte/plugin-cards/src/place/icons.ts", "../../../node_modules/.pnpm/@aparte+plugin-cards@1.1.2_@aparte+core@1.1.2/node_modules/@aparte/plugin-cards/src/place/place.css", "../../../node_modules/.pnpm/@aparte+plugin-cards@1.1.2_@aparte+core@1.1.2/node_modules/@aparte/plugin-cards/src/place/index.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * The place card's glyphs: one 24 × 24 line drawing each, in `currentColor`, so the sheet\n * colours them with the text around them — the pin, the three actions' signs, and one\n * glyph per kind of place for the placeholder and the badge.\n *\n * They live here and not in core's `icons/`: core draws no place. They are constants of\n * the package, the only markup the card parses.\n */\n\n/** The kinds of place a glyph (and a word) exists for; anything else is a `place`. */\nexport type PlaceKind = 'restaurant' | 'cafe' | 'bar' | 'hotel' | 'shop' | 'museum' | 'park' | 'gym' | 'pharmacy' | 'place';\n\nconst svg = (body: string) =>\n `<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\">${body}</svg>`; // safe-text: this package's own SVG, built from its glyph constants\n\nexport const PIN = svg('<path d=\"M12 21s-6.5-5.6-6.5-11a6.5 6.5 0 0 1 13 0c0 5.4-6.5 11-6.5 11z\"/><circle cx=\"12\" cy=\"10\" r=\"2.4\"/>');\nexport const PHONE = svg('<path d=\"M5.2 4h3l1.6 4-2 1.3a10.5 10.5 0 0 0 5 5l1.3-2 4 1.6v3a2 2 0 0 1-2.1 2A15.2 15.2 0 0 1 3.2 6.1 2 2 0 0 1 5.2 4z\"/>');\nexport const GLOBE = svg('<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"M3.5 12h17M12 3.5c2.4 2.4 3.5 5.3 3.5 8.5s-1.1 6.1-3.5 8.5c-2.4-2.4-3.5-5.3-3.5-8.5s1.1-6.1 3.5-8.5z\"/>');\nexport const DIRECTIONS = svg('<path d=\"M12 2.8 21.2 12 12 21.2 2.8 12z\"/><path d=\"M9.2 14.6v-2.4a1.4 1.4 0 0 1 1.4-1.4h4.6M13.4 8.8l1.9 2-1.9 2\"/>');\nexport const CLOCK = svg('<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"M12 7.5V12l3 2\"/>');\n\nconst KIND_GLYPHS: Record<PlaceKind, string> = {\n restaurant: svg('<path d=\"M7 3v18M4.6 3v4.8A2.4 2.4 0 0 0 7 10.2a2.4 2.4 0 0 0 2.4-2.4V3M17 21V3c-2.3 1.4-3.5 4-3.5 7.2V13H17\"/>'),\n cafe: svg('<path d=\"M4.5 9h11v5.5a4.5 4.5 0 0 1-4.5 4.5H9a4.5 4.5 0 0 1-4.5-4.5z\"/><path d=\"M15.5 10.5h1.3a2.6 2.6 0 0 1 0 5.2h-1.6M8 3.5c-.6.8-.6 1.7 0 2.5M11.5 3.5c-.6.8-.6 1.7 0 2.5\"/>'),\n bar: svg('<path d=\"M5 4h14l-7 8z\"/><path d=\"M12 12v8M8.5 20h7M8.6 8h6.8\"/>'),\n hotel: svg('<path d=\"M3 18.5V6M3 14h18v4.5M21 14v-2.5a3 3 0 0 0-3-3h-7V14\"/><circle cx=\"7\" cy=\"10.5\" r=\"1.8\"/>'),\n shop: svg('<path d=\"M5.5 8h13l-1 12.5h-11z\"/><path d=\"M9 10V7a3 3 0 0 1 6 0v3\"/>'),\n museum: svg('<path d=\"M3.5 9.5 12 4l8.5 5.5zM5 20.5h14M6.5 11.5v6.5M10 11.5v6.5M14 11.5v6.5M17.5 11.5v6.5\"/>'),\n park: svg('<path d=\"M12 21v-5M12 3 6.5 11h3L6 16h12l-3.5-5h3z\"/>'),\n gym: svg('<path d=\"M6.5 7v10M17.5 7v10M3.5 9.5v5M20.5 9.5v5M6.5 12h11\"/>'),\n pharmacy: svg('<rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"4\"/><path d=\"M12 8.5v7M8.5 12h7\"/>'),\n place: PIN,\n};\n\n/** The glyph for a kind of place. */\nexport function kindGlyph(kind: PlaceKind): string {\n return KIND_GLYPHS[kind];\n}\n", "export default \"/* =========================================\\n The place card — @aparte/plugin-cards/place\\n =========================================\\n Three variants of one card, chosen by `data-variant` on its root:\\n card a tile: the photo with its category, the name, the rating, whether it is\\n open, the address, three buttons. Several scroll sideways as tiles.\\n compact one row: a thumbnail, the name and the distance, the rating, the status.\\n Several are stacked rows in one card.\\n detail one place in full: the tile's head, the buttons, the ways in (address,\\n phone, site), the week's hours with today marked, the tags.\\n Every colour comes from core's tokens, or from a `--aparte-place-*` token here: the\\n three status inks and one hue per kind of place, which tint the placeholder and the\\n marker. A theme repaints the card by setting them.\\n */\\n\\n.aparte-place-card {\\n /* What \\\"open\\\", \\\"closes soon\\\" and \\\"closed\\\" are written in: the derived inks, which are\\n readable as text on either ground. */\\n --aparte-place-open: var(--aparte-success-ink);\\n --aparte-place-soon: var(--aparte-warning-ink);\\n --aparte-place-closed: var(--aparte-error-ink);\\n --aparte-place-media-ratio: 16 / 9;\\n --aparte-place-detail-ratio: 2 / 1;\\n --aparte-place-thumb-size: 3.5rem;\\n --aparte-place-on-hue: #ffffff;\\n\\n /* One hue per kind of place: the marker on the placeholder, the badge's glyph. */\\n --aparte-place-kind-restaurant: #e8710a;\\n --aparte-place-kind-cafe: #a0612b;\\n --aparte-place-kind-bar: #9c3fd1;\\n --aparte-place-kind-hotel: #2f6fdf;\\n --aparte-place-kind-shop: #d6336c;\\n --aparte-place-kind-museum: #5b5bd6;\\n --aparte-place-kind-park: #2f9e44;\\n --aparte-place-kind-gym: #e03131;\\n --aparte-place-kind-pharmacy: #0c9488;\\n --aparte-place-kind-place: var(--aparte-primary);\\n}\\n\\n/* A tile reads its kind's hue once; everything inside it says `--aparte-place-hue`. */\\n.aparte-place { --aparte-place-hue: var(--aparte-place-kind-place); }\\n.aparte-place[data-kind=\\\"restaurant\\\"] { --aparte-place-hue: var(--aparte-place-kind-restaurant); }\\n.aparte-place[data-kind=\\\"cafe\\\"] { --aparte-place-hue: var(--aparte-place-kind-cafe); }\\n.aparte-place[data-kind=\\\"bar\\\"] { --aparte-place-hue: var(--aparte-place-kind-bar); }\\n.aparte-place[data-kind=\\\"hotel\\\"] { --aparte-place-hue: var(--aparte-place-kind-hotel); }\\n.aparte-place[data-kind=\\\"shop\\\"] { --aparte-place-hue: var(--aparte-place-kind-shop); }\\n.aparte-place[data-kind=\\\"museum\\\"] { --aparte-place-hue: var(--aparte-place-kind-museum); }\\n.aparte-place[data-kind=\\\"park\\\"] { --aparte-place-hue: var(--aparte-place-kind-park); }\\n.aparte-place[data-kind=\\\"gym\\\"] { --aparte-place-hue: var(--aparte-place-kind-gym); }\\n.aparte-place[data-kind=\\\"pharmacy\\\"] { --aparte-place-hue: var(--aparte-place-kind-pharmacy); }\\n\\n/* A single tile is narrower than the card's default: it is a photo and five lines. */\\n.aparte-place-card[data-variant=\\\"card\\\"] { --aparte-rich-card-max-inline-size: 22rem; }\\n\\n/* ── The place ───────────────────────────────────────────────────────── */\\n\\n.aparte-place {\\n position: relative;\\n display: flex;\\n flex-direction: column;\\n min-inline-size: 0;\\n color: var(--aparte-text);\\n}\\n\\n.aparte-place__body {\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n gap: var(--aparte-space-2);\\n min-inline-size: 0;\\n padding: var(--aparte-space-6) var(--aparte-space-7) var(--aparte-space-7);\\n}\\n\\n.aparte-place__name {\\n overflow: hidden;\\n font-size: var(--aparte-font-size-lg);\\n font-weight: var(--aparte-font-weight-semibold);\\n letter-spacing: -0.01em;\\n line-height: 1.25;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n}\\n\\n.aparte-place__link {\\n color: inherit;\\n text-decoration: none;\\n border-radius: var(--aparte-radius-xs);\\n}\\n\\n.aparte-place__link:hover {\\n text-decoration: underline;\\n text-decoration-thickness: 1px;\\n text-underline-offset: 0.18em;\\n}\\n\\n.aparte-place__link:focus-visible {\\n outline: var(--aparte-focus-outline-width) solid var(--aparte-border-focus);\\n outline-offset: var(--aparte-focus-outline-offset);\\n}\\n\\n/* A tile, a row and a lone card are one target: the name's link covers the whole of it,\\n and its buttons sit above that cover. The ring is then drawn around the target, inset,\\n because the card clips what passes its edge. */\\n.aparte-place--tile .aparte-place__name .aparte-place__link::after,\\n.aparte-place__row .aparte-place__name .aparte-place__link::after,\\n.aparte-place-card[data-variant=\\\"card\\\"] > .aparte-place .aparte-place__name .aparte-place__link::after {\\n content: \\\"\\\";\\n position: absolute;\\n inset: 0;\\n border-radius: inherit;\\n}\\n\\n.aparte-place--tile .aparte-place__name .aparte-place__link:focus-visible,\\n.aparte-place__row .aparte-place__name .aparte-place__link:focus-visible,\\n.aparte-place-card[data-variant=\\\"card\\\"] > .aparte-place .aparte-place__name .aparte-place__link:focus-visible {\\n outline: none;\\n}\\n\\n.aparte-place--tile .aparte-place__name .aparte-place__link:focus-visible::after,\\n.aparte-place__row .aparte-place__name .aparte-place__link:focus-visible::after,\\n.aparte-place-card[data-variant=\\\"card\\\"] > .aparte-place .aparte-place__name .aparte-place__link:focus-visible::after {\\n outline: var(--aparte-focus-outline-width) solid var(--aparte-border-focus);\\n outline-offset: calc(var(--aparte-focus-outline-width) * -1);\\n}\\n\\n.aparte-place--tile:hover .aparte-place__name .aparte-place__link,\\n.aparte-place__row:hover .aparte-place__name .aparte-place__link {\\n text-decoration: underline;\\n text-decoration-thickness: 1px;\\n text-underline-offset: 0.18em;\\n}\\n\\n.aparte-place__dot {\\n flex: none;\\n color: var(--aparte-text-muted);\\n opacity: 0.7;\\n}\\n\\n.aparte-place__score {\\n display: flex;\\n flex-wrap: wrap;\\n align-items: center;\\n column-gap: var(--aparte-space-2);\\n min-inline-size: 0;\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-sm);\\n}\\n\\n.aparte-place__price {\\n white-space: nowrap;\\n letter-spacing: 0.04em;\\n}\\n\\n.aparte-place__price-on {\\n color: var(--aparte-text);\\n font-weight: var(--aparte-font-weight-medium);\\n}\\n\\n.aparte-place__price-off { opacity: 0.35; }\\n\\n.aparte-place__category {\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n}\\n\\n/* ── Open, closes soon, closed ───────────────────────────────────────── */\\n\\n.aparte-place__status {\\n --aparte-place-status: var(--aparte-place-open);\\n display: flex;\\n flex-wrap: wrap;\\n align-items: center;\\n column-gap: var(--aparte-space-2);\\n margin: 0;\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-sm);\\n}\\n\\n.aparte-place__status[data-status=\\\"soon\\\"] { --aparte-place-status: var(--aparte-place-soon); }\\n.aparte-place__status[data-status=\\\"closed\\\"] { --aparte-place-status: var(--aparte-place-closed); }\\n\\n.aparte-place__status-dot {\\n position: relative;\\n flex: none;\\n inline-size: 0.5rem;\\n block-size: 0.5rem;\\n margin-inline-end: var(--aparte-space-1);\\n border-radius: var(--aparte-radius-full);\\n background: var(--aparte-place-status);\\n box-shadow: 0 0 0 3px color-mix(in oklab, var(--aparte-place-status) 20%, transparent);\\n}\\n\\n/* An open place breathes: a ring leaves the dot every few seconds. Still under reduced motion. */\\n.aparte-place__status[data-status=\\\"open\\\"] .aparte-place__status-dot::after {\\n content: \\\"\\\";\\n position: absolute;\\n inset: 0;\\n border-radius: inherit;\\n background: var(--aparte-place-status);\\n animation: aparte-place-pulse 2.6s ease-out infinite;\\n}\\n\\n.aparte-place__state {\\n color: var(--aparte-place-status);\\n font-weight: var(--aparte-font-weight-semibold);\\n}\\n\\n@keyframes aparte-place-pulse {\\n 0% { opacity: 0.55; transform: scale(1); }\\n 70%, 100% { opacity: 0; transform: scale(2.6); }\\n}\\n\\n/* ── Address and the lines with a glyph ──────────────────────────────── */\\n\\n.aparte-place__address {\\n display: flex;\\n align-items: center;\\n gap: var(--aparte-space-2);\\n min-inline-size: 0;\\n margin: 0;\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-sm);\\n white-space: nowrap;\\n}\\n\\n.aparte-place__address-text {\\n min-inline-size: 0;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n}\\n\\n.aparte-place__distance {\\n flex: none;\\n color: var(--aparte-text);\\n font-weight: var(--aparte-font-weight-medium);\\n white-space: nowrap;\\n}\\n\\n.aparte-place__line-glyph {\\n --aparte-rich-card-glyph-size: 1rem;\\n color: var(--aparte-text-muted);\\n}\\n\\n/* ── The photo, or its placeholder ───────────────────────────────────── */\\n\\n.aparte-place__media {\\n position: relative;\\n flex: none;\\n overflow: hidden;\\n isolation: isolate;\\n background: var(--aparte-surface-2);\\n}\\n\\n.aparte-place__media--wide { aspect-ratio: var(--aparte-place-media-ratio); }\\n\\n.aparte-place__img {\\n position: absolute;\\n inset: 0;\\n z-index: 1;\\n display: block;\\n inline-size: 100%;\\n block-size: 100%;\\n object-fit: cover;\\n transition: transform var(--aparte-duration-slower, 0.3s) ease;\\n}\\n\\n.aparte-place--tile:hover .aparte-place__img,\\n.aparte-place-card[data-variant=\\\"card\\\"] > .aparte-place:hover .aparte-place__img {\\n transform: scale(1.04);\\n}\\n\\n/* No photo: a soft map in the kind's hue — two avenues, a grid of streets, a glow — and\\n the kind's marker standing on it. Decoration, drawn by the sheet: no map tile is fetched. */\\n.aparte-place__placeholder {\\n --aparte-place-street: color-mix(in oklab, var(--aparte-surface-1) 72%, transparent);\\n --aparte-place-avenue: color-mix(in oklab, var(--aparte-surface-1) 92%, transparent);\\n position: absolute;\\n inset: 0;\\n display: grid;\\n place-items: center;\\n background:\\n radial-gradient(circle at 50% 48%, color-mix(in oklab, var(--aparte-place-hue) 24%, transparent) 0 14%, transparent 48%),\\n linear-gradient(118deg, transparent 0 36%, var(--aparte-place-avenue) 36% 39.5%, transparent 39.5%),\\n linear-gradient(22deg, transparent 0 63%, var(--aparte-place-avenue) 63% 65.5%, transparent 65.5%),\\n repeating-linear-gradient(118deg, transparent 0 22px, var(--aparte-place-street) 22px 24px),\\n repeating-linear-gradient(28deg, transparent 0 31px, var(--aparte-place-street) 31px 33px),\\n color-mix(in oklab, var(--aparte-place-hue) 13%, var(--aparte-surface-2));\\n}\\n\\n/* The app's own map tiles (`mapTiles`), under the marker: the place at the marker's tip,\\n where its shadow falls. Placed in physical pixels — a map is not text, and a\\n right-to-left page does not mirror it. The drawn map steps aside and keeps the marker. */\\n.aparte-place__map {\\n position: absolute;\\n left: calc(50% - var(--aparte-place-map-x));\\n top: calc(50% + 1.45rem - var(--aparte-place-map-y));\\n display: grid;\\n grid-template-columns: repeat(3, 256px);\\n width: 768px;\\n filter: var(--aparte-place-map-filter, none);\\n}\\n\\n.aparte-place__tile {\\n display: block;\\n width: 256px;\\n height: 256px;\\n max-width: none;\\n}\\n\\n.aparte-place__media[data-map] .aparte-place__placeholder {\\n z-index: 1;\\n background: none;\\n}\\n\\n/* The credit the tiles' provider asks for, in a corner of the map. */\\n.aparte-place__credit {\\n position: absolute;\\n inset-block-end: 0;\\n inset-inline-end: 0;\\n z-index: 2;\\n padding: 1px 6px;\\n border-start-start-radius: var(--aparte-radius-sm, 4px);\\n font-size: 0.625rem;\\n line-height: 1.4;\\n color: var(--aparte-text-muted);\\n background: color-mix(in oklab, var(--aparte-surface-1) 85%, transparent);\\n}\\n\\n/* The marker's shadow on the ground. */\\n.aparte-place__placeholder::after {\\n content: \\\"\\\";\\n position: absolute;\\n inset-block-start: calc(50% + 1.45rem);\\n inset-inline-start: 50%;\\n inline-size: 1.4rem;\\n block-size: 0.4rem;\\n margin-inline-start: -0.7rem;\\n border-radius: 50%;\\n background: rgb(0 0 0 / 0.22);\\n filter: blur(2px);\\n}\\n\\n/* A drop pin: a square with three round corners, turned so the sharp one points down. */\\n.aparte-place__marker {\\n display: grid;\\n place-items: center;\\n inline-size: 2.75rem;\\n block-size: 2.75rem;\\n margin-block-end: 0.9rem;\\n border-radius: 50% 50% 50% 0;\\n background: var(--aparte-place-hue);\\n color: var(--aparte-place-on-hue);\\n box-shadow:\\n 0 0 0 3px color-mix(in oklab, var(--aparte-surface-1) 85%, transparent),\\n 0 8px 16px -6px color-mix(in oklab, var(--aparte-place-hue) 70%, black);\\n transform: rotate(-45deg);\\n}\\n\\n.aparte-place__marker-glyph {\\n --aparte-rich-card-glyph-size: 1.3rem;\\n transform: rotate(45deg);\\n}\\n\\n.aparte-place__media--thumb {\\n inline-size: var(--aparte-place-thumb-size);\\n block-size: var(--aparte-place-thumb-size);\\n border-radius: var(--aparte-radius-lg);\\n}\\n\\n/* In a thumbnail the placeholder is only the kind's glyph on its tint. */\\n.aparte-place__media--thumb .aparte-place__placeholder {\\n background: color-mix(in oklab, var(--aparte-place-hue) 15%, var(--aparte-surface-1));\\n}\\n\\n.aparte-place__media--thumb .aparte-place__placeholder::after { content: none; }\\n\\n.aparte-place__media--thumb .aparte-place__marker {\\n inline-size: auto;\\n block-size: auto;\\n margin: 0;\\n border-radius: 0;\\n background: none;\\n box-shadow: none;\\n color: var(--aparte-place-hue);\\n transform: none;\\n}\\n\\n.aparte-place__media--thumb .aparte-place__marker-glyph {\\n --aparte-rich-card-glyph-size: 1.5rem;\\n transform: none;\\n}\\n\\n/* The category, over the photo: a frosted chip, which reads on any picture. */\\n.aparte-place__badge {\\n position: absolute;\\n inset-block-start: var(--aparte-space-5);\\n inset-inline-start: var(--aparte-space-5);\\n z-index: 2;\\n display: inline-flex;\\n align-items: center;\\n gap: var(--aparte-space-2);\\n max-inline-size: calc(100% - var(--aparte-space-5) * 2);\\n padding-block: var(--aparte-space-2);\\n padding-inline: var(--aparte-space-3) var(--aparte-space-4);\\n border-radius: var(--aparte-radius-full);\\n background: color-mix(in oklab, var(--aparte-surface-1) 86%, transparent);\\n backdrop-filter: blur(8px) saturate(1.4);\\n box-shadow: 0 1px 4px rgb(0 0 0 / 0.14);\\n color: var(--aparte-text);\\n font-size: var(--aparte-font-size-sm);\\n font-weight: var(--aparte-font-weight-medium);\\n line-height: 1.2;\\n}\\n\\n.aparte-place__badge-glyph {\\n --aparte-rich-card-glyph-size: 0.95rem;\\n color: var(--aparte-place-hue);\\n}\\n\\n/* ── Buttons ─────────────────────────────────────────────────────────── */\\n\\n.aparte-place__actions {\\n position: relative;\\n z-index: 3;\\n display: flex;\\n flex-wrap: wrap;\\n gap: var(--aparte-space-3);\\n margin-block-start: var(--aparte-space-5);\\n}\\n\\n.aparte-place__action {\\n gap: var(--aparte-space-2);\\n}\\n\\n/* ── Several, side by side ───────────────────────────────────────────── */\\n\\n/* Tiles in a row carry their own frame, so the card around them steps back. */\\n.aparte-place-card:has(> .aparte-place__collection) {\\n --aparte-rich-card-max-inline-size: 40rem;\\n overflow: visible;\\n border-color: transparent;\\n background: transparent;\\n}\\n\\n.aparte-place__collection {\\n display: grid;\\n gap: var(--aparte-space-4);\\n min-inline-size: 0;\\n}\\n\\n.aparte-place__collection .aparte-rich-card__carousel {\\n --aparte-rich-card-slide-size: min(15rem, 80%);\\n}\\n\\n.aparte-place__heading {\\n display: flex;\\n align-items: center;\\n gap: var(--aparte-space-3);\\n min-inline-size: 0;\\n font-size: var(--aparte-font-size-md);\\n font-weight: var(--aparte-font-weight-semibold);\\n}\\n\\n.aparte-place__heading-text {\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n}\\n\\n.aparte-place__collection > .aparte-place__heading { padding-inline: var(--aparte-space-2); }\\n\\n.aparte-place--tile {\\n block-size: 100%;\\n overflow: hidden;\\n border: var(--aparte-border-width) solid var(--aparte-border);\\n border-radius: var(--aparte-radius-xl);\\n background: var(--aparte-surface-1);\\n transition:\\n border-color var(--aparte-duration-base, 0.15s) ease,\\n box-shadow var(--aparte-duration-base, 0.15s) ease;\\n}\\n\\n.aparte-place--tile:hover {\\n border-color: color-mix(in oklab, var(--aparte-text) 20%, var(--aparte-border));\\n box-shadow: 0 10px 24px -16px rgb(0 0 0 / 0.5);\\n}\\n\\n.aparte-place--tile .aparte-place__body {\\n padding: var(--aparte-space-5) var(--aparte-space-6) var(--aparte-space-6);\\n}\\n\\n.aparte-place--tile .aparte-place__name { font-size: var(--aparte-font-size-base); }\\n\\n/* The buttons sit on the tile's floor, so a row of tiles lines them up. */\\n.aparte-place--tile .aparte-place__actions { margin-block-start: auto; padding-block-start: var(--aparte-space-5); }\\n\\n/* ── Compact: rows ───────────────────────────────────────────────────── */\\n\\n.aparte-place__row {\\n flex-direction: row;\\n align-items: center;\\n gap: var(--aparte-space-5);\\n padding: var(--aparte-space-5) var(--aparte-space-6);\\n transition: background-color var(--aparte-duration-fast, 0.12s) ease;\\n}\\n\\n.aparte-place__text {\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n gap: var(--aparte-space-1);\\n min-inline-size: 0;\\n}\\n\\n.aparte-place__row-head {\\n display: flex;\\n align-items: baseline;\\n gap: var(--aparte-space-3);\\n min-inline-size: 0;\\n}\\n\\n.aparte-place__row .aparte-place__name {\\n flex: 1;\\n min-inline-size: 0;\\n font-size: var(--aparte-font-size-base);\\n}\\n\\n.aparte-place__row .aparte-place__distance {\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-sm);\\n}\\n\\n.aparte-place__row .aparte-place__score,\\n.aparte-place__row .aparte-place__status { font-size: var(--aparte-font-size-xs); }\\n\\n.aparte-place__row .aparte-place__score { flex-wrap: nowrap; overflow: hidden; }\\n\\n.aparte-place__list {\\n margin: 0;\\n padding: 0;\\n list-style: none;\\n}\\n\\n.aparte-place__list > li + li { border-block-start: var(--aparte-border-width) solid var(--aparte-border); }\\n\\n.aparte-place__list > .aparte-place__row:hover,\\n.aparte-place-card[data-variant=\\\"compact\\\"] > .aparte-place__row:hover {\\n background: color-mix(in oklab, var(--aparte-text) 4%, transparent);\\n}\\n\\n.aparte-place-card[data-variant=\\\"compact\\\"] > .aparte-place__heading {\\n padding: var(--aparte-space-5) var(--aparte-space-6) var(--aparte-space-3);\\n border-block-end: var(--aparte-border-width) solid var(--aparte-border);\\n}\\n\\n/* ── Detail ──────────────────────────────────────────────────────────── */\\n\\n.aparte-place--detail .aparte-place__media--wide { aspect-ratio: var(--aparte-place-detail-ratio); }\\n\\n.aparte-place--detail .aparte-place__body {\\n gap: var(--aparte-space-7);\\n padding: var(--aparte-space-7) var(--aparte-space-8) var(--aparte-space-8);\\n}\\n\\n.aparte-place__head {\\n display: flex;\\n flex-direction: column;\\n gap: var(--aparte-space-2);\\n min-inline-size: 0;\\n}\\n\\n.aparte-place--detail .aparte-place__name {\\n font-size: var(--aparte-font-size-xl);\\n white-space: normal;\\n}\\n\\n.aparte-place--detail .aparte-place__score,\\n.aparte-place--detail .aparte-place__status { font-size: var(--aparte-font-size-md); }\\n\\n.aparte-place--detail .aparte-place__actions { margin: 0; }\\n\\n.aparte-place__info {\\n display: grid;\\n gap: var(--aparte-space-5);\\n margin: 0;\\n padding: var(--aparte-space-6) 0 0;\\n border-block-start: var(--aparte-border-width) solid var(--aparte-border);\\n list-style: none;\\n font-size: var(--aparte-font-size-md);\\n}\\n\\n.aparte-place__info > li {\\n display: flex;\\n align-items: flex-start;\\n gap: var(--aparte-space-4);\\n min-inline-size: 0;\\n overflow-wrap: anywhere;\\n}\\n\\n.aparte-place__info .aparte-place__line-glyph { margin-block-start: 0.1em; }\\n.aparte-place__info .aparte-place__address-text { white-space: normal; }\\n.aparte-place__info .aparte-place__link { color: var(--aparte-primary-ink, var(--aparte-text)); }\\n\\n.aparte-place__hours {\\n inline-size: 100%;\\n border-collapse: collapse;\\n font-size: var(--aparte-font-size-md);\\n}\\n\\n.aparte-place__hours-title {\\n padding-block: var(--aparte-space-6) var(--aparte-space-3);\\n border-block-start: var(--aparte-border-width) solid var(--aparte-border);\\n font-weight: var(--aparte-font-weight-semibold);\\n text-align: start;\\n}\\n\\n.aparte-place__hours-title .aparte-place__line-glyph {\\n margin-inline-end: var(--aparte-space-3);\\n vertical-align: -0.15em;\\n}\\n\\n.aparte-place__hours th,\\n.aparte-place__hours td {\\n padding-block: var(--aparte-space-2);\\n vertical-align: top;\\n}\\n\\n.aparte-place__hours th {\\n padding-inline: var(--aparte-space-3) var(--aparte-space-6);\\n color: var(--aparte-text-muted);\\n font-weight: var(--aparte-font-weight-normal);\\n text-align: start;\\n white-space: nowrap;\\n}\\n\\n/* `Intl` writes \\\"lundi\\\" for the middle of a sentence; a row's label starts with a capital. */\\n.aparte-place__hours th::first-letter { text-transform: uppercase; }\\n\\n.aparte-place__hours td {\\n padding-inline-end: var(--aparte-space-3);\\n text-align: end;\\n}\\n\\n.aparte-place__hours tr[data-closed] td { color: var(--aparte-place-closed); }\\n\\n/* Today: the first row, on a band of the accent, in full ink. */\\n.aparte-place__hours tr[aria-current] > * {\\n background: color-mix(in oklab, var(--aparte-primary) 10%, transparent);\\n color: var(--aparte-text);\\n font-weight: var(--aparte-font-weight-semibold);\\n}\\n\\n.aparte-place__hours tr[aria-current] > :first-child {\\n border-start-start-radius: var(--aparte-radius-md);\\n border-end-start-radius: var(--aparte-radius-md);\\n}\\n\\n.aparte-place__hours tr[aria-current] > :last-child {\\n border-start-end-radius: var(--aparte-radius-md);\\n border-end-end-radius: var(--aparte-radius-md);\\n}\\n\\n.aparte-place__tags {\\n display: flex;\\n flex-wrap: wrap;\\n gap: var(--aparte-space-2);\\n margin: 0;\\n padding: 0;\\n list-style: none;\\n}\\n\\n/* ── Loading ─────────────────────────────────────────────────────────── */\\n\\n.aparte-place-card[data-state=\\\"loading\\\"] .aparte-place__sk-media {\\n block-size: auto;\\n border-radius: 0;\\n}\\n\\n.aparte-place-card[data-state=\\\"loading\\\"] .aparte-place__sk-thumb {\\n flex: none;\\n block-size: var(--aparte-place-thumb-size);\\n border-radius: var(--aparte-radius-lg);\\n}\\n\\n.aparte-place-card[data-state=\\\"loading\\\"] .aparte-place__sk-name { inline-size: 60%; block-size: 1.1rem; }\\n.aparte-place-card[data-state=\\\"loading\\\"] .aparte-place__sk-line { inline-size: 80%; }\\n.aparte-place-card[data-state=\\\"loading\\\"] .aparte-place__sk-line--short { inline-size: 50%; }\\n\\n.aparte-place-card[data-state=\\\"loading\\\"] .aparte-place__sk-actions {\\n display: flex;\\n gap: var(--aparte-space-3);\\n margin-block-start: var(--aparte-space-5);\\n}\\n\\n.aparte-place-card[data-state=\\\"loading\\\"] .aparte-place__sk-btn {\\n inline-size: 6rem;\\n block-size: 2rem;\\n border-radius: var(--aparte-radius-full);\\n}\\n\\n.aparte-place-card[data-state=\\\"loading\\\"] .aparte-place__sk-hours {\\n display: grid;\\n gap: var(--aparte-space-3);\\n margin-block-start: var(--aparte-space-5);\\n}\\n\\n/* ── Small screens, and stillness ────────────────────────────────────── */\\n\\n@media (max-width: 380px) {\\n .aparte-place__body { padding: var(--aparte-space-5) var(--aparte-space-6) var(--aparte-space-6); }\\n .aparte-place--detail .aparte-place__body { padding: var(--aparte-space-6); }\\n .aparte-place__actions > .aparte-place__action:not(.aparte-btn--icon) { flex: 1 1 auto; justify-content: center; }\\n .aparte-place__collection .aparte-rich-card__carousel { --aparte-rich-card-slide-size: 84%; }\\n .aparte-place__hours th { padding-inline-end: var(--aparte-space-4); }\\n .aparte-place-card { --aparte-place-thumb-size: 3rem; }\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n .aparte-place--tile:hover .aparte-place__img,\\n .aparte-place-card[data-variant=\\\"card\\\"] > .aparte-place:hover .aparte-place__img { transform: none; }\\n .aparte-place__status-dot::after { content: none; }\\n}\\n\"", "/**\n * @aparte/plugin-cards/place — a tool's places, drawn as cards: a restaurant, a shop, a\n * hotel, a venue, with its rating, whether it is open now, and the way there.\n *\n * import { setupPlaceCard } from '@aparte/plugin-cards/place';\n *\n * setupPlaceCard({ tool: 'search_places', map: (result) => result.results });\n *\n * One place or several (`[...]`, or `{ title, places: [...] }`). Three variants of one\n * card: `card` (a tile with its photo; several scroll sideways), `compact` (one row each,\n * stacked) and `detail` (one place in full, with its week of opening hours). Your tool keeps\n * its own fields: `readPlaces` reads the usual names for each (Google Places, both\n * generations, Yelp, OpenStreetMap-ish tools, what a model writes by hand), and `map` says\n * the rest.\n *\n * Whether a place is open is worked out when the card is drawn, from its weekly `hours`\n * (`isOpenAt`, `placeStatus`) — Google's current hours, holidays included, before its\n * regular week — else from the tool's own `openNow`. The three buttons a place\n * gets for free — Directions, Call, Website — appear only when its data can honour them,\n * and an app that passes its own `actions` replaces them.\n */\nimport type { AparteConfig } from '@aparte/core';\nimport { carousel } from '../kit/carousel.js';\nimport { defineCard, type CardContext, type CardSetupOptions } from '../kit/define.js';\nimport { el, glyph, num, safeUrl, str, type Loose } from '../kit/dom.js';\nimport { formatNumber, formatUnit } from '../kit/format.js';\nimport { rating } from '../kit/rating.js';\nimport { intlTag, word, type CardWord } from '../kit/strings.js';\nimport { CLOCK, DIRECTIONS, GLOBE, PHONE, PIN, kindGlyph, type PlaceKind } from './icons.js';\nimport placeStyles from './place.css?raw';\n\nexport type { PlaceKind } from './icons.js';\nexport type PlaceVariant = 'card' | 'compact' | 'detail';\n\n/** One opening range of the week, as a tool writes it. */\nexport interface PlaceHoursInput {\n /** 0 = Sunday … 6 = Saturday (7 reads as Sunday too), or an English day name (\"mon\", \"Monday\"). */\n day: number | string;\n /** \"09:00\", \"9:30\", \"0900\", \"21h30\", \"9 PM\". */\n open: string;\n /** Past midnight is fine (\"02:00\" after \"18:00\"). Missing, or \"24:00\", is midnight. */\n close?: string;\n}\n\n/** An opening range once read: minutes from the start of `day`. `end` passes 1440 when it closes after midnight. */\nexport interface PlaceHoursRange {\n day: number;\n start: number;\n end: number;\n}\n\n/**\n * A place as `map` returns it. Only `name` is needed; every other field adds a line when it\n * is there and nothing when it is not. `readPlaces` also reads the usual aliases (listed on\n * each field).\n */\nexport interface PlaceInput {\n /** Also `title`, `displayName`. */\n name: string;\n /** Shown as it is: \"Trattoria\", \"Boulangerie\". Also `primaryTypeDisplayName`, `categories[0]`. */\n category?: string;\n /** Google's `types`, read only to choose a glyph and, without `category`, a word. */\n types?: string[];\n /** An `http(s)` photo. Also `photo`, `imageUrl`, `thumbnail`, `photos[0]`. */\n image?: string;\n /** 0–5 (a 10-point score is halved). */\n rating?: number;\n /** Also `user_ratings_total`, `userRatingCount`, `reviews`, `review_count`. */\n reviewCount?: number;\n /** 1–4, `\"€€\"`, or Google's `\"PRICE_LEVEL_MODERATE\"`; any other text is shown as it is (\"€10–20\"). Also `price_level`. */\n priceLevel?: number | string;\n /** Also `formatted_address`, `formattedAddress`, `vicinity`, Yelp's `location.display_address`. */\n address?: string;\n /** In metres; a text (\"12 min walk\") is shown as it is. Also `distanceMeters`. */\n distance?: number | string;\n /** Also `formatted_phone_number`, `international_phone_number`, `nationalPhoneNumber`. */\n phone?: string;\n /** The place's own site. Also `websiteUri`. */\n website?: string;\n /** The place's page (on a map, a guide); the name links to it. Also `googleMapsUri`. */\n url?: string;\n /** Also `lat`/`lng`, `latitude`/`longitude`, `geometry.location`, `location`. */\n coordinates?: { lat: number; lng: number };\n /** Google's place id, which makes Directions land on the place itself. Also `place_id`. */\n placeId?: string;\n /** The tool's own answer; `hours` wins when both are given. Also `open_now`, `isOpen`, `opening_hours.open_now`, Yelp's `hours[0].is_open_now`. */\n openNow?: boolean;\n /**\n * The week's opening hours: `[{ day, open, close }]` (several ranges a day, closing past\n * midnight), Google's `periods` or `weekday_text`, Yelp's `hours`, or\n * `{ monday: \"09:00-18:00\", sunday: \"closed\" }`. Also `currentOpeningHours` (read first:\n * it has the holidays), `regularOpeningHours`, `opening_hours`, `openingHours`.\n */\n hours?: PlaceHoursInput[] | Record<string, unknown> | string[];\n /** The place's offset from UTC in minutes, so \"Open now\" is read on the place's clock. Also `utc_offset_minutes`. */\n utcOffset?: number;\n /** At most four short facts: \"Terrace\", \"Vegan\". Also `features`, `amenities`. */\n tags?: string[];\n}\n\n/** A price level once read: the tier, and the sign the source wrote it with, if it did. */\nexport interface PlacePrice {\n level: number;\n symbol?: string;\n}\n\n/** A place as the card draws it, once read. */\nexport interface Place {\n name: string;\n category?: string;\n kind: PlaceKind;\n image?: string;\n rating?: number;\n reviewCount?: number;\n price?: PlacePrice;\n priceText?: string;\n address?: string;\n distance?: number;\n distanceText?: string;\n phone?: string;\n website?: string;\n url?: string;\n coordinates?: { lat: number; lng: number };\n placeId?: string;\n openNow?: boolean;\n hours: PlaceHoursRange[];\n utcOffset?: number;\n tags: string[];\n}\n\n/** The card's data: one place or several, and the collection's title. */\nexport interface PlaceData {\n title?: string;\n places: Place[];\n}\n\n/** Whether a place is open at a moment, and when that changes (none: it never does). */\nexport interface PlaceStatus {\n open: boolean;\n changesAt?: Date;\n}\n\n/** How an app plugs the place card in: the kit's options, and two of the card's own. */\nexport interface PlaceCardOptions extends CardSetupOptions<PlaceData, PlaceVariant> {\n /**\n * The sign a price TIER (1–4) is drawn with. A tier is a scale, not an amount — Google\n * and Yelp return a number, not a currency — so the card cannot know the place's money.\n * `$` by default, the sign those APIs' own documentation uses; a European app passes `€`.\n * A tier the source wrote with its own sign (\"€€\") keeps it. Read aloud as\n * \"Price level 2 of 4\" either way.\n */\n currencySymbol?: string;\n /** The clock \"Open now\" is read against — the device's by default; a test or a replay passes its own. */\n now?: () => Date;\n /**\n * The Directions / Call / Website buttons on each place, drawn from its data (`true` by\n * default). They are the place's own; the app's `actions` are the card's, under it, and\n * one does not replace the other. `false` draws none.\n */\n builtIns?: boolean;\n /**\n * A real map behind a place that has coordinates and no photo: the address of your\n * map tiles, `{z}`, `{x}` and `{y}` in it (OpenStreetMap's, MapTiler's or Stadia's with\n * your key in the address, your own server's). Unset — the default — the card draws its\n * own map and fetches nothing: tiles are requests to a third party, which sees the\n * visitor and the place, so they are the app's choice. A tile that fails to load brings\n * the drawn map back.\n *\n * @example\n * setupPlaceCard({\n * mapTiles: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',\n * mapAttribution: '© OpenStreetMap contributors',\n * });\n */\n mapTiles?: string;\n /** The credit the tiles' provider asks for, shown on the map. Most require one. */\n mapAttribution?: string;\n /** How close the map is, as tile servers count it: 16 by default, a street and its neighbours. */\n mapZoom?: number;\n}\n\nconst P = {\n cardsPlaceTitle: { en: 'Places', fr: 'Lieux', de: 'Orte', es: 'Lugares', it: 'Luoghi', ja: '場所', ko: '장소', pt: 'Lugares', ru: 'Места', zh: '地点' },\n cardsPlaceCount: { en: '{n} places', fr: '{n} lieux', de: '{n} Orte', es: '{n} lugares', it: '{n} luoghi', ja: '{n}件の場所', ko: '장소 {n}곳', pt: '{n} lugares', ru: 'Мест: {n}', zh: '{n} 个地点' },\n cardsPlaceOpen: { en: 'Open', fr: 'Ouvert', de: 'Geöffnet', es: 'Abierto', it: 'Aperto', ja: '営業中', ko: '영업 중', pt: 'Aberto', ru: 'Открыто', zh: '营业中' },\n cardsPlaceClosed: { en: 'Closed', fr: 'Fermé', de: 'Geschlossen', es: 'Cerrado', it: 'Chiuso', ja: '営業時間外', ko: '영업 종료', pt: 'Fechado', ru: 'Закрыто', zh: '已打烊' },\n cardsPlaceClosesSoon: { en: 'Closes soon', fr: 'Ferme bientôt', de: 'Schließt bald', es: 'Cierra pronto', it: 'Chiude a breve', ja: 'まもなく営業終了', ko: '곧 영업 종료', pt: 'Fecha em breve', ru: 'Скоро закроется', zh: '即将打烊' },\n cardsPlaceClosesAt: { en: 'Closes at {t}', fr: 'Ferme à {t}', de: 'Schließt um {t}', es: 'Cierra a las {t}', it: 'Chiude alle {t}', ja: '{t}に営業終了', ko: '{t}에 영업 종료', pt: 'Fecha às {t}', ru: 'Закроется в {t}', zh: '{t}打烊' },\n cardsPlaceClosesOn: { en: 'Closes {day} at {t}', fr: 'Ferme {day} à {t}', de: 'Schließt {day} um {t}', es: 'Cierra el {day} a las {t}', it: 'Chiude {day} alle {t}', ja: '{day}の{t}に営業終了', ko: '{day} {t}에 영업 종료', pt: 'Fecha {day} às {t}', ru: 'Закроется: {day}, {t}', zh: '{day}{t}打烊' },\n cardsPlaceOpensAt: { en: 'Opens at {t}', fr: 'Ouvre à {t}', de: 'Öffnet um {t}', es: 'Abre a las {t}', it: 'Apre alle {t}', ja: '{t}に営業開始', ko: '{t}에 영업 시작', pt: 'Abre às {t}', ru: 'Откроется в {t}', zh: '{t}开始营业' },\n cardsPlaceOpensTomorrow: { en: 'Opens tomorrow at {t}', fr: 'Ouvre demain à {t}', de: 'Öffnet morgen um {t}', es: 'Abre mañana a las {t}', it: 'Apre domani alle {t}', ja: '明日{t}に営業開始', ko: '내일 {t}에 영업 시작', pt: 'Abre amanhã às {t}', ru: 'Откроется завтра в {t}', zh: '明天{t}开始营业' },\n cardsPlaceOpensOn: { en: 'Opens {day} at {t}', fr: 'Ouvre {day} à {t}', de: 'Öffnet {day} um {t}', es: 'Abre el {day} a las {t}', it: 'Apre {day} alle {t}', ja: '{day}の{t}に営業開始', ko: '{day} {t}에 영업 시작', pt: 'Abre {day} às {t}', ru: 'Откроется: {day}, {t}', zh: '{day}{t}开始营业' },\n cardsPlaceAlwaysOpen: { en: 'Open 24 hours', fr: 'Ouvert 24 h/24', de: 'Rund um die Uhr geöffnet', es: 'Abierto 24 horas', it: 'Aperto 24 ore su 24', ja: '24時間営業', ko: '24시간 영업', pt: 'Aberto 24 horas', ru: 'Круглосуточно', zh: '24小时营业' },\n cardsPlaceDirections: { en: 'Directions', fr: 'Itinéraire', de: 'Route', es: 'Cómo llegar', it: 'Indicazioni', ja: 'ルート', ko: '길찾기', pt: 'Rotas', ru: 'Маршрут', zh: '路线' },\n cardsPlaceCall: { en: 'Call', fr: 'Appeler', de: 'Anrufen', es: 'Llamar', it: 'Chiama', ja: '電話', ko: '전화', pt: 'Ligar', ru: 'Позвонить', zh: '致电' },\n cardsPlaceWebsite: { en: 'Website', fr: 'Site web', de: 'Website', es: 'Sitio web', it: 'Sito web', ja: 'ウェブサイト', ko: '웹사이트', pt: 'Site', ru: 'Сайт', zh: '网站' },\n cardsPlaceHours: { en: 'Hours', fr: 'Horaires', de: 'Öffnungszeiten', es: 'Horario', it: 'Orari', ja: '営業時間', ko: '영업시간', pt: 'Horário', ru: 'Часы работы', zh: '营业时间' },\n cardsPlacePrice: { en: 'Price level {level} of {max}', fr: 'Gamme de prix {level} sur {max}', de: 'Preisniveau {level} von {max}', es: 'Nivel de precio {level} de {max}', it: 'Fascia di prezzo {level} su {max}', ja: '価格帯 {max}段階中{level}', ko: '가격대 {max}단계 중 {level}', pt: 'Faixa de preço {level} de {max}', ru: 'Уровень цен: {level} из {max}', zh: '价格等级 {level}/{max}' },\n cardsPlacePhoto: { en: 'Photo of {name}', fr: 'Photo de {name}', de: 'Foto von {name}', es: 'Foto de {name}', it: 'Foto di {name}', ja: '{name}の写真', ko: '{name} 사진', pt: 'Foto de {name}', ru: 'Фото: {name}', zh: '{name}的照片' },\n} satisfies Record<string, CardWord>;\n\n/** A kind's name, for the badge of a place whose tool gave only Google-style `types`. */\nconst KIND_WORDS: Record<Exclude<PlaceKind, 'place'>, CardWord> = {\n restaurant: { en: 'Restaurant', fr: 'Restaurant', de: 'Restaurant', es: 'Restaurante', it: 'Ristorante', ja: 'レストラン', ko: '음식점', pt: 'Restaurante', ru: 'Ресторан', zh: '餐厅' },\n cafe: { en: 'Café', fr: 'Café', de: 'Café', es: 'Cafetería', it: 'Caffè', ja: 'カフェ', ko: '카페', pt: 'Café', ru: 'Кафе', zh: '咖啡馆' },\n bar: { en: 'Bar', fr: 'Bar', de: 'Bar', es: 'Bar', it: 'Bar', ja: 'バー', ko: '바', pt: 'Bar', ru: 'Бар', zh: '酒吧' },\n hotel: { en: 'Hotel', fr: 'Hôtel', de: 'Hotel', es: 'Hotel', it: 'Hotel', ja: 'ホテル', ko: '호텔', pt: 'Hotel', ru: 'Отель', zh: '酒店' },\n shop: { en: 'Shop', fr: 'Boutique', de: 'Geschäft', es: 'Tienda', it: 'Negozio', ja: 'ショップ', ko: '상점', pt: 'Loja', ru: 'Магазин', zh: '商店' },\n museum: { en: 'Museum', fr: 'Musée', de: 'Museum', es: 'Museo', it: 'Museo', ja: '博物館', ko: '박물관', pt: 'Museu', ru: 'Музей', zh: '博物馆' },\n park: { en: 'Park', fr: 'Parc', de: 'Park', es: 'Parque', it: 'Parco', ja: '公園', ko: '공원', pt: 'Parque', ru: 'Парк', zh: '公园' },\n gym: { en: 'Gym', fr: 'Salle de sport', de: 'Fitnessstudio', es: 'Gimnasio', it: 'Palestra', ja: 'ジム', ko: '헬스장', pt: 'Academia', ru: 'Спортзал', zh: '健身房' },\n pharmacy: { en: 'Pharmacy', fr: 'Pharmacie', de: 'Apotheke', es: 'Farmacia', it: 'Farmacia', ja: '薬局', ko: '약국', pt: 'Farmácia', ru: 'Аптека', zh: '药店' },\n};\n\n/** The most places one card draws; a search that returns forty is a list, not a card. */\nconst MAX_PLACES = 10;\nconst MAX_TAGS = 4;\nconst PRICE_MAX = 4;\n/** Within this many minutes of closing, \"Open\" turns to \"Closes soon\". */\nconst SOON = 60;\nconst DAY = 1440;\nconst WEEK = 7 * DAY;\n\n// ── Reading ──────────────────────────────────────────────────────────────────\n\nconst DAY_NAMES = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];\n\nfunction readDay(value: unknown): number | undefined {\n const n = num(value);\n if (n !== undefined) return Number.isInteger(n) && n >= 0 && n <= 7 ? n % 7 : undefined;\n if (typeof value !== 'string') return undefined;\n const i = DAY_NAMES.indexOf(value.trim().slice(0, 3).toLowerCase());\n return i >= 0 ? i : undefined;\n}\n\n/** Minutes from midnight: \"09:00\", \"9:30\", \"0900\", \"21h30\", \"9 PM\", Google's `{ hour, minute }`. */\nexport function readTime(value: unknown): number | undefined {\n if (value && typeof value === 'object') {\n const o = value as Record<string, unknown>;\n const h = num(o['hour']);\n const m = num(o['minute']) ?? 0;\n return h !== undefined && h >= 0 && h <= 24 && m >= 0 && m < 60 ? h * 60 + m : undefined;\n }\n const s = str(value);\n if (!s) return undefined;\n const match = /^(\\d{1,2})(?:\\s*[:h.]\\s*)?(\\d{2})?\\s*(?:([ap])\\.?\\s*m\\.?)?$/i.exec(s);\n if (!match) return undefined;\n let h = Number(match[1]);\n const m = match[2] ? Number(match[2]) : 0;\n const half = match[3]?.toLowerCase();\n if (m > 59) return undefined;\n if (half) {\n if (h < 1 || h > 12) return undefined;\n h = (h % 12) + (half === 'p' ? 12 : 0);\n }\n if (h > 24 || (h === 24 && m > 0)) return undefined;\n return h * 60 + m;\n}\n\n/** The ranges a day's text says: \"09:00-12:00, 14:00-18:00\", \"9:00 AM – 5:00 PM\", \"Closed\", \"Open 24 hours\". */\nfunction rangesOfText(day: number, value: unknown): PlaceHoursRange[] {\n const parts = Array.isArray(value) ? value : typeof value === 'string' ? value.split(/\\s*[,;]\\s*/) : [];\n const out: PlaceHoursRange[] = [];\n for (const part of parts) {\n if (typeof part !== 'string') continue;\n const [from, to] = part.split(/\\s*[-–—]\\s*|\\s+to\\s+/i);\n // \"Open 24 hours\", \"24h/24\" — but not the end of a range: \"18h-24h\" closes at midnight.\n if (to === undefined && /24\\s*(h|hours|heures|\\/\\s*24)/i.test(part)) {\n out.push({ day, start: 0, end: DAY });\n continue;\n }\n let end = readTime(to);\n const start = sharedMeridiem(from, to, end) ?? readTime(from);\n if (start === undefined || end === undefined) continue;\n if (end <= start) end += DAY;\n out.push({ day, start, end });\n }\n return out;\n}\n\n/**\n * The start of a range that writes AM/PM once, at its end — Google's \"5:00 – 10:00 PM\" is\n * five in the evening. The end's meridiem is lent to the start only when that keeps the\n * start before the end: \"9:00 – 5:00 PM\" stays nine in the morning.\n */\nfunction sharedMeridiem(from: string | undefined, to: string | undefined, end: number | undefined): number | undefined {\n const MERIDIEM = /([ap])\\.?\\s*m\\.?\\s*$/i;\n const half = to !== undefined ? MERIDIEM.exec(to) : null;\n if (!from || !half || end === undefined || /[ap]\\.?\\s*m\\.?\\s*$/i.test(from)) return undefined;\n const start = readTime(`${from} ${half[1]}M`);\n return start !== undefined && start < end ? start : undefined;\n}\n\n/**\n * A range longer than a day — open from Friday evening to Sunday night, or around the clock\n * (Google writes that as one period with no close) — split at each midnight, so the week's\n * table shows every day it covers instead of the day it started.\n */\nfunction splitLong(range: PlaceHoursRange): PlaceHoursRange[] {\n if (range.end - range.start <= DAY) return [range];\n const out: PlaceHoursRange[] = [];\n let at = range.day * DAY + range.start;\n const stop = Math.min(range.day * DAY + range.end, range.day * DAY + range.start + WEEK);\n while (at < stop) {\n const midnight = (Math.floor(at / DAY) + 1) * DAY;\n const end = Math.min(stop, midnight);\n out.push({ day: Math.floor(at / DAY) % 7, start: at % DAY, end: end - Math.floor(at / DAY) * DAY });\n at = end;\n }\n return out;\n}\n\n/**\n * The week's opening hours from the shapes tools write them in: `[{ day, open, close }]`,\n * Google's `periods` (`{ open: { day, time | hour, minute }, close }`), its `weekday_text`\n * (\"Monday: 9:00 AM – 5:00 PM\"), or a week by name (`{ monday: \"09:00-18:00\" }`).\n * Anything it cannot read is left out.\n */\nexport function readHours(raw: unknown): PlaceHoursRange[] {\n if (!raw || typeof raw !== 'object') return [];\n if (!Array.isArray(raw)) {\n const o = raw as Record<string, unknown>;\n for (const key of ['periods', 'weekday_text', 'weekdayDescriptions']) {\n if (Array.isArray(o[key])) return readHours(o[key]);\n }\n const out: PlaceHoursRange[] = [];\n for (const [key, value] of Object.entries(o)) {\n if (!/^[a-z]+$/i.test(key)) continue;\n const day = readDay(key);\n if (day !== undefined) out.push(...rangesOfText(day, value));\n }\n return tidy(out);\n }\n const yelp = raw.filter((item): item is Loose => !!item && typeof item === 'object' && Array.isArray((item as Loose)['open']));\n if (yelp.length) return tidy(yelpRanges(yelp));\n const out: PlaceHoursRange[] = [];\n for (const item of raw) {\n if (typeof item === 'string') {\n const line = /^\\s*([A-Za-z]+)\\s*:\\s*(.+)$/.exec(item);\n const day = line ? readDay(line[1]) : undefined;\n if (line && day !== undefined) out.push(...rangesOfText(day, line[2]));\n continue;\n }\n if (!item || typeof item !== 'object') continue;\n const r = item as Record<string, unknown>;\n if (typeof r['start'] === 'number' && typeof r['end'] === 'number') {\n // Already read.\n const day = readDay(r['day']);\n if (day !== undefined && r['end'] > r['start']) out.push({ day, start: r['start'], end: r['end'] });\n continue;\n }\n if (r['open'] && typeof r['open'] === 'object') {\n // Google's period: the opening and the closing each carry their own day.\n const o = r['open'] as Record<string, unknown>;\n const day = readDay(o['day']);\n const start = readTime(o['time'] ?? o);\n if (day === undefined || start === undefined) continue;\n const c = r['close'];\n if (!c || typeof c !== 'object') {\n // Google's documented \"always open\" is one period, Sunday 00:00, with no close.\n // A missing close anywhere else is not documented: read it as midnight, as the\n // plain `{ day, open }` shape does, rather than as the whole week.\n out.push({ day, start, end: day === 0 && start === 0 ? WEEK : DAY });\n continue;\n }\n const cDay = readDay((c as Record<string, unknown>)['day']);\n const cTime = readTime((c as Record<string, unknown>)['time'] ?? c);\n if (cDay === undefined || cTime === undefined) continue;\n let end = ((cDay - day + 7) % 7) * DAY + cTime;\n if (end <= start) end += WEEK;\n out.push({ day, start, end });\n continue;\n }\n const day = readDay(r['day'] ?? r['weekday']);\n const start = readTime(r['open'] ?? r['opens'] ?? r['from']);\n if (day === undefined || start === undefined) continue;\n const close = r['close'] ?? r['closes'] ?? r['to'];\n let end = close === undefined || close === null || close === '' ? DAY : readTime(close);\n if (end === undefined) continue;\n if (end <= start) end += DAY;\n out.push({ day, start, end });\n }\n return tidy(out);\n}\n\n/**\n * Yelp Fusion's `hours`: `[{ hour_type, is_open_now, open: [{ day, start, end, is_overnight }] }]`,\n * where `day` 0 is MONDAY and the times are \"HHMM\" (\"0700\", \"2130\"). Only the regular week:\n * another `hour_type` (special hours) would mix into it.\n */\nfunction yelpRanges(entries: Loose[]): PlaceHoursRange[] {\n const regular = entries.filter((e) => !str(e['hour_type']) || /regular/i.test(String(e['hour_type'])));\n const out: PlaceHoursRange[] = [];\n for (const entry of regular.length ? regular : entries.slice(0, 1)) {\n for (const range of entry['open'] as unknown[]) {\n const r = (range ?? {}) as Loose;\n const n = num(r['day']);\n const hhmm = (v: unknown) => readTime(str(v)?.padStart(4, '0'));\n const start = hhmm(r['start']);\n let end = hhmm(r['end']);\n if (n === undefined || !Number.isInteger(n) || n < 0 || n > 6 || start === undefined || end === undefined) continue;\n // `is_overnight`: the end is on the next day, which an end before the start says too.\n if (end <= start) end += DAY;\n out.push({ day: (n + 1) % 7, start, end });\n }\n }\n return out;\n}\n\nfunction tidy(ranges: PlaceHoursRange[]): PlaceHoursRange[] {\n return ranges.flatMap(splitLong).sort((a, b) => a.day - b.day || a.start - b.start);\n}\n\n/** The week's open spans in minutes from Sunday 00:00, repeated a week either side and merged. */\nfunction spans(ranges: PlaceHoursRange[]): Array<[number, number]> {\n const list: Array<[number, number]> = [];\n for (const r of ranges) {\n for (const shift of [-WEEK, 0, WEEK]) list.push([r.day * DAY + r.start + shift, r.day * DAY + r.end + shift]);\n }\n list.sort((a, b) => a[0] - b[0]);\n const merged: Array<[number, number]> = [];\n for (const span of list) {\n const last = merged[merged.length - 1];\n // Touching spans are one: open 09:00–12:00 and 12:00–14:00 closes at 14:00.\n if (last && span[0] <= last[1]) last[1] = Math.max(last[1], span[1]);\n else merged.push([span[0], span[1]]);\n }\n return merged;\n}\n\n/**\n * Whether a place with these hours is open at `date`, and when that changes — read on\n * `date`'s own clock (pass the place's local time). `null` when the hours say nothing.\n * Hours take any shape `readHours` reads.\n */\nexport function placeStatus(hours: unknown, date: Date): PlaceStatus | null {\n const ranges = readHours(hours);\n if (!ranges.length) return null;\n const t = date.getDay() * DAY + date.getHours() * 60 + date.getMinutes();\n // A minute of the week as a time on `date`'s clock, built from its fields rather than\n // added to it: a daylight-saving change in between would move \"04:00\" to 03:00.\n const at = (minute: number) => new Date(date.getFullYear(), date.getMonth(), date.getDate() - date.getDay() + Math.floor(minute / DAY), 0, minute % DAY);\n const list = spans(ranges);\n const inside = list.find(([s, e]) => s <= t && t < e);\n if (inside) return inside[1] - inside[0] >= WEEK ? { open: true } : { open: true, changesAt: at(inside[1]) };\n const next = list.find(([s]) => s > t);\n return next ? { open: false, changesAt: at(next[0]) } : { open: false };\n}\n\n/** Whether a place with these hours is open at `date`. No hours, no answer: `false`. */\nexport function isOpenAt(hours: unknown, date: Date): boolean {\n return placeStatus(hours, date)?.open ?? false;\n}\n\n/**\n * `date` moved to the place's wall clock, when its UTC offset is known: the place's time,\n * read off the UTC fields of the shifted instant, written into a Date's local fields (which\n * is how `placeStatus` reads a clock). Adding the reader's `getTimezoneOffset()` instead is\n * an hour wrong whenever the reader's own zone changes its clocks in between.\n */\nfunction placeTime(place: Pick<Place, 'utcOffset'>, now: Date): Date {\n if (place.utcOffset === undefined) return now;\n const t = new Date(now.getTime() + place.utcOffset * 60_000);\n return new Date(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate(), t.getUTCHours(), t.getUTCMinutes(), t.getUTCSeconds(), t.getUTCMilliseconds());\n}\n\nconst KIND_RULES: Array<[Exclude<PlaceKind, 'place'>, RegExp]> = [\n ['cafe', /\\bcaf[eé]s?\\b|coffee|tea ?room|bakery|boulangerie|p[aâ]tisserie|salon de th[eé]/],\n ['bar', /\\bbars?\\b|\\bpubs?\\b|brewery|\\bwine\\b|cocktail|night ?club/],\n ['restaurant', /restaurant|\\bfood\\b|meal|pizz|sushi|burger|bistro|brasserie|diner|eatery|trattoria|ramen|steak|cr[eê]perie/],\n ['hotel', /h[oô]tel|lodging|hostel|motel|\\binn\\b|resort|guest ?house|bed and breakfast|\\bb ?& ?b\\b/],\n ['museum', /museum|mus[eé]e|galler|monument|landmark|tourist attraction|\\bart\\b/],\n ['park', /\\bparks?\\b|\\bparcs?\\b|garden|jardin|beach|plage|\\bzoo\\b|campground/],\n ['gym', /\\bgyms?\\b|fitness|stadium|swimming|piscine/],\n ['pharmacy', /pharmac|drugstore|chemist/],\n ['shop', /shop|store|boutique|market|\\bmall\\b|grocery|supermarch|magasin|[eé]picerie/],\n];\n\n/** The kind of place, from its category, then its types in order — the first one that says. */\nfunction readKind(candidates: unknown[]): PlaceKind {\n for (const candidate of candidates) {\n const text = str(candidate)?.toLowerCase().replace(/[_-]+/g, ' ');\n if (!text) continue;\n for (const [kind, rule] of KIND_RULES) if (rule.test(text)) return kind;\n }\n return 'place';\n}\n\nconst PRICE_WORDS: Record<string, number> = {\n inexpensive: 1, cheap: 1, moderate: 2, expensive: 3, very_expensive: 4, 'very expensive': 4,\n};\n\nfunction readPrice(value: unknown): { price?: PlacePrice; priceText?: string } {\n const n = num(value);\n if (n !== undefined) return n >= 1 && n <= PRICE_MAX ? { price: { level: Math.round(n) } } : {};\n const s = str(value);\n if (!s) return {};\n const repeated = /^(\\p{Sc})\\1{0,3}$/u.exec(s);\n if (repeated) return { price: { level: s.length / repeated[1]!.length, symbol: repeated[1] } };\n const named = PRICE_WORDS[s.toLowerCase().replace(/^price_level_/, '')];\n if (named) return { price: { level: named } };\n if (/^price_level_/i.test(s)) return {};\n return s.length <= 24 ? { priceText: s } : {};\n}\n\nfunction readCoordinates(r: Loose): Place['coordinates'] {\n const candidates = [r['coordinates'], r['geometry']?.['location'], r['location'], r['position'], r['latlng'], r];\n for (const c of candidates) {\n if (!c || typeof c !== 'object') continue;\n const lat = num(c['lat'] ?? c['latitude']);\n const lng = num(c['lng'] ?? c['lon'] ?? c['long'] ?? c['longitude']);\n if (lat !== undefined && lng !== undefined && Math.abs(lat) <= 90 && Math.abs(lng) <= 180) return { lat, lng };\n }\n return undefined;\n}\n\n/**\n * A link a place's data gives — absolute `http(s)` only. A bare domain (\"trattoria.fr\") is read\n * as `https://` where asked. A path (`/img/a.jpg`) is refused, as the kit's `webUrl` refuses it:\n * it comes from a tool, and a photo's address is fetched on render, with the app's cookies.\n */\nfunction webUrl(value: unknown, guessScheme = false): string | undefined {\n let s = str(value);\n if (!s) return undefined;\n if (s.startsWith('//')) {\n s = `https:${s}`;\n } else if (!/^https?:\\/\\//i.test(s)) {\n // Not a link — Google's photo names (\"places/…/photos/…\") are not addresses a browser\n // can load, and a path on this site is not the tool's to ask for.\n if (!guessScheme || !/^[\\w-]+(\\.[\\w-]+)+(\\/|$)/.test(s)) return undefined;\n s = `https://${s}`;\n }\n const url = safeUrl(s);\n return url && /^https?:/i.test(url) ? url : undefined;\n}\n\nfunction textOf(value: unknown): string | undefined {\n if (value && typeof value === 'object') {\n const o = value as Record<string, unknown>;\n return str(o['text'] ?? o['title'] ?? o['name'] ?? o['url']);\n }\n return str(value);\n}\n\n/** A link given as a string or as `{ url | src | href | uri }`. */\nfunction linkOf(value: unknown): string | undefined {\n if (value && typeof value === 'object') {\n const o = value as Record<string, unknown>;\n return str(o['url'] ?? o['src'] ?? o['href'] ?? o['uri']);\n }\n return str(value);\n}\n\nfunction firstOf(value: unknown): unknown {\n return Array.isArray(value) ? value[0] : value;\n}\n\nfunction readPlace(raw: unknown): Place | null {\n if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return null;\n const r = raw as Loose;\n const name = textOf(r['name'] ?? r['displayName'] ?? r['title']);\n if (!name) return null;\n const category = textOf(r['category'] ?? r['primaryTypeDisplayName'] ?? firstOf(r['categories']));\n const types = Array.isArray(r['types']) ? r['types'] : [];\n let ratingValue = num(r['rating'] ?? r['stars']);\n if (ratingValue !== undefined && ratingValue > 5 && ratingValue <= 10) ratingValue /= 2;\n if (ratingValue !== undefined && (ratingValue < 0 || ratingValue > 5)) ratingValue = undefined;\n const reviewCount = num(r['reviewCount'] ?? r['review_count'] ?? r['user_ratings_total'] ?? r['userRatingCount'] ?? r['ratingCount'] ?? r['rating_count'] ?? r['reviews']);\n const rawDistance = r['distance'] ?? r['distanceMeters'] ?? r['distance_meters'] ?? r['distance_m'];\n const distance = num(rawDistance);\n // Google's current hours first: the next seven days, holidays included, where the regular\n // week would call a closed bank holiday open. The first source with a week gives the week;\n // the first with an answer gives \"open now\" (Yelp's sits on its first `hours` entry).\n const hourSources: Loose[] = [r['hours'], r['currentOpeningHours'], r['current_opening_hours'], r['regularOpeningHours'], r['opening_hours'], r['openingHours']]\n .filter((h) => h && typeof h === 'object');\n let hours: PlaceHoursRange[] = [];\n for (const source of hourSources) {\n hours = readHours(source);\n if (hours.length) break;\n }\n const openSource = r['openNow'] ?? r['open_now'] ?? r['isOpen'] ?? r['is_open'] ?? r['is_open_now']\n ?? hourSources.map((h) => (Array.isArray(h) ? h[0] : h) as Loose | undefined)\n .map((h) => h?.['openNow'] ?? h?.['open_now'] ?? h?.['is_open_now'])\n .find((v) => typeof v === 'boolean');\n const tags = (Array.isArray(r['tags']) ? r['tags'] : Array.isArray(r['features']) ? r['features'] : Array.isArray(r['amenities']) ? r['amenities'] : [])\n .map(textOf)\n .filter((t: string | undefined): t is string => !!t && t.length <= 32)\n .slice(0, MAX_TAGS);\n const utcOffset = num(r['utcOffset'] ?? r['utc_offset_minutes'] ?? r['utcOffsetMinutes'] ?? r['utc_offset']);\n return {\n name,\n category,\n kind: readKind([category, r['primaryType'], ...types]),\n image: webUrl(linkOf(r['image'] ?? r['photo'] ?? r['imageUrl'] ?? r['image_url'] ?? r['photoUrl'] ?? r['thumbnail'] ?? r['picture'] ?? firstOf(r['photos']))),\n rating: ratingValue,\n reviewCount: reviewCount !== undefined && reviewCount >= 0 ? Math.round(reviewCount) : undefined,\n ...readPrice(r['priceLevel'] ?? r['price_level'] ?? r['price']),\n address: str(r['address'] ?? r['formatted_address'] ?? r['formattedAddress'] ?? r['shortFormattedAddress'] ?? r['vicinity'] ?? (typeof r['location'] === 'string' ? r['location'] : undefined))\n // Yelp's address is lines to stack: on one line, they are joined.\n ?? (Array.isArray(r['location']?.['display_address']) ? str(r['location']['display_address'].map(str).filter(Boolean).join(', ')) : undefined),\n distance: distance !== undefined && distance >= 0 ? distance : undefined,\n distanceText: distance === undefined && typeof rawDistance === 'string' ? str(rawDistance) : undefined,\n phone: str(r['phone'] ?? r['phoneNumber'] ?? r['phone_number'] ?? r['formatted_phone_number'] ?? r['nationalPhoneNumber'] ?? r['international_phone_number'] ?? r['internationalPhoneNumber'] ?? r['tel']),\n website: webUrl(r['website'] ?? r['websiteUri'] ?? r['websiteUrl'] ?? r['site'], true),\n url: webUrl(r['url'] ?? r['googleMapsUri'] ?? r['mapsUrl'] ?? r['maps_url'] ?? r['link']),\n coordinates: readCoordinates(r),\n placeId: str(r['placeId'] ?? r['place_id'] ?? r['googlePlaceId']),\n openNow: typeof openSource === 'boolean' ? openSource : undefined,\n hours,\n utcOffset: utcOffset !== undefined && Math.abs(utcOffset) <= 14 * 60 ? utcOffset : undefined,\n tags,\n };\n}\n\n/**\n * The card's data from what `map` returns: one place, an array of places, or a collection\n * (`{ title?, places | results | candidates }`). At most ten places; `null` when not one\n * has a name.\n */\nexport function readPlaces(raw: unknown): PlaceData | null {\n if (!raw || typeof raw !== 'object') return null;\n let title: string | undefined;\n let list: unknown[];\n if (Array.isArray(raw)) {\n list = raw;\n } else {\n const r = raw as Record<string, unknown>;\n const nested = r['places'] ?? r['results'] ?? r['candidates'];\n if (Array.isArray(nested)) {\n list = nested;\n title = str(r['title']);\n } else {\n list = [raw];\n }\n }\n const places = list.map(readPlace).filter((p): p is Place => p !== null).slice(0, MAX_PLACES);\n return places.length ? { ...(title ? { title } : {}), places } : null;\n}\n\n/**\n * Google Maps directions to the place: to its coordinates when known, else to its name and\n * address, landing on the place itself when its Google id is known. `null` without either.\n */\nexport function directionsUrl(place: Pick<Place, 'name' | 'address' | 'coordinates' | 'placeId'>): string | null {\n const destination = place.coordinates\n ? `${place.coordinates.lat},${place.coordinates.lng}`\n : place.address ? `${place.name}, ${place.address}` : null;\n if (!destination) return null;\n const id = place.placeId ? `&destination_place_id=${encodeURIComponent(place.placeId)}` : ''; // safe-attr: a URL query parameter, encodeURIComponent-ed, not markup\n return `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(destination)}${id}`; // safe-attr: a URL query parameter, encodeURIComponent-ed, not markup\n}\n\n/**\n * A `tel:` link from a written number — its digits, and the `+` before the first of them\n * (\"Tel: +33 …\" keeps it). An extension (\"ext. 12\", \"x12\", \"#3\") is not part of the number:\n * dialled as digits, it would make a different one. `null` for no number.\n */\nexport function phoneUrl(phone: string | undefined): string | null {\n if (!phone) return null;\n const number = phone.replace(/\\s*(?:\\b(?:ext(?:ension)?\\.?|x)\\s*\\d|#).*$/i, '');\n const digits = number.replace(/\\D/g, '');\n const plus = /^[^\\d]*\\+/.test(number) ? '+' : '';\n return /\\d{3,}/.test(digits) ? safeUrl(`tel:${plus}${digits}`) : null;\n}\n\n// ── Drawing ──────────────────────────────────────────────────────────────────\n\ninterface Settings {\n builtIns: boolean;\n currencySymbol: string;\n now: () => Date;\n map?: { tiles: string; attribution?: string; zoom: number };\n}\n\ntype Tone = 'open' | 'soon' | 'closed';\n\n/** What the status line says, worked out once at render, so a language switch re-words it without re-reading the clock. */\ninterface StatusView {\n tone: Tone;\n state: keyof typeof P;\n next?: (config: AparteConfig) => string;\n}\n\n/**\n * A time of day as the language writes it on a shop door: \"10 PM\" where the clock has\n * twelve hours, \"22:00\" where it has twenty-four — `formatHour` would write a bare \"22\",\n * which reads as a number, not a time.\n */\nfunction clock(config: AparteConfig, date: Date): string {\n const tag = intlTag(config);\n const twelve = /h1[12]/.test(new Intl.DateTimeFormat(tag, { hour: 'numeric' }).resolvedOptions().hourCycle ?? '');\n return twelve\n ? new Intl.DateTimeFormat(tag, { hour: 'numeric', minute: date.getMinutes() ? '2-digit' : undefined }).format(date)\n : new Intl.DateTimeFormat(tag, { hour: '2-digit', minute: '2-digit' }).format(date);\n}\nconst weekday = (config: AparteConfig, date: Date) => new Intl.DateTimeFormat(intlTag(config), { weekday: 'long' }).format(date);\nconst startOfDay = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();\nconst daysBetween = (from: Date, to: Date) => Math.round((startOfDay(to) - startOfDay(from)) / 86_400_000);\n\nfunction statusView(place: Place, now: Date): StatusView | null {\n const local = placeTime(place, now);\n const status = place.hours.length ? placeStatus(place.hours, local) : null;\n if (!status) {\n if (place.openNow === undefined) return null;\n return { tone: place.openNow ? 'open' : 'closed', state: place.openNow ? 'cardsPlaceOpen' : 'cardsPlaceClosed' };\n }\n const at = status.changesAt;\n if (status.open) {\n if (!at) return { tone: 'open', state: 'cardsPlaceAlwaysOpen' };\n const minutes = (at.getTime() - local.getTime()) / 60_000;\n if (minutes < SOON) return { tone: 'soon', state: 'cardsPlaceClosesSoon', next: (c) => clock(c, at) };\n return {\n tone: 'open',\n state: 'cardsPlaceOpen',\n // Past midnight is still \"closes at 02:00\"; only a close more than a day away names its day.\n next: minutes <= DAY\n ? (c) => word(c, 'cardsPlaceClosesAt', P.cardsPlaceClosesAt, { t: clock(c, at) })\n : (c) => word(c, 'cardsPlaceClosesOn', P.cardsPlaceClosesOn, { day: weekday(c, at), t: clock(c, at) }),\n };\n }\n if (!at) return { tone: 'closed', state: 'cardsPlaceClosed' };\n const days = daysBetween(local, at);\n return {\n tone: 'closed',\n state: 'cardsPlaceClosed',\n next: days === 0\n ? (c) => word(c, 'cardsPlaceOpensAt', P.cardsPlaceOpensAt, { t: clock(c, at) })\n : days === 1\n ? (c) => word(c, 'cardsPlaceOpensTomorrow', P.cardsPlaceOpensTomorrow, { t: clock(c, at) })\n : (c) => word(c, 'cardsPlaceOpensOn', P.cardsPlaceOpensOn, { day: weekday(c, at), t: clock(c, at) }),\n };\n}\n\nfunction distanceText(config: AparteConfig, metres: number): string {\n if (metres < 1000) return formatUnit(config, metres < 100 ? Math.round(metres) : Math.round(metres / 10) * 10, 'meter');\n const km = metres / 1000;\n return formatUnit(config, km, 'kilometer', km < 10 ? 1 : 0);\n}\n\n/** The middle dot between two facts on a line — drawn, not read. */\nconst dot = () => el('span', { class: 'aparte-place__dot', attrs: { 'aria-hidden': 'true' }, text: '·' });\n\nfunction joined(className: string, parts: Array<Node | null>, tag: 'div' | 'p' = 'div'): HTMLElement | null {\n const present = parts.filter((p): p is Node => p !== null);\n if (!present.length) return null;\n const line = el(tag, { class: className });\n present.forEach((part, i) => {\n if (i) line.append(dot());\n line.append(part);\n });\n return line;\n}\n\nfunction nameOf(place: Place, className = 'aparte-place__name'): HTMLElement {\n const name = el('div', { class: className });\n if (place.url) {\n name.append(el('a', { class: 'aparte-place__link', attrs: { href: place.url, target: '_blank', rel: 'noopener noreferrer' }, text: place.name }));\n } else {\n name.textContent = place.name;\n }\n return name;\n}\n\n/** The category as the tool wrote it, else the kind's name in the chat's language, else nothing. */\nfunction categoryOf(ctx: CardContext, place: Place): HTMLElement | null {\n if (place.category) return el('span', { class: 'aparte-place__category', text: place.category });\n if (place.kind === 'place') return null;\n const node = el('span', { class: 'aparte-place__category' });\n ctx.word(node, `cardsPlace_${place.kind}`, KIND_WORDS[place.kind]);\n return node;\n}\n\nfunction priceOf(ctx: CardContext, place: Place, settings: Settings): HTMLElement | null {\n if (place.priceText) return el('span', { class: 'aparte-place__price', text: place.priceText });\n if (!place.price) return null;\n const { level } = place.price;\n const sign = place.price.symbol ?? settings.currencySymbol;\n // The tier in full ink, the rest of the scale faint: \"€€\" reads as two of four.\n const node = el('span', { class: 'aparte-place__price', attrs: { role: 'img' } },\n el('span', { class: 'aparte-place__price-on', attrs: { 'aria-hidden': 'true' }, text: sign.repeat(level) }),\n level < PRICE_MAX ? el('span', { class: 'aparte-place__price-off', attrs: { 'aria-hidden': 'true' }, text: sign.repeat(PRICE_MAX - level) }) : null);\n ctx.bind(node, () => word(ctx.config, 'cardsPlacePrice', P.cardsPlacePrice, {\n level: formatNumber(ctx.config, level), max: formatNumber(ctx.config, PRICE_MAX),\n }), 'aria-label');\n return node;\n}\n\nfunction scoreOf(ctx: CardContext, place: Place, settings: Settings): HTMLElement | null {\n return joined('aparte-place__score', [rating(ctx, place.rating, { count: place.reviewCount }), priceOf(ctx, place, settings)]);\n}\n\nfunction distanceOf(ctx: CardContext, place: Place): HTMLElement | null {\n if (place.distance !== undefined) {\n const node = el('span', { class: 'aparte-place__distance' });\n ctx.bind(node, () => distanceText(ctx.config, place.distance!));\n return node;\n }\n return place.distanceText ? el('span', { class: 'aparte-place__distance', text: place.distanceText }) : null;\n}\n\n/** \"● Open · Closes at 22:00\" — the state is a word, so it does not rest on its colour. */\nfunction statusOf(ctx: CardContext, place: Place, now: Date): HTMLElement | null {\n const view = statusView(place, now);\n if (!view) return null;\n const line = el('p', { class: 'aparte-place__status', attrs: { 'data-status': view.tone } });\n const state = el('span', { class: 'aparte-place__state' });\n ctx.word(state, view.state, P[view.state]);\n line.append(el('span', { class: 'aparte-place__status-dot', attrs: { 'aria-hidden': 'true' } }), state);\n if (view.next) {\n const next = el('span', { class: 'aparte-place__next' });\n ctx.bind(next, () => view.next!(ctx.config));\n line.append(dot(), next);\n }\n return line;\n}\n\nfunction addressOf(ctx: CardContext, place: Place): HTMLElement | null {\n const distance = distanceOf(ctx, place);\n const address = place.address ? el('span', { class: 'aparte-place__address-text', text: place.address }) : null;\n const line = joined('aparte-place__address', [distance, address], 'p');\n if (line) line.prepend(glyph(PIN, 'aparte-rich-card__glyph aparte-place__line-glyph'));\n return line;\n}\n\n/**\n * The photo in a fixed box, over a placeholder that stays behind it: a soft map with the\n * kind's marker for a wide box, the kind's glyph for a thumbnail. A photo that fails to load\n * is removed, and the placeholder is what shows.\n */\nfunction mediaOf(ctx: CardContext, place: Place, size: 'wide' | 'thumb', settings?: Settings): HTMLElement {\n const box = el('div', { class: `aparte-place__media aparte-place__media--${size}` });\n const mark = glyph(kindGlyph(place.kind), 'aparte-rich-card__glyph aparte-place__marker-glyph');\n box.append(el('span', { class: 'aparte-place__placeholder', attrs: { 'aria-hidden': 'true' } },\n el('span', { class: 'aparte-place__marker' }, mark)));\n // Asked first: a photo the image policy holds leaves the box as it is without one, map included.\n const img = place.image ? ctx.image(place.image, { class: 'aparte-place__img', attrs: { loading: 'lazy', decoding: 'async' } }) : null;\n // The app's tiles, when it gave some: under the marker, for a place with coordinates and no photo.\n const map = size === 'wide' && !img && place.coordinates && settings?.map ? mapOf(place.coordinates, settings.map) : null;\n if (map) {\n box.setAttribute('data-map', '');\n box.prepend(map.layer);\n if (map.credit) box.append(map.credit);\n // One tile missing would leave a hole in the street: the drawn map comes back whole.\n for (const tile of map.layer.querySelectorAll('img')) {\n tile.addEventListener('error', () => {\n map.layer.remove();\n map.credit?.remove();\n box.removeAttribute('data-map');\n }, { once: true });\n }\n }\n if (img) {\n ctx.bind(img, () => word(ctx.config, 'cardsPlacePhoto', P.cardsPlacePhoto, { name: place.name }), 'alt');\n img.addEventListener('error', () => {\n img.remove();\n box.setAttribute('data-empty', '');\n }, { once: true });\n box.append(img);\n } else {\n box.setAttribute('data-empty', '');\n }\n return box;\n}\n\nconst TILE = 256;\n\n/**\n * Nine tiles around a point, placed so the point sits under the marker's tip. Web\n * Mercator, as every tile server cuts its tiles: the point's position in tiles at `zoom`,\n * the tile it falls in, and where in that tile. Laid out in physical pixels — a map is\n * not text, and a right-to-left page does not mirror it.\n */\nfunction mapOf(at: { lat: number; lng: number }, map: NonNullable<Settings['map']>): { layer: HTMLElement; credit: HTMLElement | null } | null {\n const lat = Math.max(-85.05, Math.min(85.05, at.lat)) * Math.PI / 180;\n const n = 2 ** map.zoom;\n const fx = ((at.lng + 180) / 360) * n;\n const fy = ((1 - Math.log(Math.tan(lat) + 1 / Math.cos(lat)) / Math.PI) / 2) * n;\n if (!Number.isFinite(fx) || !Number.isFinite(fy)) return null;\n const tx = Math.floor(fx);\n const ty = Math.floor(fy);\n const layer = el('span', { class: 'aparte-place__map', attrs: { 'aria-hidden': 'true' } });\n layer.style.setProperty('--aparte-place-map-x', `${Math.round(TILE + (fx - tx) * TILE)}px`);\n layer.style.setProperty('--aparte-place-map-y', `${Math.round(TILE + (fy - ty) * TILE)}px`);\n for (let row = -1; row <= 1; row++) {\n for (let col = -1; col <= 1; col++) {\n const y = ty + row;\n const x = (((tx + col) % n) + n) % n; // the world wraps east and west, not north and south\n const tile = el('img', { class: 'aparte-place__tile', attrs: { alt: '', draggable: 'false', loading: 'lazy', decoding: 'async' } });\n if (y >= 0 && y < n) tile.setAttribute('src', map.tiles.replace('{z}', String(map.zoom)).replace('{x}', String(x)).replace('{y}', String(y)));\n else tile.style.visibility = 'hidden';\n layer.append(tile);\n }\n }\n const credit = map.attribution ? el('span', { class: 'aparte-place__credit', text: map.attribution }) : null;\n return { layer, credit };\n}\n\ntype ActionKind = 'directions' | 'call' | 'website';\nconst ACTION_WORD: Record<ActionKind, 'cardsPlaceDirections' | 'cardsPlaceCall' | 'cardsPlaceWebsite'> = {\n directions: 'cardsPlaceDirections', call: 'cardsPlaceCall', website: 'cardsPlaceWebsite',\n};\nconst ACTION_GLYPH: Record<ActionKind, string> = { directions: DIRECTIONS, call: PHONE, website: GLOBE };\n\n/**\n * The buttons a place's own data can honour — none it cannot. Labelled on a card on its own;\n * round and icon-only on a tile in a row, where three words do not fit (the word is then the\n * button's name and its tooltip).\n */\nfunction actionsOf(ctx: CardContext, place: Place, settings: Settings, iconOnly: boolean): HTMLElement | null {\n if (!settings.builtIns) return null;\n const urls: Array<[ActionKind, string | null | undefined]> = [\n ['directions', directionsUrl(place)],\n ['call', phoneUrl(place.phone)],\n ['website', place.website ?? place.url],\n ];\n const buttons: HTMLButtonElement[] = [];\n for (const [kind, url] of urls) {\n if (!url) continue;\n const label = () => word(ctx.config, ACTION_WORD[kind], P[ACTION_WORD[kind]]);\n const primary = kind === 'directions' && !iconOnly;\n const button = ctx.action({ id: kind, label: label(), url, primary }, place,\n `aparte-place__action${iconOnly ? ' aparte-btn--icon aparte-btn--circle' : ''}`)!;\n // The kit writes the label as plain text; the place's buttons carry a glyph, and a\n // word that follows the language.\n button.textContent = '';\n button.setAttribute('data-action', kind);\n button.append(glyph(ACTION_GLYPH[kind], 'aparte-rich-card__glyph aparte-btn__icon'));\n if (iconOnly) {\n ctx.bind(button, label, 'aria-label');\n ctx.bind(button, label, 'title');\n } else {\n const text = el('span');\n ctx.bind(text, label);\n button.append(text);\n }\n buttons.push(button);\n }\n return buttons.length ? el('div', { class: 'aparte-place__actions' }, ...buttons) : null;\n}\n\n/** A place as a tile: photo, name, rating, open status, address, buttons. */\nfunction tileOf(ctx: CardContext, place: Place, settings: Settings, now: Date, inRow: boolean): HTMLElement {\n const media = mediaOf(ctx, place, 'wide', settings);\n const category = categoryOf(ctx, place);\n if (category) {\n media.append(el('span', { class: 'aparte-place__badge' },\n glyph(kindGlyph(place.kind), 'aparte-rich-card__glyph aparte-place__badge-glyph'), category));\n }\n const body = el('div', { class: 'aparte-place__body' }, nameOf(place), scoreOf(ctx, place, settings), statusOf(ctx, place, now), addressOf(ctx, place));\n const actions = actionsOf(ctx, place, settings, inRow);\n if (actions) body.append(actions);\n return el('article', { class: `aparte-place${inRow ? ' aparte-place--tile' : ''}`, attrs: { 'data-kind': place.kind } }, media, body);\n}\n\n/** A place as one row: thumbnail, name and distance, rating, open status. */\nfunction rowOf(ctx: CardContext, place: Place, settings: Settings, now: Date, tag: 'div' | 'li'): HTMLElement {\n const head = el('div', { class: 'aparte-place__row-head' }, nameOf(place), distanceOf(ctx, place));\n const facts = joined('aparte-place__score', [\n rating(ctx, place.rating, { count: place.reviewCount }),\n priceOf(ctx, place, settings),\n categoryOf(ctx, place),\n ]);\n const text = el('div', { class: 'aparte-place__text' }, head, facts, statusOf(ctx, place, now));\n return el(tag, { class: 'aparte-place aparte-place__row', attrs: { 'data-kind': place.kind } }, mediaOf(ctx, place, 'thumb'), text);\n}\n\nfunction rangeText(config: AparteConfig, range: PlaceHoursRange): string {\n if (range.start === 0 && range.end >= DAY) return word(config, 'cardsPlaceAlwaysOpen', P.cardsPlaceAlwaysOpen);\n const at = (minute: number) => clock(config, new Date(2000, 0, 1, Math.floor(minute / 60) % 24, minute % 60));\n return `${at(range.start)}–${at(range.end)}`;\n}\n\n/** The week, from today, today marked: a table, so each day is read with its hours. */\nfunction hoursOf(ctx: CardContext, place: Place, now: Date): HTMLElement | null {\n if (!place.hours.length) return null;\n const local = placeTime(place, now);\n const caption = el('caption', { class: 'aparte-place__hours-title' });\n const title = el('span');\n ctx.word(title, 'cardsPlaceHours', P.cardsPlaceHours);\n caption.append(glyph(CLOCK, 'aparte-rich-card__glyph aparte-place__line-glyph'), title);\n const body = el('tbody');\n for (let i = 0; i < 7; i++) {\n const date = new Date(local.getFullYear(), local.getMonth(), local.getDate() + i, 12);\n const ranges = place.hours.filter((r) => r.day === date.getDay());\n const day = el('th', { attrs: { scope: 'row' } });\n ctx.bind(day, () => weekday(ctx.config, date));\n const hours = el('td');\n ctx.bind(hours, () => (ranges.length\n ? ranges.map((r) => rangeText(ctx.config, r)).join(', ')\n : word(ctx.config, 'cardsPlaceClosed', P.cardsPlaceClosed)));\n body.append(el('tr', { attrs: { 'aria-current': i === 0 ? 'date' : undefined, 'data-closed': !ranges.length } }, day, hours));\n }\n return el('table', { class: 'aparte-place__hours' }, caption, body);\n}\n\n/** The place's ways in, one a line: where it is, its number, its site. */\nfunction infoOf(ctx: CardContext, place: Place): HTMLElement | null {\n const items: HTMLElement[] = [];\n const address = addressOf(ctx, place);\n if (address) items.push(el('li', {}, ...address.childNodes));\n const tel = phoneUrl(place.phone);\n if (place.phone) {\n items.push(el('li', {}, glyph(PHONE, 'aparte-rich-card__glyph aparte-place__line-glyph'),\n tel ? el('a', { class: 'aparte-place__link', attrs: { href: tel }, text: place.phone }) : place.phone));\n }\n if (place.website) {\n const host = new URL(place.website).hostname.replace(/^www\\./, '');\n items.push(el('li', {}, glyph(GLOBE, 'aparte-rich-card__glyph aparte-place__line-glyph'),\n el('a', { class: 'aparte-place__link', attrs: { href: place.website, target: '_blank', rel: 'noopener noreferrer' }, text: host })));\n }\n return items.length ? el('ul', { class: 'aparte-place__info' }, ...items) : null;\n}\n\nfunction tagsOf(place: Place): HTMLElement | null {\n if (!place.tags.length) return null;\n return el('ul', { class: 'aparte-place__tags' }, ...place.tags.map((t) =>\n el('li', { class: 'aparte-tag aparte-tag--sm aparte-place__tag' }, el('span', { class: 'aparte-tag__label', text: t }))));\n}\n\nfunction renderDetail(ctx: CardContext, place: Place, settings: Settings, now: Date): Node[] {\n const media = mediaOf(ctx, place, 'wide', settings);\n const category = categoryOf(ctx, place);\n if (category) {\n media.append(el('span', { class: 'aparte-place__badge' },\n glyph(kindGlyph(place.kind), 'aparte-rich-card__glyph aparte-place__badge-glyph'), category));\n }\n const head = el('div', { class: 'aparte-place__head' }, nameOf(place), scoreOf(ctx, place, settings), statusOf(ctx, place, now));\n const body = el('div', { class: 'aparte-place__body' }, head);\n for (const part of [actionsOf(ctx, place, settings, false), infoOf(ctx, place), hoursOf(ctx, place, now), tagsOf(place)]) {\n if (part) body.append(part);\n }\n return [el('article', { class: 'aparte-place aparte-place--detail', attrs: { 'data-kind': place.kind } }, media, body)];\n}\n\nfunction countLabel(ctx: CardContext, data: Partial<PlaceData>): string {\n return data.title ?? word(ctx.config, 'cardsPlaceCount', P.cardsPlaceCount, { n: formatNumber(ctx.config, data.places?.length ?? 0) });\n}\n\nfunction headingOf(ctx: CardContext, data: PlaceData): HTMLElement {\n const text = el('span', { class: 'aparte-place__heading-text' });\n ctx.bind(text, () => countLabel(ctx, data));\n return el('div', { class: 'aparte-place__heading' }, glyph(PIN, 'aparte-rich-card__glyph aparte-place__line-glyph'), text);\n}\n\nfunction render(data: PlaceData, ctx: CardContext<PlaceVariant>, settings: Settings): Node[] {\n const now = settings.now();\n const [first] = data.places as [Place];\n const many = data.places.length > 1;\n if (ctx.variant === 'compact') {\n if (!many) return [rowOf(ctx, first, settings, now, 'div')];\n const list = el('ul', { class: 'aparte-place__list' }, ...data.places.map((p) => rowOf(ctx, p, settings, now, 'li')));\n ctx.bind(list, () => countLabel(ctx, data), 'aria-label');\n return [headingOf(ctx, data), list];\n }\n if (many) {\n // `detail` is one place's page: several of them are tiles in a row, like `card`.\n const slides = data.places.map((p) => tileOf(ctx, p, settings, now, true));\n return [el('div', { class: 'aparte-place__collection' }, headingOf(ctx, data), carousel(ctx, slides, { label: () => countLabel(ctx, data) }))];\n }\n return ctx.variant === 'detail' ? renderDetail(ctx, first, settings, now) : [tileOf(ctx, first, settings, now, false)];\n}\n\nfunction skeleton(partial: Partial<PlaceData> | null, ctx: CardContext<PlaceVariant>): Node[] {\n const block = (cls: string, kind: 'text' | 'rect' = 'rect') =>\n el('span', { class: `aparte-skeleton aparte-skeleton--${kind} ${cls}`, attrs: { 'aria-hidden': 'true' } });\n const known = partial?.places?.[0]?.name ?? partial?.title;\n const name = known ? el('div', { class: 'aparte-place__name', text: known }) : block('aparte-place__sk-name', 'text');\n if (ctx.variant === 'compact') {\n return [el('div', { class: 'aparte-place aparte-place__row' }, block('aparte-place__media--thumb aparte-place__sk-thumb'),\n el('div', { class: 'aparte-place__text' }, name, block('aparte-place__sk-line', 'text')))];\n }\n const body = el('div', { class: 'aparte-place__body' }, name,\n block('aparte-place__sk-line', 'text'),\n block('aparte-place__sk-line aparte-place__sk-line--short', 'text'),\n el('div', { class: 'aparte-place__sk-actions' }, block('aparte-place__sk-btn'), block('aparte-place__sk-btn')));\n if (ctx.variant === 'detail') body.append(el('div', { class: 'aparte-place__sk-hours' }, ...Array.from({ length: 4 }, () => block('aparte-place__sk-line', 'text'))));\n return [el('article', { class: 'aparte-place' }, block('aparte-place__media--wide aparte-place__sk-media'), body)];\n}\n\nfunction label(data: Partial<PlaceData> | null, ctx: CardContext): string {\n const places = data?.places ?? [];\n if (places.length === 1) return places[0]!.name;\n if (places.length > 1 || data?.title) return countLabel(ctx, data!);\n return word(ctx.config, 'cardsPlaceTitle', P.cardsPlaceTitle);\n}\n\n/** One sentence a place: \"Name — 4.6/5 (1,284), 12 rue de la Paix\". */\nfunction fallback(data: PlaceData, ctx: CardContext): string {\n const lines = data.places.map((p) => {\n const score = p.rating !== undefined\n ? `${formatNumber(ctx.config, p.rating, { maximumFractionDigits: 1 })}/5${p.reviewCount !== undefined ? ` (${formatNumber(ctx.config, p.reviewCount)})` : ''}`\n : undefined;\n const rest = [score, p.address].filter(Boolean).join(', ');\n return rest ? `${p.name} — ${rest}` : p.name;\n });\n return data.title ? `${data.title}:\\n${lines.join('\\n')}` : lines.join('\\n');\n}\n\nfunction partial(input: Record<string, unknown>): Partial<PlaceData> | null {\n const name = str(input['name'] ?? input['place'] ?? input['placeName']);\n if (name) return { places: [readPlace({ name })!] };\n const query = str(input['query'] ?? input['q'] ?? input['keyword'] ?? input['search'] ?? input['textQuery']);\n return query ? { title: query } : null;\n}\n\nfunction createPlaceCard(settings: Settings) {\n return defineCard<PlaceData, PlaceVariant>({\n name: 'place',\n variants: ['card', 'compact', 'detail'],\n styles: placeStyles,\n icon: PIN,\n normalize: readPlaces,\n render: (data, ctx) => render(data, ctx, settings),\n skeleton,\n label,\n fallback,\n partial,\n });\n}\n\n/**\n * The place card with its built-in buttons and the device's clock — for `placeCard.segment(data)`.\n * Plug it in with `setupPlaceCard`, which also hears the card's own options.\n */\nexport const placeCard = createPlaceCard({ builtIns: true, currencySymbol: '$', now: () => new Date() });\n\n/**\n * Draw a tool's places as this card — returns the function that stops it. Each place keeps\n * its Directions / Call / Website buttons beside the app's own `actions` unless `builtIns`\n * is `false`.\n */\nexport function setupPlaceCard(options: PlaceCardOptions = {}): () => void {\n const { currencySymbol, now, builtIns, mapTiles, mapAttribution, mapZoom, ...rest } = options;\n const tiles = str(mapTiles);\n const card = createPlaceCard({\n builtIns: builtIns !== false,\n currencySymbol: str(currencySymbol) ?? '$',\n now: now ?? (() => new Date()),\n // Only an http(s) address with the three placeholders: anything else draws the card's own map.\n ...(tiles && /^https?:\\/\\//i.test(tiles) && ['{z}', '{x}', '{y}'].every((p) => tiles.includes(p))\n ? { map: { tiles, attribution: str(mapAttribution), zoom: Math.round(Math.min(19, Math.max(1, num(mapZoom) ?? 16))) } }\n : {}),\n });\n return card.setup(rest);\n}\n"],
|
|
5
5
|
"mappings": "+O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AAM,KAAK,MAAM,KAAK,IAAI,GAAI,KAAK,IAAI,EAAG7N,EAAI8N,CAAO,GAAK,EAAE,CAAC,CAAC,CAAA,CAAA,EAChH,CAAA,CAAC,CACV,EACW,MAAMZ,CAAI,CAC1B",
|
|
6
6
|
"names": ["svg", "body", "PIN", "PHONE", "GLOBE", "DIRECTIONS", "CLOCK", "KIND_GLYPHS", "kindGlyph", "kind", "placeStyles", "P", "KIND_WORDS", "MAX_PLACES", "MAX_TAGS", "PRICE_MAX", "SOON", "DAY", "WEEK", "DAY_NAMES", "readDay", "value", "n", "num", "i", "readTime", "o", "h", "m", "s", "str", "match", "half", "rangesOfText", "day", "parts", "out", "part", "from", "to", "end", "start", "sharedMeridiem", "splitLong", "range", "at", "stop", "midnight", "readHours", "raw", "key", "tidy", "yelp", "item", "yelpRanges", "line", "r", "c", "cDay", "cTime", "close", "entries", "regular", "e", "entry", "hhmm", "v", "ranges", "a", "b", "spans", "list", "shift", "merged", "span", "last", "placeStatus", "hours", "date", "t", "minute", "inside", "next", "isOpenAt", "placeTime", "place", "now", "KIND_RULES", "readKind", "candidates", "candidate", "text", "rule", "PRICE_WORDS", "readPrice", "repeated", "named", "readCoordinates", "lat", "lng", "webUrl", "guessScheme", "url", "safeUrl", "textOf", "linkOf", "firstOf", "readPlace", "name", "category", "types", "ratingValue", "reviewCount", "rawDistance", "distance", "hourSources", "source", "openSource", "tags", "utcOffset", "readPlaces", "title", "nested", "places", "p", "directionsUrl", "destination", "id", "phoneUrl", "phone", "number", "digits", "plus", "clock", "config", "tag", "intlTag", "weekday", "startOfDay", "d", "daysBetween", "statusView", "local", "status", "minutes", "word", "days", "distanceText", "metres", "formatUnit", "km", "dot", "el", "joined", "className", "present", "nameOf", "categoryOf", "ctx", "node", "priceOf", "settings", "level", "sign", "formatNumber", "scoreOf", "rating", "distanceOf", "statusOf", "view", "state", "addressOf", "address", "glyph", "mediaOf", "size", "box", "mark", "img", "map", "mapOf", "tile", "TILE", "fx", "fy", "tx", "ty", "layer", "row", "col", "y", "x", "credit", "ACTION_WORD", "ACTION_GLYPH", "actionsOf", "iconOnly", "urls", "buttons", "label", "primary", "button", "tileOf", "inRow", "media", "actions", "rowOf", "head", "facts", "rangeText", "hoursOf", "caption", "infoOf", "items", "tel", "host", "tagsOf", "renderDetail", "countLabel", "data", "headingOf", "render", "first", "many", "slides", "carousel", "skeleton", "partial", "block", "cls", "known", "fallback", "lines", "rest", "input", "query", "createPlaceCard", "defineCard", "placeCard", "setupPlaceCard", "options", "currencySymbol", "builtIns", "mapTiles", "mapAttribution", "mapZoom", "tiles"]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as i,b as x,e as S,f as h,h as A,i as j,o as $,p as z,q as L,u as K}from"./chunk-
|
|
1
|
+
import{a as i,b as x,e as S,f as h,h as A,i as j,o as $,p as z,q as L,u as K}from"./chunk-PPDOW5CO.js";import"./chunk-4MZPEZPE.js";import"./chunk-XAWE4EAK.js";var m=(a,t)=>`<svg${t?` class="${t}"`:""} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">${a}</svg>`,na=m('<circle cx="12" cy="12" r="8"/>'),ra=m('<circle cx="12" cy="12" r="8" opacity="0.4"/><path d="M12 4a8 8 0 0 1 8 8"/>',"aparte-plan__spinner"),sa=m('<circle cx="12" cy="12" r="9" fill="currentColor" stroke="none"/><path class="aparte-plan__mark" d="M8.2 12.4l2.6 2.6 5-5.4"/>'),ia=m('<circle cx="12" cy="12" r="9" fill="currentColor" stroke="none"/><path class="aparte-plan__mark" d="M9.3 9.3l5.4 5.4M14.7 9.3l-5.4 5.4"/>'),pa=m('<circle cx="12" cy="12" r="8" stroke-dasharray="2.4 2.6"/><path d="M8.6 12h6.8"/>'),la=m('<rect x="6" y="10.6" width="12" height="9" rx="2.2"/><path d="M8.9 10.6V8.2a3.1 3.1 0 0 1 6.2 0v2.4"/>'),U={pending:na,"in-progress":ra,done:sa,failed:ia,skipped:pa,blocked:la},oa=m('<circle cx="12" cy="12" r="8"/><circle cx="12" cy="12" r="4" fill="currentColor" stroke="none"/>'),da=m('<circle cx="12" cy="12" r="8.2"/><path d="M12 7.6V12l2.9 1.9"/>'),ca=m('<rect x="5" y="4.5" width="14" height="16.5" rx="2.2"/><path d="M9.2 4.5V3.8a1 1 0 0 1 1-1h3.6a1 1 0 0 1 1 1v.7"/><path d="M8.4 10.6l1.4 1.4 2.4-2.6"/><path d="M14.2 10.6h1.8"/><path d="M8.4 16.1l1.4 1.4 2.4-2.6"/><path d="M14.2 16.1h1.8"/>'),ua=`/* =========================================
|
|
2
2
|
The plan card \u2014 @aparte/plugin-cards/plan
|
|
3
3
|
=========================================
|
|
4
4
|
Three variants of one card, chosen by \`data-variant\` on its root:
|
|
@@ -539,4 +539,4 @@ import{a as i,b as x,e as S,f as h,h as A,i as j,o as $,p as z,q as L,u as K}fro
|
|
|
539
539
|
}
|
|
540
540
|
`,R={cardsPlanTitle:{en:"Plan",fr:"Plan",de:"Plan",es:"Plan",it:"Piano",ja:"\u8A08\u753B",ko:"\uACC4\uD68D",pt:"Plano",ru:"\u041F\u043B\u0430\u043D",zh:"\u8BA1\u5212"},cardsPlanProgress:{en:"{done} of {total} done",fr:"{done} sur {total} termin\xE9es",de:"{done} von {total} erledigt",es:"{done} de {total} completados",it:"{done} di {total} completati",ja:"{total}\u4EF6\u4E2D{done}\u4EF6\u5B8C\u4E86",ko:"{total}\uAC1C \uC911 {done}\uAC1C \uC644\uB8CC",pt:"{done} de {total} conclu\xEDdos",ru:"\u0412\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u043E {done} \u0438\u0437 {total}",zh:"\u5DF2\u5B8C\u6210 {done}/{total}"},cardsPlanSkipped:{en:"{n} skipped",fr:"Ignor\xE9es : {n}",de:"\xDCbersprungen: {n}",es:"Omitidos: {n}",it:"Saltati: {n}",ja:"\u30B9\u30AD\u30C3\u30D7 {n}\u4EF6",ko:"\uAC74\uB108\uB700 {n}\uAC1C",pt:"Ignorados: {n}",ru:"\u041F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u043E: {n}",zh:"\u5DF2\u8DF3\u8FC7 {n} \u9879"},cardsPlanFailed:{en:"{n} failed",fr:"\xC9checs : {n}",de:"Fehlgeschlagen: {n}",es:"Fallidos: {n}",it:"Falliti: {n}",ja:"\u5931\u6557 {n}\u4EF6",ko:"\uC2E4\uD328 {n}\uAC1C",pt:"Falhas: {n}",ru:"\u041E\u0448\u0438\u0431\u043E\u043A: {n}",zh:"\u5931\u8D25 {n} \u9879"},cardsPlanElapsed:{en:"{time} elapsed",fr:"Dur\xE9e : {time}",de:"Dauer: {time}",es:"Duraci\xF3n: {time}",it:"Durata: {time}",ja:"\u7D4C\u904E\u6642\u9593 {time}",ko:"\uACBD\uACFC {time}",pt:"Dura\xE7\xE3o: {time}",ru:"\u041F\u0440\u043E\u0448\u043B\u043E: {time}",zh:"\u7528\u65F6 {time}"},cardsPlanStepNow:{en:"Step {n} of {total}:",fr:"\xC9tape {n} sur {total} :",de:"Schritt {n} von {total}:",es:"Paso {n} de {total}:",it:"Passo {n} di {total}:",ja:"\u30B9\u30C6\u30C3\u30D7 {n}/{total}\uFF1A",ko:"{total}\uB2E8\uACC4 \uC911 {n}\uB2E8\uACC4:",pt:"Etapa {n} de {total}:",ru:"\u0428\u0430\u0433 {n} \u0438\u0437 {total}:",zh:"\u7B2C {n}/{total} \u6B65\uFF1A"},cardsPlanAllDone:{en:"All steps done",fr:"Toutes les \xE9tapes sont termin\xE9es",de:"Alle Schritte erledigt",es:"Todos los pasos completados",it:"Tutti i passi completati",ja:"\u3059\u3079\u3066\u306E\u30B9\u30C6\u30C3\u30D7\u304C\u5B8C\u4E86",ko:"\uBAA8\uB4E0 \uB2E8\uACC4 \uC644\uB8CC",pt:"Todas as etapas conclu\xEDdas",ru:"\u0412\u0441\u0435 \u0448\u0430\u0433\u0438 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u044B",zh:"\u6240\u6709\u6B65\u9AA4\u5DF2\u5B8C\u6210"},cardsPlanStatusPending:{en:"To do",fr:"\xC0 faire",de:"Offen",es:"Pendiente",it:"Da fare",ja:"\u672A\u7740\u624B",ko:"\uB300\uAE30",pt:"A fazer",ru:"\u041D\u0435 \u043D\u0430\u0447\u0430\u0442\u043E",zh:"\u5F85\u529E"},cardsPlanStatusInProgress:{en:"In progress",fr:"En cours",de:"In Arbeit",es:"En curso",it:"In corso",ja:"\u9032\u884C\u4E2D",ko:"\uC9C4\uD589 \uC911",pt:"Em andamento",ru:"\u0412\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F",zh:"\u8FDB\u884C\u4E2D"},cardsPlanStatusDone:{en:"Done",fr:"Termin\xE9",de:"Erledigt",es:"Hecho",it:"Fatto",ja:"\u5B8C\u4E86",ko:"\uC644\uB8CC",pt:"Conclu\xEDdo",ru:"\u0413\u043E\u0442\u043E\u0432\u043E",zh:"\u5DF2\u5B8C\u6210"},cardsPlanStatusFailed:{en:"Failed",fr:"\xC9chec",de:"Fehlgeschlagen",es:"Fallido",it:"Non riuscito",ja:"\u5931\u6557",ko:"\uC2E4\uD328",pt:"Falhou",ru:"\u041E\u0448\u0438\u0431\u043A\u0430",zh:"\u5931\u8D25"},cardsPlanStatusSkipped:{en:"Skipped",fr:"Ignor\xE9",de:"\xDCbersprungen",es:"Omitido",it:"Saltato",ja:"\u30B9\u30AD\u30C3\u30D7",ko:"\uAC74\uB108\uB700",pt:"Ignorado",ru:"\u041F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u043E",zh:"\u5DF2\u8DF3\u8FC7"},cardsPlanStatusBlocked:{en:"Blocked",fr:"Bloqu\xE9",de:"Blockiert",es:"Bloqueado",it:"Bloccato",ja:"\u30D6\u30ED\u30C3\u30AF\u4E2D",ko:"\uCC28\uB2E8\uB428",pt:"Bloqueado",ru:"\u0417\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u043D\u043E",zh:"\u53D7\u963B"},cardsPlanSummary:{en:"{done}/{total} done",fr:"{done}/{total} termin\xE9es",de:"{done}/{total} erledigt",es:"{done}/{total} completados",it:"{done}/{total} completati",ja:"{done}/{total} \u5B8C\u4E86",ko:"{done}/{total} \uC644\uB8CC",pt:"{done}/{total} conclu\xEDdos",ru:"\u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u043E {done}/{total}",zh:"\u5DF2\u5B8C\u6210 {done}/{total}"},cardsPlanNow:{en:"now: {step}",fr:"en cours : {step}",de:"jetzt: {step}",es:"ahora: {step}",it:"ora: {step}",ja:"\u5B9F\u884C\u4E2D\uFF1A{step}",ko:"\uD604\uC7AC: {step}",pt:"agora: {step}",ru:"\u0441\u0435\u0439\u0447\u0430\u0441: {step}",zh:"\u5F53\u524D\uFF1A{step}"}},g=(a,t,e)=>j(a,t,R[t],e),_a={pending:"cardsPlanStatusPending","in-progress":"cardsPlanStatusInProgress",done:"cardsPlanStatusDone",failed:"cardsPlanStatusFailed",skipped:"cardsPlanStatusSkipped",blocked:"cardsPlanStatusBlocked"},fa=50,T=a=>!!a&&typeof a=="object"&&!Array.isArray(a),b=a=>a!=null;function f(a,t){for(let e of t)if(a[e]!==void 0&&a[e]!==null&&a[e]!=="")return a[e]}var ha={pending:["pending","todo","to-do","open","queued","planned","not-started","notstarted","new","waiting","scheduled","upcoming","ready","idle","backlog"],"in-progress":["in-progress","inprogress","progress","doing","running","active","current","started","working","executing","ongoing","processing","in-flight"],done:["done","completed","complete","success","succeeded","successful","finished","ok","passed","resolved","closed","checked"],failed:["failed","fail","failure","error","errored","aborted","timeout","timed-out","crashed"],skipped:["skipped","skip","cancelled","canceled","omitted","not-needed","wont-do","won't-do","wontdo","obsolete","dropped"],blocked:["blocked","on-hold","onhold","paused","stuck","held","needs-input","needs-approval","awaiting-input","awaiting-approval"]},ma=new Map(Object.entries(ha).flatMap(([a,t])=>t.map(e=>[e,a])));function ga(a){if(typeof a=="boolean")return a?"done":"pending";if(typeof a=="string")return ma.get(a.trim().toLowerCase().replace(/[\s_]+/g,"-"))}var va=["status","state","stage","phase"],ka=["done","completed","complete","checked","finished","isDone","is_done","isCompleted","is_completed"],ba=["active","running","current","inProgress","in_progress"],ya=["title","content","name","label","text","task","step","action","description"],wa=["activeForm","active_form","activeTitle","active_title"],xa=["detail","details","description","note","notes","summary","result","output","observation","message","reason"],za=["startedAt","started_at","startTime","start_time","startDate","start_date","start","begin"],Sa=["finishedAt","finished_at","completedAt","completed_at","endedAt","ended_at","endTime","end_time","doneAt","done_at","end"],Aa=["duration","durationSeconds","duration_seconds","durationSec","elapsed","seconds","took"],Pa=["durationMs","duration_ms","elapsedMs","elapsed_ms","tookMs","took_ms"],Ta=["substeps","subSteps","sub_steps","subtasks","subTasks","children","steps","todos","items","checklist"],Ea=["steps","todos","tasks","items","checklist","stages","phases","subtasks","plan"],Ia=["past_steps","pastSteps","completed_steps","completedSteps"],Da=["title","name","heading"],Ma=["goal","objective","task","input","query","request","description","explanation","summary"],Fa=["updatedAt","updated_at","lastUpdated","last_updated","asOf","as_of","timestamp"];function Na(a){let t=ga(f(a,va));if(t)return t;if(a.failed===!0||a.error===!0||h(a.error))return"failed";if(a.skipped===!0||a.cancelled===!0||a.canceled===!0)return"skipped";if(a.blocked===!0)return"blocked";let e=ba.some(n=>a[n]===!0);for(let n of ka)if(typeof a[n]=="boolean")return a[n]?"done":e?"in-progress":"pending";return e?"in-progress":void 0}function Oa(a){let t=e=>a.some(n=>n.status===e);return a.every(e=>e.status==="done"||e.status==="skipped")?t("done")?"done":"skipped":t("in-progress")?"in-progress":t("failed")?"failed":t("done")||t("skipped")?"in-progress":t("blocked")?"blocked":"pending"}var ja=/^\s*(?:(?:[-*+•]|\d+[.)])\s+)?(?:\[([ xX✓✔>~!-])\]\s*)?/,$a=/^\s*(?:(?:[-*+•]|\d+[.)])\s+|\[[ xX✓✔>~!-]\])/,La={" ":"pending",x:"done",X:"done","\u2713":"done","\u2714":"done",">":"in-progress","!":"failed","-":"skipped","~":"blocked"};function Ka(a){let t=ja.exec(a),e=a.slice(t[0].length).trim();return e?{title:e,...t[1]!==void 0?{status:La[t[1]]}:{}}:null}function C(a){let t=a.split(/\r?\n/).filter(r=>r.trim()),e,n=[];for(let[r,s]of t.entries()){if(!$a.test(s)){if(r>0)return null;e=s.trim().replace(/^#{1,6}\s+/,"").replace(/:$/,"")||void 0;continue}let p=w(s,1);if(!p)continue;let l=n[n.length-1];/^(?:\t|\s{2,})/.test(s)&&l?(l.substeps??=[]).push(p):n.push(p)}return n.length?{...e?{title:e}:{},steps:n}:null}function w(a,t,e){if(typeof a=="string"||typeof a=="number"){let u=Ka(String(a));return u?{title:u.title,status:u.status??e??"pending"}:null}if(Array.isArray(a))return w(a[0],t,e);if(!T(a))return null;let n=a,r=ya.find(u=>typeof n[u]=="string"&&n[u].trim()),s=r?n[r].trim():void 0;if(!s)return null;let p=t===0?Ta.map(u=>n[u]).find(Array.isArray):void 0,l=p?p.map(u=>w(u,1)).filter(b):[],d=z(f(n,za))??void 0,c=z(f(n,Sa))??void 0,o=Na(n)??e??(l.length?Oa(l):c?"done":d?"in-progress":"pending"),_=h(f(n,wa)),v;_&&_!==s&&(o==="in-progress"?[s,v]=[_,s]:v=_);let ta=h(n.error),F=(o==="failed"?ta:void 0)??h(f(n,xa.filter(u=>u!==r))),ea=S(f(n,Aa)),N=S(f(n,Pa)),k=ea??(N!==void 0?N/1e3:void 0);k===void 0&&d&&c&&c>=d&&(k=(c.getTime()-d.getTime())/1e3),k!==void 0&&k<0&&(k=void 0);let O=h(f(n,["id","key","uuid"]));return{title:s,...v?{altTitle:v}:{},status:o,...F?{detail:F}:{},...d?{startedAt:d}:{},...c?{finishedAt:c}:{},...k!==void 0?{duration:k}:{},...l.length?{substeps:l}:{},...O?{id:O}:{}}}function P(a){let t=fa,e=[];for(let n of a){if(t<=0)break;if(t-=1,!n.substeps){e.push(n);continue}let r=n.substeps.slice(0,t);t-=r.length;let s={...n,substeps:r};r.length||delete s.substeps,e.push(s)}return e}function E(a){if(typeof a=="string"){let o=C(a);return o?{...o.title?{title:o.title}:{},steps:P(o.steps)}:null}if(Array.isArray(a)){let o=P(a.map(_=>w(_,0)).filter(b));return o.length?{steps:o}:null}if(!T(a))return null;let t=a,e=h(f(t,Da)),n=h(f(t,Ma)),r=z(f(t,Fa))??void 0,s={...e?{title:e}:{},...n?{goal:n}:{},...r?{updatedAt:r}:{},...t.timed===!0?{timed:!0}:{}};if(T(t.plan)){let o=E(t.plan);return o?{...s,...o}:null}let p=Ia.map(o=>t[o]).find(Array.isArray)??[],l=Ea.map(o=>t[o]).find(o=>Array.isArray(o)||typeof o=="string"),d=Array.isArray(l)?l.map(o=>w(o,0)).filter(b):typeof l=="string"?C(l)?.steps??[]:[],c=P([...p.map(o=>w(o,0,"done")).filter(b),...d]);return c.length?{...s,steps:c}:null}var I=a=>a.steps.flatMap(t=>[t,...t.substeps??[]]);function Ca(a){let t=I(a),e=t.map(r=>r.startedAt?.getTime()).filter(b);if(e.length){let r=t.flatMap(p=>[p.startedAt?.getTime(),p.finishedAt?.getTime()]).filter(b);a.updatedAt&&r.push(a.updatedAt.getTime());let s=(Math.max(...r)-Math.min(...e))/1e3;if(s>0)return s}let n=a.steps.reduce((r,s)=>r+(s.duration??(s.substeps??[]).reduce((p,l)=>p+(l.duration??0),0)),0);return n>0?n:void 0}function q(a){let t=a.steps,e=o=>t.filter(_=>_.status===o).length,n=t.length,r=e("done"),s=e("skipped"),p=r+s,l=t.findIndex(o=>o.status==="in-progress");l<0&&(l=t.findIndex(o=>o.status==="pending")),l<0&&(l=t.findIndex(o=>o.status==="blocked"));let d=l<0?t.findIndex(o=>o.status==="failed"):-1,c=Ca(a);return{total:n,done:r,skipped:s,failed:e("failed"),blocked:e("blocked"),finished:p,ratio:n?p/n:0,...l>=0?{current:t[l],currentIndex:l}:{},...d>=0?{stoppedIndex:d}:{},...c!==void 0?{elapsed:c}:{}}}var G=a=>a.timed===!0||I(a).some(t=>t.startedAt||t.finishedAt||t.duration!==void 0);function D(a,t){let e=A(a),n=(d,c,o=0)=>new Intl.NumberFormat(e,{style:"unit",unit:c,unitDisplay:"narrow",maximumFractionDigits:o}).format(d),r=Math.max(0,t);if(r<10&&!Number.isInteger(r))return n(r,"second",1);let s=Math.round(r);if(s<60)return n(s,"second");let p=[],l=0;for(let[d,c]of[["day",86400],["hour",3600],["minute",60],["second",1]]){let o=Math.floor(s/c);if(s-=o*c,o>0&&p.push(n(o,d)),(o>0||l)&&(l+=1),l===2)break}try{return new Intl.ListFormat(e,{type:"unit",style:"narrow"}).format(p)}catch{return p.join(" ")}}var Ya=a=>`PT${Math.round(a*1e3)/1e3}S`;function Ba(a,t,e){return new Intl.DateTimeFormat(A(a),{hour:"numeric",minute:"2-digit",...e?{second:"2-digit"}:{}}).format(t)}function Ua(a){let t=I(a).flatMap(e=>[e.startedAt?.getTime(),e.finishedAt?.getTime()]).filter(b);return!t.length||Math.max(...t)-Math.min(...t)<36e5}var y=(a,t)=>L(a,t),Y=(a,t)=>`${t?a/t*100:0}%`,Ra=new Set(["done","failed","skipped"]);function H(a,t="aparte-plan__glyph"){return x(U[a],`aparte-rich-card__glyph ${t}`)}function V(a){return i("span",{class:"aparte-plan__step-title",attrs:{"data-text":a.title,"data-alt":a.altTitle}},i("span",{class:"aparte-plan__step-title-text",text:a.title}))}function X(a,t){let e=i("span",{class:"aparte-sr-only aparte-plan__status"});return a.bind(e,()=>` (${g(a.config,_a[t.status])})`),e}var W=a=>a.detail?i("div",{class:"aparte-plan__detail",text:a.detail}):null;function qa(a){return[3599,86340,604799].map(t=>D(a,t)).reduce((t,e)=>e.length>t.length?e:t)}function Z(a,t){let e=t.duration!==void 0&&Ra.has(t.status)?t.duration:void 0,n=i("time",{class:"aparte-plan__duration",attrs:{datetime:e!==void 0?Ya(e):void 0}});return e!==void 0&&a.bind(n,()=>D(a.config,e)),a.bind(n,()=>qa(a.config),"data-reserve"),n}function J(a,t,e,n){let r=t.title??t.goal,s=i("span",{class:"aparte-plan__count"});a.bind(s,()=>g(a.config,"cardsPlanProgress",{done:y(a.config,e.done),total:y(a.config,e.total)}));let p=(c,o,_)=>{if(!_)return null;let v=i("span",{class:"aparte-plan__note",attrs:{"data-kind":c}});return a.bind(v,()=>g(a.config,o,{n:y(a.config,_)})),v},l=null;if(e.elapsed!==void 0){let c=e.elapsed,o=i("span",{class:"aparte-plan__elapsed-text"});a.bind(o,()=>g(a.config,"cardsPlanElapsed",{time:D(a.config,c)})),l=i("span",{class:"aparte-plan__elapsed"},x(da,"aparte-rich-card__glyph aparte-plan__clock"),o)}let d=null;return n&&(d=i("div",{class:"aparte-plan__bar",attrs:{"aria-hidden":"true","data-complete":e.total>0&&e.finished===e.total}},i("span",{class:"aparte-plan__bar-done"}),i("span",{class:"aparte-plan__bar-skipped"})),d.style.setProperty("--aparte-plan-done-share",Y(e.done,e.total)),d.style.setProperty("--aparte-plan-skipped-share",Y(e.skipped,e.total))),i("div",{class:"aparte-plan__head"},r?i("div",{class:"aparte-plan__heading"},i("div",{class:"aparte-plan__title",text:r}),t.title&&t.goal?i("div",{class:"aparte-plan__goal",text:t.goal}):null):null,i("div",{class:"aparte-plan__meter"},s,p("skipped","cardsPlanSkipped",e.skipped),p("failed","cardsPlanFailed",e.failed),l),d)}function M(a,t,{timed:e,current:n=!1,sub:r=!1}){let s=i("div",{class:"aparte-plan__row"},H(t.status),i("div",{class:"aparte-plan__text"},V(t),X(a,t),W(t)),e?Z(a,t):null),p=i("li",{class:`aparte-plan__step${r?" aparte-plan__step--sub":""}`,attrs:{"data-status":t.status,"aria-current":n?"step":void 0,"data-step-id":t.id}},s);return t.substeps?.length&&p.append(i("ol",{class:"aparte-plan__substeps",attrs:{role:"list"}},...t.substeps.map(l=>M(a,l,{timed:e,sub:!0})))),p}function Ga(a,t,e){let n=G(t),r=i("ol",{class:"aparte-plan__steps",attrs:{role:"list","data-timed":n}},...t.steps.map((s,p)=>M(a,s,{timed:n,current:p===e.currentIndex})));return[J(a,t,e,!0),r]}function Ha(a,t,e){let n=t.startedAt,r=i("time",{class:"aparte-plan__start",attrs:{datetime:n?.toISOString()}});return n&&a.bind(r,()=>Ba(a.config,n,e)),i("div",{class:"aparte-plan__meta"},r,Z(a,t))}function Va(a,t,e){let n=G(t),r=Ua(t),s=i("ol",{class:"aparte-plan__timeline",attrs:{role:"list","data-timed":n}});return t.steps.forEach((p,l)=>{let d=i("span",{class:"aparte-plan__node"},x(p.status==="in-progress"?oa:U[p.status],"aparte-rich-card__glyph aparte-plan__node-glyph")),c=i("div",{class:"aparte-plan__event-body"},V(p),X(a,p),n?Ha(a,p,r):null,W(p),p.substeps?.length?i("ol",{class:"aparte-plan__substeps",attrs:{role:"list"}},...p.substeps.map(o=>M(a,o,{timed:!1,sub:!0}))):null);s.append(i("li",{class:"aparte-plan__event",attrs:{"data-status":p.status,"aria-current":l===e.currentIndex?"step":void 0,"data-step-id":p.id}},d,c))}),[J(a,t,e,!1),s]}var B="http://www.w3.org/2000/svg";function Xa(a){let t=document.createElementNS(B,"svg");t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("class","aparte-plan__ring-svg");let e=(s,p,l=0)=>{let d=document.createElementNS(B,"circle");for(let[c,o]of[["cx","12"],["cy","12"],["r","9.5"],["pathLength","100"],["class",s]])d.setAttribute(c,o);return p!==void 0&&(d.setAttribute("stroke-dasharray",`${p} 100`),d.setAttribute("stroke-dashoffset",String(-l))),d},n=a.total?a.done/a.total*100:0,r=a.total?a.skipped/a.total*100:0;return t.append(e("aparte-plan__ring-track"),e("aparte-plan__ring-done",n),e("aparte-plan__ring-skipped",r,n)),i("span",{class:"aparte-plan__ring",attrs:{"aria-hidden":"true","data-complete":a.total>0&&a.finished===a.total}},t)}function Wa(a,t,e){let n=e.currentIndex??e.stoppedIndex,r=n!==void 0?t.steps[n]:void 0,s=i("span",{class:"aparte-plan__compact-step"}),p=[];if(r)a.bind(s,()=>g(a.config,"cardsPlanStepNow",{n:y(a.config,n+1),total:y(a.config,e.total)})),p.push(s,i("span",{class:"aparte-plan__compact-title",text:r.title}));else{a.word(s,"cardsPlanAllDone",R.cardsPlanAllDone);let c=t.title??t.goal;c&&p.push(i("span",{class:"aparte-plan__compact-title",text:c})),p.push(s)}let l=i("span",{class:"aparte-plan__percent"});a.bind(l,()=>K(a.config,e.ratio));let d=r?r.status:"done";return[i("div",{class:"aparte-plan__compact",attrs:{"data-status":d}},H(d,"aparte-plan__glyph aparte-plan__compact-glyph"),i("span",{class:"aparte-plan__compact-text"},...p),Xa(e),l)]}function Q(a,t){let e=q(a);return t.variant==="timeline"?Va(t,a,e):t.variant==="compact"?Wa(t,a,e):Ga(t,a,e)}function Za(a,t){if(a?.steps?.length)return Q(a,t);let e=(p,l="rect")=>i("span",{class:`aparte-skeleton aparte-skeleton--${l} ${p}`,attrs:{"aria-hidden":"true"}}),n=a?.title??a?.goal;if(t.variant==="compact")return[i("div",{class:"aparte-plan__compact"},e("aparte-plan__sk-glyph","circle"),i("span",{class:"aparte-plan__compact-text"},n?i("span",{class:"aparte-plan__compact-title",text:n}):e("aparte-plan__sk-line","text")),e("aparte-plan__sk-ring","circle"))];let r=i("div",{class:"aparte-plan__head"},n?i("div",{class:"aparte-plan__heading"},i("div",{class:"aparte-plan__title",text:n})):e("aparte-plan__sk-title","text"),i("div",{class:"aparte-plan__meter"},e("aparte-plan__sk-count","text")),t.variant==="checklist"?i("div",{class:"aparte-plan__bar",attrs:{"aria-hidden":"true"}}):null),s=[0,1,2,3];return t.variant==="timeline"?[r,i("ol",{class:"aparte-plan__timeline",attrs:{"aria-hidden":"true"}},...s.map(()=>i("li",{class:"aparte-plan__event",attrs:{"data-status":"pending"}},i("span",{class:"aparte-plan__node"},e("aparte-plan__sk-node","circle")),i("div",{class:"aparte-plan__event-body"},e("aparte-plan__sk-line","text"),e("aparte-plan__sk-meta","text")))))]:[r,i("ol",{class:"aparte-plan__steps",attrs:{"aria-hidden":"true"}},...s.map(()=>i("li",{class:"aparte-plan__step"},i("div",{class:"aparte-plan__row"},e("aparte-plan__sk-glyph","circle"),e("aparte-plan__sk-line","text")))))]}function aa(a,t){return a?.title??a?.goal??g(t.config,"cardsPlanTitle")}var Ja={done:"[x]",pending:"[ ]","in-progress":"[>]",failed:"[!]",skipped:"[-]",blocked:"[~]"},Qa=a=>a.length>120?`${a.slice(0,119).trimEnd()}\u2026`:a;function at(a,t){let e=q(a),n=g(t.config,"cardsPlanSummary",{done:y(t.config,e.done),total:y(t.config,e.total)}),r=e.current?` \u2014 ${g(t.config,"cardsPlanNow",{step:e.current.title})}`:"",s=(l,d)=>{let c=(l.status==="failed"||l.status==="blocked")&&l.detail?` \u2014 ${Qa(l.detail)}`:"";return`${d}- ${Ja[l.status]} ${l.title}${c}`},p=a.steps.flatMap(l=>[s(l,""),...(l.substeps??[]).map(d=>s(d," "))]);return[`${aa(a,t)}: ${n}${r}`,...p].join(`
|
|
541
541
|
`)}var tt=$({name:"plan",variants:["checklist","timeline","compact"],styles:ua,icon:ca,normalize:E,render:Q,skeleton:Za,label:aa,fallback:at,partial:a=>{let t=E(a);if(t)return t;let e=h(a.title??a.goal??a.task??a.objective??a.query);return e?{title:e}:null}});function nt(a={}){return tt.setup(a)}export{fa as PLAN_STEPS_SHOWN,D as durationText,tt as planCard,q as planProgress,E as readPlan,ga as readStatus,nt as setupPlanCard};
|
|
542
|
-
//# sourceMappingURL=plan-
|
|
542
|
+
//# sourceMappingURL=plan-BAI6GY4A.js.map
|