{"version":3,"sources":["jsdelivr-header.js","/npm/@johnmorrisdotca/chikyu-earth@0.51.1/dist/adopt.js","/npm/@johnmorrisdotca/chikyu-earth@0.51.1/dist/countries.js","/npm/@johnmorrisdotca/chikyu-earth@0.51.1/dist/paint/math.js","/npm/@johnmorrisdotca/chikyu-earth@0.51.1/dist/route.js","/npm/@johnmorrisdotca/chikyu-earth@0.51.1/dist/styles.js","/npm/@johnmorrisdotca/chikyu-earth@0.51.1/dist/view.js","/npm/@johnmorrisdotca/chikyu-earth@0.51.1/dist/globe.js","/npm/@johnmorrisdotca/chikyu-earth@0.51.1/dist/markers/project.js","/npm/@johnmorrisdotca/chikyu-earth@0.51.1/dist/cities/geometry.js","/npm/@johnmorrisdotca/chikyu-earth@0.51.1/dist/sea-names/features.js","/npm/@johnmorrisdotca/chikyu-earth@0.51.1/dist/sea-names/geometry.js","/npm/@johnmorrisdotca/chikyu-earth@0.51.1/dist/sea-names/host.js","/npm/@johnmorrisdotca/chikyu-earth@0.51.1/dist/element.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,0PCJA,MAAM,EAAS,IAAI,IACZ,SAAS,GAAY,EAAM,EAAK,EAAQ,GAAI,CAC/C,GAAI,OAAO,eAAkB,YAAc,gBAAiB,cAAc,WAAa,uBAAwB,EAC3G,GAAI,CACA,IAAI,EAAQ,EAAO,IAAI,CAAG,EACrB,IACD,EAAQ,IAAI,cACZ,EAAM,YAAY,CAAG,EACrB,EAAO,IAAI,EAAK,CAAK,GAEpB,EAAK,mBAAmB,SAAS,CAAK,IACvC,EAAK,mBAAqB,CAAC,GAAG,EAAK,mBAAoB,CAAK,GAChE,MACJ,MACM,CAEN,CAEJ,MAAM,EAAQ,EAAK,cAAc,cAAc,OAAO,EAClD,GACA,EAAM,aAAa,QAAS,CAAK,EACrC,EAAM,YAAc,EACpB,EAAK,QAAQ,CAAK,CACtB,CCXO,MAAM,GAAY,CAErB,SAAU,GAAU,SAAS,IAAK,IAAa,CAC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EAAK,IAAK,OAAA,EAAQ,GAAA,EAAI,GAAA,CAAE,EAC3D,KAAK,GAAM,MAAM,CACb,MAAO,EAAO,EACd,OAAQ,EAAO,EACf,OAAA,EACA,KAAM,CAAE,EAAG,EAAI,EAAG,EAAI,OAAA,CAAM,EAC5B,QAAS,CAAC,EAAK,EAAK,IAAQ,CACxB,MAAM,EAAK,GAAQ,EAAK,EAAK,CAAI,EACjC,OAAA,EAAI,EAAI,EAAG,EACX,EAAI,EAAI,EAAG,EACJ,EAAG,CACd,CACZ,CAAS,CACL,CACJ,CACI,OAAO,eAAmB,KAAe,CAAC,eAAe,IAAI,cAAc,GAC3E,eAAe,OAAO,eAAgB,CAAW","file":"/npm/@johnmorrisdotca/chikyu-earth@0.51.1/dist/element.js/+esm","sourceRoot":"","sourcesContent":["/**\n * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1.\n * Original file: /npm/@johnmorrisdotca/chikyu-earth@0.51.1/dist/element.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// Puts an element's styles into its shadow root so a strict Content-Security-Policy (`style-src 'self'`) allows them: a constructable stylesheet is not inline\n// markup. A browser without that gets a <style> carrying the element's `nonce` attribute, which a page can allow by nonce.\nconst sheets = new Map();\nexport function adoptStyles(root, css, nonce = \"\") {\n    if (typeof CSSStyleSheet === \"function\" && \"replaceSync\" in CSSStyleSheet.prototype && \"adoptedStyleSheets\" in root) {\n        try {\n            let sheet = sheets.get(css);\n            if (!sheet) {\n                sheet = new CSSStyleSheet();\n                sheet.replaceSync(css);\n                sheets.set(css, sheet);\n            }\n            if (!root.adoptedStyleSheets.includes(sheet))\n                root.adoptedStyleSheets = [...root.adoptedStyleSheets, sheet];\n            return;\n        }\n        catch {\n            // a browser that has the API and refuses it: the <style> below\n        }\n    }\n    const style = root.ownerDocument.createElement(\"style\");\n    if (nonce)\n        style.setAttribute(\"nonce\", nonce);\n    style.textContent = css;\n    root.prepend(style);\n}\n","// The country outlines: chizu's world-geo (Natural Earth 1:110m, WGS84 longitude and latitude) shaped for the globe.\n// Names are chizu's own English and Japanese; the alpha-2 code is its two-letter code, null for the three places with none.\nimport WORLD_GEO from \"@johnmorrisdotca/chizu/world-geo\";\n/**\n * Every country the globe draws, as GeoJSON in longitude and latitude (177 features, Antarctica included), each with its English name, its Japanese name and its two-letter code.\n *\n * @example\n * ```ts\n * import { COUNTRIES } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * const japan = COUNTRIES.features.find((feature) => feature.properties.alpha2 === \"JP\");\n * console.log(japan?.properties.name, japan?.properties.ja, COUNTRIES.features.length);\n * ```\n */\nexport const COUNTRIES = {\n    type: \"FeatureCollection\",\n    features: WORLD_GEO.features.map((feature) => ({\n        type: \"Feature\",\n        geometry: feature.geometry,\n        properties: {\n            name: feature.properties.name,\n            ja: feature.properties.nameJa || null,\n            alpha2: feature.properties.code.length === 2 ? feature.properties.code : null,\n        },\n    })),\n};\n","// Pure geometry for a satellite's painted ground track: the point under it, the date line, and the circle where it stands 10° up.\nimport { greenwichSidereal } from \"../realistic/sun.js\";\nconst RAD = Math.PI / 180;\n/** Mean Earth radius, kilometres, the same unit the satellite positions use. */\nexport const PAINT_EARTH_KM = 6371;\n/** The painted texture: equirectangular, north at the first row, longitude −180 at the first column. */\nexport const PAINT_W = 1024;\nexport const PAINT_H = 512;\n/** Earth-central angle, in radians, where a satellite `heightKm` up is at least `elevationDeg` above the horizon (10 when left out). 0 when it never is. */\nexport function coverageAngleRad(heightKm, elevationDeg = 10) {\n    const r = PAINT_EARTH_KM + heightKm;\n    if (!(r > PAINT_EARTH_KM))\n        return 0;\n    const elevation = elevationDeg * RAD;\n    const cosAlpha = (PAINT_EARTH_KM / r) * Math.cos(elevation);\n    if (!(cosAlpha < 1))\n        return 0;\n    const alpha = Math.acos(Math.max(-1, cosAlpha));\n    return Math.max(0, alpha - elevation);\n}\n/** A unit vector for a longitude and latitude, in the Earth's own axes (+z at longitude 0, +x east, +y north). */\nconst unitOf = (point) => {\n    const lon = point.lon * RAD;\n    const lat = point.lat * RAD;\n    const c = Math.cos(lat);\n    return [c * Math.sin(lon), Math.sin(lat), c * Math.cos(lon)];\n};\nconst fromUnit = (x, y, z) => {\n    const length = Math.hypot(x, y, z) || 1;\n    return { lon: Math.atan2(x, z) / RAD, lat: Math.asin(Math.max(-1, Math.min(1, y / length))) / RAD };\n};\n/** The ground under a satellite. `x, y, z` are what `Satellites.exact` writes (Earth radii, x to the vernal equinox, y north). `ms` turns the Earth under that place. */\nexport function groundUnder(x, y, z, ms) {\n    const theta = greenwichSidereal(ms) * RAD;\n    const cos = Math.cos(theta);\n    const sin = Math.sin(theta);\n    const temeX = x;\n    const temeY = -z;\n    const temeZ = y;\n    const east = -temeX * sin + temeY * cos;\n    const north = temeZ;\n    const prime = temeX * cos + temeY * sin;\n    const ground = fromUnit(east, north, prime);\n    return { ...ground, heightKm: (Math.hypot(x, y, z) - 1) * PAINT_EARTH_KM };\n}\n/** Points from `a` to `b` along the great circle, about `stepDeg` apart, including both ends. A fast clock stays a continuous line, and a pole or the date line is many short steps. */\nexport function trackSteps(a, b, stepDeg) {\n    const u = unitOf(a);\n    const v = unitOf(b);\n    const dot = Math.max(-1, Math.min(1, u[0] * v[0] + u[1] * v[1] + u[2] * v[2]));\n    const angle = Math.acos(dot);\n    const step = Math.max(0.25, stepDeg) * RAD;\n    if (!(angle > step))\n        return [a, b];\n    const count = Math.ceil(angle / step);\n    const sin = Math.sin(angle) || 1;\n    const out = [];\n    for (let i = 0; i <= count; i += 1) {\n        const t = i / count;\n        const left = Math.sin((1 - t) * angle) / sin;\n        const right = Math.sin(t * angle) / sin;\n        out.push(fromUnit(u[0] * left + v[0] * right, u[1] * left + v[1] * right, u[2] * left + v[2] * right));\n    }\n    return out;\n}\n/** One segment, or two when the short way from `a` to `b` crosses the date line, so an equirectangular line does not cross the whole map. Longitude is degrees, −180 to 180. */\nexport function splitDateLine(a, b) {\n    let delta = b.lon - a.lon;\n    if (delta > 180)\n        delta -= 360;\n    if (delta < -180)\n        delta += 360;\n    const end = a.lon + delta;\n    if (end <= 180 && end >= -180)\n        return [[a, { lon: end, lat: b.lat }]];\n    const edge = end > 180 ? 180 : -180;\n    const span = end - a.lon;\n    const t = span === 0 ? 0 : (edge - a.lon) / span;\n    const lat = a.lat + (b.lat - a.lat) * t;\n    const other = edge === 180 ? -180 : 180;\n    const rest = end > 180 ? end - 360 : end + 360;\n    return [\n        [a, { lon: edge, lat }],\n        [{ lon: other, lat }, { lon: rest, lat: b.lat }],\n    ];\n}\n/** Where a longitude and latitude fall on the painted texture, column and row. */\nexport function paintPixel(lon, lat) {\n    const u = lon / 360 + 0.5;\n    const v = 0.5 - lat / 180;\n    const x = Math.max(0, Math.min(PAINT_W - 1, Math.floor(u * PAINT_W)));\n    const y = Math.max(0, Math.min(PAINT_H - 1, Math.floor(v * PAINT_H)));\n    return { x, y };\n}\n","import { splitDateLine, trackSteps } from \"./paint/math.js\";\n/**\n * WGS84 equatorial radius, metres (NIMA TR8350.2).\n *\n * @example\n * ```ts\n * import { WGS84_A_M } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * console.log(WGS84_A_M);\n * ```\n */\nexport const WGS84_A_M = 6_378_137;\n/**\n * WGS84 flattening (NIMA TR8350.2).\n *\n * @example\n * ```ts\n * import { WGS84_F } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * console.log(WGS84_F.toFixed(12));\n * ```\n */\nexport const WGS84_F = 1 / 298.257223563;\n/**\n * Mean Earth radius, kilometres, the same sphere the city distances use.\n *\n * @example\n * ```ts\n * import { MEAN_RADIUS_KM } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * console.log(MEAN_RADIUS_KM);\n * ```\n */\nexport const MEAN_RADIUS_KM = 6371.0088;\n/**\n * The speed a flight-time estimate assumes, in kilometres an hour: a jet's cruise, with no wind, climb or holding.\n *\n * @example\n * ```ts\n * import { FLIGHT_SPEED_KM_H } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * console.log(FLIGHT_SPEED_KM_H);\n * ```\n */\nexport const FLIGHT_SPEED_KM_H = 900;\nconst RAD = Math.PI / 180;\nconst B_M = WGS84_A_M * (1 - WGS84_F);\nconst isPlace = (place) => Number.isFinite(place.lon) && Number.isFinite(place.lat) && Math.abs(place.lat) <= 90 && Math.abs(place.lon) <= 180;\nconst wrap360 = (degrees) => ((degrees % 360) + 360) % 360;\nconst wrap180 = (degrees) => {\n    const wrapped = ((((degrees + 180) % 360) + 360) % 360) - 180;\n    return wrapped === 0 ? 0 : wrapped;\n};\nconst unit = (place) => {\n    const lat = place.lat * RAD;\n    const lon = place.lon * RAD;\n    const c = Math.cos(lat);\n    return [c * Math.sin(lon), Math.sin(lat), c * Math.cos(lon)];\n};\n/**\n * The great-circle distance, kilometres, on a sphere of {@link MEAN_RADIUS_KM}. The same angle `trackSteps` uses between two unit vectors.\n *\n * @param from - The start, degrees.\n * @param to - The end, degrees.\n * @returns The distance, or null when a place is not on the Earth.\n *\n * @example\n * ```ts\n * import { greatCircleKm } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * console.log(greatCircleKm({ lon: 0, lat: 0 }, { lon: 0, lat: 0 }));\n * ```\n */\nexport function greatCircleKm(from, to) {\n    if (!isPlace(from) || !isPlace(to))\n        return null;\n    const u = unit(from);\n    const v = unit(to);\n    const dot = Math.max(-1, Math.min(1, u[0] * v[0] + u[1] * v[1] + u[2] * v[2]));\n    const cross = Math.hypot(u[1] * v[2] - u[2] * v[1], u[2] * v[0] - u[0] * v[2], u[0] * v[1] - u[1] * v[0]);\n    return (MEAN_RADIUS_KM * Math.atan2(cross, dot));\n}\n/** Vincenty's inverse: metres and the two bearings, or null when it does not converge. */\nfunction vincentyInverse(from, to) {\n    const u1 = Math.atan((1 - WGS84_F) * Math.tan(from.lat * RAD));\n    const u2 = Math.atan((1 - WGS84_F) * Math.tan(to.lat * RAD));\n    const sinU1 = Math.sin(u1);\n    const cosU1 = Math.cos(u1);\n    const sinU2 = Math.sin(u2);\n    const cosU2 = Math.cos(u2);\n    const L = Math.atan2(Math.sin((to.lon - from.lon) * RAD), Math.cos((to.lon - from.lon) * RAD));\n    let lambda = L;\n    let sinSigma = 0;\n    let cosSigma = 1;\n    let sigma = 0;\n    let cos2SigmaM = 0;\n    let cosSqAlpha = 1;\n    for (let i = 0; i < 100; i += 1) {\n        const sinLambda = Math.sin(lambda);\n        const cosLambda = Math.cos(lambda);\n        sinSigma = Math.hypot(cosU2 * sinLambda, cosU1 * sinU2 - sinU1 * cosU2 * cosLambda);\n        if (sinSigma === 0)\n            return { metres: 0, initial: 0, final: 0 };\n        cosSigma = sinU1 * sinU2 + cosU1 * cosU2 * cosLambda;\n        sigma = Math.atan2(sinSigma, cosSigma);\n        const sinAlpha = (cosU1 * cosU2 * sinLambda) / sinSigma;\n        cosSqAlpha = 1 - sinAlpha * sinAlpha;\n        cos2SigmaM = cosSqAlpha === 0 ? 0 : cosSigma - (2 * sinU1 * sinU2) / cosSqAlpha;\n        const C = (WGS84_F / 16) * cosSqAlpha * (4 + WGS84_F * (4 - 3 * cosSqAlpha));\n        const next = L + (1 - C) * WGS84_F * sinAlpha * (sigma + C * sinSigma * (cos2SigmaM + C * cosSigma * (-1 + 2 * cos2SigmaM * cos2SigmaM)));\n        if (Math.abs(next - lambda) < 1e-12) {\n            lambda = next;\n            const uSq = (cosSqAlpha * (WGS84_A_M * WGS84_A_M - B_M * B_M)) / (B_M * B_M);\n            const A = 1 + (uSq / 16384) * (4096 + uSq * (-768 + uSq * (320 - 175 * uSq)));\n            const B = (uSq / 1024) * (256 + uSq * (-128 + uSq * (74 - 47 * uSq)));\n            const delta = B *\n                sinSigma *\n                (cos2SigmaM +\n                    (B / 4) * (cosSigma * (-1 + 2 * cos2SigmaM * cos2SigmaM) - (B / 6) * cos2SigmaM * (-3 + 4 * sinSigma * sinSigma) * (-3 + 4 * cos2SigmaM * cos2SigmaM)));\n            const metres = B_M * A * (sigma - delta);\n            const initial = Math.atan2(cosU2 * Math.sin(lambda), cosU1 * sinU2 - sinU1 * cosU2 * Math.cos(lambda));\n            const final = Math.atan2(cosU1 * Math.sin(lambda), -sinU1 * cosU2 + cosU1 * sinU2 * Math.cos(lambda));\n            return { metres, initial: wrap360(initial / RAD), final: wrap360(final / RAD) };\n        }\n        lambda = next;\n    }\n    return null;\n}\n/** Vincenty's direct: the place `metres` from `from` on the bearing `bearingDeg`. */\nfunction vincentyDirect(from, bearingDeg, metres) {\n    if (metres === 0)\n        return { lon: from.lon, lat: from.lat };\n    const alpha1 = bearingDeg * RAD;\n    const tanU1 = (1 - WGS84_F) * Math.tan(from.lat * RAD);\n    const cosU1 = 1 / Math.hypot(1, tanU1);\n    const sinU1 = tanU1 * cosU1;\n    const sigma1 = Math.atan2(tanU1, Math.cos(alpha1));\n    const sinAlpha = cosU1 * Math.sin(alpha1);\n    const cosSqAlpha = 1 - sinAlpha * sinAlpha;\n    const uSq = (cosSqAlpha * (WGS84_A_M * WGS84_A_M - B_M * B_M)) / (B_M * B_M);\n    const A = 1 + (uSq / 16384) * (4096 + uSq * (-768 + uSq * (320 - 175 * uSq)));\n    const B = (uSq / 1024) * (256 + uSq * (-128 + uSq * (74 - 47 * uSq)));\n    let sigma = metres / (B_M * A);\n    let cos2SigmaM = 0;\n    for (let i = 0; i < 100; i += 1) {\n        cos2SigmaM = Math.cos(2 * sigma1 + sigma);\n        const sinSigma = Math.sin(sigma);\n        const cosSigma = Math.cos(sigma);\n        const delta = B *\n            sinSigma *\n            (cos2SigmaM +\n                (B / 4) * (cosSigma * (-1 + 2 * cos2SigmaM * cos2SigmaM) - (B / 6) * cos2SigmaM * (-3 + 4 * sinSigma * sinSigma) * (-3 + 4 * cos2SigmaM * cos2SigmaM)));\n        const next = metres / (B_M * A) + delta;\n        if (Math.abs(next - sigma) < 1e-12) {\n            sigma = next;\n            break;\n        }\n        sigma = next;\n    }\n    const sinSigma = Math.sin(sigma);\n    const cosSigma = Math.cos(sigma);\n    const lat = Math.atan2(sinU1 * cosSigma + cosU1 * sinSigma * Math.cos(alpha1), (1 - WGS84_F) * Math.hypot(sinAlpha, sinU1 * sinSigma - cosU1 * cosSigma * Math.cos(alpha1)));\n    const lambda = Math.atan2(sinSigma * Math.sin(alpha1), cosU1 * cosSigma - sinU1 * sinSigma * Math.cos(alpha1));\n    const C = (WGS84_F / 16) * cosSqAlpha * (4 + WGS84_F * (4 - 3 * cosSqAlpha));\n    const L = lambda - (1 - C) * WGS84_F * sinAlpha * (sigma + C * sinSigma * (cos2SigmaM + C * cosSigma * (-1 + 2 * cos2SigmaM * cos2SigmaM)));\n    return { lon: wrap180(from.lon + L / RAD), lat: lat / RAD };\n}\n/** The place `angle` radians along the great circle that leaves `from` on `bearingDeg`, on a sphere. */\nconst sphereDirect = (from, bearingDeg, angle) => {\n    const lat1 = from.lat * RAD;\n    const bearing = bearingDeg * RAD;\n    const lat = Math.asin(Math.max(-1, Math.min(1, Math.sin(lat1) * Math.cos(angle) + Math.cos(lat1) * Math.sin(angle) * Math.cos(bearing))));\n    const lon = from.lon * RAD + Math.atan2(Math.sin(bearing) * Math.sin(angle) * Math.cos(lat1), Math.cos(angle) - Math.sin(lat1) * Math.sin(lat));\n    return { lon: wrap180(lon / RAD), lat: lat / RAD };\n};\nconst sphericalBearings = (from, to) => {\n    const y1 = Math.sin((to.lon - from.lon) * RAD) * Math.cos(to.lat * RAD);\n    const x1 = Math.cos(from.lat * RAD) * Math.sin(to.lat * RAD) - Math.sin(from.lat * RAD) * Math.cos(to.lat * RAD) * Math.cos((to.lon - from.lon) * RAD);\n    const y2 = Math.sin((from.lon - to.lon) * RAD) * Math.cos(from.lat * RAD);\n    const x2 = Math.cos(to.lat * RAD) * Math.sin(from.lat * RAD) - Math.sin(to.lat * RAD) * Math.cos(from.lat * RAD) * Math.cos((from.lon - to.lon) * RAD);\n    return { initial: wrap360(Math.atan2(y1, x1) / RAD), final: wrap360((Math.atan2(y2, x2) / RAD + 180) % 360) };\n};\n/**\n * Distance, bearings, midpoint and a flight-time estimate between two places. The distance quoted is the WGS84 geodesic.\n * The flight time is that distance at {@link FLIGHT_SPEED_KM_H}, an estimate with no wind.\n *\n * @param from - The start, degrees.\n * @param to - The end, degrees.\n * @returns The leg, or null when a place is not on the Earth.\n *\n * @example\n * ```ts\n * import { routeLeg } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * const leg = routeLeg({ lon: 0, lat: 0 }, { lon: 1, lat: 0 });\n * console.log(leg?.kilometres.toFixed(3), leg?.initialBearing);\n * ```\n */\nexport function routeLeg(from, to) {\n    const sphere = greatCircleKm(from, to);\n    if (sphere === null)\n        return null;\n    const solved = vincentyInverse(from, to);\n    const exact = solved !== null;\n    const kilometres = exact ? solved.metres / 1000 : sphere;\n    const bearings = exact ? { initial: solved.initial, final: solved.final } : sphericalBearings(from, to);\n    const midpoint = exact ? vincentyDirect(from, bearings.initial, solved.metres / 2) : trackSteps(from, to, Math.max(sphere / MEAN_RADIUS_KM / RAD / 2, 0.01))[1] ?? from;\n    return { kilometres, greatCircleKm: sphere, initialBearing: bearings.initial, finalBearing: bearings.final, flightHours: kilometres / FLIGHT_SPEED_KM_H, midpoint, exact };\n}\n/**\n * Points along the geodesic from `from` to `to`, including both ends. `count` is how many (2 when they are the same place, 64 when left out).\n * When the geodesic does not converge, the points are the great circle (`trackSteps`).\n *\n * @param from - The start.\n * @param to - The end.\n * @param count - How many points, at least 2.\n * @returns The points, or an empty list when a place is not on the Earth.\n *\n * @example\n * ```ts\n * import { routePoints } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * console.log(routePoints({ lon: 0, lat: 0 }, { lon: 1, lat: 0 }, 3).length);\n * ```\n */\nexport function routePoints(from, to, count = 64) {\n    const leg = routeLeg(from, to);\n    if (!leg)\n        return [];\n    const n = Math.max(2, Math.floor(count));\n    if (leg.kilometres === 0)\n        return [from, to];\n    if (!leg.exact) {\n        // nearly opposite places: the great circle, by the spherical direct problem from the initial bearing, so there are exactly `n` points, evenly spaced\n        const angle = leg.greatCircleKm / MEAN_RADIUS_KM;\n        return Array.from({ length: n }, (_, i) => (i === 0 ? { lon: from.lon, lat: from.lat } : i === n - 1 ? { lon: to.lon, lat: to.lat } : sphereDirect(from, leg.initialBearing, (angle * i) / (n - 1))));\n    }\n    const out = [];\n    for (let i = 0; i < n; i += 1)\n        out.push(i === n - 1 ? { lon: to.lon, lat: to.lat } : vincentyDirect(from, leg.initialBearing, (leg.kilometres * 1000 * i) / (n - 1)));\n    return out;\n}\n/**\n * The runs of a route after it is split at the date line, so a flat map draws two pieces instead of a line across the world.\n * A run that does not cross is one piece. Uses `splitDateLine`.\n *\n * @param points - Points in order along the route, including the ends.\n * @returns One list of points per piece.\n *\n * @example\n * ```ts\n * import { routeRuns } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * console.log(routeRuns([{ lon: 179, lat: 0 }, { lon: -179, lat: 0 }]).length);\n * ```\n */\nexport function routeRuns(points) {\n    if (points.length === 0)\n        return [];\n    const runs = [[{ lon: points[0].lon, lat: points[0].lat }]];\n    for (let i = 1; i < points.length; i += 1) {\n        const next = points[i];\n        const parts = splitDateLine(points[i - 1], next);\n        const run = runs[runs.length - 1];\n        if (parts.length === 1)\n            run.push({ lon: next.lon, lat: next.lat });\n        else {\n            run.push(parts[0][1]);\n            runs.push([parts[1][0], { lon: next.lon, lat: next.lat }]);\n        }\n    }\n    return runs;\n}\n/**\n * Read the `route` attribute: `lon,lat,lon,lat`. Anything else is no route.\n *\n * @param value - The attribute's text, or null.\n * @returns The two places, or null.\n *\n * @example\n * ```ts\n * import { readRoute } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * console.log(readRoute(\"139.69,35.69,-0.13,51.51\")?.from.lat);\n * console.log(readRoute(\"no\"));\n * ```\n */\nexport function readRoute(value) {\n    if (!value)\n        return null;\n    const parts = value.split(\",\").map((part) => Number(part.trim()));\n    if (parts.length !== 4 || parts.some((n) => !Number.isFinite(n)))\n        return null;\n    const route = { from: { lon: parts[0], lat: parts[1] }, to: { lon: parts[2], lat: parts[3] } };\n    if (!isPlace(route.from) || !isPlace(route.to))\n        return null;\n    return route;\n}\n/**\n * The `route` attribute for two places, four decimals.\n *\n * @param route - The two places.\n * @returns `lon,lat,lon,lat`.\n *\n * @example\n * ```ts\n * import { routeText } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * console.log(routeText({ from: { lon: 1, lat: 2 }, to: { lon: 3, lat: 4 } }));\n * ```\n */\nexport function routeText(route) {\n    const four = (n) => String(Math.round(n * 10_000) / 10_000);\n    return `${four(route.from.lon)},${four(route.from.lat)},${four(route.to.lon)},${four(route.to.lat)}`;\n}\n","// The two looks the globe is drawn in, the same line colours as hako-devices and uchusen-rockets: one table entry each,\n// a look changes lines and fills, never the geometry. Pure.\n/**\n * The looks the globe is drawn in, by name: `line` (thin outlines) and `thick`.\n *\n * @example\n * ```ts\n * import { STYLES } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * console.log(Object.keys(STYLES), STYLES.line.ocean);\n * ```\n */\nexport const STYLES = {\n    line: { line: \"#8fa1b8\", ocean: \"#0b1424\", land: \"#13203a\", outline: 0.5, horizon: 1, graticule: 0.3 },\n    thick: { line: \"#b4c2d4\", ocean: \"#0b1424\", land: \"#1a2b47\", outline: 1.2, horizon: 2, graticule: 0.5 },\n};\n/**\n * The style a drawing is in when none is named.\n *\n * @example\n * ```ts\n * import { DEFAULT_STYLE } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * console.log(DEFAULT_STYLE);\n * ```\n */\nexport const DEFAULT_STYLE = \"line\";\n/**\n * Every style's name, in the order they are listed.\n *\n * @example\n * ```ts\n * import { STYLE_NAMES } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * console.log(STYLE_NAMES.join(\", \"));\n * ```\n */\nexport const STYLE_NAMES = Object.keys(STYLES);\n/**\n * A value from outside (an attribute, a query parameter) as a style's name: the default for anything else.\n *\n * @param value - Anything.\n * @returns A valid style name; {@link DEFAULT_STYLE} when `value` names none.\n *\n * @example\n * ```ts\n * import { cleanStyle } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * console.log(cleanStyle(\"thick\"), cleanStyle(\"neon\"), cleanStyle(null));\n * ```\n */\nexport const cleanStyle = (value) => typeof value === \"string\" && Object.hasOwn(STYLES, value) ? value : DEFAULT_STYLE;\n","/**\n * The view when it opens: the home centre, upright, at 1x with no pan.\n *\n * @example\n * ```ts\n * import { HOME_VIEW } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * console.log(HOME_VIEW);\n * ```\n */\nexport const HOME_VIEW = Object.freeze({ yaw: 0, tilt: 0, zoom: 1, panX: 0, panY: 0 });\n/**\n * The radius of an unzoomed globe in a square of `size` pixels.\n *\n * @param size - The width and height of the square, in pixels.\n * @returns The radius in pixels, one less than half the size so the rim is not cut off.\n *\n * @example\n * ```ts\n * import { globeBaseScale } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * console.log(globeBaseScale(420));\n * ```\n */\nexport const globeBaseScale = (size) => size / 2 - 1;\n/**\n * Where the view is centred on the globe: the home centre, turned by yaw (west) and tipped by tilt (south), held to the poles; a drag right is yaw and a drag up is tilt, and the ground follows the pointer.\n *\n * @param centre - The home centre.\n * @param view - The turn, tip, zoom and pan from the view controls.\n * @returns The place now in the middle of the disc.\n *\n * @example\n * ```ts\n * import { lookAt } from \"@johnmorrisdotca/chikyu-earth/realistic\";\n *\n * console.log(lookAt({ lon: 10, lat: 80 }, { yaw: 25, tilt: 30, zoom: 1, panX: 0, panY: 0 }));\n * ```\n */\nexport const lookAt = (centre, view) => ({\n    lon: centre.lon - view.yaw,\n    lat: Math.max(-90, Math.min(90, centre.lat - view.tilt)),\n});\n/**\n * What the projection is given for a view: yaw turns longitude, tilt tips latitude, zoom scales and pan moves the disc in CSS pixels.\n *\n * @param centre - The home centre.\n * @param size - The width and height of the square the globe is drawn in, in pixels.\n * @param view - The turn, tip, zoom and pan; the home view when left out.\n * @returns The rotation, scale and translation for d3-geo's orthographic projection.\n *\n * @example\n * ```ts\n * import { projectionView } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * console.log(projectionView({ lon: 139.7, lat: 35.7 }, 420, { yaw: 10, tilt: 5, zoom: 2, panX: 0, panY: 0 }));\n * ```\n */\nexport function projectionView(centre, size, view = HOME_VIEW) {\n    return {\n        rotation: [-centre.lon + view.yaw, -centre.lat + view.tilt],\n        scale: globeBaseScale(size) * view.zoom,\n        translate: [size / 2 + view.panX, size / 2 + view.panY],\n    };\n}\n","// Draw the globe as one SVG string: an orthographic disc, the country outlines on it, and the rim. Pure: the same\n// arguments always give the same markup, so it works on a server, in a test, or in the element.\nimport { geoGraticule10, geoOrthographic, geoPath } from \"d3-geo\";\nimport { COUNTRIES } from \"./countries.js\";\nimport { routePoints, routeRuns } from \"./route.js\";\nimport { cleanStyle, STYLES } from \"./styles.js\";\nimport { projectionView } from \"./view.js\";\nconst SPHERE = { type: \"Sphere\" };\n/**\n * The globe as an SVG string, turned to `rotation` and drawn in `style`, `size` pixels square. It is pure: the same options always give the same markup, so it runs on a server, in a test or in a build step with no DOM.\n *\n * @param options - Size, turn, look and graticule; every one has a default, so `globe()` draws a 320-pixel globe facing the Greenwich meridian.\n * @returns One `<svg>` element as text, with the country outlines as paths.\n *\n * @example\n * ```ts\n * import { globe } from \"@johnmorrisdotca/chikyu-earth\";\n *\n * const svg = globe({ size: 240, rotation: [-139.7, -35.7], style: \"line\" });\n * console.log(svg.slice(0, 60));\n * console.log(svg.length > 10_000);\n * ```\n */\nexport function globe(options = {}) {\n    const size = options.size ?? 320;\n    const style = STYLES[cleanStyle(options.style)];\n    const view = options.view\n        ? projectionView(options.centre ?? { lon: 0, lat: 0 }, size, options.view)\n        : { rotation: (options.rotation ?? [0, 0]), scale: size / 2 - 1, translate: [size / 2, size / 2] };\n    const projection = geoOrthographic()\n        .rotate(view.rotation)\n        .translate(view.translate)\n        .scale(view.scale)\n        .precision(0.5);\n    const path = geoPath(projection);\n    const horizon = path(SPHERE) ?? \"\";\n    const parts = [];\n    parts.push(`<path d=\"${horizon}\" fill=\"${style.ocean}\"/>`);\n    if (options.graticule) {\n        const d = path(geoGraticule10());\n        if (d)\n            parts.push(`<path d=\"${d}\" fill=\"none\" stroke=\"${style.line}\" stroke-width=\"${style.graticule}\" stroke-opacity=\"0.35\"/>`);\n    }\n    for (const feature of COUNTRIES.features) {\n        const d = path(feature);\n        if (d)\n            parts.push(`<path d=\"${d}\" fill=\"${style.land}\" stroke=\"${style.line}\" stroke-width=\"${style.outline}\" stroke-linejoin=\"round\"/>`);\n    }\n    if (options.route) {\n        const runs = routeRuns(routePoints(options.route.from, options.route.to));\n        const d = path({ type: \"MultiLineString\", coordinates: runs.map((run) => run.map((place) => [place.lon, place.lat])) });\n        if (d)\n            parts.push(`<path d=\"${d}\" fill=\"none\" stroke=\"#7df9ff\" stroke-width=\"1.5\" stroke-linejoin=\"round\"/>`);\n    }\n    parts.push(`<path d=\"${horizon}\" fill=\"none\" stroke=\"${style.line}\" stroke-width=\"${style.horizon}\"/>`);\n    return (`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 ${size} ${size}\" width=\"${size}\" height=\"${size}\" ` +\n        `role=\"img\" aria-label=\"The Earth, a globe of country outlines\" stroke-linecap=\"round\">${parts.join(\"\")}</svg>`);\n}\n","// Where a point on the Earth lands on a screen, for the orthographic view both looks share. Pure.\nconst RAD = Math.PI / 180;\n/**\n * Project a longitude and latitude (degrees) to the screen. `z` is the cosine of the angle from the middle of the disc: above 0 the point faces\n * the viewer, below it is on the far side. North is up.\n *\n * @param lon - Longitude in degrees east.\n * @param lat - Latitude in degrees north.\n * @param pose - The view.\n * @returns The point's x and y in pixels and `z`, the cosine of its angle from the middle of the disc.\n *\n * @example\n * ```ts\n * import { project } from \"@johnmorrisdotca/chikyu-earth/markers\";\n *\n * const where = project(139.69, 35.69, { lon: 139.69, lat: 35.69, radius: 200, cx: 210, cy: 210 });\n * console.log(where.x, where.y, where.z);\n * ```\n */\nexport function project(lon, lat, pose) {\n    const phi = lat * RAD;\n    const phi0 = pose.lat * RAD;\n    const delta = (lon - pose.lon) * RAD;\n    const cosPhi = Math.cos(phi);\n    const z = Math.sin(phi0) * Math.sin(phi) + Math.cos(phi0) * cosPhi * Math.cos(delta);\n    return {\n        x: pose.cx + pose.radius * cosPhi * Math.sin(delta),\n        y: pose.cy - pose.radius * (Math.cos(phi0) * Math.sin(phi) - Math.sin(phi0) * cosPhi * Math.cos(delta)),\n        z,\n    };\n}\n/**\n * Project many points into flat arrays (reused between calls); `z` is the cosine used for a point's facing test.\n *\n * @param lons - Longitudes in degrees.\n * @param lats - Latitudes in degrees.\n * @param count - How many points to project.\n * @param pose - The view.\n * @param xs - Filled with each point's x in pixels.\n * @param ys - Filled with each point's y in pixels.\n * @param zs - Filled with each point's `z`: above 0 it faces the viewer.\n *\n * @example\n * ```ts\n * import { projectAll } from \"@johnmorrisdotca/chikyu-earth/markers\";\n *\n * const xs = new Float32Array(2);\n * const ys = new Float32Array(2);\n * const zs = new Float32Array(2);\n * projectAll([0, 180], [0, 0], 2, { lon: 0, lat: 0, radius: 100, cx: 100, cy: 100 }, xs, ys, zs);\n * console.log(zs[0], zs[1]);\n * ```\n */\nexport function projectAll(lons, lats, count, pose, xs, ys, zs) {\n    const phi0 = pose.lat * RAD;\n    const sin0 = Math.sin(phi0);\n    const cos0 = Math.cos(phi0);\n    for (let i = 0; i < count; i += 1) {\n        const phi = lats[i] * RAD;\n        const delta = (lons[i] - pose.lon) * RAD;\n        const sinPhi = Math.sin(phi);\n        const cosPhi = Math.cos(phi);\n        const cosDelta = Math.cos(delta);\n        zs[i] = sin0 * sinPhi + cos0 * cosPhi * cosDelta;\n        xs[i] = pose.cx + pose.radius * cosPhi * Math.sin(delta);\n        ys[i] = pose.cy - pose.radius * (cos0 * sinPhi - sin0 * cosPhi * cosDelta);\n    }\n}\n/**\n * The pixel ratio for an overlay canvas: the device's, to 2, held to 4096 a side and 6 million pixels (the same budget as the 3D canvas).\n *\n * @param width - The canvas's width in CSS pixels.\n * @param height - The canvas's height in CSS pixels.\n * @param deviceRatio - The device's pixel ratio.\n * @param maxSide - The most pixels on a side.\n * @param maxPixels - The most pixels in all.\n * @returns The ratio to draw at, between 0.1 and 2.\n *\n * @example\n * ```ts\n * import { canvasRatio } from \"@johnmorrisdotca/chikyu-earth/markers\";\n *\n * console.log(canvasRatio(420, 420, 3), canvasRatio(5000, 3000, 2));\n * ```\n */\nexport function canvasRatio(width, height, deviceRatio, maxSide = 4096, maxPixels = 6_000_000) {\n    let ratio = Math.min(Math.max(deviceRatio, 1), 2);\n    ratio = Math.min(ratio, maxSide / Math.max(width, 1), maxSide / Math.max(height, 1));\n    const pixels = width * height * ratio * ratio;\n    if (pixels > maxPixels)\n        ratio *= Math.sqrt(maxPixels / pixels);\n    return Math.max(0.1, ratio);\n}\n","// Which cities are named on the Earth, and where: tiers by how large the Earth is on the screen, the most populous first, each name beside its dot where nothing is in the way. Pure.\nimport { placeLabels } from \"../markers/labels.js\";\n/**\n * The Earth's radius on the screen, in pixels, from which each tier is shown: the capitals 60, the cities of a million 170, those of 100,000 420.\n *\n * @example\n * ```ts\n * import { TIER_RADIUS } from \"@johnmorrisdotca/chikyu-earth/realistic\";\n *\n * console.log(TIER_RADIUS.capitals, TIER_RADIUS[\"1m\"], TIER_RADIUS[\"100k\"]);\n * ```\n */\nexport const TIER_RADIUS = { capitals: 60, \"1m\": 170, \"100k\": 420 };\n/** The most cities looked at at one draw: the most populous in sight; the rest cannot have room for a name. */\nconst CANDIDATES = 400;\n/**\n * The tiers of cities a view of this size shows: none while the Earth is small, the capitals, then the cities of a million, then those of 100,000 as it grows.\n *\n * @param radius - The Earth's radius on the screen, in CSS pixels.\n * @returns The tiers, smallest first.\n *\n * @example\n * ```ts\n * import { cityTiersFor } from \"@johnmorrisdotca/chikyu-earth/realistic\";\n *\n * console.log(cityTiersFor(30), cityTiersFor(200), cityTiersFor(900));\n * ```\n */\nexport function cityTiersFor(radius) {\n    const tiers = [];\n    for (const tier of [\"capitals\", \"1m\", \"100k\"])\n        if (radius >= TIER_RADIUS[tier])\n            tiers.push(tier);\n    return tiers;\n}\n/**\n * How much a city counts when names crowd: its people, and a bonus for the capital of a country (2 million), another seat of government (1 million) and the capital of a subdivision (100,000).\n *\n * @param city - The city.\n * @returns The rank; higher is named first.\n *\n * @example\n * ```ts\n * import { cityRank } from \"@johnmorrisdotca/chikyu-earth/realistic\";\n *\n * console.log(cityRank({ population: 5_700, capital: \"national\" }), cityRank({ population: 5_700, capital: null }));\n * ```\n */\nexport function cityRank(city) {\n    const bonus = city.capital === \"national\" ? 2_000_000 : city.capital === \"alternate\" ? 1_000_000 : city.capital === \"subdivision\" ? 100_000 : 0;\n    return (city.population ?? 0) + bonus;\n}\n/**\n * The name to write for a city: Japanese on a page in Japanese where kuni has it (the short form, 東京 for 東京都, when kuni gives one), else English.\n *\n * @param city - The city.\n * @param lang - The page's language, `en` or `ja`.\n * @returns The name.\n *\n * @example\n * ```ts\n * import { cityNameText } from \"@johnmorrisdotca/chikyu-earth/realistic\";\n *\n * const osaka = { name: { en: \"Osaka\", ja: \"大阪市\" } };\n * console.log(cityNameText(osaka, \"en\"), cityNameText(osaka, \"ja\"), cityNameText({ name: { en: \"Paris\" } }, \"ja\"));\n * ```\n */\nexport function cityNameText(city, lang) {\n    return (lang === \"ja\" ? (city.name.jaShort ?? city.name.ja) : undefined) ?? city.name.en;\n}\n/**\n * About how wide a name is, in pixels, without reading any layout: a Japanese character is as wide as the text is tall, any other about 0.58 of it.\n *\n * @param text - The name.\n * @param size - The text size in pixels.\n * @returns The width, in pixels.\n *\n * @example\n * ```ts\n * import { nameWidth } from \"@johnmorrisdotca/chikyu-earth/realistic\";\n *\n * console.log(nameWidth(\"Tokyo\", 12), nameWidth(\"東京\", 12));\n * ```\n */\nexport function nameWidth(text, size) {\n    let width = 0;\n    for (const char of text)\n        width += (char.codePointAt(0) ?? 0) >= 0x2e80 ? size : size * 0.58;\n    return Math.ceil(width) + 4;\n}\n/**\n * Lays the names out for one draw: the cities in sight, the most important first, each named beside its dot (right, then left, above, below) where no earlier name is in the way; a city with no room is left out.\n *\n * @param cities - The cities of the tiers shown, the highest rank first (see {@link cityRank}).\n * @param frame - Where the Earth is on the screen.\n * @param lang - The page's language, `en` or `ja`.\n * @param options - The most names, the text size and the dot's radius.\n * @returns The names to show, the most important first.\n *\n * @example\n * ```ts\n * import { layoutCities } from \"@johnmorrisdotca/chikyu-earth/realistic\";\n *\n * const frame = { width: 300, height: 300, radius: 120, project: (lon: number, lat: number, out: { x: number; y: number }) => { out.x = 150 + (lon - 133) * 6; out.y = 150 - (lat - 36) * 6; return 1; } };\n * const tokyo = { id: \"Q1490\", name: { en: \"Tokyo\", ja: \"東京都\" }, lat: 35.7, lon: 139.7, population: 37_000_000, capital: \"national\" as const };\n * const seoul = { id: \"Q8684\", name: { en: \"Seoul\" }, lat: 37.6, lon: 127, population: 10_000_000, capital: \"national\" as const };\n * console.log(layoutCities([tokyo, seoul], frame, \"en\", { max: 10, size: 12, dot: 3 }).map((one) => one.text));\n * ```\n */\nexport function layoutCities(cities, frame, lang, options) {\n    const facing = options.facing ?? 0.12;\n    const out = { x: 0, y: 0 };\n    const margin = options.dot + 2;\n    const seen = [];\n    for (const city of cities) {\n        if (seen.length >= CANDIDATES)\n            break;\n        if (frame.project(city.lon, city.lat, out) < facing)\n            continue;\n        if (out.x < margin || out.y < margin || out.x > frame.width - margin || out.y > frame.height - margin)\n            continue;\n        seen.push({ city, x: out.x, y: out.y });\n    }\n    const height = Math.ceil(options.size * 1.35);\n    const texts = seen.map((one) => cityNameText(one.city, lang));\n    const items = seen.map((one, index) => ({ x: one.x, y: one.y, r: options.dot, w: Math.max(nameWidth(texts[index], options.size), options.measure ? Math.ceil(options.measure(texts[index])) + 4 : 0), h: height, priority: seen.length - index }));\n    return placeLabels(items, frame.width, frame.height, options.max, 64, options.taken).map((place) => {\n        const one = seen[place.item];\n        return { city: one.city, text: texts[place.item], x: one.x, y: one.y, left: place.left, top: place.top, width: items[place.item].w, height };\n    });\n}\n/**\n * The most names `city-names` may ask for at once.\n *\n * @example\n * ```ts\n * import { CITY_NAMES_MAX } from \"@johnmorrisdotca/chikyu-earth/realistic\";\n *\n * console.log(CITY_NAMES_MAX);\n * ```\n */\nexport const CITY_NAMES_MAX = 80;\n/**\n * How many names a bare `city-names` asks for.\n *\n * @example\n * ```ts\n * import { CITY_NAMES_DEFAULT } from \"@johnmorrisdotca/chikyu-earth/realistic\";\n *\n * console.log(CITY_NAMES_DEFAULT);\n * ```\n */\nexport const CITY_NAMES_DEFAULT = 24;\n/**\n * Reads the `city-names` attribute: absent is off, bare is 24 names, a number is that many names (1 to 80).\n *\n * @param value - The attribute's value, or `null` when it is absent.\n * @returns How many names at most, or `null` for none.\n *\n * @example\n * ```ts\n * import { readCityNames } from \"@johnmorrisdotca/chikyu-earth/realistic\";\n *\n * console.log(readCityNames(null), readCityNames(\"\"), readCityNames(\"12\"), readCityNames(\"500\"), readCityNames(\"many\"));\n * ```\n */\nexport function readCityNames(value) {\n    if (value === null)\n        return null;\n    const count = Number(value.trim());\n    if (value.trim() === \"\" || !Number.isFinite(count))\n        return CITY_NAMES_DEFAULT;\n    return Math.min(CITY_NAMES_MAX, Math.max(1, Math.round(count)));\n}\n","/**\n * The oceans, seas, gulfs, bays and continents that can be named, each with the point its name is set at.\n *\n * @example\n * ```ts\n * import { SEA_FEATURES } from \"@johnmorrisdotca/chikyu-earth/realistic\";\n *\n * console.log(SEA_FEATURES.find((one) => one.id === \"africa\")?.name.en);\n * ```\n */\nexport const SEA_FEATURES = [\n    { id: \"arctic-ocean\", kind: \"ocean\", lon: -178.50, lat: 87.71, name: { en: \"Arctic Ocean\", ja: \"北極海\" } },\n    { id: \"southern-ocean\", kind: \"ocean\", lon: -88.50, lat: -70.76, name: { en: \"Southern Ocean\", ja: \"南極海\" } },\n    { id: \"atlantic-ocean\", kind: \"ocean\", lon: -28.59, lat: -5.03, name: { en: \"Atlantic Ocean\", ja: \"大西洋\" } },\n    { id: \"pacific-ocean\", kind: \"ocean\", lon: -145.50, lat: -8.03, name: { en: \"Pacific Ocean\", ja: \"太平洋\" } },\n    { id: \"indian-ocean\", kind: \"ocean\", lon: 81.12, lat: -38.03, name: { en: \"Indian Ocean\", ja: \"インド洋\" } },\n    { id: \"south-america\", kind: \"continent\", lon: -59.34, lat: -19.88, name: { en: \"South America\", ja: \"南アメリカ\" } },\n    { id: \"australia\", kind: \"continent\", lon: 139.18, lat: -25.15, name: { en: \"Australia\", ja: \"オーストラリア大陸\" } },\n    { id: \"africa\", kind: \"continent\", lon: 16.50, lat: 7.21, name: { en: \"Africa\", ja: \"アフリカ\" } },\n    { id: \"antarctica\", kind: \"continent\", lon: 34.00, lat: -88.00, name: { en: \"Antarctica\", ja: \"南極大陸\" } },\n    { id: \"asia\", kind: \"continent\", lon: 96.10, lat: 47.33, name: { en: \"Asia\", ja: \"アジア\" } },\n    { id: \"europe\", kind: \"continent\", lon: 20.52, lat: 54.03, name: { en: \"Europe\", ja: \"ヨーロッパ\" } },\n    { id: \"north-america\", kind: \"continent\", lon: -102.09, lat: 61.65, name: { en: \"North America\", ja: \"北アメリカ\" } },\n    { id: \"black-sea\", kind: \"sea\", lon: 34.98, lat: 42.42, name: { en: \"Black Sea\", ja: \"黒海\" } },\n    { id: \"philippine-sea\", kind: \"sea\", lon: 134.32, lat: 19.12, name: { en: \"Philippine Sea\", ja: \"フィリピン海\" } },\n    { id: \"tasman-sea\", kind: \"sea\", lon: 159.86, lat: -40.29, name: { en: \"Tasman Sea\", ja: \"タスマン海\" } },\n    { id: \"bay-of-bengal\", kind: \"bay\", lon: 87.19, lat: 13.02, name: { en: \"Bay of Bengal\", ja: \"ベンガル湾\" } },\n    { id: \"south-china-sea\", kind: \"sea\", lon: 112.85, lat: 10.28, name: { en: \"South China Sea\", ja: \"南シナ海\" } },\n    { id: \"arabian-sea\", kind: \"sea\", lon: 64.53, lat: 12.82, name: { en: \"Arabian Sea\", ja: \"アラビア海\" } },\n    { id: \"beaufort-sea\", kind: \"sea\", lon: -137.07, lat: 70.71, name: { en: \"Beaufort Sea\", ja: \"ボーフォート海\" } },\n    { id: \"caribbean-sea\", kind: \"sea\", lon: -74.85, lat: 15.99, name: { en: \"Caribbean Sea\", ja: \"カリブ海\" } },\n    { id: \"gulf-of-mexico\", kind: \"gulf\", lon: -90.36, lat: 25.30, name: { en: \"Gulf of Mexico\", ja: \"メキシコ湾\" } },\n    { id: \"labrador-sea\", kind: \"sea\", lon: -54.27, lat: 54.96, name: { en: \"Labrador Sea\", ja: \"ラブラドル海\" } },\n    { id: \"hudson-bay\", kind: \"bay\", lon: -84.46, lat: 59.20, name: { en: \"Hudson Bay\", ja: \"ハドソン湾\" } },\n    { id: \"caspian-sea\", kind: \"sea\", lon: 51.21, lat: 41.11, name: { en: \"Caspian Sea\", ja: \"カスピ海\" } },\n    { id: \"baffin-bay\", kind: \"bay\", lon: -65.57, lat: 74.42, name: { en: \"Baffin Bay\", ja: \"バフィン湾\" } },\n    { id: \"gulf-of-alaska\", kind: \"gulf\", lon: -149.88, lat: 58.55, name: { en: \"Gulf of Alaska\", ja: \"アラスカ湾\" } },\n    { id: \"red-sea\", kind: \"sea\", lon: 38.33, lat: 22.96, name: { en: \"Red Sea\", ja: \"紅海\" } },\n    { id: \"sea-of-okhotsk\", kind: \"sea\", lon: 147.72, lat: 50.78, name: { en: \"Sea of Okhotsk\", ja: \"オホーツク海\" } },\n    { id: \"weddell-sea\", kind: \"sea\", lon: -46.28, lat: -75.96, name: { en: \"Weddell Sea\", ja: \"ウェッデル海\" } },\n    { id: \"persian-gulf\", kind: \"gulf\", lon: 52.22, lat: 25.47, name: { en: \"Persian Gulf\", ja: \"ペルシア湾\" } },\n    { id: \"mediterranean-sea\", kind: \"sea\", lon: 20.41, lat: 35.33, name: { en: \"Mediterranean Sea\", ja: \"地中海\" } },\n    { id: \"ross-sea\", kind: \"sea\", lon: -169.50, lat: -77.69, name: { en: \"Ross Sea\", ja: \"ロス海\" } },\n    { id: \"coral-sea\", kind: \"sea\", lon: 156.28, lat: -19.38, name: { en: \"Coral Sea\", ja: \"珊瑚海\" } },\n    { id: \"sea-of-japan\", kind: \"sea\", lon: 135.81, lat: 41.78, name: { en: \"Sea of Japan\", ja: \"日本海\" } },\n];\n","import { nameWidth } from \"../cities/geometry.js\";\nimport { SEA_FEATURES } from \"./features.js\";\nexport { SEA_FEATURES };\n/**\n * The Earth's radius, in CSS pixels, at which seas, gulfs and bays join the oceans and continents.\n * Below this the view is the wide Earth: only oceans and continents are named.\n *\n * @example\n * ```ts\n * import { SEA_RADIUS } from \"@johnmorrisdotca/chikyu-earth/realistic\";\n *\n * console.log(SEA_RADIUS > 200);\n * ```\n */\nexport const SEA_RADIUS = 280;\n/** Space between the letters of a water name, as a share of the text size. Continents use a little less. */\nexport const SEA_LETTER_SPACING = 0.22;\nexport const LAND_LETTER_SPACING = 0.06;\nconst WATER = new Set([\"ocean\", \"sea\", \"gulf\", \"bay\"]);\nconst FACING = 0.25;\nconst MAX = 18;\n/**\n * The names a view of this size may show: oceans and continents while the Earth is small, and seas, gulfs and bays once it is at least {@link SEA_RADIUS} pixels in radius.\n *\n * @param radius - The Earth's radius on the screen, in CSS pixels.\n * @returns The features, oceans and continents first.\n *\n * @example\n * ```ts\n * import { seaNamesFor } from \"@johnmorrisdotca/chikyu-earth/realistic\";\n *\n * console.log(seaNamesFor(120).some((one) => one.id === \"pacific-ocean\"));\n * console.log(seaNamesFor(120).some((one) => one.id === \"sea-of-japan\"));\n * console.log(seaNamesFor(400).some((one) => one.id === \"mediterranean-sea\"));\n * ```\n */\nexport function seaNamesFor(radius) {\n    const wide = SEA_FEATURES.filter((one) => one.kind === \"ocean\" || one.kind === \"continent\");\n    if (radius < SEA_RADIUS)\n        return wide;\n    return SEA_FEATURES;\n}\n/**\n * Reads the `sea-names` attribute. Absent or `off` is off. A bare attribute, or any other value, is on.\n *\n * @param value - The attribute's value, or null when it is absent.\n * @returns Whether the names are on.\n *\n * @example\n * ```ts\n * import { readSeaNames } from \"@johnmorrisdotca/chikyu-earth/realistic\";\n *\n * console.log(readSeaNames(null), readSeaNames(\"\"), readSeaNames(\"off\"));\n * ```\n */\nexport function readSeaNames(value) {\n    return value !== null && value !== \"off\";\n}\n/** The attributes the elements watch for these names. */\nexport const SEA_NAMES_ATTRIBUTES = [\"sea-names\"];\nconst spacingOf = (kind) => (WATER.has(kind) ? SEA_LETTER_SPACING : LAND_LETTER_SPACING);\nconst boxOf = (text, size, spacing) => {\n    let width = 0;\n    for (const char of text)\n        width += ((char.codePointAt(0) ?? 0) >= 0x2e80 ? size : size * 0.58) + size * spacing;\n    return { width: Math.ceil(Math.max(width, nameWidth(text, size))) + 4, height: Math.ceil(size * 1.35) };\n};\n/**\n * Lays the names out for one draw. A name on the far side, or off the Earth's disc, is left out. A box in `taken` (a city name, a place, a country) keeps its space: the name moves aside, and if the only room is taken it is left out, so a city that was placed first wins.\n *\n * @param radius - The Earth's radius on the screen. It chooses oceans and continents, or those plus the seas.\n * @param frame - Where the Earth is, and how to project a place. `project` returns how squarely the place faces the viewer.\n * @param lang - `en` or `ja`.\n * @param taken - Boxes already used. A name is not put over one.\n * @returns The names to show.\n *\n * @example\n * ```ts\n * import { layoutSeaNames } from \"@johnmorrisdotca/chikyu-earth/realistic\";\n *\n * const frame = { width: 400, height: 400, radius: 160, project: (lon: number, lat: number, out: { x: number; y: number }) => { out.x = 200 + lon; out.y = 200 - lat; return 1; } };\n * console.log(layoutSeaNames(160, frame, \"en\", []).some((one) => one.id === \"africa\"));\n * ```\n */\nexport function layoutSeaNames(radius, frame, lang, taken) {\n    const out = { x: 0, y: 0 };\n    const disc = frame.disc;\n    const blocked = taken.map((box) => ({ l: box.left, t: box.top, r: box.left + box.width, b: box.top + box.height }));\n    const placed = [];\n    const hits = (box, others) => {\n        for (const other of others)\n            if (box.l < other.r && box.r > other.l && box.t < other.b && box.b > other.t)\n                return true;\n        return false;\n    };\n    const inDisc = (box) => {\n        if (!disc)\n            return true;\n        const reach = disc.radius - 2;\n        return Math.hypot(box.l - disc.x, box.t - disc.y) <= reach && Math.hypot(box.r - disc.x, box.t - disc.y) <= reach && Math.hypot(box.l - disc.x, box.b - disc.y) <= reach && Math.hypot(box.r - disc.x, box.b - disc.y) <= reach;\n    };\n    const names = [];\n    const features = [...seaNamesFor(radius)].sort((a, b) => rank(b) - rank(a));\n    for (const feature of features) {\n        if (names.length >= MAX)\n            break;\n        const facing = frame.project(feature.lon, feature.lat, out);\n        if (facing < FACING)\n            continue;\n        const text = lang === \"ja\" ? feature.name.ja : feature.name.en;\n        const size = feature.kind === \"ocean\" || feature.kind === \"continent\" ? 14 : 12;\n        const { width, height } = boxOf(text, size, spacingOf(feature.kind));\n        const shifts = [\n            [-width / 2, -height / 2],\n            [8, -height / 2],\n            [-width - 8, -height / 2],\n            [-width / 2, -height - 6],\n            [-width / 2, 8],\n        ];\n        for (const [dx, dy] of shifts) {\n            const left = out.x + dx;\n            const top = out.y + dy;\n            const box = { l: left, t: top, r: left + width, b: top + height };\n            if (box.l < 0 || box.t < 0 || box.r > frame.width || box.b > frame.height)\n                continue;\n            if (!inDisc(box) || hits(box, blocked) || hits(box, placed))\n                continue;\n            placed.push(box);\n            names.push({ id: feature.id, kind: feature.kind, text, left, top, width, height, size });\n            break;\n        }\n    }\n    return names;\n}\nconst rank = (feature) => (feature.kind === \"sea\" || feature.kind === \"gulf\" || feature.kind === \"bay\" ? 3 : feature.kind === \"continent\" ? 2 : 1);\n","// Names of oceans, seas and continents over an element's picture. The element tells this where the Earth is at each draw. Nothing is added until `sea-names` is on, and nothing is drawn at rest.\nimport { LAND_LETTER_SPACING, SEA_LETTER_SPACING, layoutSeaNames, readSeaNames } from \"./geometry.js\";\n/** The styles of the layer (`#sea-names` in the element's shadow root). Water is spaced out; continents a little less. */\nexport const SEA_NAMES_STYLE = \"#sea-names{position:absolute;inset:0;overflow:hidden;pointer-events:none}\" +\n    \".sea-name{position:absolute;left:0;top:0;margin:0;white-space:nowrap;text-align:center;pointer-events:none;will-change:transform;\" +\n    \"font-family:var(--chikyu-sea-font,system-ui,-apple-system,'Segoe UI',sans-serif);font-weight:500;color:var(--chikyu-sea-colour,rgba(186,214,228,.9));\" +\n    `letter-spacing:${SEA_LETTER_SPACING}em;` +\n    \"text-shadow:0 0 3px #061018,0 0 3px #061018}\" +\n    `.sea-name[data-kind=continent]{letter-spacing:${LAND_LETTER_SPACING}em;color:var(--chikyu-land-colour,rgba(232,224,200,.92))}` +\n    \".sea-name[hidden]{display:none}\";\n/**\n * Makes the layer of one element. Nothing is added to the root until `sea-names` is on.\n *\n * @param options - The attribute reader, the language and the shadow root.\n * @returns The host.\n */\nexport function createSeaHost(options) {\n    const { root } = options;\n    const doc = root.ownerDocument;\n    let on = readSeaNames(options.attribute(\"sea-names\"));\n    let last = null;\n    let taken = [];\n    let shown = [];\n    let renders = 0;\n    let box;\n    const pool = [];\n    const attach = () => {\n        if (box)\n            return;\n        box = doc.createElement(\"div\");\n        box.id = \"sea-names\";\n        box.setAttribute(\"aria-hidden\", \"true\");\n        const cities = root.getElementById(\"cn-canvas\");\n        if (cities)\n            root.insertBefore(box, cities);\n        else\n            root.append(box);\n    };\n    const clear = () => {\n        for (const name of pool)\n            name.hidden = true;\n        shown = [];\n    };\n    const place = () => {\n        if (!box)\n            return;\n        renders += 1;\n        while (pool.length < shown.length) {\n            const name = doc.createElement(\"span\");\n            name.className = \"sea-name\";\n            box.append(name);\n            pool.push(name);\n        }\n        pool.forEach((name, index) => {\n            const one = shown[index];\n            if (!one) {\n                name.hidden = true;\n                return;\n            }\n            name.hidden = false;\n            name.dataset[\"kind\"] = one.kind;\n            name.textContent = one.text;\n            name.style.fontSize = `${one.size}px`;\n            name.style.transform = `translate(${one.left}px, ${one.top}px)`;\n        });\n    };\n    const compute = () => {\n        if (!on || !last) {\n            clear();\n            if (box)\n                place();\n            return;\n        }\n        attach();\n        shown = layoutSeaNames(last.radius, last, options.language(), taken);\n        place();\n    };\n    return {\n        frame(frame, next = []) {\n            last = frame;\n            taken = next;\n            compute();\n        },\n        refresh() {\n            on = readSeaNames(options.attribute(\"sea-names\"));\n            if (!on) {\n                clear();\n                box?.remove();\n                box = undefined;\n                pool.length = 0;\n                return;\n            }\n            compute();\n        },\n        get shown() {\n            return shown;\n        },\n        get boxes() {\n            return shown.map((one) => ({ left: one.left, top: one.top, width: one.width, height: one.height }));\n        },\n        get stats() {\n            return { on, radius: last?.radius ?? 0, names: on ? shown.length : 0, renders };\n        },\n        dispose() {\n            clear();\n            box?.remove();\n            box = undefined;\n            on = false;\n        },\n    };\n}\n","// <chikyu-earth>: the globe as a web component. A shared view controller supplies its yaw, tilt, zoom and pan;\n// it opens centred on the `center` attribute (0,0 without one) and never asks the browser where the reader is. Importing registers it once.\nimport { carryControls } from \"@johnmorrisdotca/kazoku-ui/view-controls\";\nimport { adoptStyles } from \"./adopt.js\";\nimport { globe } from \"./globe.js\";\nimport { readRoute, routeLeg, routeText } from \"./route.js\";\nimport { cleanStyle } from \"./styles.js\";\nimport { globeBaseScale, HOME_VIEW, lookAt } from \"./view.js\";\nimport { project } from \"./markers/project.js\";\nimport { readSeaNames } from \"./sea-names/geometry.js\";\nimport { SEA_NAMES_STYLE, createSeaHost } from \"./sea-names/host.js\";\nconst readCentre = (value) => {\n    if (!value)\n        return null;\n    const [lon, lat] = value.split(\",\").map((part) => Number(part.trim()));\n    if (!Number.isFinite(lon) || !Number.isFinite(lat))\n        return null;\n    if (Math.abs(lon) > 180 || Math.abs(lat) > 90)\n        return null;\n    return { lon, lat };\n};\n/** The least time between two redraws of the projection while a hand is turning the globe: 30 a second at most. */\nconst LIVE_MS = 1000 / 30;\n/** The automatic turn is slow enough that one redraw a second is smooth. */\nconst AUTO_MS = 1000;\n/** Tilt to the poles; zoom from a tenth of Fit, which leaves the whole globe small in the view, to 20 times: the outlines are Natural Earth 1:110m, and past about 20 times their straight segments are longer than the view is wide. */\nconst LIMITS = { tiltMax: 90, zoomMin: 0.1, zoomMax: 20 };\nconst STYLE = \":host{display:block;position:relative;isolation:isolate}.holder svg{display:block;width:100%;height:auto}.overlay{position:absolute;inset:0;pointer-events:none;transform-origin:50% 50%}\" + SEA_NAMES_STYLE;\n/**\n * The `<chikyu-earth>` custom element: the line globe, drawn as SVG in its shadow root. Importing this entry point registers the tag once. It takes the attributes `size` (pixels, 320 by default), `center` (`\"lon,lat\"`; wins over the browser's location), `look` (`line` or `thick`; `style` is the older name for it, and a framework that reads `style` as CSS cannot use it) and `graticule`, and a shared view controller's camera through `setView`.\n * It carries kazoku-ui's controls itself: a drag turns it, two fingers pinch, Ctrl and the wheel zoom (a plain wheel at Fit scrolls the page) and the arrow keys, + and - work once it is focused, from a tenth of Fit to 20 times. `controls=\"none\"` turns them off; `zoom-min` and `zoom-max` change the range. A `<kazoku-view-controls for=\"...\">` on the element takes the hands over, and the page applies its events with `setView`.\n *\n * @example\n * ```ts no-run\n * import type { ChikyuEarth } from \"@johnmorrisdotca/chikyu-earth/element\";\n *\n * const earth = document.createElement(\"chikyu-earth\") as ChikyuEarth;\n * earth.setAttribute(\"center\", \"139.7,35.7\");\n * earth.setAttribute(\"look\", \"thick\");\n * document.body.append(earth);\n * ```\n */\nexport class ChikyuEarth extends HTMLElement {\n    static observedAttributes = [\"center\", \"look\", \"style\", \"size\", \"graticule\", \"route\", \"sea-names\", \"lang\"];\n    #centre = { lon: 0, lat: 0 };\n    #view = { ...HOME_VIEW };\n    #drawn = { ...HOME_VIEW };\n    #listeners = new Set();\n    #overlay;\n    #seas;\n    #pose = null;\n    #liveTimer;\n    #liveAt = 0;\n    #hands;\n    /** The controller behind the element's own hands (`play`, `set`, `fit`, `state`), while it is in a page. */\n    get controller() {\n        return this.#hands?.controller;\n    }\n    /** Where the view is centred now: the `center` attribute, else 0,0. The element never asks the browser where the reader is. */\n    get centre() {\n        return { ...this.#centre };\n    }\n    /**\n     * A route between two places (the attribute `route`, `lon,lat,lon,lat`). Null, the default, draws none. The line is the WGS84 geodesic, split at the date line.\n     * Setting the property writes the attribute. Nothing is drawn again at rest: the line is part of the picture, which is drawn when the view or the route changes.\n     */\n    get route() {\n        return readRoute(this.getAttribute(\"route\"));\n    }\n    set route(value) {\n        if (!value)\n            this.removeAttribute(\"route\");\n        else\n            this.setAttribute(\"route\", routeText(value));\n    }\n    /**\n     * Names of oceans, seas and continents (the attribute `sea-names`). Off unless set: a bare attribute is on. Oceans and continents from far out, seas once the Earth is large on the screen. Nothing is drawn again at rest.\n     *\n     * @example\n     * ```ts no-run\n     * import type { ChikyuEarth } from \"@johnmorrisdotca/chikyu-earth/element\";\n     *\n     * const earth = document.querySelector(\"chikyu-earth\") as ChikyuEarth;\n     * earth.seaNames = true;\n     * console.log(earth.seaNames);\n     * earth.seaNames = false;\n     * ```\n     */\n    get seaNames() {\n        return readSeaNames(this.getAttribute(\"sea-names\"));\n    }\n    set seaNames(value) {\n        if (value)\n            this.setAttribute(\"sea-names\", \"\");\n        else\n            this.removeAttribute(\"sea-names\");\n    }\n    /**\n     * Whether `sea-names` is on, the Earth's radius on the screen, the names shown, and how many times they were laid out.\n     *\n     * @example\n     * ```ts no-run\n     * import type { ChikyuEarth } from \"@johnmorrisdotca/chikyu-earth/element\";\n     *\n     * const earth = document.querySelector(\"chikyu-earth\") as ChikyuEarth;\n     * console.log(earth.stats.seaNames.on);\n     * ```\n     */\n    get stats() {\n        return { seaNames: this.#seas?.stats ?? { on: false, radius: 0, names: 0, renders: 0 } };\n    }\n    /** The distance, bearings and flight-time estimate for `route`, or null when none is set. The flight time assumes 900 km/h. */\n    get routeInfo() {\n        const route = this.route;\n        return route ? routeLeg(route.from, route.to) : null;\n    }\n    /** A box laid over the globe for markers (see `@johnmorrisdotca/chikyu-earth/markers`): where it is, the pose of the last drawing, and a way to hear the next. */\n    get overlay() {\n        this.#ensureShell();\n        return {\n            overlayRoot: this.#overlay,\n            pose: this.#pose,\n            subscribe: (listener) => {\n                this.#listeners.add(listener);\n                return () => this.#listeners.delete(listener);\n            },\n        };\n    }\n    disconnectedCallback() {\n        clearTimeout(this.#liveTimer);\n        this.#liveTimer = undefined;\n        this.#hands?.unbind();\n        this.#hands = undefined;\n        this.#seas?.dispose();\n        this.#seas = undefined;\n    }\n    connectedCallback() {\n        this.#centre = readCentre(this.getAttribute(\"center\")) ?? { lon: 0, lat: 0 };\n        this.#render();\n        this.#hands = carryControls(this, {\n            initial: this.#view,\n            grabRadius: \"fit\",\n            limits: LIMITS,\n            onChange: (state, info) => this.setView(state, info.final, info.reason !== \"auto\"),\n        });\n    }\n    attributeChangedCallback(name, _old, value) {\n        if (name === \"center\")\n            this.#centre = readCentre(value) ?? { lon: 0, lat: 0 };\n        if (this.isConnected)\n            this.#render();\n    }\n    /**\n     * Apply a shared controller's camera. Every event updates the state; `final: false` makes only the cheap\n     * relative transform, and `final: true` redraws the orthographic projection. `live: true` says a hand is on the view (a drag, a pinch, a key held):\n     * the projection is then also redrawn while it turns, at most 30 times a second, so the globe follows the pointer instead of jumping when it is let go.\n     * The automatic turn leaves `live` off and is drawn about once a second.\n     */\n    setView(view, final = true, live = false) {\n        this.#view = { ...view };\n        if (final) {\n            clearTimeout(this.#liveTimer);\n            this.#liveTimer = undefined;\n            this.#render();\n            return;\n        }\n        const turned = view.yaw !== this.#drawn.yaw || view.tilt !== this.#drawn.tilt;\n        if (!live && turned && performance.now() - this.#liveAt >= AUTO_MS) {\n            this.#render();\n            return;\n        }\n        this.#transform();\n        if (live && turned && this.#liveTimer === undefined) {\n            const wait = Math.max(0, LIVE_MS - (performance.now() - this.#liveAt));\n            this.#liveTimer = setTimeout(() => {\n                this.#liveTimer = undefined;\n                this.#render();\n            }, wait);\n        }\n    }\n    #transform() {\n        const svg = this.shadowRoot?.querySelector(\"svg\");\n        if (!svg)\n            return;\n        const zoom = this.#view.zoom / this.#drawn.zoom;\n        const x = this.#view.panX - this.#drawn.panX;\n        const y = this.#view.panY - this.#drawn.panY;\n        svg.style.transformOrigin = \"50% 50%\";\n        svg.style.transform = zoom === 1 && x === 0 && y === 0 ? \"\" : `translate(${x}px, ${y}px) scale(${zoom})`;\n        this.#publish(svg.style.transform);\n    }\n    /** The shell: the picture's holder and the overlay for markers, made once; a redraw replaces only the picture. */\n    #ensureShell() {\n        const root = this.shadowRoot ?? this.attachShadow({ mode: \"open\" });\n        if (!this.#overlay || !root.contains(this.#overlay)) {\n            root.innerHTML = `<div class=\"holder\"></div><div class=\"overlay\"></div>`;\n            adoptStyles(root, STYLE, this.nonce);\n            this.#overlay = root.querySelector(\".overlay\");\n        }\n        return root;\n    }\n    #publish(transform) {\n        if (this.#listeners.size === 0) {\n            this.#pose = null;\n            return;\n        }\n        const size = Number(this.getAttribute(\"size\")) || 320;\n        const k = (this.clientWidth || size) / size;\n        const look = lookAt(this.#centre, this.#drawn);\n        const pose = {\n            lon: look.lon,\n            lat: look.lat,\n            radius: globeBaseScale(size) * this.#drawn.zoom * k,\n            cx: (size / 2 + this.#drawn.panX) * k,\n            cy: (size / 2 + this.#drawn.panY) * k,\n            width: size * k,\n            height: size * k,\n            transform,\n        };\n        this.#pose = pose;\n        for (const listener of this.#listeners)\n            listener(pose);\n    }\n    #render() {\n        this.#liveAt = performance.now();\n        const size = Number(this.getAttribute(\"size\")) || 320;\n        const style = cleanStyle(this.getAttribute(\"look\") ?? this.getAttribute(\"style\"));\n        const svg = globe({ size, style, centre: this.#centre, view: this.#view, graticule: this.hasAttribute(\"graticule\"), route: readRoute(this.getAttribute(\"route\")) });\n        const root = this.#ensureShell();\n        root.querySelector(\".holder\").innerHTML = svg;\n        this.#drawn = { ...this.#view };\n        this.#publish(\"\");\n        this.#placeSeas();\n    }\n    /** Lays the ocean, sea and continent names on the picture just drawn. Off, or at rest, it adds nothing. */\n    #placeSeas() {\n        const root = this.shadowRoot;\n        if (!root)\n            return;\n        if (!this.#seas) {\n            this.#seas = createSeaHost({\n                root,\n                attribute: (name) => this.getAttribute(name),\n                language: () => ((this.closest(\"[lang]\")?.getAttribute(\"lang\") ?? \"\").toLowerCase().startsWith(\"ja\") ? \"ja\" : \"en\"),\n            });\n        }\n        this.#seas.refresh();\n        if (!readSeaNames(this.getAttribute(\"sea-names\"))) {\n            this.#seas.frame(null);\n            return;\n        }\n        const size = Number(this.getAttribute(\"size\")) || 320;\n        const k = (this.clientWidth || size) / size;\n        const look = lookAt(this.#centre, this.#drawn);\n        const radius = globeBaseScale(size) * this.#drawn.zoom * k;\n        const cx = (size / 2 + this.#drawn.panX) * k;\n        const cy = (size / 2 + this.#drawn.panY) * k;\n        const pose = { lon: look.lon, lat: look.lat, radius, cx, cy };\n        this.#seas.frame({\n            width: size * k,\n            height: size * k,\n            radius,\n            disc: { x: cx, y: cy, radius },\n            project: (lon, lat, out) => {\n                const at = project(lon, lat, pose);\n                out.x = at.x;\n                out.y = at.y;\n                return at.z;\n            },\n        });\n    }\n}\nif (typeof customElements !== \"undefined\" && !customElements.get(\"chikyu-earth\")) {\n    customElements.define(\"chikyu-earth\", ChikyuEarth);\n}\n"]}