@usecapsule/core-components 3.12.0 → 3.14.0-dev.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. package/dist/capsule/capsule.esm.js +1 -1
  2. package/dist/capsule/index.esm.js +1 -1
  3. package/dist/capsule/index.esm.js.map +1 -1
  4. package/dist/capsule/{p-41bc3c58.entry.js → p-0a4c8cdc.entry.js} +2 -2
  5. package/dist/capsule/p-0a4c8cdc.entry.js.map +1 -0
  6. package/dist/capsule/{p-52bb30d8.entry.js → p-438442c7.entry.js} +2 -2
  7. package/dist/capsule/p-438442c7.entry.js.map +1 -0
  8. package/dist/capsule/{p-286db996.js → p-497acb43.js} +2 -2
  9. package/dist/capsule/{p-286db996.js.map → p-497acb43.js.map} +1 -1
  10. package/dist/capsule/{p-07d8431a.entry.js → p-63e6f5d8.entry.js} +4 -4
  11. package/dist/capsule/p-63e6f5d8.entry.js.map +1 -0
  12. package/dist/capsule/{p-7dff759e.entry.js → p-d239d40d.entry.js} +2 -2
  13. package/dist/capsule/{p-7dff759e.entry.js.map → p-d239d40d.entry.js.map} +1 -1
  14. package/dist/capsule/p-f2393be6.js.map +1 -1
  15. package/dist/cjs/constants-9b1b01bb.js.map +1 -1
  16. package/dist/cjs/cpsl-alert_34.cjs.entry.js +18 -18
  17. package/dist/cjs/cpsl-alert_34.cjs.entry.js.map +1 -1
  18. package/dist/cjs/cpsl-col.cjs.entry.js +1 -1
  19. package/dist/cjs/cpsl-col.cjs.entry.js.map +1 -1
  20. package/dist/cjs/cpsl-hero.cjs.entry.js +2 -2
  21. package/dist/cjs/cpsl-hero.cjs.entry.js.map +1 -1
  22. package/dist/cjs/cpsl-identicon.cjs.entry.js +2 -2
  23. package/dist/cjs/cpsl-identicon.cjs.entry.js.map +1 -1
  24. package/dist/cjs/index.cjs.js +1 -1
  25. package/dist/cjs/index.cjs.js.map +1 -1
  26. package/dist/cjs/{prand-a35ea6b2.js → prand-76d9999c.js} +3 -4
  27. package/dist/cjs/prand-76d9999c.js.map +1 -0
  28. package/dist/collection/components/cpsl-alert/cpsl-alert.js +2 -2
  29. package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
  30. package/dist/collection/components/cpsl-auth-modal/cpsl-auth-modal.js +1 -1
  31. package/dist/collection/components/cpsl-auth-modal/cpsl-auth-modal.js.map +1 -1
  32. package/dist/collection/components/cpsl-button/cpsl-button.stories.js.map +1 -1
  33. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +3 -3
  34. package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -1
  35. package/dist/collection/components/cpsl-col/cpsl-col.js +2 -2
  36. package/dist/collection/components/cpsl-col/cpsl-col.js.map +1 -1
  37. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +3 -3
  38. package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -1
  39. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +5 -5
  40. package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -1
  41. package/dist/collection/components/cpsl-dropdown/dropdown-interface.js.map +1 -1
  42. package/dist/collection/components/cpsl-hero/cpsl-hero.js +3 -3
  43. package/dist/collection/components/cpsl-hero/cpsl-hero.js.map +1 -1
  44. package/dist/collection/components/cpsl-hero/cpsl-hero.stories.js.map +1 -1
  45. package/dist/collection/components/cpsl-icon/cpsl-icon.js +3 -3
  46. package/dist/collection/components/cpsl-icon/cpsl-icon.js.map +1 -1
  47. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js +3 -3
  48. package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js.map +1 -1
  49. package/dist/collection/components/cpsl-identicon/cpsl-identicon.js +3 -3
  50. package/dist/collection/components/cpsl-identicon/cpsl-identicon.js.map +1 -1
  51. package/dist/collection/components/cpsl-identicon/cpsl-identicon.stories.js.map +1 -1
  52. package/dist/collection/components/cpsl-input/cpsl-input.js +6 -6
  53. package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
  54. package/dist/collection/components/cpsl-popover/cpsl-popover.js +2 -2
  55. package/dist/collection/components/cpsl-popover/cpsl-popover.js.map +1 -1
  56. package/dist/collection/components/cpsl-progress-indicator/cpsl-progress-indicator.js.map +1 -1
  57. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +3 -3
  58. package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js.map +1 -1
  59. package/dist/collection/components/cpsl-select/cpsl-select.js +3 -3
  60. package/dist/collection/components/cpsl-select/cpsl-select.js.map +1 -1
  61. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +3 -3
  62. package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js.map +1 -1
  63. package/dist/collection/components/cpsl-tab/cpsl-tab.js +3 -3
  64. package/dist/collection/components/cpsl-tab/cpsl-tab.js.map +1 -1
  65. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +3 -3
  66. package/dist/collection/components/cpsl-tabs/cpsl-tabs.js.map +1 -1
  67. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
  68. package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js.map +1 -1
  69. package/dist/collection/constants.js.map +1 -1
  70. package/dist/collection/index.js +4 -3
  71. package/dist/collection/index.js.map +1 -1
  72. package/dist/collection/interface.js.map +1 -1
  73. package/dist/collection/utils/prand.js +1 -1
  74. package/dist/collection/utils/prand.js.map +1 -1
  75. package/dist/collection/utils/theme/generateBorderRadii.js +1 -1
  76. package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
  77. package/dist/collection/utils/theme/generateFont.js.map +1 -1
  78. package/dist/collection/utils/theme/generatePalette.js +2 -2
  79. package/dist/collection/utils/theme/generatePalette.js.map +1 -1
  80. package/dist/collection/utils/theme/generateTheme.js +4 -4
  81. package/dist/collection/utils/theme/generateTheme.js.map +1 -1
  82. package/dist/collection/utils/theme/utils.js.map +1 -1
  83. package/dist/esm/constants-fce138fa.js.map +1 -1
  84. package/dist/esm/cpsl-alert_34.entry.js +18 -18
  85. package/dist/esm/cpsl-alert_34.entry.js.map +1 -1
  86. package/dist/esm/cpsl-col.entry.js +1 -1
  87. package/dist/esm/cpsl-col.entry.js.map +1 -1
  88. package/dist/esm/cpsl-hero.entry.js +2 -2
  89. package/dist/esm/cpsl-hero.entry.js.map +1 -1
  90. package/dist/esm/cpsl-identicon.entry.js +2 -2
  91. package/dist/esm/cpsl-identicon.entry.js.map +1 -1
  92. package/dist/esm/index.js +1 -1
  93. package/dist/esm/index.js.map +1 -1
  94. package/dist/esm/{prand-c8323494.js → prand-4c0d6ea7.js} +3 -4
  95. package/dist/esm/prand-4c0d6ea7.js.map +1 -0
  96. package/dist/index.js +2 -1
  97. package/dist/scripts/appendLoaderExports.js +42 -0
  98. package/dist/scripts/appendLoaderExports.js.map +1 -0
  99. package/dist/types/Users/norwood/capsule-repos/web-sdk/packages/core-components/.stencil/scripts/appendLoaderExports.d.ts +0 -0
  100. package/dist/types/components/cpsl-alert/cpsl-alert.d.ts +1 -1
  101. package/dist/types/components/cpsl-button/cpsl-button.stories.d.ts +1 -1
  102. package/dist/types/components/cpsl-code-input/cpsl-code-input.d.ts +1 -1
  103. package/dist/types/components/cpsl-dropdown/cpsl-dropdown.d.ts +1 -1
  104. package/dist/types/components/cpsl-dropdown/dropdown-interface.d.ts +1 -1
  105. package/dist/types/components/cpsl-hero/cpsl-hero.stories.d.ts +1 -1
  106. package/dist/types/components/cpsl-icon/cpsl-icon.d.ts +1 -1
  107. package/dist/types/components/cpsl-icon-group/cpsl-icon-group.d.ts +1 -1
  108. package/dist/types/components/cpsl-identicon/cpsl-identicon.stories.d.ts +1 -1
  109. package/dist/types/components/cpsl-input/cpsl-input.d.ts +2 -2
  110. package/dist/types/components/cpsl-qr-code/cpsl-qr-code.d.ts +1 -1
  111. package/dist/types/components/cpsl-select/cpsl-select.d.ts +1 -1
  112. package/dist/types/components/cpsl-slide-button/cpsl-slide-button.d.ts +1 -1
  113. package/dist/types/components/cpsl-tab/cpsl-tab.d.ts +2 -2
  114. package/dist/types/components/cpsl-tabs/cpsl-tabs.d.ts +2 -2
  115. package/dist/types/components/cpsl-tile-button/cpsl-tile-button.d.ts +1 -1
  116. package/dist/types/components.d.ts +12 -12
  117. package/dist/types/constants.d.ts +1 -1
  118. package/dist/types/index.d.ts +6 -4
  119. package/dist/types/interface.d.ts +2 -2
  120. package/dist/types/utils/theme/generateBorderRadii.d.ts +1 -1
  121. package/dist/types/utils/theme/generateFont.d.ts +1 -1
  122. package/dist/types/utils/theme/generatePalette.d.ts +1 -1
  123. package/dist/types/utils/theme/generateTheme.d.ts +1 -1
  124. package/dist/types/utils/theme/utils.d.ts +1 -1
  125. package/package.json +13 -6
  126. package/dist/capsule/p-07d8431a.entry.js.map +0 -1
  127. package/dist/capsule/p-41bc3c58.entry.js.map +0 -1
  128. package/dist/capsule/p-52bb30d8.entry.js.map +0 -1
  129. package/dist/cjs/prand-a35ea6b2.js.map +0 -1
  130. package/dist/esm/prand-c8323494.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{p as e,b as t}from"./p-fa6b7678.js";export{s as setNonce}from"./p-fa6b7678.js";import{g as o}from"./p-e1255160.js";var a=()=>{const t=import.meta.url;const o={};if(t!==""){o.resourcesUrl=new URL(".",t).href}return e(o)};a().then((async e=>{await o();return t([["p-7dff759e",[[1,"cpsl-hero",{height:[2],hideFadeOut:[4,"hide-fade-out"],variant:[513],title:[513],subtitle:[513],withDefaultTheme:[4,"with-default-theme"]}]]],["p-c9e61114",[[1,"cpsl-modal-v2",{enterTransitionDuration:[2,"enter-transition-duration"],exitTransitionDuration:[2,"exit-transition-duration"],elevated:[4],noOverlay:[4,"no-overlay"],open:[4],zIndexOverride:[2,"z-index-override"]},null,{open:["toggleHeight"]}]]],["p-d4bdb369",[[1,"cpsl-nav-button",{disabled:[516],exactMainRouteMatch:[4,"exact-main-route-match"],exactSubRouteMatch:[4,"exact-sub-route-match"],route:[1],subRoutes:[16],path:[1]}]]],["p-41bc3c58",[[1,"cpsl-col",{offset:[1],offsetXs:[1,"offset-xs"],offsetSm:[1,"offset-sm"],offsetMd:[1,"offset-md"],offsetLg:[1,"offset-lg"],offsetXl:[1,"offset-xl"],pull:[1],pullXs:[1,"pull-xs"],pullSm:[1,"pull-sm"],pullMd:[1,"pull-md"],pullLg:[1,"pull-lg"],pullXl:[1,"pull-xl"],push:[1],pushXs:[1,"push-xs"],pushSm:[1,"push-sm"],pushMd:[1,"push-md"],pushLg:[1,"push-lg"],pushXl:[1,"push-xl"],size:[1],sizeXs:[1,"size-xs"],sizeSm:[1,"size-sm"],sizeMd:[1,"size-md"],sizeLg:[1,"size-lg"],sizeXl:[1,"size-xl"]},[[9,"resize","onResize"]]]]],["p-de2a16e4",[[1,"cpsl-grid",{fixed:[4]}]]],["p-52bb30d8",[[1,"cpsl-identicon",{hash:[1],size:[1],variant:[1]}]]],["p-5cd62456",[[1,"cpsl-info-box"]]],["p-ab7b3141",[[1,"cpsl-row"]]],["p-07d8431a",[[1,"cpsl-pagination",{initialPage:[2,"initial-page"],totalPages:[2,"total-pages"],visiblePages:[1026,"visible-pages"],currentPage:[32]},null,{currentPage:["watchChange"]}],[1,"cpsl-select",{anchorElId:[1,"anchor-el-id"],autoWidth:[4,"auto-width"],disabled:[4],dropdownMaxHeight:[2,"dropdown-max-height"],errorText:[1,"error-text"],formatValue:[16],helperText:[1,"helper-text"],id:[1],icon:[1],label:[1],noIconAnimation:[4,"no-icon-animation"],placeholder:[1],required:[4],selectedValue:[1,"selected-value"],showFormattedSelectedItem:[4,"show-formatted-selected-item"],showOptionalLabel:[4,"show-optional-label"],showSearch:[4,"show-search"],searchPlaceholder:[1,"search-placeholder"],selectedItemColor:[1,"selected-item-color"],selectedItemVariant:[1,"selected-item-variant"],selectedItemWeight:[1,"selected-item-weight"],anchorEl:[32],hasFocus:[32],popoverOpen:[32],hasSelectedItem:[32]},[[0,"cpslSelectItemClick","selectItemClickHandler"],[0,"cpslOpen","onPopoverOpen"],[0,"cpslClose","onPopoverClose"]],{selectedValue:["onValueChange","handleValueChange"]}],[1,"cpsl-file-upload",{disabled:[516],errorText:[1,"error-text"],externalFilename:[1,"external-filename"],externalSrc:[1,"external-src"],fileTypes:[16],helperText:[1,"helper-text"],label:[1],required:[4],showOptionalLabel:[4,"show-optional-label"],uploadFile:[16],file:[32],dragOver:[32],dragError:[32],isUploading:[32],uploadError:[32]}],[1,"cpsl-auth-modal",{enterTransitionDuration:[2,"enter-transition-duration"],exitTransitionDuration:[2,"exit-transition-duration"],noOverlay:[4,"no-overlay"],open:[4],zIndexOverride:[2,"z-index-override"],hasFooter:[32],isMobile:[32]},null,{open:["toggleModal"]}],[1,"cpsl-alert",{icon:[1],noIcon:[4,"no-icon"],variant:[1],filled:[4]}],[1,"cpsl-checkbox",{checked:[4]}],[1,"cpsl-code-input",{code:[1025],errorText:[1,"error-text"],helperText:[1,"helper-text"],length:[2],type:[1]}],[1,"cpsl-drawer",{anchor:[1],anchorPosition:[2,"anchor-position"],noOverlay:[4,"no-overlay"],open:[4],size:[8],transitionDuration:[2,"transition-duration"],transitionFunction:[1,"transition-function"],variant:[1],zIndexOverride:[2,"z-index-override"],closedAnchorPosition:[32],showTransition:[32]}],[1,"cpsl-icon-group",{expandFrom:[1,"expand-from"],disabled:[4],icons:[16],isHovered:[32]}],[1,"cpsl-slide-button",{disabled:[4],endIcon:[1,"end-icon"],endText:[1,"end-text"],startIcon:[1,"start-icon"],startText:[1,"start-text"]}],[1,"cpsl-table",{hasHorizontalScroll:[32],hasVerticalScroll:[32]}],[1,"cpsl-tile-button",{src:[1],icon:[1]}],[1,"cpsl-app-bar",{height:[2],position:[1],zIndexOverride:[2,"z-index-override"]}],[1,"cpsl-avatar",{alt:[1],src:[1],variant:[1]}],[1,"cpsl-divider"],[1,"cpsl-dropdown",{width:[1],hasCpslSearch:[4,"has-cpsl-search"],items:[16],selectedItem:[1040],isOpen:[32],searchQuery:[32],filteredItems:[32]},[[9,"resize","handleResize"]],{selectedItem:["handleSelectedItemChange"],isOpen:["handleOpenChange"]}],[1,"cpsl-nav-button-group"],[1,"cpsl-pill",{text:[1]}],[1,"cpsl-progress-indicator",{totalSteps:[2,"total-steps"],step:[2]}],[1,"cpsl-qr-code",{url:[1],imageSrc:[1,"image-src"],size:[2],icon:[1]}],[1,"cpsl-radio",{checked:[4]}],[1,"cpsl-select-item",{selected:[4],value:[1]}],[1,"cpsl-switch",{checked:[4]}],[1,"cpsl-tab",{selected:[4],tab:[1]},[[8,"cpslTabsChanged","onTabsChanged"],[8,"cpslTabsInit","onTabsInit"]]],[1,"cpsl-tabs",{fullWidth:[4,"full-width"],selectedTab:[1,"selected-tab"],selectedTabRect:[32],loaded:[32]},[[8,"cpslTabButtonSizeChange","onTabSizeChange"]],{fullWidth:["updateSlider"],selectedTab:["updateTab"]}],[1,"cpsl-button-group",{selectedId:[1,"selected-id"]},null,{selectedId:["selectItem"]}],[1,"cpsl-input",{as:[1],autocapitalize:[1],autocomplete:[1],autocorrect:[1],noAutoDisable:[4,"no-auto-disable"],autofocus:[4],autoselect:[4],disabled:[4],contrastText:[4,"contrast-text"],enterkeyhint:[1],errorText:[1,"error-text"],mask:[1],helperText:[1,"helper-text"],inputmode:[1],label:[1],max:[8],maxlength:[2],min:[8],minlength:[2],multiple:[4],name:[1],pattern:[1],placeholder:[1],readonly:[4],required:[4],rows:[2],showOptionalLabel:[4,"show-optional-label"],spellcheck:[4],startIconSrc:[1,"start-icon-src"],startIcon:[1,"start-icon"],step:[1],type:[1],value:[1025],hasFocus:[32]},null,{disabled:["handleDisable"],mask:["handleSetupMask"],value:["handleValueChange"]}],[1,"cpsl-popover",{anchorEl:[16],anchorOriginHorizontal:[1,"anchor-origin-horizontal"],anchorOriginVertical:[1,"anchor-origin-vertical"],autoWidth:[4,"auto-width"],disabled:[4],preventBlur:[4,"prevent-blur"],transformOriginHorizontal:[1,"transform-origin-horizontal"],transformOriginVertical:[1,"transform-origin-vertical"],triggerAction:[1,"trigger-action"],trigger:[1],windowPadding:[2,"window-padding"],open:[32],positionX:[32],positionY:[32],closePopover:[64]},null,{trigger:["onTriggerChange"],triggerAction:["onTriggerChange"],preventBlur:["onTriggerChange"],anchorOriginHorizontal:["onAnchorChange"],anchorOriginVertical:["onAnchorChange"],open:["onOpenChange"]}],[1,"cpsl-spinner",{size:[2],speed:[2]}],[1,"cpsl-button",{as:[1],disabled:[516],fullWidth:[4,"full-width"],href:[1],size:[1],target:[1],variant:[513]}],[1,"cpsl-card"],[1,"cpsl-overlay",{enterTransitionDuration:[2,"enter-transition-duration"],exitTransitionDuration:[2,"exit-transition-duration"],open:[4],zIndexOverride:[2,"z-index-override"]},null,{open:["toggleHeight"]}],[1,"cpsl-text",{color:[1],variant:[1],weight:[1]}],[1,"cpsl-icon",{src:[1],icon:[1]}]]]],e)}));
1
+ import{p as e,b as t}from"./p-fa6b7678.js";export{s as setNonce}from"./p-fa6b7678.js";import{g as o}from"./p-e1255160.js";var a=()=>{const t=import.meta.url;const o={};if(t!==""){o.resourcesUrl=new URL(".",t).href}return e(o)};a().then((async e=>{await o();return t([["p-d239d40d",[[1,"cpsl-hero",{height:[2],hideFadeOut:[4,"hide-fade-out"],variant:[513],title:[513],subtitle:[513],withDefaultTheme:[4,"with-default-theme"]}]]],["p-c9e61114",[[1,"cpsl-modal-v2",{enterTransitionDuration:[2,"enter-transition-duration"],exitTransitionDuration:[2,"exit-transition-duration"],elevated:[4],noOverlay:[4,"no-overlay"],open:[4],zIndexOverride:[2,"z-index-override"]},null,{open:["toggleHeight"]}]]],["p-d4bdb369",[[1,"cpsl-nav-button",{disabled:[516],exactMainRouteMatch:[4,"exact-main-route-match"],exactSubRouteMatch:[4,"exact-sub-route-match"],route:[1],subRoutes:[16],path:[1]}]]],["p-0a4c8cdc",[[1,"cpsl-col",{offset:[1],offsetXs:[1,"offset-xs"],offsetSm:[1,"offset-sm"],offsetMd:[1,"offset-md"],offsetLg:[1,"offset-lg"],offsetXl:[1,"offset-xl"],pull:[1],pullXs:[1,"pull-xs"],pullSm:[1,"pull-sm"],pullMd:[1,"pull-md"],pullLg:[1,"pull-lg"],pullXl:[1,"pull-xl"],push:[1],pushXs:[1,"push-xs"],pushSm:[1,"push-sm"],pushMd:[1,"push-md"],pushLg:[1,"push-lg"],pushXl:[1,"push-xl"],size:[1],sizeXs:[1,"size-xs"],sizeSm:[1,"size-sm"],sizeMd:[1,"size-md"],sizeLg:[1,"size-lg"],sizeXl:[1,"size-xl"]},[[9,"resize","onResize"]]]]],["p-de2a16e4",[[1,"cpsl-grid",{fixed:[4]}]]],["p-438442c7",[[1,"cpsl-identicon",{hash:[1],size:[1],variant:[1]}]]],["p-5cd62456",[[1,"cpsl-info-box"]]],["p-ab7b3141",[[1,"cpsl-row"]]],["p-63e6f5d8",[[1,"cpsl-pagination",{initialPage:[2,"initial-page"],totalPages:[2,"total-pages"],visiblePages:[1026,"visible-pages"],currentPage:[32]},null,{currentPage:["watchChange"]}],[1,"cpsl-select",{anchorElId:[1,"anchor-el-id"],autoWidth:[4,"auto-width"],disabled:[4],dropdownMaxHeight:[2,"dropdown-max-height"],errorText:[1,"error-text"],formatValue:[16],helperText:[1,"helper-text"],id:[1],icon:[1],label:[1],noIconAnimation:[4,"no-icon-animation"],placeholder:[1],required:[4],selectedValue:[1,"selected-value"],showFormattedSelectedItem:[4,"show-formatted-selected-item"],showOptionalLabel:[4,"show-optional-label"],showSearch:[4,"show-search"],searchPlaceholder:[1,"search-placeholder"],selectedItemColor:[1,"selected-item-color"],selectedItemVariant:[1,"selected-item-variant"],selectedItemWeight:[1,"selected-item-weight"],anchorEl:[32],hasFocus:[32],popoverOpen:[32],hasSelectedItem:[32]},[[0,"cpslSelectItemClick","selectItemClickHandler"],[0,"cpslOpen","onPopoverOpen"],[0,"cpslClose","onPopoverClose"]],{selectedValue:["onValueChange","handleValueChange"]}],[1,"cpsl-file-upload",{disabled:[516],errorText:[1,"error-text"],externalFilename:[1,"external-filename"],externalSrc:[1,"external-src"],fileTypes:[16],helperText:[1,"helper-text"],label:[1],required:[4],showOptionalLabel:[4,"show-optional-label"],uploadFile:[16],file:[32],dragOver:[32],dragError:[32],isUploading:[32],uploadError:[32]}],[1,"cpsl-auth-modal",{enterTransitionDuration:[2,"enter-transition-duration"],exitTransitionDuration:[2,"exit-transition-duration"],noOverlay:[4,"no-overlay"],open:[4],zIndexOverride:[2,"z-index-override"],hasFooter:[32],isMobile:[32]},null,{open:["toggleModal"]}],[1,"cpsl-alert",{icon:[1],noIcon:[4,"no-icon"],variant:[1],filled:[4]}],[1,"cpsl-checkbox",{checked:[4]}],[1,"cpsl-code-input",{code:[1025],errorText:[1,"error-text"],helperText:[1,"helper-text"],length:[2],type:[1]}],[1,"cpsl-drawer",{anchor:[1],anchorPosition:[2,"anchor-position"],noOverlay:[4,"no-overlay"],open:[4],size:[8],transitionDuration:[2,"transition-duration"],transitionFunction:[1,"transition-function"],variant:[1],zIndexOverride:[2,"z-index-override"],closedAnchorPosition:[32],showTransition:[32]}],[1,"cpsl-icon-group",{expandFrom:[1,"expand-from"],disabled:[4],icons:[16],isHovered:[32]}],[1,"cpsl-slide-button",{disabled:[4],endIcon:[1,"end-icon"],endText:[1,"end-text"],startIcon:[1,"start-icon"],startText:[1,"start-text"]}],[1,"cpsl-table",{hasHorizontalScroll:[32],hasVerticalScroll:[32]}],[1,"cpsl-tile-button",{src:[1],icon:[1]}],[1,"cpsl-app-bar",{height:[2],position:[1],zIndexOverride:[2,"z-index-override"]}],[1,"cpsl-avatar",{alt:[1],src:[1],variant:[1]}],[1,"cpsl-divider"],[1,"cpsl-dropdown",{width:[1],hasCpslSearch:[4,"has-cpsl-search"],items:[16],selectedItem:[1040],isOpen:[32],searchQuery:[32],filteredItems:[32]},[[9,"resize","handleResize"]],{selectedItem:["handleSelectedItemChange"],isOpen:["handleOpenChange"]}],[1,"cpsl-nav-button-group"],[1,"cpsl-pill",{text:[1]}],[1,"cpsl-progress-indicator",{totalSteps:[2,"total-steps"],step:[2]}],[1,"cpsl-qr-code",{url:[1],imageSrc:[1,"image-src"],size:[2],icon:[1]}],[1,"cpsl-radio",{checked:[4]}],[1,"cpsl-select-item",{selected:[4],value:[1]}],[1,"cpsl-switch",{checked:[4]}],[1,"cpsl-tab",{selected:[4],tab:[1]},[[8,"cpslTabsChanged","onTabsChanged"],[8,"cpslTabsInit","onTabsInit"]]],[1,"cpsl-tabs",{fullWidth:[4,"full-width"],selectedTab:[1,"selected-tab"],selectedTabRect:[32],loaded:[32]},[[8,"cpslTabButtonSizeChange","onTabSizeChange"]],{fullWidth:["updateSlider"],selectedTab:["updateTab"]}],[1,"cpsl-button-group",{selectedId:[1,"selected-id"]},null,{selectedId:["selectItem"]}],[1,"cpsl-input",{as:[1],autocapitalize:[1],autocomplete:[1],autocorrect:[1],noAutoDisable:[4,"no-auto-disable"],autofocus:[4],autoselect:[4],disabled:[4],contrastText:[4,"contrast-text"],enterkeyhint:[1],errorText:[1,"error-text"],mask:[1],helperText:[1,"helper-text"],inputmode:[1],label:[1],max:[8],maxlength:[2],min:[8],minlength:[2],multiple:[4],name:[1],pattern:[1],placeholder:[1],readonly:[4],required:[4],rows:[2],showOptionalLabel:[4,"show-optional-label"],spellcheck:[4],startIconSrc:[1,"start-icon-src"],startIcon:[1,"start-icon"],step:[1],type:[1],value:[1025],hasFocus:[32]},null,{disabled:["handleDisable"],mask:["handleSetupMask"],value:["handleValueChange"]}],[1,"cpsl-popover",{anchorEl:[16],anchorOriginHorizontal:[1,"anchor-origin-horizontal"],anchorOriginVertical:[1,"anchor-origin-vertical"],autoWidth:[4,"auto-width"],disabled:[4],preventBlur:[4,"prevent-blur"],transformOriginHorizontal:[1,"transform-origin-horizontal"],transformOriginVertical:[1,"transform-origin-vertical"],triggerAction:[1,"trigger-action"],trigger:[1],windowPadding:[2,"window-padding"],open:[32],positionX:[32],positionY:[32],closePopover:[64]},null,{trigger:["onTriggerChange"],triggerAction:["onTriggerChange"],preventBlur:["onTriggerChange"],anchorOriginHorizontal:["onAnchorChange"],anchorOriginVertical:["onAnchorChange"],open:["onOpenChange"]}],[1,"cpsl-spinner",{size:[2],speed:[2]}],[1,"cpsl-button",{as:[1],disabled:[516],fullWidth:[4,"full-width"],href:[1],size:[1],target:[1],variant:[513]}],[1,"cpsl-card"],[1,"cpsl-overlay",{enterTransitionDuration:[2,"enter-transition-duration"],exitTransitionDuration:[2,"exit-transition-duration"],open:[4],zIndexOverride:[2,"z-index-override"]},null,{open:["toggleHeight"]}],[1,"cpsl-text",{color:[1],variant:[1],weight:[1]}],[1,"cpsl-icon",{src:[1],icon:[1]}]]]],e)}));
2
2
  //# sourceMappingURL=capsule.esm.js.map
@@ -1,2 +1,2 @@
1
- import{D as o,C as t,U as n}from"./p-f2393be6.js";export{g as getPseudoRandomBackground}from"./p-286db996.js";function c(o,t,n){return Math.min(Math.max(o,n),t)}class r extends Error{constructor(o){super(`Failed to parse color: "${o}"`)}}var e=r;function s(o){if(typeof o!=="string")throw new e(o);if(o.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=o.trim();t=m.test(o)?a(o):o;const n=p.exec(t);if(n){const o=Array.from(n).slice(1);return[...o.slice(0,3).map((o=>parseInt(i(o,2),16))),parseInt(i(o[3]||"f",2),16)/255]}const r=_.exec(t);if(r){const o=Array.from(r).slice(1);return[...o.slice(0,3).map((o=>parseInt(o,16))),parseInt(o[3]||"ff",16)/255]}const s=f.exec(t);if(s){const o=Array.from(s).slice(1);return[...o.slice(0,3).map((o=>parseInt(o,10))),parseFloat(o[3]||"1")]}const u=b.exec(t);if(u){const[t,n,r,s]=Array.from(u).slice(1).map(parseFloat);if(c(0,100,n)!==n)throw new e(o);if(c(0,100,r)!==r)throw new e(o);return[...k(t,n,r),Number.isNaN(s)?1:s]}throw new e(o)}function u(o){let t=5381;let n=o.length;while(n){t=t*33^o.charCodeAt(--n)}return(t>>>0)%2341}const d=o=>parseInt(o.replace(/_/g,""),36);const l="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce(((o,t)=>{const n=d(t.substring(0,3));const c=d(t.substring(3)).toString(16);let r="";for(let o=0;o<6-c.length;o++){r+="0"}o[n]=`${r}${c}`;return o}),{});function a(o){const t=o.toLowerCase().trim();const n=l[u(t)];if(!n)throw new e(o);return`#${n}`}const i=(o,t)=>Array.from(Array(t)).map((()=>o)).join("");const p=new RegExp(`^#${i("([a-f0-9])",3)}([a-f0-9])?$`,"i");const _=new RegExp(`^#${i("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i");const f=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${i(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i");const b=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i;const m=/^[a-z]+$/i;const h=o=>Math.round(o*255);const k=(o,t,n)=>{let c=n/100;if(t===0){return[c,c,c].map(h)}const r=(o%360+360)%360/60;const e=(1-Math.abs(2*c-1))*(t/100);const s=e*(1-Math.abs(r%2-1));let u=0;let d=0;let l=0;if(r>=0&&r<1){u=e;d=s}else if(r>=1&&r<2){u=s;d=e}else if(r>=2&&r<3){d=e;l=s}else if(r>=3&&r<4){d=s;l=e}else if(r>=4&&r<5){u=s;l=e}else if(r>=5&&r<6){u=e;l=s}const a=c-e/2;const i=u+a;const p=d+a;const _=l+a;return[i,p,_].map(h)};function y(o){if(o==="transparent")return 0;function t(o){const t=o/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}const[n,c,r]=s(o);return.2126*t(n)+.7152*t(c)+.0722*t(r)}function z(o,t,n,r){return`rgba(${c(0,255,o).toFixed()}, ${c(0,255,t).toFixed()}, ${c(0,255,n).toFixed()}, ${parseFloat(c(0,1,r).toFixed(3))})`}function x(o,t,n){const c=(o,t)=>t===3?o:o/255;const[r,e,u,d]=s(o).map(c);const[l,a,i,p]=s(t).map(c);const _=p-d;const f=n*2-1;const b=f*_===-1?f:f+_/(1+f*_);const m=(b+1)/2;const g=1-m;const h=(r*g+l*m)*255;const k=(e*g+a*m)*255;const y=(u*g+i*m)*255;const x=p*n+d*(1-n);return z(h,k,y,x)}function $(o){return y(o)>.179}function w(o,t,n){return{r:255*n(o.r/255,t.r/255),g:255*n(o.g/255,t.g/255),b:255*n(o.b/255,t.b/255)}}function F(o,t){return o*t}function j(o,t){return o+t-o*t}function v(o,t){return q(t,o)}function q(o,t){return t<=.5?F(o,2*t):j(o,2*t-1)}function C(o,t,n){return Math.min(Math.max(o||0,t),n)}function M(o){return{r:C(o.r,0,255),g:C(o.g,0,255),b:C(o.b,0,255),a:C(o.a,0,1)}}function R(o){return{r:255*o.r,g:255*o.g,b:255*o.b,a:o.a}}function A(o){return{r:o.r/255,g:o.g/255,b:o.b/255,a:o.a}}function O(o,t){void 0===t&&(t=0);var n=Math.pow(10,t);return{r:Math.round(o.r*n)/n,g:Math.round(o.g*n)/n,b:Math.round(o.b*n)/n,a:o.a}}function S(o,t,n,c,r,e){return(1-t/n)*c+t/n*Math.round((1-o)*r+o*e)}function B(o,t,n,c,r){void 0===r&&(r={unitInput:!1,unitOutput:!1,roundOutput:!0}),r.unitInput&&(o=R(o),t=R(t)),o=M(o);var e=(t=M(t)).a+o.a-t.a*o.a,s=n(o,t,c),u=M({r:S(o.a,t.a,e,o.r,t.r,s.r),g:S(o.a,t.a,e,o.g,t.g,s.g),b:S(o.a,t.a,e,o.b,t.b,s.b),a:e});return u=r.unitOutput?A(u):r.roundOutput?O(u):function(o){return O(o,9)}(u),u}function I(o,t){return B(o,t,w,v)}const X=o=>{const t=(new Option).style;t.color=o;return t.color!==""};const L=o=>o.replace(/([a-z0–9])([A-Z])/g,"$1-$2").toLowerCase();const E=(o,t)=>{let n={};for(const c in t){const r=`${o}-${L(c)}`;if(typeof t[c]==="object"&&t[c]!==null){n=Object.assign(Object.assign({},n),E(r,t[c]))}else{n[r]=t[c]}}return n};const P=o=>E("--cpsl-color",o);const D=o=>E("--cpsl-border-radius",o);const T=(o,t)=>{const n=s(o);const c=s(t);const r=I({r:n[0],g:n[1],b:n[2],a:.1},{r:c[0],g:c[1],b:c[2],a:c[3]});return z(r.r,r.g,r.b,r.a)};const N=({borderRadius:o,customBorderRadii:t})=>{let n,c,r=4;const e=1e3;let s=false;let u=false;switch(o){case"none":{u=true;n=0;c=0;r=0;break}case"xs":{n=2;c=4;r=2;break}case"sm":{n=4;c=8;break}case"md":{n=8;c=16;break}case"xl":{n=16;c=32;break}case"full":{n=24;c=32;s=true;break}default:case"lg":{n=12;c=24;break}}document.documentElement.style.setProperty("--cpsl-border-radius-input",`${s?e:n}px`);document.documentElement.style.setProperty("--cpsl-border-radius-select",`${s?e:n}px`);document.documentElement.style.setProperty("--cpsl-border-radius-file",`${s?e:n}px`);document.documentElement.style.setProperty("--cpsl-border-radius-alert",`${s?e:n}px`);document.documentElement.style.setProperty("--cpsl-border-radius-tabs",`${u?0:e}px`);document.documentElement.style.setProperty("--cpsl-border-radius-primary-button",`${s?e:n}px`);document.documentElement.style.setProperty("--cpsl-border-radius-secondary-button",`${s?e:n}px`);document.documentElement.style.setProperty("--cpsl-border-radius-tertiary-button",`${s?e:n}px`);document.documentElement.style.setProperty("--cpsl-border-radius-destructive-button",`${s?e:n}px`);document.documentElement.style.setProperty("--cpsl-border-radius-tile-button",`${n}px`);document.documentElement.style.setProperty("--cpsl-border-radius-qr-code",`${c}px`);document.documentElement.style.setProperty("--cpsl-border-radius-info-box",`${n}px`);document.documentElement.style.setProperty("--cpsl-border-radius-table-container",`${n}px`);document.documentElement.style.setProperty("--cpsl-border-radius-avatar",`${n}px`);document.documentElement.style.setProperty("--cpsl-border-radius-button-group",`${n}px`);document.documentElement.style.setProperty("--cpsl-border-radius-card",`${c}px`);document.documentElement.style.setProperty("--cpsl-border-radius-modal",`${c}px`);document.documentElement.style.setProperty("--cpsl-border-radius-checkbox",`${r}px`);document.documentElement.style.setProperty("--cpsl-border-radius-switch",`${u?0:e}px`);document.documentElement.style.setProperty("--cpsl-border-radius-pill",`${u?0:e}px`);document.documentElement.style.setProperty("--cpsl-border-radius-radio",`${e}px`);if(t){const o=D(t);Object.entries(o).forEach((([o,t])=>document.documentElement.style.setProperty(o,t)))}};const U={body2XS:"body-2xs",bodyXS:"body-xs",bodyS:"body-s",bodyM:"body-m",bodyL:"body-l",bodyXL:"body-xl",headingXS:"heading-xs",headingS:"heading-s",headingM:"heading-m",headingL:"heading-l",headingXL:"heading-xl",heading2XL:"heading-2xl"};const Z=({font:o,customFontSizes:t})=>{if(o){document.documentElement.style.setProperty("--cpsl-default-font",o)}Object.entries(U).forEach((([o,n])=>{if(t===null||t===void 0?void 0:t[o]){document.documentElement.style.setProperty(`--cpsl-font-size-${n}`,t[o])}else{document.documentElement.style.removeProperty(`--cpsl-font-size-${n}`)}}))};const G=({foregroundColor:c,backgroundColor:r,accentColor:e,isDarkTheme:s,customPalette:u})=>{if(!c||!X(c)){c=o.foregroundColor}if(!r||!X(r)){r=o.backgroundColor}if(!Boolean(e)||!X(e)){e=c}const d=Boolean(e)?!$(e):false;const l={foregroundColors:[],backgroundColors:[],accentColors:[]};const a=s?"#FFFFFF":"#000000";const i=s?"#000000":"#FFFFFF";const p=d?"#FFFFFF":"#000000";t.forEach((o=>{l.foregroundColors.push(x(c,i,o));l.backgroundColors.push(x(r,a,o));l.accentColors.push(x(e,p,o))}));document.documentElement.style.setProperty("--cpsl-color-background-0",l.backgroundColors[0]);document.documentElement.style.setProperty("--cpsl-color-background-4",l.backgroundColors[1]);document.documentElement.style.setProperty("--cpsl-color-background-8",l.backgroundColors[2]);document.documentElement.style.setProperty("--cpsl-color-background-16",l.backgroundColors[3]);document.documentElement.style.setProperty("--cpsl-color-background-32",l.backgroundColors[4]);document.documentElement.style.setProperty("--cpsl-color-background-48",l.backgroundColors[5]);document.documentElement.style.setProperty("--cpsl-color-background-64",l.backgroundColors[6]);document.documentElement.style.setProperty("--cpsl-color-background-80",l.backgroundColors[7]);document.documentElement.style.setProperty("--cpsl-color-background-96",l.backgroundColors[8]);document.documentElement.style.setProperty("--cpsl-color-foreground-0",l.foregroundColors[0]);document.documentElement.style.setProperty("--cpsl-color-foreground-4",l.foregroundColors[1]);document.documentElement.style.setProperty("--cpsl-color-foreground-8",l.foregroundColors[2]);document.documentElement.style.setProperty("--cpsl-color-foreground-16",l.foregroundColors[3]);document.documentElement.style.setProperty("--cpsl-color-foreground-32",l.foregroundColors[4]);document.documentElement.style.setProperty("--cpsl-color-foreground-48",l.foregroundColors[5]);document.documentElement.style.setProperty("--cpsl-color-foreground-64",l.foregroundColors[6]);document.documentElement.style.setProperty("--cpsl-color-foreground-80",l.foregroundColors[7]);document.documentElement.style.setProperty("--cpsl-color-foreground-96",l.foregroundColors[8]);document.documentElement.style.setProperty("--cpsl-color-accent-0",l.accentColors[0]);document.documentElement.style.setProperty("--cpsl-color-accent-4",l.accentColors[1]);document.documentElement.style.setProperty("--cpsl-color-accent-8",l.accentColors[2]);document.documentElement.style.setProperty("--cpsl-color-accent-16",l.accentColors[3]);document.documentElement.style.setProperty("--cpsl-color-accent-32",l.accentColors[4]);document.documentElement.style.setProperty("--cpsl-color-accent-48",l.accentColors[5]);document.documentElement.style.setProperty("--cpsl-color-accent-64",l.accentColors[6]);document.documentElement.style.setProperty("--cpsl-color-accent-80",l.accentColors[7]);document.documentElement.style.setProperty("--cpsl-color-accent-96",l.accentColors[8]);document.documentElement.style.setProperty("--cpsl-color-contrast",s?"#FFFFFF":"#000000");const _="#FFFFFF";const f=.72;const b=T(c,n.red);const m=T(c,n.yellow);const g=T(c,n.green);document.documentElement.style.setProperty("--cpsl-color-utility-red",b);document.documentElement.style.setProperty("--cpsl-color-utility-yellow",m);document.documentElement.style.setProperty("--cpsl-color-utility-green",g);document.documentElement.style.setProperty("--cpsl-color-utility-red-light",x(b,_,f));document.documentElement.style.setProperty("--cpsl-color-utility-yellow-light",x(m,_,f));document.documentElement.style.setProperty("--cpsl-color-utility-green-light",x(g,_,f));if(u){const o=P(u);Object.entries(o).forEach((([o,t])=>document.documentElement.style.setProperty(o,t)))}};const H=({foregroundColor:t=o.foregroundColor,backgroundColor:n=o.backgroundColor,accentColor:c,darkForegroundColor:r,darkBackgroundColor:e,darkAccentColor:s,mode:u="light",font:d,customPalette:l,borderRadius:a,customFontSizes:i,customBorderRadii:p})=>{const _=u==="dark";G({foregroundColor:_?r!==null&&r!==void 0?r:t:t,backgroundColor:_?e!==null&&e!==void 0?e:n:n,accentColor:_?s!==null&&s!==void 0?s:c:c,customPalette:l,isDarkTheme:_});Z({font:d,customFontSizes:i});N({borderRadius:a,customBorderRadii:p})};export{H as generateTheme};
1
+ import{D as o,C as t,U as c}from"./p-f2393be6.js";export{g as getPseudoRandomBackground}from"./p-497acb43.js";function n(o,t,c){return Math.min(Math.max(o,c),t)}class r extends Error{constructor(o){super(`Failed to parse color: "${o}"`)}}var e=r;function s(o){if(typeof o!=="string")throw new e(o);if(o.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=o.trim();t=m.test(o)?a(o):o;const c=p.exec(t);if(c){const o=Array.from(c).slice(1);return[...o.slice(0,3).map((o=>parseInt(i(o,2),16))),parseInt(i(o[3]||"f",2),16)/255]}const r=_.exec(t);if(r){const o=Array.from(r).slice(1);return[...o.slice(0,3).map((o=>parseInt(o,16))),parseInt(o[3]||"ff",16)/255]}const s=f.exec(t);if(s){const o=Array.from(s).slice(1);return[...o.slice(0,3).map((o=>parseInt(o,10))),parseFloat(o[3]||"1")]}const u=b.exec(t);if(u){const[t,c,r,s]=Array.from(u).slice(1).map(parseFloat);if(n(0,100,c)!==c)throw new e(o);if(n(0,100,r)!==r)throw new e(o);return[...k(t,c,r),Number.isNaN(s)?1:s]}throw new e(o)}function u(o){let t=5381;let c=o.length;while(c){t=t*33^o.charCodeAt(--c)}return(t>>>0)%2341}const d=o=>parseInt(o.replace(/_/g,""),36);const l="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce(((o,t)=>{const c=d(t.substring(0,3));const n=d(t.substring(3)).toString(16);let r="";for(let o=0;o<6-n.length;o++){r+="0"}o[c]=`${r}${n}`;return o}),{});function a(o){const t=o.toLowerCase().trim();const c=l[u(t)];if(!c)throw new e(o);return`#${c}`}const i=(o,t)=>Array.from(Array(t)).map((()=>o)).join("");const p=new RegExp(`^#${i("([a-f0-9])",3)}([a-f0-9])?$`,"i");const _=new RegExp(`^#${i("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i");const f=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${i(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i");const b=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i;const m=/^[a-z]+$/i;const h=o=>Math.round(o*255);const k=(o,t,c)=>{let n=c/100;if(t===0){return[n,n,n].map(h)}const r=(o%360+360)%360/60;const e=(1-Math.abs(2*n-1))*(t/100);const s=e*(1-Math.abs(r%2-1));let u=0;let d=0;let l=0;if(r>=0&&r<1){u=e;d=s}else if(r>=1&&r<2){u=s;d=e}else if(r>=2&&r<3){d=e;l=s}else if(r>=3&&r<4){d=s;l=e}else if(r>=4&&r<5){u=s;l=e}else if(r>=5&&r<6){u=e;l=s}const a=n-e/2;const i=u+a;const p=d+a;const _=l+a;return[i,p,_].map(h)};function y(o){if(o==="transparent")return 0;function t(o){const t=o/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}const[c,n,r]=s(o);return.2126*t(c)+.7152*t(n)+.0722*t(r)}function z(o,t,c,r){return`rgba(${n(0,255,o).toFixed()}, ${n(0,255,t).toFixed()}, ${n(0,255,c).toFixed()}, ${parseFloat(n(0,1,r).toFixed(3))})`}function x(o,t,c){const n=(o,t)=>t===3?o:o/255;const[r,e,u,d]=s(o).map(n);const[l,a,i,p]=s(t).map(n);const _=p-d;const f=c*2-1;const b=f*_===-1?f:f+_/(1+f*_);const m=(b+1)/2;const g=1-m;const h=(r*g+l*m)*255;const k=(e*g+a*m)*255;const y=(u*g+i*m)*255;const x=p*c+d*(1-c);return z(h,k,y,x)}function $(o){return y(o)>.179}function w(o,t,c){return{r:255*c(o.r/255,t.r/255),g:255*c(o.g/255,t.g/255),b:255*c(o.b/255,t.b/255)}}function F(o,t){return o*t}function j(o,t){return o+t-o*t}function v(o,t){return q(t,o)}function q(o,t){return t<=.5?F(o,2*t):j(o,2*t-1)}function C(o,t,c){return Math.min(Math.max(o||0,t),c)}function M(o){return{r:C(o.r,0,255),g:C(o.g,0,255),b:C(o.b,0,255),a:C(o.a,0,1)}}function R(o){return{r:255*o.r,g:255*o.g,b:255*o.b,a:o.a}}function A(o){return{r:o.r/255,g:o.g/255,b:o.b/255,a:o.a}}function O(o,t){void 0===t&&(t=0);var c=Math.pow(10,t);return{r:Math.round(o.r*c)/c,g:Math.round(o.g*c)/c,b:Math.round(o.b*c)/c,a:o.a}}function S(o,t,c,n,r,e){return(1-t/c)*n+t/c*Math.round((1-o)*r+o*e)}function B(o,t,c,n,r){void 0===r&&(r={unitInput:!1,unitOutput:!1,roundOutput:!0}),r.unitInput&&(o=R(o),t=R(t)),o=M(o);var e=(t=M(t)).a+o.a-t.a*o.a,s=c(o,t,n),u=M({r:S(o.a,t.a,e,o.r,t.r,s.r),g:S(o.a,t.a,e,o.g,t.g,s.g),b:S(o.a,t.a,e,o.b,t.b,s.b),a:e});return u=r.unitOutput?A(u):r.roundOutput?O(u):function(o){return O(o,9)}(u),u}function I(o,t){return B(o,t,w,v)}const X=o=>{const t=(new Option).style;t.color=o;return t.color!==""};const L=o=>o.replace(/([a-z0–9])([A-Z])/g,"$1-$2").toLowerCase();const E=(o,t)=>{let c={};for(const n in t){const r=`${o}-${L(n)}`;if(typeof t[n]==="object"&&t[n]!==null){c=Object.assign(Object.assign({},c),E(r,t[n]))}else{c[r]=t[n]}}return c};const P=o=>E("--cpsl-color",o);const D=o=>E("--cpsl-border-radius",o);const T=(o,t)=>{const c=s(o);const n=s(t);const r=I({r:c[0],g:c[1],b:c[2],a:.1},{r:n[0],g:n[1],b:n[2],a:n[3]});return z(r.r,r.g,r.b,r.a)};const N=({borderRadius:o,customBorderRadii:t})=>{let c,n,r=4;const e=1e3;let s=false;let u=false;switch(o){case"none":{u=true;c=0;n=0;r=0;break}case"xs":{c=2;n=4;r=2;break}case"sm":{c=4;n=8;break}case"md":{c=8;n=16;break}case"xl":{c=16;n=32;break}case"full":{c=24;n=32;s=true;break}default:case"lg":{c=12;n=24;break}}document.documentElement.style.setProperty("--cpsl-border-radius-input",`${s?e:c}px`);document.documentElement.style.setProperty("--cpsl-border-radius-select",`${s?e:c}px`);document.documentElement.style.setProperty("--cpsl-border-radius-file",`${s?e:c}px`);document.documentElement.style.setProperty("--cpsl-border-radius-alert",`${s?e:c}px`);document.documentElement.style.setProperty("--cpsl-border-radius-tabs",`${u?0:e}px`);document.documentElement.style.setProperty("--cpsl-border-radius-primary-button",`${s?e:c}px`);document.documentElement.style.setProperty("--cpsl-border-radius-secondary-button",`${s?e:c}px`);document.documentElement.style.setProperty("--cpsl-border-radius-tertiary-button",`${s?e:c}px`);document.documentElement.style.setProperty("--cpsl-border-radius-destructive-button",`${s?e:c}px`);document.documentElement.style.setProperty("--cpsl-border-radius-tile-button",`${c}px`);document.documentElement.style.setProperty("--cpsl-border-radius-qr-code",`${n}px`);document.documentElement.style.setProperty("--cpsl-border-radius-info-box",`${c}px`);document.documentElement.style.setProperty("--cpsl-border-radius-table-container",`${c}px`);document.documentElement.style.setProperty("--cpsl-border-radius-avatar",`${c}px`);document.documentElement.style.setProperty("--cpsl-border-radius-button-group",`${c}px`);document.documentElement.style.setProperty("--cpsl-border-radius-card",`${n}px`);document.documentElement.style.setProperty("--cpsl-border-radius-modal",`${n}px`);document.documentElement.style.setProperty("--cpsl-border-radius-checkbox",`${r}px`);document.documentElement.style.setProperty("--cpsl-border-radius-switch",`${u?0:e}px`);document.documentElement.style.setProperty("--cpsl-border-radius-pill",`${u?0:e}px`);document.documentElement.style.setProperty("--cpsl-border-radius-radio",`${e}px`);if(t){const o=D(t);Object.entries(o).forEach((([o,t])=>document.documentElement.style.setProperty(o,t)))}};const U={body2XS:"body-2xs",bodyXS:"body-xs",bodyS:"body-s",bodyM:"body-m",bodyL:"body-l",bodyXL:"body-xl",headingXS:"heading-xs",headingS:"heading-s",headingM:"heading-m",headingL:"heading-l",headingXL:"heading-xl",heading2XL:"heading-2xl"};const Z=({font:o,customFontSizes:t})=>{if(o){document.documentElement.style.setProperty("--cpsl-default-font",o)}Object.entries(U).forEach((([o,c])=>{if(t===null||t===void 0?void 0:t[o]){document.documentElement.style.setProperty(`--cpsl-font-size-${c}`,t[o])}else{document.documentElement.style.removeProperty(`--cpsl-font-size-${c}`)}}))};const G=({foregroundColor:n,backgroundColor:r,accentColor:e,isDarkTheme:s,customPalette:u})=>{if(!n||!X(n)){n=o.foregroundColor}if(!r||!X(r)){r=o.backgroundColor}if(!Boolean(e)||!X(e)){e=n}const d=Boolean(e)?!$(e):false;const l={foregroundColors:[],backgroundColors:[],accentColors:[]};const a=s?"#FFFFFF":"#000000";const i=s?"#000000":"#FFFFFF";const p=d?"#FFFFFF":"#000000";t.forEach((o=>{l.foregroundColors.push(x(n,i,o));l.backgroundColors.push(x(r,a,o));l.accentColors.push(x(e,p,o))}));document.documentElement.style.setProperty("--cpsl-color-background-0",l.backgroundColors[0]);document.documentElement.style.setProperty("--cpsl-color-background-4",l.backgroundColors[1]);document.documentElement.style.setProperty("--cpsl-color-background-8",l.backgroundColors[2]);document.documentElement.style.setProperty("--cpsl-color-background-16",l.backgroundColors[3]);document.documentElement.style.setProperty("--cpsl-color-background-32",l.backgroundColors[4]);document.documentElement.style.setProperty("--cpsl-color-background-48",l.backgroundColors[5]);document.documentElement.style.setProperty("--cpsl-color-background-64",l.backgroundColors[6]);document.documentElement.style.setProperty("--cpsl-color-background-80",l.backgroundColors[7]);document.documentElement.style.setProperty("--cpsl-color-background-96",l.backgroundColors[8]);document.documentElement.style.setProperty("--cpsl-color-foreground-0",l.foregroundColors[0]);document.documentElement.style.setProperty("--cpsl-color-foreground-4",l.foregroundColors[1]);document.documentElement.style.setProperty("--cpsl-color-foreground-8",l.foregroundColors[2]);document.documentElement.style.setProperty("--cpsl-color-foreground-16",l.foregroundColors[3]);document.documentElement.style.setProperty("--cpsl-color-foreground-32",l.foregroundColors[4]);document.documentElement.style.setProperty("--cpsl-color-foreground-48",l.foregroundColors[5]);document.documentElement.style.setProperty("--cpsl-color-foreground-64",l.foregroundColors[6]);document.documentElement.style.setProperty("--cpsl-color-foreground-80",l.foregroundColors[7]);document.documentElement.style.setProperty("--cpsl-color-foreground-96",l.foregroundColors[8]);document.documentElement.style.setProperty("--cpsl-color-accent-0",l.accentColors[0]);document.documentElement.style.setProperty("--cpsl-color-accent-4",l.accentColors[1]);document.documentElement.style.setProperty("--cpsl-color-accent-8",l.accentColors[2]);document.documentElement.style.setProperty("--cpsl-color-accent-16",l.accentColors[3]);document.documentElement.style.setProperty("--cpsl-color-accent-32",l.accentColors[4]);document.documentElement.style.setProperty("--cpsl-color-accent-48",l.accentColors[5]);document.documentElement.style.setProperty("--cpsl-color-accent-64",l.accentColors[6]);document.documentElement.style.setProperty("--cpsl-color-accent-80",l.accentColors[7]);document.documentElement.style.setProperty("--cpsl-color-accent-96",l.accentColors[8]);document.documentElement.style.setProperty("--cpsl-color-contrast",s?"#FFFFFF":"#000000");const _="#FFFFFF";const f=.72;const b=T(n,c.red);const m=T(n,c.yellow);const g=T(n,c.green);document.documentElement.style.setProperty("--cpsl-color-utility-red",b);document.documentElement.style.setProperty("--cpsl-color-utility-yellow",m);document.documentElement.style.setProperty("--cpsl-color-utility-green",g);document.documentElement.style.setProperty("--cpsl-color-utility-red-light",x(b,_,f));document.documentElement.style.setProperty("--cpsl-color-utility-yellow-light",x(m,_,f));document.documentElement.style.setProperty("--cpsl-color-utility-green-light",x(g,_,f));if(u){const o=P(u);Object.entries(o).forEach((([o,t])=>document.documentElement.style.setProperty(o,t)))}};const H=({foregroundColor:t=o.foregroundColor,backgroundColor:c=o.backgroundColor,accentColor:n,darkForegroundColor:r,darkBackgroundColor:e,darkAccentColor:s,mode:u="light",font:d,customPalette:l,borderRadius:a,customFontSizes:i,customBorderRadii:p})=>{const _=u==="dark";G({foregroundColor:_?r!==null&&r!==void 0?r:t:t,backgroundColor:_?e!==null&&e!==void 0?e:c:c,accentColor:_?s!==null&&s!==void 0?s:n:n,customPalette:l,isDarkTheme:_});Z({font:d,customFontSizes:i});N({borderRadius:a,customBorderRadii:p})};export{H as generateTheme};
2
2
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["guard","low","high","value","Math","min","max","ColorError","Error","constructor","color","super","ColorError$1","parseToRgba","trim","toLowerCase","normalizedColor","namedColorRegex","test","nameToHex","reducedHexMatch","reducedHexRegex","exec","arr","Array","from","slice","map","x","parseInt","r","hexMatch","hexRegex","rgbaMatch","rgbaRegex","parseFloat","hslaMatch","hslaRegex","h","s","l","a","hslToRgb","Number","isNaN","hash","str","i","length","charCodeAt","colorToInt","replace","compressedColorMap","split","reduce","acc","next","key","substring","hex","toString","prefix","normalizedColorName","result","amount","join","RegExp","roundColor","round","hue","saturation","lightness","huePrime","chroma","abs","secondComponent","red","green","blue","lightnessModification","finalRed","finalGreen","finalBlue","getLuminance","f","channel","pow","g","b","rgba","alpha","toFixed","mix","color1","color2","weight","normalize","n","index","r1","g1","b1","a1","r2","g2","b2","a2","alphaDelta","normalizedWeight","combinedWeight","weight2","weight1","readableColorIsBlack","t","u","M","m","d","p","v","o","O","unitInput","unitOutput","roundOutput","e","c","D","isColor","strColor","Option","style","toKebabCase","pascal","buildVars","prev","obj","resp","k","name","Object","assign","getCssColors","customPalette","getCssBorderRadii","customBorderRadii","overlayMix","baseColor","overlayColor","baseRGBA","overlayRGBA","finalRGBA","overlay","generateBorderRadii","borderRadius","mediumRadius","largeRadius","checkboxRadius","fullRadius","isFull","isNone","document","documentElement","setProperty","cssBorderRadiiVars","entries","forEach","FONT_NAME_MAP","body2XS","bodyXS","bodyS","bodyM","bodyL","bodyXL","headingXS","headingS","headingM","headingL","headingXL","heading2XL","generateFont","font","customFontSizes","removeProperty","generatePalette","foregroundColor","backgroundColor","accentColor","isDarkTheme","DEFAULT_THEME","Boolean","isDarkAccent","palette","foregroundColors","backgroundColors","accentColors","backgroundMixColor","foregroundMixColor","accentMixColor","COLOR_MIXES","push","utilityLightMixColor","utilityLightMixValue","UTILITY_COLORS","yellow","cssColorVars","generateTheme","darkForegroundColor","darkBackgroundColor","darkAccentColor","mode"],"sources":["../../node_modules/color2k/dist/index.module.es.js","../../node_modules/color-blend/dist/index.modern.js","src/utils/theme/utils.ts","src/utils/theme/generateBorderRadii.ts","src/utils/theme/generateFont.ts","src/utils/theme/generatePalette.ts","src/utils/theme/generateTheme.ts"],"sourcesContent":["/**\n * A simple guard function:\n *\n * ```js\n * Math.min(Math.max(low, value), high)\n * ```\n */\nfunction guard(low, high, value) {\n return Math.min(Math.max(low, value), high);\n}\n\nclass ColorError extends Error {\n constructor(color) {\n super(`Failed to parse color: \"${color}\"`);\n }\n}\nvar ColorError$1 = ColorError;\n\n/**\n * Parses a color into red, gree, blue, alpha parts\n *\n * @param color the input color. Can be a RGB, RBGA, HSL, HSLA, or named color\n */\nfunction parseToRgba(color) {\n if (typeof color !== 'string') throw new ColorError$1(color);\n if (color.trim().toLowerCase() === 'transparent') return [0, 0, 0, 0];\n let normalizedColor = color.trim();\n normalizedColor = namedColorRegex.test(color) ? nameToHex(color) : color;\n const reducedHexMatch = reducedHexRegex.exec(normalizedColor);\n if (reducedHexMatch) {\n const arr = Array.from(reducedHexMatch).slice(1);\n return [...arr.slice(0, 3).map(x => parseInt(r(x, 2), 16)), parseInt(r(arr[3] || 'f', 2), 16) / 255];\n }\n const hexMatch = hexRegex.exec(normalizedColor);\n if (hexMatch) {\n const arr = Array.from(hexMatch).slice(1);\n return [...arr.slice(0, 3).map(x => parseInt(x, 16)), parseInt(arr[3] || 'ff', 16) / 255];\n }\n const rgbaMatch = rgbaRegex.exec(normalizedColor);\n if (rgbaMatch) {\n const arr = Array.from(rgbaMatch).slice(1);\n return [...arr.slice(0, 3).map(x => parseInt(x, 10)), parseFloat(arr[3] || '1')];\n }\n const hslaMatch = hslaRegex.exec(normalizedColor);\n if (hslaMatch) {\n const [h, s, l, a] = Array.from(hslaMatch).slice(1).map(parseFloat);\n if (guard(0, 100, s) !== s) throw new ColorError$1(color);\n if (guard(0, 100, l) !== l) throw new ColorError$1(color);\n return [...hslToRgb(h, s, l), Number.isNaN(a) ? 1 : a];\n }\n throw new ColorError$1(color);\n}\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n while (i) {\n hash = hash * 33 ^ str.charCodeAt(--i);\n }\n\n /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed\n * integers. Since we want the results to be always positive, convert the\n * signed int to an unsigned by doing an unsigned bitshift. */\n return (hash >>> 0) % 2341;\n}\nconst colorToInt = x => parseInt(x.replace(/_/g, ''), 36);\nconst compressedColorMap = '1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm'.split(' ').reduce((acc, next) => {\n const key = colorToInt(next.substring(0, 3));\n const hex = colorToInt(next.substring(3)).toString(16);\n\n // NOTE: padStart could be used here but it breaks Node 6 compat\n // https://github.com/ricokahler/color2k/issues/351\n let prefix = '';\n for (let i = 0; i < 6 - hex.length; i++) {\n prefix += '0';\n }\n acc[key] = `${prefix}${hex}`;\n return acc;\n}, {});\n\n/**\n * Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.\n */\nfunction nameToHex(color) {\n const normalizedColorName = color.toLowerCase().trim();\n const result = compressedColorMap[hash(normalizedColorName)];\n if (!result) throw new ColorError$1(color);\n return `#${result}`;\n}\nconst r = (str, amount) => Array.from(Array(amount)).map(() => str).join('');\nconst reducedHexRegex = new RegExp(`^#${r('([a-f0-9])', 3)}([a-f0-9])?$`, 'i');\nconst hexRegex = new RegExp(`^#${r('([a-f0-9]{2})', 3)}([a-f0-9]{2})?$`, 'i');\nconst rgbaRegex = new RegExp(`^rgba?\\\\(\\\\s*(\\\\d+)\\\\s*${r(',\\\\s*(\\\\d+)\\\\s*', 2)}(?:,\\\\s*([\\\\d.]+))?\\\\s*\\\\)$`, 'i');\nconst hslaRegex = /^hsla?\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)%\\s*,\\s*([\\d.]+)%(?:\\s*,\\s*([\\d.]+))?\\s*\\)$/i;\nconst namedColorRegex = /^[a-z]+$/i;\nconst roundColor = color => {\n return Math.round(color * 255);\n};\nconst hslToRgb = (hue, saturation, lightness) => {\n let l = lightness / 100;\n if (saturation === 0) {\n // achromatic\n return [l, l, l].map(roundColor);\n }\n\n // formulae from https://en.wikipedia.org/wiki/HSL_and_HSV\n const huePrime = (hue % 360 + 360) % 360 / 60;\n const chroma = (1 - Math.abs(2 * l - 1)) * (saturation / 100);\n const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));\n let red = 0;\n let green = 0;\n let blue = 0;\n if (huePrime >= 0 && huePrime < 1) {\n red = chroma;\n green = secondComponent;\n } else if (huePrime >= 1 && huePrime < 2) {\n red = secondComponent;\n green = chroma;\n } else if (huePrime >= 2 && huePrime < 3) {\n green = chroma;\n blue = secondComponent;\n } else if (huePrime >= 3 && huePrime < 4) {\n green = secondComponent;\n blue = chroma;\n } else if (huePrime >= 4 && huePrime < 5) {\n red = secondComponent;\n blue = chroma;\n } else if (huePrime >= 5 && huePrime < 6) {\n red = chroma;\n blue = secondComponent;\n }\n const lightnessModification = l - chroma / 2;\n const finalRed = red + lightnessModification;\n const finalGreen = green + lightnessModification;\n const finalBlue = blue + lightnessModification;\n return [finalRed, finalGreen, finalBlue].map(roundColor);\n};\n\n// taken from:\n// https://github.com/styled-components/polished/blob/a23a6a2bb26802b3d922d9c3b67bac3f3a54a310/src/internalHelpers/_rgbToHsl.js\n\n/**\n * Parses a color in hue, saturation, lightness, and the alpha channel.\n *\n * Hue is a number between 0 and 360, saturation, lightness, and alpha are\n * decimal percentages between 0 and 1\n */\nfunction parseToHsla(color) {\n const [red, green, blue, alpha] = parseToRgba(color).map((value, index) =>\n // 3rd index is alpha channel which is already normalized\n index === 3 ? value : value / 255);\n const max = Math.max(red, green, blue);\n const min = Math.min(red, green, blue);\n const lightness = (max + min) / 2;\n\n // achromatic\n if (max === min) return [0, 0, lightness, alpha];\n const delta = max - min;\n const saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);\n const hue = 60 * (red === max ? (green - blue) / delta + (green < blue ? 6 : 0) : green === max ? (blue - red) / delta + 2 : (red - green) / delta + 4);\n return [hue, saturation, lightness, alpha];\n}\n\n/**\n * Takes in hsla parts and constructs an hsla string\n *\n * @param hue The color circle (from 0 to 360) - 0 (or 360) is red, 120 is green, 240 is blue\n * @param saturation Percentage of saturation, given as a decimal between 0 and 1\n * @param lightness Percentage of lightness, given as a decimal between 0 and 1\n * @param alpha Percentage of opacity, given as a decimal between 0 and 1\n */\nfunction hsla(hue, saturation, lightness, alpha) {\n return `hsla(${(hue % 360).toFixed()}, ${guard(0, 100, saturation * 100).toFixed()}%, ${guard(0, 100, lightness * 100).toFixed()}%, ${parseFloat(guard(0, 1, alpha).toFixed(3))})`;\n}\n\n/**\n * Adjusts the current hue of the color by the given degrees. Wraps around when\n * over 360.\n *\n * @param color input color\n * @param degrees degrees to adjust the input color, accepts degree integers\n * (0 - 360) and wraps around on overflow\n */\nfunction adjustHue(color, degrees) {\n const [h, s, l, a] = parseToHsla(color);\n return hsla(h + degrees, s, l, a);\n}\n\n/**\n * Darkens using lightness. This is equivalent to subtracting the lightness\n * from the L in HSL.\n *\n * @param amount The amount to darken, given as a decimal between 0 and 1\n */\nfunction darken(color, amount) {\n const [hue, saturation, lightness, alpha] = parseToHsla(color);\n return hsla(hue, saturation, lightness - amount, alpha);\n}\n\n/**\n * Desaturates the input color by the given amount via subtracting from the `s`\n * in `hsla`.\n *\n * @param amount The amount to desaturate, given as a decimal between 0 and 1\n */\nfunction desaturate(color, amount) {\n const [h, s, l, a] = parseToHsla(color);\n return hsla(h, s - amount, l, a);\n}\n\n// taken from:\n// https://github.com/styled-components/polished/blob/0764c982551b487469043acb56281b0358b3107b/src/color/getLuminance.js\n\n/**\n * Returns a number (float) representing the luminance of a color.\n */\nfunction getLuminance(color) {\n if (color === 'transparent') return 0;\n function f(x) {\n const channel = x / 255;\n return channel <= 0.04045 ? channel / 12.92 : Math.pow((channel + 0.055) / 1.055, 2.4);\n }\n const [r, g, b] = parseToRgba(color);\n return 0.2126 * f(r) + 0.7152 * f(g) + 0.0722 * f(b);\n}\n\n// taken from:\n// https://github.com/styled-components/polished/blob/0764c982551b487469043acb56281b0358b3107b/src/color/getContrast.js\n\n/**\n * Returns the contrast ratio between two colors based on\n * [W3's recommended equation for calculating contrast](http://www.w3.org/TR/WCAG20/#contrast-ratiodef).\n */\nfunction getContrast(color1, color2) {\n const luminance1 = getLuminance(color1);\n const luminance2 = getLuminance(color2);\n return luminance1 > luminance2 ? (luminance1 + 0.05) / (luminance2 + 0.05) : (luminance2 + 0.05) / (luminance1 + 0.05);\n}\n\n/**\n * Takes in rgba parts and returns an rgba string\n *\n * @param red The amount of red in the red channel, given in a number between 0 and 255 inclusive\n * @param green The amount of green in the red channel, given in a number between 0 and 255 inclusive\n * @param blue The amount of blue in the red channel, given in a number between 0 and 255 inclusive\n * @param alpha Percentage of opacity, given as a decimal between 0 and 1\n */\nfunction rgba(red, green, blue, alpha) {\n return `rgba(${guard(0, 255, red).toFixed()}, ${guard(0, 255, green).toFixed()}, ${guard(0, 255, blue).toFixed()}, ${parseFloat(guard(0, 1, alpha).toFixed(3))})`;\n}\n\n/**\n * Mixes two colors together. Taken from sass's implementation.\n */\nfunction mix(color1, color2, weight) {\n const normalize = (n, index) =>\n // 3rd index is alpha channel which is already normalized\n index === 3 ? n : n / 255;\n const [r1, g1, b1, a1] = parseToRgba(color1).map(normalize);\n const [r2, g2, b2, a2] = parseToRgba(color2).map(normalize);\n\n // The formula is copied from the original Sass implementation:\n // http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method\n const alphaDelta = a2 - a1;\n const normalizedWeight = weight * 2 - 1;\n const combinedWeight = normalizedWeight * alphaDelta === -1 ? normalizedWeight : normalizedWeight + alphaDelta / (1 + normalizedWeight * alphaDelta);\n const weight2 = (combinedWeight + 1) / 2;\n const weight1 = 1 - weight2;\n const r = (r1 * weight1 + r2 * weight2) * 255;\n const g = (g1 * weight1 + g2 * weight2) * 255;\n const b = (b1 * weight1 + b2 * weight2) * 255;\n const a = a2 * weight + a1 * (1 - weight);\n return rgba(r, g, b, a);\n}\n\n/**\n * Given a series colors, this function will return a `scale(x)` function that\n * accepts a percentage as a decimal between 0 and 1 and returns the color at\n * that percentage in the scale.\n *\n * ```js\n * const scale = getScale('red', 'yellow', 'green');\n * console.log(scale(0)); // rgba(255, 0, 0, 1)\n * console.log(scale(0.5)); // rgba(255, 255, 0, 1)\n * console.log(scale(1)); // rgba(0, 128, 0, 1)\n * ```\n *\n * If you'd like to limit the domain and range like chroma-js, we recommend\n * wrapping scale again.\n *\n * ```js\n * const _scale = getScale('red', 'yellow', 'green');\n * const scale = x => _scale(x / 100);\n *\n * console.log(scale(0)); // rgba(255, 0, 0, 1)\n * console.log(scale(50)); // rgba(255, 255, 0, 1)\n * console.log(scale(100)); // rgba(0, 128, 0, 1)\n * ```\n */\nfunction getScale(...colors) {\n return n => {\n const lastIndex = colors.length - 1;\n const lowIndex = guard(0, lastIndex, Math.floor(n * lastIndex));\n const highIndex = guard(0, lastIndex, Math.ceil(n * lastIndex));\n const color1 = colors[lowIndex];\n const color2 = colors[highIndex];\n const unit = 1 / lastIndex;\n const weight = (n - unit * lowIndex) / unit;\n return mix(color1, color2, weight);\n };\n}\n\nconst guidelines = {\n decorative: 1.5,\n readable: 3,\n aa: 4.5,\n aaa: 7\n};\n\n/**\n * Returns whether or not a color has bad contrast against a background\n * according to a given standard.\n */\nfunction hasBadContrast(color, standard = 'aa', background = '#fff') {\n return getContrast(color, background) < guidelines[standard];\n}\n\n/**\n * Lightens a color by a given amount. This is equivalent to\n * `darken(color, -amount)`\n *\n * @param amount The amount to darken, given as a decimal between 0 and 1\n */\nfunction lighten(color, amount) {\n return darken(color, -amount);\n}\n\n/**\n * Takes in a color and makes it more transparent by convert to `rgba` and\n * decreasing the amount in the alpha channel.\n *\n * @param amount The amount to increase the transparency by, given as a decimal between 0 and 1\n */\nfunction transparentize(color, amount) {\n const [r, g, b, a] = parseToRgba(color);\n return rgba(r, g, b, a - amount);\n}\n\n/**\n * Takes a color and un-transparentizes it. Equivalent to\n * `transparentize(color, -amount)`\n *\n * @param amount The amount to increase the opacity by, given as a decimal between 0 and 1\n */\nfunction opacify(color, amount) {\n return transparentize(color, -amount);\n}\n\n/**\n * An alternative function to `readableColor`. Returns whether or not the \n * readable color (i.e. the color to be place on top the input color) should be\n * black.\n */\nfunction readableColorIsBlack(color) {\n return getLuminance(color) > 0.179;\n}\n\n/**\n * Returns black or white for best contrast depending on the luminosity of the\n * given color.\n */\nfunction readableColor(color) {\n return readableColorIsBlack(color) ? '#000' : '#fff';\n}\n\n/**\n * Saturates a color by converting it to `hsl` and increasing the saturation\n * amount. Equivalent to `desaturate(color, -amount)`\n * \n * @param color Input color\n * @param amount The amount to darken, given as a decimal between 0 and 1\n */\nfunction saturate(color, amount) {\n return desaturate(color, -amount);\n}\n\n/**\n * Takes in any color and returns it as a hex code.\n */\nfunction toHex(color) {\n const [r, g, b, a] = parseToRgba(color);\n let hex = x => {\n const h = guard(0, 255, x).toString(16);\n // NOTE: padStart could be used here but it breaks Node 6 compat\n // https://github.com/ricokahler/color2k/issues/351\n return h.length === 1 ? `0${h}` : h;\n };\n return `#${hex(r)}${hex(g)}${hex(b)}${a < 1 ? hex(Math.round(a * 255)) : ''}`;\n}\n\n/**\n * Takes in any color and returns it as an rgba string.\n */\nfunction toRgba(color) {\n return rgba(...parseToRgba(color));\n}\n\n/**\n * Takes in any color and returns it as an hsla string.\n */\nfunction toHsla(color) {\n return hsla(...parseToHsla(color));\n}\n\nexport { ColorError$1 as ColorError, adjustHue, darken, desaturate, getContrast, getLuminance, getScale, guard, hasBadContrast, hsla, lighten, mix, opacify, parseToHsla, parseToRgba, readableColor, readableColorIsBlack, rgba, saturate, toHex, toHsla, toRgba, transparentize };\n//# sourceMappingURL=index.module.es.js.map\n","function n(n,r,t){return{r:255*t(n.r/255,r.r/255),g:255*t(n.g/255,r.g/255),b:255*t(n.b/255,r.b/255)}}function r(n,r){return r}function t(n,r){return n*r}function u(n,r){return n+r-n*r}function i(n,r){return a(r,n)}function o(n,r){return Math.min(n,r)}function e(n,r){return Math.min(Math.max(n,r),1)}function c(n,r){return 0===n?0:1===r?1:Math.min(1,n/(1-r))}function f(n,r){return 1===n?1:0===r?0:1-Math.min(1,(1-n)/r)}function a(n,r){return r<=.5?t(n,2*r):u(n,2*r-1)}function b(n,r){return r<=.5?n-(1-2*r)*n*(1-n):n+(2*r-1)*((n<=.25?((16*n-12)*n+4)*n:Math.sqrt(n))-n)}function g(n,r){return Math.abs(n-r)}function h(n,r){return n+r-2*n*r}function M(n,r,t){return Math.min(Math.max(n||0,r),t)}function m(n){return{r:M(n.r,0,255),g:M(n.g,0,255),b:M(n.b,0,255),a:M(n.a,0,1)}}function d(n){return{r:255*n.r,g:255*n.g,b:255*n.b,a:n.a}}function p(n){return{r:n.r/255,g:n.g/255,b:n.b/255,a:n.a}}function v(n,r){void 0===r&&(r=0);var t=Math.pow(10,r);return{r:Math.round(n.r*t)/t,g:Math.round(n.g*t)/t,b:Math.round(n.b*t)/t,a:n.a}}function x(n,r,t,u,i,o){return(1-r/t)*u+r/t*Math.round((1-n)*i+n*o)}function O(n,r,t,u,i){void 0===i&&(i={unitInput:!1,unitOutput:!1,roundOutput:!0}),i.unitInput&&(n=d(n),r=d(r)),n=m(n);var o=(r=m(r)).a+n.a-r.a*n.a,e=t(n,r,u),c=m({r:x(n.a,r.a,o,n.r,r.r,e.r),g:x(n.a,r.a,o,n.g,r.g,e.g),b:x(n.a,r.a,o,n.b,r.b,e.b),a:o});return c=i.unitOutput?p(c):i.roundOutput?v(c):function(n){return v(n,9)}(c),c}function s(n,r,t){return d(t(p(n),p(r)))}function I(n){return.3*n.r+.59*n.g+.11*n.b}function q(n,r){var t=r-I(n);return function(n){var r=I(n),t=n.r,u=n.g,i=n.b,o=Math.min(t,u,i),e=Math.max(t,u,i);function c(n){return r+(n-r)*r/(r-o)}function f(n){return r+(n-r)*(1-r)/(e-r)}return o<0&&(t=c(t),u=c(u),i=c(i)),e>1&&(t=f(t),u=f(u),i=f(i)),{r:t,g:u,b:i}}({r:n.r+t,g:n.g+t,b:n.b+t})}function w(n){return Math.max(n.r,n.g,n.b)-Math.min(n.r,n.g,n.b)}function j(n,r){var t=[\"r\",\"g\",\"b\"].sort(function(r,t){return n[r]-n[t]}),u=t[0],i=t[1],o=t[2],e={r:n.r,g:n.g,b:n.b};return e[o]>e[u]?(e[i]=(e[i]-e[u])*r/(e[o]-e[u]),e[o]=r):e[i]=e[o]=0,e[u]=0,e}function k(n,r){return q(j(r,w(n)),I(n))}function l(n,r){return q(j(n,w(r)),I(n))}function y(n,r){return q(r,I(n))}function z(n,r){return q(n,I(r))}function A(t,u){return O(t,u,n,r)}function B(r,u){return O(r,u,n,t)}function C(r,t){return O(r,t,n,u)}function D(r,t){return O(r,t,n,i)}function E(r,t){return O(r,t,n,o)}function F(r,t){return O(r,t,n,e)}function G(r,t){return O(r,t,n,c)}function H(r,t){return O(r,t,n,f)}function J(r,t){return O(r,t,n,a)}function K(r,t){return O(r,t,n,b)}function L(r,t){return O(r,t,n,g)}function N(r,t){return O(r,t,n,h)}function P(n,r){return O(n,r,s,k)}function Q(n,r){return O(n,r,s,l)}function R(n,r){return O(n,r,s,y)}function S(n,r){return O(n,r,s,z)}export{R as color,H as colorBurn,G as colorDodge,E as darken,L as difference,N as exclusion,J as hardLight,P as hue,F as lighten,S as luminosity,B as multiply,A as normal,D as overlay,Q as saturation,C as screen,K as softLight};\n//# sourceMappingURL=index.modern.js.map\n","import { parseToRgba, rgba } from 'color2k';\nimport { CustomBorderRadii, CustomPalette } from '../../interface';\nimport { overlay } from 'color-blend';\n\nexport const isColor = strColor => {\n const s = new Option().style;\n s.color = strColor;\n return s.color !== '';\n};\n\nconst toKebabCase = (pascal: string) => pascal.replace(/([a-z0–9])([A-Z])/g, '$1-$2').toLowerCase();\n\n// This function handles arrays and objects\nconst buildVars = (prev: string, obj: any): { [k: string]: string } => {\n let resp = {};\n\n for (const k in obj) {\n const name = `${prev}-${toKebabCase(k)}`;\n if (typeof obj[k] === 'object' && obj[k] !== null) {\n resp = { ...resp, ...buildVars(name, obj[k]) };\n } else {\n resp[name] = obj[k];\n }\n }\n\n return resp;\n};\n\nexport const getCssColors = (customPalette: CustomPalette): { [k: string]: string } => buildVars('--cpsl-color', customPalette);\nexport const getCssBorderRadii = (customBorderRadii: CustomBorderRadii): { [k: string]: string } => buildVars('--cpsl-border-radius', customBorderRadii);\n\nexport const overlayMix = (baseColor: string, overlayColor: string) => {\n const baseRGBA = parseToRgba(baseColor);\n const overlayRGBA = parseToRgba(overlayColor);\n\n const finalRGBA = overlay({ r: baseRGBA[0], g: baseRGBA[1], b: baseRGBA[2], a: 0.1 }, { r: overlayRGBA[0], g: overlayRGBA[1], b: overlayRGBA[2], a: overlayRGBA[3] });\n\n return rgba(finalRGBA.r, finalRGBA.g, finalRGBA.b, finalRGBA.a);\n};\n","import { Theme } from '../../interface';\nimport { getCssBorderRadii } from './utils';\n\nexport const generateBorderRadii = ({ borderRadius, customBorderRadii }: Pick<Theme, 'borderRadius' | 'customBorderRadii'>) => {\n let mediumRadius: number,\n largeRadius: number,\n checkboxRadius: number = 4;\n const fullRadius = 1000;\n let isFull = false;\n let isNone = false;\n\n switch (borderRadius) {\n case 'none': {\n isNone = true;\n mediumRadius = 0;\n largeRadius = 0;\n checkboxRadius = 0;\n break;\n }\n case 'xs': {\n mediumRadius = 2;\n largeRadius = 4;\n checkboxRadius = 2;\n break;\n }\n case 'sm': {\n mediumRadius = 4;\n largeRadius = 8;\n break;\n }\n case 'md': {\n mediumRadius = 8;\n largeRadius = 16;\n break;\n }\n case 'xl': {\n mediumRadius = 16;\n largeRadius = 32;\n break;\n }\n case 'full': {\n mediumRadius = 24;\n largeRadius = 32;\n isFull = true;\n break;\n }\n default:\n case 'lg': {\n mediumRadius = 12;\n largeRadius = 24;\n break;\n }\n }\n\n document.documentElement.style.setProperty('--cpsl-border-radius-input', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-select', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-file', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-alert', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-tabs', `${isNone ? 0 : fullRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-primary-button', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-secondary-button', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-tertiary-button', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-destructive-button', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-tile-button', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-qr-code', `${largeRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-info-box', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-table-container', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-avatar', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-button-group', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-card', `${largeRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-modal', `${largeRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-checkbox', `${checkboxRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-switch', `${isNone ? 0 : fullRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-pill', `${isNone ? 0 : fullRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-radio', `${fullRadius}px`);\n\n if (customBorderRadii) {\n const cssBorderRadiiVars = getCssBorderRadii(customBorderRadii);\n Object.entries(cssBorderRadiiVars).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));\n }\n};\n","import { Theme } from '../../interface';\n\nconst FONT_NAME_MAP = {\n body2XS: 'body-2xs',\n bodyXS: 'body-xs',\n bodyS: 'body-s',\n bodyM: 'body-m',\n bodyL: 'body-l',\n bodyXL: 'body-xl',\n headingXS: 'heading-xs',\n headingS: 'heading-s',\n headingM: 'heading-m',\n headingL: 'heading-l',\n headingXL: 'heading-xl',\n heading2XL: 'heading-2xl',\n};\n\nexport const generateFont = ({ font, customFontSizes }: Pick<Theme, 'font' | 'customFontSizes'>) => {\n if (font) {\n document.documentElement.style.setProperty('--cpsl-default-font', font);\n }\n\n Object.entries(FONT_NAME_MAP).forEach(([key, value]) => {\n if (customFontSizes?.[key]) {\n document.documentElement.style.setProperty(`--cpsl-font-size-${value}`, customFontSizes[key]);\n } else {\n document.documentElement.style.removeProperty(`--cpsl-font-size-${value}`);\n }\n });\n};\n","import { mix, readableColorIsBlack } from 'color2k';\nimport { Theme } from '../../interface';\nimport { getCssColors, isColor, overlayMix } from './utils';\nimport { COLOR_MIXES, DEFAULT_THEME, UTILITY_COLORS } from '../../constants';\n\nexport type Palette = {\n foregroundColors: string[];\n backgroundColors: string[];\n accentColors: string[];\n};\n\nexport const generatePalette = ({\n foregroundColor,\n backgroundColor,\n accentColor,\n isDarkTheme,\n customPalette,\n}: Pick<Theme, 'foregroundColor' | 'backgroundColor' | 'accentColor' | 'customPalette'> & { isDarkTheme: boolean }) => {\n if (!foregroundColor || !isColor(foregroundColor)) {\n foregroundColor = DEFAULT_THEME.foregroundColor;\n }\n if (!backgroundColor || !isColor(backgroundColor)) {\n backgroundColor = DEFAULT_THEME.backgroundColor;\n }\n if (!Boolean(accentColor) || !isColor(accentColor)) {\n accentColor = foregroundColor;\n }\n\n const isDarkAccent = Boolean(accentColor) ? !readableColorIsBlack(accentColor) : false;\n\n const palette: Palette = {\n foregroundColors: [],\n backgroundColors: [],\n accentColors: [],\n };\n\n const backgroundMixColor = isDarkTheme ? '#FFFFFF' : '#000000';\n const foregroundMixColor = isDarkTheme ? '#000000' : '#FFFFFF';\n const accentMixColor = isDarkAccent ? '#FFFFFF' : '#000000';\n\n COLOR_MIXES.forEach(value => {\n palette.foregroundColors.push(mix(foregroundColor, foregroundMixColor, value));\n palette.backgroundColors.push(mix(backgroundColor, backgroundMixColor, value));\n palette.accentColors.push(mix(accentColor, accentMixColor, value));\n });\n\n // BACKGROUND\n document.documentElement.style.setProperty('--cpsl-color-background-0', palette.backgroundColors[0]);\n document.documentElement.style.setProperty('--cpsl-color-background-4', palette.backgroundColors[1]);\n document.documentElement.style.setProperty('--cpsl-color-background-8', palette.backgroundColors[2]);\n document.documentElement.style.setProperty('--cpsl-color-background-16', palette.backgroundColors[3]);\n document.documentElement.style.setProperty('--cpsl-color-background-32', palette.backgroundColors[4]);\n document.documentElement.style.setProperty('--cpsl-color-background-48', palette.backgroundColors[5]);\n document.documentElement.style.setProperty('--cpsl-color-background-64', palette.backgroundColors[6]);\n document.documentElement.style.setProperty('--cpsl-color-background-80', palette.backgroundColors[7]);\n document.documentElement.style.setProperty('--cpsl-color-background-96', palette.backgroundColors[8]);\n\n // FOREGROUND\n document.documentElement.style.setProperty('--cpsl-color-foreground-0', palette.foregroundColors[0]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-4', palette.foregroundColors[1]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-8', palette.foregroundColors[2]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-16', palette.foregroundColors[3]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-32', palette.foregroundColors[4]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-48', palette.foregroundColors[5]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-64', palette.foregroundColors[6]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-80', palette.foregroundColors[7]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-96', palette.foregroundColors[8]);\n\n // ACCENT\n document.documentElement.style.setProperty('--cpsl-color-accent-0', palette.accentColors[0]);\n document.documentElement.style.setProperty('--cpsl-color-accent-4', palette.accentColors[1]);\n document.documentElement.style.setProperty('--cpsl-color-accent-8', palette.accentColors[2]);\n document.documentElement.style.setProperty('--cpsl-color-accent-16', palette.accentColors[3]);\n document.documentElement.style.setProperty('--cpsl-color-accent-32', palette.accentColors[4]);\n document.documentElement.style.setProperty('--cpsl-color-accent-48', palette.accentColors[5]);\n document.documentElement.style.setProperty('--cpsl-color-accent-64', palette.accentColors[6]);\n document.documentElement.style.setProperty('--cpsl-color-accent-80', palette.accentColors[7]);\n document.documentElement.style.setProperty('--cpsl-color-accent-96', palette.accentColors[8]);\n\n // CONTRAST\n document.documentElement.style.setProperty('--cpsl-color-contrast', isDarkTheme ? '#FFFFFF' : '#000000');\n\n const utilityLightMixColor = '#FFFFFF';\n const utilityLightMixValue = 0.72;\n // UTILITY\n const red = overlayMix(foregroundColor, UTILITY_COLORS.red);\n const yellow = overlayMix(foregroundColor, UTILITY_COLORS.yellow);\n const green = overlayMix(foregroundColor, UTILITY_COLORS.green);\n document.documentElement.style.setProperty('--cpsl-color-utility-red', red);\n document.documentElement.style.setProperty('--cpsl-color-utility-yellow', yellow);\n document.documentElement.style.setProperty('--cpsl-color-utility-green', green);\n document.documentElement.style.setProperty('--cpsl-color-utility-red-light', mix(red, utilityLightMixColor, utilityLightMixValue));\n document.documentElement.style.setProperty('--cpsl-color-utility-yellow-light', mix(yellow, utilityLightMixColor, utilityLightMixValue));\n document.documentElement.style.setProperty('--cpsl-color-utility-green-light', mix(green, utilityLightMixColor, utilityLightMixValue));\n\n if (customPalette) {\n const cssColorVars = getCssColors(customPalette);\n Object.entries(cssColorVars).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));\n }\n};\n","import { DEFAULT_THEME } from '../../constants';\nimport { Theme } from '../../interface';\nimport { generateBorderRadii } from './generateBorderRadii';\nimport { generateFont } from './generateFont';\nimport { generatePalette } from './generatePalette';\n\n/**\n * Generates css theme variables.\n * @returns @boolean Whether background is dark or not.\n */\nexport const generateTheme = ({\n foregroundColor = DEFAULT_THEME.foregroundColor,\n backgroundColor = DEFAULT_THEME.backgroundColor,\n accentColor,\n darkForegroundColor,\n darkBackgroundColor,\n darkAccentColor,\n mode = 'light',\n font,\n customPalette,\n borderRadius,\n customFontSizes,\n customBorderRadii,\n}: Theme) => {\n const isDarkTheme = mode === 'dark';\n\n generatePalette({\n foregroundColor: isDarkTheme ? (darkForegroundColor ?? foregroundColor) : foregroundColor,\n backgroundColor: isDarkTheme ? (darkBackgroundColor ?? backgroundColor) : backgroundColor,\n accentColor: isDarkTheme ? (darkAccentColor ?? accentColor) : accentColor,\n customPalette,\n isDarkTheme,\n });\n\n generateFont({ font, customFontSizes });\n\n generateBorderRadii({ borderRadius, customBorderRadii });\n};\n"],"mappings":"8GAOA,SAASA,EAAMC,EAAKC,EAAMC,GACxB,OAAOC,KAAKC,IAAID,KAAKE,IAAIL,EAAKE,GAAQD,EACxC,CAEA,MAAMK,UAAmBC,MACvB,WAAAC,CAAYC,GACVC,MAAM,2BAA2BD,KACrC,EAEA,IAAIE,EAAeL,EAOnB,SAASM,EAAYH,GACnB,UAAWA,IAAU,SAAU,MAAM,IAAIE,EA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,YAAY,8BAA+ByC,GAC1E3C,SAASC,gBAAgB/B,MAAMgC,YAAY,6BAA8BtF,GACzEoF,SAASC,gBAAgB/B,MAAMgC,YAAY,iCAAkCvE,EAAIhB,EAAK6H,EAAsBC,IAC5GzC,SAASC,gBAAgB/B,MAAMgC,YAAY,oCAAqCvE,EAAIgH,EAAQH,EAAsBC,IAClHzC,SAASC,gBAAgB/B,MAAMgC,YAAY,mCAAoCvE,EAAIf,EAAO4H,EAAsBC,IAEhH,GAAI3D,EAAe,CACjB,MAAM8D,EAAe/D,EAAaC,GAClCH,OAAOyB,QAAQwC,GAAcvC,SAAQ,EAAE5B,EAAGnB,KAAO0C,SAASC,gBAAgB/B,MAAMgC,YAAYzB,EAAGnB,I,SCvFtFuF,EAAgB,EAC3BrB,kBAAkBI,EAAcJ,gBAChCC,kBAAkBG,EAAcH,gBAChCC,cACAoB,sBACAC,sBACAC,kBACAC,OAAO,QACP7B,OACAtC,gBACAW,eACA4B,kBACArC,wBAEA,MAAM2C,EAAcsB,IAAS,OAE7B1B,EAAgB,CACdC,gBAAiBG,EAAemB,IAAmB,MAAnBA,SAAmB,EAAnBA,EAAuBtB,EAAmBA,EAC1EC,gBAAiBE,EAAeoB,IAAmB,MAAnBA,SAAmB,EAAnBA,EAAuBtB,EAAmBA,EAC1EC,YAAaC,EAAeqB,IAAe,MAAfA,SAAe,EAAfA,EAAmBtB,EAAeA,EAC9D5C,gBACA6C,gBAGFR,EAAa,CAAEC,OAAMC,oBAErB7B,EAAoB,CAAEC,eAAcT,qBAAoB,S","ignoreList":[]}
1
+ {"version":3,"names":["guard","low","high","value","Math","min","max","ColorError","Error","constructor","color","super","ColorError$1","parseToRgba","trim","toLowerCase","normalizedColor","namedColorRegex","test","nameToHex","reducedHexMatch","reducedHexRegex","exec","arr","Array","from","slice","map","x","parseInt","r","hexMatch","hexRegex","rgbaMatch","rgbaRegex","parseFloat","hslaMatch","hslaRegex","h","s","l","a","hslToRgb","Number","isNaN","hash","str","i","length","charCodeAt","colorToInt","replace","compressedColorMap","split","reduce","acc","next","key","substring","hex","toString","prefix","normalizedColorName","result","amount","join","RegExp","roundColor","round","hue","saturation","lightness","huePrime","chroma","abs","secondComponent","red","green","blue","lightnessModification","finalRed","finalGreen","finalBlue","getLuminance","f","channel","pow","g","b","rgba","alpha","toFixed","mix","color1","color2","weight","normalize","n","index","r1","g1","b1","a1","r2","g2","b2","a2","alphaDelta","normalizedWeight","combinedWeight","weight2","weight1","readableColorIsBlack","t","u","M","m","d","p","v","o","O","unitInput","unitOutput","roundOutput","e","c","D","isColor","strColor","Option","style","toKebabCase","pascal","buildVars","prev","obj","resp","k","name","Object","assign","getCssColors","customPalette","getCssBorderRadii","customBorderRadii","overlayMix","baseColor","overlayColor","baseRGBA","overlayRGBA","finalRGBA","overlay","generateBorderRadii","borderRadius","mediumRadius","largeRadius","checkboxRadius","fullRadius","isFull","isNone","document","documentElement","setProperty","cssBorderRadiiVars","entries","forEach","FONT_NAME_MAP","body2XS","bodyXS","bodyS","bodyM","bodyL","bodyXL","headingXS","headingS","headingM","headingL","headingXL","heading2XL","generateFont","font","customFontSizes","removeProperty","generatePalette","foregroundColor","backgroundColor","accentColor","isDarkTheme","DEFAULT_THEME","Boolean","isDarkAccent","palette","foregroundColors","backgroundColors","accentColors","backgroundMixColor","foregroundMixColor","accentMixColor","COLOR_MIXES","push","utilityLightMixColor","utilityLightMixValue","UTILITY_COLORS","yellow","cssColorVars","generateTheme","darkForegroundColor","darkBackgroundColor","darkAccentColor","mode"],"sources":["../../node_modules/color2k/dist/index.module.es.js","../../node_modules/color-blend/dist/index.modern.js","src/utils/theme/utils.ts","src/utils/theme/generateBorderRadii.ts","src/utils/theme/generateFont.ts","src/utils/theme/generatePalette.ts","src/utils/theme/generateTheme.ts"],"sourcesContent":["/**\n * A simple guard function:\n *\n * ```js\n * Math.min(Math.max(low, value), high)\n * ```\n */\nfunction guard(low, high, value) {\n return Math.min(Math.max(low, value), high);\n}\n\nclass ColorError extends Error {\n constructor(color) {\n super(`Failed to parse color: \"${color}\"`);\n }\n}\nvar ColorError$1 = ColorError;\n\n/**\n * Parses a color into red, gree, blue, alpha parts\n *\n * @param color the input color. Can be a RGB, RBGA, HSL, HSLA, or named color\n */\nfunction parseToRgba(color) {\n if (typeof color !== 'string') throw new ColorError$1(color);\n if (color.trim().toLowerCase() === 'transparent') return [0, 0, 0, 0];\n let normalizedColor = color.trim();\n normalizedColor = namedColorRegex.test(color) ? nameToHex(color) : color;\n const reducedHexMatch = reducedHexRegex.exec(normalizedColor);\n if (reducedHexMatch) {\n const arr = Array.from(reducedHexMatch).slice(1);\n return [...arr.slice(0, 3).map(x => parseInt(r(x, 2), 16)), parseInt(r(arr[3] || 'f', 2), 16) / 255];\n }\n const hexMatch = hexRegex.exec(normalizedColor);\n if (hexMatch) {\n const arr = Array.from(hexMatch).slice(1);\n return [...arr.slice(0, 3).map(x => parseInt(x, 16)), parseInt(arr[3] || 'ff', 16) / 255];\n }\n const rgbaMatch = rgbaRegex.exec(normalizedColor);\n if (rgbaMatch) {\n const arr = Array.from(rgbaMatch).slice(1);\n return [...arr.slice(0, 3).map(x => parseInt(x, 10)), parseFloat(arr[3] || '1')];\n }\n const hslaMatch = hslaRegex.exec(normalizedColor);\n if (hslaMatch) {\n const [h, s, l, a] = Array.from(hslaMatch).slice(1).map(parseFloat);\n if (guard(0, 100, s) !== s) throw new ColorError$1(color);\n if (guard(0, 100, l) !== l) throw new ColorError$1(color);\n return [...hslToRgb(h, s, l), Number.isNaN(a) ? 1 : a];\n }\n throw new ColorError$1(color);\n}\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n while (i) {\n hash = hash * 33 ^ str.charCodeAt(--i);\n }\n\n /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed\n * integers. Since we want the results to be always positive, convert the\n * signed int to an unsigned by doing an unsigned bitshift. */\n return (hash >>> 0) % 2341;\n}\nconst colorToInt = x => parseInt(x.replace(/_/g, ''), 36);\nconst compressedColorMap = '1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm'.split(' ').reduce((acc, next) => {\n const key = colorToInt(next.substring(0, 3));\n const hex = colorToInt(next.substring(3)).toString(16);\n\n // NOTE: padStart could be used here but it breaks Node 6 compat\n // https://github.com/ricokahler/color2k/issues/351\n let prefix = '';\n for (let i = 0; i < 6 - hex.length; i++) {\n prefix += '0';\n }\n acc[key] = `${prefix}${hex}`;\n return acc;\n}, {});\n\n/**\n * Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.\n */\nfunction nameToHex(color) {\n const normalizedColorName = color.toLowerCase().trim();\n const result = compressedColorMap[hash(normalizedColorName)];\n if (!result) throw new ColorError$1(color);\n return `#${result}`;\n}\nconst r = (str, amount) => Array.from(Array(amount)).map(() => str).join('');\nconst reducedHexRegex = new RegExp(`^#${r('([a-f0-9])', 3)}([a-f0-9])?$`, 'i');\nconst hexRegex = new RegExp(`^#${r('([a-f0-9]{2})', 3)}([a-f0-9]{2})?$`, 'i');\nconst rgbaRegex = new RegExp(`^rgba?\\\\(\\\\s*(\\\\d+)\\\\s*${r(',\\\\s*(\\\\d+)\\\\s*', 2)}(?:,\\\\s*([\\\\d.]+))?\\\\s*\\\\)$`, 'i');\nconst hslaRegex = /^hsla?\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)%\\s*,\\s*([\\d.]+)%(?:\\s*,\\s*([\\d.]+))?\\s*\\)$/i;\nconst namedColorRegex = /^[a-z]+$/i;\nconst roundColor = color => {\n return Math.round(color * 255);\n};\nconst hslToRgb = (hue, saturation, lightness) => {\n let l = lightness / 100;\n if (saturation === 0) {\n // achromatic\n return [l, l, l].map(roundColor);\n }\n\n // formulae from https://en.wikipedia.org/wiki/HSL_and_HSV\n const huePrime = (hue % 360 + 360) % 360 / 60;\n const chroma = (1 - Math.abs(2 * l - 1)) * (saturation / 100);\n const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));\n let red = 0;\n let green = 0;\n let blue = 0;\n if (huePrime >= 0 && huePrime < 1) {\n red = chroma;\n green = secondComponent;\n } else if (huePrime >= 1 && huePrime < 2) {\n red = secondComponent;\n green = chroma;\n } else if (huePrime >= 2 && huePrime < 3) {\n green = chroma;\n blue = secondComponent;\n } else if (huePrime >= 3 && huePrime < 4) {\n green = secondComponent;\n blue = chroma;\n } else if (huePrime >= 4 && huePrime < 5) {\n red = secondComponent;\n blue = chroma;\n } else if (huePrime >= 5 && huePrime < 6) {\n red = chroma;\n blue = secondComponent;\n }\n const lightnessModification = l - chroma / 2;\n const finalRed = red + lightnessModification;\n const finalGreen = green + lightnessModification;\n const finalBlue = blue + lightnessModification;\n return [finalRed, finalGreen, finalBlue].map(roundColor);\n};\n\n// taken from:\n// https://github.com/styled-components/polished/blob/a23a6a2bb26802b3d922d9c3b67bac3f3a54a310/src/internalHelpers/_rgbToHsl.js\n\n/**\n * Parses a color in hue, saturation, lightness, and the alpha channel.\n *\n * Hue is a number between 0 and 360, saturation, lightness, and alpha are\n * decimal percentages between 0 and 1\n */\nfunction parseToHsla(color) {\n const [red, green, blue, alpha] = parseToRgba(color).map((value, index) =>\n // 3rd index is alpha channel which is already normalized\n index === 3 ? value : value / 255);\n const max = Math.max(red, green, blue);\n const min = Math.min(red, green, blue);\n const lightness = (max + min) / 2;\n\n // achromatic\n if (max === min) return [0, 0, lightness, alpha];\n const delta = max - min;\n const saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);\n const hue = 60 * (red === max ? (green - blue) / delta + (green < blue ? 6 : 0) : green === max ? (blue - red) / delta + 2 : (red - green) / delta + 4);\n return [hue, saturation, lightness, alpha];\n}\n\n/**\n * Takes in hsla parts and constructs an hsla string\n *\n * @param hue The color circle (from 0 to 360) - 0 (or 360) is red, 120 is green, 240 is blue\n * @param saturation Percentage of saturation, given as a decimal between 0 and 1\n * @param lightness Percentage of lightness, given as a decimal between 0 and 1\n * @param alpha Percentage of opacity, given as a decimal between 0 and 1\n */\nfunction hsla(hue, saturation, lightness, alpha) {\n return `hsla(${(hue % 360).toFixed()}, ${guard(0, 100, saturation * 100).toFixed()}%, ${guard(0, 100, lightness * 100).toFixed()}%, ${parseFloat(guard(0, 1, alpha).toFixed(3))})`;\n}\n\n/**\n * Adjusts the current hue of the color by the given degrees. Wraps around when\n * over 360.\n *\n * @param color input color\n * @param degrees degrees to adjust the input color, accepts degree integers\n * (0 - 360) and wraps around on overflow\n */\nfunction adjustHue(color, degrees) {\n const [h, s, l, a] = parseToHsla(color);\n return hsla(h + degrees, s, l, a);\n}\n\n/**\n * Darkens using lightness. This is equivalent to subtracting the lightness\n * from the L in HSL.\n *\n * @param amount The amount to darken, given as a decimal between 0 and 1\n */\nfunction darken(color, amount) {\n const [hue, saturation, lightness, alpha] = parseToHsla(color);\n return hsla(hue, saturation, lightness - amount, alpha);\n}\n\n/**\n * Desaturates the input color by the given amount via subtracting from the `s`\n * in `hsla`.\n *\n * @param amount The amount to desaturate, given as a decimal between 0 and 1\n */\nfunction desaturate(color, amount) {\n const [h, s, l, a] = parseToHsla(color);\n return hsla(h, s - amount, l, a);\n}\n\n// taken from:\n// https://github.com/styled-components/polished/blob/0764c982551b487469043acb56281b0358b3107b/src/color/getLuminance.js\n\n/**\n * Returns a number (float) representing the luminance of a color.\n */\nfunction getLuminance(color) {\n if (color === 'transparent') return 0;\n function f(x) {\n const channel = x / 255;\n return channel <= 0.04045 ? channel / 12.92 : Math.pow((channel + 0.055) / 1.055, 2.4);\n }\n const [r, g, b] = parseToRgba(color);\n return 0.2126 * f(r) + 0.7152 * f(g) + 0.0722 * f(b);\n}\n\n// taken from:\n// https://github.com/styled-components/polished/blob/0764c982551b487469043acb56281b0358b3107b/src/color/getContrast.js\n\n/**\n * Returns the contrast ratio between two colors based on\n * [W3's recommended equation for calculating contrast](http://www.w3.org/TR/WCAG20/#contrast-ratiodef).\n */\nfunction getContrast(color1, color2) {\n const luminance1 = getLuminance(color1);\n const luminance2 = getLuminance(color2);\n return luminance1 > luminance2 ? (luminance1 + 0.05) / (luminance2 + 0.05) : (luminance2 + 0.05) / (luminance1 + 0.05);\n}\n\n/**\n * Takes in rgba parts and returns an rgba string\n *\n * @param red The amount of red in the red channel, given in a number between 0 and 255 inclusive\n * @param green The amount of green in the red channel, given in a number between 0 and 255 inclusive\n * @param blue The amount of blue in the red channel, given in a number between 0 and 255 inclusive\n * @param alpha Percentage of opacity, given as a decimal between 0 and 1\n */\nfunction rgba(red, green, blue, alpha) {\n return `rgba(${guard(0, 255, red).toFixed()}, ${guard(0, 255, green).toFixed()}, ${guard(0, 255, blue).toFixed()}, ${parseFloat(guard(0, 1, alpha).toFixed(3))})`;\n}\n\n/**\n * Mixes two colors together. Taken from sass's implementation.\n */\nfunction mix(color1, color2, weight) {\n const normalize = (n, index) =>\n // 3rd index is alpha channel which is already normalized\n index === 3 ? n : n / 255;\n const [r1, g1, b1, a1] = parseToRgba(color1).map(normalize);\n const [r2, g2, b2, a2] = parseToRgba(color2).map(normalize);\n\n // The formula is copied from the original Sass implementation:\n // http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method\n const alphaDelta = a2 - a1;\n const normalizedWeight = weight * 2 - 1;\n const combinedWeight = normalizedWeight * alphaDelta === -1 ? normalizedWeight : normalizedWeight + alphaDelta / (1 + normalizedWeight * alphaDelta);\n const weight2 = (combinedWeight + 1) / 2;\n const weight1 = 1 - weight2;\n const r = (r1 * weight1 + r2 * weight2) * 255;\n const g = (g1 * weight1 + g2 * weight2) * 255;\n const b = (b1 * weight1 + b2 * weight2) * 255;\n const a = a2 * weight + a1 * (1 - weight);\n return rgba(r, g, b, a);\n}\n\n/**\n * Given a series colors, this function will return a `scale(x)` function that\n * accepts a percentage as a decimal between 0 and 1 and returns the color at\n * that percentage in the scale.\n *\n * ```js\n * const scale = getScale('red', 'yellow', 'green');\n * console.log(scale(0)); // rgba(255, 0, 0, 1)\n * console.log(scale(0.5)); // rgba(255, 255, 0, 1)\n * console.log(scale(1)); // rgba(0, 128, 0, 1)\n * ```\n *\n * If you'd like to limit the domain and range like chroma-js, we recommend\n * wrapping scale again.\n *\n * ```js\n * const _scale = getScale('red', 'yellow', 'green');\n * const scale = x => _scale(x / 100);\n *\n * console.log(scale(0)); // rgba(255, 0, 0, 1)\n * console.log(scale(50)); // rgba(255, 255, 0, 1)\n * console.log(scale(100)); // rgba(0, 128, 0, 1)\n * ```\n */\nfunction getScale(...colors) {\n return n => {\n const lastIndex = colors.length - 1;\n const lowIndex = guard(0, lastIndex, Math.floor(n * lastIndex));\n const highIndex = guard(0, lastIndex, Math.ceil(n * lastIndex));\n const color1 = colors[lowIndex];\n const color2 = colors[highIndex];\n const unit = 1 / lastIndex;\n const weight = (n - unit * lowIndex) / unit;\n return mix(color1, color2, weight);\n };\n}\n\nconst guidelines = {\n decorative: 1.5,\n readable: 3,\n aa: 4.5,\n aaa: 7\n};\n\n/**\n * Returns whether or not a color has bad contrast against a background\n * according to a given standard.\n */\nfunction hasBadContrast(color, standard = 'aa', background = '#fff') {\n return getContrast(color, background) < guidelines[standard];\n}\n\n/**\n * Lightens a color by a given amount. This is equivalent to\n * `darken(color, -amount)`\n *\n * @param amount The amount to darken, given as a decimal between 0 and 1\n */\nfunction lighten(color, amount) {\n return darken(color, -amount);\n}\n\n/**\n * Takes in a color and makes it more transparent by convert to `rgba` and\n * decreasing the amount in the alpha channel.\n *\n * @param amount The amount to increase the transparency by, given as a decimal between 0 and 1\n */\nfunction transparentize(color, amount) {\n const [r, g, b, a] = parseToRgba(color);\n return rgba(r, g, b, a - amount);\n}\n\n/**\n * Takes a color and un-transparentizes it. Equivalent to\n * `transparentize(color, -amount)`\n *\n * @param amount The amount to increase the opacity by, given as a decimal between 0 and 1\n */\nfunction opacify(color, amount) {\n return transparentize(color, -amount);\n}\n\n/**\n * An alternative function to `readableColor`. Returns whether or not the \n * readable color (i.e. the color to be place on top the input color) should be\n * black.\n */\nfunction readableColorIsBlack(color) {\n return getLuminance(color) > 0.179;\n}\n\n/**\n * Returns black or white for best contrast depending on the luminosity of the\n * given color.\n */\nfunction readableColor(color) {\n return readableColorIsBlack(color) ? '#000' : '#fff';\n}\n\n/**\n * Saturates a color by converting it to `hsl` and increasing the saturation\n * amount. Equivalent to `desaturate(color, -amount)`\n * \n * @param color Input color\n * @param amount The amount to darken, given as a decimal between 0 and 1\n */\nfunction saturate(color, amount) {\n return desaturate(color, -amount);\n}\n\n/**\n * Takes in any color and returns it as a hex code.\n */\nfunction toHex(color) {\n const [r, g, b, a] = parseToRgba(color);\n let hex = x => {\n const h = guard(0, 255, x).toString(16);\n // NOTE: padStart could be used here but it breaks Node 6 compat\n // https://github.com/ricokahler/color2k/issues/351\n return h.length === 1 ? `0${h}` : h;\n };\n return `#${hex(r)}${hex(g)}${hex(b)}${a < 1 ? hex(Math.round(a * 255)) : ''}`;\n}\n\n/**\n * Takes in any color and returns it as an rgba string.\n */\nfunction toRgba(color) {\n return rgba(...parseToRgba(color));\n}\n\n/**\n * Takes in any color and returns it as an hsla string.\n */\nfunction toHsla(color) {\n return hsla(...parseToHsla(color));\n}\n\nexport { ColorError$1 as ColorError, adjustHue, darken, desaturate, getContrast, getLuminance, getScale, guard, hasBadContrast, hsla, lighten, mix, opacify, parseToHsla, parseToRgba, readableColor, readableColorIsBlack, rgba, saturate, toHex, toHsla, toRgba, transparentize };\n//# sourceMappingURL=index.module.es.js.map\n","function n(n,r,t){return{r:255*t(n.r/255,r.r/255),g:255*t(n.g/255,r.g/255),b:255*t(n.b/255,r.b/255)}}function r(n,r){return r}function t(n,r){return n*r}function u(n,r){return n+r-n*r}function i(n,r){return a(r,n)}function o(n,r){return Math.min(n,r)}function e(n,r){return Math.min(Math.max(n,r),1)}function c(n,r){return 0===n?0:1===r?1:Math.min(1,n/(1-r))}function f(n,r){return 1===n?1:0===r?0:1-Math.min(1,(1-n)/r)}function a(n,r){return r<=.5?t(n,2*r):u(n,2*r-1)}function b(n,r){return r<=.5?n-(1-2*r)*n*(1-n):n+(2*r-1)*((n<=.25?((16*n-12)*n+4)*n:Math.sqrt(n))-n)}function g(n,r){return Math.abs(n-r)}function h(n,r){return n+r-2*n*r}function M(n,r,t){return Math.min(Math.max(n||0,r),t)}function m(n){return{r:M(n.r,0,255),g:M(n.g,0,255),b:M(n.b,0,255),a:M(n.a,0,1)}}function d(n){return{r:255*n.r,g:255*n.g,b:255*n.b,a:n.a}}function p(n){return{r:n.r/255,g:n.g/255,b:n.b/255,a:n.a}}function v(n,r){void 0===r&&(r=0);var t=Math.pow(10,r);return{r:Math.round(n.r*t)/t,g:Math.round(n.g*t)/t,b:Math.round(n.b*t)/t,a:n.a}}function x(n,r,t,u,i,o){return(1-r/t)*u+r/t*Math.round((1-n)*i+n*o)}function O(n,r,t,u,i){void 0===i&&(i={unitInput:!1,unitOutput:!1,roundOutput:!0}),i.unitInput&&(n=d(n),r=d(r)),n=m(n);var o=(r=m(r)).a+n.a-r.a*n.a,e=t(n,r,u),c=m({r:x(n.a,r.a,o,n.r,r.r,e.r),g:x(n.a,r.a,o,n.g,r.g,e.g),b:x(n.a,r.a,o,n.b,r.b,e.b),a:o});return c=i.unitOutput?p(c):i.roundOutput?v(c):function(n){return v(n,9)}(c),c}function s(n,r,t){return d(t(p(n),p(r)))}function I(n){return.3*n.r+.59*n.g+.11*n.b}function q(n,r){var t=r-I(n);return function(n){var r=I(n),t=n.r,u=n.g,i=n.b,o=Math.min(t,u,i),e=Math.max(t,u,i);function c(n){return r+(n-r)*r/(r-o)}function f(n){return r+(n-r)*(1-r)/(e-r)}return o<0&&(t=c(t),u=c(u),i=c(i)),e>1&&(t=f(t),u=f(u),i=f(i)),{r:t,g:u,b:i}}({r:n.r+t,g:n.g+t,b:n.b+t})}function w(n){return Math.max(n.r,n.g,n.b)-Math.min(n.r,n.g,n.b)}function j(n,r){var t=[\"r\",\"g\",\"b\"].sort(function(r,t){return n[r]-n[t]}),u=t[0],i=t[1],o=t[2],e={r:n.r,g:n.g,b:n.b};return e[o]>e[u]?(e[i]=(e[i]-e[u])*r/(e[o]-e[u]),e[o]=r):e[i]=e[o]=0,e[u]=0,e}function k(n,r){return q(j(r,w(n)),I(n))}function l(n,r){return q(j(n,w(r)),I(n))}function y(n,r){return q(r,I(n))}function z(n,r){return q(n,I(r))}function A(t,u){return O(t,u,n,r)}function B(r,u){return O(r,u,n,t)}function C(r,t){return O(r,t,n,u)}function D(r,t){return O(r,t,n,i)}function E(r,t){return O(r,t,n,o)}function F(r,t){return O(r,t,n,e)}function G(r,t){return O(r,t,n,c)}function H(r,t){return O(r,t,n,f)}function J(r,t){return O(r,t,n,a)}function K(r,t){return O(r,t,n,b)}function L(r,t){return O(r,t,n,g)}function N(r,t){return O(r,t,n,h)}function P(n,r){return O(n,r,s,k)}function Q(n,r){return O(n,r,s,l)}function R(n,r){return O(n,r,s,y)}function S(n,r){return O(n,r,s,z)}export{R as color,H as colorBurn,G as colorDodge,E as darken,L as difference,N as exclusion,J as hardLight,P as hue,F as lighten,S as luminosity,B as multiply,A as normal,D as overlay,Q as saturation,C as screen,K as softLight};\n//# sourceMappingURL=index.modern.js.map\n","import { parseToRgba, rgba } from 'color2k';\nimport { CustomBorderRadii, CustomPalette } from '../../interface.js';\nimport { overlay } from 'color-blend';\n\nexport const isColor = strColor => {\n const s = new Option().style;\n s.color = strColor;\n return s.color !== '';\n};\n\nconst toKebabCase = (pascal: string) => pascal.replace(/([a-z0–9])([A-Z])/g, '$1-$2').toLowerCase();\n\n// This function handles arrays and objects\nconst buildVars = (prev: string, obj: any): { [k: string]: string } => {\n let resp = {};\n\n for (const k in obj) {\n const name = `${prev}-${toKebabCase(k)}`;\n if (typeof obj[k] === 'object' && obj[k] !== null) {\n resp = { ...resp, ...buildVars(name, obj[k]) };\n } else {\n resp[name] = obj[k];\n }\n }\n\n return resp;\n};\n\nexport const getCssColors = (customPalette: CustomPalette): { [k: string]: string } => buildVars('--cpsl-color', customPalette);\nexport const getCssBorderRadii = (customBorderRadii: CustomBorderRadii): { [k: string]: string } => buildVars('--cpsl-border-radius', customBorderRadii);\n\nexport const overlayMix = (baseColor: string, overlayColor: string) => {\n const baseRGBA = parseToRgba(baseColor);\n const overlayRGBA = parseToRgba(overlayColor);\n\n const finalRGBA = overlay({ r: baseRGBA[0], g: baseRGBA[1], b: baseRGBA[2], a: 0.1 }, { r: overlayRGBA[0], g: overlayRGBA[1], b: overlayRGBA[2], a: overlayRGBA[3] });\n\n return rgba(finalRGBA.r, finalRGBA.g, finalRGBA.b, finalRGBA.a);\n};\n","import { Theme } from '../../interface.js';\nimport { getCssBorderRadii } from './utils.js';\n\nexport const generateBorderRadii = ({ borderRadius, customBorderRadii }: Pick<Theme, 'borderRadius' | 'customBorderRadii'>) => {\n let mediumRadius: number,\n largeRadius: number,\n checkboxRadius: number = 4;\n const fullRadius = 1000;\n let isFull = false;\n let isNone = false;\n\n switch (borderRadius) {\n case 'none': {\n isNone = true;\n mediumRadius = 0;\n largeRadius = 0;\n checkboxRadius = 0;\n break;\n }\n case 'xs': {\n mediumRadius = 2;\n largeRadius = 4;\n checkboxRadius = 2;\n break;\n }\n case 'sm': {\n mediumRadius = 4;\n largeRadius = 8;\n break;\n }\n case 'md': {\n mediumRadius = 8;\n largeRadius = 16;\n break;\n }\n case 'xl': {\n mediumRadius = 16;\n largeRadius = 32;\n break;\n }\n case 'full': {\n mediumRadius = 24;\n largeRadius = 32;\n isFull = true;\n break;\n }\n default:\n case 'lg': {\n mediumRadius = 12;\n largeRadius = 24;\n break;\n }\n }\n\n document.documentElement.style.setProperty('--cpsl-border-radius-input', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-select', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-file', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-alert', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-tabs', `${isNone ? 0 : fullRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-primary-button', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-secondary-button', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-tertiary-button', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-destructive-button', `${isFull ? fullRadius : mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-tile-button', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-qr-code', `${largeRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-info-box', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-table-container', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-avatar', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-button-group', `${mediumRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-card', `${largeRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-modal', `${largeRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-checkbox', `${checkboxRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-switch', `${isNone ? 0 : fullRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-pill', `${isNone ? 0 : fullRadius}px`);\n document.documentElement.style.setProperty('--cpsl-border-radius-radio', `${fullRadius}px`);\n\n if (customBorderRadii) {\n const cssBorderRadiiVars = getCssBorderRadii(customBorderRadii);\n Object.entries(cssBorderRadiiVars).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));\n }\n};\n","import { Theme } from '../../interface.js';\n\nconst FONT_NAME_MAP = {\n body2XS: 'body-2xs',\n bodyXS: 'body-xs',\n bodyS: 'body-s',\n bodyM: 'body-m',\n bodyL: 'body-l',\n bodyXL: 'body-xl',\n headingXS: 'heading-xs',\n headingS: 'heading-s',\n headingM: 'heading-m',\n headingL: 'heading-l',\n headingXL: 'heading-xl',\n heading2XL: 'heading-2xl',\n};\n\nexport const generateFont = ({ font, customFontSizes }: Pick<Theme, 'font' | 'customFontSizes'>) => {\n if (font) {\n document.documentElement.style.setProperty('--cpsl-default-font', font);\n }\n\n Object.entries(FONT_NAME_MAP).forEach(([key, value]) => {\n if (customFontSizes?.[key]) {\n document.documentElement.style.setProperty(`--cpsl-font-size-${value}`, customFontSizes[key]);\n } else {\n document.documentElement.style.removeProperty(`--cpsl-font-size-${value}`);\n }\n });\n};\n","import { mix, readableColorIsBlack } from 'color2k';\nimport { Theme } from '../../interface.js';\nimport { getCssColors, isColor, overlayMix } from './utils.js';\nimport { COLOR_MIXES, DEFAULT_THEME, UTILITY_COLORS } from '../../constants.js';\n\nexport type Palette = {\n foregroundColors: string[];\n backgroundColors: string[];\n accentColors: string[];\n};\n\nexport const generatePalette = ({\n foregroundColor,\n backgroundColor,\n accentColor,\n isDarkTheme,\n customPalette,\n}: Pick<Theme, 'foregroundColor' | 'backgroundColor' | 'accentColor' | 'customPalette'> & { isDarkTheme: boolean }) => {\n if (!foregroundColor || !isColor(foregroundColor)) {\n foregroundColor = DEFAULT_THEME.foregroundColor;\n }\n if (!backgroundColor || !isColor(backgroundColor)) {\n backgroundColor = DEFAULT_THEME.backgroundColor;\n }\n if (!Boolean(accentColor) || !isColor(accentColor)) {\n accentColor = foregroundColor;\n }\n\n const isDarkAccent = Boolean(accentColor) ? !readableColorIsBlack(accentColor) : false;\n\n const palette: Palette = {\n foregroundColors: [],\n backgroundColors: [],\n accentColors: [],\n };\n\n const backgroundMixColor = isDarkTheme ? '#FFFFFF' : '#000000';\n const foregroundMixColor = isDarkTheme ? '#000000' : '#FFFFFF';\n const accentMixColor = isDarkAccent ? '#FFFFFF' : '#000000';\n\n COLOR_MIXES.forEach(value => {\n palette.foregroundColors.push(mix(foregroundColor, foregroundMixColor, value));\n palette.backgroundColors.push(mix(backgroundColor, backgroundMixColor, value));\n palette.accentColors.push(mix(accentColor, accentMixColor, value));\n });\n\n // BACKGROUND\n document.documentElement.style.setProperty('--cpsl-color-background-0', palette.backgroundColors[0]);\n document.documentElement.style.setProperty('--cpsl-color-background-4', palette.backgroundColors[1]);\n document.documentElement.style.setProperty('--cpsl-color-background-8', palette.backgroundColors[2]);\n document.documentElement.style.setProperty('--cpsl-color-background-16', palette.backgroundColors[3]);\n document.documentElement.style.setProperty('--cpsl-color-background-32', palette.backgroundColors[4]);\n document.documentElement.style.setProperty('--cpsl-color-background-48', palette.backgroundColors[5]);\n document.documentElement.style.setProperty('--cpsl-color-background-64', palette.backgroundColors[6]);\n document.documentElement.style.setProperty('--cpsl-color-background-80', palette.backgroundColors[7]);\n document.documentElement.style.setProperty('--cpsl-color-background-96', palette.backgroundColors[8]);\n\n // FOREGROUND\n document.documentElement.style.setProperty('--cpsl-color-foreground-0', palette.foregroundColors[0]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-4', palette.foregroundColors[1]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-8', palette.foregroundColors[2]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-16', palette.foregroundColors[3]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-32', palette.foregroundColors[4]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-48', palette.foregroundColors[5]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-64', palette.foregroundColors[6]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-80', palette.foregroundColors[7]);\n document.documentElement.style.setProperty('--cpsl-color-foreground-96', palette.foregroundColors[8]);\n\n // ACCENT\n document.documentElement.style.setProperty('--cpsl-color-accent-0', palette.accentColors[0]);\n document.documentElement.style.setProperty('--cpsl-color-accent-4', palette.accentColors[1]);\n document.documentElement.style.setProperty('--cpsl-color-accent-8', palette.accentColors[2]);\n document.documentElement.style.setProperty('--cpsl-color-accent-16', palette.accentColors[3]);\n document.documentElement.style.setProperty('--cpsl-color-accent-32', palette.accentColors[4]);\n document.documentElement.style.setProperty('--cpsl-color-accent-48', palette.accentColors[5]);\n document.documentElement.style.setProperty('--cpsl-color-accent-64', palette.accentColors[6]);\n document.documentElement.style.setProperty('--cpsl-color-accent-80', palette.accentColors[7]);\n document.documentElement.style.setProperty('--cpsl-color-accent-96', palette.accentColors[8]);\n\n // CONTRAST\n document.documentElement.style.setProperty('--cpsl-color-contrast', isDarkTheme ? '#FFFFFF' : '#000000');\n\n const utilityLightMixColor = '#FFFFFF';\n const utilityLightMixValue = 0.72;\n // UTILITY\n const red = overlayMix(foregroundColor, UTILITY_COLORS.red);\n const yellow = overlayMix(foregroundColor, UTILITY_COLORS.yellow);\n const green = overlayMix(foregroundColor, UTILITY_COLORS.green);\n document.documentElement.style.setProperty('--cpsl-color-utility-red', red);\n document.documentElement.style.setProperty('--cpsl-color-utility-yellow', yellow);\n document.documentElement.style.setProperty('--cpsl-color-utility-green', green);\n document.documentElement.style.setProperty('--cpsl-color-utility-red-light', mix(red, utilityLightMixColor, utilityLightMixValue));\n document.documentElement.style.setProperty('--cpsl-color-utility-yellow-light', mix(yellow, utilityLightMixColor, utilityLightMixValue));\n document.documentElement.style.setProperty('--cpsl-color-utility-green-light', mix(green, utilityLightMixColor, utilityLightMixValue));\n\n if (customPalette) {\n const cssColorVars = getCssColors(customPalette);\n Object.entries(cssColorVars).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));\n }\n};\n","import { DEFAULT_THEME } from '../../constants.js';\nimport { Theme } from '../../interface.js';\nimport { generateBorderRadii } from './generateBorderRadii.js';\nimport { generateFont } from './generateFont.js';\nimport { generatePalette } from './generatePalette.js';\n\n/**\n * Generates css theme variables.\n * @returns @boolean Whether background is dark or not.\n */\nexport const generateTheme = ({\n foregroundColor = DEFAULT_THEME.foregroundColor,\n backgroundColor = DEFAULT_THEME.backgroundColor,\n accentColor,\n darkForegroundColor,\n darkBackgroundColor,\n darkAccentColor,\n mode = 'light',\n font,\n customPalette,\n borderRadius,\n customFontSizes,\n customBorderRadii,\n}: Theme) => {\n const isDarkTheme = mode === 'dark';\n\n generatePalette({\n foregroundColor: isDarkTheme ? (darkForegroundColor ?? foregroundColor) : foregroundColor,\n backgroundColor: isDarkTheme ? (darkBackgroundColor ?? backgroundColor) : backgroundColor,\n accentColor: isDarkTheme ? (darkAccentColor ?? accentColor) : accentColor,\n customPalette,\n isDarkTheme,\n });\n\n generateFont({ font, customFontSizes });\n\n generateBorderRadii({ borderRadius, customBorderRadii });\n};\n"],"mappings":"8GAOA,SAASA,EAAMC,EAAKC,EAAMC,GACxB,OAAOC,KAAKC,IAAID,KAAKE,IAAIL,EAAKE,GAAQD,EACxC,CAEA,MAAMK,UAAmBC,MACvB,WAAAC,CAAYC,GACVC,MAAM,2BAA2BD,KACrC,EAEA,IAAIE,EAAeL,EAOnB,SAASM,EAAYH,GACnB,UAAWA,IAAU,SAAU,MAAM,IAAIE,EAAaF,GACtD,GAAIA,EAAMI,OAAOC,gBAAkB,cAAe,MAAO,CAAC,EAAG,EAAG,EAAG,GACnE,IAAIC,EAAkBN,EAAMI,OAC5BE,EAAkBC,EAAgBC,KAAKR,GAASS,EAAUT,GAASA,EACnE,MAAMU,EAAkBC,EAAgBC,KAAKN,GAC7C,GAAII,EAAiB,CACnB,MAAMG,EAAMC,MAAMC,KAAKL,GAAiBM,MAAM,GAC9C,MAAO,IAAIH,EAAIG,MAAM,EAAG,GAAGC,KAAIC,GAAKC,SAASC,EAAEF,EAAG,GAAI,MAAMC,SAASC,EAAEP,EAAI,IAAM,IAAK,GAAI,IAAM,IACpG,CACE,MAAMQ,EAAWC,EAASV,KAAKN,GAC/B,GAAIe,EAAU,CACZ,MAAMR,EAAMC,MAAMC,KAAKM,GAAUL,MAAM,GACvC,MAAO,IAAIH,EAAIG,MAAM,EAAG,GAAGC,KAAIC,GAAKC,SAASD,EAAG,MAAMC,SAASN,EAAI,IAAM,KAAM,IAAM,IACzF,CACE,MAAMU,EAAYC,EAAUZ,KAAKN,GACjC,GAAIiB,EAAW,CACb,MAAMV,EAAMC,MAAMC,KA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AAuBtB,EAAmBA,EAC1EC,gBAAiBE,EAAeoB,IAAmB,MAAnBA,SAAmB,EAAnBA,EAAuBtB,EAAmBA,EAC1EC,YAAaC,EAAeqB,IAAe,MAAfA,SAAe,EAAfA,EAAmBtB,EAAeA,EAC9D5C,gBACA6C,gBAGFR,EAAa,CAAEC,OAAMC,oBAErB7B,EAAoB,CAAEC,eAAcT,qBAAoB,S","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as d,f as i,h as n,H as p}from"./p-fa6b7678.js";const a={xs:"(min-width: 0px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)"};const l=d=>{if(d===undefined||d===""){return true}if(window.matchMedia){const i=a[d];return window.matchMedia(i).matches}return false};const r=":host{-webkit-padding-start:var(--cpsl-grid-column-padding-xs, var(--cpsl-grid-column-padding, 0px));padding-inline-start:var(--cpsl-grid-column-padding-xs, var(--cpsl-grid-column-padding, 0px));-webkit-padding-end:var(--cpsl-grid-column-padding-xs, var(--cpsl-grid-column-padding, 0px));padding-inline-end:var(--cpsl-grid-column-padding-xs, var(--cpsl-grid-column-padding, 0px));padding-top:var(--cpsl-grid-column-padding-xs, var(--cpsl-grid-column-padding, 0px));padding-bottom:var(--cpsl-grid-column-padding-xs, var(--cpsl-grid-column-padding, 0px));margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;box-sizing:border-box;position:relative;flex-basis:0;flex-grow:1;width:100%;max-width:100%;min-height:1px}@media (min-width: 576px){:host{-webkit-padding-start:var(--cpsl-grid-column-padding-sm, var(--cpsl-grid-column-padding, 0px));padding-inline-start:var(--cpsl-grid-column-padding-sm, var(--cpsl-grid-column-padding, 0px));-webkit-padding-end:var(--cpsl-grid-column-padding-sm, var(--cpsl-grid-column-padding, 0px));padding-inline-end:var(--cpsl-grid-column-padding-sm, var(--cpsl-grid-column-padding, 0px));padding-top:var(--cpsl-grid-column-padding-sm, var(--cpsl-grid-column-padding, 0px));padding-bottom:var(--cpsl-grid-column-padding-sm, var(--cpsl-grid-column-padding, 0px))}}@media (min-width: 768px){:host{-webkit-padding-start:var(--cpsl-grid-column-padding-md, var(--cpsl-grid-column-padding, 0px));padding-inline-start:var(--cpsl-grid-column-padding-md, var(--cpsl-grid-column-padding, 0px));-webkit-padding-end:var(--cpsl-grid-column-padding-md, var(--cpsl-grid-column-padding, 0px));padding-inline-end:var(--cpsl-grid-column-padding-md, var(--cpsl-grid-column-padding, 0px));padding-top:var(--cpsl-grid-column-padding-md, var(--cpsl-grid-column-padding, 0px));padding-bottom:var(--cpsl-grid-column-padding-md, var(--cpsl-grid-column-padding, 0px))}}@media (min-width: 992px){:host{-webkit-padding-start:var(--cpsl-grid-column-padding-lg, var(--cpsl-grid-column-padding, 0px));padding-inline-start:var(--cpsl-grid-column-padding-lg, var(--cpsl-grid-column-padding, 0px));-webkit-padding-end:var(--cpsl-grid-column-padding-lg, var(--cpsl-grid-column-padding, 0px));padding-inline-end:var(--cpsl-grid-column-padding-lg, var(--cpsl-grid-column-padding, 0px));padding-top:var(--cpsl-grid-column-padding-lg, var(--cpsl-grid-column-padding, 0px));padding-bottom:var(--cpsl-grid-column-padding-lg, var(--cpsl-grid-column-padding, 0px))}}@media (min-width: 1200px){:host{-webkit-padding-start:var(--cpsl-grid-column-padding-xl, var(--cpsl-grid-column-padding, 0px));padding-inline-start:var(--cpsl-grid-column-padding-xl, var(--cpsl-grid-column-padding, 0px));-webkit-padding-end:var(--cpsl-grid-column-padding-xl, var(--cpsl-grid-column-padding, 0px));padding-inline-end:var(--cpsl-grid-column-padding-xl, var(--cpsl-grid-column-padding, 0px));padding-top:var(--cpsl-grid-column-padding-xl, var(--cpsl-grid-column-padding, 0px));padding-bottom:var(--cpsl-grid-column-padding-xl, var(--cpsl-grid-column-padding, 0px))}}";const g=r;const c=typeof window!=="undefined"?window:undefined;const s=c&&!!(c.CSS&&c.CSS.supports&&c.CSS.supports("--a: 0"));const t=["","xs","sm","md","lg","xl"];const e=class{constructor(i){d(this,i);this.offset=undefined;this.offsetXs=undefined;this.offsetSm=undefined;this.offsetMd=undefined;this.offsetLg=undefined;this.offsetXl=undefined;this.pull=undefined;this.pullXs=undefined;this.pullSm=undefined;this.pullMd=undefined;this.pullLg=undefined;this.pullXl=undefined;this.push=undefined;this.pushXs=undefined;this.pushSm=undefined;this.pushMd=undefined;this.pushLg=undefined;this.pushXl=undefined;this.size=undefined;this.sizeXs=undefined;this.sizeSm=undefined;this.sizeMd=undefined;this.sizeLg=undefined;this.sizeXl=undefined}onResize(){i(this)}getColumns(d){let i;for(const n of t){const p=l(n);const a=this[d+n.charAt(0).toUpperCase()+n.slice(1)];if(p&&a!==undefined){i=a}}return i}calculateSize(){const d=this.getColumns("size");if(!d||d===""){return}const i=d==="auto"?"auto":s?`calc(calc(${d} / var(--ion-grid-columns, 12)) * 100%)`:d/12*100+"%";return{flex:`0 0 ${i}`,width:`${i}`,"max-width":`${i}`}}calculatePosition(d,i){const n=this.getColumns(d);if(!n){return}const p=s?`calc(calc(${n} / var(--ion-grid-columns, 12)) * 100%)`:n>0&&n<12?n/12*100+"%":"auto";return{[i]:p}}calculateOffset(d){return this.calculatePosition("offset",d?"margin-right":"margin-left")}calculatePull(d){return this.calculatePosition("pull",d?"left":"right")}calculatePush(d){return this.calculatePosition("push",d?"right":"left")}render(){const d=document.dir==="rtl";return n(p,{key:"febc737118ea526e5c53e8e59479a245ec1b5dd1",style:Object.assign(Object.assign(Object.assign(Object.assign({},this.calculateOffset(d)),this.calculatePull(d)),this.calculatePush(d)),this.calculateSize())},n("slot",{key:"88e01f9f4ed95eedbfd0620398792d9d5d58633d"}))}};e.style=g;export{e as cpsl_col};
2
- //# sourceMappingURL=p-41bc3c58.entry.js.map
1
+ import{r as d,f as i,h as n,H as a}from"./p-fa6b7678.js";const p={xs:"(min-width: 0px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)"};const l=d=>{if(d===undefined||d===""){return true}if(window.matchMedia){const i=p[d];return window.matchMedia(i).matches}return false};const r=":host{-webkit-padding-start:var(--cpsl-grid-column-padding-xs, var(--cpsl-grid-column-padding, 0px));padding-inline-start:var(--cpsl-grid-column-padding-xs, var(--cpsl-grid-column-padding, 0px));-webkit-padding-end:var(--cpsl-grid-column-padding-xs, var(--cpsl-grid-column-padding, 0px));padding-inline-end:var(--cpsl-grid-column-padding-xs, var(--cpsl-grid-column-padding, 0px));padding-top:var(--cpsl-grid-column-padding-xs, var(--cpsl-grid-column-padding, 0px));padding-bottom:var(--cpsl-grid-column-padding-xs, var(--cpsl-grid-column-padding, 0px));margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;box-sizing:border-box;position:relative;flex-basis:0;flex-grow:1;width:100%;max-width:100%;min-height:1px}@media (min-width: 576px){:host{-webkit-padding-start:var(--cpsl-grid-column-padding-sm, var(--cpsl-grid-column-padding, 0px));padding-inline-start:var(--cpsl-grid-column-padding-sm, var(--cpsl-grid-column-padding, 0px));-webkit-padding-end:var(--cpsl-grid-column-padding-sm, var(--cpsl-grid-column-padding, 0px));padding-inline-end:var(--cpsl-grid-column-padding-sm, var(--cpsl-grid-column-padding, 0px));padding-top:var(--cpsl-grid-column-padding-sm, var(--cpsl-grid-column-padding, 0px));padding-bottom:var(--cpsl-grid-column-padding-sm, var(--cpsl-grid-column-padding, 0px))}}@media (min-width: 768px){:host{-webkit-padding-start:var(--cpsl-grid-column-padding-md, var(--cpsl-grid-column-padding, 0px));padding-inline-start:var(--cpsl-grid-column-padding-md, var(--cpsl-grid-column-padding, 0px));-webkit-padding-end:var(--cpsl-grid-column-padding-md, var(--cpsl-grid-column-padding, 0px));padding-inline-end:var(--cpsl-grid-column-padding-md, var(--cpsl-grid-column-padding, 0px));padding-top:var(--cpsl-grid-column-padding-md, var(--cpsl-grid-column-padding, 0px));padding-bottom:var(--cpsl-grid-column-padding-md, var(--cpsl-grid-column-padding, 0px))}}@media (min-width: 992px){:host{-webkit-padding-start:var(--cpsl-grid-column-padding-lg, var(--cpsl-grid-column-padding, 0px));padding-inline-start:var(--cpsl-grid-column-padding-lg, var(--cpsl-grid-column-padding, 0px));-webkit-padding-end:var(--cpsl-grid-column-padding-lg, var(--cpsl-grid-column-padding, 0px));padding-inline-end:var(--cpsl-grid-column-padding-lg, var(--cpsl-grid-column-padding, 0px));padding-top:var(--cpsl-grid-column-padding-lg, var(--cpsl-grid-column-padding, 0px));padding-bottom:var(--cpsl-grid-column-padding-lg, var(--cpsl-grid-column-padding, 0px))}}@media (min-width: 1200px){:host{-webkit-padding-start:var(--cpsl-grid-column-padding-xl, var(--cpsl-grid-column-padding, 0px));padding-inline-start:var(--cpsl-grid-column-padding-xl, var(--cpsl-grid-column-padding, 0px));-webkit-padding-end:var(--cpsl-grid-column-padding-xl, var(--cpsl-grid-column-padding, 0px));padding-inline-end:var(--cpsl-grid-column-padding-xl, var(--cpsl-grid-column-padding, 0px));padding-top:var(--cpsl-grid-column-padding-xl, var(--cpsl-grid-column-padding, 0px));padding-bottom:var(--cpsl-grid-column-padding-xl, var(--cpsl-grid-column-padding, 0px))}}";const c=r;const g=typeof window!=="undefined"?window:undefined;const s=g&&!!(g.CSS&&g.CSS.supports&&g.CSS.supports("--a: 0"));const t=["","xs","sm","md","lg","xl"];const e=class{constructor(i){d(this,i);this.offset=undefined;this.offsetXs=undefined;this.offsetSm=undefined;this.offsetMd=undefined;this.offsetLg=undefined;this.offsetXl=undefined;this.pull=undefined;this.pullXs=undefined;this.pullSm=undefined;this.pullMd=undefined;this.pullLg=undefined;this.pullXl=undefined;this.push=undefined;this.pushXs=undefined;this.pushSm=undefined;this.pushMd=undefined;this.pushLg=undefined;this.pushXl=undefined;this.size=undefined;this.sizeXs=undefined;this.sizeSm=undefined;this.sizeMd=undefined;this.sizeLg=undefined;this.sizeXl=undefined}onResize(){i(this)}getColumns(d){let i;for(const n of t){const a=l(n);const p=this[d+n.charAt(0).toUpperCase()+n.slice(1)];if(a&&p!==undefined){i=p}}return i}calculateSize(){const d=this.getColumns("size");if(!d||d===""){return}const i=d==="auto"?"auto":s?`calc(calc(${d} / var(--ion-grid-columns, 12)) * 100%)`:d/12*100+"%";return{flex:`0 0 ${i}`,width:`${i}`,"max-width":`${i}`}}calculatePosition(d,i){const n=this.getColumns(d);if(!n){return}const a=s?`calc(calc(${n} / var(--ion-grid-columns, 12)) * 100%)`:n>0&&n<12?n/12*100+"%":"auto";return{[i]:a}}calculateOffset(d){return this.calculatePosition("offset",d?"margin-right":"margin-left")}calculatePull(d){return this.calculatePosition("pull",d?"left":"right")}calculatePush(d){return this.calculatePosition("push",d?"right":"left")}render(){const d=document.dir==="rtl";return n(a,{key:"c9d2d0d4c021bc38e672ef6a8db36b1f50f53e2c",style:Object.assign(Object.assign(Object.assign(Object.assign({},this.calculateOffset(d)),this.calculatePull(d)),this.calculatePush(d)),this.calculateSize())},n("slot",{key:"a9f61e679573d1ec7cf26ac9837b0fabf9f885eb"}))}};e.style=c;export{e as cpsl_col};
2
+ //# sourceMappingURL=p-0a4c8cdc.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SIZE_TO_MEDIA","xs","sm","md","lg","xl","matchBreakpoint","breakpoint","undefined","window","matchMedia","mediaQuery","matches","cpslColCss","CpslColStyle0","win","SUPPORTS_VARS","CSS","supports","BREAKPOINTS","CpslCol","onResize","forceUpdate","this","getColumns","property","matched","columns","charAt","toUpperCase","slice","calculateSize","colSize","flex","width","calculatePosition","modifier","amount","calculateOffset","isRTL","calculatePull","calculatePush","render","document","dir","h","Host","key","style","Object","assign"],"sources":["src/utils/media.ts","src/components/cpsl-col/cpsl-col.scss?tag=cpsl-col&encapsulation=shadow","src/components/cpsl-col/cpsl-col.tsx"],"sourcesContent":["export const SIZE_TO_MEDIA: any = {\n xs: '(min-width: 0px)',\n sm: '(min-width: 576px)',\n md: '(min-width: 768px)',\n lg: '(min-width: 992px)',\n xl: '(min-width: 1200px)',\n};\n\n// Check if the window matches the media query\n// at the breakpoint passed\n// e.g. matchBreakpoint('sm') => true if screen width exceeds 576px\nexport const matchBreakpoint = (breakpoint: string | undefined) => {\n if (breakpoint === undefined || breakpoint === '') {\n return true;\n }\n if ((window as any).matchMedia) {\n const mediaQuery = SIZE_TO_MEDIA[breakpoint];\n return window.matchMedia(mediaQuery).matches;\n }\n return false;\n};\n","@import './cpsl-col.vars';\n\n// Column\n// --------------------------------------------------\n\n:host {\n /**\n * @prop --cpsl-grid-columns: The number of total Columns in the Grid\n * @prop --cpsl-grid-column-padding: Padding for the Column\n * @prop --cpsl-grid-column-padding-xs: Padding for the Column on xs screens and up\n * @prop --cpsl-grid-column-padding-sm: Padding for the Column on sm screens and up\n * @prop --cpsl-grid-column-padding-md: Padding for the Column on md screens and up\n * @prop --cpsl-grid-column-padding-lg: Padding for the Column on lg screens and up\n * @prop --cpsl-grid-column-padding-xl: Padding for the Column on xl screens and up\n */\n @include make-breakpoint-padding($grid-column-paddings);\n @include margin(0);\n\n box-sizing: border-box;\n\n position: relative;\n\n flex-basis: 0;\n flex-grow: 1;\n\n width: 100%;\n max-width: 100%;\n min-height: 1px; // Prevent columns from collapsing when empty\n}\n","import { Component, Host, Listen, Prop, forceUpdate, h } from '@stencil/core';\nimport { matchBreakpoint } from '../../utils/media.js';\n\nconst win = typeof (window as any) !== 'undefined' ? (window as any) : undefined;\nconst SUPPORTS_VARS = win && !!(win.CSS && win.CSS.supports && win.CSS.supports('--a: 0'));\nconst BREAKPOINTS = ['', 'xs', 'sm', 'md', 'lg', 'xl'];\n\n@Component({\n tag: 'cpsl-col',\n styleUrl: 'cpsl-col.scss',\n shadow: true,\n})\nexport class CpslCol {\n /**\n * The amount to offset the column, in terms of how many columns it should shift to the end\n * of the total available.\n */\n @Prop() offset?: string;\n\n /**\n * The amount to offset the column for xs screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() offsetXs?: string;\n\n /**\n * The amount to offset the column for sm screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() offsetSm?: string;\n\n /**\n * The amount to offset the column for md screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() offsetMd?: string;\n\n /**\n * The amount to offset the column for lg screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() offsetLg?: string;\n\n /**\n * The amount to offset the column for xl screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() offsetXl?: string;\n\n /**\n * The amount to pull the column, in terms of how many columns it should shift to the start of\n * the total available.\n */\n @Prop() pull?: string;\n\n /**\n * The amount to pull the column for xs screens, in terms of how many columns it should shift\n * to the start of the total available.\n */\n @Prop() pullXs?: string;\n /**\n * The amount to pull the column for sm screens, in terms of how many columns it should shift\n * to the start of the total available.\n */\n @Prop() pullSm?: string;\n /**\n * The amount to pull the column for md screens, in terms of how many columns it should shift\n * to the start of the total available.\n */\n @Prop() pullMd?: string;\n /**\n * The amount to pull the column for lg screens, in terms of how many columns it should shift\n * to the start of the total available.\n */\n @Prop() pullLg?: string;\n /**\n * The amount to pull the column for xl screens, in terms of how many columns it should shift\n * to the start of the total available.\n */\n @Prop() pullXl?: string;\n\n /**\n * The amount to push the column, in terms of how many columns it should shift to the end\n * of the total available.\n */\n @Prop() push?: string;\n\n /**\n * The amount to push the column for xs screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() pushXs?: string;\n\n /**\n * The amount to push the column for sm screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() pushSm?: string;\n\n /**\n * The amount to push the column for md screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() pushMd?: string;\n\n /**\n * The amount to push the column for lg screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() pushLg?: string;\n\n /**\n * The amount to push the column for xl screens, in terms of how many columns it should shift\n * to the end of the total available.\n */\n @Prop() pushXl?: string;\n\n /**\n * The size of the column, in terms of how many columns it should take up out of the total\n * available. If `\"auto\"` is passed, the column will be the size of its content.\n */\n @Prop() size?: string;\n\n /**\n * The size of the column for xs screens, in terms of how many columns it should take up out\n * of the total available. If `\"auto\"` is passed, the column will be the size of its content.\n */\n @Prop() sizeXs?: string;\n\n /**\n * The size of the column for sm screens, in terms of how many columns it should take up out\n * of the total available. If `\"auto\"` is passed, the column will be the size of its content.\n */\n @Prop() sizeSm?: string;\n\n /**\n * The size of the column for md screens, in terms of how many columns it should take up out\n * of the total available. If `\"auto\"` is passed, the column will be the size of its content.\n */\n @Prop() sizeMd?: string;\n\n /**\n * The size of the column for lg screens, in terms of how many columns it should take up out\n * of the total available. If `\"auto\"` is passed, the column will be the size of its content.\n */\n @Prop() sizeLg?: string;\n\n /**\n * The size of the column for xl screens, in terms of how many columns it should take up out\n * of the total available. If `\"auto\"` is passed, the column will be the size of its content.\n */\n @Prop() sizeXl?: string;\n\n @Listen('resize', { target: 'window' })\n onResize() {\n forceUpdate(this);\n }\n\n // Loop through all of the breakpoints to see if the media query\n // matches and grab the column value from the relevant prop if so\n private getColumns(property: string) {\n let matched;\n\n for (const breakpoint of BREAKPOINTS) {\n const matches = matchBreakpoint(breakpoint);\n\n // Grab the value of the property, if it exists and our\n // media query matches we return the value\n const columns = (this as any)[property + breakpoint.charAt(0).toUpperCase() + breakpoint.slice(1)];\n\n if (matches && columns !== undefined) {\n matched = columns;\n }\n }\n\n // Return the last matched columns since the breakpoints\n // increase in size and we want to return the largest match\n return matched;\n }\n\n private calculateSize() {\n const columns = this.getColumns('size');\n\n // If size wasn't set for any breakpoint\n // or if the user set the size without a value\n // it means we need to stick with the default and return\n // e.g. <ion-col size-md>\n if (!columns || columns === '') {\n return;\n }\n\n // If the size is set to auto then don't calculate a size\n const colSize =\n columns === 'auto'\n ? 'auto'\n : // If CSS supports variables we should use the grid columns var\n SUPPORTS_VARS\n ? `calc(calc(${columns} / var(--ion-grid-columns, 12)) * 100%)`\n : // Convert the columns to a percentage by dividing by the total number\n // of columns (12) and then multiplying by 100\n (columns / 12) * 100 + '%';\n\n return {\n 'flex': `0 0 ${colSize}`,\n 'width': `${colSize}`,\n 'max-width': `${colSize}`,\n };\n }\n\n // Called by push, pull, and offset since they use the same calculations\n private calculatePosition(property: string, modifier: string) {\n const columns = this.getColumns(property);\n\n if (!columns) {\n return;\n }\n\n // If the number of columns passed are greater than 0 and less than\n // 12 we can position the column, else default to auto\n const amount = SUPPORTS_VARS\n ? // If CSS supports variables we should use the grid columns var\n `calc(calc(${columns} / var(--ion-grid-columns, 12)) * 100%)`\n : // Convert the columns to a percentage by dividing by the total number\n // of columns (12) and then multiplying by 100\n columns > 0 && columns < 12\n ? (columns / 12) * 100 + '%'\n : 'auto';\n\n return {\n [modifier]: amount,\n };\n }\n\n private calculateOffset(isRTL: boolean) {\n return this.calculatePosition('offset', isRTL ? 'margin-right' : 'margin-left');\n }\n\n private calculatePull(isRTL: boolean) {\n return this.calculatePosition('pull', isRTL ? 'left' : 'right');\n }\n\n private calculatePush(isRTL: boolean) {\n return this.calculatePosition('push', isRTL ? 'right' : 'left');\n }\n\n render() {\n const isRTL = document.dir === 'rtl';\n return (\n <Host\n style={{\n ...this.calculateOffset(isRTL),\n ...this.calculatePull(isRTL),\n ...this.calculatePush(isRTL),\n ...this.calculateSize(),\n }}\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":"yDAAO,MAAMA,EAAqB,CAChCC,GAAI,mBACJC,GAAI,qBACJC,GAAI,qBACJC,GAAI,qBACJC,GAAI,uBAMC,MAAMC,EAAmBC,IAC9B,GAAIA,IAAeC,WAAaD,IAAe,GAAI,CACjD,OAAO,I,CAET,GAAKE,OAAeC,WAAY,CAC9B,MAAMC,EAAaX,EAAcO,GACjC,OAAOE,OAAOC,WAAWC,GAAYC,O,CAEvC,OAAO,KAAK,ECnBd,MAAMC,EAAa,i+FACnB,MAAAC,EAAeD,ECEf,MAAME,SAAcN,SAAmB,YAAeA,OAAiBD,UACvE,MAAMQ,EAAgBD,MAAUA,EAAIE,KAAOF,EAAIE,IAAIC,UAAYH,EAAIE,IAAIC,SAAS,WAChF,MAAMC,EAAc,CAA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AcD,IACnBhB,KAAKkB,cAAcF,IACnBhB,KAAKQ,kBAGVc,EAAA,QAAAE,IAAA,6C","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as t,h as o,H as e}from"./p-fa6b7678.js";import{C as r,P as n}from"./p-286db996.js";const i=":host{--identicon-background-red:linear-gradient(136deg, #ff4270 6.86%, #ff7c7c 93.78%);--identicon-background-orange:linear-gradient(136deg, #f45532 6.86%, #ff9b63 93.78%);--identicon-background-yellow:linear-gradient(136deg, #ffa756 6.86%, #fbff47 93.78%);--identicon-background-green:linear-gradient(136deg, #0cae60 6.86%, #7bffd0 93.78%);--identicon-background-blue:linear-gradient(136deg, #476fff 6.86%, #47c8ff 93.78%);--identicon-background-purple:linear-gradient(136deg, #9747ff 6.86%, #da47ff 93.78%);--identicon-background-empty:linear-gradient(136deg, #aaaaaa 6.86%, #999999 93.78%);display:block;aspect-ratio:1;border-radius:25%;position:relative;border:1px solid var(--cpsl-color-background-8)}:host>svg{fill:rgba(255, 255, 255, 0.6);position:absolute;width:30%}:host>svg.rotate90{transform:rotate(0.25turn)}:host>svg.rotate180{transform:rotate(0.5turn)}:host>svg.rotate270{transform:rotate(0.75turn)}:host>svg:nth-child(1){right:50%;bottom:50%}:host>svg:nth-child(2){left:50%;bottom:50%}:host>svg:nth-child(3){right:50%;top:50%}:host>svg:nth-child(4){left:50%;top:50%}:host(.red){background:var(--identicon-background-red)}:host(.orange){background:var(--identicon-background-orange)}:host(.green){background:var(--identicon-background-green)}:host(.yellow){background:var(--identicon-background-yellow)}:host(.blue){background:var(--identicon-background-blue)}:host(.purple){background:var(--identicon-background-purple)}:host(.empty){background:var(--identicon-background-empty)}:host(.avatar){border-radius:1000px}";const d=i;const a=t=>o("svg",{class:{rotate90:t===1,rotate180:t===2,rotate270:t===3},viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg"},o("g",{"clip-path":"url(#clip0_674_66)"},o("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z"})),o("defs",null,o("clipPath",{id:"clip0_674_66"},o("rect",{width:"12",height:"12"}))));const l=t=>o("svg",{class:{rotate90:t===1,rotate180:t===2,rotate270:t===3},viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg"},o("g",{"clip-path":"url(#clip0_674_255)"},o("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z"}),o("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 18C15.3137 18 18 15.3137 18 12C18 8.68629 15.3137 6 12 6C8.68629 6 6 8.68629 6 12C6 15.3137 8.68629 18 12 18ZM12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z"})),o("defs",null,o("clipPath",{id:"clip0_674_255"},o("rect",{width:"12",height:"12"}))));const s=[[[0,0,0,0],[0,1,3,2]],[[1,1,0,0],[0,1,3,2]],[[0,1,0,1],[0,1,3,2]],[[0,0,1,1],[0,1,3,2]],[[1,0,1,0],[0,1,3,2]],[[1,1,1,1],[0,1,3,2]],[[0,0,0,0],[2,3,1,0]],[[1,1,1,1],[2,3,1,0]],[[1,1,1,1],[0,1,2,3]]];const c=class{constructor(o){t(this,o);this.hash=undefined;this.size="40px";this.variant="default"}render(){let t;const r=!this.hash;if(!r)t=u(this.hash);return o(e,{key:"df11955bfd534443af672f89d5133010e2ae775d",class:{red:(t===null||t===void 0?void 0:t.color)==="red",orange:(t===null||t===void 0?void 0:t.color)==="orange",yellow:(t===null||t===void 0?void 0:t.color)==="yellow",green:(t===null||t===void 0?void 0:t.color)==="green",blue:(t===null||t===void 0?void 0:t.color)==="blue",purple:(t===null||t===void 0?void 0:t.color)==="purple",empty:!(t===null||t===void 0?void 0:t.color)&&!this.hash,avatar:this.variant==="avatar"},style:{width:this.size,height:this.size}},(t===null||t===void 0?void 0:t.shapes)&&(t===null||t===void 0?void 0:t.rotations)&&t.shapes.map(((o,e)=>o?l(t.rotations[e]):a(t.rotations[e]))))}};const g=[r.length,s.length,16];function u(t){const o=new n(t);const[e,i,d]=g.map((t=>o.nextInt(0,t-1)));const a=Math.floor(d/4);const[l,c]=[d%2===1,d%4>=2];return{color:r[e],shapes:s[i][0].map(((t,o)=>o===a?l?t===1?false:true:t===1:t===1)),rotations:s[i][1].map(((t,o)=>o===a?c?(t+2)%4:t:t))}}c.style=d;export{c as cpsl_identicon};
2
- //# sourceMappingURL=p-52bb30d8.entry.js.map
1
+ import{r as t,h as o,H as e}from"./p-fa6b7678.js";import{C as r,P as n}from"./p-497acb43.js";const i=":host{--identicon-background-red:linear-gradient(136deg, #ff4270 6.86%, #ff7c7c 93.78%);--identicon-background-orange:linear-gradient(136deg, #f45532 6.86%, #ff9b63 93.78%);--identicon-background-yellow:linear-gradient(136deg, #ffa756 6.86%, #fbff47 93.78%);--identicon-background-green:linear-gradient(136deg, #0cae60 6.86%, #7bffd0 93.78%);--identicon-background-blue:linear-gradient(136deg, #476fff 6.86%, #47c8ff 93.78%);--identicon-background-purple:linear-gradient(136deg, #9747ff 6.86%, #da47ff 93.78%);--identicon-background-empty:linear-gradient(136deg, #aaaaaa 6.86%, #999999 93.78%);display:block;aspect-ratio:1;border-radius:25%;position:relative;border:1px solid var(--cpsl-color-background-8)}:host>svg{fill:rgba(255, 255, 255, 0.6);position:absolute;width:30%}:host>svg.rotate90{transform:rotate(0.25turn)}:host>svg.rotate180{transform:rotate(0.5turn)}:host>svg.rotate270{transform:rotate(0.75turn)}:host>svg:nth-child(1){right:50%;bottom:50%}:host>svg:nth-child(2){left:50%;bottom:50%}:host>svg:nth-child(3){right:50%;top:50%}:host>svg:nth-child(4){left:50%;top:50%}:host(.red){background:var(--identicon-background-red)}:host(.orange){background:var(--identicon-background-orange)}:host(.green){background:var(--identicon-background-green)}:host(.yellow){background:var(--identicon-background-yellow)}:host(.blue){background:var(--identicon-background-blue)}:host(.purple){background:var(--identicon-background-purple)}:host(.empty){background:var(--identicon-background-empty)}:host(.avatar){border-radius:1000px}";const d=i;const a=t=>o("svg",{class:{rotate90:t===1,rotate180:t===2,rotate270:t===3},viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg"},o("g",{"clip-path":"url(#clip0_674_66)"},o("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z"})),o("defs",null,o("clipPath",{id:"clip0_674_66"},o("rect",{width:"12",height:"12"}))));const l=t=>o("svg",{class:{rotate90:t===1,rotate180:t===2,rotate270:t===3},viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg"},o("g",{"clip-path":"url(#clip0_674_255)"},o("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z"}),o("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 18C15.3137 18 18 15.3137 18 12C18 8.68629 15.3137 6 12 6C8.68629 6 6 8.68629 6 12C6 15.3137 8.68629 18 12 18ZM12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z"})),o("defs",null,o("clipPath",{id:"clip0_674_255"},o("rect",{width:"12",height:"12"}))));const s=[[[0,0,0,0],[0,1,3,2]],[[1,1,0,0],[0,1,3,2]],[[0,1,0,1],[0,1,3,2]],[[0,0,1,1],[0,1,3,2]],[[1,0,1,0],[0,1,3,2]],[[1,1,1,1],[0,1,3,2]],[[0,0,0,0],[2,3,1,0]],[[1,1,1,1],[2,3,1,0]],[[1,1,1,1],[0,1,2,3]]];const c=class{constructor(o){t(this,o);this.hash=undefined;this.size="40px";this.variant="default"}render(){let t;const r=!this.hash;if(!r)t=u(this.hash);return o(e,{key:"55072485ad5993ad8eb075a9d7d83e7e137ec9cd",class:{red:(t===null||t===void 0?void 0:t.color)==="red",orange:(t===null||t===void 0?void 0:t.color)==="orange",yellow:(t===null||t===void 0?void 0:t.color)==="yellow",green:(t===null||t===void 0?void 0:t.color)==="green",blue:(t===null||t===void 0?void 0:t.color)==="blue",purple:(t===null||t===void 0?void 0:t.color)==="purple",empty:!(t===null||t===void 0?void 0:t.color)&&!this.hash,avatar:this.variant==="avatar"},style:{width:this.size,height:this.size}},(t===null||t===void 0?void 0:t.shapes)&&(t===null||t===void 0?void 0:t.rotations)&&t.shapes.map(((o,e)=>o?l(t.rotations[e]):a(t.rotations[e]))))}};const g=[r.length,s.length,16];function u(t){const o=new n(t);const[e,i,d]=g.map((t=>o.nextInt(0,t-1)));const a=Math.floor(d/4);const[l,c]=[d%2===1,d%4>=2];return{color:r[e],shapes:s[i][0].map(((t,o)=>o===a?l?t===1?false:true:t===1:t===1)),rotations:s[i][1].map(((t,o)=>o===a?c?(t+2)%4:t:t))}}c.style=d;export{c as cpsl_identicon};
2
+ //# sourceMappingURL=p-438442c7.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["cpslIdenticonCss","CpslIdenticonStyle0","SingleArc","rotation","h","class","rotate90","rotate180","rotate270","viewBox","xmlns","d","id","width","height","DoubleArc","BASE_PATTERNS","CpslIdenticon","render","props","isEmpty","this","hash","getIdenticonProps","Host","key","red","color","orange","yellow","green","blue","purple","empty","avatar","variant","style","size","shapes","rotations","map","isDouble","index","PRANDO_INTS","COLORS","length","seed","rng","Prando","iColor","iPattern","iDeviation","len","nextInt","deviationIndex","Math","floor","isDeviateShape","isDeviateFlip","s","i","r"],"sources":["src/components/cpsl-identicon/cpsl-identicon.scss?tag=cpsl-identicon&encapsulation=shadow","src/components/cpsl-identicon/cpsl-identicon.tsx"],"sourcesContent":[":host {\n --identicon-background-red: linear-gradient(136deg, #ff4270 6.86%, #ff7c7c 93.78%);\n --identicon-background-orange: linear-gradient(136deg, #f45532 6.86%, #ff9b63 93.78%);\n --identicon-background-yellow: linear-gradient(136deg, #ffa756 6.86%, #fbff47 93.78%);\n --identicon-background-green: linear-gradient(136deg, #0cae60 6.86%, #7bffd0 93.78%);\n --identicon-background-blue: linear-gradient(136deg, #476fff 6.86%, #47c8ff 93.78%);\n --identicon-background-purple: linear-gradient(136deg, #9747ff 6.86%, #da47ff 93.78%);\n --identicon-background-empty: linear-gradient(136deg, #aaaaaa 6.86%, #999999 93.78%);\n\n display: block;\n aspect-ratio: 1;\n border-radius: 25%;\n position: relative;\n border: 1px solid var(--cpsl-color-background-8);\n\n & > svg {\n fill: rgba(255, 255, 255, 0.6);\n position: absolute;\n width: 30%;\n }\n\n & > svg.rotate90 {\n transform: rotate(0.25turn);\n }\n\n & > svg.rotate180 {\n transform: rotate(0.5turn);\n }\n\n & > svg.rotate270 {\n transform: rotate(0.75turn);\n }\n\n & > svg:nth-child(1) {\n right: 50%;\n bottom: 50%;\n }\n\n & > svg:nth-child(2) {\n left: 50%;\n bottom: 50%;\n }\n\n & > svg:nth-child(3) {\n right: 50%;\n top: 50%;\n }\n\n & > svg:nth-child(4) {\n left: 50%;\n top: 50%;\n }\n}\n\n:host(.red) {\n background: var(--identicon-background-red);\n}\n\n:host(.orange) {\n background: var(--identicon-background-orange);\n}\n\n:host(.green) {\n background: var(--identicon-background-green);\n}\n\n:host(.yellow) {\n background: var(--identicon-background-yellow);\n}\n\n:host(.blue) {\n background: var(--identicon-background-blue);\n}\n\n:host(.purple) {\n background: var(--identicon-background-purple);\n}\n\n:host(.empty) {\n background: var(--identicon-background-empty);\n}\n\n:host(.avatar) {\n border-radius: 1000px;\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\nimport Prando from '../../lib/prando.js';\nimport { Color, COLORS } from '../../utils/prand.js';\n\nconst SingleArc = (rotation: number) => (\n <svg\n class={{\n rotate90: rotation === 1,\n rotate180: rotation === 2,\n rotate270: rotation === 3,\n }}\n viewBox=\"0 0 12 12\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g clip-path=\"url(#clip0_674_66)\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_674_66\">\n <rect width=\"12\" height=\"12\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nconst DoubleArc = (rotation: number) => (\n <svg\n class={{\n rotate90: rotation === 1,\n rotate180: rotation === 2,\n rotate270: rotation === 3,\n }}\n viewBox=\"0 0 12 12\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g clip-path=\"url(#clip0_674_255)\">\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12 18C15.3137 18 18 15.3137 18 12C18 8.68629 15.3137 6 12 6C8.68629 6 6 8.68629 6 12C6 15.3137 8.68629 18 12 18ZM12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_674_255\">\n <rect width=\"12\" height=\"12\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nconst BASE_PATTERNS = [\n [\n [0, 0, 0, 0],\n [0, 1, 3, 2],\n ],\n [\n [1, 1, 0, 0],\n [0, 1, 3, 2],\n ],\n [\n [0, 1, 0, 1],\n [0, 1, 3, 2],\n ],\n [\n [0, 0, 1, 1],\n [0, 1, 3, 2],\n ],\n [\n [1, 0, 1, 0],\n [0, 1, 3, 2],\n ],\n [\n [1, 1, 1, 1],\n [0, 1, 3, 2],\n ],\n [\n [0, 0, 0, 0],\n [2, 3, 1, 0],\n ],\n [\n [1, 1, 1, 1],\n [2, 3, 1, 0],\n ],\n [\n [1, 1, 1, 1],\n [0, 1, 2, 3],\n ],\n];\n\n@Component({\n tag: 'cpsl-identicon',\n styleUrl: 'cpsl-identicon.scss',\n shadow: true,\n})\nexport class CpslIdenticon {\n @Prop() hash?: string | undefined;\n\n /**\n * The CSS width and height of the identicon.\n * Default is: 40px.\n */\n @Prop() size: string = '40px';\n\n @Prop() variant: 'default' | 'avatar' = 'default';\n\n render() {\n let props;\n const isEmpty = !this.hash;\n if (!isEmpty) props = getIdenticonProps(this.hash);\n\n return (\n <Host\n class={{\n red: props?.color === 'red',\n orange: props?.color === 'orange',\n yellow: props?.color === 'yellow',\n green: props?.color === 'green',\n blue: props?.color === 'blue',\n purple: props?.color === 'purple',\n empty: !props?.color && !this.hash,\n avatar: this.variant === 'avatar',\n }}\n style={{\n width: this.size,\n height: this.size,\n }}\n >\n {props?.shapes &&\n props?.rotations &&\n props.shapes.map((isDouble, index) => {\n return isDouble ? DoubleArc(props.rotations[index]) : SingleArc(props.rotations[index]);\n })}\n </Host>\n );\n }\n}\n\nconst PRANDO_INTS = [COLORS.length, BASE_PATTERNS.length, 16];\n\nfunction getIdenticonProps(seed: string): { color: Color; shapes: boolean[]; rotations: number[] } {\n const rng = new Prando(seed);\n\n const [iColor, iPattern, iDeviation] = PRANDO_INTS.map(len => rng.nextInt(0, len - 1));\n\n const deviationIndex = Math.floor(iDeviation / 4);\n const [isDeviateShape, isDeviateFlip] = [iDeviation % 2 === 1, iDeviation % 4 >= 2];\n\n return {\n color: COLORS[iColor],\n shapes: BASE_PATTERNS[iPattern][0].map((s, i) => {\n return i === deviationIndex ? (isDeviateShape ? (s === 1 ? false : true) : s === 1) : s === 1;\n }),\n rotations: BASE_PATTERNS[iPattern][1].map((r, i) => (i === deviationIndex ? (isDeviateFlip ? (r + 2) % 4 : r) : r)),\n };\n}\n"],"mappings":"6FAAA,MAAMA,EAAmB,8/CACzB,MAAAC,EAAeD,ECGf,MAAME,EAAaC,GACjBC,EAAA,OACEC,MAAO,CACLC,SAAUH,IAAa,EACvBI,UAAWJ,IAAa,EACxBK,UAAWL,IAAa,GAE1BM,QAAQ,YACRC,MAAM,8BAENN,EAAA,iBAAa,sBACXA,EAAA,oBACY,UAAS,YACT,UACVO,EAAE,wOAGNP,EAAA,YACEA,EAAA,YAAUQ,GAAG,gBACXR,EAAA,QAAMS,MAAM,KAAKC,OAAO,UAMhC,MAAMC,EAAaZ,GACjBC,EAAA,OACEC,MAAO,CACLC,SAAUH,IAAa,EACvBI,UAAWJ,IAAa,EACxBK,UAAWL,IAAa,GAE1BM,QAAQ,YACRC,MAAM,8BAENN,EAAA,iBAAa,uBACXA,EAAA,oBACY,UAAS,YACT,UACVO,EAAE,uOAEJP,EAAA,oBACY,UAAS,YACT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K,SAALA,EAAOQ,SAAUN,KAAKC,KAC9BY,OAAQb,KAAKc,UAAY,UAE3BC,MAAO,CACLvB,MAAOQ,KAAKgB,KACZvB,OAAQO,KAAKgB,QAGdlB,IAAK,MAALA,SAAK,SAALA,EAAOmB,UACNnB,IAAK,MAALA,SAAK,SAALA,EAAOoB,YACPpB,EAAMmB,OAAOE,KAAI,CAACC,EAAUC,IACnBD,EAAW1B,EAAUI,EAAMoB,UAAUG,IAAUxC,EAAUiB,EAAMoB,UAAUG,M,GAO5F,MAAMC,EAAc,CAACC,EAAOC,OAAQ7B,EAAc6B,OAAQ,IAE1D,SAAStB,EAAkBuB,GACzB,MAAMC,EAAM,IAAIC,EAAOF,GAEvB,MAAOG,EAAQC,EAAUC,GAAcR,EAAYH,KAAIY,GAAOL,EAAIM,QAAQ,EAAGD,EAAM,KAEnF,MAAME,EAAiBC,KAAKC,MAAML,EAAa,GAC/C,MAAOM,EAAgBC,GAAiB,CAACP,EAAa,IAAM,EAAGA,EAAa,GAAK,GAEjF,MAAO,CACLxB,MAAOiB,EAAOK,GACdX,OAAQtB,EAAckC,GAAU,GAAGV,KAAI,CAACmB,EAAGC,IAClCA,IAAMN,EAAkBG,EAAkBE,IAAM,EAAI,MAAQ,KAAQA,IAAM,EAAKA,IAAM,IAE9FpB,UAAWvB,EAAckC,GAAU,GAAGV,KAAI,CAACqB,EAAGD,IAAOA,IAAMN,EAAkBI,GAAiBG,EAAI,GAAK,EAAIA,EAAKA,IAEpH,C","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- class t{constructor(e){this._value=NaN;if(typeof e==="string"){this._seed=this.hashCode(e)}else if(typeof e==="number"){this._seed=this.getSafeSeed(e)}else{this._seed=this.getSafeSeed(t.MIN+Math.floor((t.MAX-t.MIN)*Math.random()))}this.reset()}next(e=0,r=1){this.recalculate();return this.map(this._value,t.MIN,t.MAX,e,r)}nextInt(e=10,r=100){this.recalculate();return Math.floor(this.map(this._value,t.MIN,t.MAX,e,r+1))}nextString(t=16,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"){let r="";while(r.length<t){r+=this.nextChar(e)}return r}nextChar(t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"){return t.substr(this.nextInt(0,t.length-1),1)}nextArrayItem(t){return t[this.nextInt(0,t.length-1)]}nextBoolean(){this.recalculate();return this._value>.5}skip(t=1){while(t-- >0){this.recalculate()}}reset(){this._value=this._seed}recalculate(){this._value=this.xorshift(this._value)}xorshift(t){t^=t<<13;t^=t>>17;t^=t<<5;return t}map(t,e,r,s,i){return(t-e)/(r-e)*(i-s)+s}hashCode(t){let e=0;if(t){const r=t.length;for(let s=0;s<r;s++){e=(e<<5)-e+t.charCodeAt(s);e|=0;e=this.xorshift(e)}}return this.getSafeSeed(e)}getSafeSeed(t){if(t===0)return 1;return t}}t.MIN=-2147483648;t.MAX=2147483647;const e=t;const r=["red","orange","yellow","green","blue","purple"];const s={red:["#FF4270","#FF7C7C"],orange:["#F45532","#FF9B63"],yellow:["#FFA756","#FBFF47"],green:["#0CAE60","#7BFFD0"],blue:["#476FFF","#47C8FF"],purple:["#9747FF","#DA47FF"]};function i(t){const i=new e(t);const[n,h]=s[r[i.nextInt(0,r.length-1)]];return`linear-gradient(136deg, ${n} 6.86%, ${h} 93.78%)`}export{r as C,e as P,i as g};
2
- //# sourceMappingURL=p-286db996.js.map
1
+ class t{constructor(e){this._value=NaN;if(typeof e==="string"){this._seed=this.hashCode(e)}else if(typeof e==="number"){this._seed=this.getSafeSeed(e)}else{this._seed=this.getSafeSeed(t.MIN+Math.floor((t.MAX-t.MIN)*Math.random()))}this.reset()}next(e=0,r=1){this.recalculate();return this.map(this._value,t.MIN,t.MAX,e,r)}nextInt(e=10,r=100){this.recalculate();return Math.floor(this.map(this._value,t.MIN,t.MAX,e,r+1))}nextString(t=16,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"){let r="";while(r.length<t){r+=this.nextChar(e)}return r}nextChar(t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"){return t.substr(this.nextInt(0,t.length-1),1)}nextArrayItem(t){return t[this.nextInt(0,t.length-1)]}nextBoolean(){this.recalculate();return this._value>.5}skip(t=1){while(t-- >0){this.recalculate()}}reset(){this._value=this._seed}recalculate(){this._value=this.xorshift(this._value)}xorshift(t){t^=t<<13;t^=t>>17;t^=t<<5;return t}map(t,e,r,s,i){return(t-e)/(r-e)*(i-s)+s}hashCode(t){let e=0;if(t){const r=t.length;for(let s=0;s<r;s++){e=(e<<5)-e+t.charCodeAt(s);e|=0;e=this.xorshift(e)}}return this.getSafeSeed(e)}getSafeSeed(t){if(t===0)return 1;return t}}t.MIN=-2147483648;t.MAX=2147483647;const e=["red","orange","yellow","green","blue","purple"];const r={red:["#FF4270","#FF7C7C"],orange:["#F45532","#FF9B63"],yellow:["#FFA756","#FBFF47"],green:["#0CAE60","#7BFFD0"],blue:["#476FFF","#47C8FF"],purple:["#9747FF","#DA47FF"]};function s(s){const i=new t(s);const[n,h]=r[e[i.nextInt(0,e.length-1)]];return`linear-gradient(136deg, ${n} 6.86%, ${h} 93.78%)`}export{e as C,t as P,s as g};
2
+ //# sourceMappingURL=p-497acb43.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Prando","constructor","seed","this","_value","NaN","_seed","hashCode","getSafeSeed","MIN","Math","floor","MAX","random","reset","next","min","pseudoMax","recalculate","map","nextInt","max","nextString","length","chars","str","nextChar","substr","nextArrayItem","array","nextBoolean","skip","iterations","xorshift","value","val","minFrom","maxFrom","minTo","maxTo","hash","l","i","charCodeAt","COLORS","GRADIENTS","red","orange","yellow","green","blue","purple","getPseudoRandomBackground","rng","start","stop"],"sources":["src/lib/prando.ts","src/utils/prand.ts"],"sourcesContent":["/*\n * This file contains code from prando, which is licensed under the MIT License:\n *\n * Copyright (c) 2016 Zeh Fernando\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport default class Prando {\n private static readonly MIN: number = -2147483648; // Int32 min\n private static readonly MAX: number = 2147483647; // Int32 max\n\n private _seed: number;\n private _value = NaN;\n\n // ================================================================================================================\n // CONSTRUCTOR ----------------------------------------------------------------------------------------------------\n\n /**\n * Generate a new Prando pseudo-random number generator.\n *\n * @param seed - A number or string seed that determines which pseudo-random number sequence will be created. Defaults to a random seed based on `Math.random()`.\n */\n constructor(seed?: number | string) {\n if (typeof seed === 'string') {\n // String seed\n this._seed = this.hashCode(seed);\n } else if (typeof seed === 'number') {\n // Numeric seed\n this._seed = this.getSafeSeed(seed);\n } else {\n // Pseudo-random seed\n this._seed = this.getSafeSeed(Prando.MIN + Math.floor((Prando.MAX - Prando.MIN) * Math.random()));\n }\n this.reset();\n }\n\n // ================================================================================================================\n // PUBLIC INTERFACE -----------------------------------------------------------------------------------------------\n\n /**\n * Generates a pseudo-random number between a lower (inclusive) and a higher (exclusive) bounds.\n *\n * @param min - The minimum number that can be randomly generated.\n * @param pseudoMax - The maximum number that can be randomly generated (exclusive).\n * @return The generated pseudo-random number.\n */\n public next(min = 0, pseudoMax = 1): number {\n this.recalculate();\n return this.map(this._value, Prando.MIN, Prando.MAX, min, pseudoMax);\n }\n\n /**\n * Generates a pseudo-random integer number in a range (inclusive).\n *\n * @param min - The minimum number that can be randomly generated.\n * @param max - The maximum number that can be randomly generated.\n * @return The generated pseudo-random number.\n */\n public nextInt(min = 10, max = 100): number {\n this.recalculate();\n return Math.floor(this.map(this._value, Prando.MIN, Prando.MAX, min, max + 1));\n }\n\n /**\n * Generates a pseudo-random string sequence of a particular length from a specific character range.\n *\n * Note: keep in mind that creating a random string sequence does not guarantee uniqueness; there is always a\n * 1 in (char_length^string_length) chance of collision. For real unique string ids, always check for\n * pre-existing ids, or employ a robust GUID/UUID generator.\n *\n * @param length - Length of the string to be generated.\n * @param chars - Characters that are used when creating the random string. Defaults to all alphanumeric chars (A-Z, a-z, 0-9).\n * @return The generated string sequence.\n */\n public nextString(length = 16, chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'): string {\n let str = '';\n while (str.length < length) {\n str += this.nextChar(chars);\n }\n return str;\n }\n\n /**\n * Generates a pseudo-random string of 1 character specific character range.\n *\n * @param chars - Characters that are used when creating the random string. Defaults to all alphanumeric chars (A-Z, a-z, 0-9).\n * @return The generated character.\n */\n public nextChar(chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'): string {\n return chars.substr(this.nextInt(0, chars.length - 1), 1);\n }\n\n /**\n * Picks a pseudo-random item from an array. The array is left unmodified.\n *\n * Note: keep in mind that while the returned item will be random enough, picking one item from the array at a time\n * does not guarantee nor imply that a sequence of random non-repeating items will be picked. If you want to\n * *pick items in a random order* from an array, instead of *pick one random item from an array*, it's best to\n * apply a *shuffle* transformation to the array instead, then read it linearly.\n *\n * @param array - Array of any type containing one or more candidates for random picking.\n * @return An item from the array.\n */\n public nextArrayItem<T>(array: T[]): T {\n return array[this.nextInt(0, array.length - 1)];\n }\n\n /**\n * Generates a pseudo-random boolean.\n *\n * @return A value of true or false.\n */\n public nextBoolean(): boolean {\n this.recalculate();\n return this._value > 0.5;\n }\n\n /**\n * Skips ahead in the sequence of numbers that are being generated. This is equivalent to\n * calling next() a specified number of times, but faster since it doesn't need to map the\n * new random numbers to a range and return it.\n *\n * @param iterations - The number of items to skip ahead.\n */\n public skip(iterations = 1): void {\n while (iterations-- > 0) {\n this.recalculate();\n }\n }\n\n /**\n * Reset the pseudo-random number sequence back to its starting seed. Further calls to next()\n * will then produce the same sequence of numbers it had produced before. This is equivalent to\n * creating a new Prando instance with the same seed as another Prando instance.\n *\n * Example:\n * let rng = new Prando(12345678);\n * console.log(rng.next()); // 0.6177754114889017\n * console.log(rng.next()); // 0.5784605181725837\n * rng.reset();\n * console.log(rng.next()); // 0.6177754114889017 again\n * console.log(rng.next()); // 0.5784605181725837 again\n */\n public reset(): void {\n this._value = this._seed;\n }\n\n // ================================================================================================================\n // PRIVATE INTERFACE ----------------------------------------------------------------------------------------------\n\n private recalculate(): void {\n this._value = this.xorshift(this._value);\n }\n\n private xorshift(value: number): number {\n // Xorshift*32\n // Based on George Marsaglia's work: http://www.jstatsoft.org/v08/i14/paper\n value ^= value << 13;\n value ^= value >> 17;\n value ^= value << 5;\n return value;\n }\n\n private map(val: number, minFrom: number, maxFrom: number, minTo: number, maxTo: number): number {\n return ((val - minFrom) / (maxFrom - minFrom)) * (maxTo - minTo) + minTo;\n }\n\n private hashCode(str: string): number {\n let hash = 0;\n if (str) {\n const l = str.length;\n for (let i = 0; i < l; i++) {\n hash = (hash << 5) - hash + str.charCodeAt(i);\n hash |= 0;\n hash = this.xorshift(hash);\n }\n }\n return this.getSafeSeed(hash);\n }\n\n private getSafeSeed(seed: number): number {\n if (seed === 0) return 1;\n return seed;\n }\n}\n","import Prando from '../lib/prando';\n\nexport type Color = 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'purple';\n\nexport const COLORS: Color[] = ['red', 'orange', 'yellow', 'green', 'blue', 'purple'];\n\nconst GRADIENTS = {\n red: ['#FF4270', '#FF7C7C'],\n orange: ['#F45532', '#FF9B63'],\n yellow: ['#FFA756', '#FBFF47'],\n green: ['#0CAE60', '#7BFFD0'],\n blue: ['#476FFF', '#47C8FF'],\n purple: ['#9747FF', '#DA47FF'],\n};\n\nexport function getPseudoRandomBackground(seed: string): string {\n const rng = new Prando(seed);\n\n const [start, stop] = GRADIENTS[COLORS[rng.nextInt(0, COLORS.length - 1)]];\n\n return `linear-gradient(136deg, ${start} 6.86%, ${stop} 93.78%)`;\n}\n"],"mappings":"AAwBA,MAAqBA,EAenB,WAAAC,CAAYC,GAVJC,KAAAC,OAASC,IAWf,UAAWH,IAAS,SAAU,CAE5BC,KAAKG,MAAQH,KAAKI,SAASL,E,MACtB,UAAWA,IAAS,SAAU,CAEnCC,KAAKG,MAAQH,KAAKK,YAAYN,E,KACzB,CAELC,KAAKG,MAAQH,KAAKK,YAAYR,EAAOS,IAAMC,KAAKC,OAAOX,EAAOY,IAAMZ,EAAOS,KAAOC,KAAKG,U,CAEzFV,KAAKW,O,CAaA,IAAAC,CAAKC,EAAM,EAAGC,EAAY,GAC/Bd,KAAKe,cACL,OAAOf,KAAKgB,IAAIhB,KAAKC,OAAQJ,EAAOS,IAAKT,EAAOY,IAAKI,EAAKC,E,CAUrD,OAAAG,CAAQJ,EAAM,GAAIK,EAAM,KAC7BlB,KAAKe,cACL,OAAOR,KAAKC,MAAMR,KAAKgB,IAAIhB,KAAKC,OAAQJ,EAAOS,IAAKT,EAAOY,IAAKI,EAAKK,EAAM,G,CActE,UAAAC,CAAWC,EAAS,GAAIC,EAAQ,kEACrC,IAAIC,EAAM,GACV,MAAOA,EAAIF,OAASA,EAAQ,CAC1BE,GAAOtB,KAAKuB,SAASF,E,CAEvB,OAAOC,C,CASF,QAAAC,CAASF,EAAQ,kEACtB,OAAOA,EAAMG,OAAO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AM,IAAIrD,EAAOE,GAEvB,MAAOoD,EAAOC,GAAQV,EAAUD,EAAOS,EAAIjC,QAAQ,EAAGwB,EAAOrB,OAAS,KAEtE,MAAO,2BAA2B+B,YAAgBC,WACpD,Q","ignoreList":[]}
1
+ {"version":3,"names":["Prando","constructor","seed","this","_value","NaN","_seed","hashCode","getSafeSeed","MIN","Math","floor","MAX","random","reset","next","min","pseudoMax","recalculate","map","nextInt","max","nextString","length","chars","str","nextChar","substr","nextArrayItem","array","nextBoolean","skip","iterations","xorshift","value","val","minFrom","maxFrom","minTo","maxTo","hash","l","i","charCodeAt","COLORS","GRADIENTS","red","orange","yellow","green","blue","purple","getPseudoRandomBackground","rng","start","stop"],"sources":["src/lib/prando.ts","src/utils/prand.ts"],"sourcesContent":["/*\n * This file contains code from prando, which is licensed under the MIT License:\n *\n * Copyright (c) 2016 Zeh Fernando\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport default class Prando {\n private static readonly MIN: number = -2147483648; // Int32 min\n private static readonly MAX: number = 2147483647; // Int32 max\n\n private _seed: number;\n private _value = NaN;\n\n // ================================================================================================================\n // CONSTRUCTOR ----------------------------------------------------------------------------------------------------\n\n /**\n * Generate a new Prando pseudo-random number generator.\n *\n * @param seed - A number or string seed that determines which pseudo-random number sequence will be created. Defaults to a random seed based on `Math.random()`.\n */\n constructor(seed?: number | string) {\n if (typeof seed === 'string') {\n // String seed\n this._seed = this.hashCode(seed);\n } else if (typeof seed === 'number') {\n // Numeric seed\n this._seed = this.getSafeSeed(seed);\n } else {\n // Pseudo-random seed\n this._seed = this.getSafeSeed(Prando.MIN + Math.floor((Prando.MAX - Prando.MIN) * Math.random()));\n }\n this.reset();\n }\n\n // ================================================================================================================\n // PUBLIC INTERFACE -----------------------------------------------------------------------------------------------\n\n /**\n * Generates a pseudo-random number between a lower (inclusive) and a higher (exclusive) bounds.\n *\n * @param min - The minimum number that can be randomly generated.\n * @param pseudoMax - The maximum number that can be randomly generated (exclusive).\n * @return The generated pseudo-random number.\n */\n public next(min = 0, pseudoMax = 1): number {\n this.recalculate();\n return this.map(this._value, Prando.MIN, Prando.MAX, min, pseudoMax);\n }\n\n /**\n * Generates a pseudo-random integer number in a range (inclusive).\n *\n * @param min - The minimum number that can be randomly generated.\n * @param max - The maximum number that can be randomly generated.\n * @return The generated pseudo-random number.\n */\n public nextInt(min = 10, max = 100): number {\n this.recalculate();\n return Math.floor(this.map(this._value, Prando.MIN, Prando.MAX, min, max + 1));\n }\n\n /**\n * Generates a pseudo-random string sequence of a particular length from a specific character range.\n *\n * Note: keep in mind that creating a random string sequence does not guarantee uniqueness; there is always a\n * 1 in (char_length^string_length) chance of collision. For real unique string ids, always check for\n * pre-existing ids, or employ a robust GUID/UUID generator.\n *\n * @param length - Length of the string to be generated.\n * @param chars - Characters that are used when creating the random string. Defaults to all alphanumeric chars (A-Z, a-z, 0-9).\n * @return The generated string sequence.\n */\n public nextString(length = 16, chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'): string {\n let str = '';\n while (str.length < length) {\n str += this.nextChar(chars);\n }\n return str;\n }\n\n /**\n * Generates a pseudo-random string of 1 character specific character range.\n *\n * @param chars - Characters that are used when creating the random string. Defaults to all alphanumeric chars (A-Z, a-z, 0-9).\n * @return The generated character.\n */\n public nextChar(chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'): string {\n return chars.substr(this.nextInt(0, chars.length - 1), 1);\n }\n\n /**\n * Picks a pseudo-random item from an array. The array is left unmodified.\n *\n * Note: keep in mind that while the returned item will be random enough, picking one item from the array at a time\n * does not guarantee nor imply that a sequence of random non-repeating items will be picked. If you want to\n * *pick items in a random order* from an array, instead of *pick one random item from an array*, it's best to\n * apply a *shuffle* transformation to the array instead, then read it linearly.\n *\n * @param array - Array of any type containing one or more candidates for random picking.\n * @return An item from the array.\n */\n public nextArrayItem<T>(array: T[]): T {\n return array[this.nextInt(0, array.length - 1)];\n }\n\n /**\n * Generates a pseudo-random boolean.\n *\n * @return A value of true or false.\n */\n public nextBoolean(): boolean {\n this.recalculate();\n return this._value > 0.5;\n }\n\n /**\n * Skips ahead in the sequence of numbers that are being generated. This is equivalent to\n * calling next() a specified number of times, but faster since it doesn't need to map the\n * new random numbers to a range and return it.\n *\n * @param iterations - The number of items to skip ahead.\n */\n public skip(iterations = 1): void {\n while (iterations-- > 0) {\n this.recalculate();\n }\n }\n\n /**\n * Reset the pseudo-random number sequence back to its starting seed. Further calls to next()\n * will then produce the same sequence of numbers it had produced before. This is equivalent to\n * creating a new Prando instance with the same seed as another Prando instance.\n *\n * Example:\n * let rng = new Prando(12345678);\n * console.log(rng.next()); // 0.6177754114889017\n * console.log(rng.next()); // 0.5784605181725837\n * rng.reset();\n * console.log(rng.next()); // 0.6177754114889017 again\n * console.log(rng.next()); // 0.5784605181725837 again\n */\n public reset(): void {\n this._value = this._seed;\n }\n\n // ================================================================================================================\n // PRIVATE INTERFACE ----------------------------------------------------------------------------------------------\n\n private recalculate(): void {\n this._value = this.xorshift(this._value);\n }\n\n private xorshift(value: number): number {\n // Xorshift*32\n // Based on George Marsaglia's work: http://www.jstatsoft.org/v08/i14/paper\n value ^= value << 13;\n value ^= value >> 17;\n value ^= value << 5;\n return value;\n }\n\n private map(val: number, minFrom: number, maxFrom: number, minTo: number, maxTo: number): number {\n return ((val - minFrom) / (maxFrom - minFrom)) * (maxTo - minTo) + minTo;\n }\n\n private hashCode(str: string): number {\n let hash = 0;\n if (str) {\n const l = str.length;\n for (let i = 0; i < l; i++) {\n hash = (hash << 5) - hash + str.charCodeAt(i);\n hash |= 0;\n hash = this.xorshift(hash);\n }\n }\n return this.getSafeSeed(hash);\n }\n\n private getSafeSeed(seed: number): number {\n if (seed === 0) return 1;\n return seed;\n }\n}\n","import Prando from '../lib/prando.js';\n\nexport type Color = 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'purple';\n\nexport const COLORS: Color[] = ['red', 'orange', 'yellow', 'green', 'blue', 'purple'];\n\nconst GRADIENTS = {\n red: ['#FF4270', '#FF7C7C'],\n orange: ['#F45532', '#FF9B63'],\n yellow: ['#FFA756', '#FBFF47'],\n green: ['#0CAE60', '#7BFFD0'],\n blue: ['#476FFF', '#47C8FF'],\n purple: ['#9747FF', '#DA47FF'],\n};\n\nexport function getPseudoRandomBackground(seed: string): string {\n const rng = new Prando(seed);\n\n const [start, stop] = GRADIENTS[COLORS[rng.nextInt(0, COLORS.length - 1)]];\n\n return `linear-gradient(136deg, ${start} 6.86%, ${stop} 93.78%)`;\n}\n"],"mappings":"AAwBA,MAAqBA,EAenB,WAAAC,CAAYC,GAVJC,KAAAC,OAASC,IAWf,UAAWH,IAAS,SAAU,CAE5BC,KAAKG,MAAQH,KAAKI,SAASL,E,MACtB,UAAWA,IAAS,SAAU,CAEnCC,KAAKG,MAAQH,KAAKK,YAAYN,E,KACzB,CAELC,KAAKG,MAAQH,KAAKK,YAAYR,EAAOS,IAAMC,KAAKC,OAAOX,E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