{"version":3,"sources":["jsdelivr-header.js","/npm/@scalar/themes@0.19.2/src/utilities/has-obtrusive-scrollbars.ts","/npm/@scalar/themes@0.19.2/src/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,k7qECCA,SAAgB,yBACd,GAAsB,oBAAX,OACT,OAAO,EAIT,MAAM,EAAS,SAAS,cAAc,OACtC,EAAO,aAAa,QAAS,6CAC7B,EAAO,UAAU,IAAI,kBAGrB,MAAM,EAAQ,SAAS,cAAc,OACrC,EAAM,aAAa,QAAS,0BAC5B,EAAO,YAAY,GACnB,SAAS,KAAK,YAAY,GAI1B,MAAM,EAAiB,GADJ,EAAO,WACa,YAIvC,OAFA,SAAS,KAAK,YAAY,KAEjB,CACX,CC4BA,IAAa,SAAW,CACtB,YACA,UACA,OACA,SACA,YACA,aACA,YACA,SACA,SACA,WACA,UACA,OACA,YACA,QAQW,YAAc,CACzB,QAAS,UACT,UAAW,YACX,KAAM,OACN,OAAQ,SACR,UAAW,YACX,SAAU,YACV,QAAS,UACT,WAAY,cACZ,OAAQ,SACR,OAAQ,aACR,KAAM,OACN,UAAW,aACX,UAAW,YACX,KAAM,QAWK,QAAU,CACrB,QAAS,CACP,IAAK,wBACL,KAAM,UACN,YAAa,uBACb,MAAO,gBACP,KAAM,WAER,UAAW,CACT,IAAK,wBACL,KAAM,YACN,YAAa,yBACb,MAAO,kBACP,KAAM,aAER,KAAM,CACJ,IAAK,wBACL,KAAM,OACN,YAAa,eACb,MAAO,aACP,KAAM,QAER,OAAQ,CACN,IAAK,wBACL,KAAM,SACN,YAAa,sBACb,MAAO,eACP,KAAM,UAER,UAAW,CACT,IAAK,wBACL,KAAM,YACN,YAAa,yBACb,MAAO,kBACP,KAAM,aAER,WAAY,CACV,IAAK,wBACL,KAAM,cACN,YAAa,2BACb,MAAO,mBACP,KAAM,eAER,UAAW,CACT,IAAK,wBACL,KAAM,aACN,YAAa,0BACb,MAAO,kBACP,KAAM,cAER,OAAQ,CACN,IAAK,wBACL,KAAM,SACN,YAAa,sBACb,MAAO,eACP,KAAM,UAER,OAAQ,CACN,IAAK,wBACL,KAAM,aACN,YAAa,0BACb,MAAO,eACP,KAAM,cAER,KAAM,CACJ,IAAK,wBACL,KAAM,OACN,YAAa,oBACb,MAAO,aACP,KAAM,QAER,UAAW,CACT,IAAK,wBACL,KAAM,YACN,YAAa,yBACb,MAAO,kBACP,KAAM,aAER,SAAU,CACR,IAAK,wBACL,KAAM,YACN,YAAa,kBACb,MAAO,iBACP,KAAM,YAER,QAAS,CACP,IAAK,wBACL,KAAM,UACN,YAAa,gBACb,MAAO,gBACP,KAAM,YAKG,aAAe,OAAO,OAAO,SAG7B,gBAAmB,IAAA,CAC9B,OACA,KAAM,EACH,UAAU,OACV,cACA,OACA,QAAQ,0BAA2B,IACnC,QAAQ,UAAW,KACnB,QAAQ,WAAY,IACpB,MAAM,EAAG,KACZ,YAAa,GACb,IAAK,SACL,MAAO,+BAII,eAAA,CACX,EACA,KAqBA,MAAM,MAAE,GAAQ,EAAA,MAAM,EAAQ,gBAAmB,GAAQ,CAAC,EAGpD,EAAS,CACb,QAAS,GAAwC,YAAY,OAAA,o1JAC7D,EAAQ,cAAe,IACvB,KAAK,IAGP,OAAI,EACK,UAAU,QAAY,KAExB,U","file":"/npm/@scalar/themes@0.19.2/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /npm/@scalar/themes@0.19.2/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * Scrollbar Width Test\n *\n * Return true if scrollbars use up screen real estate.\n *\n * @see https://www.filamentgroup.com/lab/scrollbars/\n */\nexport function hasObtrusiveScrollbars(): boolean {\n  if (typeof window === 'undefined') {\n    return false\n  }\n\n  // Create a 30px square div\n  const parent = document.createElement('div')\n  parent.setAttribute('style', 'width:30px;height:30px;overflow-y:scroll;')\n  parent.classList.add('scrollbar-test')\n\n  // Create a 40px tall child div so it has to scroll\n  const child = document.createElement('div')\n  child.setAttribute('style', 'width:100%;height:40px')\n  parent.appendChild(child)\n  document.body.appendChild(parent)\n\n  // Measure the child element, if it is not 30px wide the scrollbars are obtrusive\n  const firstChild = parent.firstChild as HTMLDivElement\n  const scrollbarWidth = 30 - firstChild.clientWidth\n\n  document.body.removeChild(parent)\n\n  return !!scrollbarWidth\n}\n","import defaultFonts from './fonts/fonts.css?inline'\nimport alternateTheme from './presets/alternate.css?inline'\nimport bluePlanetTheme from './presets/bluePlanet.css?inline'\nimport customThemeStarter from './presets/custom-theme-starter.css?inline'\nimport deepSpaceTheme from './presets/deepSpace.css?inline'\nimport defaultTheme from './presets/default.css?inline'\nimport elysiajsTheme from './presets/elysiajs.css?inline'\nimport fastifyTheme from './presets/fastify.css?inline'\nimport keplerTheme from './presets/kepler.css?inline'\nimport laserwaveTheme from './presets/laserwave.css?inline'\nimport marsTheme from './presets/mars.css?inline'\nimport moonTheme from './presets/moon.css?inline'\nimport purpleTheme from './presets/purple.css?inline'\nimport saturnTheme from './presets/saturn.css?inline'\nimport solarizedTheme from './presets/solarized.css?inline'\n\nexport { hasObtrusiveScrollbars } from './utilities/has-obtrusive-scrollbars'\n\nimport { nanoid } from 'nanoid'\n\n// Export all presets for easier access\nexport {\n  alternateTheme,\n  bluePlanetTheme,\n  deepSpaceTheme,\n  defaultFonts,\n  defaultTheme,\n  elysiajsTheme,\n  fastifyTheme,\n  keplerTheme,\n  laserwaveTheme,\n  marsTheme,\n  moonTheme,\n  purpleTheme,\n  saturnTheme,\n  solarizedTheme,\n}\n\n/** Theme definition for Scalar platform themes. Matches user provided theme definitions. */\nexport type Theme = {\n  uid: string\n  /** Display name of the theme */\n  name: string\n  /** Description of the theme */\n  description: string\n  /** CSS string for the theme */\n  theme: string\n  /** Text identifier for the theme. Used for specifying in scalar.config.ts */\n  slug: string\n  /** Deprecated themes will still be loadable but will be hidden from the UI for future selection */\n  deprecated?: boolean\n}\n\n/** List of available theme IDs as a type. */\nexport type ThemeId = (typeof themeIds)[number]\n\nexport type IntegrationThemeId = 'elysiajs' | 'fastify'\n\nexport const themeIds = [\n  'alternate',\n  'default',\n  'moon',\n  'purple',\n  'solarized',\n  'bluePlanet',\n  'deepSpace',\n  'saturn',\n  'kepler',\n  'elysiajs',\n  'fastify',\n  'mars',\n  'laserwave',\n  'none',\n] as const\n\n// ---------------------------------------------------------------------------\n\n/**\n * User readable theme names / labels\n */\nexport const themeLabels = {\n  default: 'Default',\n  alternate: 'Alternate',\n  moon: 'Moon',\n  purple: 'Purple',\n  solarized: 'Solarized',\n  elysiajs: 'Elysia.js',\n  fastify: 'Fastify',\n  bluePlanet: 'Blue Planet',\n  saturn: 'Saturn',\n  kepler: 'Kepler-11e',\n  mars: 'Mars',\n  deepSpace: 'Deep Space',\n  laserwave: 'Laserwave',\n  none: 'None',\n} as const satisfies Record<ThemeId, string>\n\n/**\n * Formatted list of available theme presets.\n *\n * Used across the Scalar platform as base themes. Extendable by team defined themes\n *\n * Static UIDs must be assigned and never changed when a new theme is created.\n * Slugs should be formatted as kebab-case and cannot change after initial creation.\n */\nexport const presets = {\n  default: {\n    uid: 'qTQR9jSM8E-LihpyZzPOi',\n    name: 'Default',\n    description: 'Default Scalar theme',\n    theme: defaultTheme,\n    slug: 'default',\n  },\n  alternate: {\n    uid: '2skUDSH4S8HYFF9yXysr-',\n    name: 'Alternate',\n    description: 'Alternate Scalar theme',\n    theme: alternateTheme,\n    slug: 'alternate',\n  },\n  moon: {\n    uid: 'DG9ZUNp5lJhDeX_kPX4Bl',\n    name: 'Moon',\n    description: 'Lunar styles',\n    theme: moonTheme,\n    slug: 'moon',\n  },\n  purple: {\n    uid: 'pE_1ysxcZ-y2LM1GGNBUv',\n    name: 'Purple',\n    description: 'Purple Scalar theme',\n    theme: purpleTheme,\n    slug: 'purple',\n  },\n  solarized: {\n    uid: 'BdGVG1vf-4nYl3wJKyj8l',\n    name: 'Solarized',\n    description: 'Solarized Scalar theme',\n    theme: solarizedTheme,\n    slug: 'solarized',\n  },\n  bluePlanet: {\n    uid: 'X12IfAvl7ue-42V2lW40S',\n    name: 'Blue Planet',\n    description: 'Blue Planet Scalar theme',\n    theme: bluePlanetTheme,\n    slug: 'blue-planet',\n  },\n  deepSpace: {\n    uid: 'K8b38NWQiicq4-zXGXKdI',\n    name: 'Deep Space',\n    description: 'Deep Space Scalar theme',\n    theme: deepSpaceTheme,\n    slug: 'deep-space',\n  },\n  saturn: {\n    uid: '1jyAjmbIZQG-RUU4Ugk9o',\n    name: 'Saturn',\n    description: 'Saturn Scalar theme',\n    theme: saturnTheme,\n    slug: 'saturn',\n  },\n  kepler: {\n    uid: 'jZ6dnWbtqQ0Hz3s9jLPH0',\n    name: 'Kepler-11e',\n    description: 'Kepler-11e Scalar theme',\n    theme: keplerTheme,\n    slug: 'kepler-11e',\n  },\n  mars: {\n    uid: 'YY4LQgwiXix55-TmMz9qd',\n    name: 'Mars',\n    description: 'Mars Scalar theme',\n    theme: marsTheme,\n    slug: 'mars',\n  },\n  laserwave: {\n    uid: 'c5fZEi-K-hP-xXf885dkf',\n    name: 'Laserwave',\n    description: 'Laserwave Scalar theme',\n    theme: laserwaveTheme,\n    slug: 'laserwave',\n  },\n  elysiajs: {\n    uid: 'nEVZkRmCylPkT0o9YJa7y',\n    name: 'Elysia.js',\n    description: 'Elysia.js theme',\n    theme: elysiajsTheme,\n    slug: 'elysiajs',\n  },\n  fastify: {\n    uid: 'nTZcdcM2_yHFZFxTQe9Kk',\n    name: 'Fastify',\n    description: 'Fastify theme',\n    theme: fastifyTheme,\n    slug: 'fastify',\n  },\n} as const satisfies Record<Exclude<ThemeId, 'none'>, Theme>\n\n/** List of available theme presets */\nexport const themePresets = Object.values(presets)\n\n/** Starter custom theme styles with all variables and options */\nexport const getStarterTheme = (name: string): Theme => ({\n  name,\n  slug: name\n    .normalize('NFC')\n    .toLowerCase()\n    .trim()\n    .replace(/[^\\p{L}\\p{M}\\p{N}\\s-]/gu, '')\n    .replace(/[\\s-]+/g, '-')\n    .replace(/^-+|-+$/g, '')\n    .slice(0, 255),\n  description: '',\n  uid: nanoid(),\n  theme: customThemeStarter,\n})\n\n/** Get the theme and base variables for a given theme */\nexport const getThemeStyles = (\n  themeId?: ThemeId,\n  opts?: {\n    /**\n     * Whether or not to include the base variables (e.g. typography)\n     *\n     * @default true\n     */\n    variables?: boolean\n    /**\n     * Whether or not to include the definitions for the default scalar fonts (e.g. Inter)\n     *\n     * @default true\n     */\n    fonts?: boolean\n    /**\n     * Cascade layer to assign the theme styles to\n     *\n     * @default 'scalar-theme'\n     */\n    layer?: string | false\n  },\n) => {\n  const { fonts = true, layer = 'scalar-theme' } = opts ?? {}\n\n  // Combined theme, base variables and default fonts if configured\n  const styles = [\n    presets[(themeId as Exclude<ThemeId, 'none'>) || 'default']?.theme ?? defaultTheme,\n    fonts ? defaultFonts : '',\n  ].join('')\n\n  // Wrap the styles in a layer if configured\n  if (layer) {\n    return `@layer ${layer} {\\n${styles}}`\n  }\n  return styles\n}\n"]}