@mhmo91/schmancy 0.4.44 → 0.4.45

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.
Files changed (59) hide show
  1. package/ai/dialog.md +1 -1
  2. package/dist/ai/dialog.md +1 -1
  3. package/dist/{avatar-DbQohKTF.js → avatar-DAPIovPH.js} +17 -17
  4. package/dist/{avatar-DbQohKTF.js.map → avatar-DAPIovPH.js.map} +1 -1
  5. package/dist/{avatar-N8UvQjsm.cjs → avatar-DDjdOEu0.cjs} +2 -2
  6. package/dist/{avatar-N8UvQjsm.cjs.map → avatar-DDjdOEu0.cjs.map} +1 -1
  7. package/dist/badge.cjs +1 -1
  8. package/dist/badge.js +1 -1
  9. package/dist/content-drawer.cjs +1 -1
  10. package/dist/content-drawer.js +1 -1
  11. package/dist/{date-range-B7VG8UXD.js → date-range-BJNoGX45.js} +2 -2
  12. package/dist/{date-range-B7VG8UXD.js.map → date-range-BJNoGX45.js.map} +1 -1
  13. package/dist/{date-range-CREpHqxO.cjs → date-range-IyDqhNLw.cjs} +2 -2
  14. package/dist/{date-range-CREpHqxO.cjs.map → date-range-IyDqhNLw.cjs.map} +1 -1
  15. package/dist/date-range.cjs +1 -1
  16. package/dist/date-range.js +1 -1
  17. package/dist/{dialog-content-ClfiDTji.cjs → dialog-content-Biz4uVPD.cjs} +2 -2
  18. package/dist/{dialog-content-ClfiDTji.cjs.map → dialog-content-Biz4uVPD.cjs.map} +1 -1
  19. package/dist/{dialog-content-Cc7LNx1o.js → dialog-content-CmOEqKOr.js} +2 -2
  20. package/dist/{dialog-content-Cc7LNx1o.js.map → dialog-content-CmOEqKOr.js.map} +1 -1
  21. package/dist/dialog-service-AdqbEHnW.js +130 -0
  22. package/dist/dialog-service-AdqbEHnW.js.map +1 -0
  23. package/dist/dialog-service-B4gxdlr-.cjs +2 -0
  24. package/dist/dialog-service-B4gxdlr-.cjs.map +1 -0
  25. package/dist/dialog.cjs +1 -1
  26. package/dist/dialog.js +2 -2
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.js +7 -7
  29. package/dist/nav-drawer.cjs +1 -1
  30. package/dist/nav-drawer.js +1 -1
  31. package/dist/{sheet-BY3YdE4E.js → sheet-BXNBQt5O.js} +2 -2
  32. package/dist/{sheet-BY3YdE4E.js.map → sheet-BXNBQt5O.js.map} +1 -1
  33. package/dist/{sheet-BY85jX0R.cjs → sheet-QLZcRUG6.cjs} +2 -2
  34. package/dist/{sheet-BY85jX0R.cjs.map → sheet-QLZcRUG6.cjs.map} +1 -1
  35. package/dist/sheet.cjs +1 -1
  36. package/dist/sheet.js +2 -2
  37. package/dist/teleport.cjs +1 -1
  38. package/dist/teleport.js +1 -1
  39. package/dist/theme.cjs +1 -1
  40. package/dist/theme.component-B3Z6xZ33.cjs +3 -0
  41. package/dist/theme.component-B3Z6xZ33.cjs.map +1 -0
  42. package/dist/{sheet.service-DSvFe5PY.js → theme.component-DbZODTAR.js} +67 -65
  43. package/dist/theme.component-DbZODTAR.js.map +1 -0
  44. package/dist/theme.js +1 -1
  45. package/dist/{typewriter-DMKxup-I.js → typewriter-CnloNIdN.js} +6 -6
  46. package/dist/{typewriter-DMKxup-I.js.map → typewriter-CnloNIdN.js.map} +1 -1
  47. package/dist/typewriter.js +1 -1
  48. package/package.json +1 -1
  49. package/dist/dialog-events--DuMbZ8T.cjs +0 -2
  50. package/dist/dialog-events--DuMbZ8T.cjs.map +0 -1
  51. package/dist/dialog-events-mjOcyPQ-.js +0 -6
  52. package/dist/dialog-events-mjOcyPQ-.js.map +0 -1
  53. package/dist/dialog-service-BZZK8N6A.cjs +0 -2
  54. package/dist/dialog-service-BZZK8N6A.cjs.map +0 -1
  55. package/dist/dialog-service-DFMlRcXf.js +0 -128
  56. package/dist/dialog-service-DFMlRcXf.js.map +0 -1
  57. package/dist/sheet.service-CNz7lXHC.cjs +0 -3
  58. package/dist/sheet.service-CNz7lXHC.cjs.map +0 -1
  59. package/dist/sheet.service-DSvFe5PY.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"dialog-service-DFMlRcXf.js","sources":["../src/dialog/dialog-service.ts"],"sourcesContent":["import { render, TemplateResult } from 'lit'\nimport { defaultIfEmpty, forkJoin, fromEvent, map, of, Subject, switchMap, takeUntil, tap, timer } from 'rxjs'\nimport { ConfirmDialog } from './dailog'\nimport { DialogHereMorty, DialogHereMortyEvent, DialogWhereAreYouRicky } from './dialog-events'\n\n/**\n * Dialog service options interface with component support\n */\nexport interface DialogOptions {\n\ttitle?: string\n\tsubtitle?: string\n\tmessage?: string\n\tconfirmText?: string\n\tcancelText?: string\n\tvariant?: 'default' | 'danger'\n\tconfirmColor?: 'primary' | 'error' | 'warning' | 'success' // Button color for confirm action\n\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\n\t// New options for component rendering\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\twidth?: string\n\tonConfirm?: () => void\n\tonCancel?: () => void\n\thideActions?: boolean // Set to true to hide all buttons and title\n\ttargetContainer?: HTMLElement // Container to append dialog to (defaults to document.body)\n}\n\ninterface DialogTarget {\n\toptions: DialogOptions\n\ttype: 'confirm' | 'component'\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\tresolve?: (value: boolean) => void\n\treject?: (reason?: any) => void\n}\n\n/**\n * Dialog service for centralized dialog management.\n * Provides a simple API for showing dialogs with optional custom components.\n */\nexport class DialogService {\n\tprivate static instance: DialogService\n\n\t// Default dialog options\n\tprivate static DEFAULT_OPTIONS: Partial<DialogOptions> = {\n\t\ttitle: undefined,\n\t\tsubtitle: undefined,\n\t\tconfirmText: undefined,\n\t\tcancelText: undefined,\n\t\tvariant: 'default',\n\t\twidth: '360px',\n\t}\n\n\t// Track active dialogs to handle dismissing the most recent one\n\tprivate activeDialogs: ConfirmDialog[] = []\n\t\n\t// Track component dialogs (schmancy-dialog instances)\n\tprivate activeRawDialogs: any[] = []\n\t\n\t// Subject for dialog opening requests\n\tprivate dialogSubject = new Subject<DialogTarget>()\n\t\n\t// Subject for dialog dismissal requests\n\tprivate dismissSubject = new Subject<string>()\n\n\t// Private constructor for singleton pattern\n\tprivate constructor() {\n\t\tthis.setupDialogOpeningLogic()\n\t\tthis.setupDialogDismissLogic()\n\t}\n\n\t/**\n\t * Get the singleton instance\n\t */\n\tpublic static getInstance(): DialogService {\n\t\tif (!DialogService.instance) {\n\t\t\tDialogService.instance = new DialogService()\n\t\t}\n\t\treturn DialogService.instance\n\t}\n\t\n\t/**\n\t * Sets up the main dialog opening logic using RxJS pipes\n\t */\n\tprivate setupDialogOpeningLogic() {\n\t\tthis.dialogSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\tconst uid = target.type === 'confirm' \n\t\t\t\t\t\t\t\t\t? `confirm-dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\t: `dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Store uid in target for later use\n\t\t\t\t\t\t\t\t;(target as any).uid = uid\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tmap(([response, target]) => {\n\t\t\t\t\tlet dialog: ConfirmDialog | any\n\t\t\t\t\tlet targetContainer: HTMLElement\n\t\t\t\t\t\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Use existing dialog\n\t\t\t\t\t\tdialog = response.dialog\n\t\t\t\t\t\ttargetContainer = dialog.parentElement as HTMLElement\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Determine container - use responding theme or fallback\n\t\t\t\t\t\tif (response?.theme) {\n\t\t\t\t\t\t\ttargetContainer = response.theme as HTMLElement\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttargetContainer = target.options.targetContainer || \n\t\t\t\t\t\t\t document.querySelector('schmancy-theme') as HTMLElement || \n\t\t\t\t\t\t\t document.body\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Create appropriate dialog type\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdialog = document.createElement('schmancy-dialog')\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tdialog.setAttribute('uid', (target as any).uid)\n\t\t\t\t\t\ttargetContainer.appendChild(dialog)\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\treturn { dialog, target, targetContainer }\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t// Configure confirm dialog\n\t\t\t\t\t\tconst confirmDialog = dialog as ConfirmDialog\n\t\t\t\t\t\tconst options = target.options\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (options.title) confirmDialog.title = options.title\n\t\t\t\t\t\tif (options.subtitle) confirmDialog.subtitle = options.subtitle\n\t\t\t\t\t\tif (options.message) confirmDialog.message = options.message\n\t\t\t\t\t\tif (options.confirmText) confirmDialog.confirmText = options.confirmText\n\t\t\t\t\t\tif (options.cancelText) confirmDialog.cancelText = options.cancelText\n\t\t\t\t\t\tif (options.variant) confirmDialog.variant = options.variant\n\t\t\t\t\t\tif (options.confirmColor) confirmDialog.confirmColor = options.confirmColor\n\t\t\t\t\t\tif (options.width) confirmDialog.style.setProperty('--dialog-width', options.width)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Handle custom content if provided\n\t\t\t\t\t\tif (options.content) {\n\t\t\t\t\t\t\tconst contentContainer = document.createElement('div')\n\t\t\t\t\t\t\tcontentContainer.slot = 'content'\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (typeof options.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = options.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tcontentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, contentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (options.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tcontentContainer.appendChild(options.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(options.content, contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconfirmDialog.appendChild(contentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active dialogs\n\t\t\t\t\t\tthis.activeDialogs.push(confirmDialog)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Configure component dialog\n\t\t\t\t\t\tif (target.content) {\n\t\t\t\t\t\t\tconst directContentContainer = document.createElement('div')\n\t\t\t\t\t\t\tdirectContentContainer.style.height = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.style.width = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.classList.add('schmancy-dialog-content-container')\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Render the content directly\n\t\t\t\t\t\t\tif (typeof target.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = target.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, directContentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (target.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(target.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(target.content, directContentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdialog.appendChild(directContentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Set width from options\n\t\t\t\t\t\tif (target.options.width) {\n\t\t\t\t\t\t\tdialog.style.setProperty('--dialog-width', target.options.width)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active raw dialogs\n\t\t\t\t\t\tthis.activeRawDialogs.push(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\t// Show dialog and handle promise resolution\n\t\t\t\t\tconst position = target.options.position || this.getCenteredPosition()\n\t\t\t\t\t\n\t\t\t\t\tdialog.show(position).then((result: boolean) => {\n\t\t\t\t\t\tif (target.resolve) {\n\t\t\t\t\t\t\ttarget.resolve(result)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Cleanup\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tconst index = this.activeDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentEl = dialog.querySelector('[slot=\"content\"]')\n\t\t\t\t\t\t\tif (contentEl) {\n\t\t\t\t\t\t\t\tdialog.removeChild(contentEl)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst index = this.activeRawDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeRawDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentContainer = dialog.querySelector('.schmancy-dialog-content-container')\n\t\t\t\t\t\t\tif (contentContainer && contentContainer.parentNode) {\n\t\t\t\t\t\t\t\tcontentContainer.parentNode.removeChild(contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM\n\t\t\t\t\t\tif (dialog.parentElement) {\n\t\t\t\t\t\t\tdialog.parentElement.removeChild(dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}).catch((error: any) => {\n\t\t\t\t\t\tif (target.reject) {\n\t\t\t\t\t\t\ttarget.reject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t\n\t\t\t\t\t// Set up event listeners for callbacks\n\t\t\t\t\tif (target.options.onConfirm) {\n\t\t\t\t\t\tconst onConfirm = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onConfirm!()\n\t\t\t\t\t\t\tdialog.removeEventListener('confirm', onConfirm)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('confirm', onConfirm)\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (target.options.onCancel) {\n\t\t\t\t\t\tconst onCancel = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onCancel!()\n\t\t\t\t\t\t\tdialog.removeEventListener('cancel', onCancel)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('cancel', onCancel)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\t\n\t/**\n\t * Sets up the dialog dismissal logic\n\t */\n\tprivate setupDialogDismissLogic() {\n\t\tthis.dismissSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, { \n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([response]) => {\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Hide the dialog\n\t\t\t\t\t\tresponse.dialog.hide(false)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove from tracking arrays\n\t\t\t\t\t\tconst confirmIndex = this.activeDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (confirmIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeDialogs.splice(confirmIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tconst rawIndex = this.activeRawDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (rawIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeRawDialogs.splice(rawIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM immediately\n\t\t\t\t\t\tif (response.dialog.parentElement) {\n\t\t\t\t\t\t\tresponse.dialog.parentElement.removeChild(response.dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic confirm(options: DialogOptions): Promise<boolean> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// Apply default options\n\t\t\tconst completeOptions = {\n\t\t\t\t...DialogService.DEFAULT_OPTIONS,\n\t\t\t\t...options,\n\t\t\t}\n\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!completeOptions.position) {\n\t\t\t\tcompleteOptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: completeOptions,\n\t\t\t\ttype: 'confirm',\n\t\t\t\tcontent: completeOptions.content,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Show a dialog with custom component content\n\t * Always renders content directly without any headers or action buttons\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tpublic component(\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions: Omit<DialogOptions, 'content' | 'message'> = {},\n\t): Promise<boolean> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!options.position) {\n\t\t\t\toptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: options as DialogOptions,\n\t\t\t\ttype: 'component',\n\t\t\t\tcontent,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Dismiss the most recently opened dialog (either confirm or component type)\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tpublic dismiss(): boolean {\n\t\t// Try component dialog first (they're more likely to be on top)\n\t\tif (this.activeRawDialogs.length > 0) {\n\t\t\t// Get the most recently opened raw dialog (last in the array)\n\t\t\tconst dialog = this.activeRawDialogs[this.activeRawDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fall back to confirm dialogs\n\t\tif (this.activeDialogs.length > 0) {\n\t\t\t// Get the most recently opened dialog (last in the array)\n\t\t\tconst dialog = this.activeDialogs[this.activeDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic danger(options: Omit<DialogOptions, 'variant'>): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\t...options,\n\t\t\tvariant: 'danger',\n\t\t})\n\t}\n\n\t/**\n\t * Get a centered position for the dialog\n\t */\n\tprivate getCenteredPosition(): { x: number; y: number } {\n\t\treturn {\n\t\t\tx: window.innerWidth / 2,\n\t\t\ty: window.innerHeight / 2,\n\t\t}\n\t}\n\n}\n\n/**\n * Global dialog utility - provides a quick way to show dialogs\n */\nexport const $dialog = {\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tconfirm: (options: DialogOptions): Promise<boolean> => {\n\t\treturn DialogService.getInstance().confirm(options)\n\t},\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\task: (message: string, event?: MouseEvent | TouchEvent): Promise<boolean> => {\n\t\treturn DialogService.getInstance().ask(message, event)\n\t},\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tdanger: (options: Omit<DialogOptions, 'variant'>): Promise<boolean> => {\n\t\treturn DialogService.getInstance().danger(options)\n\t},\n\n\t/**\n\t * Show a dialog with custom component content\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tcomponent: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Show a simple dialog without title or actions, just content\n\t * This is an alias for component() since all component dialogs are now simple by design\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tsimple: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message' | 'title' | 'confirmText' | 'cancelText'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Dismiss the most recently opened dialog\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tdismiss: (): boolean => {\n\t\treturn DialogService.getInstance().dismiss()\n\t},\n}\n\nexport default DialogService"],"names":["DialogService","constructor","this","activeDialogs","activeRawDialogs","dialogSubject","Subject","dismissSubject","setupDialogOpeningLogic","setupDialogDismissLogic","getInstance","instance","pipe","switchMap","forkJoin","fromEvent","window","DialogHereMorty","takeUntil","timer","map","e","detail","defaultIfEmpty","of","target","tap","uid","type","Date","now","Math","random","toString","substring","dispatchEvent","CustomEvent","DialogWhereAreYouRicky","bubbles","composed","response","dialog","targetContainer","parentElement","theme","options","document","querySelector","body","createElement","setAttribute","appendChild","confirmDialog","title","subtitle","message","confirmText","cancelText","variant","confirmColor","width","style","setProperty","content","contentContainer","slot","result","HTMLElement","render","push","directContentContainer","height","classList","add","position","getCenteredPosition","show","then","resolve","index","indexOf","splice","contentEl","removeChild","parentNode","catch","error","reject","onConfirm","_e","removeEventListener","addEventListener","onCancel","subscribe","hide","confirmIndex","rawIndex","Promise","completeOptions","DEFAULT_OPTIONS","next","length","getAttribute","event","confirm","x","innerWidth","y","innerHeight","_f","$dialog","ask","danger","component","simple","dismiss"],"mappings":"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"}
@@ -1,3 +0,0 @@
1
- "use strict";const f=require("rxjs"),Me=require("./provide-BxZ2kn_p.cjs"),Fe=require("./tailwind.mixin-DVKI3qb9.cjs"),Se=require("lit"),Z=require("lit/decorators.js"),he=require("./dialog-events--DuMbZ8T.cjs");function z(e){return e<0?-1:e===0?0:1}function te(e,t,o){return(1-o)*e+o*t}function ie(e,t,o){return o<e?e:o>t?t:o}function me(e){return(e%=360)<0&&(e+=360),e}function de(e,t){return[e[0]*t[0][0]+e[1]*t[0][1]+e[2]*t[0][2],e[0]*t[1][0]+e[1]*t[1][1]+e[2]*t[1][2],e[0]*t[2][0]+e[1]*t[2][1]+e[2]*t[2][2]]}const Ve=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],Re=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],He=[95.047,100,108.883];function fe(e,t,o){return(255<<24|(255&e)<<16|(255&t)<<8|255&o)>>>0}function Ce(e){return fe(J(e[0]),J(e[1]),J(e[2]))}function pe(e){const t=function(o){const r=K(function(s){return s>>16&255}(o)),n=K(function(s){return s>>8&255}(o)),a=K(function(s){return 255&s}(o));return de([r,n,a],Ve)}(e)[1];return 116*De(t/100)-16}function G(e){return 100*function(t){const o=903.2962962962963,r=t*t*t;return r>216/24389?r:(116*t-16)/o}((e+16)/116)}function ye(e){return 116*De(e/100)-16}function K(e){const t=e/255;return t<=.040449936?t/12.92*100:100*Math.pow((t+.055)/1.055,2.4)}function J(e){const t=e/100;let o=0;return o=t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,r=0,n=255,(a=Math.round(255*o))<r?r:a>n?n:a;var r,n,a}function De(e){return e>216/24389?Math.pow(e,1/3):(903.2962962962963*e+16)/116}class _{static make(t=function(){return He}(),o=200/Math.PI*G(50)/100,r=50,n=2,a=!1){const s=t,l=.401288*s[0]+.650173*s[1]+-.051461*s[2],h=-.250268*s[0]+1.204414*s[1]+.045854*s[2],i=-.002079*s[0]+.048952*s[1]+.953127*s[2],m=.8+n/10,g=m>=.9?te(.59,.69,10*(m-.9)):te(.525,.59,10*(m-.8));let k=a?1:m*(1-1/3.6*Math.exp((-o-42)/92));k=k>1?1:k<0?0:k;const b=m,y=[k*(100/l)+1-k,k*(100/h)+1-k,k*(100/i)+1-k],C=1/(5*o+1),P=C*C*C*C,D=1-P,x=P*o+.1*D*D*Math.cbrt(5*o),F=G(r)/t[1],w=1.48+Math.sqrt(F),v=.725/Math.pow(F,.2),A=v,M=[Math.pow(x*y[0]*l/100,.42),Math.pow(x*y[1]*h/100,.42),Math.pow(x*y[2]*i/100,.42)],E=[400*M[0]/(M[0]+27.13),400*M[1]/(M[1]+27.13),400*M[2]/(M[2]+27.13)];return new _(F,(2*E[0]+E[1]+.05*E[2])*v,v,A,g,b,y,x,Math.pow(x,.25),w)}constructor(t,o,r,n,a,s,l,h,i,m){this.n=t,this.aw=o,this.nbb=r,this.ncb=n,this.c=a,this.nc=s,this.rgbD=l,this.fl=h,this.fLRoot=i,this.z=m}}_.DEFAULT=_.make();class O{constructor(t,o,r,n,a,s,l,h,i){this.hue=t,this.chroma=o,this.j=r,this.q=n,this.m=a,this.s=s,this.jstar=l,this.astar=h,this.bstar=i}distance(t){const o=this.jstar-t.jstar,r=this.astar-t.astar,n=this.bstar-t.bstar,a=Math.sqrt(o*o+r*r+n*n);return 1.41*Math.pow(a,.63)}static fromInt(t){return O.fromIntInViewingConditions(t,_.DEFAULT)}static fromIntInViewingConditions(t,o){const r=(65280&t)>>8,n=255&t,a=K((16711680&t)>>16),s=K(r),l=K(n),h=.41233895*a+.35762064*s+.18051042*l,i=.2126*a+.7152*s+.0722*l,m=.01932141*a+.11916382*s+.95034478*l,g=.401288*h+.650173*i-.051461*m,k=-.250268*h+1.204414*i+.045854*m,b=-.002079*h+.048952*i+.953127*m,y=o.rgbD[0]*g,C=o.rgbD[1]*k,P=o.rgbD[2]*b,D=Math.pow(o.fl*Math.abs(y)/100,.42),x=Math.pow(o.fl*Math.abs(C)/100,.42),F=Math.pow(o.fl*Math.abs(P)/100,.42),w=400*z(y)*D/(D+27.13),v=400*z(C)*x/(x+27.13),A=400*z(P)*F/(F+27.13),M=(11*w+-12*v+A)/11,E=(w+v-2*A)/9,T=(20*w+20*v+21*A)/20,ne=(40*w+20*v+A)/20,N=180*Math.atan2(E,M)/Math.PI,q=N<0?N+360:N>=360?N-360:N,j=q*Math.PI/180,R=ne*o.nbb,U=100*Math.pow(R/o.aw,o.c*o.z),X=4/o.c*Math.sqrt(U/100)*(o.aw+4)*o.fLRoot,Q=q<20.14?q+360:q,ae=5e4/13*(.25*(Math.cos(Q*Math.PI/180+2)+3.8))*o.nc*o.ncb*Math.sqrt(M*M+E*E)/(T+.305),ce=Math.pow(ae,.9)*Math.pow(1.64-Math.pow(.29,o.n),.73),se=ce*Math.sqrt(U/100),be=se*o.fLRoot,Le=50*Math.sqrt(ce*o.c/(o.aw+4)),Ae=(1+100*.007)*U/(1+.007*U),ve=1/.0228*Math.log(1+.0228*be),Be=ve*Math.cos(j),Oe=ve*Math.sin(j);return new O(q,se,U,X,be,Le,Ae,Be,Oe)}static fromJch(t,o,r){return O.fromJchInViewingConditions(t,o,r,_.DEFAULT)}static fromJchInViewingConditions(t,o,r,n){const a=4/n.c*Math.sqrt(t/100)*(n.aw+4)*n.fLRoot,s=o*n.fLRoot,l=o/Math.sqrt(t/100),h=50*Math.sqrt(l*n.c/(n.aw+4)),i=r*Math.PI/180,m=(1+100*.007)*t/(1+.007*t),g=1/.0228*Math.log(1+.0228*s),k=g*Math.cos(i),b=g*Math.sin(i);return new O(r,o,t,a,s,h,m,k,b)}static fromUcs(t,o,r){return O.fromUcsInViewingConditions(t,o,r,_.DEFAULT)}static fromUcsInViewingConditions(t,o,r,n){const a=o,s=r,l=Math.sqrt(a*a+s*s),h=(Math.exp(.0228*l)-1)/.0228/n.fLRoot;let i=Math.atan2(s,a)*(180/Math.PI);i<0&&(i+=360);const m=t/(1-.007*(t-100));return O.fromJchInViewingConditions(m,h,i,n)}toInt(){return this.viewed(_.DEFAULT)}viewed(t){const o=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(o/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),n=this.hue*Math.PI/180,a=.25*(Math.cos(n+2)+3.8),s=t.aw*Math.pow(this.j/100,1/t.c/t.z),l=a*(5e4/13)*t.nc*t.ncb,h=s/t.nbb,i=Math.sin(n),m=Math.cos(n),g=23*(h+.305)*r/(23*l+11*r*m+108*r*i),k=g*m,b=g*i,y=(460*h+451*k+288*b)/1403,C=(460*h-891*k-261*b)/1403,P=(460*h-220*k-6300*b)/1403,D=Math.max(0,27.13*Math.abs(y)/(400-Math.abs(y))),x=z(y)*(100/t.fl)*Math.pow(D,1/.42),F=Math.max(0,27.13*Math.abs(C)/(400-Math.abs(C))),w=z(C)*(100/t.fl)*Math.pow(F,1/.42),v=Math.max(0,27.13*Math.abs(P)/(400-Math.abs(P))),A=z(P)*(100/t.fl)*Math.pow(v,1/.42),M=x/t.rgbD[0],E=w/t.rgbD[1],T=A/t.rgbD[2];return function(N,q,j){const R=Re,U=R[0][0]*N+R[0][1]*q+R[0][2]*j,X=R[1][0]*N+R[1][1]*q+R[1][2]*j,Q=R[2][0]*N+R[2][1]*q+R[2][2]*j;return fe(J(U),J(X),J(Q))}(1.86206786*M-1.01125463*E+.14918677*T,.38752654*M+.62144744*E-.00897398*T,-.0158415*M-.03412294*E+1.04996444*T)}static fromXyzInViewingConditions(t,o,r,n){const a=.401288*t+.650173*o-.051461*r,s=-.250268*t+1.204414*o+.045854*r,l=-.002079*t+.048952*o+.953127*r,h=n.rgbD[0]*a,i=n.rgbD[1]*s,m=n.rgbD[2]*l,g=Math.pow(n.fl*Math.abs(h)/100,.42),k=Math.pow(n.fl*Math.abs(i)/100,.42),b=Math.pow(n.fl*Math.abs(m)/100,.42),y=400*z(h)*g/(g+27.13),C=400*z(i)*k/(k+27.13),P=400*z(m)*b/(b+27.13),D=(11*y+-12*C+P)/11,x=(y+C-2*P)/9,F=(20*y+20*C+21*P)/20,w=(40*y+20*C+P)/20,v=180*Math.atan2(x,D)/Math.PI,A=v<0?v+360:v>=360?v-360:v,M=A*Math.PI/180,E=w*n.nbb,T=100*Math.pow(E/n.aw,n.c*n.z),ne=4/n.c*Math.sqrt(T/100)*(n.aw+4)*n.fLRoot,N=A<20.14?A+360:A,q=5e4/13*(1/4*(Math.cos(N*Math.PI/180+2)+3.8))*n.nc*n.ncb*Math.sqrt(D*D+x*x)/(F+.305),j=Math.pow(q,.9)*Math.pow(1.64-Math.pow(.29,n.n),.73),R=j*Math.sqrt(T/100),U=R*n.fLRoot,X=50*Math.sqrt(j*n.c/(n.aw+4)),Q=(1+100*.007)*T/(1+.007*T),ae=Math.log(1+.0228*U)/.0228,ce=ae*Math.cos(M),se=ae*Math.sin(M);return new O(A,R,T,ne,U,X,Q,ce,se)}xyzInViewingConditions(t){const o=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(o/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),n=this.hue*Math.PI/180,a=.25*(Math.cos(n+2)+3.8),s=t.aw*Math.pow(this.j/100,1/t.c/t.z),l=a*(5e4/13)*t.nc*t.ncb,h=s/t.nbb,i=Math.sin(n),m=Math.cos(n),g=23*(h+.305)*r/(23*l+11*r*m+108*r*i),k=g*m,b=g*i,y=(460*h+451*k+288*b)/1403,C=(460*h-891*k-261*b)/1403,P=(460*h-220*k-6300*b)/1403,D=Math.max(0,27.13*Math.abs(y)/(400-Math.abs(y))),x=z(y)*(100/t.fl)*Math.pow(D,1/.42),F=Math.max(0,27.13*Math.abs(C)/(400-Math.abs(C))),w=z(C)*(100/t.fl)*Math.pow(F,1/.42),v=Math.max(0,27.13*Math.abs(P)/(400-Math.abs(P))),A=z(P)*(100/t.fl)*Math.pow(v,1/.42),M=x/t.rgbD[0],E=w/t.rgbD[1],T=A/t.rgbD[2];return[1.86206786*M-1.01125463*E+.14918677*T,.38752654*M+.62144744*E-.00897398*T,-.0158415*M-.03412294*E+1.04996444*T]}}class d{static sanitizeRadians(t){return(t+8*Math.PI)%(2*Math.PI)}static trueDelinearized(t){const o=t/100;let r=0;return r=o<=.0031308?12.92*o:1.055*Math.pow(o,1/2.4)-.055,255*r}static chromaticAdaptation(t){const o=Math.pow(Math.abs(t),.42);return 400*z(t)*o/(o+27.13)}static hueOf(t){const o=de(t,d.SCALED_DISCOUNT_FROM_LINRGB),r=d.chromaticAdaptation(o[0]),n=d.chromaticAdaptation(o[1]),a=d.chromaticAdaptation(o[2]),s=(11*r+-12*n+a)/11,l=(r+n-2*a)/9;return Math.atan2(l,s)}static areInCyclicOrder(t,o,r){return d.sanitizeRadians(o-t)<d.sanitizeRadians(r-t)}static intercept(t,o,r){return(o-t)/(r-t)}static lerpPoint(t,o,r){return[t[0]+(r[0]-t[0])*o,t[1]+(r[1]-t[1])*o,t[2]+(r[2]-t[2])*o]}static setCoordinate(t,o,r,n){const a=d.intercept(t[n],o,r[n]);return d.lerpPoint(t,a,r)}static isBounded(t){return 0<=t&&t<=100}static nthVertex(t,o){const r=d.Y_FROM_LINRGB[0],n=d.Y_FROM_LINRGB[1],a=d.Y_FROM_LINRGB[2],s=o%4<=1?0:100,l=o%2==0?0:100;if(o<4){const h=s,i=l,m=(t-h*n-i*a)/r;return d.isBounded(m)?[m,h,i]:[-1,-1,-1]}if(o<8){const h=s,i=l,m=(t-i*r-h*a)/n;return d.isBounded(m)?[i,m,h]:[-1,-1,-1]}{const h=s,i=l,m=(t-h*r-i*n)/a;return d.isBounded(m)?[h,i,m]:[-1,-1,-1]}}static bisectToSegment(t,o){let r=[-1,-1,-1],n=r,a=0,s=0,l=!1,h=!0;for(let i=0;i<12;i++){const m=d.nthVertex(t,i);if(m[0]<0)continue;const g=d.hueOf(m);l?(h||d.areInCyclicOrder(a,g,s))&&(h=!1,d.areInCyclicOrder(a,o,g)?(n=m,s=g):(r=m,a=g)):(r=m,n=m,a=g,s=g,l=!0)}return[r,n]}static midpoint(t,o){return[(t[0]+o[0])/2,(t[1]+o[1])/2,(t[2]+o[2])/2]}static criticalPlaneBelow(t){return Math.floor(t-.5)}static criticalPlaneAbove(t){return Math.ceil(t-.5)}static bisectToLimit(t,o){const r=d.bisectToSegment(t,o);let n=r[0],a=d.hueOf(n),s=r[1];for(let l=0;l<3;l++)if(n[l]!==s[l]){let h=-1,i=255;n[l]<s[l]?(h=d.criticalPlaneBelow(d.trueDelinearized(n[l])),i=d.criticalPlaneAbove(d.trueDelinearized(s[l]))):(h=d.criticalPlaneAbove(d.trueDelinearized(n[l])),i=d.criticalPlaneBelow(d.trueDelinearized(s[l])));for(let m=0;m<8&&!(Math.abs(i-h)<=1);m++){const g=Math.floor((h+i)/2),k=d.CRITICAL_PLANES[g],b=d.setCoordinate(n,k,s,l),y=d.hueOf(b);d.areInCyclicOrder(a,o,y)?(s=b,i=g):(n=b,a=y,h=g)}}return d.midpoint(n,s)}static inverseChromaticAdaptation(t){const o=Math.abs(t),r=Math.max(0,27.13*o/(400-o));return z(t)*Math.pow(r,1/.42)}static findResultByJ(t,o,r){let n=11*Math.sqrt(r);const a=_.DEFAULT,s=1/Math.pow(1.64-Math.pow(.29,a.n),.73),l=.25*(Math.cos(t+2)+3.8)*(5e4/13)*a.nc*a.ncb,h=Math.sin(t),i=Math.cos(t);for(let m=0;m<5;m++){const g=n/100,k=o===0||n===0?0:o/Math.sqrt(g),b=Math.pow(k*s,1/.9),y=a.aw*Math.pow(g,1/a.c/a.z)/a.nbb,C=23*(y+.305)*b/(23*l+11*b*i+108*b*h),P=C*i,D=C*h,x=(460*y+451*P+288*D)/1403,F=(460*y-891*P-261*D)/1403,w=(460*y-220*P-6300*D)/1403,v=de([d.inverseChromaticAdaptation(x),d.inverseChromaticAdaptation(F),d.inverseChromaticAdaptation(w)],d.LINRGB_FROM_SCALED_DISCOUNT);if(v[0]<0||v[1]<0||v[2]<0)return 0;const A=d.Y_FROM_LINRGB[0],M=d.Y_FROM_LINRGB[1],E=d.Y_FROM_LINRGB[2],T=A*v[0]+M*v[1]+E*v[2];if(T<=0)return 0;if(m===4||Math.abs(T-r)<.002)return v[0]>100.01||v[1]>100.01||v[2]>100.01?0:Ce(v);n-=(T-r)*n/(2*T)}return 0}static solveToInt(t,o,r){if(o<1e-4||r<1e-4||r>99.9999)return function(l){const h=J(G(l));return fe(h,h,h)}(r);const n=(t=me(t))/180*Math.PI,a=G(r),s=d.findResultByJ(n,o,a);return s!==0?s:Ce(d.bisectToLimit(a,n))}static solveToCam(t,o,r){return O.fromInt(d.solveToInt(t,o,r))}}d.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]],d.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],d.Y_FROM_LINRGB=[.2126,.7152,.0722],d.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.942497089126609,1.0022825574869039,1.0642236851973577,1.1283421258858297,1.1946592148522128,1.2631959812511864,1.3339731595349034,1.407011200216447,1.4823302800086415,1.5599503113873272,1.6398909516233677,1.7221716113234105,1.8068114625156377,1.8938294463134073,1.9832442801866852,2.075074464868551,2.1693382909216234,2.2660538449872063,2.36523901573795,2.4669114995532007,2.5710888059345764,2.6777882626779785,2.7870270208169257,2.898822059350997,3.0131901897720907,3.1301480604002863,3.2497121605402226,3.3718988244681087,3.4967242352587946,3.624204428461639,3.754355295633311,3.887192587735158,4.022731918402185,4.160988767090289,4.301978482107941,4.445716283538092,4.592217266055746,4.741496401646282,4.893568542229298,5.048448422192488,5.20615066083972,5.3666897647573375,5.5300801301023865,5.696336044816294,5.865471690767354,6.037501145825082,6.212438385869475,6.390297286737924,6.571091626112461,6.7548350853498045,6.941541251256611,7.131223617812143,7.323895587840543,7.5195704746346665,7.7182615035334345,7.919981813454504,8.124744458384042,8.332562408825165,8.543448553206703,8.757415699253682,8.974476575321063,9.194643831691977,9.417930041841839,9.644347703669503,9.873909240696694,10.106627003236781,10.342513269534024,10.58158024687427,10.8238400726681,11.069304815507364,11.317986476196008,11.569896988756009,11.825048221409341,12.083451977536606,12.345119996613247,12.610063955123938,12.878295467455942,13.149826086772048,13.42466730586372,13.702830557985108,13.984327217668513,14.269168601521828,14.55736596900856,14.848930523210871,15.143873411576273,15.44220572664832,15.743938506781891,16.04908273684337,16.35764934889634,16.66964922287304,16.985093187232053,17.30399201960269,17.62635644741625,17.95219714852476,18.281524751807332,18.614349837764564,18.95068293910138,19.290534541298456,19.633915083172692,19.98083495742689,20.331304511189067,20.685334046541502,21.042933821039977,21.404114048223256,21.76888489811322,22.137256497705877,22.50923893145328,22.884842241736916,23.264076429332462,23.6469514538663,24.033477234264016,24.42366364919083,24.817520537484558,25.21505769858089,25.61628489293138,26.021211842414342,26.429848230738664,26.842203703840827,27.258287870275353,27.678110301598522,28.10168053274597,28.529008062403893,28.96010235337422,29.39497283293396,29.83362889318845,30.276079891419332,30.722335150426627,31.172403958865512,31.62629557157785,32.08401920991837,32.54558406207592,33.010999283389665,33.4802739966603,33.953417292456834,34.430438229418264,34.911345834551085,35.39614910352207,35.88485700094671,36.37747846067349,36.87402238606382,37.37449765026789,37.87891309649659,38.38727753828926,38.89959975977785,39.41588851594697,39.93615253289054,40.460400508064545,40.98864111053629,41.520882981230194,42.05713473317016,42.597404951718396,43.141702194811224,43.6900349931913,44.24241185063697,44.798841244188324,45.35933162437017,45.92389141541209,46.49252901546552,47.065252796817916,47.64207110610409,48.22299226451468,48.808024568002054,49.3971762874833,49.9904556690408,50.587870934119984,51.189430279724725,51.79514187861014,52.40501387947288,53.0190544071392,53.637271562750364,54.259673423945976,54.88626804504493,55.517063457223934,56.15206766869424,56.79128866487574,57.43473440856916,58.08241284012621,58.734331877617365,59.39049941699807,60.05092333227251,60.715611475655585,61.38457167773311,62.057811747619894,62.7353394731159,63.417162620860914,64.10328893648692,64.79372614476921,65.48848194977529,66.18756403501224,66.89098006357258,67.59873767827808,68.31084450182222,69.02730813691093,69.74813616640164,70.47333615344107,71.20291564160104,71.93688215501312,72.67524319850172,73.41800625771542,74.16517879925733,74.9167682708136,75.67278210128072,76.43322770089146,77.1981124613393,77.96744375590167,78.74122893956174,79.51947534912904,80.30219030335869,81.08938110306934,81.88105503125999,82.67721935322541,83.4778813166706,84.28304815182372,85.09272707154808,85.90692527145302,86.72564993000343,87.54890820862819,88.3767072518277,89.2090541872801,90.04595612594655,90.88742016217518,91.73345337380438,92.58406282226491,93.43925555268066,94.29903859396902,95.16341895893969,96.03240364439274,96.9059996312159,97.78421388448044,98.6670533535366,99.55452497210776];class I{static from(t,o,r){return new I(d.solveToInt(t,o,r))}static fromInt(t){return new I(t)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(t){this.setInternalState(d.solveToInt(t,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(t){this.setInternalState(d.solveToInt(this.internalHue,t,this.internalTone))}get tone(){return this.internalTone}set tone(t){this.setInternalState(d.solveToInt(this.internalHue,this.internalChroma,t))}constructor(t){this.argb=t;const o=O.fromInt(t);this.internalHue=o.hue,this.internalChroma=o.chroma,this.internalTone=pe(t),this.argb=t}setInternalState(t){const o=O.fromInt(t);this.internalHue=o.hue,this.internalChroma=o.chroma,this.internalTone=pe(t),this.argb=t}inViewingConditions(t){const o=O.fromInt(this.toInt()).xyzInViewingConditions(t),r=O.fromXyzInViewingConditions(o[0],o[1],o[2],_.make());return I.from(r.hue,r.chroma,ye(o[1]))}}class ge{static harmonize(t,o){const r=I.fromInt(t),n=I.fromInt(o),a=(s=r.hue,l=n.hue,180-Math.abs(Math.abs(s-l)-180));var s,l;const h=Math.min(.5*a,15),i=me(r.hue+h*(m=r.hue,me(n.hue-m)<=180?1:-1));var m;return I.from(i,r.chroma,r.tone).toInt()}static hctHue(t,o,r){const n=ge.cam16Ucs(t,o,r),a=O.fromInt(n),s=O.fromInt(t);return I.from(a.hue,s.chroma,pe(t)).toInt()}static cam16Ucs(t,o,r){const n=O.fromInt(t),a=O.fromInt(o),s=n.jstar,l=n.astar,h=n.bstar,i=s+(a.jstar-s)*r,m=l+(a.astar-l)*r,g=h+(a.bstar-h)*r;return O.fromUcs(i,m,g).toInt()}}class B{static ratioOfTones(t,o){return t=ie(0,100,t),o=ie(0,100,o),B.ratioOfYs(G(t),G(o))}static ratioOfYs(t,o){const r=t>o?t:o;return(r+5)/((r===o?t:o)+5)}static lighter(t,o){if(t<0||t>100)return-1;const r=G(t),n=o*(r+5)-5,a=B.ratioOfYs(n,r),s=Math.abs(a-o);if(a<o&&s>.04)return-1;const l=ye(n)+.4;return l<0||l>100?-1:l}static darker(t,o){if(t<0||t>100)return-1;const r=G(t),n=(r+5)/o-5,a=B.ratioOfYs(r,n),s=Math.abs(a-o);if(a<o&&s>.04)return-1;const l=ye(n)-.4;return l<0||l>100?-1:l}static lighterUnsafe(t,o){const r=B.lighter(t,o);return r<0?100:r}static darkerUnsafe(t,o){const r=B.darker(t,o);return r<0?0:r}}class ke{static isDisliked(t){const o=Math.round(t.hue)>=90&&Math.round(t.hue)<=111,r=Math.round(t.chroma)>16,n=Math.round(t.tone)<65;return o&&r&&n}static fixIfDisliked(t){return ke.isDisliked(t)?I.from(t.hue,t.chroma,70):t}}class u{static fromPalette(t){return new u(t.name??"",t.palette,t.tone,t.isBackground??!1,t.background,t.secondBackground,t.contrastCurve,t.toneDeltaPair)}constructor(t,o,r,n,a,s,l,h){if(this.name=t,this.palette=o,this.tone=r,this.isBackground=n,this.background=a,this.secondBackground=s,this.contrastCurve=l,this.toneDeltaPair=h,this.hctCache=new Map,!a&&s)throw new Error(`Color ${t} has secondBackgrounddefined, but background is not defined.`);if(!a&&l)throw new Error(`Color ${t} has contrastCurvedefined, but background is not defined.`);if(a&&!l)throw new Error(`Color ${t} has backgrounddefined, but contrastCurve is not defined.`)}getArgb(t){return this.getHct(t).toInt()}getHct(t){const o=this.hctCache.get(t);if(o!=null)return o;const r=this.getTone(t),n=this.palette(t).getHct(r);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(t,n),n}getTone(t){const o=t.contrastLevel<0;if(this.toneDeltaPair){const r=this.toneDeltaPair(t),n=r.roleA,a=r.roleB,s=r.delta,l=r.polarity,h=r.stayTogether,i=this.background(t).getTone(t),m=l==="nearer"||l==="lighter"&&!t.isDark||l==="darker"&&t.isDark,g=m?n:a,k=m?a:n,b=this.name===g.name,y=t.isDark?1:-1,C=g.contrastCurve.get(t.contrastLevel),P=k.contrastCurve.get(t.contrastLevel),D=g.tone(t);let x=B.ratioOfTones(i,D)>=C?D:u.foregroundTone(i,C);const F=k.tone(t);let w=B.ratioOfTones(i,F)>=P?F:u.foregroundTone(i,P);return o&&(x=u.foregroundTone(i,C),w=u.foregroundTone(i,P)),(w-x)*y>=s||(w=ie(0,100,x+s*y),(w-x)*y>=s||(x=ie(0,100,w-s*y))),50<=x&&x<60?y>0?(x=60,w=Math.max(w,x+s*y)):(x=49,w=Math.min(w,x+s*y)):50<=w&&w<60&&(h?y>0?(x=60,w=Math.max(w,x+s*y)):(x=49,w=Math.min(w,x+s*y)):w=y>0?60:49),b?x:w}{let r=this.tone(t);if(this.background==null)return r;const n=this.background(t).getTone(t),a=this.contrastCurve.get(t.contrastLevel);if(B.ratioOfTones(n,r)>=a||(r=u.foregroundTone(n,a)),o&&(r=u.foregroundTone(n,a)),this.isBackground&&50<=r&&r<60&&(r=B.ratioOfTones(49,n)>=a?49:60),this.secondBackground){const[s,l]=[this.background,this.secondBackground],[h,i]=[s(t).getTone(t),l(t).getTone(t)],[m,g]=[Math.max(h,i),Math.min(h,i)];if(B.ratioOfTones(m,r)>=a&&B.ratioOfTones(g,r)>=a)return r;const k=B.lighter(m,a),b=B.darker(g,a),y=[];return k!==-1&&y.push(k),b!==-1&&y.push(b),u.tonePrefersLightForeground(h)||u.tonePrefersLightForeground(i)?k<0?100:k:y.length===1?y[0]:b<0?0:b}return r}}static foregroundTone(t,o){const r=B.lighterUnsafe(t,o),n=B.darkerUnsafe(t,o),a=B.ratioOfTones(r,t),s=B.ratioOfTones(n,t);if(u.tonePrefersLightForeground(t)){const l=Math.abs(a-s)<.1&&a<o&&s<o;return a>=o||a>=s||l?r:n}return s>=o||s>=a?n:r}static tonePrefersLightForeground(t){return Math.round(t)<60}static toneAllowsLightForeground(t){return Math.round(t)<=49}static enableLightForeground(t){return u.tonePrefersLightForeground(t)&&!u.toneAllowsLightForeground(t)?49:t}}class L{static fromInt(t){const o=I.fromInt(t);return L.fromHct(o)}static fromHct(t){return new L(t.hue,t.chroma,t)}static fromHueAndChroma(t,o){const r=new ze(t,o).create();return new L(t,o,r)}constructor(t,o,r){this.hue=t,this.chroma=o,this.keyColor=r,this.cache=new Map}tone(t){let o=this.cache.get(t);return o===void 0&&(o=I.from(this.hue,this.chroma,t).toInt(),this.cache.set(t,o)),o}getHct(t){return I.fromInt(this.tone(t))}}class ze{constructor(t,o){this.hue=t,this.requestedChroma=o,this.chromaCache=new Map,this.maxChromaValue=200}create(){let t=0,o=100;for(;t<o;){const r=Math.floor((t+o)/2),n=this.maxChroma(r)<this.maxChroma(r+1);if(this.maxChroma(r)>=this.requestedChroma-.01)if(Math.abs(t-50)<Math.abs(o-50))o=r;else{if(t===r)return I.from(this.hue,this.requestedChroma,t);t=r}else n?t=r+1:o=r}return I.from(this.hue,this.requestedChroma,t)}maxChroma(t){if(this.chromaCache.has(t))return this.chromaCache.get(t);const o=I.from(this.hue,this.maxChromaValue,t).chroma;return this.chromaCache.set(t,o),o}}class p{constructor(t,o,r,n){this.low=t,this.normal=o,this.medium=r,this.high=n}get(t){return t<=-1?this.low:t<0?te(this.low,this.normal,(t- -1)/1):t<.5?te(this.normal,this.medium,(t-0)/.5):t<1?te(this.medium,this.high,(t-.5)/.5):this.high}}class H{constructor(t,o,r,n,a){this.roleA=t,this.roleB=o,this.delta=r,this.polarity=n,this.stayTogether=a}}var re;function W(e){return e.variant===re.FIDELITY||e.variant===re.CONTENT}function S(e){return e.variant===re.MONOCHROME}(function(e){e[e.MONOCHROME=0]="MONOCHROME",e[e.NEUTRAL=1]="NEUTRAL",e[e.TONAL_SPOT=2]="TONAL_SPOT",e[e.VIBRANT=3]="VIBRANT",e[e.EXPRESSIVE=4]="EXPRESSIVE",e[e.FIDELITY=5]="FIDELITY",e[e.CONTENT=6]="CONTENT",e[e.RAINBOW=7]="RAINBOW",e[e.FRUIT_SALAD=8]="FRUIT_SALAD"})(re||(re={}));class c{static highestSurface(t){return t.isDark?c.surfaceBright:c.surfaceDim}}c.contentAccentToneDelta=15,c.primaryPaletteKeyColor=u.fromPalette({name:"primary_palette_key_color",palette:e=>e.primaryPalette,tone:e=>e.primaryPalette.keyColor.tone}),c.secondaryPaletteKeyColor=u.fromPalette({name:"secondary_palette_key_color",palette:e=>e.secondaryPalette,tone:e=>e.secondaryPalette.keyColor.tone}),c.tertiaryPaletteKeyColor=u.fromPalette({name:"tertiary_palette_key_color",palette:e=>e.tertiaryPalette,tone:e=>e.tertiaryPalette.keyColor.tone}),c.neutralPaletteKeyColor=u.fromPalette({name:"neutral_palette_key_color",palette:e=>e.neutralPalette,tone:e=>e.neutralPalette.keyColor.tone}),c.neutralVariantPaletteKeyColor=u.fromPalette({name:"neutral_variant_palette_key_color",palette:e=>e.neutralVariantPalette,tone:e=>e.neutralVariantPalette.keyColor.tone}),c.background=u.fromPalette({name:"background",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0}),c.onBackground=u.fromPalette({name:"on_background",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>c.background,contrastCurve:new p(3,3,4.5,7)}),c.surface=u.fromPalette({name:"surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0}),c.surfaceDim=u.fromPalette({name:"surface_dim",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:new p(87,87,80,75).get(e.contrastLevel),isBackground:!0}),c.surfaceBright=u.fromPalette({name:"surface_bright",palette:e=>e.neutralPalette,tone:e=>e.isDark?new p(24,24,29,34).get(e.contrastLevel):98,isBackground:!0}),c.surfaceContainerLowest=u.fromPalette({name:"surface_container_lowest",palette:e=>e.neutralPalette,tone:e=>e.isDark?new p(4,4,2,0).get(e.contrastLevel):100,isBackground:!0}),c.surfaceContainerLow=u.fromPalette({name:"surface_container_low",palette:e=>e.neutralPalette,tone:e=>e.isDark?new p(10,10,11,12).get(e.contrastLevel):new p(96,96,96,95).get(e.contrastLevel),isBackground:!0}),c.surfaceContainer=u.fromPalette({name:"surface_container",palette:e=>e.neutralPalette,tone:e=>e.isDark?new p(12,12,16,20).get(e.contrastLevel):new p(94,94,92,90).get(e.contrastLevel),isBackground:!0}),c.surfaceContainerHigh=u.fromPalette({name:"surface_container_high",palette:e=>e.neutralPalette,tone:e=>e.isDark?new p(17,17,21,25).get(e.contrastLevel):new p(92,92,88,85).get(e.contrastLevel),isBackground:!0}),c.surfaceContainerHighest=u.fromPalette({name:"surface_container_highest",palette:e=>e.neutralPalette,tone:e=>e.isDark?new p(22,22,26,30).get(e.contrastLevel):new p(90,90,84,80).get(e.contrastLevel),isBackground:!0}),c.onSurface=u.fromPalette({name:"on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>c.highestSurface(e),contrastCurve:new p(4.5,7,11,21)}),c.surfaceVariant=u.fromPalette({name:"surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:90,isBackground:!0}),c.onSurfaceVariant=u.fromPalette({name:"on_surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?80:30,background:e=>c.highestSurface(e),contrastCurve:new p(3,4.5,7,11)}),c.inverseSurface=u.fromPalette({name:"inverse_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:20}),c.inverseOnSurface=u.fromPalette({name:"inverse_on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?20:95,background:e=>c.inverseSurface,contrastCurve:new p(4.5,7,11,21)}),c.outline=u.fromPalette({name:"outline",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?60:50,background:e=>c.highestSurface(e),contrastCurve:new p(1.5,3,4.5,7)}),c.outlineVariant=u.fromPalette({name:"outline_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:80,background:e=>c.highestSurface(e),contrastCurve:new p(1,1,3,4.5)}),c.shadow=u.fromPalette({name:"shadow",palette:e=>e.neutralPalette,tone:e=>0}),c.scrim=u.fromPalette({name:"scrim",palette:e=>e.neutralPalette,tone:e=>0}),c.surfaceTint=u.fromPalette({name:"surface_tint",palette:e=>e.primaryPalette,tone:e=>e.isDark?80:40,isBackground:!0}),c.primary=u.fromPalette({name:"primary",palette:e=>e.primaryPalette,tone:e=>S(e)?e.isDark?100:0:e.isDark?80:40,isBackground:!0,background:e=>c.highestSurface(e),contrastCurve:new p(3,4.5,7,7),toneDeltaPair:e=>new H(c.primaryContainer,c.primary,10,"nearer",!1)}),c.onPrimary=u.fromPalette({name:"on_primary",palette:e=>e.primaryPalette,tone:e=>S(e)?e.isDark?10:90:e.isDark?20:100,background:e=>c.primary,contrastCurve:new p(4.5,7,11,21)}),c.primaryContainer=u.fromPalette({name:"primary_container",palette:e=>e.primaryPalette,tone:e=>W(e)?e.sourceColorHct.tone:S(e)?e.isDark?85:25:e.isDark?30:90,isBackground:!0,background:e=>c.highestSurface(e),contrastCurve:new p(1,1,3,4.5),toneDeltaPair:e=>new H(c.primaryContainer,c.primary,10,"nearer",!1)}),c.onPrimaryContainer=u.fromPalette({name:"on_primary_container",palette:e=>e.primaryPalette,tone:e=>W(e)?u.foregroundTone(c.primaryContainer.tone(e),4.5):S(e)?e.isDark?0:100:e.isDark?90:30,background:e=>c.primaryContainer,contrastCurve:new p(3,4.5,7,11)}),c.inversePrimary=u.fromPalette({name:"inverse_primary",palette:e=>e.primaryPalette,tone:e=>e.isDark?40:80,background:e=>c.inverseSurface,contrastCurve:new p(3,4.5,7,7)}),c.secondary=u.fromPalette({name:"secondary",palette:e=>e.secondaryPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>c.highestSurface(e),contrastCurve:new p(3,4.5,7,7),toneDeltaPair:e=>new H(c.secondaryContainer,c.secondary,10,"nearer",!1)}),c.onSecondary=u.fromPalette({name:"on_secondary",palette:e=>e.secondaryPalette,tone:e=>S(e)?e.isDark?10:100:e.isDark?20:100,background:e=>c.secondary,contrastCurve:new p(4.5,7,11,21)}),c.secondaryContainer=u.fromPalette({name:"secondary_container",palette:e=>e.secondaryPalette,tone:e=>{const t=e.isDark?30:90;return S(e)?e.isDark?30:85:W(e)?function(o,r,n,a){let s=n,l=I.from(o,r,n);if(l.chroma<r){let h=l.chroma;for(;l.chroma<r;){s+=a?-1:1;const i=I.from(o,r,s);if(h>i.chroma||Math.abs(i.chroma-r)<.4)break;Math.abs(i.chroma-r)<Math.abs(l.chroma-r)&&(l=i),h=Math.max(h,i.chroma)}}return s}(e.secondaryPalette.hue,e.secondaryPalette.chroma,t,!e.isDark):t},isBackground:!0,background:e=>c.highestSurface(e),contrastCurve:new p(1,1,3,4.5),toneDeltaPair:e=>new H(c.secondaryContainer,c.secondary,10,"nearer",!1)}),c.onSecondaryContainer=u.fromPalette({name:"on_secondary_container",palette:e=>e.secondaryPalette,tone:e=>S(e)?e.isDark?90:10:W(e)?u.foregroundTone(c.secondaryContainer.tone(e),4.5):e.isDark?90:30,background:e=>c.secondaryContainer,contrastCurve:new p(3,4.5,7,11)}),c.tertiary=u.fromPalette({name:"tertiary",palette:e=>e.tertiaryPalette,tone:e=>S(e)?e.isDark?90:25:e.isDark?80:40,isBackground:!0,background:e=>c.highestSurface(e),contrastCurve:new p(3,4.5,7,7),toneDeltaPair:e=>new H(c.tertiaryContainer,c.tertiary,10,"nearer",!1)}),c.onTertiary=u.fromPalette({name:"on_tertiary",palette:e=>e.tertiaryPalette,tone:e=>S(e)?e.isDark?10:90:e.isDark?20:100,background:e=>c.tertiary,contrastCurve:new p(4.5,7,11,21)}),c.tertiaryContainer=u.fromPalette({name:"tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>{if(S(e))return e.isDark?60:49;if(!W(e))return e.isDark?30:90;const t=e.tertiaryPalette.getHct(e.sourceColorHct.tone);return ke.fixIfDisliked(t).tone},isBackground:!0,background:e=>c.highestSurface(e),contrastCurve:new p(1,1,3,4.5),toneDeltaPair:e=>new H(c.tertiaryContainer,c.tertiary,10,"nearer",!1)}),c.onTertiaryContainer=u.fromPalette({name:"on_tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>S(e)?e.isDark?0:100:W(e)?u.foregroundTone(c.tertiaryContainer.tone(e),4.5):e.isDark?90:30,background:e=>c.tertiaryContainer,contrastCurve:new p(3,4.5,7,11)}),c.error=u.fromPalette({name:"error",palette:e=>e.errorPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>c.highestSurface(e),contrastCurve:new p(3,4.5,7,7),toneDeltaPair:e=>new H(c.errorContainer,c.error,10,"nearer",!1)}),c.onError=u.fromPalette({name:"on_error",palette:e=>e.errorPalette,tone:e=>e.isDark?20:100,background:e=>c.error,contrastCurve:new p(4.5,7,11,21)}),c.errorContainer=u.fromPalette({name:"error_container",palette:e=>e.errorPalette,tone:e=>e.isDark?30:90,isBackground:!0,background:e=>c.highestSurface(e),contrastCurve:new p(1,1,3,4.5),toneDeltaPair:e=>new H(c.errorContainer,c.error,10,"nearer",!1)}),c.onErrorContainer=u.fromPalette({name:"on_error_container",palette:e=>e.errorPalette,tone:e=>S(e)?e.isDark?90:10:e.isDark?90:30,background:e=>c.errorContainer,contrastCurve:new p(3,4.5,7,11)}),c.primaryFixed=u.fromPalette({name:"primary_fixed",palette:e=>e.primaryPalette,tone:e=>S(e)?40:90,isBackground:!0,background:e=>c.highestSurface(e),contrastCurve:new p(1,1,3,4.5),toneDeltaPair:e=>new H(c.primaryFixed,c.primaryFixedDim,10,"lighter",!0)}),c.primaryFixedDim=u.fromPalette({name:"primary_fixed_dim",palette:e=>e.primaryPalette,tone:e=>S(e)?30:80,isBackground:!0,background:e=>c.highestSurface(e),contrastCurve:new p(1,1,3,4.5),toneDeltaPair:e=>new H(c.primaryFixed,c.primaryFixedDim,10,"lighter",!0)}),c.onPrimaryFixed=u.fromPalette({name:"on_primary_fixed",palette:e=>e.primaryPalette,tone:e=>S(e)?100:10,background:e=>c.primaryFixedDim,secondBackground:e=>c.primaryFixed,contrastCurve:new p(4.5,7,11,21)}),c.onPrimaryFixedVariant=u.fromPalette({name:"on_primary_fixed_variant",palette:e=>e.primaryPalette,tone:e=>S(e)?90:30,background:e=>c.primaryFixedDim,secondBackground:e=>c.primaryFixed,contrastCurve:new p(3,4.5,7,11)}),c.secondaryFixed=u.fromPalette({name:"secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>S(e)?80:90,isBackground:!0,background:e=>c.highestSurface(e),contrastCurve:new p(1,1,3,4.5),toneDeltaPair:e=>new H(c.secondaryFixed,c.secondaryFixedDim,10,"lighter",!0)}),c.secondaryFixedDim=u.fromPalette({name:"secondary_fixed_dim",palette:e=>e.secondaryPalette,tone:e=>S(e)?70:80,isBackground:!0,background:e=>c.highestSurface(e),contrastCurve:new p(1,1,3,4.5),toneDeltaPair:e=>new H(c.secondaryFixed,c.secondaryFixedDim,10,"lighter",!0)}),c.onSecondaryFixed=u.fromPalette({name:"on_secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>10,background:e=>c.secondaryFixedDim,secondBackground:e=>c.secondaryFixed,contrastCurve:new p(4.5,7,11,21)}),c.onSecondaryFixedVariant=u.fromPalette({name:"on_secondary_fixed_variant",palette:e=>e.secondaryPalette,tone:e=>S(e)?25:30,background:e=>c.secondaryFixedDim,secondBackground:e=>c.secondaryFixed,contrastCurve:new p(3,4.5,7,11)}),c.tertiaryFixed=u.fromPalette({name:"tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>S(e)?40:90,isBackground:!0,background:e=>c.highestSurface(e),contrastCurve:new p(1,1,3,4.5),toneDeltaPair:e=>new H(c.tertiaryFixed,c.tertiaryFixedDim,10,"lighter",!0)}),c.tertiaryFixedDim=u.fromPalette({name:"tertiary_fixed_dim",palette:e=>e.tertiaryPalette,tone:e=>S(e)?30:80,isBackground:!0,background:e=>c.highestSurface(e),contrastCurve:new p(1,1,3,4.5),toneDeltaPair:e=>new H(c.tertiaryFixed,c.tertiaryFixedDim,10,"lighter",!0)}),c.onTertiaryFixed=u.fromPalette({name:"on_tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>S(e)?100:10,background:e=>c.tertiaryFixedDim,secondBackground:e=>c.tertiaryFixed,contrastCurve:new p(4.5,7,11,21)}),c.onTertiaryFixedVariant=u.fromPalette({name:"on_tertiary_fixed_variant",palette:e=>e.tertiaryPalette,tone:e=>S(e)?90:30,background:e=>c.tertiaryFixedDim,secondBackground:e=>c.tertiaryFixed,contrastCurve:new p(3,4.5,7,11)});class V{static of(t){return new V(t,!1)}static contentOf(t){return new V(t,!0)}static fromColors(t){return V.createPaletteFromColors(!1,t)}static contentFromColors(t){return V.createPaletteFromColors(!0,t)}static createPaletteFromColors(t,o){const r=new V(o.primary,t);if(o.secondary){const n=new V(o.secondary,t);r.a2=n.a1}if(o.tertiary){const n=new V(o.tertiary,t);r.a3=n.a1}if(o.error){const n=new V(o.error,t);r.error=n.a1}if(o.neutral){const n=new V(o.neutral,t);r.n1=n.n1}if(o.neutralVariant){const n=new V(o.neutralVariant,t);r.n2=n.n2}return r}constructor(t,o){const r=I.fromInt(t),n=r.hue,a=r.chroma;o?(this.a1=L.fromHueAndChroma(n,a),this.a2=L.fromHueAndChroma(n,a/3),this.a3=L.fromHueAndChroma(n+60,a/2),this.n1=L.fromHueAndChroma(n,Math.min(a/12,4)),this.n2=L.fromHueAndChroma(n,Math.min(a/6,8))):(this.a1=L.fromHueAndChroma(n,Math.max(48,a)),this.a2=L.fromHueAndChroma(n,16),this.a3=L.fromHueAndChroma(n+60,24),this.n1=L.fromHueAndChroma(n,4),this.n2=L.fromHueAndChroma(n,8)),this.error=L.fromHueAndChroma(25,84)}}class ${get primary(){return this.props.primary}get onPrimary(){return this.props.onPrimary}get primaryContainer(){return this.props.primaryContainer}get onPrimaryContainer(){return this.props.onPrimaryContainer}get secondary(){return this.props.secondary}get onSecondary(){return this.props.onSecondary}get secondaryContainer(){return this.props.secondaryContainer}get onSecondaryContainer(){return this.props.onSecondaryContainer}get tertiary(){return this.props.tertiary}get onTertiary(){return this.props.onTertiary}get tertiaryContainer(){return this.props.tertiaryContainer}get onTertiaryContainer(){return this.props.onTertiaryContainer}get error(){return this.props.error}get onError(){return this.props.onError}get errorContainer(){return this.props.errorContainer}get onErrorContainer(){return this.props.onErrorContainer}get background(){return this.props.background}get onBackground(){return this.props.onBackground}get surface(){return this.props.surface}get onSurface(){return this.props.onSurface}get surfaceVariant(){return this.props.surfaceVariant}get onSurfaceVariant(){return this.props.onSurfaceVariant}get outline(){return this.props.outline}get outlineVariant(){return this.props.outlineVariant}get shadow(){return this.props.shadow}get scrim(){return this.props.scrim}get inverseSurface(){return this.props.inverseSurface}get inverseOnSurface(){return this.props.inverseOnSurface}get inversePrimary(){return this.props.inversePrimary}static light(t){return $.lightFromCorePalette(V.of(t))}static dark(t){return $.darkFromCorePalette(V.of(t))}static lightContent(t){return $.lightFromCorePalette(V.contentOf(t))}static darkContent(t){return $.darkFromCorePalette(V.contentOf(t))}static lightFromCorePalette(t){return new $({primary:t.a1.tone(40),onPrimary:t.a1.tone(100),primaryContainer:t.a1.tone(90),onPrimaryContainer:t.a1.tone(10),secondary:t.a2.tone(40),onSecondary:t.a2.tone(100),secondaryContainer:t.a2.tone(90),onSecondaryContainer:t.a2.tone(10),tertiary:t.a3.tone(40),onTertiary:t.a3.tone(100),tertiaryContainer:t.a3.tone(90),onTertiaryContainer:t.a3.tone(10),error:t.error.tone(40),onError:t.error.tone(100),errorContainer:t.error.tone(90),onErrorContainer:t.error.tone(10),background:t.n1.tone(99),onBackground:t.n1.tone(10),surface:t.n1.tone(99),onSurface:t.n1.tone(10),surfaceVariant:t.n2.tone(90),onSurfaceVariant:t.n2.tone(30),outline:t.n2.tone(50),outlineVariant:t.n2.tone(80),shadow:t.n1.tone(0),scrim:t.n1.tone(0),inverseSurface:t.n1.tone(20),inverseOnSurface:t.n1.tone(95),inversePrimary:t.a1.tone(80)})}static darkFromCorePalette(t){return new $({primary:t.a1.tone(80),onPrimary:t.a1.tone(20),primaryContainer:t.a1.tone(30),onPrimaryContainer:t.a1.tone(90),secondary:t.a2.tone(80),onSecondary:t.a2.tone(20),secondaryContainer:t.a2.tone(30),onSecondaryContainer:t.a2.tone(90),tertiary:t.a3.tone(80),onTertiary:t.a3.tone(20),tertiaryContainer:t.a3.tone(30),onTertiaryContainer:t.a3.tone(90),error:t.error.tone(80),onError:t.error.tone(20),errorContainer:t.error.tone(30),onErrorContainer:t.error.tone(80),background:t.n1.tone(10),onBackground:t.n1.tone(90),surface:t.n1.tone(10),onSurface:t.n1.tone(90),surfaceVariant:t.n2.tone(30),onSurfaceVariant:t.n2.tone(80),outline:t.n2.tone(60),outlineVariant:t.n2.tone(30),shadow:t.n1.tone(0),scrim:t.n1.tone(0),inverseSurface:t.n1.tone(90),inverseOnSurface:t.n1.tone(20),inversePrimary:t.a1.tone(40)})}constructor(t){this.props=t}toJSON(){return{...this.props}}}function Pe(e){const t=(e=e.replace("#","")).length===3,o=e.length===6,r=e.length===8;if(!t&&!o&&!r)throw new Error("unexpected hex "+e);let n=0,a=0,s=0;return t?(n=Y(e.slice(0,1).repeat(2)),a=Y(e.slice(1,2).repeat(2)),s=Y(e.slice(2,3).repeat(2))):o?(n=Y(e.slice(0,2)),a=Y(e.slice(2,4)),s=Y(e.slice(4,6))):r&&(n=Y(e.slice(2,4)),a=Y(e.slice(4,6)),s=Y(e.slice(6,8))),(255<<24|(255&n)<<16|(255&a)<<8|255&s)>>>0}function Y(e){return parseInt(e,16)}function Ne(e,t=[]){const o=V.of(e);return{source:e,schemes:{light:$.light(e),dark:$.dark(e)},palettes:{primary:o.a1,secondary:o.a2,tertiary:o.a3,neutral:o.n1,neutralVariant:o.n2,error:o.error},customColors:t.map(r=>function(n,a){let s=a.value;const l=s,h=n;a.blend&&(s=ge.harmonize(l,h));const i=V.of(s),m=i.a1;return{color:a,value:s,light:{color:m.tone(40),onColor:m.tone(100),colorContainer:m.tone(90),onColorContainer:m.tone(10)},dark:{color:m.tone(80),onColor:m.tone(20),colorContainer:m.tone(30),onColorContainer:m.tone(90)}}}(e,r))}}const qe=Me.n("theme-context");function Te(e,t=!1,o){function r(n){return"#"+n.toString(16).padStart(8,"0").slice(2)}if(t){const n=e.schemes.dark,a=function(l,h){const i=L.fromHueAndChroma(l,h);return{cLowest:i.tone(0),cLow:i.tone(10),c:i.tone(12),cHigh:i.tone(17),cHighest:i.tone(22),sDim:i.tone(0),s:i.tone(6),sBright:i.tone(24)}}(e.palettes.neutral.hue,e.palettes.neutral.chroma),s=function(l){const h=I.fromInt(l),i=L.fromHueAndChroma(h.hue,h.chroma);return{default:i.tone(80),on:i.tone(20),container:i.tone(30),onContainer:i.tone(90)}}(o);return{sys:{color:{scrim:r(n.scrim),outlineVariant:r(n.outlineVariant),outline:r(n.outline),surface:{default:r(n.surface),dim:r(a.sDim),bright:r(a.sBright),on:r(n.onSurface),onVariant:r(n.onSurfaceVariant),highest:r(a.cHighest),high:r(a.cHigh),container:r(a.c),low:r(a.cLow),lowest:r(a.cLowest)},primary:{default:r(n.primary),on:r(n.onPrimary),container:r(n.primaryContainer),onContainer:r(n.onPrimaryContainer)},secondary:{default:r(n.secondary),on:r(n.onSecondary),container:r(n.secondaryContainer),onContainer:r(n.onSecondaryContainer)},tertiary:{default:r(n.tertiary),on:r(n.onTertiary),container:r(n.tertiaryContainer),onContainer:r(n.onTertiaryContainer)},error:{default:r(n.error),on:r(n.onError),container:r(n.errorContainer),onContainer:r(n.onErrorContainer)},success:{default:r(s.default),on:r(s.on),container:r(s.container),onContainer:r(s.onContainer)}},elevation:{0:"0 0 0 0 rgba(0, 0, 0, 0)",1:"rgba(0, 0, 0, 0.2) 0px 2px 1px -1px, rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px",2:"rgba(0, 0, 0, 0.2) 0px 3px 3px -2px, rgba(0, 0, 0, 0.14) 0px 3px 4px 0px, rgba(0, 0, 0, 0.12) 0px 1px 8px 0px",3:"rgba(0, 0, 0, 0.2) 0px 3px 5px -1px, rgba(0, 0, 0, 0.14) 0px 6px 10px 0px, rgba(0, 0, 0, 0.12) 0px 1px 18px 0px",4:"rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, rgba(0, 0, 0, 0.12) 0px 3px 14px 2px",5:"rgba(0, 0, 0, 0.2) 0px 7px 8px -4px, rgba(0, 0, 0, 0.14) 0px 12px 17px 2px, rgba(0, 0, 0, 0.12) 0px 5px 22px 4px"},outline:{1:"1px"}}}}{const n=e.schemes.light,a=function(l,h){const i=L.fromHueAndChroma(l,h);return{cLowest:i.tone(100),cLow:i.tone(96),c:i.tone(94),cHigh:i.tone(92),cHighest:i.tone(90),sDim:i.tone(87),s:i.tone(98),sBright:i.tone(100)}}(e.palettes.neutral.hue,e.palettes.neutral.chroma),s=function(l){const h=I.fromInt(l),i=L.fromHueAndChroma(h.hue,h.chroma);return{default:i.tone(40),on:i.tone(100),container:i.tone(90),onContainer:i.tone(10)}}(o);return{sys:{color:{scrim:r(n.scrim),outlineVariant:r(n.outlineVariant),outline:r(n.outline),surface:{default:r(n.surface),dim:r(a.sDim),bright:r(a.sBright),on:r(n.onSurface),onVariant:r(n.onSurfaceVariant),highest:r(a.cHighest),high:r(a.cHigh),container:r(a.c),low:r(a.cLow),lowest:r(a.cLowest)},primary:{default:r(n.primary),on:r(n.onPrimary),container:r(n.primaryContainer),onContainer:r(n.onPrimaryContainer)},secondary:{default:r(n.secondary),on:r(n.onSecondary),container:r(n.secondaryContainer),onContainer:r(n.onSecondaryContainer)},tertiary:{default:r(n.tertiary),on:r(n.onTertiary),container:r(n.tertiaryContainer),onContainer:r(n.onTertiaryContainer)},error:{default:r(n.error),on:r(n.onError),container:r(n.errorContainer),onContainer:r(n.onErrorContainer)},success:{default:r(s.default),on:r(s.on),container:r(s.container),onContainer:r(s.onContainer)}},elevation:{0:"0 0 0 0 rgba(0, 0, 0, 0)",1:"rgba(0, 0, 0, 0.2) 0px 2px 1px -1px, rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px",2:"rgba(0, 0, 0, 0.2) 0px 3px 3px -2px, rgba(0, 0, 0, 0.14) 0px 3px 4px 0px, rgba(0, 0, 0, 0.12) 0px 1px 8px 0px",3:"rgba(0, 0, 0, 0.2) 0px 3px 5px -1px, rgba(0, 0, 0, 0.14) 0px 6px 10px 0px, rgba(0, 0, 0, 0.12) 0px 1px 18px 0px",4:"rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, rgba(0, 0, 0, 0.12) 0px 3px 14px 2px",5:"rgba(0, 0, 0, 0.2) 0px 7px 8px -4px, rgba(0, 0, 0, 0.14) 0px 12px 17px 2px, rgba(0, 0, 0, 0.12) 0px 5px 22px 4px"},outline:{1:"1px"}}}}}var Ue=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,ee=(e,t,o,r)=>{for(var n,a=r>1?void 0:r?_e(t,o):t,s=e.length-1;s>=0;s--)(n=e[s])&&(a=(r?n(t,o,a):n(a))||a);return r&&a&&Ue(t,o,a),a};const xe="theme-where-are-you",we="theme-here-i-am",Ie=Se.unsafeCSS(':host,:root{--md-ref-typeface-brand: "Josefin Sans", sans-serif;--md-ref-typeface-plain: "Josefin Sans", sans-serif;--md-sys-color-primary: var(--schmancy-sys-color-primary-default);--md-sys-color-secondary: var(--schmancy-sys-color-secondary-default);--default-font-family: var(--schmancy-font-family);--border-style: solid;--spacing: 4px;--color-scrim: var(--schmancy-sys-color-scrim);--color-outline: var(--schmancy-sys-color-outline);--color-outlineVariant: var(--schmancy-sys-color-outlineVariant);--color-surface-default: var(--schmancy-sys-color-surface-default);--color-surface-dim: var(--schmancy-sys-color-surface-dim);--color-surface-bright: var(--schmancy-sys-color-surface-bright);--color-surface-container: var(--schmancy-sys-color-surface-container);--color-surface-low: var(--schmancy-sys-color-surface-low);--color-surface-high: var(--schmancy-sys-color-surface-high);--color-surface-highest: var(--schmancy-sys-color-surface-highest);--color-surface-lowest: var(--schmancy-sys-color-surface-lowest);--color-surface-on: var(--schmancy-sys-color-surface-on);--color-surface-onVariant: var(--schmancy-sys-color-surface-onVariant);--color-primary-default: var(--schmancy-sys-color-primary-default);--color-primary-on: var(--schmancy-sys-color-primary-on);--color-primary-container: var(--schmancy-sys-color-primary-container);--color-primary-onContainer: var(--schmancy-sys-color-primary-onContainer);--color-secondary-default: var(--schmancy-sys-color-secondary-default);--color-secondary-on: var(--schmancy-sys-color-secondary-on);--color-secondary-container: var(--schmancy-sys-color-secondary-container);--color-secondary-onContainer: var(--schmancy-sys-color-secondary-onContainer);--color-tertiary-default: var(--schmancy-sys-color-tertiary-default);--color-tertiary-on: var(--schmancy-sys-color-tertiary-on);--color-tertiary-container: var(--schmancy-sys-color-tertiary-container);--color-tertiary-onContainer: var(--schmancy-sys-color-tertiary-onContainer);--color-error-default: var(--schmancy-sys-color-error-default);--color-error-on: var(--schmancy-sys-color-error-on);--color-error-container: var(--schmancy-sys-color-error-container);--color-error-onContainer: var(--schmancy-sys-color-error-onContainer);--color-success-default: var(--schmancy-sys-color-success-default);--color-success-on: var(--schmancy-sys-color-success-on);--color-success-container: var(--schmancy-sys-color-success-container);--color-success-onContainer: var(--schmancy-sys-color-success-onContainer);--shadow-xs: var(--schmancy-sys-elevation-0);--shadow-sm: var(--schmancy-sys-elevation-1);--shadow-md: var(--schmancy-sys-elevation-2);--shadow-lg: var(--schmancy-sys-elevation-3);--shadow-xl: var(--schmancy-sys-elevation-4);--shadow-2xl: var(--schmancy-sys-elevation-5);--outline-1: var(--schmancy-sys-outline-1);--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50: oklch(.971 .013 17.38);--color-red-100: oklch(.936 .032 17.717);--color-red-200: oklch(.885 .062 18.334);--color-red-300: oklch(.808 .114 19.571);--color-red-400: oklch(.704 .191 22.216);--color-red-500: oklch(.637 .237 25.331);--color-red-600: oklch(.577 .245 27.325);--color-red-700: oklch(.505 .213 27.518);--color-red-800: oklch(.444 .177 26.899);--color-red-900: oklch(.396 .141 25.723);--color-red-950: oklch(.258 .092 26.042);--color-orange-50: oklch(.98 .016 73.684);--color-orange-100: oklch(.954 .038 75.164);--color-orange-200: oklch(.901 .076 70.697);--color-orange-300: oklch(.837 .128 66.29);--color-orange-400: oklch(.75 .183 55.934);--color-orange-500: oklch(.705 .213 47.604);--color-orange-600: oklch(.646 .222 41.116);--color-orange-700: oklch(.553 .195 38.402);--color-orange-800: oklch(.47 .157 37.304);--color-orange-900: oklch(.408 .123 38.172);--color-orange-950: oklch(.266 .079 36.259);--color-amber-50: oklch(.987 .022 95.277);--color-amber-100: oklch(.962 .059 95.617);--color-amber-200: oklch(.924 .12 95.746);--color-amber-300: oklch(.879 .169 91.605);--color-amber-400: oklch(.828 .189 84.429);--color-amber-500: oklch(.769 .188 70.08);--color-amber-600: oklch(.666 .179 58.318);--color-amber-700: oklch(.555 .163 48.998);--color-amber-800: oklch(.473 .137 46.201);--color-amber-900: oklch(.414 .112 45.904);--color-amber-950: oklch(.279 .077 45.635);--color-yellow-50: oklch(.987 .026 102.212);--color-yellow-100: oklch(.973 .071 103.193);--color-yellow-200: oklch(.945 .129 101.54);--color-yellow-300: oklch(.905 .182 98.111);--color-yellow-400: oklch(.852 .199 91.936);--color-yellow-500: oklch(.795 .184 86.047);--color-yellow-600: oklch(.681 .162 75.834);--color-yellow-700: oklch(.554 .135 66.442);--color-yellow-800: oklch(.476 .114 61.907);--color-yellow-900: oklch(.421 .095 57.708);--color-yellow-950: oklch(.286 .066 53.813);--color-lime-50: oklch(.986 .031 120.757);--color-lime-100: oklch(.967 .067 122.328);--color-lime-200: oklch(.938 .127 124.321);--color-lime-300: oklch(.897 .196 126.665);--color-lime-400: oklch(.841 .238 128.85);--color-lime-500: oklch(.768 .233 130.85);--color-lime-600: oklch(.648 .2 131.684);--color-lime-700: oklch(.532 .157 131.589);--color-lime-800: oklch(.453 .124 130.933);--color-lime-900: oklch(.405 .101 131.063);--color-lime-950: oklch(.274 .072 132.109);--color-green-50: oklch(.982 .018 155.826);--color-green-100: oklch(.962 .044 156.743);--color-green-200: oklch(.925 .084 155.995);--color-green-300: oklch(.871 .15 154.449);--color-green-400: oklch(.792 .209 151.711);--color-green-500: oklch(.723 .219 149.579);--color-green-600: oklch(.627 .194 149.214);--color-green-700: oklch(.527 .154 150.069);--color-green-800: oklch(.448 .119 151.328);--color-green-900: oklch(.393 .095 152.535);--color-green-950: oklch(.266 .065 152.934);--color-emerald-50: oklch(.979 .021 166.113);--color-emerald-100: oklch(.95 .052 163.051);--color-emerald-200: oklch(.905 .093 164.15);--color-emerald-300: oklch(.845 .143 164.978);--color-emerald-400: oklch(.765 .177 163.223);--color-emerald-500: oklch(.696 .17 162.48);--color-emerald-600: oklch(.596 .145 163.225);--color-emerald-700: oklch(.508 .118 165.612);--color-emerald-800: oklch(.432 .095 166.913);--color-emerald-900: oklch(.378 .077 168.94);--color-emerald-950: oklch(.262 .051 172.552);--color-teal-50: oklch(.984 .014 180.72);--color-teal-100: oklch(.953 .051 180.801);--color-teal-200: oklch(.91 .096 180.426);--color-teal-300: oklch(.855 .138 181.071);--color-teal-400: oklch(.777 .152 181.912);--color-teal-500: oklch(.704 .14 182.503);--color-teal-600: oklch(.6 .118 184.704);--color-teal-700: oklch(.511 .096 186.391);--color-teal-800: oklch(.437 .078 188.216);--color-teal-900: oklch(.386 .063 188.416);--color-teal-950: oklch(.277 .046 192.524);--color-cyan-50: oklch(.984 .019 200.873);--color-cyan-100: oklch(.956 .045 203.388);--color-cyan-200: oklch(.917 .08 205.041);--color-cyan-300: oklch(.865 .127 207.078);--color-cyan-400: oklch(.789 .154 211.53);--color-cyan-500: oklch(.715 .143 215.221);--color-cyan-600: oklch(.609 .126 221.723);--color-cyan-700: oklch(.52 .105 223.128);--color-cyan-800: oklch(.45 .085 224.283);--color-cyan-900: oklch(.398 .07 227.392);--color-cyan-950: oklch(.302 .056 229.695);--color-sky-50: oklch(.977 .013 236.62);--color-sky-100: oklch(.951 .026 236.824);--color-sky-200: oklch(.901 .058 230.902);--color-sky-300: oklch(.828 .111 230.318);--color-sky-400: oklch(.746 .16 232.661);--color-sky-500: oklch(.685 .169 237.323);--color-sky-600: oklch(.588 .158 241.966);--color-sky-700: oklch(.5 .134 242.749);--color-sky-800: oklch(.443 .11 240.79);--color-sky-900: oklch(.391 .09 240.876);--color-sky-950: oklch(.293 .066 243.157);--color-blue-50: oklch(.97 .014 254.604);--color-blue-100: oklch(.932 .032 255.585);--color-blue-200: oklch(.882 .059 254.128);--color-blue-300: oklch(.809 .105 251.813);--color-blue-400: oklch(.707 .165 254.624);--color-blue-500: oklch(.623 .214 259.815);--color-blue-600: oklch(.546 .245 262.881);--color-blue-700: oklch(.488 .243 264.376);--color-blue-800: oklch(.424 .199 265.638);--color-blue-900: oklch(.379 .146 265.522);--color-blue-950: oklch(.282 .091 267.935);--color-indigo-50: oklch(.962 .018 272.314);--color-indigo-100: oklch(.93 .034 272.788);--color-indigo-200: oklch(.87 .065 274.039);--color-indigo-300: oklch(.785 .115 274.713);--color-indigo-400: oklch(.673 .182 276.935);--color-indigo-500: oklch(.585 .233 277.117);--color-indigo-600: oklch(.511 .262 276.966);--color-indigo-700: oklch(.457 .24 277.023);--color-indigo-800: oklch(.398 .195 277.366);--color-indigo-900: oklch(.359 .144 278.697);--color-indigo-950: oklch(.257 .09 281.288);--color-violet-50: oklch(.969 .016 293.756);--color-violet-100: oklch(.943 .029 294.588);--color-violet-200: oklch(.894 .057 293.283);--color-violet-300: oklch(.811 .111 293.571);--color-violet-400: oklch(.702 .183 293.541);--color-violet-500: oklch(.606 .25 292.717);--color-violet-600: oklch(.541 .281 293.009);--color-violet-700: oklch(.491 .27 292.581);--color-violet-800: oklch(.432 .232 292.759);--color-violet-900: oklch(.38 .189 293.745);--color-violet-950: oklch(.283 .141 291.089);--color-purple-50: oklch(.977 .014 308.299);--color-purple-100: oklch(.946 .033 307.174);--color-purple-200: oklch(.902 .063 306.703);--color-purple-300: oklch(.827 .119 306.383);--color-purple-400: oklch(.714 .203 305.504);--color-purple-500: oklch(.627 .265 303.9);--color-purple-600: oklch(.558 .288 302.321);--color-purple-700: oklch(.496 .265 301.924);--color-purple-800: oklch(.438 .218 303.724);--color-purple-900: oklch(.381 .176 304.987);--color-purple-950: oklch(.291 .149 302.717);--color-fuchsia-50: oklch(.977 .017 320.058);--color-fuchsia-100: oklch(.952 .037 318.852);--color-fuchsia-200: oklch(.903 .076 319.62);--color-fuchsia-300: oklch(.833 .145 321.434);--color-fuchsia-400: oklch(.74 .238 322.16);--color-fuchsia-500: oklch(.667 .295 322.15);--color-fuchsia-600: oklch(.591 .293 322.896);--color-fuchsia-700: oklch(.518 .253 323.949);--color-fuchsia-800: oklch(.452 .211 324.591);--color-fuchsia-900: oklch(.401 .17 325.612);--color-fuchsia-950: oklch(.293 .136 325.661);--color-pink-50: oklch(.971 .014 343.198);--color-pink-100: oklch(.948 .028 342.258);--color-pink-200: oklch(.899 .061 343.231);--color-pink-300: oklch(.823 .12 346.018);--color-pink-400: oklch(.718 .202 349.761);--color-pink-500: oklch(.656 .241 354.308);--color-pink-600: oklch(.592 .249 .584);--color-pink-700: oklch(.525 .223 3.958);--color-pink-800: oklch(.459 .187 3.815);--color-pink-900: oklch(.408 .153 2.432);--color-pink-950: oklch(.284 .109 3.907);--color-rose-50: oklch(.969 .015 12.422);--color-rose-100: oklch(.941 .03 12.58);--color-rose-200: oklch(.892 .058 10.001);--color-rose-300: oklch(.81 .117 11.638);--color-rose-400: oklch(.712 .194 13.428);--color-rose-500: oklch(.645 .246 16.439);--color-rose-600: oklch(.586 .253 17.585);--color-rose-700: oklch(.514 .222 16.935);--color-rose-800: oklch(.455 .188 13.697);--color-rose-900: oklch(.41 .159 10.272);--color-rose-950: oklch(.271 .105 12.094);--color-slate-50: oklch(.984 .003 247.858);--color-slate-100: oklch(.968 .007 247.896);--color-slate-200: oklch(.929 .013 255.508);--color-slate-300: oklch(.869 .022 252.894);--color-slate-400: oklch(.704 .04 256.788);--color-slate-500: oklch(.554 .046 257.417);--color-slate-600: oklch(.446 .043 257.281);--color-slate-700: oklch(.372 .044 257.287);--color-slate-800: oklch(.279 .041 260.031);--color-slate-900: oklch(.208 .042 265.755);--color-slate-950: oklch(.129 .042 264.695);--color-gray-50: oklch(.985 .002 247.839);--color-gray-100: oklch(.967 .003 264.542);--color-gray-200: oklch(.928 .006 264.531);--color-gray-300: oklch(.872 .01 258.338);--color-gray-400: oklch(.707 .022 261.325);--color-gray-500: oklch(.551 .027 264.364);--color-gray-600: oklch(.446 .03 256.802);--color-gray-700: oklch(.373 .034 259.733);--color-gray-800: oklch(.278 .033 256.848);--color-gray-900: oklch(.21 .034 264.665);--color-gray-950: oklch(.13 .028 261.692);--color-zinc-50: oklch(.985 0 0);--color-zinc-100: oklch(.967 .001 286.375);--color-zinc-200: oklch(.92 .004 286.32);--color-zinc-300: oklch(.871 .006 286.286);--color-zinc-400: oklch(.705 .015 286.067);--color-zinc-500: oklch(.552 .016 285.938);--color-zinc-600: oklch(.442 .017 285.786);--color-zinc-700: oklch(.37 .013 285.805);--color-zinc-800: oklch(.274 .006 286.033);--color-zinc-900: oklch(.21 .006 285.885);--color-zinc-950: oklch(.141 .005 285.823);--color-neutral-50: oklch(.985 0 0);--color-neutral-100: oklch(.97 0 0);--color-neutral-200: oklch(.922 0 0);--color-neutral-300: oklch(.87 0 0);--color-neutral-400: oklch(.708 0 0);--color-neutral-500: oklch(.556 0 0);--color-neutral-600: oklch(.439 0 0);--color-neutral-700: oklch(.371 0 0);--color-neutral-800: oklch(.269 0 0);--color-neutral-900: oklch(.205 0 0);--color-neutral-950: oklch(.145 0 0);--color-stone-50: oklch(.985 .001 106.423);--color-stone-100: oklch(.97 .001 106.424);--color-stone-200: oklch(.923 .003 48.717);--color-stone-300: oklch(.869 .005 56.366);--color-stone-400: oklch(.709 .01 56.259);--color-stone-500: oklch(.553 .013 58.071);--color-stone-600: oklch(.444 .011 73.639);--color-stone-700: oklch(.374 .01 67.558);--color-stone-800: oklch(.268 .007 34.298);--color-stone-900: oklch(.216 .006 56.043);--color-stone-950: oklch(.147 .004 49.25);--color-black: #000;--color-white: #fff;--spacing: .25rem;--breakpoint-sm: 40rem;--breakpoint-md: 48rem;--breakpoint-lg: 64rem;--breakpoint-xl: 80rem;--breakpoint-2xl: 96rem;--container-3xs: 16rem;--container-2xs: 18rem;--container-xs: 20rem;--container-sm: 24rem;--container-md: 28rem;--container-lg: 32rem;--container-xl: 36rem;--container-2xl: 42rem;--container-3xl: 48rem;--container-4xl: 56rem;--container-5xl: 64rem;--container-6xl: 72rem;--container-7xl: 80rem;--text-xs: .75rem;--text-xs--line-height: calc(1 / .75);--text-sm: .875rem;--text-sm--line-height: calc(1.25 / .875);--text-base: 1rem;--text-base--line-height: 1.5 ;--text-lg: 1.125rem;--text-lg--line-height: calc(1.75 / 1.125);--text-xl: 1.25rem;--text-xl--line-height: calc(1.75 / 1.25);--text-2xl: 1.5rem;--text-2xl--line-height: calc(2 / 1.5);--text-3xl: 1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl: 2.25rem;--text-4xl--line-height: calc(2.5 / 2.25);--text-5xl: 3rem;--text-5xl--line-height: 1;--text-6xl: 3.75rem;--text-6xl--line-height: 1;--text-7xl: 4.5rem;--text-7xl--line-height: 1;--text-8xl: 6rem;--text-8xl--line-height: 1;--text-9xl: 8rem;--text-9xl--line-height: 1;--font-weight-thin: 100;--font-weight-extralight: 200;--font-weight-light: 300;--font-weight-normal: 400;--font-weight-medium: 500;--font-weight-semibold: 600;--font-weight-bold: 700;--font-weight-extrabold: 800;--font-weight-black: 900;--tracking-tighter: -.05em;--tracking-tight: -.025em;--tracking-normal: 0em;--tracking-wide: .025em;--tracking-wider: .05em;--tracking-widest: .1em;--leading-tight: 1.25;--leading-snug: 1.375;--leading-normal: 1.5;--leading-relaxed: 1.625;--leading-loose: 2;--radius-xs: .125rem;--radius-sm: .25rem;--radius-md: .375rem;--radius-lg: .5rem;--radius-xl: .75rem;--radius-2xl: 1rem;--radius-3xl: 1.5rem;--radius-4xl: 2rem;--shadow-smxs: 0 1px rgb(0 0 0 / .05);--shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05);--shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--shadow-smxl: 0 25px 50px -12px rgb(0 0 0 / .25);--inset-shadow-smxs: inset 0 1px rgb(0 0 0 / .05);--inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / .05);--inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / .05);--drop-shadow-xs: 0 1px 1px rgb(0 0 0 / .05);--drop-shadow-sm: 0 1px 2px rgb(0 0 0 / .15);--drop-shadow-md: 0 3px 3px rgb(0 0 0 / .12);--drop-shadow-lg: 0 4px 4px rgb(0 0 0 / .15);--drop-shadow-xl: 0 9px 7px rgb(0 0 0 / .1);--drop-shadow-smxl: 0 25px 25px rgb(0 0 0 / .15);--blur-xs: 4px;--blur-sm: 8px;--blur-md: 12px;--blur-lg: 16px;--blur-xl: 24px;--blur-2xl: 40px;--blur-3xl: 64px;--perspective-dramatic: 100px;--perspective-near: 300px;--perspective-normal: 500px;--perspective-midrange: 800px;--perspective-distant: 1200px;--aspect-video: 16 / 9;--ease-in: cubic-bezier(.4, 0, 1, 1);--ease-out: cubic-bezier(0, 0, .2, 1);--ease-in-out: cubic-bezier(.4, 0, .2, 1);--animate-spin: spin 1s linear infinite;--animate-ping: ping 1s cubic-bezier(0, 0, .2, 1) infinite;--animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--animate-bounce: bounce 1s infinite;@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes pulse{50%{opacity:.5}}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}--md-sys-color-scrim: var(--schmancy-sys-color-scrim);--md-sys-color-outline: var(--schmancy-sys-color-outline);--md-sys-color-outlineVariant: var(--schmancy-sys-color-outlineVariant);--md-sys-color-surface-default: var(--schmancy-sys-color-surface-default);--md-sys-color-surface-dim: var(--schmancy-sys-color-surface-dim);--md-sys-color-surface-bright: var(--schmancy-sys-color-surface-bright);--md-sys-color-surface-container: var(--schmancy-sys-color-surface-container);--md-sys-color-surface-low: var(--schmancy-sys-color-surface-low);--md-sys-color-surface-high: var(--schmancy-sys-color-surface-high);--md-sys-color-surface-highest: var(--schmancy-sys-color-surface-highest);--md-sys-color-surface-lowest: var(--schmancy-sys-color-surface-lowest);--md-sys-color-surface-on: var(--schmancy-sys-color-surface-on);--md-sys-color-on-surface-variant: var(--schmancy-sys-color-surface-onVariant);--md-sys-color-on-secondary-container: var(--schmancy-sys-color-secondary-onContainer);--md-sys-color-primary-default: var(--schmancy-sys-color-primary-default);--md-sys-color-primary-on: var(--schmancy-sys-color-primary-on);--md-sys-color-primary-container: var(--schmancy-sys-color-primary-container);--md-sys-color-primary-onContainer: var(--schmancy-sys-color-primary-onContainer);--md-sys-color-secondary-default: var(--schmancy-sys-color-secondary-default);--md-sys-color-secondary-on: var(--schmancy-sys-color-secondary-on);--md-sys-color-secondary-container: var(--schmancy-sys-color-secondary-container);--md-sys-color-secondary-onContainer: var(--schmancy-sys-color-secondary-onContainer);--md-sys-color-tertiary-default: var(--schmancy-sys-color-tertiary-default);--md-sys-color-tertiary-on: var(--schmancy-sys-color-tertiary-on);--md-sys-color-tertiary-container: var(--schmancy-sys-color-tertiary-container);--md-sys-color-tertiary-onContainer: var(--schmancy-sys-color-tertiary-onContainer);--md-sys-color-error-default: var(--schmancy-sys-color-error-default);--md-sys-color-error-on: var(--schmancy-sys-color-error-on);--md-sys-color-error-container: var(--schmancy-sys-color-error-container);--md-sys-color-error-onContainer: var(--schmancy-sys-color-error-onContainer);--md-sys-color-success-default: var(--schmancy-sys-color-success-default);--md-sys-color-success-on: var(--schmancy-sys-color-success-on);--md-sys-color-success-container: var(--schmancy-sys-color-success-container);--md-sys-color-success-onContainer: var(--schmancy-sys-color-success-onContainer);--md-sys-elevation-0: var(--schmancy-sys-elevation-0);--md-sys-elevation-1: var(--schmancy-sys-elevation-1);--md-sys-elevation-2: var(--schmancy-sys-elevation-2);--md-sys-elevation-3: var(--schmancy-sys-elevation-3);--md-sys-elevation-4: var(--schmancy-sys-elevation-4);--md-sys-elevation-5: var(--schmancy-sys-elevation-5);--md-sys-outline-1: var(--schmancy-sys-outline-1);--md-filter-chip-label-text-color: var(--schmancy-sys-color-surface-on)}'),ue=window.matchMedia("(prefers-color-scheme: dark)"),je=new f.Observable(e=>{const t=r=>{const n=r.matches?"dark":"light";e.next(n)};ue.addEventListener("change",t);const o=ue.matches?"dark":"light";return e.next(o),()=>ue.removeEventListener("change",t)});exports.SchmancyThemeComponent=class extends Fe.TailwindElement(Ie){constructor(){super(...arguments),this.scheme="auto",this.root=!1,this.theme={}}connectedCallback(){super.connectedCallback(),this.color||(this.color=this.generateRandomColor()),f.of(this.scheme).pipe(f.switchMap(e=>e==="auto"?je:f.of(e))).subscribe(e=>{this.scheme=e,this.registerTheme()}),f.fromEvent(window,xe).subscribe(()=>{window.dispatchEvent(new CustomEvent(we,{detail:{theme:this},bubbles:!0,composed:!0}))}),f.fromEvent(window,he.DialogWhereAreYouRicky).subscribe(e=>{const t=this.querySelector(`schmancy-dialog[uid="${e.detail.uid}"]`)||this.querySelector(`confirm-dialog[uid="${e.detail.uid}"]`);t?window.dispatchEvent(new CustomEvent(he.DialogHereMorty,{detail:{dialog:t},bubbles:!0,composed:!0})):window.dispatchEvent(new CustomEvent(he.DialogHereMorty,{detail:{dialog:null,theme:this},bubbles:!0,composed:!0}))}),f.fromEvent(window,le).subscribe(e=>{const t=this.querySelector(`schmancy-sheet[uid="${e.detail.uid}"]`);t?window.dispatchEvent(new CustomEvent(oe,{detail:{sheet:t},bubbles:!0,composed:!0})):window.dispatchEvent(new CustomEvent(oe,{detail:{sheet:null,theme:this},bubbles:!0,composed:!0}))})}registerTheme(){let e=Te(Ne(Pe(this.color)),this.scheme==="dark",Pe("#34B334"));e={...e,...this.theme},this.registerThemeValues("schmancy","",e),(this.root?document.body:this.shadowRoot.host).style.colorScheme=this.scheme==="dark"?"dark":"light"}registerThemeValues(e="schmancy",t,o){return typeof o=="object"?Object.keys(o).map(r=>this.registerThemeValues(e,t+(t?"-":"")+r,o[r])).join(`
2
- `):void(this.root?document.body:this.shadowRoot.host).style.setProperty(`--${e}-${t}`,o)}generateRandomColor(){return"#"+Math.floor(16777215*Math.random()).toString(16).padStart(6,"0")}render(){return Se.html`<slot></slot>`}},ee([Z.property({type:String,reflect:!0})],exports.SchmancyThemeComponent.prototype,"color",2),ee([Z.property({type:String})],exports.SchmancyThemeComponent.prototype,"scheme",2),ee([Z.property({type:Boolean})],exports.SchmancyThemeComponent.prototype,"root",2),ee([Me.e({context:qe}),Z.property({type:Object})],exports.SchmancyThemeComponent.prototype,"theme",2),exports.SchmancyThemeComponent=ee([Z.customElement("schmancy-theme")],exports.SchmancyThemeComponent);var Ee=(e=>(e.Side="side",e.Bottom="bottom",e))(Ee||{});const le="are-you-there-sheet",oe="yes-here",Ye=new class{constructor(){this.openSheet$=new f.Subject,this.dismissSheet$=new f.Subject,this.activeSheets=new Set,this.sheetComponents=new Map,this.sheetElements=new Map,this.popStateListenerActive=!1,this.initializeEventStreams(),this.setupHistoryManagement()}initializeEventStreams(){this.setupOpenStream(),this.setupDismissStream()}resolveComponent(e){if(typeof e.component=="function"){const t=e.component();if(!(t instanceof HTMLElement))throw new Error("Component factory function must return an HTMLElement instance");return t}return e.component}calculateUid(e){return e.uid?e.uid:typeof e.component=="function"?this.resolveComponent(e).tagName.toLowerCase():e.component.tagName.toLowerCase()}async discoverOrCreateSheet(e){window.dispatchEvent(new CustomEvent(le,{detail:{uid:e}}));const t=await f.fromEvent(window,oe).pipe(f.takeUntil(f.timer(50)),f.map(n=>n.detail.sheet),f.defaultIfEmpty(void 0),f.take(1)).toPromise();if(t)return{sheet:t,container:t.parentElement};window.dispatchEvent(new CustomEvent(xe));const o=await f.fromEvent(window,we).pipe(f.takeUntil(f.timer(100)),f.map(n=>n.detail.theme),f.defaultIfEmpty(void 0),f.take(1)).toPromise()||document.querySelector("schmancy-theme")||document.body,r=document.createElement("schmancy-sheet");return r.setAttribute("uid",e),o.appendChild(r),{sheet:r,container:o}}configureSheet(e,t){t.lock&&e.setAttribute("lock","true");const o=t.position||(window.innerWidth>=768?"side":"bottom");e.setAttribute("position",o),t.title&&e.setAttribute("title",t.title),t.persist!==void 0&&e.setAttribute("persist",String(t.persist)),t.header&&e.setAttribute("header",t.header),t.handleHistory!==void 0&&e.setAttribute("handleHistory",String(t.handleHistory))}setupOpenStream(){this.openSheet$.pipe(f.switchMap(e=>{const t=this.resolveComponent(e),o=this.calculateUid(e);return f.from(this.discoverOrCreateSheet(o)).pipe(f.map(({sheet:r})=>(this.configureSheet(r,e),document.body.style.overflow="hidden",this.sheetComponents.set(o,t),this.sheetElements.set(o,r),{config:e,sheet:r,component:t,uid:o})))}),f.delay(20),f.tap(e=>{const{config:t,sheet:o,component:r,uid:n}=e;t.onBeforeOpen&&t.onBeforeOpen(r);const a=(o.shadowRoot?.querySelector("slot")?.assignedElements()||[]).find(s=>s.tagName===r.tagName);a?this.sheetComponents.set(n,a):o.appendChild(r)}),f.delay(1),f.tap(e=>{const{config:t,sheet:o,component:r,uid:n}=e;o.setAttribute("open","true"),this.activeSheets.add(n),t.onAfterOpen&&t.onAfterOpen(r),t.handleHistory!==!1&&history.pushState({schmancySheet:!0,uid:n,timestamp:Date.now()},"",window.location.href),this.setupCloseListener(o,n,t)})).subscribe({error:e=>{document.body.style.overflow="auto"}})}setupCloseListener(e,t,o){f.fromEvent(e,"close").pipe(f.take(1),f.delay(300)).subscribe(()=>{this.activeSheets.delete(t),o.persist||(this.sheetComponents.delete(t),this.sheetElements.delete(t),e.remove()),this.activeSheets.size===0&&(document.body.style.overflow="auto")})}setupDismissStream(){this.dismissSheet$.pipe(f.switchMap(e=>{const t=this.sheetElements.get(e);return t?f.of({uid:e,sheet:t}):(window.dispatchEvent(new CustomEvent(le,{detail:{uid:e}})),f.fromEvent(window,oe).pipe(f.takeUntil(f.timer(100)),f.map(o=>({uid:e,sheet:o.detail.sheet})),f.defaultIfEmpty({uid:e,sheet:void 0})))}),f.tap(({uid:e,sheet:t})=>{t&&(t.closeSheet(),this.activeSheets.delete(e))})).subscribe()}setupHistoryManagement(){this.popStateListenerActive||(f.fromEvent(window,"popstate").subscribe(e=>{if(this.activeSheets.size>0){const t=Array.from(this.activeSheets).pop();t&&(this.dismiss(t),e.state?.schmancySheet&&history.pushState({},"",window.location.href))}}),this.popStateListenerActive=!0)}open(e){this.openSheet$.next(e)}dismiss(e){if(!e&&this.activeSheets.size>0){const t=Array.from(this.activeSheets);e=t[t.length-1]}e&&this.dismissSheet$.next(e)}getComponent(e){return this.sheetComponents.get(e)}isOpen(e){return this.activeSheets.has(e)}closeAll(){Array.from(this.activeSheets).forEach(e=>this.dismiss(e))}getSheetElement(e){return this.sheetElements.get(e)}};exports.SchmancySheetPosition=Ee,exports.SheetHereMorty=oe,exports.SheetWhereAreYouRicky=le,exports.ThemeHereIAm=we,exports.ThemeWhereAreYou=xe,exports.formateTheme=Te,exports.sheet=Ye,exports.tailwindStyles=Ie;
3
- //# sourceMappingURL=sheet.service-CNz7lXHC.cjs.map