diff --git a/.gitignore b/.gitignore index ed05f19..2d6a809 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,6 @@ .venv build/ -dist/ +dist/* +!dist/js django_simple_bulma.egg-info/ diff --git a/.gitmodules b/.gitmodules index 6a93d82..53d6d22 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,57 @@ [submodule "bulma"] path = django_simple_bulma/bulma url = https://github.com/jgthms/bulma.git +[submodule "bulma-tagsinput"] + path = django_simple_bulma/extensions/bulma-tagsinput + url = https://github.com/CreativeBulma/bulma-tagsinput.git +[submodule "bulma-divider"] + path = django_simple_bulma/extensions/bulma-divider + url = https://github.com/CreativeBulma/bulma-divider.git +[submodule "bulma-badge"] + path = django_simple_bulma/extensions/bulma-badge + url = https://github.com/CreativeBulma/bulma-badge.git +[submodule "bulma-carousel"] + path = django_simple_bulma/extensions/bulma-carousel + url = https://github.com/Wikiki/bulma-carousel.git +[submodule "bulma-calendar"] + path = django_simple_bulma/extensions/bulma-calendar + url = https://github.com/Wikiki/bulma-calendar.git +[submodule "bulma-tooltip"] + path = django_simple_bulma/extensions/bulma-tooltip + url = https://github.com/Wikiki/bulma-tooltip.git +[submodule "bulma-quickview"] + path = django_simple_bulma/extensions/bulma-quickview + url = https://github.com/Wikiki/bulma-quickview.git +[submodule "bulma-pricingtable"] + path = django_simple_bulma/extensions/bulma-pricingtable + url = https://github.com/Wikiki/bulma-pricingtable.git +[submodule "bulma-megamenu"] + path = django_simple_bulma/extensions/bulma-megamenu + url = https://github.com/hunzaboy/bulma-megamenu.git +[submodule "Cool-Checkboxes-for-Bulma.io"] + path = django_simple_bulma/extensions/bulma-coolcheckboxes + url = https://github.com/hunzaboy/Cool-Checkboxes-for-Bulma.io.git +[submodule "bulma-slider"] + path = django_simple_bulma/extensions/bulma-slider + url = https://github.com/Wikiki/bulma-slider.git +[submodule "bulma-checkradio"] + path = django_simple_bulma/extensions/bulma-checkradio + url = https://github.com/Wikiki/bulma-checkradio.git +[submodule "bulma-switch"] + path = django_simple_bulma/extensions/bulma-switch + url = https://github.com/Wikiki/bulma-switch.git +[submodule "bulma-pageloader"] + path = django_simple_bulma/extensions/bulma-pageloader + url = https://github.com/Wikiki/bulma-pageloader.git +[submodule "bulma-ribbon"] + path = django_simple_bulma/extensions/bulma-ribbon + url = https://github.com/Wikiki/bulma-ribbon.git +[submodule "bulma-steps"] + path = django_simple_bulma/extensions/bulma-steps + url = https://github.com/Wikiki/bulma-steps.git +[submodule "bulma-timeline"] + path = django_simple_bulma/extensions/bulma-timeline + url = https://github.com/Wikiki/bulma-timeline.git +[submodule "bulma-collapsible"] + path = django_simple_bulma/extensions/bulma-collapsible + url = https://github.com/CreativeBulma/bulma-collapsible.git diff --git a/MANIFEST.in b/MANIFEST.in index 073f9e9..2f222af 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,14 @@ include LICENSE recursive-include django_simple_bulma * + prune django_simple_bulma/bulma graft django_simple_bulma/bulma/sass + +prune django_simple_bulma/extensions +graft django_simple_bulma/extensions/*/dist/js +graft django_simple_bulma/extensions/*/src +prune django_simple_bulma/extensions/*/src/docs +prune django_simple_bulma/extensions/*/src/demo + +graft django_simple_bulma/extensions/bulma-coolcheckboxes/dist +include django_simple_bulma/extensions/bulma-megamenu/megamenu.css diff --git a/README.md b/README.md index 7cfa710..0c8d35c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ django-simple-bulma `django-simple-bulma` is a Django application that makes [Bulma](https://bulma.io) and [Bulma-Extensions](https://wikiki.github.io/) available to use in your Django project with as little setup as possible. The goal of this project is to make it as easy as possible to use Bulma with Django. -This project currently uses **Bulma v0.9.0**, **Bulma-Extensions v4.0.0**, and **FontAwesome v5.6.3**. If you want features that are only available in newer versions of these frameworks, please [create an issue](https://github.com/python-discord/django-simple-bulma/issues), and we will be happy to update it. +This project currently uses **Bulma v0.9.0** and **FontAwesome v5.6.3**. If you want features that are only available in newer versions of these frameworks, please [create an issue](https://github.com/python-discord/django-simple-bulma/issues), and we will be happy to update it. Installation ------------ @@ -57,7 +57,7 @@ In order to do this, we'll simply create a dictionary inside your `settings.py` # Custom settings for django-simple-bulma BULMA_SETTINGS = { "extensions": [ - "bulma-accordion", + "bulma-collapsible", "bulma-calendar", ], "variables": { @@ -70,14 +70,36 @@ BULMA_SETTINGS = { You may here define any variable found on the [Bulma variables](https://bulma.io/documentation/customize/variables/) page, and you may use any valid SASS or CSS as the value. For example, `hsl(217, 71%, 53%)` would be a valid value for a color variable, as would `#ffff00`. Please note that any syntactically incorrect values may prevent Bulma from building correctly, so be careful what you add here unless you know exactly what you're doing. -If the `extensions` key is not found, it will default to loading **all extensions**. If you don't want any extensions, simply set it to an empty list. +If the `extensions` key is not found, it will default to not loading any extensions. If you want all extensions, simply set it to the string `"all"`. + +We currently support these extensions: +- bulma-badge +- bulma-calendar +- bulma-carousel +- bulma-collapsible +- bulma-checkradio +- bulma-divider +- bulma-megamenu +- bulma-pageloader +- bulma-pricingtable +- bulma-quickview +- bulma-ribbon +- bulma-slider +- bulma-steps +- bulma-switch +- bulma-tagsinput +- bulma-timeline +- bulma-tooltip +- Cool-Checkboxes-for-Bulma.io (include it as bulma-coolcheckboxes) + +If an extension you want to use is missing, feel free to [create an issue](https://github.com/python-discord/django-simple-bulma/issues) and we will be happy to add it. Alternatively, add it yourself and create a pull request (see [this pr](https://github.com/python-discord/django-simple-bulma/pull/55) for some context on how to go about doing that). The `output_style` determines the style of the resulting CSS file. It can be any of `"nested"` (default), `"expanded"`, `"compact"`, and `"compressed"`. It is recommended to use `"compressed"` in production as to reduce the final file size. Additional scripts ------------------ -For your convenience, we also give you the option to add other quality of life improvements to your Bulma app. If you are not specifying any extensions in `BULMA_SETTINGS`, these will all be loaded by default. If you are, you may want to add these as well if they sound useful to you. +For your convenience, we also give you the option to add other quality of life improvements to your Bulma app. You may want to add these as well if they sound useful to you. * `bulma-fileupload` will handle displaying the filename in your [file upload inputs](https://bulma.io/documentation/form/file/). * `bulma-navbar-burger` will hook up your `navbar-burger`s and `navbar-menu`s automatically, to provide a toggle for mobile users. We use a slightly updated version of [the example from Bulma's documentation](https://bulma.io/documentation/components/navbar/#navbarJsExample) - simply add a `data-target` attribute to your `navbar-burger` that refers to the `id` of the `navbar-menu` that should be expanded and collapsed by the button. diff --git a/django_simple_bulma/extensions/_all.sass b/django_simple_bulma/extensions/_all.sass deleted file mode 100644 index 877f294..0000000 --- a/django_simple_bulma/extensions/_all.sass +++ /dev/null @@ -1,21 +0,0 @@ -@charset "utf-8" - -@import '_bulma-calendar' -@import '_bulma-accordion' -@import '_bulma-badge' -@import '_bulma-calendar' -@import '_bulma-carousel' -@import '_bulma-checkradio' -@import '_bulma-divider' -@import '_bulma-iconpicker' -@import '_bulma-pageloader' -@import '_bulma-pricingtable' -@import '_bulma-quickview' -@import '_bulma-ribbon' -@import '_bulma-slider' -@import '_bulma-steps' -@import '_bulma-switch' -@import '_bulma-tagsinput' -@import '_bulma-timeline' -@import '_bulma-tooltip' - diff --git a/django_simple_bulma/extensions/_bulma-accordion.sass b/django_simple_bulma/extensions/_bulma-accordion.sass deleted file mode 100644 index 2140001..0000000 --- a/django_simple_bulma/extensions/_bulma-accordion.sass +++ /dev/null @@ -1,139 +0,0 @@ -$accordion-background-color: $background !default -$accordion-radius: $radius !default - -$accordion-header-background-color: $text !default -$accordion-header-color: $text-invert !default -$accordion-header-padding: 0.5em 0.75em !default -$accordion-header-radius: $radius !default - -$accordion-content-border: 1px solid $border !default -$accordion-content-color: $text !default -$accordion-content-padding-top: 1em !default -$accordion-content-padding-left: 1.25em !default -$accordion-content-radius: $radius !default - -$accordion-content-pre-background-color: $white !default -$accordion-content-pre-code-background-color: transparent !default - -.accordions - .accordion - +block - display: flex - flex-direction: column - background-color: $accordion-background-color - border-radius: $accordion-radius - font-size: $size-normal - strong - color: currentColor - a:not(.button):not(.tag) - color: currentColor - text-decoration: underline - // Sizes - &.is-small - font-size: $size-small - &.is-medium - font-size: $size-medium - &.is-large - font-size: $size-large - - &:not(:first-child) - .accordion-header - border-radius: 0 - &:not(:last-child) - margin-bottom: 0 - .accordion-content - border-radius: 0 - - .toggle, - [data-action="toggle"] - cursor: pointer - - .accordion-header - align-items: center - background-color: $accordion-header-background-color - border-radius: $accordion-header-radius $accordion-header-radius 0 0 - color: $accordion-header-color - display: flex - justify-content: space-between - line-height: 1.25 - padding: $accordion-header-padding - position: relative - .toggle - -webkit-touch-callout: none - -webkit-user-select: none - -moz-user-select: none - -ms-user-select: none - user-select: none - -moz-appearance: none - -webkit-appearance: none - background-color: rgba(10,10,10,0.2) - border: none - border-radius: 290486px - display: inline-block - flex-grow: 0 - flex-shrink: 0 - margin-left: 0.75em - height: 20px - width: 20px - max-height: 20px - max-width: 20px - min-height: 20px - min-width: 20px - outline: none - position: relative - vertical-align: top - &::before - color: $white - display: block - left: 0 - position: absolute - top: -.1em - right: 0 - bottom: 0 - content: '\002B' - &::after - display: none - & + .accordion-body - overflow-y: hidden - max-height: 0 - color: $accordion-content-color - border: $accordion-content-border - border-radius: $accordion-content-radius - border-top-left-radius: 0 - border-top-right-radius: 0 - border-top: none - -webkit-transition: max-height .2s ease - -moz-transition: max-height .2s ease - -o-transition: max-height .2s ease - transition: max-height .2s ease - .accordion-content - padding: $accordion-content-padding-top $accordion-content-padding-left - code, - pre - background-color: $accordion-content-pre-background-color - pre code - background-color: $accordion-content-pre-code-background-color - &.is-active - .accordion-header - .toggle - &::before - content: '\002D' - .accordion-body - max-height: 100em - - // Colors - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - $color-lightning: max((100% - lightness($color)) - 2%, 0%) - $color-luminance: colorLuminance($color) - $darken-percentage: $color-luminance * 70% - $desaturate-percentage: $color-luminance * 30% - &.is-#{$name} - background-color: lighten($color, $color-lightning) - .accordion-header - background-color: $color - color: $color-invert - .accordion-content - border-color: $color - color: desaturate(darken($color, $darken-percentage), $desaturate-percentage) diff --git a/django_simple_bulma/extensions/_bulma-badge.sass b/django_simple_bulma/extensions/_bulma-badge.sass deleted file mode 100644 index 4d6d76f..0000000 --- a/django_simple_bulma/extensions/_bulma-badge.sass +++ /dev/null @@ -1,82 +0,0 @@ -$badge-border-size: .1rem !default -$badge-border-radius: 1rem !default - -=badge-size($size) - $badgeSize: $size - $leftPosition: calc(100% - ( #{$badgeSize} / 2 )) - $topPosition: calc(0px - ( #{$badgeSize} / 2 )) - &[data-badge]::after - top: $topPosition - left: $leftPosition - min-height: $badgeSize - min-width: $badgeSize - &:not([data-badge=""])::after - font-size: $size * .75 - line-height: $size * .5 - &[data-badge=""]::after - width: $badgeSize - &.is-badge-left - &::after - left: calc(0px - ( #{$badgeSize} / 2 )) - &.is-badge-bottom - &::after - top: calc(100% - ( #{$badgeSize} / 2 )) - &.is-badge-bottom-left - &::after - left: calc(0px - ( #{$badgeSize} / 2 )) - top: calc(100% - ( #{$badgeSize} / 2 )) - -.badge - position: relative - white-space: nowrap - position: relative - &[data-badge]::after - position: absolute - left: 100% - margin: 0 - background: $primary - background-clip: padding-box - border-radius: $badge-border-radius - box-shadow: 0 0 0 $badge-border-size $white - color: $white - content: attr(data-badge) - display: inline-block - &:not([data-badge=""])::after - padding: .3rem .5rem - text-align: center - white-space: nowrap - &[data-badge=""]::after - display: inline-block - vertical-align: inherit - - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-badge-#{$name} - &[data-badge]::after, &:not([data-badge])::after - background: $color - color: $color-invert - - &.is-badge-outlined - &[data-badge]::after - background-color: $white - box-shadow: none - border: $badge-border-size solid $primary - color: $primary - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-badge-#{$name} - &[data-badge]::after - background: $white - box-shadow: none - border: $badge-border-size solid $color - color: $color - - +badge-size($size-normal) - &.is-badge-small - +badge-size($size-small) - &.is-badge-medium - +badge-size($size-medium) - &.is-badge-large - +badge-size($size-large) diff --git a/django_simple_bulma/extensions/_bulma-calendar.sass b/django_simple_bulma/extensions/_bulma-calendar.sass deleted file mode 100644 index 71a88b6..0000000 --- a/django_simple_bulma/extensions/_bulma-calendar.sass +++ /dev/null @@ -1,352 +0,0 @@ -$calendar-border: .1rem solid $white-ter !default -$calendar-border-radius: $radius-small !default -$calendar-header-background-color: $primary !default -$calendar-days-background-color: transparent !default -$calendar-header-days-color: $grey-light !default -$calendar-date-color: $text !default -$calendar-date-hover-background-color: $white !default -$calendar-date-hover-border: .1rem solid $primary !default -$calendar-today-background: transparent !default -$calendar-today-border: .1rem dotted $primary !default -$calendar-today-color: $primary !default -$calendar-range-background-color: $primary !default -$calendar-body-padding: 0 !default -$calendar-header-padding: .3rem 0 !default -$calendar-header-nav-padding: .5em !default -$calendar-date-padding: .1rem 0 !default - -=calendar-header - .calendar-header - display: flex - flex: 1 - text-align: left - position: relative - padding: 0 .5rem - +mobile - font-size: .5rem - .calendar-selection-from, - .calendar-selection-to - font-size: $size-7 - color: $grey-light - text-transform: uppercase - .calendar-selection-start, - .calendar-selection-end - padding: .5rem - display: flex - flex: 1 - flex-direction: column - .calendar-selection-date - flex-direction: row - display: flex - .calendar-selection-day - flex: 0 - text-transform: capitalize - font-size: 3rem - margin-right: .5rem - color: #5d5d5e - +mobile - font-size: 2rem - .calendar-selection-details - justify-content: center - display: flex - flex-direction: column - .calendar-selection-month - color: $text - text-transform: capitalize - .calendar-selection-weekday - font-size: 12px - color: #b6b4b6 - text-transform: capitalize - text-align: left - .calendar-selection-end - &:before, - &::before - content: ">" - font: 2rem 'Consolas' - color: $white-ter - font-weight: 700 - position: absolute - left: 50% - top: 50% - transform: translateY(-50%) translateX(-50%) - .calendar-selection-to - padding-left: 1rem - .calendar-selection-date - justify-content: flex-end - -=calendar-nav - .calendar-nav - background: $calendar-header-background-color - color: $white - border-top-left-radius: $calendar-border-radius - border-top-right-radius: $calendar-border-radius - display: flex - align-items: center - justify-content: space-between - padding: $calendar-header-nav-padding - flex-direction: row - .calendar-nav-month-year - flex-direction: row - display: flex - .calendar-nav-month, - .calendar-nav-year - text-decoration: none - font-size: $size-6 - color: findColorInvert($primary) - &:hover - cursor: pointer - .calendar-nav-month - text-transform: capitalize - .calendar-nav-previous, .calendar-nav-next - flex-basis: auto - flex-grow: 0 - flex-shrink: 0 - text-decoration: none - color: $white - &:hover - background-color: transparent - svg - stroke-width: 1em - svg - stroke: currentColor - width: 11.25px - height: 18px - -=calendar-body - .calendar-body - .calendar-dates - display: none - &.is-active - display: flex - flex-direction: column - .calendar-months, - .calendar-years - display: none - &.is-active - display: flex - flex-direction: row - .calendar-weekdays - display: flex - flex-wrap: wrap - justify-content: space-around - padding: $calendar-header-padding - background: $calendar-days-background-color - color: findColorInvert($calendar-days-background-color) - font-size: $size-7 - .calendar-date - flex: 0 0 14.28% - max-width: 14.28% - background: $calendar-days-background-color !important - color: $calendar-header-days-color - padding: .3rem - .calendar-dates - .calendar-days - display: flex - flex-direction: row - flex-wrap: wrap - justify-content: space-around - padding: $calendar-body-padding - color: $grey - .calendar-date - flex: 0 0 14.28% - max-width: 14.28% - border: 0 - padding: $calendar-date-padding - background: $white-ter - .date-item - appearance: none - background: transparent - border: .1rem solid transparent - border-radius: 100% - color: $calendar-date-color - cursor: pointer - height: 2.2rem - line-height: 1.4rem - outline: none - padding: .3rem - position: relative - text-align: center - text-decoration: none - transition: all .2s ease - vertical-align: middle - white-space: nowrap - width: 2.2rem - &.is-today - background: $calendar-today-background - border: $calendar-today-border - color: $calendar-today-color - &:focus - background: $calendar-date-hover-background-color - border-color: $calendar-date-hover-background-color - color: findColorInvert( $calendar-date-hover-background-color ) - text-decoration: none - &.is-active - background: $primary - border-color: $primary - border-radius: 25091983px - color: findColorInvert( $primary ) - &:hover - background: $calendar-date-hover-background-color - border: $calendar-date-hover-border - color: findColorInvert( $calendar-date-hover-background-color ) - text-decoration: none - &.is-disabled, - &[disabled] - .date-item, - .calendar-event - cursor: default - opacity: .25 - pointer-events: none - &.is-current-month - background: transparent - &.calendar-range - position: relative - background: $calendar-range-background-color - &::before - background: $calendar-range-background-color - border: $calendar-date-hover-border - content: "" - height: 100% - width: 100%; - position: absolute - right: 0 - top: 50% - transform: translateY(-50%) - &.calendar-range-start, - &.calendar-range-end - border-radius: 25091983px - &.calendar-range-start::before - left: 50% - width: 50% - &.calendar-range-end::before - right: 50% - width: 50% - .date-item - background-color: $primary - color: findColorInvert($primary) - .calendar-months, - .calendar-years - display: none - flex-direction: row - flex-wrap: wrap - padding: .5rem - max-height: 17rem - overflow-y: auto - &.is-active - display: flex - .calendar-month, - .calendar-year - padding: .5rem - margin: .5rem - font-size: $size-6 - flex: calc(25% - 1rem) - text-transform: capitalize - border-radius: 25091983px - border: .1rem solid transparent - &.is-active - background: $primary - border-color: $primary - color: findColorInvert( $primary ) - &:hover - cursor: pointer - background: $calendar-date-hover-background-color - border: $calendar-date-hover-border - color: findColorInvert( $calendar-date-hover-background-color ) - -=calendar-footer - .calendar-footer - display: flex - flex: 1 - justify-content: space-evenly - margin-top: .5rem - > * - text-decoration: none !important - -=calendar - background: $white - border: $calendar-border - border-radius: $calendar-border-radius - display: block - width: 28rem - text-align: center - max-width: 95% - margin: auto - overflow: hidden - &.is-active - display: initial - +calendar-header - +calendar-nav - +calendar-body - +calendar-footer - - &.is-large - max-width: 100% - .calendar-body - .calendar-date - border-bottom: $calendar-border - border-right: $calendar-border - display: flex - flex-direction: column - height: 11rem - padding: 0 - &:nth-child(7n) - border-right: 0 - &:nth-last-child(-n+7) - border-bottom: 0 - .date-item - align-self: flex-end - height: 2.2rem - margin-right: .5rem - margin-top: .5rem - .calendar-range - &::before - top: 1.9rem - &.calendar-range-start::before - left: auto - width: 1.9rem - &.calendar-range-end::before - right: 1.9rem - .calendar-events - flex-grow: 1 - line-height: 1 - overflow-y: auto - padding: .5rem - .calendar-event - background-color: $grey - border-radius: $radius-small - color: $white - display: block - font-size: 1rem - margin: .2rem auto - overflow: hidden - padding: .3rem .4rem - text-align: left - text-overflow: ellipsis - vertical-align: baseline - white-space: nowrap - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-#{$name} - background-color: $color - color: $color-invert - -=datepicker - display: none - &.is-active - display: flex - .calendar - position: fixed - z-index: 40 - position: relative - margin: 0 auto - max-height: calc(100vh - 40px) - .calendar - +calendar - - -.calendar - +calendar - -.datepicker - +datepicker diff --git a/django_simple_bulma/extensions/_bulma-carousel.sass b/django_simple_bulma/extensions/_bulma-carousel.sass deleted file mode 100644 index 1f2a098..0000000 --- a/django_simple_bulma/extensions/_bulma-carousel.sass +++ /dev/null @@ -1,147 +0,0 @@ -$carousel-nav-background: rgba($white, 0.7) !default -$carousel-nav-color: $text !default -$carousel-title-background: rgba($white, 0.6) !default -$carousel-title-size: $size-7 !default -$carousel-border: none -$carousel-animation-speed: .5s -$carousel-animation-method: ease-in-out - -=carousel-item - display: block - position: relative - flex: 1 0 100% - &.has-background - .is-background - object-fit: cover - object-position: center center - height: 100% - width: 100% - .title - position: absolute - left: 0 - right: 0 - bottom: 0 - padding: 1.5em - margin: 0 - text-align: center - background: $carousel-title-background - font-size: $carousel-title-size - -=carousel-container - width: 100% - position: relative - border: $carousel-border - display: flex - margin: 0 - padding: 0 - left: -100% - transform: translateX(100%) - @content - -=carousel - position: relative - overflow: hidden - .carousel-container - +carousel-container - .carousel-item - +carousel-item - .carousel-navigation - +carousel-navigation - &.is-reversing - .carousel-container - transform: translateX(-100%) - -// Carousel Navigation (includes previous - next actions elements) -=carousel-navigation - display: flex - justify-content: space-around - width: 100% - pointer-events: none - .carousel-nav-left, - .carousel-nav-right - padding: 1em - pointer-events: auto - &.is-centered - justify-content: center - &.is-overlay - top: 50% - transform: perspective(1px) translateY(-50%) - bottom: auto - left: auto - right: auto - align-items: center - justify-content: space-between - z-index: 99 - .carousel-nav-left, - .carousel-nav-right - height: 2.2em - width: 2em - background: $carousel-nav-background - display: flex - justify-content: center - align-items: center - color: $carousel-nav-color - position: absolute - left: 0 - &:hover - cursor: pointer - .carousel-nav-right - left: auto - right: 0 - -// Sizes -.carousel - +carousel - &[data-size] - &:not(.carousel-animate-fade) - .carousel-container - .carousel-item - padding: 1em - -// Hero Carousel -=hero-carousel - display: flex - position: absolute - top: 0 - left: 0 - bottom: 0 - right: 0 - height: auto - border: none - margin: auto - padding: 0 - z-index: 0 - -.hero - &.has-carousel - position: relative - + .hero-body, - + .hero-head, - + .hero-footer - z-index: 1 - .hero-carousel - +hero-carousel - .carousel-container - height: auto !important - -.hero-carousel - +carousel - -// Animation -.carousel, -.hero-carousel - &.carousel-animate-slide - &.carousel-animated - .carousel-container - transform: none !important - transition: transform $carousel-animation-speed $carousel-animation-method - &.carousel-animate-fade - .carousel-item - position: absolute - width: 100% - height: 100% - transition: opacity $carousel-animation-speed $carousel-animation-method - &.is-active - opacity: 1 - &:not(.is-active) - opacity: 0 diff --git a/django_simple_bulma/extensions/_bulma-checkradio.sass b/django_simple_bulma/extensions/_bulma-checkradio.sass deleted file mode 100644 index ea4e23f..0000000 --- a/django_simple_bulma/extensions/_bulma-checkradio.sass +++ /dev/null @@ -1,338 +0,0 @@ -$checkbox-radius: $radius !default -$checkbox-border: .1rem solid $grey-lighter !default -$checkbox-block-background: $white-ter !default -$checkradio-focus: 1px dotted $grey-light !default -$checkradio-top-offset: 0rem !default - -=checkbox-size($size) - $newSize: $size * 1.5 - $height: $newSize / 2.5 - $width: $newSize / 4 - - + label - font-size: $size - // line-height: $newSize - padding-left: $size * 2 - &::before, - &:before - width: $newSize - height: $newSize - &::after, - &:after - width: $width - height: $height - top: ( ( $newSize / 2 ) - ( $height / 2 ) ) * 0.9 - left: $height - - &.is-block - + label - &::after, - &:after - top: ( ( ( $newSize / 2 ) - ( $height / 2 ) ) * 1.3 ) - left: $height * 1.3 - - &.is-rtl - + label - padding-left: 0 - padding-right: $size * 2 - &::after, - &:after - left: auto - right: $height - -// Use a mixin to define all ratios in the same spot -=radio-size($size) - $newSize: $size * 1.5 - $height: $newSize - $width: $newSize - - + label - font-size: $size - line-height: $newSize - padding-left: $size * 2 - &::before, - &:before, - &::after, - &:after - width: $width - height: $height - &.is-rtl - + label - padding-right: $size * 2 - -.is-checkradio[type="radio"], -.is-checkradio[type="checkbox"] - outline: 0 - user-select: none - display: inline-block - position: absolute - opacity: 0 - - + label - position: relative - display: initial - cursor: pointer - vertical-align: middle - margin: .5em - padding: .2rem .5rem .2rem 0 - border-radius: $checkbox-radius - - &:hover - &::before, - &:before - animation-duration: 0.4s - animation-fill-mode: both - animation-name: hover-color - - &::before, - &:before - position: absolute - left: 0 - top: $checkradio-top-offset - content: '' - border: $checkbox-border - - &::after, - &:after - position: absolute - display: none - content: '' - top: $checkradio-top-offset - - &.is-rtl - + label - margin-right: 0rem - margin-left: 0.5rem - &::before, - &:before - left: auto - right: 0 - - &:focus - + label - &::before, - &:before - outline: $checkradio-focus - - &:hover:not([disabled]) - + label - &::before, - &:before - border-color: $primary !important - - &:checked - + label - &::before, - &:before - border: $checkbox-border - &[disabled] - cursor: not-allowed - + label - opacity: 0.5 - + label - &::before, - &:before - animation-name: none - &::after, - &:after - display: inline-block - - &[disabled] - cursor: not-allowed - + label - opacity: 0.5 - cursor: not-allowed - &:hover, - &:before, - &::before, - &::after, - &:after - cursor: not-allowed - - &:hover - cursor: not-allowed - &::before, - &:before - animation-name: none - - &::before, - &:before - cursor: not-allowed - - &::after, - &:after - cursor: not-allowed - - &.has-no-border - + label - &::before, - &:before - border: none !important - - &.is-block - display: none !important - + label - width: 100% !important - background: $checkbox-block-background - color: findColorInvert( $checkbox-block-background ) - padding-right: .75em - &::before, - &:before - border: none !important - -.is-checkradio[type="checkbox"] - + label - &::before, - &:before - border-radius: $checkbox-radius - - &::after, - &:after - box-sizing: border-box - transform: rotate(45deg) - border-width: .1rem - border-style: solid - border-color: $primary - border-top: 0 - border-left: 0 - - &.is-circle - + label - &::before, - &:before - border-radius: 50% - - +checkbox-size($size-normal) - &.is-small - +checkbox-size($size-small) - &.is-medium - +checkbox-size($size-medium) - &.is-large - +checkbox-size($size-large) - - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-#{$name} - &.has-background-color - + label - &::before, - &:before - border-color: transparent !important - background-color: $color !important - &:hover:not([disabled]) - + label - &::before, - &:before - border-color: $color !important - &:checked - + label - &::after, - &:after - border-color: $color !important - &.has-background-color - + label - &::before, - &:before - border-color: transparent !important - background-color: $color !important - &::after, - &:after - border-color: $color-invert !important - background-color: $color !important - &.is-block - + label - color: $color-invert - border-color: $color !important - background: $color - &::after, - &:after - border-color: $color-invert !important - - &:indeterminate - + label - &::after, - &:after - display: inline-block - transform: rotate(90deg) - border-bottom: none - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-#{$name} - + label - &::after, - &:after - border-color: $color - -.is-checkradio[type="radio"] - + label - &::before, - &:before - border-radius: 50% - &::after, - &:after - border-radius: 50% - background: $primary - left: 0 - transform: scale(0.5) - - &:checked - &.has-background-color - + label - &::before, - &:before - border-color: $text !important - background-color: $text !important - &::after, - &:after - border-color: $text !important - background-color: $text !important - - &.is-rtl - + label - padding-left: 0 - &::after, - &:after - left: auto - right: 0 - - +radio-size($size-normal) - &.is-small - +radio-size($size-small) - &.is-medium - +radio-size($size-medium) - &.is-large - +radio-size($size-large) - - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-#{$name} - &.has-background-color - + label - &::before, - &:before - border-color: $color !important - background-color: $color !important - &:hover:not([disabled]) - + label - &::before, - &:before - border-color: $color !important - &:checked - + label - &::after, - &:after - border-color: $color !important - background-color: $color !important - &.has-background-color - + label - &::before, - &:before - border-color: $color !important - background-color: $color !important - &::after, - &:after - border-color: $color-invert !important - background-color: $color-invert !important diff --git a/django_simple_bulma/extensions/_bulma-divider.sass b/django_simple_bulma/extensions/_bulma-divider.sass deleted file mode 100644 index 7f5a2e0..0000000 --- a/django_simple_bulma/extensions/_bulma-divider.sass +++ /dev/null @@ -1,71 +0,0 @@ -$divider-background-color: $grey-lighter !default -$divider-thickness: .1rem !default -$divider-font-size: $size-7 !default -$divider-color: $grey-light !default - -.is-divider, .is-divider-vertical - display: block - position: relative - border-top: $divider-thickness solid $divider-background-color - height: $divider-thickness - margin: 2rem 0 - text-align: center - - -.is-divider[data-content]::after, .is-divider-vertical[data-content]::after - background: $white - color: $divider-color - content: attr(data-content) - display: inline-block - font-size: $divider-font-size - padding: .4rem .8rem - -webkit-transform: translateY(-1.1rem) - -ms-transform: translateY(-1.1rem) - transform: translateY(-1.1rem) - text-align: center - -.is-divider-vertical - +tablet - display: block - flex: none - width: auto - height: auto - padding: 2rem - margin: 0 - position: relative - border-top: none - min-height: 2rem - &::before - border-left: $divider-thickness solid $divider-background-color - bottom: 1rem - content: "" - display: block - left: 50% - position: absolute - top: 1rem - -webkit-transform: translateX(-50%) - -ms-transform: translateX(-50%) - transform: translateX(-50%) - &[data-content]::after - position: absolute - left: 50% - top: 50% - padding: .1rem - -webkit-transform: translateY(-50%) translateX(-50%) - -ms-transform: translateY(-50%) translateX(-50%) - transform: translateY(-50%) translateX(-50%) - -.is-divider, -.is-divider-vertical - @each $name, $pair in mergeColorMaps($colors, $shades) - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-#{$name} - border-top-color: $color - - &[data-content]::after, &[data-content]::after - background: $color-invert - color: $color - - &::before - border-left-color: $color diff --git a/django_simple_bulma/extensions/_bulma-iconpicker.sass b/django_simple_bulma/extensions/_bulma-iconpicker.sass deleted file mode 100644 index 8d6d2d5..0000000 --- a/django_simple_bulma/extensions/_bulma-iconpicker.sass +++ /dev/null @@ -1,57 +0,0 @@ -[data-action="iconPicker"] - width: 0 - height: 0 - display: block - opacity: 0 - top: -999px - position: absolute -.iconpicker-preview - border-radius: 100% - background-color: whitesmoke - &:hover - cursor: pointer - .iconpicker-icon-preview - color: $grey - font-size: 1.5em - -.iconpicker-modal - .modal-card - .modal-card-head - background: $primary - color: $white - border-top-left-radius: 0 - border-top-right-radius: 0 - padding: 1rem - .modal-card-title - font-size: 1.2em - color: $white - .iconpicker-search - background-color: rgba(255, 255, 255, 0.5) - border-radius: 2em - box-shadow: none - border: .1em solid rgba(255, 255, 255, 0.3) - margin: 0 2em - padding: .3em 1em - color: $grey - - .iconpicker-sets - flex-shrink: 0 - background-color: whitesmoke - font-size: .8em - margin: 0 - .modal-card-body - padding: 0 - .iconpicker-icons - display: flex - flex-direction: row - flex-wrap: wrap - justify-content: center - padding: 1em - [data-icon] - display: block - width: 48px - height: 48px - text-align: center - padding: .5rem - .iconpicker-icon-preview - font-size: 1.4em diff --git a/django_simple_bulma/extensions/_bulma-pageloader.sass b/django_simple_bulma/extensions/_bulma-pageloader.sass deleted file mode 100644 index fb99420..0000000 --- a/django_simple_bulma/extensions/_bulma-pageloader.sass +++ /dev/null @@ -1,124 +0,0 @@ -$pageloader-opacity: 1 !default - -// keyframes mixin -=keyframes($name) - @-webkit-keyframes #{$name} - @content - @-moz-keyframes #{$name} - @content - @-o-keyframes #{$name} - @content - @keyframes #{$name} - @content - -.pageloader - +overlay - position: fixed - padding-top: 2em - background: $primary - background: rgba( $primary, $pageloader-opacity ) - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-#{$name} - background-color: $color - background: rgba( $color, $pageloader-opacity ) - &::after - border-color: $color-invert - -webkit-animation: loader-figure-#{$name} 1.15s infinite cubic-bezier(0.215, 0.61, 0.355, 1) - -moz-animation: loader-figure-#{$name} 1.15s infinite cubic-bezier(0.215, 0.61, 0.355, 1) - animation: loader-figure-#{$name} 1.15s infinite cubic-bezier(0.215, 0.61, 0.355, 1) - .title - color: $color-invert - z-index: 999998 - transition: transform .35s ease-out,-webkit-transform .35s ease-out - will-change: transform - &:not(.is-left-to-right), - &:not(.is-right-to-left) - -webkit-transform: translateY(-100%) - transform: translateY(-100%) - &.is-left-to-right - -webkit-transform: translateX(-100%) - transform: translateX(-100%) - &.is-right-to-left - -webkit-transform: translateX(100%) - transform: translateX(100%) - &.is-active - &:not(.is-left-to-right), - &:not(.is-right-to-left) - -webkit-transform: translateY(0) - transform: translateY(0) - &.is-left-to-right, - &.is-right-to-left - -webkit-transform: translateX(0) - transform: translateX(0) - &::after - position: absolute - top: 50% - left: 50% - display: block - border-radius: 100% - content: '' - z-index: 9999 - -webkit-transform: translate(-50%, -50%) - transform: translate(-50%, -50%) - width: 0 - height: 0 - box-sizing: border-box - border: 0 solid $white - -webkit-animation: loader-figure 1.15s infinite cubic-bezier(0.215, 0.61, 0.355, 1) - animation: loader-figure 1.15s infinite cubic-bezier(0.215, 0.61, 0.355, 1) - .title - position: absolute - top: 50% - left: 50% - -webkit-transform: translateX(-50%) - transform: translateX(-50%) - margin: 2em 0 0 0 - font-size: 0.875em - letter-spacing: 0.1em - line-height: 1.5em - color: $white - white-space: nowrap - +keyframes(loader-figure) - 0% - height: 0 - width: 0 - background-color: $white - 29% - background-color: $white - 30% - height: 2em - width: 2em - background-color: transparent - border-width: 1em - opacity: 1 - 100% - height: 2em - width: 2em - border-width: 0 - opacity: 0 - background-color: transparent - -@each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - +keyframes(loader-figure-#{$name}) - 0% - height: 0 - width: 0 - background-color: $color-invert - 29% - background-color: $color-invert - 30% - height: 2em - width: 2em - background-color: transparent - border-width: 1em - opacity: 1 - 100% - height: 2em - width: 2em - border-width: 0 - opacity: 0 - background-color: transparent diff --git a/django_simple_bulma/extensions/_bulma-pricingtable.sass b/django_simple_bulma/extensions/_bulma-pricingtable.sass deleted file mode 100644 index cd17991..0000000 --- a/django_simple_bulma/extensions/_bulma-pricingtable.sass +++ /dev/null @@ -1,209 +0,0 @@ -$pricing-plan-border: .1rem solid $white-ter !default -$pricing-plan-border-radius: $radius !default -$pricing-plan-active-shadow: 0 8px 12px 0 rgba($grey, 0.2) !default -$pricing-plan-active-transform: scale(1.05) !default -$pricing-header-background: $white !default -$pricing-item-background: $white-ter !default -$pricing-item-border: .1rem solid $white !default -$pricing-item-color: $grey !default -$pricing-price-background: white !default - -.pricing-table - display: flex - align-items: stretch - flex-direction: row - flex-flow: row wrap - justify-content: space-between - - &.is-comparative - .pricing-plan - border-radius: initial - margin: 0 - &:not(:last-child) - border-right: none - &:first-child - border-top-left-radius: $pricing-plan-border-radius - border-bottom-left-radius: $pricing-plan-border-radius - &:last-child - border-top-right-radius: $pricing-plan-border-radius - border-bottom-right-radius: $pricing-plan-border-radius - &.is-active - border: $pricing-plan-border - border-radius: $pricing-plan-border-radius - - .pricing-plan - display: flex - flex-direction: column - flex: 1 1 auto - background-color: $white - border: $pricing-plan-border - border-radius: $pricing-plan-border-radius - list-style-type: none - transition: 0.25s - margin: .5em - - .plan-header - border-top-left-radius: $pricing-plan-border-radius - border-top-right-radius: $pricing-plan-border-radius - background-color: $pricing-header-background - color: $text - font-size: $size-medium - font-weight: $weight-semibold - padding: .75em - align-content: center - text-align: center - - .plan-item - background: $pricing-item-background - border-bottom: $pricing-item-border - padding: .75em - align-content: center - text-align: center - font-size: .9em - color: $pricing-item-color - - .plan-price - background-color: $pricing-price-background - color: $text - font-size: $size-small - font-weight: $weight-normal - padding: .75em - align-content: center - text-align: center - - .plan-price-amount - font-size: $size-2 - font-weight: $weight-bold - - .plan-price-currency - vertical-align: super - font-size: $size-normal !important - font-weight: $weight-normal !important - color: $text - margin-right: .25rem - - .plan-footer - border-bottom-left-radius: $pricing-plan-border-radius - border-bottom-right-radius: $pricing-plan-border-radius - padding: .75em - align-content: center - text-align: center - margin-top: auto - - &.is-active - box-shadow: $pricing-plan-active-shadow - transform: $pricing-plan-active-transform - .plan-price - .plan-price-amount - color: $primary - .plan-footer - .button - background-color: $primary - border-color: transparent - color: findColorInvert( $primary ) - &:hover, - &.is-hovered - background-color: darken($primary, 2.5%) - border-color: transparent - color: findColorInvert( $primary ) - &:focus, - &.is-focused - border-color: transparent - box-shadow: 0 0 0.5em rgba($primary, 0.25) - color: findColorInvert( $primary ) - &:active, - &.is-active - background-color: darken($primary, 5%) - border-color: transparent - color: findColorInvert( $primary ) - &[disabled] - background-color: $primary - border-color: transparent - - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-#{$name} - .plan-price - .plan-price-amount - color: $color - .plan-footer - .button - background-color: $color - border-color: transparent - color: $color-invert - &:hover, - &.is-hovered - background-color: darken($color, 2.5%) - border-color: transparent - color: $color-invert - &:focus, - &.is-focused - border-color: transparent - box-shadow: 0 0 0.5em rgba($color, 0.25) - color: $color-invert - &:active, - &.is-active - background-color: darken($color, 5%) - border-color: transparent - color: $color-invert - &[disabled] - background-color: $color - border-color: transparent - box-shadow: none - -+tablet - .pricing-table - &.is-comparative - margin: .5rem - &.is-features - display: none - .plan-item - &::before - content: attr( 'data-feature' ) - - &.is-horizontal - .pricing-plan - display: flex - flex-direction: row - flex-basis: 100% - .plan-header - width: 50% - display: flex - flex-direction: column - justify-content: center - .plan-price - width: 100% - display: flex - flex-direction: row - justify-content: center - .plan-items - width: 100% - background-color: $pricing-item-background - columns: 2 - -webkit-columns: 2 - -moz-columns: 2 - column-gap: .1rem - .plan-footer - width: 50% - display: flex - flex-direction: column - justify-content: center - margin: auto - -+mobile - .pricing-table - &.is-comparative - .pricing-plan - &.is-plan-first-mobile - order: -1 - &.is-features - display: none - margin: .5rem - .plan-item - &::before - content: attr(data-feature) - display: block - font-weight: $weight-semibold - font-size: $size-small - color: $grey-light diff --git a/django_simple_bulma/extensions/_bulma-quickview.sass b/django_simple_bulma/extensions/_bulma-quickview.sass deleted file mode 100644 index 302723f..0000000 --- a/django_simple_bulma/extensions/_bulma-quickview.sass +++ /dev/null @@ -1,90 +0,0 @@ -$quickview-z: 35 !default -$quickview-header-height: 3.25em !default -$quickview-footer-height: 4rem !default -$quickview-shadow: 5px 0px 13px 3px rgba( 0, 0, 0, 0.1 ) !default -$quickview-divider: 1px solid $grey-lighter !default - -.quickview - display: flex - flex-direction: column - background-color: $white - max-width: calc( 100% - 50px ) - &.is-marginless - max-width: 100% - position: fixed - top: 0 - bottom: 0 - z-index: $quickview-z - transform: translateZ( 0 ) - transition: .3s ease - backface-visibility: hidden - perspective: 1000 - will-change: transform - +mobile - width: 100% - right: -100% - +tablet - width: 50% - right: -50% - +desktop - width: 35% - right: -35% - +widescreen - width: 30% - right: -30% - +fullhd - width: 25% - right: -25% - &.is-left - +mobile - left: -100% - +tablet - left: -50% - +desktop - left: -35% - +widescreen - left: -30% - +fullhd - left: -25% - &.is-active - right: 0 - box-shadow: $quickview-shadow - &.is-left - left: 0 - -.quickview-header - display: flex - justify-content: space-between - align-items: center - padding: 0 1rem - min-height: $quickview-header-height !important - border-bottom: $quickview-divider - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-#{$name} - background-color: $color - .title - color: $color-invert - .title - font-size: $size-6 - font-weight: $weight-light - margin-bottom: 0 - img - max-height: 2em - -.quickview-body - -webkit-box-flex: 1 - flex: 1 1 0% - overflow-y: auto - -.quickview-footer - display: flex - justify-content: space-between - align-items: center - padding: 0 1rem - min-height: $quickview-footer-height - background-color: $white-ter - border-top: $quickview-divider - > * - margin: 0 .4rem diff --git a/django_simple_bulma/extensions/_bulma-ribbon.sass b/django_simple_bulma/extensions/_bulma-ribbon.sass deleted file mode 100644 index e2dacc0..0000000 --- a/django_simple_bulma/extensions/_bulma-ribbon.sass +++ /dev/null @@ -1,66 +0,0 @@ -$ribbon-color: $grey-darker !default -$ribbon-background-color: $white !default -$ribbon-border: .1rem solid $grey-lighter !default - -// The ribbon sizes use mixins so they can be used at different breakpoints -=ribbon-small - font-size: $size-small -=ribbon-medium - font-size: $size-medium -=ribbon-large - font-size: $size-large - -.has-ribbon - position: relative - -.has-ribbon-left - position: relative - .ribbon - right: auto - left: 0 - border-left: none - border-right: $ribbon-border - -.has-ribbon-bottom - position: relative - .ribbon - top: auto - bottom: .5em - -.ribbon - background-color: $ribbon-background-color - border: $ribbon-border - border-right: none - color: $ribbon-color - font-size: $size-normal - justify-content: center - padding-left: 0.75em - padding-right: 0.75em - text-align: center - white-space: nowrap - position: absolute - top: .5em - right: 0 - font-weight: 400 - z-index: 2 - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-#{$name}:not(.is-outlined) - background-color: $color - border-color: transparent - color: $color-invert !important - &.is-#{$name} - &.is-outlined - background-color: transparent - border-color: $color - - // Sizes - &.is-small - +ribbon-small - &.is-medium - +ribbon-medium - &.is-large - +ribbon-large - &.is-outlined - background-color: transparent diff --git a/django_simple_bulma/extensions/_bulma-slider.sass b/django_simple_bulma/extensions/_bulma-slider.sass deleted file mode 100644 index bac064d..0000000 --- a/django_simple_bulma/extensions/_bulma-slider.sass +++ /dev/null @@ -1,231 +0,0 @@ -$slider-radius: $radius !default -$slider-track-background: $grey-lighter !default -$slider-track-radius: $radius !default -$slider-track-border: 0px solid $grey !default -$slider-track-shadow: 0px 0px 0px $grey !default -$slider-thumb-background: $white !default -$slider-thumb-radius: $radius !default -$slider-thumb-border: 1px solid $grey-light !default -$slider-thumb-shadow: none !default -$slider-output-width: 3rem !default -$slider-output-background: $grey-dark !default -$slider-output-radius: $radius !default - -=slider-size($size) - $track-height: $size / 2 - $thumb-size: $size - - &:not([orient="vertical"]) - &::-webkit-slider-runnable-track - height: $track-height - &::-moz-range-track - height: $track-height - &::-ms-track - height: $track-height - - &[orient="vertical"] - &::-webkit-slider-runnable-track - width: $track-height - &::-moz-range-track - width: $track-height - &::-ms-track - width: $track-height - - &::-webkit-slider-thumb - height: $thumb-size - width: $thumb-size - margin-top: -( $thumb-size / 4 ) - &::-moz-range-thumb - height: $thumb-size - width: $thumb-size - &::-ms-thumb - height: $thumb-size - width: $thumb-size - - &[orient="vertical"] - &::-webkit-slider-thumb - margin-top: auto - margin-left: -( $thumb-size / 4 ) - -input[type=range] - &.slider - -webkit-appearance: none - appearance: none - margin: 1rem 0 - background: transparent - - &.is-fullwidth - display: block - width: 100% - - &:focus - outline: none - - &:not([orient="vertical"]) - &::-webkit-slider-runnable-track - width: 100% - &::-moz-range-track - width: 100% - &::-ms-track - width: 100% - - &.has-output, - &.has-output-tooltip - + output - width: $slider-output-width - background: $slider-output-background - border-radius: $slider-output-radius - padding: .4rem .8rem - font-size: $size-7 - line-height: $size-7 - text-align: center - text-overflow: ellipsis - white-space: nowrap - color: $white - overflow: hidden - pointer-events: none - z-index: 200 - - &.has-output - display: inline-block - width: calc(100% - ( #{$slider-output-width + 1.2rem } )) - + output - display: inline-block - position: relative - margin-left: .75rem - top: -.75rem - - &.has-output-tooltip - display: block - + output - position: absolute - left: 0 - top: -.1rem - - &[orient="vertical"] - -webkit-appearance: slider-vertical - writing-mode: bt-lr - &::-webkit-slider-runnable-track - height: 100% - &::-moz-range-track - height: 100% - &::-ms-track - height: 100% - - &::-webkit-slider-runnable-track - cursor: pointer - animate: 0.2s - box-shadow: $slider-track-shadow - background: $slider-track-background - border-radius: $slider-track-radius - border: $slider-track-border - &::-moz-range-track - cursor: pointer - animate: 0.2s - box-shadow: $slider-track-shadow - background: $slider-track-background - border-radius: $slider-track-radius - border: $slider-track-border - &::-ms-track - cursor: pointer - animate: 0.2s - box-shadow: $slider-track-shadow - background: $slider-track-background - border-radius: $slider-track-radius - border: $slider-track-border - &::-ms-fill-lower - background: $primary - &::-ms-fill-upper - background: $grey-lighter - - &::-webkit-slider-thumb - box-shadow: $slider-thumb-shadow - border: $slider-thumb-border - border-radius: $slider-thumb-radius - background: $slider-thumb-background - cursor: pointer - -webkit-appearance: none - transition: transform .2s ease, -webkit-transform .2s ease - transition: transform .2s ease - transition: -webkit-transform .2s ease - &::-moz-range-thumb - box-shadow: $slider-thumb-shadow - border: $slider-thumb-border - background: $slider-thumb-background - border-radius: $slider-thumb-radius - cursor: pointer - transition: transform .2s ease, -webkit-transform .2s ease - transition: transform .2s ease - transition: -webkit-transform .2s ease - &::-ms-thumb - box-shadow: $slider-thumb-shadow - border: $slider-thumb-border - background: $slider-thumb-background - border-radius: $slider-thumb-radius - cursor: pointer - transition: transform .2s ease, -webkit-transform .2s ease - transition: transform .2s ease - transition: -webkit-transform .2s ease - - &::-webkit-slider-thumb - -webkit-appearance: none - - &.is-circle - &::-webkit-slider-thumb - border-radius: 50% - &::-moz-range-thumb - border-radius: 50% - &::-ms-thumb - border-radius: 50% - - &:active - &::-webkit-slider-thumb - -webkit-transform: scale(1.25) - transform: scale(1.25) - &::-moz-range-thumb - transform: scale(1.25) - &::-ms-thumb - -ms-transform: scale(1.25) - transform: scale(1.25) - - &:disabled - opacity: 0.5 - cursor: not-allowed - &::-webkit-slider-thumb - cursor: not-allowed - -webkit-transform: scale(1) - transform: scale(1) - &::-moz-range-thumb - cursor: not-allowed - transform: scale(1) - &::-ms-thumb - cursor: not-allowed - -ms-transform: scale(1) - transform: scale(1) - - +slider-size($size-normal) - &.is-small - +slider-size($size-small) - &.is-medium - +slider-size($size-medium) - &.is-large - +slider-size($size-large) - - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-#{$name} - &::-moz-range-track - background: $color - &::-webkit-slider-runnable-track - background: $color - &::-ms-track - background: $color !important - &::-ms-fill-lower - background: $color - - &.has-output, - .has-output-tooltip - + output - background-color: $color - color: $color-invert diff --git a/django_simple_bulma/extensions/_bulma-steps.sass b/django_simple_bulma/extensions/_bulma-steps.sass deleted file mode 100644 index bf69fc0..0000000 --- a/django_simple_bulma/extensions/_bulma-steps.sass +++ /dev/null @@ -1,149 +0,0 @@ -$steps-maker-default-color: $grey-light !default -$steps-marker-default-border: .2em solid #fff !default -$steps-default-color: $grey-lighter !default -$steps-completed-color: $primary !default -$steps-active-color: $primary !default -$steps-divider-height: .2em !default - -=steps-size($size) - font-size: $size - min-height: $size * 2 - - .step-item - &:not(:first-child)::before - height: $steps-divider-height - width: 100% - bottom: 0 - left: -50% - top: #{$size} - .step-marker - height: $size * 2 - width: $size * 2 - position: absolute - left: calc(50% - #{$size}) - .icon - * - font-size: $size - .step-details - margin-top: $size * 2 - margin-left: .5em - margin-right: .5em - padding-top: .2em - .step-title - font-size: $size * 1.2 - font-weight: $weight-semibold - - -.steps - +block - display: flex - flex-wrap: wrap - - .step-item - margin-top: 0 - position: relative - flex-grow: 1 - flex-basis: 0 - &:not(:first-child) - flex-basis: 1em - flex-grow: 1 - flex-shrink: 1 - &::before - // This will contain the horizontal or vertical divider - content: " " - display: block - position: absolute - - &::before - background: linear-gradient(to left, $steps-default-color 50%, $steps-active-color 50%) - background-size: 200% 100% - background-position: right bottom - .step-marker - color: $white - &.is-active - &::before - background-position: left bottom - .step-marker - background-color: $white - border-color: $steps-active-color - color: $steps-active-color - &.is-completed - &::before - background-position: left bottom - .step-marker - color: $white - background-color: $steps-completed-color - - .step-marker - align-items: center - display: flex - border-radius: 50% - font-weight: $weight-bold - justify-content: center - background: $steps-maker-default-color - color: $white - border: $steps-marker-default-border - z-index: 1 - - .step-details - text-align: center - - // Override marker color per step - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-#{$name} - &::before - background: linear-gradient(to left, $steps-default-color 50%, $color 50%) - background-size: 200% 100% - background-position: right bottom - &.is-active - &::before - background-position: left bottom - .step-marker - background-color: $white - border-color: $color - color: $color - &.is-completed - &::before - background-position: left bottom - .step-marker - color: $color-invert - background-color: $color - - .steps-content - align-items: stretch - flex-basis: 100% - margin: 2rem 0 - .step-content - display: none - &.is-active - display: block - - .steps-actions - display: flex - align-items: stretch - flex-basis: 100% - .steps-action - display: flex - flex-basis: 0 - flex-grow: 1 - margin: .5rem - justify-content: center - align-items: center - - &.is-animated - .step-item - &::before - transition: all 2s ease - .step-marker - transition: all 0s ease - transition-delay: 1.5s - - +steps-size($size-normal) - &.is-small - +steps-size($size-small) - &.is-medium - +steps-size($size-medium) - &.is-large - +steps-size($size-large) diff --git a/django_simple_bulma/extensions/_bulma-switch.sass b/django_simple_bulma/extensions/_bulma-switch.sass deleted file mode 100644 index d836edb..0000000 --- a/django_simple_bulma/extensions/_bulma-switch.sass +++ /dev/null @@ -1,194 +0,0 @@ -$switch-background: $grey-light !default -$switch-border: .1rem solid transparent !default -$switch-background-active: $primary !default -$switch-radius: $radius !default -$switch-paddle-background: $white !default -$switch-paddle-background-active: $primary !default -$switch-paddle-offset: 0.25rem !default -$switch-paddle-transition: all 0.25s ease-out !default -$switch-focus: 1px dotted $grey-light !default - -=switch-size($size) - $switch-height: $size * 1.5 - $switch-width: $switch-height * 2 - $paddle-height: $switch-height - ($switch-paddle-offset * 2) - $paddle-width: $switch-height - ($switch-paddle-offset * 2) - $paddle-active-offest: $switch-width - $paddle-width - ($switch-paddle-offset * 1.5) - - + label - position: relative - display: initial - font-size: $size - line-height: initial - padding-left: $switch-width + .5 - padding-top: .2rem - cursor: pointer - - &::before, - &:before - position: absolute - display: block - top: 0 - left: 0 - width: $switch-width - height: $switch-height - border: $switch-border - border-radius: $switch-radius - background: $switch-background - content: '' - - &::after, - &:after - display: block - position: absolute - top: ( $switch-height / 2 ) - ( $paddle-height / 2 ) - left: $switch-paddle-offset - width: $paddle-width - height: $paddle-height - transform: translate3d(0, 0, 0) - border-radius: $switch-radius - background: $switch-paddle-background - transition: $switch-paddle-transition - content: '' - - &.is-rtl - + label - padding-left: 0 - padding-right: $switch-width + .5 - &::before, - &:before - left: auto - right: 0 - &::after, - &:after - left: auto - right: $switch-paddle-offset - - &:checked - + label - &::before, - &:before - background: $switch-background-active - &::after - left: $paddle-active-offest - &.is-rtl - + label - &::after, - &:after - left: auto - right: $paddle-active-offest - - &.is-outlined - + label - &::before, - &:before - background-color: transparent - border-color: $switch-background - &::after, - &:after - background: $switch-background - &:checked - + label - &::before, - &:before - background-color: transparent - border-color: $switch-background-active - &::after, - &:after - background: $switch-paddle-background-active - - &.is-thin - + label - &::before, - &:before - top: $switch-height / 2.75 - height: $switch-height / 4 - &::after, - &:after - box-shadow: 0px 0px 3px $grey - - &.is-rounded - + label - &::before, - &:before - border-radius: $radius-large * 4 - &::after, - &:after - border-radius: 50% - - -.switch[type="checkbox"] - outline: 0 - user-select: none - display: inline-block - position: absolute - opacity: 0 - - &:focus - + label - &::before, - &:before, - &::after, - &:after - outline: $switch-focus - - &[disabled] - cursor: not-allowed - + label - opacity: 0.5 - &::before, - &:before - opacity: 0.5 - &::after, - &:after - opacity: 0.5 - &:hover - cursor: not-allowed - - +switch-size($size-normal) - &.is-small - +switch-size($size-small) - &.is-medium - +switch-size($size-medium) - &.is-large - +switch-size($size-large) - - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-#{$name} - &:checked - + label - &::before, - &:before - background: $color - &.is-outlined - &:checked - + label - &::before, - &:before - background-color: transparent - border-color: $color !important - &::after, - &:after - background: $color - &.is-thin - &.is-outlined - + label - &::after, - &:after - box-shadow: none - &.is-unchecked-#{$name} - + label - &::before, - &:before - background: $color - &.is-outlined - + label - &::before, - &:before - background-color: transparent - border-color: $color !important - &::after, - &:after - background: $color diff --git a/django_simple_bulma/extensions/_bulma-tagsinput.sass b/django_simple_bulma/extensions/_bulma-tagsinput.sass deleted file mode 100644 index 83c4825..0000000 --- a/django_simple_bulma/extensions/_bulma-tagsinput.sass +++ /dev/null @@ -1,13 +0,0 @@ -.tagsinput - height: auto !important - .control - margin-bottom: .1em !important - margin-top: .1em !important - input - border: none - margin-bottom: .1em !important - margin-top: .1em !important - .tag - &.is-active - background-color: $primary - color: findColorInvert($primary) diff --git a/django_simple_bulma/extensions/_bulma-timeline.sass b/django_simple_bulma/extensions/_bulma-timeline.sass deleted file mode 100644 index b6afbf4..0000000 --- a/django_simple_bulma/extensions/_bulma-timeline.sass +++ /dev/null @@ -1,209 +0,0 @@ -$timeline-marker-size: .8em !default -$timeline-marker-color: $grey-lighter !default -$timeline-marker-icon-size: 1.5em !default -$timeline-marker-border-size: .1em !default -$timeline-marker-border: $timeline-marker-border-size solid $timeline-marker-color !default -$timeline-line-color: $grey-lighter !default -$timeline-line-width: .1em !default -$timeline-line-style: solid !default -$timeline-line: $timeline-line-width $timeline-line-style $timeline-line-color !default -$timeline-content-padding: 1em 0 0 2em !default -$timeline-rtl-content-padding: 1em 2em 0 0 !default -$timeline-icon-size: $size-small !default -$timeline-header-width: 4em !default -$timeline-item-padding-left: $timeline-header-width / 2 !default -$timeline-item-padding-bottom: 2em !default -$dimensions: 16 24 32 48 64 96 128 !default - -.timeline - display: flex - flex-direction: column - .timeline-header - width: $timeline-header-width - min-width: $timeline-header-width - max-width: $timeline-header-width * 2 - word-wrap: normal - text-align: center - display: flex - justify-content: center - .timeline-item - display: flex - display: -ms-flexbox - display: -webkit-flex - position: relative - margin-left: $timeline-item-padding-left - padding-bottom: $timeline-item-padding-bottom - &::before - content: "" - background-color: $timeline-line-color - display: block - width: $timeline-line-width - height: 100% - position: absolute - left: 0 - top: 0 - - .timeline-marker - position: absolute - background: $timeline-marker-color - border: $timeline-marker-border - border-radius: 100% - content: "" - display: block - height: $timeline-marker-size - left: -(($timeline-marker-size / 2) - $timeline-marker-border-size / 2) - top: 1.2rem - width: $timeline-marker-size - &.is-image - @each $dimension in $dimensions - &.is-#{$dimension}x#{$dimension} - height: $dimension * 1px - width: $dimension * 1px - left: ( $dimension / 2 ) * -1px - background: $timeline-marker-color - border: $timeline-marker-border - border-radius: 100% - display: block - overflow: hidden - &.is-icon - display: flex - align-items: center - justify-content: center - height: $timeline-marker-icon-size - width: $timeline-marker-icon-size - left: -(($timeline-marker-icon-size / 2) - $timeline-marker-border-size / 2) - line-height: .75rem - padding: $timeline-icon-size / 3 - background: $timeline-marker-color - border: $timeline-marker-border - border-radius: 100% - > i - color: $white - font-size: $timeline-icon-size !important - &.is-outlined - .image - background: $white - &.is-icon - background: $white - > i - color: $timeline-marker-color - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-#{$name} - background-color: $color !important - border-color: $color !important - .image - border-color: $color !important - - &.is-icon - background-color: $color !important - border-color: $color !important - > i - color: $color-invert !important - &.is-outlined - background-color: $white !important - border-color: $color !important - .image - background-color: $white !important - &.is-icon - background-color: $white !important - > i - color: $color !important - .timeline-content - padding: 1em 0 0 .5em - padding: $timeline-content-padding - .heading - font-weight: $weight-semibold - - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-#{$name} - &::before - background-color: $color - - &.is-centered - .timeline-header - display: flex - width: 100% - align-self: center - .timeline-item - width: 50% - align-self: flex-end - &:nth-of-type(2n) - align-self: flex-start - margin-left: 0 - margin-right: $timeline-header-width / 2 - &::before - right: -$timeline-line-width - left: auto - .timeline-marker - left: auto - right: -(($timeline-marker-size / 2) - $timeline-marker-border-size / 2) - $timeline-line-width - &.is-image - @each $dimension in $dimensions - &.is-#{$dimension}x#{$dimension} - left: auto - right: ( $dimension / 2 ) * -1px - &.is-icon - left: auto - right: -(($timeline-marker-icon-size / 2) - $timeline-marker-border-size / 2) - $timeline-line-width - .timeline-content - padding: $timeline-rtl-content-padding - text-align: right - display: flex - flex-direction: column - align-items: flex-end - flex-basis: 100% - &:nth-of-type(2n+1) - &::before - content: "" - background-color: $timeline-line-color - display: block - width: $timeline-line-width - height: 100% - position: absolute - top: 0 - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-#{$name} - &::before - background-color: $color - - &.is-rtl - justify-content: flex-end - align-items: flex-end - .timeline-item - justify-content: flex-end - border-left: none - &::before - right: 0 - left: auto - margin-left: 0 - margin-right: $timeline-header-width / 2 - .timeline-marker - left: auto - right: -(($timeline-marker-size / 2) - $timeline-marker-border-size / 2) - &.is-image - @each $dimension in $dimensions - &.is-#{$dimension}x#{$dimension} - left: auto - right: ( $dimension / 2 ) * -1px - &.is-icon - left: auto - right: -(($timeline-marker-icon-size / 2) - $timeline-marker-border-size / 2) - .timeline-content - padding: $timeline-rtl-content-padding - text-align: right - - &.no-headers - .timeline-item - &.is-first - &::before - height: calc(100% - 1.2rem) - top: 1.2rem - &.is-last - &::before - height: 1.2rem diff --git a/django_simple_bulma/extensions/_bulma-tooltip.sass b/django_simple_bulma/extensions/_bulma-tooltip.sass deleted file mode 100644 index efda3bf..0000000 --- a/django_simple_bulma/extensions/_bulma-tooltip.sass +++ /dev/null @@ -1,93 +0,0 @@ -@import 'position' - -$tooltip-background-color: $grey-dark !default -$tooltip-background-opacity: 0.9 !default -$tooltip-max-width: 24rem !default - -.tooltip - position: relative - &:hover, - &.is-tooltip-active - &:not(.is-loading) - &::after - z-index: 99999 - position: absolute - display: inline-block - pointer-events: none - &::before - z-index: 99999 - position: absolute - display: inline-block - pointer-events: none - &:not(.is-loading) - &::after - content: "" - border-style: solid - border-width: .5rem - &::before - opacity: 0 - content: attr(data-tooltip) - overflow: hidden - white-space: nowrap - text-overflow: ellipsis - font-size: $size-7 - padding: .4rem .8rem - background: rgba($tooltip-background-color, $tooltip-background-opacity) - border-radius: $radius - color: $white - max-width: $tooltip-max-width - - &:focus, - &:hover, - &.is-tooltip-active - &:not(.is-loading) - &::after - opacity: 1 - margin-left: -.5rem - margin-top: -.5rem - - &::before - opacity: 1 - - +top - - &.is-tooltip-right - +right - - &.is-tooltip-bottom - +bottom - - &.is-tooltip-left - +left - - &.is-tooltip-multiline - &::before - min-width: $tooltip-max-width - text-overflow: clip - white-space: normal - word-break: keep-all - - @each $name, $pair in $colors - $color: nth($pair, 1) - $color-invert: nth($pair, 2) - &.is-tooltip-#{$name} - &:not(.is-loading) - &::after - border-color: rgba($color, $tooltip-background-opacity) transparent transparent transparent - &.is-tooltip-right - &:not(.is-loading) - &::after - border-color: transparent rgba($color, $tooltip-background-opacity) transparent transparent - &.is-tooltip-bottom - &:not(.is-loading) - &::after - border-color: transparent transparent rgba($color, $tooltip-background-opacity) transparent - &.is-tooltip-left - &:not(.is-loading) - &::after - border-color: transparent transparent transparent rgba($color, $tooltip-background-opacity) - &::before - background: rgba($color, $tooltip-background-opacity) - color: $color-invert - -@import 'dispatcher' \ No newline at end of file diff --git a/django_simple_bulma/extensions/_dispatcher.sass b/django_simple_bulma/extensions/_dispatcher.sass deleted file mode 100644 index c9d815a..0000000 --- a/django_simple_bulma/extensions/_dispatcher.sass +++ /dev/null @@ -1,28 +0,0 @@ -@each $direction in top, right, bottom, left - +mobile - .is-tooltip-#{$direction}-mobile - @include direction(#{$direction}) - +tablet - .is-tooltip-#{$direction}-tablet - @include direction(#{$direction}) - +tablet-only - .is-tooltip-#{$direction}-tablet-only - @include direction(#{$direction}) - +touch - .is-tooltip-#{$direction}-touch - @include direction(#{$direction}) - +desktop - .is-tooltip-#{$direction}-desktop - @include direction(#{$direction}) - +desktop-only - .is-tooltip-#{$direction}-desktop-only - @include direction(#{$direction}) - +widescreen - .is-tooltip-#{$direction}-widescreen - @include direction(#{$direction}) - +widescreen-only - .is-tooltip-#{$direction}-widescreen-only - @include direction(#{$direction}) - +fullhd - .is-tooltip-#{$direction}-fullhd - @include direction(#{$direction}) diff --git a/django_simple_bulma/extensions/_position.sass b/django_simple_bulma/extensions/_position.sass deleted file mode 100644 index 073f204..0000000 --- a/django_simple_bulma/extensions/_position.sass +++ /dev/null @@ -1,90 +0,0 @@ -=top($important: null) - &::before - - top: auto $important - bottom: 100% $important - left: 50% $important - right: auto $important - &:focus, - &:hover, - &.is-tooltip-active - &:not(.is-loading) - &::after - top: 0 $important - bottom: auto $important - left: 50% $important - right: auto $important - border-color: rgba($tooltip-background-color, 0.9) transparent transparent transparent $important - &::before - transform: translate(-50%, -.5rem) $important - -=right($important: null) - &::before - top: auto $important - bottom: 50% $important - left: 100% $important - right: auto $important - transform: translate(-1rem, 50%) $important - &:focus, - &:hover, - &.is-tooltip-active - &:not(.is-loading) - &::after - top: 50% $important - left: 100% $important - right: auto $important - border-color: transparent rgba($tooltip-background-color, 0.9) transparent transparent $important - &::before - transform: translate(0.5rem, 50%) $important - -=bottom($important: null) - &::before - top: 100% $important - bottom: auto $important - left: 50% $important - right: auto $important - transform: translate(-50%, -1rem) $important - - &:focus, - &:hover, - &.is-tooltip-active - &:not(.is-loading) - &::after - top: 100% $important - bottom: auto $important - left: 50% $important - right: auto $important - border-color: transparent transparent rgba($tooltip-background-color, 0.9) transparent $important - &::before - transform: translate(-50%, 0.5rem) $important - -=left($important: null) - &::before - top: auto $important - bottom: 50% $important - left: auto $important - right: 100% $important - transform: translate(1rem, 50%) $important - - &:focus, - &:hover, - &.is-tooltip-active - &:not(.is-loading) - &::after - top: 50% $important - bottom: auto $important - left: auto $important - right: calc(100% - .5rem) $important - border-color: transparent transparent transparent rgba($tooltip-background-color, 0.9) $important - &::before - transform: translate(-0.5rem, 50%) $important - -=direction($direction) - @if $direction == 'top' - @include top(!important) - @else if $direction == 'right' - @include right(!important) - @else if $direction == 'bottom' - @include bottom(!important) - @else if $direction == 'left' - @include left(!important) \ No newline at end of file diff --git a/django_simple_bulma/extensions/bulma-badge b/django_simple_bulma/extensions/bulma-badge new file mode 160000 index 0000000..559f674 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-badge @@ -0,0 +1 @@ +Subproject commit 559f674603473878e573849412ef246d08caef5b diff --git a/django_simple_bulma/extensions/bulma-calendar b/django_simple_bulma/extensions/bulma-calendar new file mode 160000 index 0000000..af74842 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-calendar @@ -0,0 +1 @@ +Subproject commit af74842bf85619d3e7594a405ec3f5252babfc24 diff --git a/django_simple_bulma/extensions/bulma-carousel b/django_simple_bulma/extensions/bulma-carousel new file mode 160000 index 0000000..2d9797e --- /dev/null +++ b/django_simple_bulma/extensions/bulma-carousel @@ -0,0 +1 @@ +Subproject commit 2d9797ef543d53b7e7888a78fc3fcf0054a45e07 diff --git a/django_simple_bulma/extensions/bulma-checkradio b/django_simple_bulma/extensions/bulma-checkradio new file mode 160000 index 0000000..38c9557 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-checkradio @@ -0,0 +1 @@ +Subproject commit 38c95578f465f4c3805f578490925f337b87404d diff --git a/django_simple_bulma/extensions/bulma-collapsible b/django_simple_bulma/extensions/bulma-collapsible new file mode 160000 index 0000000..eca9fb3 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-collapsible @@ -0,0 +1 @@ +Subproject commit eca9fb3c269aec1f2f6326d1acd9c53ab7e87121 diff --git a/django_simple_bulma/extensions/bulma-coolcheckboxes b/django_simple_bulma/extensions/bulma-coolcheckboxes new file mode 160000 index 0000000..65b85e4 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-coolcheckboxes @@ -0,0 +1 @@ +Subproject commit 65b85e4e22a8f0eb458de578e6f94a7a50968f1f diff --git a/django_simple_bulma/extensions/bulma-divider b/django_simple_bulma/extensions/bulma-divider new file mode 160000 index 0000000..560e3c8 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-divider @@ -0,0 +1 @@ +Subproject commit 560e3c8ef9d73c0c0b5528081b32f8dd015af755 diff --git a/django_simple_bulma/js/bulma-fileupload.js b/django_simple_bulma/extensions/bulma-fileupload/dist/js/bulma-fileupload.js similarity index 100% rename from django_simple_bulma/js/bulma-fileupload.js rename to django_simple_bulma/extensions/bulma-fileupload/dist/js/bulma-fileupload.js diff --git a/django_simple_bulma/extensions/bulma-megamenu b/django_simple_bulma/extensions/bulma-megamenu new file mode 160000 index 0000000..4566744 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-megamenu @@ -0,0 +1 @@ +Subproject commit 45667445b11c78c1a9f821e7aebcbf2885c4b5c3 diff --git a/django_simple_bulma/js/bulma-navbar-burger.js b/django_simple_bulma/extensions/bulma-navbar-burger/dist/js/bulma-navbar-burger.js similarity index 100% rename from django_simple_bulma/js/bulma-navbar-burger.js rename to django_simple_bulma/extensions/bulma-navbar-burger/dist/js/bulma-navbar-burger.js diff --git a/django_simple_bulma/js/bulma-notifications.js b/django_simple_bulma/extensions/bulma-notifications/dist/js/bulma-notifications.js similarity index 100% rename from django_simple_bulma/js/bulma-notifications.js rename to django_simple_bulma/extensions/bulma-notifications/dist/js/bulma-notifications.js diff --git a/django_simple_bulma/extensions/bulma-pageloader b/django_simple_bulma/extensions/bulma-pageloader new file mode 160000 index 0000000..e06c282 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-pageloader @@ -0,0 +1 @@ +Subproject commit e06c282aa0d0de5d8684e33f2402b02603cde0cd diff --git a/django_simple_bulma/extensions/bulma-pricingtable b/django_simple_bulma/extensions/bulma-pricingtable new file mode 160000 index 0000000..aea1e79 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-pricingtable @@ -0,0 +1 @@ +Subproject commit aea1e79224b2c2116f9bbcd8ff4899e5d0e26d09 diff --git a/django_simple_bulma/extensions/bulma-quickview b/django_simple_bulma/extensions/bulma-quickview new file mode 160000 index 0000000..290e395 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-quickview @@ -0,0 +1 @@ +Subproject commit 290e395ae990771d704e7e2d1f02f098a8009c70 diff --git a/django_simple_bulma/extensions/bulma-ribbon b/django_simple_bulma/extensions/bulma-ribbon new file mode 160000 index 0000000..1352e81 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-ribbon @@ -0,0 +1 @@ +Subproject commit 1352e8175a12f5fd5c41d6efba4c8904e36107f8 diff --git a/django_simple_bulma/extensions/bulma-slider b/django_simple_bulma/extensions/bulma-slider new file mode 160000 index 0000000..b189fe9 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-slider @@ -0,0 +1 @@ +Subproject commit b189fe920bb0e1c9e129de8468d153cc29d215d7 diff --git a/django_simple_bulma/extensions/bulma-steps b/django_simple_bulma/extensions/bulma-steps new file mode 160000 index 0000000..dfd4955 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-steps @@ -0,0 +1 @@ +Subproject commit dfd4955894ce413acdef81b39c0b0c63033ebc88 diff --git a/django_simple_bulma/extensions/bulma-switch b/django_simple_bulma/extensions/bulma-switch new file mode 160000 index 0000000..7cda5b0 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-switch @@ -0,0 +1 @@ +Subproject commit 7cda5b08a799040e411d9da2d954fd0a0e3b0d58 diff --git a/django_simple_bulma/extensions/bulma-tagsinput b/django_simple_bulma/extensions/bulma-tagsinput new file mode 160000 index 0000000..67a9655 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-tagsinput @@ -0,0 +1 @@ +Subproject commit 67a9655b1cce42c0975a3ab3cb7d812ca0e8b003 diff --git a/django_simple_bulma/extensions/bulma-timeline b/django_simple_bulma/extensions/bulma-timeline new file mode 160000 index 0000000..507ec83 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-timeline @@ -0,0 +1 @@ +Subproject commit 507ec83580eb8bdd10e712a76ed3a368ab8c42f7 diff --git a/django_simple_bulma/extensions/bulma-tooltip b/django_simple_bulma/extensions/bulma-tooltip new file mode 160000 index 0000000..0f4e9d2 --- /dev/null +++ b/django_simple_bulma/extensions/bulma-tooltip @@ -0,0 +1 @@ +Subproject commit 0f4e9d2a6defbefb10527ae7d44fa9c3f7f7d908 diff --git a/django_simple_bulma/finders.py b/django_simple_bulma/finders.py index 7fd2e65..928164f 100644 --- a/django_simple_bulma/finders.py +++ b/django_simple_bulma/finders.py @@ -13,6 +13,13 @@ from django.contrib.staticfiles.finders import BaseFinder from django.core.files.storage import FileSystemStorage +from .utils import ( + get_js_files, + get_sass_files, + is_enabled, + simple_bulma_path, +) + class SimpleBulmaFinder(BaseFinder): """ @@ -30,26 +37,36 @@ def __init__(self): except AttributeError: self.bulma_settings = {} - self.simple_bulma_path = Path(__file__).resolve().parent - self.bulma_submodule_path = self.simple_bulma_path / 'bulma' / 'sass' + self.bulma_submodule_path = simple_bulma_path / "bulma" / "sass" self.custom_scss = self.bulma_settings.get("custom_scss", []) - self.extensions = self.bulma_settings.get("extensions", "_all") self.variables = self.bulma_settings.get("variables", {}) - self.output_style = self.bulma_settings.get("output_style", 'nested') - self.storage = FileSystemStorage(self.simple_bulma_path) + self.output_style = self.bulma_settings.get("output_style", "nested") + self.storage = FileSystemStorage(simple_bulma_path) + + def _get_extension_imports(self) -> str: + """Return a string that, in SASS, imports all enabled extensions""" + scss_imports = "" + + for ext in (simple_bulma_path / "extensions").iterdir(): + + if is_enabled(ext): + for src in get_sass_files(ext): + scss_imports += f"@import '{src.as_posix()}';\n" + + return scss_imports def _get_bulma_css(self) -> str: """Compiles the bulma css file and returns its relative path.""" # Start by unpacking the users custom variables - scss_string = '@charset "utf-8";\n' + scss_string = "@charset 'utf-8';\n" for var, value in self.variables.items(): scss_string += f"${var}: {value};\n" # SASS wants paths with forward slash: - sass_bulma_path = self.simple_bulma_path.as_posix() - sass_bulma_submodule_path = self.bulma_submodule_path.as_posix() + sass_bulma_submodule_path = self.bulma_submodule_path \ + .relative_to(simple_bulma_path).as_posix() - scss_string += f'@import "{sass_bulma_submodule_path}/utilities/_all";\n' + scss_string += f"@import '{sass_bulma_submodule_path}/utilities/_all';\n" # Now load bulma dynamically. # Doing this instead of just referencing bulma.sass is preperation for issue #6 @@ -59,23 +76,16 @@ def _get_bulma_css(self) -> str: if dirname.name == "utilities": continue - scss_string += f'@import "{sass_bulma_submodule_path}/{dirname.name}/_all";\n' + scss_string += f"@import '{sass_bulma_submodule_path}/{dirname.name}/_all';\n" # Now load in the extensions that the user wants - if self.extensions == "_all": - scss_string += f'@import "{sass_bulma_path}/extensions/_all";\n' - elif isinstance(self.extensions, list): - for extension in self.extensions: - - # Check if the extension exists - extensions_folder = self.simple_bulma_path / "extensions" - extensions = [extension.stem[1:] for extension in extensions_folder.iterdir()] - if extension in extensions: - scss_string += f'@import "{sass_bulma_path}/extensions/_{extension}";\n' + scss_string += self._get_extension_imports() # Store this as a css file if hasattr(sass, "libsass_version"): - css_string = sass.compile(string=scss_string, output_style=self.output_style) + css_string = sass.compile(string=scss_string, + output_style=self.output_style, + include_paths=[simple_bulma_path.as_posix()]) else: # If the user has the sass module installed in addition to libsass, # warn the user and fail hard. @@ -88,8 +98,8 @@ def _get_bulma_css(self) -> str: "not both `sass` and `libsass`, or this application will not work." ) - css_path = self.simple_bulma_path / "css" / "bulma.css" - with open(css_path, "w") as bulma_css: + css_path = simple_bulma_path / "css" / "bulma.css" + with open(css_path, "w", encoding="utf-8") as bulma_css: bulma_css.write(css_string) return "css/bulma.css" @@ -114,7 +124,7 @@ def _get_custom_css(self) -> str: ) # SASS wants paths with forward slash: - scss_path = str(scss_path).replace('\\', '/') + scss_path = str(scss_path).replace("\\", "/") # Now load up the scss file scss_string = f'@import "{scss_path}";' @@ -123,7 +133,7 @@ def _get_custom_css(self) -> str: # already happened earlier, during the Bulma compilation css_string = sass.compile(string=scss_string, output_style=self.output_style) - css_path = self.simple_bulma_path / relative_path.parent + css_path = simple_bulma_path / relative_path.parent css_path.mkdir(exist_ok=True) css_path = f"{css_path}/{relative_path.stem}.css" @@ -136,20 +146,7 @@ def _get_custom_css(self) -> str: def _get_bulma_js(self) -> List[str]: """Return a list of all the js files that are needed for the users selected extensions.""" - js_files = [] - js_folder = self.simple_bulma_path / "js" - - if self.extensions == "_all": - for filename in js_folder.iterdir(): - js_files.append(f"js/{filename.name}") - else: - for filename in js_folder.iterdir(): - extension_name = str(filename.stem) - - if extension_name in self.extensions: - js_files.append(f"js/{filename.name}") - - return js_files + return list(get_js_files()) @staticmethod def find_relative_staticfiles(path: Union[str, Path]) -> Union[Path, None]: @@ -174,7 +171,7 @@ def find(self, path: str, all: bool = False) -> Union[List[str], str]: If the ``all`` parameter is False (default) return only the first found file path; if True, return a list of all found files paths. """ - absolute_path = str(self.simple_bulma_path / path) + absolute_path = str(simple_bulma_path / path) if all: return [absolute_path] diff --git a/django_simple_bulma/js/bulma-accordion.js b/django_simple_bulma/js/bulma-accordion.js deleted file mode 100644 index e4de03c..0000000 --- a/django_simple_bulma/js/bulma-accordion.js +++ /dev/null @@ -1,400 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["bulmaAccordion"] = factory(); - else - root["bulmaAccordion"] = factory(); -})(typeof self !== 'undefined' ? self : this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__events__ = __webpack_require__(1); -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - -var onBulmaAccordionClick = Symbol('onBulmaAccordionClick'); - -var bulmaAccordion = function (_EventEmitter) { - _inherits(bulmaAccordion, _EventEmitter); - - function bulmaAccordion(selector) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - _classCallCheck(this, bulmaAccordion); - - var _this = _possibleConstructorReturn(this, (bulmaAccordion.__proto__ || Object.getPrototypeOf(bulmaAccordion)).call(this)); - - _this.element = typeof selector === 'string' ? document.querySelector(selector) : selector; - // An invalid selector or non-DOM node has been provided. - if (!_this.element) { - throw new Error('An invalid selector or non-DOM node has been provided.'); - } - - _this._clickEvents = ['click']; - - _this[onBulmaAccordionClick] = _this[onBulmaAccordionClick].bind(_this); - - _this.init(); - return _this; - } - - /** - * Initiate all DOM element containing carousel class - * @method - * @return {Array} Array of all Carousel instances - */ - - - _createClass(bulmaAccordion, [{ - key: 'init', - - - /** - * Initiate plugin - * @method init - * @return {void} - */ - value: function init() { - this.items = this.element.querySelectorAll('.accordion .toggle') || []; - - this._bindEvents(); - } - }, { - key: 'destroy', - value: function destroy() { - var _this2 = this; - - this.items.forEach(function (item) { - _this2._clickEvents.forEach(function (clickEvent) { - item.removeEventListener(clickEvent, _this2[onBulmaAccordionClick], false); - }); - }); - } - - /** - * Bind all events - * @method _bindEvents - * @return {void} - */ - - }, { - key: '_bindEvents', - value: function _bindEvents() { - var _this3 = this; - - this.items.forEach(function (item) { - _this3._clickEvents.forEach(function (clickEvent) { - item.addEventListener(clickEvent, _this3[onBulmaAccordionClick], false); - }); - }); - } - - /** - * Toggle accordion item - * @method onBulmaAccordionClick - * @param {Event} e click event - * @return {void} - */ - - }, { - key: onBulmaAccordionClick, - value: function value(e) { - e.preventDefault(); - - var target = e.currentTarget.closest('.accordion') || e.currentTarget; - if (!target.classList.contains('is-active')) { - var activeItem = this.element.querySelector('.accordion.is-active'); - if (activeItem) { - activeItem.classList.remove('is-active'); - } - target.classList.add('is-active'); - } else { - target.classList.remove('is-active'); - } - } - }], [{ - key: 'attach', - value: function attach() { - var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '.accordions'; - - var instances = new Array(); - - var elements = document.querySelectorAll(selector); - [].forEach.call(elements, function (element) { - setTimeout(function () { - instances.push(new bulmaAccordion(element)); - }, 100); - }); - return instances; - } - }]); - - return bulmaAccordion; -}(__WEBPACK_IMPORTED_MODULE_0__events__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["default"] = (bulmaAccordion); - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var EventEmitter = function () { - function EventEmitter() { - var listeners = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - - _classCallCheck(this, EventEmitter); - - this._listeners = new Map(listeners); - this._middlewares = new Map(); - } - - _createClass(EventEmitter, [{ - key: "listenerCount", - value: function listenerCount(eventName) { - if (!this._listeners.has(eventName)) { - return 0; - } - - var eventListeners = this._listeners.get(eventName); - return eventListeners.length; - } - }, { - key: "removeListeners", - value: function removeListeners() { - var _this = this; - - var eventName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var middleware = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (eventName !== null) { - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this.removeListeners(e, middleware); - }); - } else { - this._listeners.delete(eventName); - - if (middleware) { - this.removeMiddleware(eventName); - } - } - } else { - this._listeners = new Map(); - } - } - }, { - key: "middleware", - value: function middleware(eventName, fn) { - var _this2 = this; - - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this2.middleware(e, fn); - }); - } else { - if (!Array.isArray(this._middlewares.get(eventName))) { - this._middlewares.set(eventName, []); - } - - this._middlewares.get(eventName).push(fn); - } - } - }, { - key: "removeMiddleware", - value: function removeMiddleware() { - var _this3 = this; - - var eventName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (eventName !== null) { - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this3.removeMiddleware(e); - }); - } else { - this._middlewares.delete(eventName); - } - } else { - this._middlewares = new Map(); - } - } - }, { - key: "on", - value: function on(name, callback) { - var _this4 = this; - - var once = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - if (Array.isArray(name)) { - name.forEach(function (e) { - return _this4.on(e, callback); - }); - } else { - name = name.toString(); - var split = name.split(/,|, | /); - - if (split.length > 1) { - split.forEach(function (e) { - return _this4.on(e, callback); - }); - } else { - if (!Array.isArray(this._listeners.get(name))) { - this._listeners.set(name, []); - } - - this._listeners.get(name).push({ once: once, callback: callback }); - } - } - } - }, { - key: "once", - value: function once(name, callback) { - this.on(name, callback, true); - } - }, { - key: "emit", - value: function emit(name, data) { - var _this5 = this; - - var silent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - name = name.toString(); - var listeners = this._listeners.get(name); - var middlewares = null; - var doneCount = 0; - var execute = silent; - - if (Array.isArray(listeners)) { - listeners.forEach(function (listener, index) { - // Start Middleware checks unless we're doing a silent emit - if (!silent) { - middlewares = _this5._middlewares.get(name); - // Check and execute Middleware - if (Array.isArray(middlewares)) { - middlewares.forEach(function (middleware) { - middleware(data, function () { - var newData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (newData !== null) { - data = newData; - } - doneCount++; - }, name); - }); - - if (doneCount >= middlewares.length) { - execute = true; - } - } else { - execute = true; - } - } - - // If Middleware checks have been passed, execute - if (execute) { - if (listener.once) { - listeners[index] = null; - } - listener.callback(data); - } - }); - - // Dirty way of removing used Events - while (listeners.indexOf(null) !== -1) { - listeners.splice(listeners.indexOf(null), 1); - } - } - } - }]); - - return EventEmitter; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (EventEmitter); - -/***/ }) -/******/ ])["default"]; -}); \ No newline at end of file diff --git a/django_simple_bulma/js/bulma-calendar.js b/django_simple_bulma/js/bulma-calendar.js deleted file mode 100644 index f102d92..0000000 --- a/django_simple_bulma/js/bulma-calendar.js +++ /dev/null @@ -1,18506 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["bulmaCalendar"] = factory(); - else - root["bulmaCalendar"] = factory(); -})(typeof self !== 'undefined' ? self : this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 228); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -var isDate = __webpack_require__(116) - -var MILLISECONDS_IN_HOUR = 3600000 -var MILLISECONDS_IN_MINUTE = 60000 -var DEFAULT_ADDITIONAL_DIGITS = 2 - -var parseTokenDateTimeDelimeter = /[T ]/ -var parseTokenPlainTime = /:/ - -// year tokens -var parseTokenYY = /^(\d{2})$/ -var parseTokensYYY = [ - /^([+-]\d{2})$/, // 0 additional digits - /^([+-]\d{3})$/, // 1 additional digit - /^([+-]\d{4})$/ // 2 additional digits -] - -var parseTokenYYYY = /^(\d{4})/ -var parseTokensYYYYY = [ - /^([+-]\d{4})/, // 0 additional digits - /^([+-]\d{5})/, // 1 additional digit - /^([+-]\d{6})/ // 2 additional digits -] - -// date tokens -var parseTokenMM = /^-(\d{2})$/ -var parseTokenDDD = /^-?(\d{3})$/ -var parseTokenMMDD = /^-?(\d{2})-?(\d{2})$/ -var parseTokenWww = /^-?W(\d{2})$/ -var parseTokenWwwD = /^-?W(\d{2})-?(\d{1})$/ - -// time tokens -var parseTokenHH = /^(\d{2}([.,]\d*)?)$/ -var parseTokenHHMM = /^(\d{2}):?(\d{2}([.,]\d*)?)$/ -var parseTokenHHMMSS = /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/ - -// timezone tokens -var parseTokenTimezone = /([Z+-].*)$/ -var parseTokenTimezoneZ = /^(Z)$/ -var parseTokenTimezoneHH = /^([+-])(\d{2})$/ -var parseTokenTimezoneHHMM = /^([+-])(\d{2}):?(\d{2})$/ - -/** - * @category Common Helpers - * @summary Convert the given argument to an instance of Date. - * - * @description - * Convert the given argument to an instance of Date. - * - * If the argument is an instance of Date, the function returns its clone. - * - * If the argument is a number, it is treated as a timestamp. - * - * If an argument is a string, the function tries to parse it. - * Function accepts complete ISO 8601 formats as well as partial implementations. - * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601 - * - * If all above fails, the function passes the given argument to Date constructor. - * - * @param {Date|String|Number} argument - the value to convert - * @param {Object} [options] - the object with options - * @param {0 | 1 | 2} [options.additionalDigits=2] - the additional number of digits in the extended year format - * @returns {Date} the parsed date in the local time zone - * - * @example - * // Convert string '2014-02-11T11:30:30' to date: - * var result = parse('2014-02-11T11:30:30') - * //=> Tue Feb 11 2014 11:30:30 - * - * @example - * // Parse string '+02014101', - * // if the additional number of digits in the extended year format is 1: - * var result = parse('+02014101', {additionalDigits: 1}) - * //=> Fri Apr 11 2014 00:00:00 - */ -function parse (argument, dirtyOptions) { - if (isDate(argument)) { - // Prevent the date to lose the milliseconds when passed to new Date() in IE10 - return new Date(argument.getTime()) - } else if (typeof argument !== 'string') { - return new Date(argument) - } - - var options = dirtyOptions || {} - var additionalDigits = options.additionalDigits - if (additionalDigits == null) { - additionalDigits = DEFAULT_ADDITIONAL_DIGITS - } else { - additionalDigits = Number(additionalDigits) - } - - var dateStrings = splitDateString(argument) - - var parseYearResult = parseYear(dateStrings.date, additionalDigits) - var year = parseYearResult.year - var restDateString = parseYearResult.restDateString - - var date = parseDate(restDateString, year) - - if (date) { - var timestamp = date.getTime() - var time = 0 - var offset - - if (dateStrings.time) { - time = parseTime(dateStrings.time) - } - - if (dateStrings.timezone) { - offset = parseTimezone(dateStrings.timezone) - } else { - // get offset accurate to hour in timezones that change offset - offset = new Date(timestamp + time).getTimezoneOffset() - offset = new Date(timestamp + time + offset * MILLISECONDS_IN_MINUTE).getTimezoneOffset() - } - - return new Date(timestamp + time + offset * MILLISECONDS_IN_MINUTE) - } else { - return new Date(argument) - } -} - -function splitDateString (dateString) { - var dateStrings = {} - var array = dateString.split(parseTokenDateTimeDelimeter) - var timeString - - if (parseTokenPlainTime.test(array[0])) { - dateStrings.date = null - timeString = array[0] - } else { - dateStrings.date = array[0] - timeString = array[1] - } - - if (timeString) { - var token = parseTokenTimezone.exec(timeString) - if (token) { - dateStrings.time = timeString.replace(token[1], '') - dateStrings.timezone = token[1] - } else { - dateStrings.time = timeString - } - } - - return dateStrings -} - -function parseYear (dateString, additionalDigits) { - var parseTokenYYY = parseTokensYYY[additionalDigits] - var parseTokenYYYYY = parseTokensYYYYY[additionalDigits] - - var token - - // YYYY or ±YYYYY - token = parseTokenYYYY.exec(dateString) || parseTokenYYYYY.exec(dateString) - if (token) { - var yearString = token[1] - return { - year: parseInt(yearString, 10), - restDateString: dateString.slice(yearString.length) - } - } - - // YY or ±YYY - token = parseTokenYY.exec(dateString) || parseTokenYYY.exec(dateString) - if (token) { - var centuryString = token[1] - return { - year: parseInt(centuryString, 10) * 100, - restDateString: dateString.slice(centuryString.length) - } - } - - // Invalid ISO-formatted year - return { - year: null - } -} - -function parseDate (dateString, year) { - // Invalid ISO-formatted year - if (year === null) { - return null - } - - var token - var date - var month - var week - - // YYYY - if (dateString.length === 0) { - date = new Date(0) - date.setUTCFullYear(year) - return date - } - - // YYYY-MM - token = parseTokenMM.exec(dateString) - if (token) { - date = new Date(0) - month = parseInt(token[1], 10) - 1 - date.setUTCFullYear(year, month) - return date - } - - // YYYY-DDD or YYYYDDD - token = parseTokenDDD.exec(dateString) - if (token) { - date = new Date(0) - var dayOfYear = parseInt(token[1], 10) - date.setUTCFullYear(year, 0, dayOfYear) - return date - } - - // YYYY-MM-DD or YYYYMMDD - token = parseTokenMMDD.exec(dateString) - if (token) { - date = new Date(0) - month = parseInt(token[1], 10) - 1 - var day = parseInt(token[2], 10) - date.setUTCFullYear(year, month, day) - return date - } - - // YYYY-Www or YYYYWww - token = parseTokenWww.exec(dateString) - if (token) { - week = parseInt(token[1], 10) - 1 - return dayOfISOYear(year, week) - } - - // YYYY-Www-D or YYYYWwwD - token = parseTokenWwwD.exec(dateString) - if (token) { - week = parseInt(token[1], 10) - 1 - var dayOfWeek = parseInt(token[2], 10) - 1 - return dayOfISOYear(year, week, dayOfWeek) - } - - // Invalid ISO-formatted date - return null -} - -function parseTime (timeString) { - var token - var hours - var minutes - - // hh - token = parseTokenHH.exec(timeString) - if (token) { - hours = parseFloat(token[1].replace(',', '.')) - return (hours % 24) * MILLISECONDS_IN_HOUR - } - - // hh:mm or hhmm - token = parseTokenHHMM.exec(timeString) - if (token) { - hours = parseInt(token[1], 10) - minutes = parseFloat(token[2].replace(',', '.')) - return (hours % 24) * MILLISECONDS_IN_HOUR + - minutes * MILLISECONDS_IN_MINUTE - } - - // hh:mm:ss or hhmmss - token = parseTokenHHMMSS.exec(timeString) - if (token) { - hours = parseInt(token[1], 10) - minutes = parseInt(token[2], 10) - var seconds = parseFloat(token[3].replace(',', '.')) - return (hours % 24) * MILLISECONDS_IN_HOUR + - minutes * MILLISECONDS_IN_MINUTE + - seconds * 1000 - } - - // Invalid ISO-formatted time - return null -} - -function parseTimezone (timezoneString) { - var token - var absoluteOffset - - // Z - token = parseTokenTimezoneZ.exec(timezoneString) - if (token) { - return 0 - } - - // ±hh - token = parseTokenTimezoneHH.exec(timezoneString) - if (token) { - absoluteOffset = parseInt(token[2], 10) * 60 - return (token[1] === '+') ? -absoluteOffset : absoluteOffset - } - - // ±hh:mm or ±hhmm - token = parseTokenTimezoneHHMM.exec(timezoneString) - if (token) { - absoluteOffset = parseInt(token[2], 10) * 60 + parseInt(token[3], 10) - return (token[1] === '+') ? -absoluteOffset : absoluteOffset - } - - return 0 -} - -function dayOfISOYear (isoYear, week, day) { - week = week || 0 - day = day || 0 - var date = new Date(0) - date.setUTCFullYear(isoYear, 0, 4) - var fourthOfJanuaryDay = date.getUTCDay() || 7 - var diff = week * 7 + day + 1 - fourthOfJanuaryDay - date.setUTCDate(date.getUTCDate() + diff) - return date -} - -module.exports = parse - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js (c) KNOWLEDGECODE | MIT - */ -(function (global) { - 'use strict'; - - var date = {}, - lang = 'en', - locales = { - en: { - MMMM: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], - MMM: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - dddd: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], - ddd: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], - dd: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], - A: ['a.m.', 'p.m.'], - formatter: { - YYYY: function (d/*, formatString*/) { return ('000' + d.getFullYear()).slice(-4); }, - YY: function (d/*, formatString*/) { return ('0' + d.getFullYear()).slice(-2); }, - Y: function (d/*, formatString*/) { return '' + d.getFullYear(); }, - MMMM: function (d/*, formatString*/) { return this.MMMM[d.getMonth()]; }, - MMM: function (d/*, formatString*/) { return this.MMM[d.getMonth()]; }, - MM: function (d/*, formatString*/) { return ('0' + (d.getMonth() + 1)).slice(-2); }, - M: function (d/*, formatString*/) { return '' + (d.getMonth() + 1); }, - DD: function (d/*, formatString*/) { return ('0' + d.getDate()).slice(-2); }, - D: function (d/*, formatString*/) { return '' + d.getDate(); }, - HH: function (d/*, formatString*/) { return ('0' + d.getHours()).slice(-2); }, - H: function (d/*, formatString*/) { return '' + d.getHours(); }, - A: function (d/*, formatString*/) { return this.A[d.getHours() > 11 | 0]; }, - hh: function (d/*, formatString*/) { return ('0' + (d.getHours() % 12 || 12)).slice(-2); }, - h: function (d/*, formatString*/) { return '' + (d.getHours() % 12 || 12); }, - mm: function (d/*, formatString*/) { return ('0' + d.getMinutes()).slice(-2); }, - m: function (d/*, formatString*/) { return '' + d.getMinutes(); }, - ss: function (d/*, formatString*/) { return ('0' + d.getSeconds()).slice(-2); }, - s: function (d/*, formatString*/) { return '' + d.getSeconds(); }, - SSS: function (d/*, formatString*/) { return ('00' + d.getMilliseconds()).slice(-3); }, - SS: function (d/*, formatString*/) { return ('0' + (d.getMilliseconds() / 10 | 0)).slice(-2); }, - S: function (d/*, formatString*/) { return '' + (d.getMilliseconds() / 100 | 0); }, - dddd: function (d/*, formatString*/) { return this.dddd[d.getDay()]; }, - ddd: function (d/*, formatString*/) { return this.ddd[d.getDay()]; }, - dd: function (d/*, formatString*/) { return this.dd[d.getDay()]; }, - Z: function (d/*, formatString*/) { - var offset = d.utc ? 0 : d.getTimezoneOffset() / 0.6; - return (offset > 0 ? '-' : '+') + ('000' + Math.abs(offset - offset % 100 * 0.4)).slice(-4); - }, - post: function (str) { return str; } - }, - parser: { - find: function (array, str) { - var index = -1, length = 0; - - for (var i = 0, len = array.length, item; i < len; i++) { - item = array[i]; - if (!str.indexOf(item) && item.length > length) { - index = i; - length = item.length; - } - } - return { index: index, length: length }; - }, - MMMM: function (str/*, formatString*/) { - return this.parser.find(this.MMMM, str); - }, - MMM: function (str/*, formatString*/) { - return this.parser.find(this.MMM, str); - }, - A: function (str/*, formatString*/) { - return this.parser.find(this.A, str); - }, - h: function (h, a) { return (h === 12 ? 0 : h) + a * 12; }, - pre: function (str) { return str; } - } - } - }; - - /** - * formatting a date - * @param {Object} dateObj - date object - * @param {String} formatString - format string - * @param {Boolean} [utc] - output as UTC - * @returns {String} the formatted string - */ - date.format = function (dateObj, formatString, utc) { - var d = date.addMinutes(dateObj, utc ? dateObj.getTimezoneOffset() : 0), - locale = locales[lang], formatter = locale.formatter; - - d.utc = utc; - return formatString.replace(/(\[[^\[\]]*]|\[.*\][^\[]*\]|YYYY|YY|MMM?M?|DD|HH|hh|mm|ss|SSS?|ddd?d?|.)/g, function (token) { - var format = formatter[token]; - return format ? formatter.post(format.call(locale, d, formatString)) : token.replace(/\[(.*)]/, '$1'); - }); - }; - - /** - * parsing a date string - * @param {String} dateString - date string - * @param {String} formatString - format string - * @param {Boolean} [utc] - input as UTC - * @returns {Object} the constructed date - */ - date.parse = function (dateString, formatString, utc) { - var locale = locales[lang], dString = locale.parser.pre(dateString), - offset = 0, keys, i, token, length, p, str, result, dateObj, - re = /(MMMM?|A)|(YYYY)|(SSS)|(MM|DD|HH|hh|mm|ss)|(YY|M|D|H|h|m|s|SS)|(S)|(.)/g, - exp = { 2: /^\d{1,4}/, 3: /^\d{1,3}/, 4: /^\d\d/, 5: /^\d\d?/, 6: /^\d/ }, - last = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], - dt = { Y: 1970, M: 1, D: 1, H: 0, m: 0, s: 0, S: 0 }; - - while ((keys = re.exec(formatString))) { - for (i = 0, length = 1, token = ''; !token;) { - token = keys[++i]; - } - p = token.charAt(0); - str = dString.slice(offset); - if (i < 2) { - result = locale.parser[token].call(locale, str, formatString); - dt[p] = result.index; - if (p === 'M') { - dt[p]++; - } - length = result.length; - } else if (i < 7) { - result = (str.match(exp[i]) || [''])[0]; - dt[p] = (p === 'S' ? (result + '000').slice(0, -token.length) : result) | 0; - length = result.length; - } else if (p !== ' ' && p !== str[0]) { - return NaN; - } - if (!length) { - return NaN; - } - offset += length; - } - if (offset !== dString.length || !result) { - return NaN; - } - dt.Y += dt.Y < 70 ? 2000 : dt.Y < 100 ? 1900 : 0; - dt.H = dt.H || locale.parser.h(dt.h || 0, dt.A || 0); - - dateObj = new Date(dt.Y, dt.M - 1, dt.D, dt.H, dt.m, dt.s, dt.S); - last[1] += date.isLeapYear(dateObj) | 0; - if (dt.M < 1 || dt.M > 12 || dt.D < 1 || dt.D > last[dt.M - 1] || dt.H > 23 || dt.m > 59 || dt.s > 59) { - return NaN; - } - return utc ? date.addMinutes(dateObj, -dateObj.getTimezoneOffset()) : dateObj; - }; - - /** - * validation - * @param {String} dateString - date string - * @param {String} formatString - format string - * @returns {Boolean} whether the date string is a valid date - */ - date.isValid = function (dateString, formatString) { - return !!date.parse(dateString, formatString); - }; - - /** - * adding years - * @param {Object} dateObj - date object - * @param {Number} years - adding year - * @returns {Object} the date after adding the value - */ - date.addYears = function (dateObj, years) { - return date.addMonths(dateObj, years * 12); - }; - - /** - * adding months - * @param {Object} dateObj - date object - * @param {Number} months - adding month - * @returns {Object} the date after adding the value - */ - date.addMonths = function (dateObj, months) { - var d = new Date(dateObj.getTime()); - - d.setMonth(d.getMonth() + months); - return d; - }; - - /** - * adding days - * @param {Object} dateObj - date object - * @param {Number} days - adding day - * @returns {Object} the date after adding the value - */ - date.addDays = function (dateObj, days) { - var d = new Date(dateObj.getTime()); - - d.setDate(d.getDate() + days); - return d; - }; - - /** - * adding hours - * @param {Object} dateObj - date object - * @param {Number} hours - adding hour - * @returns {Object} the date after adding the value - */ - date.addHours = function (dateObj, hours) { - return date.addMilliseconds(dateObj, hours * 3600000); - }; - - /** - * adding minutes - * @param {Object} dateObj - date object - * @param {Number} minutes - adding minute - * @returns {Object} the date after adding the value - */ - date.addMinutes = function (dateObj, minutes) { - return date.addMilliseconds(dateObj, minutes * 60000); - }; - - /** - * adding seconds - * @param {Object} dateObj - date object - * @param {Number} seconds - adding second - * @returns {Object} the date after adding the value - */ - date.addSeconds = function (dateObj, seconds) { - return date.addMilliseconds(dateObj, seconds * 1000); - }; - - /** - * adding milliseconds - * @param {Object} dateObj - date object - * @param {Number} milliseconds - adding millisecond - * @returns {Object} the date after adding the value - */ - date.addMilliseconds = function (dateObj, milliseconds) { - return new Date(dateObj.getTime() + milliseconds); - }; - - /** - * subtracting - * @param {Object} date1 - date object - * @param {Object} date2 - date object - * @returns {Object} the result object after subtracting the date - */ - date.subtract = function (date1, date2) { - var delta = date1.getTime() - date2.getTime(); - - return { - toMilliseconds: function () { - return delta; - }, - toSeconds: function () { - return delta / 1000 | 0; - }, - toMinutes: function () { - return delta / 60000 | 0; - }, - toHours: function () { - return delta / 3600000 | 0; - }, - toDays: function () { - return delta / 86400000 | 0; - } - }; - }; - - /** - * leap year - * @param {Object} dateObj - date object - * @returns {Boolean} whether the year is a leap year - */ - date.isLeapYear = function (dateObj) { - var y = dateObj.getFullYear(); - return (!(y % 4) && !!(y % 100)) || !(y % 400); - }; - - /** - * comparison of dates - * @param {Object} date1 - target for comparison - * @param {Object} date2 - target for comparison - * @returns {Boolean} whether the dates are the same day (times are ignored) - */ - date.isSameDay = function (date1, date2) { - return date.format(date1, 'YYYYMMDD') === date.format(date2, 'YYYYMMDD'); - }; - - /** - * setting a locale - * @param {String} [code] - language code - * @returns {String} current language code - */ - date.locale = function (code) { - if (code) { - if (!locales[code] && "function" === 'function' && global) { - __webpack_require__(329)("./" + code); - } - lang = code; - } - return lang; - }; - - /** - * getting a definition of locale - * @param {String} [code] - language code - * @returns {Object} definition of locale - */ - date.getLocales = function (code) { - return locales[code || lang]; - }; - - /** - * adding a new definition of locale - * @param {String} code - language code - * @param {Object} options - definition of locale - * @returns {void} - */ - date.setLocales = function (code, options) { - var copy = function (src, proto) { - var Locale = function () {}, dst, key; - - Locale.prototype = proto; - dst = new Locale(); - for (key in src) { - if (src.hasOwnProperty(key)) { - dst[key] = src[key]; - } - } - return dst; - }, - base = locales[code] || locales.en, - locale = copy(options, base); - - if (options.formatter) { - locale.formatter = copy(options.formatter, base.formatter); - } - if (options.parser) { - locale.parser = copy(options.parser, base.parser); - } - locales[code] = locale; - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - module.exports = date; - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { - return date; - }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - global.date = date; - } - -}(this)); - - -/***/ }), -/* 2 */ -/***/ (function(module, exports) { - -var commonFormatterKeys = [ - 'M', 'MM', 'Q', 'D', 'DD', 'DDD', 'DDDD', 'd', - 'E', 'W', 'WW', 'YY', 'YYYY', 'GG', 'GGGG', - 'H', 'HH', 'h', 'hh', 'm', 'mm', - 's', 'ss', 'S', 'SS', 'SSS', - 'Z', 'ZZ', 'X', 'x' -] - -function buildFormattingTokensRegExp (formatters) { - var formatterKeys = [] - for (var key in formatters) { - if (formatters.hasOwnProperty(key)) { - formatterKeys.push(key) - } - } - - var formattingTokens = commonFormatterKeys - .concat(formatterKeys) - .sort() - .reverse() - var formattingTokensRegExp = new RegExp( - '(\\[[^\\[]*\\])|(\\\\)?' + '(' + formattingTokens.join('|') + '|.)', 'g' - ) - - return formattingTokensRegExp -} - -module.exports = buildFormattingTokensRegExp - - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) -var startOfISOWeek = __webpack_require__(4) - -/** - * @category ISO Week-Numbering Year Helpers - * @summary Get the ISO week-numbering year of the given date. - * - * @description - * Get the ISO week-numbering year of the given date, - * which always starts 3 days before the year's first Thursday. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the ISO week-numbering year - * - * @example - * // Which ISO-week numbering year is 2 January 2005? - * var result = getISOYear(new Date(2005, 0, 2)) - * //=> 2004 - */ -function getISOYear (dirtyDate) { - var date = parse(dirtyDate) - var year = date.getFullYear() - - var fourthOfJanuaryOfNextYear = new Date(0) - fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4) - fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0) - var startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear) - - var fourthOfJanuaryOfThisYear = new Date(0) - fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4) - fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0) - var startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear) - - if (date.getTime() >= startOfNextYear.getTime()) { - return year + 1 - } else if (date.getTime() >= startOfThisYear.getTime()) { - return year - } else { - return year - 1 - } -} - -module.exports = getISOYear - - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -var startOfWeek = __webpack_require__(79) - -/** - * @category ISO Week Helpers - * @summary Return the start of an ISO week for the given date. - * - * @description - * Return the start of an ISO week for the given date. - * The result will be in the local timezone. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the start of an ISO week - * - * @example - * // The start of an ISO week for 2 September 2014 11:55:00: - * var result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Mon Sep 01 2014 00:00:00 - */ -function startOfISOWeek (dirtyDate) { - return startOfWeek(dirtyDate, {weekStartsOn: 1}) -} - -module.exports = startOfISOWeek - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Day Helpers - * @summary Return the start of a day for the given date. - * - * @description - * Return the start of a day for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the start of a day - * - * @example - * // The start of a day for 2 September 2014 11:55:00: - * var result = startOfDay(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Sep 02 2014 00:00:00 - */ -function startOfDay (dirtyDate) { - var date = parse(dirtyDate) - date.setHours(0, 0, 0, 0) - return date -} - -module.exports = startOfDay - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(11) -var buildFormatLocale = __webpack_require__(12) - -/** - * @category Locales - * @summary English locale. - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Day Helpers - * @summary Add the specified number of days to the given date. - * - * @description - * Add the specified number of days to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of days to be added - * @returns {Date} the new date with the days added - * - * @example - * // Add 10 days to 1 September 2014: - * var result = addDays(new Date(2014, 8, 1), 10) - * //=> Thu Sep 11 2014 00:00:00 - */ -function addDays (dirtyDate, dirtyAmount) { - var date = parse(dirtyDate) - var amount = Number(dirtyAmount) - date.setDate(date.getDate() + amount) - return date -} - -module.exports = addDays - - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Millisecond Helpers - * @summary Add the specified number of milliseconds to the given date. - * - * @description - * Add the specified number of milliseconds to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of milliseconds to be added - * @returns {Date} the new date with the milliseconds added - * - * @example - * // Add 750 milliseconds to 10 July 2014 12:45:30.000: - * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) - * //=> Thu Jul 10 2014 12:45:30.750 - */ -function addMilliseconds (dirtyDate, dirtyAmount) { - var timestamp = parse(dirtyDate).getTime() - var amount = Number(dirtyAmount) - return new Date(timestamp + amount) -} - -module.exports = addMilliseconds - - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -var getISOYear = __webpack_require__(3) -var startOfISOWeek = __webpack_require__(4) - -/** - * @category ISO Week-Numbering Year Helpers - * @summary Return the start of an ISO week-numbering year for the given date. - * - * @description - * Return the start of an ISO week-numbering year, - * which always starts 3 days before the year's first Thursday. - * The result will be in the local timezone. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the start of an ISO year - * - * @example - * // The start of an ISO week-numbering year for 2 July 2005: - * var result = startOfISOYear(new Date(2005, 6, 2)) - * //=> Mon Jan 03 2005 00:00:00 - */ -function startOfISOYear (dirtyDate) { - var year = getISOYear(dirtyDate) - var fourthOfJanuary = new Date(0) - fourthOfJanuary.setFullYear(year, 0, 4) - fourthOfJanuary.setHours(0, 0, 0, 0) - var date = startOfISOWeek(fourthOfJanuary) - return date -} - -module.exports = startOfISOYear - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Common Helpers - * @summary Compare the two dates and return -1, 0 or 1. - * - * @description - * Compare the two dates and return 1 if the first date is after the second, - * -1 if the first date is before the second or 0 if dates are equal. - * - * @param {Date|String|Number} dateLeft - the first date to compare - * @param {Date|String|Number} dateRight - the second date to compare - * @returns {Number} the result of the comparison - * - * @example - * // Compare 11 February 1987 and 10 July 1989: - * var result = compareAsc( - * new Date(1987, 1, 11), - * new Date(1989, 6, 10) - * ) - * //=> -1 - * - * @example - * // Sort the array of dates: - * var result = [ - * new Date(1995, 6, 2), - * new Date(1987, 1, 11), - * new Date(1989, 6, 10) - * ].sort(compareAsc) - * //=> [ - * // Wed Feb 11 1987 00:00:00, - * // Mon Jul 10 1989 00:00:00, - * // Sun Jul 02 1995 00:00:00 - * // ] - */ -function compareAsc (dirtyDateLeft, dirtyDateRight) { - var dateLeft = parse(dirtyDateLeft) - var timeLeft = dateLeft.getTime() - var dateRight = parse(dirtyDateRight) - var timeRight = dateRight.getTime() - - if (timeLeft < timeRight) { - return -1 - } else if (timeLeft > timeRight) { - return 1 - } else { - return 0 - } -} - -module.exports = compareAsc - - -/***/ }), -/* 11 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'less than a second', - other: 'less than {{count}} seconds' - }, - - xSeconds: { - one: '1 second', - other: '{{count}} seconds' - }, - - halfAMinute: 'half a minute', - - lessThanXMinutes: { - one: 'less than a minute', - other: 'less than {{count}} minutes' - }, - - xMinutes: { - one: '1 minute', - other: '{{count}} minutes' - }, - - aboutXHours: { - one: 'about 1 hour', - other: 'about {{count}} hours' - }, - - xHours: { - one: '1 hour', - other: '{{count}} hours' - }, - - xDays: { - one: '1 day', - other: '{{count}} days' - }, - - aboutXMonths: { - one: 'about 1 month', - other: 'about {{count}} months' - }, - - xMonths: { - one: '1 month', - other: '{{count}} months' - }, - - aboutXYears: { - one: 'about 1 year', - other: 'about {{count}} years' - }, - - xYears: { - one: '1 year', - other: '{{count}} years' - }, - - overXYears: { - one: 'over 1 year', - other: 'over {{count}} years' - }, - - almostXYears: { - one: 'almost 1 year', - other: 'almost {{count}} years' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'in ' + result - } else { - return result + ' ago' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - // Note: in English, the names of days of the week and months are capitalized. - // If you are making a new locale based on this one, check if the same is true for the language you're working on. - // Generally, formatted dates should look like they are in the middle of a sentence, - // e.g. in Spanish language the weekdays and months should be in the lowercase. - var months3char = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - var monthsFull = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] - var weekdays2char = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'] - var weekdays3char = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] - var weekdaysFull = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] - var meridiemUppercase = ['AM', 'PM'] - var meridiemLowercase = ['am', 'pm'] - var meridiemFull = ['a.m.', 'p.m.'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - var rem100 = number % 100 - if (rem100 > 20 || rem100 < 10) { - switch (rem100 % 10) { - case 1: - return number + 'st' - case 2: - return number + 'nd' - case 3: - return number + 'rd' - } - } - return number + 'th' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 13 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'أقل من ثانية واحدة', - other: 'أقل من {{count}} ثواني' - }, - - xSeconds: { - one: 'ثانية واحدة', - other: '{{count}} ثواني' - }, - - halfAMinute: 'نصف دقيقة', - - lessThanXMinutes: { - one: 'أقل من دقيقة', - other: 'أقل من {{count}} دقيقة' - }, - - xMinutes: { - one: 'دقيقة واحدة', - other: '{{count}} دقائق' - }, - - aboutXHours: { - one: 'ساعة واحدة تقريباً', - other: '{{count}} ساعات تقريباً' - }, - - xHours: { - one: 'ساعة واحدة', - other: '{{count}} ساعات' - }, - - xDays: { - one: 'يوم واحد', - other: '{{count}} أيام' - }, - - aboutXMonths: { - one: 'شهر واحد تقريباً', - other: '{{count}} أشهر تقريباً' - }, - - xMonths: { - one: 'شهر واحد', - other: '{{count}} أشهر' - }, - - aboutXYears: { - one: 'عام واحد تقريباً', - other: '{{count}} أعوام تقريباً' - }, - - xYears: { - one: 'عام واحد', - other: '{{count}} أعوام' - }, - - overXYears: { - one: 'أكثر من عام', - other: 'أكثر من {{count}} أعوام' - }, - - almostXYears: { - one: 'عام واحد تقريباً', - other: '{{count}} أعوام تقريباً' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'في خلال ' + result - } else { - return 'منذ ' + result - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'] - var monthsFull = ['كانون الثاني يناير', 'شباط فبراير', 'آذار مارس', 'نيسان أبريل', 'أيار مايو', 'حزيران يونيو', 'تموز يوليو', 'آب أغسطس', 'أيلول سبتمبر', 'تشرين الأول أكتوبر', 'تشرين الثاني نوفمبر', 'كانون الأول ديسمبر'] - var weekdays2char = ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'] - var weekdays3char = ['أحد', 'إثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'] - var weekdaysFull = ['الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'] - var meridiemUppercase = ['صباح', 'مساء'] - var meridiemLowercase = ['ص', 'م'] - var meridiemFull = ['صباحاً', 'مساءاً'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return String(number) -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 15 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'по-малко от секунда', - other: 'по-малко от {{count}} секунди' - }, - - xSeconds: { - one: '1 секунда', - other: '{{count}} секунди' - }, - - halfAMinute: 'половин минута', - - lessThanXMinutes: { - one: 'по-малко от минута', - other: 'по-малко от {{count}} минути' - }, - - xMinutes: { - one: '1 минута', - other: '{{count}} минути' - }, - - aboutXHours: { - one: 'около час', - other: 'около {{count}} часа' - }, - - xHours: { - one: '1 час', - other: '{{count}} часа' - }, - - xDays: { - one: '1 ден', - other: '{{count}} дни' - }, - - aboutXMonths: { - one: 'около месец', - other: 'около {{count}} месеца' - }, - - xMonths: { - one: '1 месец', - other: '{{count}} месеца' - }, - - aboutXYears: { - one: 'около година', - other: 'около {{count}} години' - }, - - xYears: { - one: '1 година', - other: '{{count}} години' - }, - - overXYears: { - one: 'над година', - other: 'над {{count}} години' - }, - - almostXYears: { - one: 'почти година', - other: 'почти {{count}} години' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'след ' + result - } else { - return 'преди ' + result - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['яну', 'фев', 'мар', 'апр', 'май', 'юни', 'юли', 'авг', 'сеп', 'окт', 'ное', 'дек'] - var monthsFull = ['януари', 'февруари', 'март', 'април', 'май', 'юни', 'юли', 'август', 'септември', 'октомври', 'ноември', 'декември'] - var weekdays2char = ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'] - var weekdays3char = ['нед', 'пон', 'вто', 'сря', 'чет', 'пет', 'съб'] - var weekdaysFull = ['неделя', 'понеделник', 'вторник', 'сряда', 'четвъртък', 'петък', 'събота'] - var meridiem = ['сутринта', 'на обяд', 'следобед', 'вечерта'] - - var timeOfDay = function (date) { - var hours = date.getHours() - if (hours >= 4 && hours < 12) { - return meridiem[0] - } else if (hours >= 12 && hours < 14) { - return meridiem[1] - } else if (hours >= 14 && hours < 17) { - return meridiem[2] - } else { - return meridiem[3] - } - } - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': timeOfDay, - - // am, pm - 'a': timeOfDay, - - // a.m., p.m. - 'aa': timeOfDay - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - var rem100 = number % 100 - if (rem100 > 20 || rem100 < 10) { - switch (rem100 % 10) { - case 1: - return number + '-ви' - case 2: - return number + '-ри' - } - } - return number + '-и' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 17 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: "menys d'un segon", - other: 'menys de {{count}} segons' - }, - - xSeconds: { - one: '1 segon', - other: '{{count}} segons' - }, - - halfAMinute: 'mig minut', - - lessThanXMinutes: { - one: "menys d'un minut", - other: 'menys de {{count}} minuts' - }, - - xMinutes: { - one: '1 minut', - other: '{{count}} minuts' - }, - - aboutXHours: { - one: 'aproximadament una hora', - other: 'aproximadament {{count}} hores' - }, - - xHours: { - one: '1 hora', - other: '{{count}} hores' - }, - - xDays: { - one: '1 dia', - other: '{{count}} dies' - }, - - aboutXMonths: { - one: 'aproximadament un mes', - other: 'aproximadament {{count}} mesos' - }, - - xMonths: { - one: '1 mes', - other: '{{count}} mesos' - }, - - aboutXYears: { - one: 'aproximadament un any', - other: 'aproximadament {{count}} anys' - }, - - xYears: { - one: '1 any', - other: '{{count}} anys' - }, - - overXYears: { - one: "més d'un any", - other: 'més de {{count}} anys' - }, - - almostXYears: { - one: 'gairebé un any', - other: 'gairebé {{count}} anys' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'en ' + result - } else { - return 'fa ' + result - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['gen', 'feb', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'oct', 'nov', 'des'] - var monthsFull = ['gener', 'febrer', 'març', 'abril', 'maig', 'juny', 'juliol', 'agost', 'setembre', 'octobre', 'novembre', 'desembre'] - var weekdays2char = ['dg', 'dl', 'dt', 'dc', 'dj', 'dv', 'ds'] - var weekdays3char = ['dge', 'dls', 'dts', 'dcs', 'djs', 'dvs', 'dss'] - var weekdaysFull = ['diumenge', 'dilluns', 'dimarts', 'dimecres', 'dijous', 'divendres', 'dissabte'] - var meridiemUppercase = ['AM', 'PM'] - var meridiemLowercase = ['am', 'pm'] - var meridiemFull = ['a.m.', 'p.m.'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - switch (number) { - case 1: - return '1r' - case 2: - return '2n' - case 3: - return '3r' - case 4: - return '4t' - default: - return number + 'è' - } -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 19 */ -/***/ (function(module, exports) { - -function declensionGroup (scheme, count) { - if (count === 1) { - return scheme.one - } - - if (count >= 2 && count <= 4) { - return scheme.twoFour - } - - // if count === null || count === 0 || count >= 5 - return scheme.other -} - -function declension (scheme, count, time) { - var group = declensionGroup(scheme, count) - var finalText = group[time] || group - return finalText.replace('{{count}}', count) -} - -function extractPreposition (token) { - var result = ['lessThan', 'about', 'over', 'almost'].filter(function (preposition) { - return !!token.match(new RegExp('^' + preposition)) - }) - - return result[0] -} - -function prefixPreposition (preposition) { - var translation = '' - - if (preposition === 'almost') { - translation = 'skoro' - } - - if (preposition === 'about') { - translation = 'přibližně' - } - - return translation.length > 0 ? translation + ' ' : '' -} - -function suffixPreposition (preposition) { - var translation = '' - - if (preposition === 'lessThan') { - translation = 'méně než' - } - - if (preposition === 'over') { - translation = 'více než' - } - - return translation.length > 0 ? translation + ' ' : '' -} - -function lowercaseFirstLetter (string) { - return string.charAt(0).toLowerCase() + string.slice(1) -} - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - xSeconds: { - one: { - regular: 'vteřina', - past: 'vteřinou', - future: 'vteřinu' - }, - twoFour: { - regular: '{{count}} vteřiny', - past: '{{count}} vteřinami', - future: '{{count}} vteřiny' - }, - other: { - regular: '{{count}} vteřin', - past: '{{count}} vteřinami', - future: '{{count}} vteřin' - } - }, - - halfAMinute: { - other: { - regular: 'půl minuty', - past: 'půl minutou', - future: 'půl minuty' - } - }, - - xMinutes: { - one: { - regular: 'minuta', - past: 'minutou', - future: 'minutu' - }, - twoFour: { - regular: '{{count}} minuty', - past: '{{count}} minutami', - future: '{{count}} minuty' - }, - other: { - regular: '{{count}} minut', - past: '{{count}} minutami', - future: '{{count}} minut' - } - }, - - xHours: { - one: { - regular: 'hodina', - past: 'hodinou', - future: 'hodinu' - }, - twoFour: { - regular: '{{count}} hodiny', - past: '{{count}} hodinami', - future: '{{count}} hodiny' - }, - other: { - regular: '{{count}} hodin', - past: '{{count}} hodinami', - future: '{{count}} hodin' - } - }, - - xDays: { - one: { - regular: 'den', - past: 'dnem', - future: 'den' - }, - twoFour: { - regular: '{{count}} dni', - past: '{{count}} dny', - future: '{{count}} dni' - }, - other: { - regular: '{{count}} dní', - past: '{{count}} dny', - future: '{{count}} dní' - } - }, - - xMonths: { - one: { - regular: 'měsíc', - past: 'měsícem', - future: 'měsíc' - }, - twoFour: { - regular: '{{count}} měsíce', - past: '{{count}} měsíci', - future: '{{count}} měsíce' - }, - other: { - regular: '{{count}} měsíců', - past: '{{count}} měsíci', - future: '{{count}} měsíců' - } - }, - - xYears: { - one: { - regular: 'rok', - past: 'rokem', - future: 'rok' - }, - twoFour: { - regular: '{{count}} roky', - past: '{{count}} roky', - future: '{{count}} roky' - }, - other: { - regular: '{{count}} roků', - past: '{{count}} roky', - future: '{{count}} roků' - } - } - } - - function localize (token, count, options) { - options = options || {} - - var preposition = extractPreposition(token) || '' - var key = lowercaseFirstLetter(token.substring(preposition.length)) - var scheme = distanceInWordsLocale[key] - - if (!options.addSuffix) { - return prefixPreposition(preposition) + suffixPreposition(preposition) + declension(scheme, count, 'regular') - } - - if (options.comparison > 0) { - return prefixPreposition(preposition) + 'za ' + suffixPreposition(preposition) + declension(scheme, count, 'future') - } else { - return prefixPreposition(preposition) + 'před ' + suffixPreposition(preposition) + declension(scheme, count, 'past') - } - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro'] - var monthsFull = ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'] - var weekdays2char = ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'] - var weekdays3char = ['ned', 'pon', 'úte', 'stř', 'čtv', 'pát', 'sob'] - var weekdaysFull = ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'] - var meridiemUppercase = ['DOP.', 'ODP.'] - var meridiemLowercase = ['dop.', 'odp.'] - var meridiemFull = ['dopoledne', 'odpoledne'] - - var formatters = { - // Month: led, úno, ..., pro - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: leden, únor, ..., prosinec - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: ne, po, ..., so - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: ned, pon, ..., sob - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: neděle, pondělí, ..., sobota - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // DOP., ODP. - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // dop., odp. - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // dopoledne, odpoledne - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return number + '.' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 21 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'mindre end et sekund', - other: 'mindre end {{count}} sekunder' - }, - - xSeconds: { - one: '1 sekund', - other: '{{count}} sekunder' - }, - - halfAMinute: 'et halvt minut', - - lessThanXMinutes: { - one: 'mindre end et minut', - other: 'mindre end {{count}} minutter' - }, - - xMinutes: { - one: '1 minut', - other: '{{count}} minutter' - }, - - aboutXHours: { - one: 'cirka 1 time', - other: 'cirka {{count}} timer' - }, - - xHours: { - one: '1 time', - other: '{{count}} timer' - }, - - xDays: { - one: '1 dag', - other: '{{count}} dage' - }, - - aboutXMonths: { - one: 'cirka 1 måned', - other: 'cirka {{count}} måneder' - }, - - xMonths: { - one: '1 måned', - other: '{{count}} måneder' - }, - - aboutXYears: { - one: 'cirka 1 år', - other: 'cirka {{count}} år' - }, - - xYears: { - one: '1 år', - other: '{{count}} år' - }, - - overXYears: { - one: 'over 1 år', - other: 'over {{count}} år' - }, - - almostXYears: { - one: 'næsten 1 år', - other: 'næsten {{count}} år' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'om ' + result - } else { - return result + ' siden' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'] - var monthsFull = ['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'] - var weekdays2char = ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø'] - var weekdays3char = ['søn', 'man', 'tir', 'ons', 'tor', 'fre', 'lør'] - var weekdaysFull = ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'] - var meridiemUppercase = ['AM', 'PM'] - var meridiemLowercase = ['am', 'pm'] - var meridiemFull = ['a.m.', 'p.m.'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return number + '.' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 23 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - standalone: { - one: 'weniger als eine Sekunde', - other: 'weniger als {{count}} Sekunden' - }, - withPreposition: { - one: 'weniger als einer Sekunde', - other: 'weniger als {{count}} Sekunden' - } - }, - - xSeconds: { - standalone: { - one: 'eine Sekunde', - other: '{{count}} Sekunden' - }, - withPreposition: { - one: 'einer Sekunde', - other: '{{count}} Sekunden' - } - }, - - halfAMinute: { - standalone: 'eine halbe Minute', - withPreposition: 'einer halben Minute' - }, - - lessThanXMinutes: { - standalone: { - one: 'weniger als eine Minute', - other: 'weniger als {{count}} Minuten' - }, - withPreposition: { - one: 'weniger als einer Minute', - other: 'weniger als {{count}} Minuten' - } - }, - - xMinutes: { - standalone: { - one: 'eine Minute', - other: '{{count}} Minuten' - }, - withPreposition: { - one: 'einer Minute', - other: '{{count}} Minuten' - } - }, - - aboutXHours: { - standalone: { - one: 'etwa eine Stunde', - other: 'etwa {{count}} Stunden' - }, - withPreposition: { - one: 'etwa einer Stunde', - other: 'etwa {{count}} Stunden' - } - }, - - xHours: { - standalone: { - one: 'eine Stunde', - other: '{{count}} Stunden' - }, - withPreposition: { - one: 'einer Stunde', - other: '{{count}} Stunden' - } - }, - - xDays: { - standalone: { - one: 'ein Tag', - other: '{{count}} Tage' - }, - withPreposition: { - one: 'einem Tag', - other: '{{count}} Tagen' - } - - }, - - aboutXMonths: { - standalone: { - one: 'etwa ein Monat', - other: 'etwa {{count}} Monate' - }, - withPreposition: { - one: 'etwa einem Monat', - other: 'etwa {{count}} Monaten' - } - }, - - xMonths: { - standalone: { - one: 'ein Monat', - other: '{{count}} Monate' - }, - withPreposition: { - one: 'einem Monat', - other: '{{count}} Monaten' - } - }, - - aboutXYears: { - standalone: { - one: 'etwa ein Jahr', - other: 'etwa {{count}} Jahre' - }, - withPreposition: { - one: 'etwa einem Jahr', - other: 'etwa {{count}} Jahren' - } - }, - - xYears: { - standalone: { - one: 'ein Jahr', - other: '{{count}} Jahre' - }, - withPreposition: { - one: 'einem Jahr', - other: '{{count}} Jahren' - } - }, - - overXYears: { - standalone: { - one: 'mehr als ein Jahr', - other: 'mehr als {{count}} Jahre' - }, - withPreposition: { - one: 'mehr als einem Jahr', - other: 'mehr als {{count}} Jahren' - } - }, - - almostXYears: { - standalone: { - one: 'fast ein Jahr', - other: 'fast {{count}} Jahre' - }, - withPreposition: { - one: 'fast einem Jahr', - other: 'fast {{count}} Jahren' - } - } - } - - function localize (token, count, options) { - options = options || {} - - var usageGroup = options.addSuffix - ? distanceInWordsLocale[token].withPreposition - : distanceInWordsLocale[token].standalone - - var result - if (typeof usageGroup === 'string') { - result = usageGroup - } else if (count === 1) { - result = usageGroup.one - } else { - result = usageGroup.other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'in ' + result - } else { - return 'vor ' + result - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - // Note: in German, the names of days of the week and months are capitalized. - // If you are making a new locale based on this one, check if the same is true for the language you're working on. - // Generally, formatted dates should look like they are in the middle of a sentence, - // e.g. in Spanish language the weekdays and months should be in the lowercase. - var months3char = ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'] - var monthsFull = ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'] - var weekdays2char = ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'] - var weekdays3char = ['Son', 'Mon', 'Die', 'Mit', 'Don', 'Fre', 'Sam'] - var weekdaysFull = ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'] - var meridiemUppercase = ['AM', 'PM'] - var meridiemLowercase = ['am', 'pm'] - var meridiemFull = ['a.m.', 'p.m.'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return number + '.' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 25 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'λιγότερο από ένα δευτερόλεπτο', - other: 'λιγότερο από {{count}} δευτερόλεπτα' - }, - - xSeconds: { - one: '1 δευτερόλεπτο', - other: '{{count}} δευτερόλεπτα' - }, - - halfAMinute: 'μισό λεπτό', - - lessThanXMinutes: { - one: 'λιγότερο από ένα λεπτό', - other: 'λιγότερο από {{count}} λεπτά' - }, - - xMinutes: { - one: '1 λεπτό', - other: '{{count}} λεπτά' - }, - - aboutXHours: { - one: 'περίπου 1 ώρα', - other: 'περίπου {{count}} ώρες' - }, - - xHours: { - one: '1 ώρα', - other: '{{count}} ώρες' - }, - - xDays: { - one: '1 ημέρα', - other: '{{count}} ημέρες' - }, - - aboutXMonths: { - one: 'περίπου 1 μήνας', - other: 'περίπου {{count}} μήνες' - }, - - xMonths: { - one: '1 μήνας', - other: '{{count}} μήνες' - }, - - aboutXYears: { - one: 'περίπου 1 χρόνο', - other: 'περίπου {{count}} χρόνια' - }, - - xYears: { - one: '1 χρόνο', - other: '{{count}} χρόνια' - }, - - overXYears: { - one: 'πάνω από 1 χρόνο', - other: 'πάνω από {{count}} χρόνια' - }, - - almostXYears: { - one: 'περίπου 1 χρόνο', - other: 'περίπου {{count}} χρόνια' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'σε ' + result - } else { - return result + ' πρίν' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιουν', 'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ'] - var monthsFull = ['Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος'] - var monthsGenitive = ['Ιανουαρίου', 'Φεβρουαρίου', 'Μαρτίου', 'Απριλίου', 'Μαΐου', 'Ιουνίου', 'Ιουλίου', 'Αυγούστου', 'Σεπτεμβρίου', 'Οκτωβρίου', 'Νοεμβρίου', 'Δεκεμβρίου'] - var weekdays2char = ['Κυ', 'Δε', 'Τρ', 'Τε', 'Πέ', 'Πα', 'Σά'] - var weekdays3char = ['Κυρ', 'Δευ', 'Τρί', 'Τετ', 'Πέμ', 'Παρ', 'Σάβ'] - var weekdaysFull = ['Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο'] - var meridiemUppercase = ['ΠΜ', 'ΜΜ'] - var meridiemLowercase = ['πμ', 'μμ'] - var meridiemFull = ['π.μ.', 'μ.μ.'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalGenders = { - 'M': 'ος', - 'D': 'η', - 'DDD': 'η', - 'd': 'η', - 'Q': 'ο', - 'W': 'η' - } - var ordinalKeys = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalKeys.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return formatters[formatterToken](date) + ordinalGenders[formatterToken] - } - }) - - // Generate genitive variant of full months - var formatsWithGenitive = ['D', 'Do', 'DD'] - formatsWithGenitive.forEach(function (formatterToken) { - formatters[formatterToken + ' MMMM'] = function (date, commonFormatters) { - var formatter = formatters[formatterToken] || commonFormatters[formatterToken] - return formatter(date, commonFormatters) + ' ' + monthsGenitive[date.getMonth()] - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 27 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'malpli ol sekundo', - other: 'malpli ol {{count}} sekundoj' - }, - - xSeconds: { - one: '1 sekundo', - other: '{{count}} sekundoj' - }, - - halfAMinute: 'duonminuto', - - lessThanXMinutes: { - one: 'malpli ol minuto', - other: 'malpli ol {{count}} minutoj' - }, - - xMinutes: { - one: '1 minuto', - other: '{{count}} minutoj' - }, - - aboutXHours: { - one: 'proksimume 1 horo', - other: 'proksimume {{count}} horoj' - }, - - xHours: { - one: '1 horo', - other: '{{count}} horoj' - }, - - xDays: { - one: '1 tago', - other: '{{count}} tagoj' - }, - - aboutXMonths: { - one: 'proksimume 1 monato', - other: 'proksimume {{count}} monatoj' - }, - - xMonths: { - one: '1 monato', - other: '{{count}} monatoj' - }, - - aboutXYears: { - one: 'proksimume 1 jaro', - other: 'proksimume {{count}} jaroj' - }, - - xYears: { - one: '1 jaro', - other: '{{count}} jaroj' - }, - - overXYears: { - one: 'pli ol 1 jaro', - other: 'pli ol {{count}} jaroj' - }, - - almostXYears: { - one: 'preskaŭ 1 jaro', - other: 'preskaŭ {{count}} jaroj' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'post ' + result - } else { - return 'antaŭ ' + result - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aŭg', 'sep', 'okt', 'nov', 'dec'] - var monthsFull = ['januaro', 'februaro', 'marto', 'aprilo', 'majo', 'junio', 'julio', 'aŭgusto', 'septembro', 'oktobro', 'novembro', 'decembro'] - var weekdays2char = ['di', 'lu', 'ma', 'me', 'ĵa', 've', 'sa'] - var weekdays3char = ['dim', 'lun', 'mar', 'mer', 'ĵaŭ', 'ven', 'sab'] - var weekdaysFull = ['dimanĉo', 'lundo', 'mardo', 'merkredo', 'ĵaŭdo', 'vendredo', 'sabato'] - var meridiemUppercase = ['A.T.M.', 'P.T.M.'] - var meridiemLowercase = ['a.t.m.', 'p.t.m.'] - var meridiemFull = ['antaŭtagmeze', 'posttagmeze'] - - var formatters = { - // Month: jan, feb, ..., deс - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: januaro, februaro, ..., decembro - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: di, lu, ..., sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: dim, lun, ..., sab - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: dimanĉo, lundo, ..., sabato - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // A.T.M., P.T.M. - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // a.t.m., p.t.m. - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // antaŭtagmeze, posttagmeze - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return formatters[formatterToken](date) + '-a' - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 29 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'menos de un segundo', - other: 'menos de {{count}} segundos' - }, - - xSeconds: { - one: '1 segundo', - other: '{{count}} segundos' - }, - - halfAMinute: 'medio minuto', - - lessThanXMinutes: { - one: 'menos de un minuto', - other: 'menos de {{count}} minutos' - }, - - xMinutes: { - one: '1 minuto', - other: '{{count}} minutos' - }, - - aboutXHours: { - one: 'alrededor de 1 hora', - other: 'alrededor de {{count}} horas' - }, - - xHours: { - one: '1 hora', - other: '{{count}} horas' - }, - - xDays: { - one: '1 día', - other: '{{count}} días' - }, - - aboutXMonths: { - one: 'alrededor de 1 mes', - other: 'alrededor de {{count}} meses' - }, - - xMonths: { - one: '1 mes', - other: '{{count}} meses' - }, - - aboutXYears: { - one: 'alrededor de 1 año', - other: 'alrededor de {{count}} años' - }, - - xYears: { - one: '1 año', - other: '{{count}} años' - }, - - overXYears: { - one: 'más de 1 año', - other: 'más de {{count}} años' - }, - - almostXYears: { - one: 'casi 1 año', - other: 'casi {{count}} años' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'en ' + result - } else { - return 'hace ' + result - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'] - var monthsFull = ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'] - var weekdays2char = ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sa'] - var weekdays3char = ['dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb'] - var weekdaysFull = ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'] - var meridiemUppercase = ['AM', 'PM'] - var meridiemLowercase = ['am', 'pm'] - var meridiemFull = ['a.m.', 'p.m.'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return number + 'º' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 31 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - function futureSeconds (text) { - return text.replace(/sekuntia?/, 'sekunnin') - } - - function futureMinutes (text) { - return text.replace(/minuuttia?/, 'minuutin') - } - - function futureHours (text) { - return text.replace(/tuntia?/, 'tunnin') - } - - function futureDays (text) { - return text.replace(/päivää?/, 'päivän') - } - - function futureMonths (text) { - return text.replace(/(kuukausi|kuukautta)/, 'kuukauden') - } - - function futureYears (text) { - return text.replace(/(vuosi|vuotta)/, 'vuoden') - } - - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'alle sekunti', - other: 'alle {{count}} sekuntia', - futureTense: futureSeconds - }, - - xSeconds: { - one: 'sekunti', - other: '{{count}} sekuntia', - futureTense: futureSeconds - }, - - halfAMinute: { - one: 'puoli minuuttia', - other: 'puoli minuuttia', - futureTense: function (text) { - return 'puolen minuutin' - } - }, - - lessThanXMinutes: { - one: 'alle minuutti', - other: 'alle {{count}} minuuttia', - futureTense: futureMinutes - }, - - xMinutes: { - one: 'minuutti', - other: '{{count}} minuuttia', - futureTense: futureMinutes - }, - - aboutXHours: { - one: 'noin tunti', - other: 'noin {{count}} tuntia', - futureTense: futureHours - }, - - xHours: { - one: 'tunti', - other: '{{count}} tuntia', - futureTense: futureHours - }, - - xDays: { - one: 'päivä', - other: '{{count}} päivää', - futureTense: futureDays - }, - - aboutXMonths: { - one: 'noin kuukausi', - other: 'noin {{count}} kuukautta', - futureTense: futureMonths - }, - - xMonths: { - one: 'kuukausi', - other: '{{count}} kuukautta', - futureTense: futureMonths - }, - - aboutXYears: { - one: 'noin vuosi', - other: 'noin {{count}} vuotta', - futureTense: futureYears - }, - - xYears: { - one: 'vuosi', - other: '{{count}} vuotta', - futureTense: futureYears - }, - - overXYears: { - one: 'yli vuosi', - other: 'yli {{count}} vuotta', - futureTense: futureYears - }, - - almostXYears: { - one: 'lähes vuosi', - other: 'lähes {{count}} vuotta', - futureTense: futureYears - } - } - - function localize (token, count, options) { - options = options || {} - - var distance = distanceInWordsLocale[token] - var result = count === 1 ? distance.one : distance.other.replace('{{count}}', count) - - if (options.addSuffix) { - if (options.comparison > 0) { - return distance.futureTense(result) + ' kuluttua' - } else { - return result + ' sitten' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['tammi', 'helmi', 'maalis', 'huhti', 'touko', 'kesä', 'heinä', 'elo', 'syys', 'loka', 'marras', 'joulu'] - var monthsFull = ['tammikuu', 'helmikuu', 'maaliskuu', 'huhtikuu', 'toukokuu', 'kesäkuu', 'heinäkuu', 'elokuu', 'syyskuu', 'lokakuu', 'marraskuu', 'joulukuu'] - var weekdays2char = ['su', 'ma', 'ti', 'ke', 'to', 'pe', 'la'] - var weekdaysFull = ['sunnuntai', 'maanantai', 'tiistai', 'keskiviikko', 'torstai', 'perjantai', 'lauantai'] - - // In Finnish `a.m.` / `p.m.` are virtually never used, but it seems `AP` (aamupäivä) / `IP` (iltapäivä) are acknowleded terms: - // https://fi.wikipedia.org/wiki/24_tunnin_kello - function meridiem (date) { - return date.getHours() < 12 ? 'AP' : 'IP' - } - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - // Finnish doesn't use two-char weekdays - return weekdays2char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': meridiem, - - // am, pm - 'a': meridiem, - - // a.m., p.m. - 'aa': meridiem - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return formatters[formatterToken](date).toString() + '.' - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 33 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'mas maliit sa isang segundo', - other: 'mas maliit sa {{count}} segundo' - }, - - xSeconds: { - one: '1 segundo', - other: '{{count}} segundo' - }, - - halfAMinute: 'kalahating minuto', - - lessThanXMinutes: { - one: 'mas maliit sa isang minuto', - other: 'mas maliit sa {{count}} minuto' - }, - - xMinutes: { - one: '1 minuto', - other: '{{count}} minuto' - }, - - aboutXHours: { - one: 'mga 1 oras', - other: 'mga {{count}} oras' - }, - - xHours: { - one: '1 oras', - other: '{{count}} oras' - }, - - xDays: { - one: '1 araw', - other: '{{count}} araw' - }, - - aboutXMonths: { - one: 'mga 1 buwan', - other: 'mga {{count}} buwan' - }, - - xMonths: { - one: '1 buwan', - other: '{{count}} buwan' - }, - - aboutXYears: { - one: 'mga 1 taon', - other: 'mga {{count}} taon' - }, - - xYears: { - one: '1 taon', - other: '{{count}} taon' - }, - - overXYears: { - one: 'higit sa 1 taon', - other: 'higit sa {{count}} taon' - }, - - almostXYears: { - one: 'halos 1 taon', - other: 'halos {{count}} taon' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'sa loob ng ' + result - } else { - return result + ' ang nakalipas' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['Ene', 'Peb', 'Mar', 'Abr', 'May', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis'] - var monthsFull = ['Enero', 'Pebrero', 'Marso', 'Abril', 'Mayo', 'Hunyo', 'Hulyo', 'Agosto', 'Setyembre', 'Oktubre', 'Nobyembre', 'Disyembre'] - var weekdays2char = ['Li', 'Lu', 'Ma', 'Mi', 'Hu', 'Bi', 'Sa'] - var weekdays3char = ['Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab'] - var weekdaysFull = ['Linggo', 'Lunes', 'Martes', 'Miyerkules', 'Huwebes', 'Biyernes', 'Sabado'] - var meridiemUppercase = ['NU', 'NT', 'NH', 'NG'] - var meridiemLowercase = ['nu', 'nt', 'nh', 'ng'] - var meridiemFull = ['ng umaga', 'ng tanghali', 'ng hapon', 'ng gabi'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - if (date.getHours() > 12) { - var modulo = date.getHours() % 12 - if (modulo < 6) { - return meridiemUppercase[2] - } else { - return meridiemUppercase[3] - } - } else if (date.getHours() < 12) { - return meridiemUppercase[0] - } else { - return meridiemUppercase[1] - } - }, - - // am, pm - 'a': function (date) { - if (date.getHours() > 12) { - var modulo = date.getHours() % 12 - if (modulo < 6) { - return meridiemLowercase[2] - } else { - return meridiemLowercase[3] - } - } else if (date.getHours() < 12) { - return meridiemLowercase[0] - } else { - return meridiemLowercase[1] - } - }, - - // a.m., p.m. - 'aa': function (date) { - if (date.getHours() > 12) { - var modulo = date.getHours() % 12 - if (modulo < 6) { - return meridiemFull[2] - } else { - return meridiemFull[3] - } - } else if (date.getHours() < 12) { - return meridiemFull[0] - } else { - return meridiemFull[1] - } - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return 'ika-' + number -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 35 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'moins d’une seconde', - other: 'moins de {{count}} secondes' - }, - - xSeconds: { - one: '1 seconde', - other: '{{count}} secondes' - }, - - halfAMinute: '30 secondes', - - lessThanXMinutes: { - one: 'moins d’une minute', - other: 'moins de {{count}} minutes' - }, - - xMinutes: { - one: '1 minute', - other: '{{count}} minutes' - }, - - aboutXHours: { - one: 'environ 1 heure', - other: 'environ {{count}} heures' - }, - - xHours: { - one: '1 heure', - other: '{{count}} heures' - }, - - xDays: { - one: '1 jour', - other: '{{count}} jours' - }, - - aboutXMonths: { - one: 'environ 1 mois', - other: 'environ {{count}} mois' - }, - - xMonths: { - one: '1 mois', - other: '{{count}} mois' - }, - - aboutXYears: { - one: 'environ 1 an', - other: 'environ {{count}} ans' - }, - - xYears: { - one: '1 an', - other: '{{count}} ans' - }, - - overXYears: { - one: 'plus d’un an', - other: 'plus de {{count}} ans' - }, - - almostXYears: { - one: 'presqu’un an', - other: 'presque {{count}} ans' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'dans ' + result - } else { - return 'il y a ' + result - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juill.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'] - var monthsFull = ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'] - var weekdays2char = ['di', 'lu', 'ma', 'me', 'je', 've', 'sa'] - var weekdays3char = ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'] - var weekdaysFull = ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'] - var meridiemUppercase = ['AM', 'PM'] - var meridiemLowercase = ['am', 'pm'] - var meridiemFull = ['du matin', 'de l’après-midi', 'du soir'] - - var formatters = { - // Month: Jan, Feb, …, Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, …, December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, …, Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, …, Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, …, Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - var hours = date.getHours() - - if (hours <= 12) { - return meridiemFull[0] - } - - if (hours <= 16) { - return meridiemFull[1] - } - - return meridiemFull[2] - }, - - // ISO week, ordinal version: 1st, 2nd, …, 53rd - // NOTE: Week has feminine grammatical gender in French: semaine - 'Wo': function (date, formatters) { - return feminineOrdinal(formatters.W(date)) - } - } - - // Generate ordinal version of formatters: M → Mo, D → Do, etc. - // NOTE: For words with masculine grammatical gender in French: mois, jour, trimestre - var formatterTokens = ['M', 'D', 'DDD', 'd', 'Q'] - formatterTokens.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return masculineOrdinal(formatters[formatterToken](date)) - } - }) - - // Special case for day of month ordinals in long date format context: - // 1er mars, 2 mars, 3 mars, … - // See https://github.com/date-fns/date-fns/issues/437 - // - // NOTE: The below implementation works because parsing of tokens inside a - // format string is done by a greedy regular expression, i.e. longer tokens - // have priority. E.g. formatter for "Do MMMM" has priority over individual - // formatters for "Do" and "MMMM". - var monthsTokens = ['MMM', 'MMMM'] - monthsTokens.forEach(function (monthToken) { - formatters['Do ' + monthToken] = function (date, commonFormatters) { - var dayOfMonthToken = date.getDate() === 1 - ? 'Do' - : 'D' - var dayOfMonthFormatter = formatters[dayOfMonthToken] || commonFormatters[dayOfMonthToken] - - return dayOfMonthFormatter(date, commonFormatters) + ' ' + formatters[monthToken](date) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function masculineOrdinal (number) { - if (number === 1) { - return '1er' - } - - return number + 'e' -} - -function feminineOrdinal (number) { - if (number === 1) { - return '1re' - } - - return number + 'e' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 37 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: { - standalone: 'manje od 1 sekunde', - withPrepositionAgo: 'manje od 1 sekunde', - withPrepositionIn: 'manje od 1 sekundu' - }, - dual: 'manje od {{count}} sekunde', - other: 'manje od {{count}} sekundi' - }, - - xSeconds: { - one: { - standalone: '1 sekunda', - withPrepositionAgo: '1 sekunde', - withPrepositionIn: '1 sekundu' - }, - dual: '{{count}} sekunde', - other: '{{count}} sekundi' - }, - - halfAMinute: 'pola minute', - - lessThanXMinutes: { - one: { - standalone: 'manje od 1 minute', - withPrepositionAgo: 'manje od 1 minute', - withPrepositionIn: 'manje od 1 minutu' - }, - dual: 'manje od {{count}} minute', - other: 'manje od {{count}} minuta' - }, - - xMinutes: { - one: { - standalone: '1 minuta', - withPrepositionAgo: '1 minute', - withPrepositionIn: '1 minutu' - }, - dual: '{{count}} minute', - other: '{{count}} minuta' - }, - - aboutXHours: { - one: { - standalone: 'oko 1 sat', - withPrepositionAgo: 'oko 1 sat', - withPrepositionIn: 'oko 1 sat' - }, - dual: 'oko {{count}} sata', - other: 'oko {{count}} sati' - }, - - xHours: { - one: { - standalone: '1 sat', - withPrepositionAgo: '1 sat', - withPrepositionIn: '1 sat' - }, - dual: '{{count}} sata', - other: '{{count}} sati' - }, - - xDays: { - one: { - standalone: '1 dan', - withPrepositionAgo: '1 dan', - withPrepositionIn: '1 dan' - }, - dual: '{{count}} dana', - other: '{{count}} dana' - }, - - aboutXMonths: { - one: { - standalone: 'oko 1 mjesec', - withPrepositionAgo: 'oko 1 mjesec', - withPrepositionIn: 'oko 1 mjesec' - }, - dual: 'oko {{count}} mjeseca', - other: 'oko {{count}} mjeseci' - }, - - xMonths: { - one: { - standalone: '1 mjesec', - withPrepositionAgo: '1 mjesec', - withPrepositionIn: '1 mjesec' - }, - dual: '{{count}} mjeseca', - other: '{{count}} mjeseci' - }, - - aboutXYears: { - one: { - standalone: 'oko 1 godinu', - withPrepositionAgo: 'oko 1 godinu', - withPrepositionIn: 'oko 1 godinu' - }, - dual: 'oko {{count}} godine', - other: 'oko {{count}} godina' - }, - - xYears: { - one: { - standalone: '1 godina', - withPrepositionAgo: '1 godine', - withPrepositionIn: '1 godinu' - }, - dual: '{{count}} godine', - other: '{{count}} godina' - }, - - overXYears: { - one: { - standalone: 'preko 1 godinu', - withPrepositionAgo: 'preko 1 godinu', - withPrepositionIn: 'preko 1 godinu' - }, - dual: 'preko {{count}} godine', - other: 'preko {{count}} godina' - }, - - almostXYears: { - one: { - standalone: 'gotovo 1 godinu', - withPrepositionAgo: 'gotovo 1 godinu', - withPrepositionIn: 'gotovo 1 godinu' - }, - dual: 'gotovo {{count}} godine', - other: 'gotovo {{count}} godina' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - if (options.addSuffix) { - if (options.comparison > 0) { - result = distanceInWordsLocale[token].one.withPrepositionIn - } else { - result = distanceInWordsLocale[token].one.withPrepositionAgo - } - } else { - result = distanceInWordsLocale[token].one.standalone - } - } else if ( - count % 10 > 1 && count % 10 < 5 && // if last digit is between 2 and 4 - String(count).substr(-2, 1) !== '1' // unless the 2nd to last digit is "1" - ) { - result = distanceInWordsLocale[token].dual.replace('{{count}}', count) - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'za ' + result - } else { - return 'prije ' + result - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 38 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['sij', 'velj', 'ožu', 'tra', 'svi', 'lip', 'srp', 'kol', 'ruj', 'lis', 'stu', 'pro'] - var monthsFull = ['siječanj', 'veljača', 'ožujak', 'travanj', 'svibanj', 'lipanj', 'srpanj', 'kolovoz', 'rujan', 'listopad', 'studeni', 'prosinac'] - var monthsGenitive = ['siječnja', 'veljače', 'ožujka', 'travnja', 'svibnja', 'lipnja', 'srpnja', 'kolovoza', 'rujna', 'listopada', 'studenog', 'prosinca'] - var weekdays2char = ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'] - var weekdays3char = ['ned', 'pon', 'uto', 'sri', 'čet', 'pet', 'sub'] - var weekdaysFull = ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'] - var meridiemUppercase = ['ujutro', 'popodne'] - var meridiemLowercase = ['ujutro', 'popodne'] - var meridiemFull = ['ujutro', 'popodne'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - // Generate formatters like 'D MMMM', where the month is in the genitive case - var monthsGenitiveFormatters = ['D', 'Do', 'DD'] - monthsGenitiveFormatters.forEach(function (formatterToken) { - formatters[formatterToken + ' MMM'] = function (date, commonFormatters) { - var formatter = formatters[formatterToken] || commonFormatters[formatterToken] - return formatter(date, commonFormatters) + ' ' + monthsGenitive[date.getMonth()] - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return number + '.' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 39 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'kevesebb, mint egy másodperce', - other: 'kevesebb, mint {{count}} másodperce' - }, - - xSeconds: { - one: '1 másodperce', - other: '{{count}} másodperce' - }, - - halfAMinute: 'fél perce', - - lessThanXMinutes: { - one: 'kevesebb, mint egy perce', - other: 'kevesebb, mint {{count}} perce' - }, - - xMinutes: { - one: '1 perce', - other: '{{count}} perce' - }, - - aboutXHours: { - one: 'közel 1 órája', - other: 'közel {{count}} órája' - }, - - xHours: { - one: '1 órája', - other: '{{count}} órája' - }, - - xDays: { - one: '1 napja', - other: '{{count}} napja' - }, - - aboutXMonths: { - one: 'közel 1 hónapja', - other: 'közel {{count}} hónapja' - }, - - xMonths: { - one: '1 hónapja', - other: '{{count}} hónapja' - }, - - aboutXYears: { - one: 'közel 1 éve', - other: 'közel {{count}} éve' - }, - - xYears: { - one: '1 éve', - other: '{{count}} éve' - }, - - overXYears: { - one: 'több, mint 1 éve', - other: 'több, mint {{count}} éve' - }, - - almostXYears: { - one: 'majdnem 1 éve', - other: 'majdnem {{count}} éve' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return '' + result - } else { - return result + '' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 40 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - // Note: in English, the names of days of the week and months are capitalized. - // If you are making a new locale based on this one, check if the same is true for the language you're working on. - // Generally, formatted dates should look like they are in the middle of a sentence, - // e.g. in Spanish language the weekdays and months should be in the lowercase. - var months3char = ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún', 'Júl', 'Aug', 'Sze', 'Okt', 'Nov', 'Dec'] - var monthsFull = ['Január', 'Február', 'Március', 'Április', 'Május', 'Június', 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'] - var weekdays2char = ['Va', 'Hé', 'Ke', 'Sze', 'Cs', 'Pé', 'Szo'] - var weekdays3char = ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'] - var weekdaysFull = ['Vasárnap', 'Hétfő', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'] - var meridiemUppercase = ['DE', 'DU'] - var meridiemLowercase = ['de', 'du'] - var meridiemFull = ['délelőtt', 'délután'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - var rem100 = number % 100 - if (rem100 > 20 || rem100 < 10) { - switch (rem100 % 10) { - case 1: - return number + 'st' - case 2: - return number + 'nd' - case 3: - return number + 'rd' - } - } - return number + 'th' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 41 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'kurang dari 1 detik', - other: 'kurang dari {{count}} detik' - }, - - xSeconds: { - one: '1 detik', - other: '{{count}} detik' - }, - - halfAMinute: 'setengah menit', - - lessThanXMinutes: { - one: 'kurang dari 1 menit', - other: 'kurang dari {{count}} menit' - }, - - xMinutes: { - one: '1 menit', - other: '{{count}} menit' - }, - - aboutXHours: { - one: 'sekitar 1 jam', - other: 'sekitar {{count}} jam' - }, - - xHours: { - one: '1 jam', - other: '{{count}} jam' - }, - - xDays: { - one: '1 hari', - other: '{{count}} hari' - }, - - aboutXMonths: { - one: 'sekitar 1 bulan', - other: 'sekitar {{count}} bulan' - }, - - xMonths: { - one: '1 bulan', - other: '{{count}} bulan' - }, - - aboutXYears: { - one: 'sekitar 1 tahun', - other: 'sekitar {{count}} tahun' - }, - - xYears: { - one: '1 tahun', - other: '{{count}} tahun' - }, - - overXYears: { - one: 'lebih dari 1 tahun', - other: 'lebih dari {{count}} tahun' - }, - - almostXYears: { - one: 'hampir 1 tahun', - other: 'hampir {{count}} tahun' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'dalam waktu ' + result - } else { - return result + ' yang lalu' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 42 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - // Note: in Indonesian, the names of days of the week and months are capitalized. - // If you are making a new locale based on this one, check if the same is true for the language you're working on. - // Generally, formatted dates should look like they are in the middle of a sentence, - // e.g. in Spanish language the weekdays and months should be in the lowercase. - var months3char = ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agu', 'Sep', 'Okt', 'Nov', 'Des'] - var monthsFull = ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'] - var weekdays2char = ['Mi', 'Sn', 'Sl', 'Ra', 'Ka', 'Ju', 'Sa'] - var weekdays3char = ['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'] - var weekdaysFull = ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu'] - var meridiemUppercase = ['AM', 'PM'] - var meridiemLowercase = ['am', 'pm'] - var meridiemFull = ['a.m.', 'p.m.'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - switch (number) { - case 1: - return 'pertama' - case 2: - return 'kedua' - case 3: - return 'ketiga' - default: - return 'ke-' + number - } -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 43 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'minna en 1 sekúnda', - other: 'minna en {{count}} sekúndur' - }, - - xSeconds: { - one: '1 sekúnda', - other: '{{count}} sekúndur' - }, - - halfAMinute: 'hálf mínúta', - - lessThanXMinutes: { - one: 'minna en 1 mínúta', - other: 'minna en {{count}} mínútur' - }, - - xMinutes: { - one: '1 mínúta', - other: '{{count}} mínútur' - }, - - aboutXHours: { - one: 'u.þ.b. 1 klukkustund', - other: 'u.þ.b. {{count}} klukkustundir' - }, - - xHours: { - one: '1 klukkustund', - other: '{{count}} klukkustundir' - }, - - xDays: { - one: '1 dagur', - other: '{{count}} dagar' - }, - - aboutXMonths: { - one: 'u.þ.b. 1 mánuður', - other: 'u.þ.b. {{count}} mánuðir' - }, - - xMonths: { - one: '1 mánuður', - other: '{{count}} mánuðir' - }, - - aboutXYears: { - one: 'u.þ.b. 1 ár', - other: 'u.þ.b. {{count}} ár' - }, - - xYears: { - one: '1 ár', - other: '{{count}} ár' - }, - - overXYears: { - one: 'meira en 1 ár', - other: 'meira en {{count}} ár' - }, - - almostXYears: { - one: 'næstum 1 ár', - other: 'næstum {{count}} ár' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'í ' + result - } else { - return result + ' síðan' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 44 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['jan', 'feb', 'mar', 'apr', 'maí', 'jún', 'júl', 'ágú', 'sep', 'okt', 'nóv', 'des'] - var monthsFull = ['janúar', 'febrúar', 'mars', 'apríl', 'maí', 'júní', 'júlí', 'ágúst', 'september', 'október', 'nóvember', 'desember'] - var weekdays2char = ['su', 'má', 'þr', 'mi', 'fi', 'fö', 'la'] - var weekdays3char = ['sun', 'mán', 'þri', 'mið', 'fim', 'fös', 'lau'] - var weekdaysFull = ['sunnudaginn', 'mánudaginn', 'þriðjudaginn', 'miðvikudaginn', 'fimmtudaginn', 'föstudaginn', 'laugardaginn'] - var meridiemUppercase = ['AM', 'PM'] - var meridiemLowercase = ['am', 'pm'] - var meridiemFull = ['a.m.', 'p.m.'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return '' + number -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 45 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'meno di un secondo', - other: 'meno di {{count}} secondi' - }, - - xSeconds: { - one: 'un secondo', - other: '{{count}} secondi' - }, - - halfAMinute: 'alcuni secondi', - - lessThanXMinutes: { - one: 'meno di un minuto', - other: 'meno di {{count}} minuti' - }, - - xMinutes: { - one: 'un minuto', - other: '{{count}} minuti' - }, - - aboutXHours: { - one: 'circa un\'ora', - other: 'circa {{count}} ore' - }, - - xHours: { - one: 'un\'ora', - other: '{{count}} ore' - }, - - xDays: { - one: 'un giorno', - other: '{{count}} giorni' - }, - - aboutXMonths: { - one: 'circa un mese', - other: 'circa {{count}} mesi' - }, - - xMonths: { - one: 'un mese', - other: '{{count}} mesi' - }, - - aboutXYears: { - one: 'circa un anno', - other: 'circa {{count}} anni' - }, - - xYears: { - one: 'un anno', - other: '{{count}} anni' - }, - - overXYears: { - one: 'più di un anno', - other: 'più di {{count}} anni' - }, - - almostXYears: { - one: 'quasi un anno', - other: 'quasi {{count}} anni' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'tra ' + result - } else { - return result + ' fa' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 46 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'] - var monthsFull = ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'] - var weekdays2char = ['do', 'lu', 'ma', 'me', 'gi', 've', 'sa'] - var weekdays3char = ['dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab'] - var weekdaysFull = ['domenica', 'lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato'] - var meridiemUppercase = ['AM', 'PM'] - var meridiemLowercase = ['am', 'pm'] - var meridiemFull = ['a.m.', 'p.m.'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return number + 'º' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 47 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: '1秒以下', - other: '{{count}}秒以下' - }, - - xSeconds: { - one: '1秒', - other: '{{count}}秒' - }, - - halfAMinute: '30秒ぐらい', - - lessThanXMinutes: { - one: '1分以下', - other: '{{count}}分以下' - }, - - xMinutes: { - one: '1分', - other: '{{count}}分' - }, - - aboutXHours: { - one: '1時間ぐらい', - other: '{{count}}時間ぐらい' - }, - - xHours: { - one: '1時間', - other: '{{count}}時間' - }, - - xDays: { - one: '1日', - other: '{{count}}日' - }, - - aboutXMonths: { - one: '1ヶ月ぐらい', - other: '{{count}}ヶ月ぐらい' - }, - - xMonths: { - one: '1ヶ月', - other: '{{count}}ヶ月' - }, - - aboutXYears: { - one: '1年ぐらい', - other: '{{count}}年ぐらい' - }, - - xYears: { - one: '1年', - other: '{{count}}年' - }, - - overXYears: { - one: '1年以上', - other: '{{count}}年以上' - }, - - almostXYears: { - one: '1年以下', - other: '{{count}}年以下' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return result + '後' - } else { - return result + '前' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 48 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] - var monthsFull = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'] - var weekdays2char = ['日', '月', '火', '水', '木', '金', '土'] - var weekdays3char = ['日曜', '月曜', '火曜', '水曜', '木曜', '金曜', '土曜'] - var weekdaysFull = ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'] - var meridiemUppercase = ['午前', '午後'] - var meridiemLowercase = ['午前', '午後'] - var meridiemFull = ['午前', '午後'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return number + '日' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 49 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: '1초 미만', - other: '{{count}}초 미만' - }, - - xSeconds: { - one: '1초', - other: '{{count}}초' - }, - - halfAMinute: '30초', - - lessThanXMinutes: { - one: '1분 미만', - other: '{{count}}분 미만' - }, - - xMinutes: { - one: '1분', - other: '{{count}}분' - }, - - aboutXHours: { - one: '약 1시간', - other: '약 {{count}}시간' - }, - - xHours: { - one: '1시간', - other: '{{count}}시간' - }, - - xDays: { - one: '1일', - other: '{{count}}일' - }, - - aboutXMonths: { - one: '약 1개월', - other: '약 {{count}}개월' - }, - - xMonths: { - one: '1개월', - other: '{{count}}개월' - }, - - aboutXYears: { - one: '약 1년', - other: '약 {{count}}년' - }, - - xYears: { - one: '1년', - other: '{{count}}년' - }, - - overXYears: { - one: '1년 이상', - other: '{{count}}년 이상' - }, - - almostXYears: { - one: '거의 1년', - other: '거의 {{count}}년' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return result + ' 후' - } else { - return result + ' 전' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'] - var monthsFull = ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'] - var weekdays2char = ['일', '월', '화', '수', '목', '금', '토'] - var weekdays3char = ['일', '월', '화', '수', '목', '금', '토'] - var weekdaysFull = ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'] - var meridiemUppercase = ['오전', '오후'] - var meridiemLowercase = ['오전', '오후'] - var meridiemFull = ['오전', '오후'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return number + '일' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 51 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'помалку од секунда', - other: 'помалку од {{count}} секунди' - }, - - xSeconds: { - one: '1 секунда', - other: '{{count}} секунди' - }, - - halfAMinute: 'половина минута', - - lessThanXMinutes: { - one: 'помалку од минута', - other: 'помалку од {{count}} минути' - }, - - xMinutes: { - one: '1 минута', - other: '{{count}} минути' - }, - - aboutXHours: { - one: 'околу 1 час', - other: 'околу {{count}} часа' - }, - - xHours: { - one: '1 час', - other: '{{count}} часа' - }, - - xDays: { - one: '1 ден', - other: '{{count}} дена' - }, - - aboutXMonths: { - one: 'околу 1 месец', - other: 'околу {{count}} месеци' - }, - - xMonths: { - one: '1 месец', - other: '{{count}} месеци' - }, - - aboutXYears: { - one: 'околу 1 година', - other: 'околу {{count}} години' - }, - - xYears: { - one: '1 година', - other: '{{count}} години' - }, - - overXYears: { - one: 'повеќе од 1 година', - other: 'повеќе од {{count}} години' - }, - - almostXYears: { - one: 'безмалку 1 година', - other: 'безмалку {{count}} години' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'за ' + result - } else { - return 'пред ' + result - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 52 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['јан', 'фев', 'мар', 'апр', 'мај', 'јун', 'јул', 'авг', 'сеп', 'окт', 'ное', 'дек'] - var monthsFull = ['јануари', 'февруари', 'март', 'април', 'мај', 'јуни', 'јули', 'август', 'септември', 'октомври', 'ноември', 'декември'] - var weekdays2char = ['не', 'по', 'вт', 'ср', 'че', 'пе', 'са'] - var weekdays3char = ['нед', 'пон', 'вто', 'сре', 'чет', 'пет', 'саб'] - var weekdaysFull = ['недела', 'понеделник', 'вторник', 'среда', 'четврток', 'петок', 'сабота'] - var meridiem = ['претпладне', 'попладне'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiem[1] : meridiem[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiem[1] : meridiem[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiem[1] : meridiem[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - var rem100 = number % 100 - if (rem100 > 20 || rem100 < 10) { - switch (rem100 % 10) { - case 1: - return number + '-ви' - case 2: - return number + '-ри' - case 7: - case 8: - return number + '-ми' - } - } - return number + '-ти' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 53 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'mindre enn ett sekund', - other: 'mindre enn {{count}} sekunder' - }, - - xSeconds: { - one: 'ett sekund', - other: '{{count}} sekunder' - }, - - halfAMinute: 'et halvt minutt', - - lessThanXMinutes: { - one: 'mindre enn ett minutt', - other: 'mindre enn {{count}} minutter' - }, - - xMinutes: { - one: 'ett minutt', - other: '{{count}} minutter' - }, - - aboutXHours: { - one: 'rundt en time', - other: 'rundt {{count}} timer' - }, - - xHours: { - one: 'en time', - other: '{{count}} timer' - }, - - xDays: { - one: 'en dag', - other: '{{count}} dager' - }, - - aboutXMonths: { - one: 'rundt en måned', - other: 'rundt {{count}} måneder' - }, - - xMonths: { - one: 'en måned', - other: '{{count}} måneder' - }, - - aboutXYears: { - one: 'rundt ett år', - other: 'rundt {{count}} år' - }, - - xYears: { - one: 'ett år', - other: '{{count}} år' - }, - - overXYears: { - one: 'over ett år', - other: 'over {{count}} år' - }, - - almostXYears: { - one: 'nesten ett år', - other: 'nesten {{count}} år' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'om ' + result - } else { - return result + ' siden' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 54 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['jan.', 'feb.', 'mars', 'april', 'mai', 'juni', 'juli', 'aug.', 'sep.', 'okt.', 'nov.', 'des.'] - var monthsFull = ['januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember'] - var weekdays2char = ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø'] - var weekdays3char = ['sø.', 'ma.', 'ti.', 'on.', 'to.', 'fr.', 'lø.'] - var weekdaysFull = ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'] - var meridiemUppercase = ['AM', 'PM'] - var meridiemLowercase = ['am', 'pm'] - var meridiemFull = ['a.m.', 'p.m.'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return number + '.' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 55 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'minder dan een seconde', - other: 'minder dan {{count}} seconden' - }, - - xSeconds: { - one: '1 seconde', - other: '{{count}} seconden' - }, - - halfAMinute: 'een halve minuut', - - lessThanXMinutes: { - one: 'minder dan een minuut', - other: 'minder dan {{count}} minuten' - }, - - xMinutes: { - one: 'een minuut', - other: '{{count}} minuten' - }, - - aboutXHours: { - one: 'ongeveer 1 uur', - other: 'ongeveer {{count}} uur' - }, - - xHours: { - one: '1 uur', - other: '{{count}} uur' - }, - - xDays: { - one: '1 dag', - other: '{{count}} dagen' - }, - - aboutXMonths: { - one: 'ongeveer 1 maand', - other: 'ongeveer {{count}} maanden' - }, - - xMonths: { - one: '1 maand', - other: '{{count}} maanden' - }, - - aboutXYears: { - one: 'ongeveer 1 jaar', - other: 'ongeveer {{count}} jaar' - }, - - xYears: { - one: '1 jaar', - other: '{{count}} jaar' - }, - - overXYears: { - one: 'meer dan 1 jaar', - other: 'meer dan {{count}} jaar' - }, - - almostXYears: { - one: 'bijna 1 jaar', - other: 'bijna {{count}} jaar' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'over ' + result - } else { - return result + ' geleden' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['jan', 'feb', 'mar', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'] - var monthsFull = ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'] - var weekdays2char = ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'] - var weekdays3char = ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'] - var weekdaysFull = ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'] - var meridiemUppercase = ['AM', 'PM'] - var meridiemLowercase = ['am', 'pm'] - var meridiemFull = ['a.m.', 'p.m.'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return number + 'e' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 57 */ -/***/ (function(module, exports) { - -function declensionGroup (scheme, count) { - if (count === 1) { - return scheme.one - } - - var rem100 = count % 100 - - // ends with 11-20 - if (rem100 <= 20 && rem100 > 10) { - return scheme.other - } - - var rem10 = rem100 % 10 - - // ends with 2, 3, 4 - if (rem10 >= 2 && rem10 <= 4) { - return scheme.twoFour - } - - return scheme.other -} - -function declension (scheme, count, time) { - time = time || 'regular' - var group = declensionGroup(scheme, count) - var finalText = group[time] || group - return finalText.replace('{{count}}', count) -} - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: { - regular: 'mniej niż sekunda', - past: 'mniej niż sekundę', - future: 'mniej niż sekundę' - }, - twoFour: 'mniej niż {{count}} sekundy', - other: 'mniej niż {{count}} sekund' - }, - - xSeconds: { - one: { - regular: 'sekunda', - past: 'sekundę', - future: 'sekundę' - }, - twoFour: '{{count}} sekundy', - other: '{{count}} sekund' - }, - - halfAMinute: { - one: 'pół minuty', - twoFour: 'pół minuty', - other: 'pół minuty' - }, - - lessThanXMinutes: { - one: { - regular: 'mniej niż minuta', - past: 'mniej niż minutę', - future: 'mniej niż minutę' - }, - twoFour: 'mniej niż {{count}} minuty', - other: 'mniej niż {{count}} minut' - }, - - xMinutes: { - one: { - regular: 'minuta', - past: 'minutę', - future: 'minutę' - }, - twoFour: '{{count}} minuty', - other: '{{count}} minut' - }, - - aboutXHours: { - one: { - regular: 'około godzina', - past: 'około godziny', - future: 'około godzinę' - }, - twoFour: 'około {{count}} godziny', - other: 'około {{count}} godzin' - }, - - xHours: { - one: { - regular: 'godzina', - past: 'godzinę', - future: 'godzinę' - }, - twoFour: '{{count}} godziny', - other: '{{count}} godzin' - }, - - xDays: { - one: { - regular: 'dzień', - past: 'dzień', - future: '1 dzień' - }, - twoFour: '{{count}} dni', - other: '{{count}} dni' - }, - - aboutXMonths: { - one: 'około miesiąc', - twoFour: 'około {{count}} miesiące', - other: 'około {{count}} miesięcy' - }, - - xMonths: { - one: 'miesiąc', - twoFour: '{{count}} miesiące', - other: '{{count}} miesięcy' - }, - - aboutXYears: { - one: 'około rok', - twoFour: 'około {{count}} lata', - other: 'około {{count}} lat' - }, - - xYears: { - one: 'rok', - twoFour: '{{count}} lata', - other: '{{count}} lat' - }, - - overXYears: { - one: 'ponad rok', - twoFour: 'ponad {{count}} lata', - other: 'ponad {{count}} lat' - }, - - almostXYears: { - one: 'prawie rok', - twoFour: 'prawie {{count}} lata', - other: 'prawie {{count}} lat' - } - } - - function localize (token, count, options) { - options = options || {} - - var scheme = distanceInWordsLocale[token] - if (!options.addSuffix) { - return declension(scheme, count) - } - - if (options.comparison > 0) { - return 'za ' + declension(scheme, count, 'future') - } else { - return declension(scheme, count, 'past') + ' temu' - } - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 58 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru'] - var monthsFull = ['styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień'] - var weekdays2char = ['nd', 'pn', 'wt', 'śr', 'cz', 'pt', 'sb'] - var weekdays3char = ['niedz.', 'pon.', 'wt.', 'śr.', 'czw.', 'piąt.', 'sob.'] - var weekdaysFull = ['niedziela', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota'] - var meridiem = ['w nocy', 'rano', 'po południu', 'wieczorem'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // Time of day - 'A': function (date) { - var hours = date.getHours() - if (hours >= 17) { - return meridiem[3] - } else if (hours >= 12) { - return meridiem[2] - } else if (hours >= 4) { - return meridiem[1] - } else { - return meridiem[0] - } - } - } - - formatters.a = formatters.A - formatters.aa = formatters.A - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - // Well, it should be just a number without any suffix - return formatters[formatterToken](date).toString() - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 59 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'menos de um segundo', - other: 'menos de {{count}} segundos' - }, - - xSeconds: { - one: '1 segundo', - other: '{{count}} segundos' - }, - - halfAMinute: 'meio minuto', - - lessThanXMinutes: { - one: 'menos de um minuto', - other: 'menos de {{count}} minutos' - }, - - xMinutes: { - one: '1 minuto', - other: '{{count}} minutos' - }, - - aboutXHours: { - one: 'aproximadamente 1 hora', - other: 'aproximadamente {{count}} horas' - }, - - xHours: { - one: '1 hora', - other: '{{count}} horas' - }, - - xDays: { - one: '1 dia', - other: '{{count}} dias' - }, - - aboutXMonths: { - one: 'aproximadamente 1 mês', - other: 'aproximadamente {{count}} meses' - }, - - xMonths: { - one: '1 mês', - other: '{{count}} meses' - }, - - aboutXYears: { - one: 'aproximadamente 1 ano', - other: 'aproximadamente {{count}} anos' - }, - - xYears: { - one: '1 ano', - other: '{{count}} anos' - }, - - overXYears: { - one: 'mais de 1 ano', - other: 'mais de {{count}} anos' - }, - - almostXYears: { - one: 'quase 1 ano', - other: 'quase {{count}} anos' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'daqui a ' + result - } else { - return 'há ' + result - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'] - var monthsFull = ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'] - var weekdays2char = ['do', 'se', 'te', 'qa', 'qi', 'se', 'sa'] - var weekdays3char = ['dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sáb'] - var weekdaysFull = ['domingo', 'segunda-feira', 'terça-feira', 'quarta-feira', 'quinta-feira', 'sexta-feira', 'sábado'] - var meridiemUppercase = ['AM', 'PM'] - var meridiemLowercase = ['am', 'pm'] - var meridiemFull = ['a.m.', 'p.m.'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return number + 'º' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 61 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'mai puțin de o secundă', - other: 'mai puțin de {{count}} secunde' - }, - - xSeconds: { - one: '1 secundă', - other: '{{count}} secunde' - }, - - halfAMinute: 'jumătate de minut', - - lessThanXMinutes: { - one: 'mai puțin de un minut', - other: 'mai puțin de {{count}} minute' - }, - - xMinutes: { - one: '1 minut', - other: '{{count}} minute' - }, - - aboutXHours: { - one: 'circa 1 oră', - other: 'circa {{count}} ore' - }, - - xHours: { - one: '1 oră', - other: '{{count}} ore' - }, - - xDays: { - one: '1 zi', - other: '{{count}} zile' - }, - - aboutXMonths: { - one: 'circa 1 lună', - other: 'circa {{count}} luni' - }, - - xMonths: { - one: '1 lună', - other: '{{count}} luni' - }, - - aboutXYears: { - one: 'circa 1 an', - other: 'circa {{count}} ani' - }, - - xYears: { - one: '1 an', - other: '{{count}} ani' - }, - - overXYears: { - one: 'peste 1 an', - other: 'peste {{count}} ani' - }, - - almostXYears: { - one: 'aproape 1 an', - other: 'aproape {{count}} ani' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'în ' + result - } else { - return result + ' în urmă' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 62 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - // Note: in Romanian language the weekdays and months should be in the lowercase. - var months3char = ['ian', 'feb', 'mar', 'apr', 'mai', 'iun', 'iul', 'aug', 'sep', 'oct', 'noi', 'dec'] - var monthsFull = ['ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie'] - var weekdays2char = ['du', 'lu', 'ma', 'mi', 'jo', 'vi', 'sâ'] - var weekdays3char = ['dum', 'lun', 'mar', 'mie', 'joi', 'vin', 'sâm'] - var weekdaysFull = ['duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbăta'] - var meridiemUppercase = ['AM', 'PM'] - var meridiemLowercase = ['am', 'pm'] - var meridiemFull = ['a.m.', 'p.m.'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return number.toString() -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 63 */ -/***/ (function(module, exports) { - -function declension (scheme, count) { - // scheme for count=1 exists - if (scheme.one !== undefined && count === 1) { - return scheme.one - } - - var rem10 = count % 10 - var rem100 = count % 100 - - // 1, 21, 31, ... - if (rem10 === 1 && rem100 !== 11) { - return scheme.singularNominative.replace('{{count}}', count) - - // 2, 3, 4, 22, 23, 24, 32 ... - } else if ((rem10 >= 2 && rem10 <= 4) && (rem100 < 10 || rem100 > 20)) { - return scheme.singularGenitive.replace('{{count}}', count) - - // 5, 6, 7, 8, 9, 10, 11, ... - } else { - return scheme.pluralGenitive.replace('{{count}}', count) - } -} - -function buildLocalizeTokenFn (scheme) { - return function (count, options) { - if (options.addSuffix) { - if (options.comparison > 0) { - if (scheme.future) { - return declension(scheme.future, count) - } else { - return 'через ' + declension(scheme.regular, count) - } - } else { - if (scheme.past) { - return declension(scheme.past, count) - } else { - return declension(scheme.regular, count) + ' назад' - } - } - } else { - return declension(scheme.regular, count) - } - } -} - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: buildLocalizeTokenFn({ - regular: { - one: 'меньше секунды', - singularNominative: 'меньше {{count}} секунды', - singularGenitive: 'меньше {{count}} секунд', - pluralGenitive: 'меньше {{count}} секунд' - }, - future: { - one: 'меньше, чем через секунду', - singularNominative: 'меньше, чем через {{count}} секунду', - singularGenitive: 'меньше, чем через {{count}} секунды', - pluralGenitive: 'меньше, чем через {{count}} секунд' - } - }), - - xSeconds: buildLocalizeTokenFn({ - regular: { - singularNominative: '{{count}} секунда', - singularGenitive: '{{count}} секунды', - pluralGenitive: '{{count}} секунд' - }, - past: { - singularNominative: '{{count}} секунду назад', - singularGenitive: '{{count}} секунды назад', - pluralGenitive: '{{count}} секунд назад' - }, - future: { - singularNominative: 'через {{count}} секунду', - singularGenitive: 'через {{count}} секунды', - pluralGenitive: 'через {{count}} секунд' - } - }), - - halfAMinute: function (_, options) { - if (options.addSuffix) { - if (options.comparison > 0) { - return 'через полминуты' - } else { - return 'полминуты назад' - } - } - - return 'полминуты' - }, - - lessThanXMinutes: buildLocalizeTokenFn({ - regular: { - one: 'меньше минуты', - singularNominative: 'меньше {{count}} минуты', - singularGenitive: 'меньше {{count}} минут', - pluralGenitive: 'меньше {{count}} минут' - }, - future: { - one: 'меньше, чем через минуту', - singularNominative: 'меньше, чем через {{count}} минуту', - singularGenitive: 'меньше, чем через {{count}} минуты', - pluralGenitive: 'меньше, чем через {{count}} минут' - } - }), - - xMinutes: buildLocalizeTokenFn({ - regular: { - singularNominative: '{{count}} минута', - singularGenitive: '{{count}} минуты', - pluralGenitive: '{{count}} минут' - }, - past: { - singularNominative: '{{count}} минуту назад', - singularGenitive: '{{count}} минуты назад', - pluralGenitive: '{{count}} минут назад' - }, - future: { - singularNominative: 'через {{count}} минуту', - singularGenitive: 'через {{count}} минуты', - pluralGenitive: 'через {{count}} минут' - } - }), - - aboutXHours: buildLocalizeTokenFn({ - regular: { - singularNominative: 'около {{count}} часа', - singularGenitive: 'около {{count}} часов', - pluralGenitive: 'около {{count}} часов' - }, - future: { - singularNominative: 'приблизительно через {{count}} час', - singularGenitive: 'приблизительно через {{count}} часа', - pluralGenitive: 'приблизительно через {{count}} часов' - } - }), - - xHours: buildLocalizeTokenFn({ - regular: { - singularNominative: '{{count}} час', - singularGenitive: '{{count}} часа', - pluralGenitive: '{{count}} часов' - } - }), - - xDays: buildLocalizeTokenFn({ - regular: { - singularNominative: '{{count}} день', - singularGenitive: '{{count}} дня', - pluralGenitive: '{{count}} дней' - } - }), - - aboutXMonths: buildLocalizeTokenFn({ - regular: { - singularNominative: 'около {{count}} месяца', - singularGenitive: 'около {{count}} месяцев', - pluralGenitive: 'около {{count}} месяцев' - }, - future: { - singularNominative: 'приблизительно через {{count}} месяц', - singularGenitive: 'приблизительно через {{count}} месяца', - pluralGenitive: 'приблизительно через {{count}} месяцев' - } - }), - - xMonths: buildLocalizeTokenFn({ - regular: { - singularNominative: '{{count}} месяц', - singularGenitive: '{{count}} месяца', - pluralGenitive: '{{count}} месяцев' - } - }), - - aboutXYears: buildLocalizeTokenFn({ - regular: { - singularNominative: 'около {{count}} года', - singularGenitive: 'около {{count}} лет', - pluralGenitive: 'около {{count}} лет' - }, - future: { - singularNominative: 'приблизительно через {{count}} год', - singularGenitive: 'приблизительно через {{count}} года', - pluralGenitive: 'приблизительно через {{count}} лет' - } - }), - - xYears: buildLocalizeTokenFn({ - regular: { - singularNominative: '{{count}} год', - singularGenitive: '{{count}} года', - pluralGenitive: '{{count}} лет' - } - }), - - overXYears: buildLocalizeTokenFn({ - regular: { - singularNominative: 'больше {{count}} года', - singularGenitive: 'больше {{count}} лет', - pluralGenitive: 'больше {{count}} лет' - }, - future: { - singularNominative: 'больше, чем через {{count}} год', - singularGenitive: 'больше, чем через {{count}} года', - pluralGenitive: 'больше, чем через {{count}} лет' - } - }), - - almostXYears: buildLocalizeTokenFn({ - regular: { - singularNominative: 'почти {{count}} год', - singularGenitive: 'почти {{count}} года', - pluralGenitive: 'почти {{count}} лет' - }, - future: { - singularNominative: 'почти через {{count}} год', - singularGenitive: 'почти через {{count}} года', - pluralGenitive: 'почти через {{count}} лет' - } - }) - } - - function localize (token, count, options) { - options = options || {} - return distanceInWordsLocale[token](count, options) - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 64 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - // http://new.gramota.ru/spravka/buro/search-answer?s=242637 - var monthsShort = ['янв.', 'фев.', 'март', 'апр.', 'май', 'июнь', 'июль', 'авг.', 'сент.', 'окт.', 'нояб.', 'дек.'] - var monthsFull = ['январь', 'февраль', 'март', 'апрель', 'май', 'июнь', 'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь'] - var monthsGenitive = ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'] - var weekdays2char = ['вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'] - var weekdays3char = ['вск', 'пнд', 'втр', 'срд', 'чтв', 'птн', 'суб'] - var weekdaysFull = ['воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота'] - var meridiem = ['ночи', 'утра', 'дня', 'вечера'] - - var formatters = { - // Month: янв., фев., ..., дек. - 'MMM': function (date) { - return monthsShort[date.getMonth()] - }, - - // Month: январь, февраль, ..., декабрь - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: вс, пн, ..., сб - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: вск, пнд, ..., суб - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: воскресенье, понедельник, ..., суббота - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // Time of day: ночи, утра, дня, вечера - 'A': function (date) { - var hours = date.getHours() - if (hours >= 17) { - return meridiem[3] - } else if (hours >= 12) { - return meridiem[2] - } else if (hours >= 4) { - return meridiem[1] - } else { - return meridiem[0] - } - }, - - 'Do': function (date, formatters) { - return formatters.D(date) + '-е' - }, - - 'Wo': function (date, formatters) { - return formatters.W(date) + '-я' - } - } - - formatters.a = formatters.A - formatters.aa = formatters.A - - // Generate ordinal version of formatters: M -> Mo, DDD -> DDDo, etc. - var ordinalFormatters = ['M', 'DDD', 'd', 'Q'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return formatters[formatterToken](date) + '-й' - } - }) - - // Generate formatters like 'D MMMM', - // where month is in the genitive case: января, февраля, ..., декабря - var monthsGenitiveFormatters = ['D', 'Do', 'DD'] - monthsGenitiveFormatters.forEach(function (formatterToken) { - formatters[formatterToken + ' MMMM'] = function (date, commonFormatters) { - var formatter = formatters[formatterToken] || commonFormatters[formatterToken] - return formatter(date, commonFormatters) + ' ' + monthsGenitive[date.getMonth()] - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 65 */ -/***/ (function(module, exports) { - -function declensionGroup (scheme, count) { - if (count === 1) { - return scheme.one - } - - if (count >= 2 && count <= 4) { - return scheme.twoFour - } - - // if count === null || count === 0 || count >= 5 - return scheme.other -} - -function declension (scheme, count, time) { - var group = declensionGroup(scheme, count) - var finalText = group[time] || group - return finalText.replace('{{count}}', count) -} - -function extractPreposition (token) { - var result = ['lessThan', 'about', 'over', 'almost'].filter(function (preposition) { - return !!token.match(new RegExp('^' + preposition)) - }) - - return result[0] -} - -function prefixPreposition (preposition) { - var translation = '' - - if (preposition === 'almost') { - translation = 'takmer' - } - - if (preposition === 'about') { - translation = 'približne' - } - - return translation.length > 0 ? translation + ' ' : '' -} - -function suffixPreposition (preposition) { - var translation = '' - - if (preposition === 'lessThan') { - translation = 'menej než' - } - - if (preposition === 'over') { - translation = 'viac než' - } - - return translation.length > 0 ? translation + ' ' : '' -} - -function lowercaseFirstLetter (string) { - return string.charAt(0).toLowerCase() + string.slice(1) -} - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - xSeconds: { - one: { - regular: 'sekunda', - past: 'sekundou', - future: 'sekundu' - }, - twoFour: { - regular: '{{count}} sekundy', - past: '{{count}} sekundami', - future: '{{count}} sekundy' - }, - other: { - regular: '{{count}} sekúnd', - past: '{{count}} sekundami', - future: '{{count}} sekúnd' - } - }, - - halfAMinute: { - other: { - regular: 'pol minúty', - past: 'pol minútou', - future: 'pol minúty' - } - }, - - xMinutes: { - one: { - regular: 'minúta', - past: 'minútou', - future: 'minútu' - }, - twoFour: { - regular: '{{count}} minúty', - past: '{{count}} minútami', - future: '{{count}} minúty' - }, - other: { - regular: '{{count}} minút', - past: '{{count}} minútami', - future: '{{count}} minút' - } - }, - - xHours: { - one: { - regular: 'hodina', - past: 'hodinou', - future: 'hodinu' - }, - twoFour: { - regular: '{{count}} hodiny', - past: '{{count}} hodinami', - future: '{{count}} hodiny' - }, - other: { - regular: '{{count}} hodín', - past: '{{count}} hodinami', - future: '{{count}} hodín' - } - }, - - xDays: { - one: { - regular: 'deň', - past: 'dňom', - future: 'deň' - }, - twoFour: { - regular: '{{count}} dni', - past: '{{count}} dňami', - future: '{{count}} dni' - }, - other: { - regular: '{{count}} dní', - past: '{{count}} dňami', - future: '{{count}} dní' - } - }, - - xMonths: { - one: { - regular: 'mesiac', - past: 'mesiacom', - future: 'mesiac' - }, - twoFour: { - regular: '{{count}} mesiace', - past: '{{count}} mesiacmi', - future: '{{count}} mesiace' - }, - other: { - regular: '{{count}} mesiacov', - past: '{{count}} mesiacmi', - future: '{{count}} mesiacov' - } - }, - - xYears: { - one: { - regular: 'rok', - past: 'rokom', - future: 'rok' - }, - twoFour: { - regular: '{{count}} roky', - past: '{{count}} rokmi', - future: '{{count}} roky' - }, - other: { - regular: '{{count}} rokov', - past: '{{count}} rokmi', - future: '{{count}} rokov' - } - } - } - - function localize (token, count, options) { - options = options || {} - - var preposition = extractPreposition(token) || '' - var key = lowercaseFirstLetter(token.substring(preposition.length)) - var scheme = distanceInWordsLocale[key] - - if (!options.addSuffix) { - return prefixPreposition(preposition) + suffixPreposition(preposition) + declension(scheme, count, 'regular') - } - - if (options.comparison > 0) { - return prefixPreposition(preposition) + 'za ' + suffixPreposition(preposition) + declension(scheme, count, 'future') - } else { - return prefixPreposition(preposition) + 'pred ' + suffixPreposition(preposition) + declension(scheme, count, 'past') - } - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 66 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['jan', 'feb', 'mar', 'apr', 'máj', 'jún', 'júl', 'aug', 'sep', 'okt', 'nov', 'dec'] - var monthsFull = ['január', 'február', 'marec', 'apríl', 'máj', 'jún', 'júl', 'august', 'september', 'október', 'november', 'december'] - var weekdays2char = ['ne', 'po', 'ut', 'st', 'št', 'pi', 'so'] - var weekdays3char = ['neď', 'pon', 'uto', 'str', 'štv', 'pia', 'sob'] - var weekdaysFull = ['nedeľa', 'pondelok', 'utorok', 'streda', 'štvrtok', 'piatok', 'sobota'] - var meridiemUppercase = ['AM', 'PM'] - var meridiemLowercase = ['am', 'pm'] - var meridiemFull = ['a.m.', 'p.m.'] - - var formatters = { - // Month: jan, feb, ..., dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: január, február, ..., december - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: ne, po, ..., so - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: neď, pon, ..., sob - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: neďeľa, pondelok, ..., sobota - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return number + '.' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 67 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'manj kot sekunda', - two: 'manj kot 2 sekundi', - three: 'manj kot {{count}} sekunde', - other: 'manj kot {{count}} sekund' - }, - - xSeconds: { - one: '1 sekunda', - two: '2 sekundi', - three: '{{count}} sekunde', - other: '{{count}} sekund' - }, - - halfAMinute: 'pol minute', - - lessThanXMinutes: { - one: 'manj kot minuta', - two: 'manj kot 2 minuti', - three: 'manj kot {{count}} minute', - other: 'manj kot {{count}} minut' - }, - - xMinutes: { - one: '1 minuta', - two: '2 minuti', - three: '{{count}} minute', - other: '{{count}} minut' - }, - - aboutXHours: { - one: 'približno 1 ura', - two: 'približno 2 uri', - three: 'približno {{count}} ure', - other: 'približno {{count}} ur' - }, - - xHours: { - one: '1 ura', - two: '2 uri', - three: '{{count}} ure', - other: '{{count}} ur' - }, - - xDays: { - one: '1 dan', - two: '2 dni', - three: '{{count}} dni', - other: '{{count}} dni' - }, - - aboutXMonths: { - one: 'približno 1 mesec', - two: 'približno 2 meseca', - three: 'približno {{count}} mesece', - other: 'približno {{count}} mesecev' - }, - - xMonths: { - one: '1 mesec', - two: '2 meseca', - three: '{{count}} meseci', - other: '{{count}} mesecev' - }, - - aboutXYears: { - one: 'približno 1 leto', - two: 'približno 2 leti', - three: 'približno {{count}} leta', - other: 'približno {{count}} let' - }, - - xYears: { - one: '1 leto', - two: '2 leti', - three: '{{count}} leta', - other: '{{count}} let' - }, - - overXYears: { - one: 'več kot 1 leto', - two: 'več kot 2 leti', - three: 'več kot {{count}} leta', - other: 'več kot {{count}} let' - }, - - almostXYears: { - one: 'skoraj 1 leto', - two: 'skoraj 2 leti', - three: 'skoraj {{count}} leta', - other: 'skoraj {{count}} let' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else if (count === 2) { - result = distanceInWordsLocale[token].two - } else if (count === 3 || count === 4) { - result = distanceInWordsLocale[token].three.replace('{{count}}', count) - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - result = result.replace(/(minut|sekund|ur)(a)/, '$1o') - if (token === 'xMonths') { - result = result.replace(/(mesec)(i)/, '$1e') - } - if (options.comparison > 0) { - return 'čez ' + result - } else { - return result + ' nazaj' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 68 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'avg', 'sep', 'okt', 'nov', 'dec'] - var monthsFull = ['januar', 'februar', 'marec', 'april', 'maj', 'junij', 'julij', 'avgust', 'september', 'oktober', 'november', 'december'] - var weekdays2char = ['ne', 'po', 'to', 'sr', 'če', 'pe', 'so'] - var weekdays3char = ['ned', 'pon', 'tor', 'sre', 'čet', 'pet', 'sob'] - var weekdaysFull = ['nedelja', 'ponedeljek', 'torek', 'sreda', 'četrtek', 'petek', 'sobota'] - var meridiemUppercase = ['AM', 'PM'] - var meridiemLowercase = ['am', 'pm'] - var meridiemFull = ['a.m.', 'p.m.'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return number + '.' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 69 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - singular: 'mindre än en sekund', - plural: 'mindre än {{count}} sekunder' - }, - - xSeconds: { - singular: 'en sekund', - plural: '{{count}} sekunder' - }, - - halfAMinute: 'en halv minut', - - lessThanXMinutes: { - singular: 'mindre än en minut', - plural: 'mindre än {{count}} minuter' - }, - - xMinutes: { - singular: 'en minut', - plural: '{{count}} minuter' - }, - - aboutXHours: { - singular: 'ungefär en timme', - plural: 'ungefär {{count}} timmar' - }, - - xHours: { - singular: 'en timme', - plural: '{{count}} timmar' - }, - - xDays: { - singular: 'en dag', - plural: '{{count}} dagar' - }, - - aboutXMonths: { - singular: 'ungefär en månad', - plural: 'ungefär {{count}} månader' - }, - - xMonths: { - singular: 'en månad', - plural: '{{count}} månader' - }, - - aboutXYears: { - singular: 'ungefär ett år', - plural: 'ungefär {{count}} år' - }, - - xYears: { - singular: 'ett år', - plural: '{{count}} år' - }, - - overXYears: { - singular: 'över ett år', - plural: 'över {{count}} år' - }, - - almostXYears: { - singular: 'nästan ett år', - plural: 'nästan {{count}} år' - } - } - - var wordMapping = [ - 'noll', - 'en', - 'två', - 'tre', - 'fyra', - 'fem', - 'sex', - 'sju', - 'åtta', - 'nio', - 'tio', - 'elva', - 'tolv' - ] - - function localize (token, count, options) { - options = options || {} - - var translation = distanceInWordsLocale[token] - var result - if (typeof translation === 'string') { - result = translation - } else if (count === 0 || count > 1) { - result = translation.plural.replace('{{count}}', count < 13 ? wordMapping[count] : count) - } else { - result = translation.singular - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return 'om ' + result - } else { - return result + ' sedan' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 70 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'] - var monthsFull = ['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december'] - var weekdays2char = ['sö', 'må', 'ti', 'on', 'to', 'fr', 'lö'] - var weekdays3char = ['sön', 'mån', 'tis', 'ons', 'tor', 'fre', 'lör'] - var weekdaysFull = ['söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag'] - var meridiemFull = ['f.m.', 'e.m.'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - formatters.A = formatters.aa - formatters.a = formatters.aa - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - var rem100 = number % 100 - if (rem100 > 20 || rem100 < 10) { - switch (rem100 % 10) { - case 1: - case 2: - return number + ':a' - } - } - return number + ':e' -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 71 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'น้อยกว่า 1 วินาที', - other: 'น้อยกว่า {{count}} วินาที' - }, - - xSeconds: { - one: '1 วินาที', - other: '{{count}} วินาที' - }, - - halfAMinute: 'ครึ่งนาที', - - lessThanXMinutes: { - one: 'น้อยกว่า 1 นาที', - other: 'น้อยกว่า {{count}} นาที' - }, - - xMinutes: { - one: '1 นาที', - other: '{{count}} นาที' - }, - - aboutXHours: { - one: 'ประมาณ 1 ชั่วโมง', - other: 'ประมาณ {{count}} ชั่วโมง' - }, - - xHours: { - one: '1 ชั่วโมง', - other: '{{count}} ชั่วโมง' - }, - - xDays: { - one: '1 วัน', - other: '{{count}} วัน' - }, - - aboutXMonths: { - one: 'ประมาณ 1 เดือน', - other: 'ประมาณ {{count}} เดือน' - }, - - xMonths: { - one: '1 เดือน', - other: '{{count}} เดือน' - }, - - aboutXYears: { - one: 'ประมาณ 1 ปี', - other: 'ประมาณ {{count}} ปี' - }, - - xYears: { - one: '1 ปี', - other: '{{count}} ปี' - }, - - overXYears: { - one: 'มากกว่า 1 ปี', - other: 'มากกว่า {{count}} ปี' - }, - - almostXYears: { - one: 'เกือบ 1 ปี', - other: 'เกือบ {{count}} ปี' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - if (token === 'halfAMinute') { - return 'ใน' + result - } else { - return 'ใน ' + result - } - } else { - return result + 'ที่ผ่านมา' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 72 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'] - var monthsFull = ['มกราคาม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'] - var weekdays2char = ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'] - var weekdays3char = ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'] - var weekdaysFull = ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'] - var meridiemUppercase = ['น.'] - var meridiemLowercase = ['น.'] - var meridiemFull = ['นาฬิกา'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return meridiemFull[0] - } - } - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 73 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: 'bir saniyeden az', - other: '{{count}} saniyeden az' - }, - - xSeconds: { - one: '1 saniye', - other: '{{count}} saniye' - }, - - halfAMinute: 'yarım dakika', - - lessThanXMinutes: { - one: 'bir dakikadan az', - other: '{{count}} dakikadan az' - }, - - xMinutes: { - one: '1 dakika', - other: '{{count}} dakika' - }, - - aboutXHours: { - one: 'yaklaşık 1 saat', - other: 'yaklaşık {{count}} saat' - }, - - xHours: { - one: '1 saat', - other: '{{count}} saat' - }, - - xDays: { - one: '1 gün', - other: '{{count}} gün' - }, - - aboutXMonths: { - one: 'yaklaşık 1 ay', - other: 'yaklaşık {{count}} ay' - }, - - xMonths: { - one: '1 ay', - other: '{{count}} ay' - }, - - aboutXYears: { - one: 'yaklaşık 1 yıl', - other: 'yaklaşık {{count}} yıl' - }, - - xYears: { - one: '1 yıl', - other: '{{count}} yıl' - }, - - overXYears: { - one: '1 yıldan fazla', - other: '{{count}} yıldan fazla' - }, - - almostXYears: { - one: 'neredeyse 1 yıl', - other: 'neredeyse {{count}} yıl' - } - } - - var extraWordTokens = [ - 'lessThanXSeconds', - 'lessThanXMinutes', - 'overXYears' - ] - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - var extraWord = '' - if (extraWordTokens.indexOf(token) > -1) { - extraWord = ' bir süre' - } - - if (options.comparison > 0) { - return result + extraWord + ' içinde' - } else { - return result + extraWord + ' önce' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 74 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - // Note: in Turkish, the names of days of the week and months are capitalized. - // If you are making a new locale based on this one, check if the same is true for the language you're working on. - // Generally, formatted dates should look like they are in the middle of a sentence, - // e.g. in Spanish language the weekdays and months should be in the lowercase. - var months3char = ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'] - var monthsFull = ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'] - var weekdays2char = ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'] - var weekdays3char = ['Paz', 'Pts', 'Sal', 'Çar', 'Per', 'Cum', 'Cts'] - var weekdaysFull = ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'] - var meridiemUppercase = ['ÖÖ', 'ÖS'] - var meridiemLowercase = ['öö', 'ös'] - var meridiemFull = ['ö.ö.', 'ö.s.'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - var suffixes = { - 1: '\'inci', - 2: '\'inci', - 3: '\'üncü', - 4: '\'üncü', - 5: '\'inci', - 6: '\'ıncı', - 7: '\'inci', - 8: '\'inci', - 9: '\'uncu', - 10: '\'uncu', - 20: '\'inci', - 30: '\'uncu', - 50: '\'inci', - 60: '\'ıncı', - 70: '\'inci', - 80: '\'inci', - 90: '\'ıncı', - 100: '\'üncü' - } - - if (number === 0) { - return '0\'ıncı' - } - - var x = number % 10 - var y = number % 100 - x - var z = number >= 100 ? 100 : null - - return number + (suffixes[x] || suffixes[y] || suffixes[z]) -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 75 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: '不到 1 秒', - other: '不到 {{count}} 秒' - }, - - xSeconds: { - one: '1 秒', - other: '{{count}} 秒' - }, - - halfAMinute: '半分钟', - - lessThanXMinutes: { - one: '不到 1 分钟', - other: '不到 {{count}} 分钟' - }, - - xMinutes: { - one: '1 分钟', - other: '{{count}} 分钟' - }, - - xHours: { - one: '1 小时', - other: '{{count}} 小时' - }, - - aboutXHours: { - one: '大约 1 小时', - other: '大约 {{count}} 小时' - }, - - xDays: { - one: '1 天', - other: '{{count}} 天' - }, - - aboutXMonths: { - one: '大约 1 个月', - other: '大约 {{count}} 个月' - }, - - xMonths: { - one: '1 个月', - other: '{{count}} 个月' - }, - - aboutXYears: { - one: '大约 1 年', - other: '大约 {{count}} 年' - }, - - xYears: { - one: '1 年', - other: '{{count}} 年' - }, - - overXYears: { - one: '超过 1 年', - other: '超过 {{count}} 年' - }, - - almostXYears: { - one: '将近 1 年', - other: '将近 {{count}} 年' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return result + '内' - } else { - return result + '前' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 76 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] - var monthsFull = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'] - var weekdays2char = ['日', '一', '二', '三', '四', '五', '六'] - var weekdays3char = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'] - var weekdaysFull = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'] - var meridiemFull = ['上午', '下午'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - } - } - - // AM, PM / am, pm / a.m., p.m. all translates to 上午, 下午 - formatters.a = formatters.aa = formatters.A = function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return number.toString() -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 77 */ -/***/ (function(module, exports) { - -function buildDistanceInWordsLocale () { - var distanceInWordsLocale = { - lessThanXSeconds: { - one: '少於 1 秒', - other: '少於 {{count}} 秒' - }, - - xSeconds: { - one: '1 秒', - other: '{{count}} 秒' - }, - - halfAMinute: '半分鐘', - - lessThanXMinutes: { - one: '少於 1 分鐘', - other: '少於 {{count}} 分鐘' - }, - - xMinutes: { - one: '1 分鐘', - other: '{{count}} 分鐘' - }, - - xHours: { - one: '1 小時', - other: '{{count}} 小時' - }, - - aboutXHours: { - one: '大約 1 小時', - other: '大約 {{count}} 小時' - }, - - xDays: { - one: '1 天', - other: '{{count}} 天' - }, - - aboutXMonths: { - one: '大約 1 個月', - other: '大約 {{count}} 個月' - }, - - xMonths: { - one: '1 個月', - other: '{{count}} 個月' - }, - - aboutXYears: { - one: '大約 1 年', - other: '大約 {{count}} 年' - }, - - xYears: { - one: '1 年', - other: '{{count}} 年' - }, - - overXYears: { - one: '超過 1 年', - other: '超過 {{count}} 年' - }, - - almostXYears: { - one: '將近 1 年', - other: '將近 {{count}} 年' - } - } - - function localize (token, count, options) { - options = options || {} - - var result - if (typeof distanceInWordsLocale[token] === 'string') { - result = distanceInWordsLocale[token] - } else if (count === 1) { - result = distanceInWordsLocale[token].one - } else { - result = distanceInWordsLocale[token].other.replace('{{count}}', count) - } - - if (options.addSuffix) { - if (options.comparison > 0) { - return result + '內' - } else { - return result + '前' - } - } - - return result - } - - return { - localize: localize - } -} - -module.exports = buildDistanceInWordsLocale - - -/***/ }), -/* 78 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildFormattingTokensRegExp = __webpack_require__(2) - -function buildFormatLocale () { - var months3char = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] - var monthsFull = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'] - var weekdays2char = ['日', '一', '二', '三', '四', '五', '六'] - var weekdays3char = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'] - var weekdaysFull = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'] - var meridiemUppercase = ['AM', 'PM'] - var meridiemLowercase = ['am', 'pm'] - var meridiemFull = ['上午', '下午'] - - var formatters = { - // Month: Jan, Feb, ..., Dec - 'MMM': function (date) { - return months3char[date.getMonth()] - }, - - // Month: January, February, ..., December - 'MMMM': function (date) { - return monthsFull[date.getMonth()] - }, - - // Day of week: Su, Mo, ..., Sa - 'dd': function (date) { - return weekdays2char[date.getDay()] - }, - - // Day of week: Sun, Mon, ..., Sat - 'ddd': function (date) { - return weekdays3char[date.getDay()] - }, - - // Day of week: Sunday, Monday, ..., Saturday - 'dddd': function (date) { - return weekdaysFull[date.getDay()] - }, - - // AM, PM - 'A': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] - }, - - // am, pm - 'a': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] - }, - - // a.m., p.m. - 'aa': function (date) { - return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] - } - } - - // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. - var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] - ordinalFormatters.forEach(function (formatterToken) { - formatters[formatterToken + 'o'] = function (date, formatters) { - return ordinal(formatters[formatterToken](date)) - } - }) - - return { - formatters: formatters, - formattingTokensRegExp: buildFormattingTokensRegExp(formatters) - } -} - -function ordinal (number) { - return number.toString() -} - -module.exports = buildFormatLocale - - -/***/ }), -/* 79 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Week Helpers - * @summary Return the start of a week for the given date. - * - * @description - * Return the start of a week for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @param {Object} [options] - the object with options - * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @returns {Date} the start of a week - * - * @example - * // The start of a week for 2 September 2014 11:55:00: - * var result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Sun Aug 31 2014 00:00:00 - * - * @example - * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00: - * var result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), {weekStartsOn: 1}) - * //=> Mon Sep 01 2014 00:00:00 - */ -function startOfWeek (dirtyDate, dirtyOptions) { - var weekStartsOn = dirtyOptions ? (Number(dirtyOptions.weekStartsOn) || 0) : 0 - - var date = parse(dirtyDate) - var day = date.getDay() - var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn - - date.setDate(date.getDate() - diff) - date.setHours(0, 0, 0, 0) - return date -} - -module.exports = startOfWeek - - -/***/ }), -/* 80 */ -/***/ (function(module, exports, __webpack_require__) { - -var startOfDay = __webpack_require__(5) - -var MILLISECONDS_IN_MINUTE = 60000 -var MILLISECONDS_IN_DAY = 86400000 - -/** - * @category Day Helpers - * @summary Get the number of calendar days between the given dates. - * - * @description - * Get the number of calendar days between the given dates. - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @returns {Number} the number of calendar days - * - * @example - * // How many calendar days are between - * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00? - * var result = differenceInCalendarDays( - * new Date(2012, 6, 2, 0, 0), - * new Date(2011, 6, 2, 23, 0) - * ) - * //=> 366 - */ -function differenceInCalendarDays (dirtyDateLeft, dirtyDateRight) { - var startOfDayLeft = startOfDay(dirtyDateLeft) - var startOfDayRight = startOfDay(dirtyDateRight) - - var timestampLeft = startOfDayLeft.getTime() - - startOfDayLeft.getTimezoneOffset() * MILLISECONDS_IN_MINUTE - var timestampRight = startOfDayRight.getTime() - - startOfDayRight.getTimezoneOffset() * MILLISECONDS_IN_MINUTE - - // Round the number of days to the nearest integer - // because the number of milliseconds in a day is not constant - // (e.g. it's different in the day of the daylight saving time clock shift) - return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY) -} - -module.exports = differenceInCalendarDays - - -/***/ }), -/* 81 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) -var getDaysInMonth = __webpack_require__(117) - -/** - * @category Month Helpers - * @summary Add the specified number of months to the given date. - * - * @description - * Add the specified number of months to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of months to be added - * @returns {Date} the new date with the months added - * - * @example - * // Add 5 months to 1 September 2014: - * var result = addMonths(new Date(2014, 8, 1), 5) - * //=> Sun Feb 01 2015 00:00:00 - */ -function addMonths (dirtyDate, dirtyAmount) { - var date = parse(dirtyDate) - var amount = Number(dirtyAmount) - var desiredMonth = date.getMonth() + amount - var dateWithDesiredMonth = new Date(0) - dateWithDesiredMonth.setFullYear(date.getFullYear(), desiredMonth, 1) - dateWithDesiredMonth.setHours(0, 0, 0, 0) - var daysInMonth = getDaysInMonth(dateWithDesiredMonth) - // Set the last day of the new month - // if the original date was the last day of the longer month - date.setMonth(desiredMonth, Math.min(daysInMonth, date.getDate())) - return date -} - -module.exports = addMonths - - -/***/ }), -/* 82 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Millisecond Helpers - * @summary Get the number of milliseconds between the given dates. - * - * @description - * Get the number of milliseconds between the given dates. - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @returns {Number} the number of milliseconds - * - * @example - * // How many milliseconds are between - * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700? - * var result = differenceInMilliseconds( - * new Date(2014, 6, 2, 12, 30, 21, 700), - * new Date(2014, 6, 2, 12, 30, 20, 600) - * ) - * //=> 1100 - */ -function differenceInMilliseconds (dirtyDateLeft, dirtyDateRight) { - var dateLeft = parse(dirtyDateLeft) - var dateRight = parse(dirtyDateRight) - return dateLeft.getTime() - dateRight.getTime() -} - -module.exports = differenceInMilliseconds - - -/***/ }), -/* 83 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(13) -var buildFormatLocale = __webpack_require__(14) - -/** - * @category Locales - * @summary Arabic locale (Modern Standard Arabic - Al-fussha). - * @author Abdallah Hassan [@AbdallahAHO]{@link https://github.com/AbdallahAHO} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 84 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(15) -var buildFormatLocale = __webpack_require__(16) - -/** - * @category Locales - * @summary Bulgarian locale. - * @author Nikolay Stoynov [@arvigeus]{@link https://github.com/arvigeus} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 85 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(17) -var buildFormatLocale = __webpack_require__(18) - -/** - * @category Locales - * @summary Catalan locale. - * @author Guillermo Grau [@guigrpa]{@link https://github.com/guigrpa} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 86 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(19) -var buildFormatLocale = __webpack_require__(20) - -/** - * @category Locales - * @summary Czech locale. - * @author David Rus [@davidrus]{@link https://github.com/davidrus} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 87 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(21) -var buildFormatLocale = __webpack_require__(22) - -/** - * @category Locales - * @summary Danish locale. - * @author Anders B. Hansen [@Andersbiha]{@link https://github.com/Andersbiha} - * @author [@kgram]{@link https://github.com/kgram} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 88 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(23) -var buildFormatLocale = __webpack_require__(24) - -/** - * @category Locales - * @summary German locale. - * @author Thomas Eilmsteiner [@DeMuu]{@link https://github.com/DeMuu} - * @author Asia [@asia-t]{@link https://github.com/asia-t} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 89 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(25) -var buildFormatLocale = __webpack_require__(26) - -/** - * @category Locales - * @summary Greek locale. - * @author Theodoros Orfanidis [@teoulas]{@link https://github.com/teoulas} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 90 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(27) -var buildFormatLocale = __webpack_require__(28) - -/** - * @category Locales - * @summary Esperanto locale. - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(29) -var buildFormatLocale = __webpack_require__(30) - -/** - * @category Locales - * @summary Spanish locale. - * @author Juan Angosto [@juanangosto]{@link https://github.com/juanangosto} - * @author Guillermo Grau [@guigrpa]{@link https://github.com/guigrpa} - * @author Fernando Agüero [@fjaguero]{@link https://github.com/fjaguero} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 92 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(31) -var buildFormatLocale = __webpack_require__(32) - -/** - * @category Locales - * @summary Finnish locale. - * @author Pyry-Samuli Lahti [@Pyppe]{@link https://github.com/Pyppe} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 93 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(33) -var buildFormatLocale = __webpack_require__(34) - -/** - * @category Locales - * @summary Filipino locale. - * @author Ian De La Cruz [@RIanDeLaCruz]{@link https://github.com/RIanDeLaCruz} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 94 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(35) -var buildFormatLocale = __webpack_require__(36) - -/** - * @category Locales - * @summary French locale. - * @author Jean Dupouy [@izeau]{@link https://github.com/izeau} - * @author François B [@fbonzon]{@link https://github.com/fbonzon} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 95 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(37) -var buildFormatLocale = __webpack_require__(38) - -/** - * @category Locales - * @summary Croatian locale. - * @author Matija Marohnić [@silvenon]{@link https://github.com/silvenon} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(39) -var buildFormatLocale = __webpack_require__(40) - -/** - * @category Locales - * @summary English locale. - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 97 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(41) -var buildFormatLocale = __webpack_require__(42) - -/** - * @category Locales - * @summary Indonesian locale. - * @author Rahmat Budiharso [@rbudiharso]{@link https://github.com/rbudiharso} - * @author Benget Nata [@bentinata]{@link https://github.com/bentinata} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 98 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(43) -var buildFormatLocale = __webpack_require__(44) - -/** - * @category Locales - * @summary Icelandic locale. - * @author Derek Blank [@derekblank]{@link https://github.com/derekblank} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 99 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(45) -var buildFormatLocale = __webpack_require__(46) - -/** - * @category Locales - * @summary Italian locale. - * @author Alberto Restifo [@albertorestifo]{@link https://github.com/albertorestifo} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 100 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(47) -var buildFormatLocale = __webpack_require__(48) - -/** - * @category Locales - * @summary Japanese locale. - * @author Thomas Eilmsteiner [@DeMuu]{@link https://github.com/DeMuu} - * @author Yamagishi Kazutoshi [@ykzts]{@link https://github.com/ykzts} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 101 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(49) -var buildFormatLocale = __webpack_require__(50) - -/** - * @category Locales - * @summary Korean locale. - * @author Hong Chulju [@angdev]{@link https://github.com/angdev} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 102 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(51) -var buildFormatLocale = __webpack_require__(52) - -/** - * @category Locales - * @summary Macedonian locale. - * @author Petar Vlahu [@vlahupetar]{@link https://github.com/vlahupetar} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 103 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(53) -var buildFormatLocale = __webpack_require__(54) - -/** - * @category Locales - * @summary Norwegian Bokmål locale. - * @author Hans-Kristian Koren [@Hanse]{@link https://github.com/Hanse} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 104 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(55) -var buildFormatLocale = __webpack_require__(56) - -/** - * @category Locales - * @summary Dutch locale. - * @author Jorik Tangelder [@jtangelder]{@link https://github.com/jtangelder} - * @author Ruben Stolk [@rubenstolk]{@link https://github.com/rubenstolk} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 105 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(57) -var buildFormatLocale = __webpack_require__(58) - -/** - * @category Locales - * @summary Polish locale. - * @author Mateusz Derks [@ertrzyiks]{@link https://github.com/ertrzyiks} - * @author Just RAG [@justrag]{@link https://github.com/justrag} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 106 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(59) -var buildFormatLocale = __webpack_require__(60) - -/** - * @category Locales - * @summary Portuguese locale. - * @author Dário Freire [@dfreire]{@link https://github.com/dfreire} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 107 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(61) -var buildFormatLocale = __webpack_require__(62) - -/** - * @category Locales - * @summary Romanian locale. - * @author Sergiu Munteanu [@jsergiu]{@link https://github.com/jsergiu} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 108 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(63) -var buildFormatLocale = __webpack_require__(64) - -/** - * @category Locales - * @summary Russian locale. - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 109 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(65) -var buildFormatLocale = __webpack_require__(66) - -/** - * @category Locales - * @summary Slovak locale. - * @author Marek Suscak [@mareksuscak]{@link https://github.com/mareksuscak} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 110 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(67) -var buildFormatLocale = __webpack_require__(68) - -/** - * @category Locales - * @summary Slovenian locale. - * @author Adam Stradovnik [@Neoglyph]{@link https://github.com/Neoglyph} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 111 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(69) -var buildFormatLocale = __webpack_require__(70) - -/** - * @category Locales - * @summary Swedish locale. - * @author Johannes Ulén [@ejulen]{@link https://github.com/ejulen} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 112 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(71) -var buildFormatLocale = __webpack_require__(72) - -/** - * @category Locales - * @summary Thai locale. - * @author Athiwat Hirunworawongkun [@athivvat]{@link https://github.com/athivvat} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 113 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(73) -var buildFormatLocale = __webpack_require__(74) - -/** - * @category Locales - * @summary Turkish locale. - * @author Alpcan Aydın [@alpcanaydin]{@link https://github.com/alpcanaydin} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 114 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(75) -var buildFormatLocale = __webpack_require__(76) - -/** - * @category Locales - * @summary Chinese Simplified locale. - * @author Changyu Geng [@KingMario]{@link https://github.com/KingMario} - * @author Song Shuoyun [@fnlctrl]{@link https://github.com/fnlctrl} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 115 */ -/***/ (function(module, exports, __webpack_require__) { - -var buildDistanceInWordsLocale = __webpack_require__(77) -var buildFormatLocale = __webpack_require__(78) - -/** - * @category Locales - * @summary Chinese Simplified locale. - * @author tonypai [@tpai]{@link https://github.com/tpai} - */ -module.exports = { - distanceInWords: buildDistanceInWordsLocale(), - format: buildFormatLocale() -} - - -/***/ }), -/* 116 */ -/***/ (function(module, exports) { - -/** - * @category Common Helpers - * @summary Is the given argument an instance of Date? - * - * @description - * Is the given argument an instance of Date? - * - * @param {*} argument - the argument to check - * @returns {Boolean} the given argument is an instance of Date - * - * @example - * // Is 'mayonnaise' a Date? - * var result = isDate('mayonnaise') - * //=> false - */ -function isDate (argument) { - return argument instanceof Date -} - -module.exports = isDate - - -/***/ }), -/* 117 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Month Helpers - * @summary Get the number of days in a month of the given date. - * - * @description - * Get the number of days in a month of the given date. - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the number of days in a month - * - * @example - * // How many days are in February 2000? - * var result = getDaysInMonth(new Date(2000, 1)) - * //=> 29 - */ -function getDaysInMonth (dirtyDate) { - var date = parse(dirtyDate) - var year = date.getFullYear() - var monthIndex = date.getMonth() - var lastDayOfMonth = new Date(0) - lastDayOfMonth.setFullYear(year, monthIndex + 1, 0) - lastDayOfMonth.setHours(0, 0, 0, 0) - return lastDayOfMonth.getDate() -} - -module.exports = getDaysInMonth - - -/***/ }), -/* 118 */ -/***/ (function(module, exports, __webpack_require__) { - -var addDays = __webpack_require__(7) - -/** - * @category Week Helpers - * @summary Add the specified number of weeks to the given date. - * - * @description - * Add the specified number of week to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of weeks to be added - * @returns {Date} the new date with the weeks added - * - * @example - * // Add 4 weeks to 1 September 2014: - * var result = addWeeks(new Date(2014, 8, 1), 4) - * //=> Mon Sep 29 2014 00:00:00 - */ -function addWeeks (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - var days = amount * 7 - return addDays(dirtyDate, days) -} - -module.exports = addWeeks - - -/***/ }), -/* 119 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Common Helpers - * @summary Compare the two dates reverse chronologically and return -1, 0 or 1. - * - * @description - * Compare the two dates and return -1 if the first date is after the second, - * 1 if the first date is before the second or 0 if dates are equal. - * - * @param {Date|String|Number} dateLeft - the first date to compare - * @param {Date|String|Number} dateRight - the second date to compare - * @returns {Number} the result of the comparison - * - * @example - * // Compare 11 February 1987 and 10 July 1989 reverse chronologically: - * var result = compareDesc( - * new Date(1987, 1, 11), - * new Date(1989, 6, 10) - * ) - * //=> 1 - * - * @example - * // Sort the array of dates in reverse chronological order: - * var result = [ - * new Date(1995, 6, 2), - * new Date(1987, 1, 11), - * new Date(1989, 6, 10) - * ].sort(compareDesc) - * //=> [ - * // Sun Jul 02 1995 00:00:00, - * // Mon Jul 10 1989 00:00:00, - * // Wed Feb 11 1987 00:00:00 - * // ] - */ -function compareDesc (dirtyDateLeft, dirtyDateRight) { - var dateLeft = parse(dirtyDateLeft) - var timeLeft = dateLeft.getTime() - var dateRight = parse(dirtyDateRight) - var timeRight = dateRight.getTime() - - if (timeLeft > timeRight) { - return -1 - } else if (timeLeft < timeRight) { - return 1 - } else { - return 0 - } -} - -module.exports = compareDesc - - -/***/ }), -/* 120 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) -var differenceInCalendarMonths = __webpack_require__(134) -var compareAsc = __webpack_require__(10) - -/** - * @category Month Helpers - * @summary Get the number of full months between the given dates. - * - * @description - * Get the number of full months between the given dates. - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @returns {Number} the number of full months - * - * @example - * // How many full months are between 31 January 2014 and 1 September 2014? - * var result = differenceInMonths( - * new Date(2014, 8, 1), - * new Date(2014, 0, 31) - * ) - * //=> 7 - */ -function differenceInMonths (dirtyDateLeft, dirtyDateRight) { - var dateLeft = parse(dirtyDateLeft) - var dateRight = parse(dirtyDateRight) - - var sign = compareAsc(dateLeft, dateRight) - var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight)) - dateLeft.setMonth(dateLeft.getMonth() - sign * difference) - - // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full - // If so, result must be decreased by 1 in absolute value - var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign - return sign * (difference - isLastMonthNotFull) -} - -module.exports = differenceInMonths - - -/***/ }), -/* 121 */ -/***/ (function(module, exports, __webpack_require__) { - -var differenceInMilliseconds = __webpack_require__(82) - -/** - * @category Second Helpers - * @summary Get the number of seconds between the given dates. - * - * @description - * Get the number of seconds between the given dates. - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @returns {Number} the number of seconds - * - * @example - * // How many seconds are between - * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000? - * var result = differenceInSeconds( - * new Date(2014, 6, 2, 12, 30, 20, 0), - * new Date(2014, 6, 2, 12, 30, 7, 999) - * ) - * //=> 12 - */ -function differenceInSeconds (dirtyDateLeft, dirtyDateRight) { - var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / 1000 - return diff > 0 ? Math.floor(diff) : Math.ceil(diff) -} - -module.exports = differenceInSeconds - - -/***/ }), -/* 122 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Day Helpers - * @summary Return the end of a day for the given date. - * - * @description - * Return the end of a day for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the end of a day - * - * @example - * // The end of a day for 2 September 2014 11:55:00: - * var result = endOfDay(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Sep 02 2014 23:59:59.999 - */ -function endOfDay (dirtyDate) { - var date = parse(dirtyDate) - date.setHours(23, 59, 59, 999) - return date -} - -module.exports = endOfDay - - -/***/ }), -/* 123 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) -var startOfISOWeek = __webpack_require__(4) -var startOfISOYear = __webpack_require__(9) - -var MILLISECONDS_IN_WEEK = 604800000 - -/** - * @category ISO Week Helpers - * @summary Get the ISO week of the given date. - * - * @description - * Get the ISO week of the given date. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the ISO week - * - * @example - * // Which week of the ISO-week numbering year is 2 January 2005? - * var result = getISOWeek(new Date(2005, 0, 2)) - * //=> 53 - */ -function getISOWeek (dirtyDate) { - var date = parse(dirtyDate) - var diff = startOfISOWeek(date).getTime() - startOfISOYear(date).getTime() - - // Round the number of days to the nearest integer - // because the number of milliseconds in a week is not constant - // (e.g. it's different in the week of the daylight saving time clock shift) - return Math.round(diff / MILLISECONDS_IN_WEEK) + 1 -} - -module.exports = getISOWeek - - -/***/ }), -/* 124 */ -/***/ (function(module, exports, __webpack_require__) { - -var startOfWeek = __webpack_require__(79) - -/** - * @category Week Helpers - * @summary Are the given dates in the same week? - * - * @description - * Are the given dates in the same week? - * - * @param {Date|String|Number} dateLeft - the first date to check - * @param {Date|String|Number} dateRight - the second date to check - * @param {Object} [options] - the object with options - * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @returns {Boolean} the dates are in the same week - * - * @example - * // Are 31 August 2014 and 4 September 2014 in the same week? - * var result = isSameWeek( - * new Date(2014, 7, 31), - * new Date(2014, 8, 4) - * ) - * //=> true - * - * @example - * // If week starts with Monday, - * // are 31 August 2014 and 4 September 2014 in the same week? - * var result = isSameWeek( - * new Date(2014, 7, 31), - * new Date(2014, 8, 4), - * {weekStartsOn: 1} - * ) - * //=> false - */ -function isSameWeek (dirtyDateLeft, dirtyDateRight, dirtyOptions) { - var dateLeftStartOfWeek = startOfWeek(dirtyDateLeft, dirtyOptions) - var dateRightStartOfWeek = startOfWeek(dirtyDateRight, dirtyOptions) - - return dateLeftStartOfWeek.getTime() === dateRightStartOfWeek.getTime() -} - -module.exports = isSameWeek - - -/***/ }), -/* 125 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { - addDays: __webpack_require__(7), - addHours: __webpack_require__(126), - addISOYears: __webpack_require__(127), - addMilliseconds: __webpack_require__(8), - addMinutes: __webpack_require__(129), - addMonths: __webpack_require__(81), - addQuarters: __webpack_require__(130), - addSeconds: __webpack_require__(131), - addWeeks: __webpack_require__(118), - addYears: __webpack_require__(132), - areRangesOverlapping: __webpack_require__(231), - closestIndexTo: __webpack_require__(232), - closestTo: __webpack_require__(233), - compareAsc: __webpack_require__(10), - compareDesc: __webpack_require__(119), - differenceInCalendarDays: __webpack_require__(80), - differenceInCalendarISOWeeks: __webpack_require__(234), - differenceInCalendarISOYears: __webpack_require__(133), - differenceInCalendarMonths: __webpack_require__(134), - differenceInCalendarQuarters: __webpack_require__(235), - differenceInCalendarWeeks: __webpack_require__(236), - differenceInCalendarYears: __webpack_require__(136), - differenceInDays: __webpack_require__(137), - differenceInHours: __webpack_require__(237), - differenceInISOYears: __webpack_require__(238), - differenceInMilliseconds: __webpack_require__(82), - differenceInMinutes: __webpack_require__(239), - differenceInMonths: __webpack_require__(120), - differenceInQuarters: __webpack_require__(240), - differenceInSeconds: __webpack_require__(121), - differenceInWeeks: __webpack_require__(241), - differenceInYears: __webpack_require__(242), - distanceInWords: __webpack_require__(139), - distanceInWordsStrict: __webpack_require__(243), - distanceInWordsToNow: __webpack_require__(244), - eachDay: __webpack_require__(245), - endOfDay: __webpack_require__(122), - endOfHour: __webpack_require__(246), - endOfISOWeek: __webpack_require__(247), - endOfISOYear: __webpack_require__(248), - endOfMinute: __webpack_require__(249), - endOfMonth: __webpack_require__(141), - endOfQuarter: __webpack_require__(250), - endOfSecond: __webpack_require__(251), - endOfToday: __webpack_require__(252), - endOfTomorrow: __webpack_require__(253), - endOfWeek: __webpack_require__(140), - endOfYear: __webpack_require__(254), - endOfYesterday: __webpack_require__(255), - format: __webpack_require__(256), - getDate: __webpack_require__(257), - getDay: __webpack_require__(258), - getDayOfYear: __webpack_require__(142), - getDaysInMonth: __webpack_require__(117), - getDaysInYear: __webpack_require__(259), - getHours: __webpack_require__(260), - getISODay: __webpack_require__(146), - getISOWeek: __webpack_require__(123), - getISOWeeksInYear: __webpack_require__(261), - getISOYear: __webpack_require__(3), - getMilliseconds: __webpack_require__(262), - getMinutes: __webpack_require__(263), - getMonth: __webpack_require__(264), - getOverlappingDaysInRanges: __webpack_require__(265), - getQuarter: __webpack_require__(135), - getSeconds: __webpack_require__(266), - getTime: __webpack_require__(267), - getYear: __webpack_require__(268), - isAfter: __webpack_require__(269), - isBefore: __webpack_require__(270), - isDate: __webpack_require__(116), - isEqual: __webpack_require__(271), - isFirstDayOfMonth: __webpack_require__(272), - isFriday: __webpack_require__(273), - isFuture: __webpack_require__(274), - isLastDayOfMonth: __webpack_require__(275), - isLeapYear: __webpack_require__(145), - isMonday: __webpack_require__(276), - isPast: __webpack_require__(277), - isSameDay: __webpack_require__(278), - isSameHour: __webpack_require__(147), - isSameISOWeek: __webpack_require__(149), - isSameISOYear: __webpack_require__(150), - isSameMinute: __webpack_require__(151), - isSameMonth: __webpack_require__(153), - isSameQuarter: __webpack_require__(154), - isSameSecond: __webpack_require__(156), - isSameWeek: __webpack_require__(124), - isSameYear: __webpack_require__(158), - isSaturday: __webpack_require__(279), - isSunday: __webpack_require__(280), - isThisHour: __webpack_require__(281), - isThisISOWeek: __webpack_require__(282), - isThisISOYear: __webpack_require__(283), - isThisMinute: __webpack_require__(284), - isThisMonth: __webpack_require__(285), - isThisQuarter: __webpack_require__(286), - isThisSecond: __webpack_require__(287), - isThisWeek: __webpack_require__(288), - isThisYear: __webpack_require__(289), - isThursday: __webpack_require__(290), - isToday: __webpack_require__(291), - isTomorrow: __webpack_require__(292), - isTuesday: __webpack_require__(293), - isValid: __webpack_require__(144), - isWednesday: __webpack_require__(294), - isWeekend: __webpack_require__(295), - isWithinRange: __webpack_require__(296), - isYesterday: __webpack_require__(297), - lastDayOfISOWeek: __webpack_require__(298), - lastDayOfISOYear: __webpack_require__(299), - lastDayOfMonth: __webpack_require__(300), - lastDayOfQuarter: __webpack_require__(301), - lastDayOfWeek: __webpack_require__(159), - lastDayOfYear: __webpack_require__(302), - max: __webpack_require__(303), - min: __webpack_require__(304), - parse: __webpack_require__(0), - setDate: __webpack_require__(305), - setDay: __webpack_require__(306), - setDayOfYear: __webpack_require__(307), - setHours: __webpack_require__(308), - setISODay: __webpack_require__(309), - setISOWeek: __webpack_require__(310), - setISOYear: __webpack_require__(128), - setMilliseconds: __webpack_require__(311), - setMinutes: __webpack_require__(312), - setMonth: __webpack_require__(160), - setQuarter: __webpack_require__(313), - setSeconds: __webpack_require__(314), - setYear: __webpack_require__(315), - startOfDay: __webpack_require__(5), - startOfHour: __webpack_require__(148), - startOfISOWeek: __webpack_require__(4), - startOfISOYear: __webpack_require__(9), - startOfMinute: __webpack_require__(152), - startOfMonth: __webpack_require__(316), - startOfQuarter: __webpack_require__(155), - startOfSecond: __webpack_require__(157), - startOfToday: __webpack_require__(317), - startOfTomorrow: __webpack_require__(318), - startOfWeek: __webpack_require__(79), - startOfYear: __webpack_require__(143), - startOfYesterday: __webpack_require__(319), - subDays: __webpack_require__(320), - subHours: __webpack_require__(321), - subISOYears: __webpack_require__(138), - subMilliseconds: __webpack_require__(322), - subMinutes: __webpack_require__(323), - subMonths: __webpack_require__(324), - subQuarters: __webpack_require__(325), - subSeconds: __webpack_require__(326), - subWeeks: __webpack_require__(327), - subYears: __webpack_require__(328) -} - - -/***/ }), -/* 126 */ -/***/ (function(module, exports, __webpack_require__) { - -var addMilliseconds = __webpack_require__(8) - -var MILLISECONDS_IN_HOUR = 3600000 - -/** - * @category Hour Helpers - * @summary Add the specified number of hours to the given date. - * - * @description - * Add the specified number of hours to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of hours to be added - * @returns {Date} the new date with the hours added - * - * @example - * // Add 2 hours to 10 July 2014 23:00:00: - * var result = addHours(new Date(2014, 6, 10, 23, 0), 2) - * //=> Fri Jul 11 2014 01:00:00 - */ -function addHours (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_HOUR) -} - -module.exports = addHours - - -/***/ }), -/* 127 */ -/***/ (function(module, exports, __webpack_require__) { - -var getISOYear = __webpack_require__(3) -var setISOYear = __webpack_require__(128) - -/** - * @category ISO Week-Numbering Year Helpers - * @summary Add the specified number of ISO week-numbering years to the given date. - * - * @description - * Add the specified number of ISO week-numbering years to the given date. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of ISO week-numbering years to be added - * @returns {Date} the new date with the ISO week-numbering years added - * - * @example - * // Add 5 ISO week-numbering years to 2 July 2010: - * var result = addISOYears(new Date(2010, 6, 2), 5) - * //=> Fri Jun 26 2015 00:00:00 - */ -function addISOYears (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - return setISOYear(dirtyDate, getISOYear(dirtyDate) + amount) -} - -module.exports = addISOYears - - -/***/ }), -/* 128 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) -var startOfISOYear = __webpack_require__(9) -var differenceInCalendarDays = __webpack_require__(80) - -/** - * @category ISO Week-Numbering Year Helpers - * @summary Set the ISO week-numbering year to the given date. - * - * @description - * Set the ISO week-numbering year to the given date, - * saving the week number and the weekday number. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} isoYear - the ISO week-numbering year of the new date - * @returns {Date} the new date with the ISO week-numbering year setted - * - * @example - * // Set ISO week-numbering year 2007 to 29 December 2008: - * var result = setISOYear(new Date(2008, 11, 29), 2007) - * //=> Mon Jan 01 2007 00:00:00 - */ -function setISOYear (dirtyDate, dirtyISOYear) { - var date = parse(dirtyDate) - var isoYear = Number(dirtyISOYear) - var diff = differenceInCalendarDays(date, startOfISOYear(date)) - var fourthOfJanuary = new Date(0) - fourthOfJanuary.setFullYear(isoYear, 0, 4) - fourthOfJanuary.setHours(0, 0, 0, 0) - date = startOfISOYear(fourthOfJanuary) - date.setDate(date.getDate() + diff) - return date -} - -module.exports = setISOYear - - -/***/ }), -/* 129 */ -/***/ (function(module, exports, __webpack_require__) { - -var addMilliseconds = __webpack_require__(8) - -var MILLISECONDS_IN_MINUTE = 60000 - -/** - * @category Minute Helpers - * @summary Add the specified number of minutes to the given date. - * - * @description - * Add the specified number of minutes to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of minutes to be added - * @returns {Date} the new date with the minutes added - * - * @example - * // Add 30 minutes to 10 July 2014 12:00:00: - * var result = addMinutes(new Date(2014, 6, 10, 12, 0), 30) - * //=> Thu Jul 10 2014 12:30:00 - */ -function addMinutes (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE) -} - -module.exports = addMinutes - - -/***/ }), -/* 130 */ -/***/ (function(module, exports, __webpack_require__) { - -var addMonths = __webpack_require__(81) - -/** - * @category Quarter Helpers - * @summary Add the specified number of year quarters to the given date. - * - * @description - * Add the specified number of year quarters to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of quarters to be added - * @returns {Date} the new date with the quarters added - * - * @example - * // Add 1 quarter to 1 September 2014: - * var result = addQuarters(new Date(2014, 8, 1), 1) - * //=> Mon Dec 01 2014 00:00:00 - */ -function addQuarters (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - var months = amount * 3 - return addMonths(dirtyDate, months) -} - -module.exports = addQuarters - - -/***/ }), -/* 131 */ -/***/ (function(module, exports, __webpack_require__) { - -var addMilliseconds = __webpack_require__(8) - -/** - * @category Second Helpers - * @summary Add the specified number of seconds to the given date. - * - * @description - * Add the specified number of seconds to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of seconds to be added - * @returns {Date} the new date with the seconds added - * - * @example - * // Add 30 seconds to 10 July 2014 12:45:00: - * var result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30) - * //=> Thu Jul 10 2014 12:45:30 - */ -function addSeconds (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - return addMilliseconds(dirtyDate, amount * 1000) -} - -module.exports = addSeconds - - -/***/ }), -/* 132 */ -/***/ (function(module, exports, __webpack_require__) { - -var addMonths = __webpack_require__(81) - -/** - * @category Year Helpers - * @summary Add the specified number of years to the given date. - * - * @description - * Add the specified number of years to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of years to be added - * @returns {Date} the new date with the years added - * - * @example - * // Add 5 years to 1 September 2014: - * var result = addYears(new Date(2014, 8, 1), 5) - * //=> Sun Sep 01 2019 00:00:00 - */ -function addYears (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - return addMonths(dirtyDate, amount * 12) -} - -module.exports = addYears - - -/***/ }), -/* 133 */ -/***/ (function(module, exports, __webpack_require__) { - -var getISOYear = __webpack_require__(3) - -/** - * @category ISO Week-Numbering Year Helpers - * @summary Get the number of calendar ISO week-numbering years between the given dates. - * - * @description - * Get the number of calendar ISO week-numbering years between the given dates. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @returns {Number} the number of calendar ISO week-numbering years - * - * @example - * // How many calendar ISO week-numbering years are 1 January 2010 and 1 January 2012? - * var result = differenceInCalendarISOYears( - * new Date(2012, 0, 1), - * new Date(2010, 0, 1) - * ) - * //=> 2 - */ -function differenceInCalendarISOYears (dirtyDateLeft, dirtyDateRight) { - return getISOYear(dirtyDateLeft) - getISOYear(dirtyDateRight) -} - -module.exports = differenceInCalendarISOYears - - -/***/ }), -/* 134 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Month Helpers - * @summary Get the number of calendar months between the given dates. - * - * @description - * Get the number of calendar months between the given dates. - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @returns {Number} the number of calendar months - * - * @example - * // How many calendar months are between 31 January 2014 and 1 September 2014? - * var result = differenceInCalendarMonths( - * new Date(2014, 8, 1), - * new Date(2014, 0, 31) - * ) - * //=> 8 - */ -function differenceInCalendarMonths (dirtyDateLeft, dirtyDateRight) { - var dateLeft = parse(dirtyDateLeft) - var dateRight = parse(dirtyDateRight) - - var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear() - var monthDiff = dateLeft.getMonth() - dateRight.getMonth() - - return yearDiff * 12 + monthDiff -} - -module.exports = differenceInCalendarMonths - - -/***/ }), -/* 135 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Quarter Helpers - * @summary Get the year quarter of the given date. - * - * @description - * Get the year quarter of the given date. - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the quarter - * - * @example - * // Which quarter is 2 July 2014? - * var result = getQuarter(new Date(2014, 6, 2)) - * //=> 3 - */ -function getQuarter (dirtyDate) { - var date = parse(dirtyDate) - var quarter = Math.floor(date.getMonth() / 3) + 1 - return quarter -} - -module.exports = getQuarter - - -/***/ }), -/* 136 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Year Helpers - * @summary Get the number of calendar years between the given dates. - * - * @description - * Get the number of calendar years between the given dates. - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @returns {Number} the number of calendar years - * - * @example - * // How many calendar years are between 31 December 2013 and 11 February 2015? - * var result = differenceInCalendarYears( - * new Date(2015, 1, 11), - * new Date(2013, 11, 31) - * ) - * //=> 2 - */ -function differenceInCalendarYears (dirtyDateLeft, dirtyDateRight) { - var dateLeft = parse(dirtyDateLeft) - var dateRight = parse(dirtyDateRight) - - return dateLeft.getFullYear() - dateRight.getFullYear() -} - -module.exports = differenceInCalendarYears - - -/***/ }), -/* 137 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) -var differenceInCalendarDays = __webpack_require__(80) -var compareAsc = __webpack_require__(10) - -/** - * @category Day Helpers - * @summary Get the number of full days between the given dates. - * - * @description - * Get the number of full days between the given dates. - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @returns {Number} the number of full days - * - * @example - * // How many full days are between - * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00? - * var result = differenceInDays( - * new Date(2012, 6, 2, 0, 0), - * new Date(2011, 6, 2, 23, 0) - * ) - * //=> 365 - */ -function differenceInDays (dirtyDateLeft, dirtyDateRight) { - var dateLeft = parse(dirtyDateLeft) - var dateRight = parse(dirtyDateRight) - - var sign = compareAsc(dateLeft, dateRight) - var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight)) - dateLeft.setDate(dateLeft.getDate() - sign * difference) - - // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full - // If so, result must be decreased by 1 in absolute value - var isLastDayNotFull = compareAsc(dateLeft, dateRight) === -sign - return sign * (difference - isLastDayNotFull) -} - -module.exports = differenceInDays - - -/***/ }), -/* 138 */ -/***/ (function(module, exports, __webpack_require__) { - -var addISOYears = __webpack_require__(127) - -/** - * @category ISO Week-Numbering Year Helpers - * @summary Subtract the specified number of ISO week-numbering years from the given date. - * - * @description - * Subtract the specified number of ISO week-numbering years from the given date. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of ISO week-numbering years to be subtracted - * @returns {Date} the new date with the ISO week-numbering years subtracted - * - * @example - * // Subtract 5 ISO week-numbering years from 1 September 2014: - * var result = subISOYears(new Date(2014, 8, 1), 5) - * //=> Mon Aug 31 2009 00:00:00 - */ -function subISOYears (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - return addISOYears(dirtyDate, -amount) -} - -module.exports = subISOYears - - -/***/ }), -/* 139 */ -/***/ (function(module, exports, __webpack_require__) { - -var compareDesc = __webpack_require__(119) -var parse = __webpack_require__(0) -var differenceInSeconds = __webpack_require__(121) -var differenceInMonths = __webpack_require__(120) -var enLocale = __webpack_require__(6) - -var MINUTES_IN_DAY = 1440 -var MINUTES_IN_ALMOST_TWO_DAYS = 2520 -var MINUTES_IN_MONTH = 43200 -var MINUTES_IN_TWO_MONTHS = 86400 - -/** - * @category Common Helpers - * @summary Return the distance between the given dates in words. - * - * @description - * Return the distance between the given dates in words. - * - * | Distance between dates | Result | - * |-------------------------------------------------------------------|---------------------| - * | 0 ... 30 secs | less than a minute | - * | 30 secs ... 1 min 30 secs | 1 minute | - * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes | - * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour | - * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours | - * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day | - * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days | - * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month | - * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months | - * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months | - * | 1 yr ... 1 yr 3 months | about 1 year | - * | 1 yr 3 months ... 1 yr 9 month s | over 1 year | - * | 1 yr 9 months ... 2 yrs | almost 2 years | - * | N yrs ... N yrs 3 months | about N years | - * | N yrs 3 months ... N yrs 9 months | over N years | - * | N yrs 9 months ... N+1 yrs | almost N+1 years | - * - * With `options.includeSeconds == true`: - * | Distance between dates | Result | - * |------------------------|----------------------| - * | 0 secs ... 5 secs | less than 5 seconds | - * | 5 secs ... 10 secs | less than 10 seconds | - * | 10 secs ... 20 secs | less than 20 seconds | - * | 20 secs ... 40 secs | half a minute | - * | 40 secs ... 60 secs | less than a minute | - * | 60 secs ... 90 secs | 1 minute | - * - * @param {Date|String|Number} dateToCompare - the date to compare with - * @param {Date|String|Number} date - the other date - * @param {Object} [options] - the object with options - * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed - * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first - * @param {Object} [options.locale=enLocale] - the locale object - * @returns {String} the distance in words - * - * @example - * // What is the distance between 2 July 2014 and 1 January 2015? - * var result = distanceInWords( - * new Date(2014, 6, 2), - * new Date(2015, 0, 1) - * ) - * //=> '6 months' - * - * @example - * // What is the distance between 1 January 2015 00:00:15 - * // and 1 January 2015 00:00:00, including seconds? - * var result = distanceInWords( - * new Date(2015, 0, 1, 0, 0, 15), - * new Date(2015, 0, 1, 0, 0, 0), - * {includeSeconds: true} - * ) - * //=> 'less than 20 seconds' - * - * @example - * // What is the distance from 1 January 2016 - * // to 1 January 2015, with a suffix? - * var result = distanceInWords( - * new Date(2016, 0, 1), - * new Date(2015, 0, 1), - * {addSuffix: true} - * ) - * //=> 'about 1 year ago' - * - * @example - * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto? - * var eoLocale = require('date-fns/locale/eo') - * var result = distanceInWords( - * new Date(2016, 7, 1), - * new Date(2015, 0, 1), - * {locale: eoLocale} - * ) - * //=> 'pli ol 1 jaro' - */ -function distanceInWords (dirtyDateToCompare, dirtyDate, dirtyOptions) { - var options = dirtyOptions || {} - - var comparison = compareDesc(dirtyDateToCompare, dirtyDate) - - var locale = options.locale - var localize = enLocale.distanceInWords.localize - if (locale && locale.distanceInWords && locale.distanceInWords.localize) { - localize = locale.distanceInWords.localize - } - - var localizeOptions = { - addSuffix: Boolean(options.addSuffix), - comparison: comparison - } - - var dateLeft, dateRight - if (comparison > 0) { - dateLeft = parse(dirtyDateToCompare) - dateRight = parse(dirtyDate) - } else { - dateLeft = parse(dirtyDate) - dateRight = parse(dirtyDateToCompare) - } - - var seconds = differenceInSeconds(dateRight, dateLeft) - var offset = dateRight.getTimezoneOffset() - dateLeft.getTimezoneOffset() - var minutes = Math.round(seconds / 60) - offset - var months - - // 0 up to 2 mins - if (minutes < 2) { - if (options.includeSeconds) { - if (seconds < 5) { - return localize('lessThanXSeconds', 5, localizeOptions) - } else if (seconds < 10) { - return localize('lessThanXSeconds', 10, localizeOptions) - } else if (seconds < 20) { - return localize('lessThanXSeconds', 20, localizeOptions) - } else if (seconds < 40) { - return localize('halfAMinute', null, localizeOptions) - } else if (seconds < 60) { - return localize('lessThanXMinutes', 1, localizeOptions) - } else { - return localize('xMinutes', 1, localizeOptions) - } - } else { - if (minutes === 0) { - return localize('lessThanXMinutes', 1, localizeOptions) - } else { - return localize('xMinutes', minutes, localizeOptions) - } - } - - // 2 mins up to 0.75 hrs - } else if (minutes < 45) { - return localize('xMinutes', minutes, localizeOptions) - - // 0.75 hrs up to 1.5 hrs - } else if (minutes < 90) { - return localize('aboutXHours', 1, localizeOptions) - - // 1.5 hrs up to 24 hrs - } else if (minutes < MINUTES_IN_DAY) { - var hours = Math.round(minutes / 60) - return localize('aboutXHours', hours, localizeOptions) - - // 1 day up to 1.75 days - } else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) { - return localize('xDays', 1, localizeOptions) - - // 1.75 days up to 30 days - } else if (minutes < MINUTES_IN_MONTH) { - var days = Math.round(minutes / MINUTES_IN_DAY) - return localize('xDays', days, localizeOptions) - - // 1 month up to 2 months - } else if (minutes < MINUTES_IN_TWO_MONTHS) { - months = Math.round(minutes / MINUTES_IN_MONTH) - return localize('aboutXMonths', months, localizeOptions) - } - - months = differenceInMonths(dateRight, dateLeft) - - // 2 months up to 12 months - if (months < 12) { - var nearestMonth = Math.round(minutes / MINUTES_IN_MONTH) - return localize('xMonths', nearestMonth, localizeOptions) - - // 1 year up to max Date - } else { - var monthsSinceStartOfYear = months % 12 - var years = Math.floor(months / 12) - - // N years up to 1 years 3 months - if (monthsSinceStartOfYear < 3) { - return localize('aboutXYears', years, localizeOptions) - - // N years 3 months up to N years 9 months - } else if (monthsSinceStartOfYear < 9) { - return localize('overXYears', years, localizeOptions) - - // N years 9 months up to N year 12 months - } else { - return localize('almostXYears', years + 1, localizeOptions) - } - } -} - -module.exports = distanceInWords - - -/***/ }), -/* 140 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Week Helpers - * @summary Return the end of a week for the given date. - * - * @description - * Return the end of a week for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @param {Object} [options] - the object with options - * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @returns {Date} the end of a week - * - * @example - * // The end of a week for 2 September 2014 11:55:00: - * var result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Sat Sep 06 2014 23:59:59.999 - * - * @example - * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00: - * var result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), {weekStartsOn: 1}) - * //=> Sun Sep 07 2014 23:59:59.999 - */ -function endOfWeek (dirtyDate, dirtyOptions) { - var weekStartsOn = dirtyOptions ? (Number(dirtyOptions.weekStartsOn) || 0) : 0 - - var date = parse(dirtyDate) - var day = date.getDay() - var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn) - - date.setDate(date.getDate() + diff) - date.setHours(23, 59, 59, 999) - return date -} - -module.exports = endOfWeek - - -/***/ }), -/* 141 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Month Helpers - * @summary Return the end of a month for the given date. - * - * @description - * Return the end of a month for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the end of a month - * - * @example - * // The end of a month for 2 September 2014 11:55:00: - * var result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Sep 30 2014 23:59:59.999 - */ -function endOfMonth (dirtyDate) { - var date = parse(dirtyDate) - var month = date.getMonth() - date.setFullYear(date.getFullYear(), month + 1, 0) - date.setHours(23, 59, 59, 999) - return date -} - -module.exports = endOfMonth - - -/***/ }), -/* 142 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) -var startOfYear = __webpack_require__(143) -var differenceInCalendarDays = __webpack_require__(80) - -/** - * @category Day Helpers - * @summary Get the day of the year of the given date. - * - * @description - * Get the day of the year of the given date. - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the day of year - * - * @example - * // Which day of the year is 2 July 2014? - * var result = getDayOfYear(new Date(2014, 6, 2)) - * //=> 183 - */ -function getDayOfYear (dirtyDate) { - var date = parse(dirtyDate) - var diff = differenceInCalendarDays(date, startOfYear(date)) - var dayOfYear = diff + 1 - return dayOfYear -} - -module.exports = getDayOfYear - - -/***/ }), -/* 143 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Year Helpers - * @summary Return the start of a year for the given date. - * - * @description - * Return the start of a year for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the start of a year - * - * @example - * // The start of a year for 2 September 2014 11:55:00: - * var result = startOfYear(new Date(2014, 8, 2, 11, 55, 00)) - * //=> Wed Jan 01 2014 00:00:00 - */ -function startOfYear (dirtyDate) { - var cleanDate = parse(dirtyDate) - var date = new Date(0) - date.setFullYear(cleanDate.getFullYear(), 0, 1) - date.setHours(0, 0, 0, 0) - return date -} - -module.exports = startOfYear - - -/***/ }), -/* 144 */ -/***/ (function(module, exports, __webpack_require__) { - -var isDate = __webpack_require__(116) - -/** - * @category Common Helpers - * @summary Is the given date valid? - * - * @description - * Returns false if argument is Invalid Date and true otherwise. - * Invalid Date is a Date, whose time value is NaN. - * - * Time value of Date: http://es5.github.io/#x15.9.1.1 - * - * @param {Date} date - the date to check - * @returns {Boolean} the date is valid - * @throws {TypeError} argument must be an instance of Date - * - * @example - * // For the valid date: - * var result = isValid(new Date(2014, 1, 31)) - * //=> true - * - * @example - * // For the invalid date: - * var result = isValid(new Date('')) - * //=> false - */ -function isValid (dirtyDate) { - if (isDate(dirtyDate)) { - return !isNaN(dirtyDate) - } else { - throw new TypeError(toString.call(dirtyDate) + ' is not an instance of Date') - } -} - -module.exports = isValid - - -/***/ }), -/* 145 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Year Helpers - * @summary Is the given date in the leap year? - * - * @description - * Is the given date in the leap year? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is in the leap year - * - * @example - * // Is 1 September 2012 in the leap year? - * var result = isLeapYear(new Date(2012, 8, 1)) - * //=> true - */ -function isLeapYear (dirtyDate) { - var date = parse(dirtyDate) - var year = date.getFullYear() - return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0 -} - -module.exports = isLeapYear - - -/***/ }), -/* 146 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Weekday Helpers - * @summary Get the day of the ISO week of the given date. - * - * @description - * Get the day of the ISO week of the given date, - * which is 7 for Sunday, 1 for Monday etc. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the day of ISO week - * - * @example - * // Which day of the ISO week is 26 February 2012? - * var result = getISODay(new Date(2012, 1, 26)) - * //=> 7 - */ -function getISODay (dirtyDate) { - var date = parse(dirtyDate) - var day = date.getDay() - - if (day === 0) { - day = 7 - } - - return day -} - -module.exports = getISODay - - -/***/ }), -/* 147 */ -/***/ (function(module, exports, __webpack_require__) { - -var startOfHour = __webpack_require__(148) - -/** - * @category Hour Helpers - * @summary Are the given dates in the same hour? - * - * @description - * Are the given dates in the same hour? - * - * @param {Date|String|Number} dateLeft - the first date to check - * @param {Date|String|Number} dateRight - the second date to check - * @returns {Boolean} the dates are in the same hour - * - * @example - * // Are 4 September 2014 06:00:00 and 4 September 06:30:00 in the same hour? - * var result = isSameHour( - * new Date(2014, 8, 4, 6, 0), - * new Date(2014, 8, 4, 6, 30) - * ) - * //=> true - */ -function isSameHour (dirtyDateLeft, dirtyDateRight) { - var dateLeftStartOfHour = startOfHour(dirtyDateLeft) - var dateRightStartOfHour = startOfHour(dirtyDateRight) - - return dateLeftStartOfHour.getTime() === dateRightStartOfHour.getTime() -} - -module.exports = isSameHour - - -/***/ }), -/* 148 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Hour Helpers - * @summary Return the start of an hour for the given date. - * - * @description - * Return the start of an hour for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the start of an hour - * - * @example - * // The start of an hour for 2 September 2014 11:55:00: - * var result = startOfHour(new Date(2014, 8, 2, 11, 55)) - * //=> Tue Sep 02 2014 11:00:00 - */ -function startOfHour (dirtyDate) { - var date = parse(dirtyDate) - date.setMinutes(0, 0, 0) - return date -} - -module.exports = startOfHour - - -/***/ }), -/* 149 */ -/***/ (function(module, exports, __webpack_require__) { - -var isSameWeek = __webpack_require__(124) - -/** - * @category ISO Week Helpers - * @summary Are the given dates in the same ISO week? - * - * @description - * Are the given dates in the same ISO week? - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} dateLeft - the first date to check - * @param {Date|String|Number} dateRight - the second date to check - * @returns {Boolean} the dates are in the same ISO week - * - * @example - * // Are 1 September 2014 and 7 September 2014 in the same ISO week? - * var result = isSameISOWeek( - * new Date(2014, 8, 1), - * new Date(2014, 8, 7) - * ) - * //=> true - */ -function isSameISOWeek (dirtyDateLeft, dirtyDateRight) { - return isSameWeek(dirtyDateLeft, dirtyDateRight, {weekStartsOn: 1}) -} - -module.exports = isSameISOWeek - - -/***/ }), -/* 150 */ -/***/ (function(module, exports, __webpack_require__) { - -var startOfISOYear = __webpack_require__(9) - -/** - * @category ISO Week-Numbering Year Helpers - * @summary Are the given dates in the same ISO week-numbering year? - * - * @description - * Are the given dates in the same ISO week-numbering year? - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} dateLeft - the first date to check - * @param {Date|String|Number} dateRight - the second date to check - * @returns {Boolean} the dates are in the same ISO week-numbering year - * - * @example - * // Are 29 December 2003 and 2 January 2005 in the same ISO week-numbering year? - * var result = isSameISOYear( - * new Date(2003, 11, 29), - * new Date(2005, 0, 2) - * ) - * //=> true - */ -function isSameISOYear (dirtyDateLeft, dirtyDateRight) { - var dateLeftStartOfYear = startOfISOYear(dirtyDateLeft) - var dateRightStartOfYear = startOfISOYear(dirtyDateRight) - - return dateLeftStartOfYear.getTime() === dateRightStartOfYear.getTime() -} - -module.exports = isSameISOYear - - -/***/ }), -/* 151 */ -/***/ (function(module, exports, __webpack_require__) { - -var startOfMinute = __webpack_require__(152) - -/** - * @category Minute Helpers - * @summary Are the given dates in the same minute? - * - * @description - * Are the given dates in the same minute? - * - * @param {Date|String|Number} dateLeft - the first date to check - * @param {Date|String|Number} dateRight - the second date to check - * @returns {Boolean} the dates are in the same minute - * - * @example - * // Are 4 September 2014 06:30:00 and 4 September 2014 06:30:15 - * // in the same minute? - * var result = isSameMinute( - * new Date(2014, 8, 4, 6, 30), - * new Date(2014, 8, 4, 6, 30, 15) - * ) - * //=> true - */ -function isSameMinute (dirtyDateLeft, dirtyDateRight) { - var dateLeftStartOfMinute = startOfMinute(dirtyDateLeft) - var dateRightStartOfMinute = startOfMinute(dirtyDateRight) - - return dateLeftStartOfMinute.getTime() === dateRightStartOfMinute.getTime() -} - -module.exports = isSameMinute - - -/***/ }), -/* 152 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Minute Helpers - * @summary Return the start of a minute for the given date. - * - * @description - * Return the start of a minute for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the start of a minute - * - * @example - * // The start of a minute for 1 December 2014 22:15:45.400: - * var result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) - * //=> Mon Dec 01 2014 22:15:00 - */ -function startOfMinute (dirtyDate) { - var date = parse(dirtyDate) - date.setSeconds(0, 0) - return date -} - -module.exports = startOfMinute - - -/***/ }), -/* 153 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Month Helpers - * @summary Are the given dates in the same month? - * - * @description - * Are the given dates in the same month? - * - * @param {Date|String|Number} dateLeft - the first date to check - * @param {Date|String|Number} dateRight - the second date to check - * @returns {Boolean} the dates are in the same month - * - * @example - * // Are 2 September 2014 and 25 September 2014 in the same month? - * var result = isSameMonth( - * new Date(2014, 8, 2), - * new Date(2014, 8, 25) - * ) - * //=> true - */ -function isSameMonth (dirtyDateLeft, dirtyDateRight) { - var dateLeft = parse(dirtyDateLeft) - var dateRight = parse(dirtyDateRight) - return dateLeft.getFullYear() === dateRight.getFullYear() && - dateLeft.getMonth() === dateRight.getMonth() -} - -module.exports = isSameMonth - - -/***/ }), -/* 154 */ -/***/ (function(module, exports, __webpack_require__) { - -var startOfQuarter = __webpack_require__(155) - -/** - * @category Quarter Helpers - * @summary Are the given dates in the same year quarter? - * - * @description - * Are the given dates in the same year quarter? - * - * @param {Date|String|Number} dateLeft - the first date to check - * @param {Date|String|Number} dateRight - the second date to check - * @returns {Boolean} the dates are in the same quarter - * - * @example - * // Are 1 January 2014 and 8 March 2014 in the same quarter? - * var result = isSameQuarter( - * new Date(2014, 0, 1), - * new Date(2014, 2, 8) - * ) - * //=> true - */ -function isSameQuarter (dirtyDateLeft, dirtyDateRight) { - var dateLeftStartOfQuarter = startOfQuarter(dirtyDateLeft) - var dateRightStartOfQuarter = startOfQuarter(dirtyDateRight) - - return dateLeftStartOfQuarter.getTime() === dateRightStartOfQuarter.getTime() -} - -module.exports = isSameQuarter - - -/***/ }), -/* 155 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Quarter Helpers - * @summary Return the start of a year quarter for the given date. - * - * @description - * Return the start of a year quarter for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the start of a quarter - * - * @example - * // The start of a quarter for 2 September 2014 11:55:00: - * var result = startOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Jul 01 2014 00:00:00 - */ -function startOfQuarter (dirtyDate) { - var date = parse(dirtyDate) - var currentMonth = date.getMonth() - var month = currentMonth - currentMonth % 3 - date.setMonth(month, 1) - date.setHours(0, 0, 0, 0) - return date -} - -module.exports = startOfQuarter - - -/***/ }), -/* 156 */ -/***/ (function(module, exports, __webpack_require__) { - -var startOfSecond = __webpack_require__(157) - -/** - * @category Second Helpers - * @summary Are the given dates in the same second? - * - * @description - * Are the given dates in the same second? - * - * @param {Date|String|Number} dateLeft - the first date to check - * @param {Date|String|Number} dateRight - the second date to check - * @returns {Boolean} the dates are in the same second - * - * @example - * // Are 4 September 2014 06:30:15.000 and 4 September 2014 06:30.15.500 - * // in the same second? - * var result = isSameSecond( - * new Date(2014, 8, 4, 6, 30, 15), - * new Date(2014, 8, 4, 6, 30, 15, 500) - * ) - * //=> true - */ -function isSameSecond (dirtyDateLeft, dirtyDateRight) { - var dateLeftStartOfSecond = startOfSecond(dirtyDateLeft) - var dateRightStartOfSecond = startOfSecond(dirtyDateRight) - - return dateLeftStartOfSecond.getTime() === dateRightStartOfSecond.getTime() -} - -module.exports = isSameSecond - - -/***/ }), -/* 157 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Second Helpers - * @summary Return the start of a second for the given date. - * - * @description - * Return the start of a second for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the start of a second - * - * @example - * // The start of a second for 1 December 2014 22:15:45.400: - * var result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400)) - * //=> Mon Dec 01 2014 22:15:45.000 - */ -function startOfSecond (dirtyDate) { - var date = parse(dirtyDate) - date.setMilliseconds(0) - return date -} - -module.exports = startOfSecond - - -/***/ }), -/* 158 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Year Helpers - * @summary Are the given dates in the same year? - * - * @description - * Are the given dates in the same year? - * - * @param {Date|String|Number} dateLeft - the first date to check - * @param {Date|String|Number} dateRight - the second date to check - * @returns {Boolean} the dates are in the same year - * - * @example - * // Are 2 September 2014 and 25 September 2014 in the same year? - * var result = isSameYear( - * new Date(2014, 8, 2), - * new Date(2014, 8, 25) - * ) - * //=> true - */ -function isSameYear (dirtyDateLeft, dirtyDateRight) { - var dateLeft = parse(dirtyDateLeft) - var dateRight = parse(dirtyDateRight) - return dateLeft.getFullYear() === dateRight.getFullYear() -} - -module.exports = isSameYear - - -/***/ }), -/* 159 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Week Helpers - * @summary Return the last day of a week for the given date. - * - * @description - * Return the last day of a week for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @param {Object} [options] - the object with options - * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @returns {Date} the last day of a week - * - * @example - * // The last day of a week for 2 September 2014 11:55:00: - * var result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Sat Sep 06 2014 00:00:00 - * - * @example - * // If the week starts on Monday, the last day of the week for 2 September 2014 11:55:00: - * var result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0), {weekStartsOn: 1}) - * //=> Sun Sep 07 2014 00:00:00 - */ -function lastDayOfWeek (dirtyDate, dirtyOptions) { - var weekStartsOn = dirtyOptions ? (Number(dirtyOptions.weekStartsOn) || 0) : 0 - - var date = parse(dirtyDate) - var day = date.getDay() - var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn) - - date.setHours(0, 0, 0, 0) - date.setDate(date.getDate() + diff) - return date -} - -module.exports = lastDayOfWeek - - -/***/ }), -/* 160 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) -var getDaysInMonth = __webpack_require__(117) - -/** - * @category Month Helpers - * @summary Set the month to the given date. - * - * @description - * Set the month to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} month - the month of the new date - * @returns {Date} the new date with the month setted - * - * @example - * // Set February to 1 September 2014: - * var result = setMonth(new Date(2014, 8, 1), 1) - * //=> Sat Feb 01 2014 00:00:00 - */ -function setMonth (dirtyDate, dirtyMonth) { - var date = parse(dirtyDate) - var month = Number(dirtyMonth) - var year = date.getFullYear() - var day = date.getDate() - - var dateWithDesiredMonth = new Date(0) - dateWithDesiredMonth.setFullYear(year, month, 15) - dateWithDesiredMonth.setHours(0, 0, 0, 0) - var daysInMonth = getDaysInMonth(dateWithDesiredMonth) - // Set the last day of the new month - // if the original date was the last day of the longer month - date.setMonth(month, Math.min(day, daysInMonth)) - return date -} - -module.exports = setMonth - - -/***/ }), -/* 161 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Arabic (ar) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - var num = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩'], - map = { '٠': 0, '١': 1, '٢': 2, '٣': 3, '٤': 4, '٥': 5, '٦': 6, '٧': 7, '٨': 8, '٩': 9 }; - - date.setLocales('ar', { - MMMM: ['كانون الثاني يناير', 'شباط فبراير', 'آذار مارس', 'نيسان أبريل', 'أيار مايو', 'حزيران يونيو', 'تموز يوليو', 'آب أغسطس', 'أيلول سبتمبر', 'تشرين الأول أكتوبر', 'تشرين الثاني نوفمبر', 'كانون الأول ديسمبر'], - MMM: ['كانون الثاني يناير', 'شباط فبراير', 'آذار مارس', 'نيسان أبريل', 'أيار مايو', 'حزيران يونيو', 'تموز يوليو', 'آب أغسطس', 'أيلول سبتمبر', 'تشرين الأول أكتوبر', 'تشرين الثاني نوفمبر', 'كانون الأول ديسمبر'], - dddd: ['الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], - ddd: ['أحد', 'إثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], - dd: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], - A: ['ص', 'م'], - formatter: { - post: function (str) { - return str.replace(/\d/g, function (i) { - return num[i | 0]; - }); - } - }, - parser: { - pre: function (str) { - return str.replace(/[٠١٢٣٤٥٦٧٨٩]/g, function (i) { - return '' + map[i]; - }); - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 162 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Azerbaijani (az) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('az', { - MMMM: ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'], - MMM: ['yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek'], - dddd: ['Bazar', 'Bazar ertəsi', 'Çərşənbə axşamı', 'Çərşənbə', 'Cümə axşamı', 'Cümə', 'Şənbə'], - ddd: ['Baz', 'BzE', 'ÇAx', 'Çər', 'CAx', 'Cüm', 'Şən'], - dd: ['Bz', 'BE', 'ÇA', 'Çə', 'CA', 'Cü', 'Şə'], - A: ['gecə', 'səhər', 'gündüz', 'axşam'], - formatter: { - A: function (d) { - var h = d.getHours(); - if (h < 4) { - return this.A[0]; // gecə - } else if (h < 12) { - return this.A[1]; // səhər - } else if (h < 17) { - return this.A[2]; // gündüz - } - return this.A[3]; // axşam - } - }, - parser: { - h: function (h, a) { - if (a < 2) { - return h; // gecə, səhər - } - return h > 11 ? h : h + 12; // gündüz, axşam - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 163 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Bengali (bn) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('bn', { - MMMM: ['জানুয়ারী', 'ফেবুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'অগাস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], - MMM: ['জানু', 'ফেব', 'মার্চ', 'এপর', 'মে', 'জুন', 'জুল', 'অগ', 'সেপ্ট', 'অক্টো', 'নভ', 'ডিসেম্'], - dddd: ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পত্তিবার', 'শুক্রবার', 'শনিবার'], - ddd: ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পত্তি', 'শুক্র', 'শনি'], - dd: ['রব', 'সম', 'মঙ্গ', 'বু', 'ব্রিহ', 'শু', 'শনি'], - A: ['রাত', 'সকাল', 'দুপুর', 'বিকাল'], - formatter: { - A: function (d) { - var h = d.getHours(); - if (h < 4) { - return this.A[0]; // রাত - } else if (h < 10) { - return this.A[1]; // সকাল - } else if (h < 17) { - return this.A[2]; // দুপুর - } else if (h < 20) { - return this.A[3]; // বিকাল - } - return this.A[0]; // রাত - } - }, - parser: { - h: function (h, a) { - if (a < 1) { - return h < 4 || h > 11 ? h : h + 12; // রাত - } else if (a < 2) { - return h; // সকাল - } else if (a < 3) { - return h > 9 ? h : h + 12; // দুপুর - } - return h + 12; // বিকাল - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 164 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Czech (cs) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('cs', { - MMMM: ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'], - MMM: ['led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro'], - dddd: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'], - ddd: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'], - dd: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'] - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 165 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve German (de) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('de', { - MMMM: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], - MMM: ['Jan.', 'Febr.', 'Mrz.', 'Apr.', 'Mai', 'Jun.', 'Jul.', 'Aug.', 'Sept.', 'Okt.', 'Nov.', 'Dez.'], - dddd: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'], - ddd: ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'], - dd: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'], - A: ['Uhr nachmittags', 'Uhr morgens'] - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 166 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Greek (el) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('el', { - MMMM: { - nominative: ['Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος'], - genitive: ['Ιανουαρίου', 'Φεβρουαρίου', 'Μαρτίου', 'Απριλίου', 'Μαΐου', 'Ιουνίου', 'Ιουλίου', 'Αυγούστου', 'Σεπτεμβρίου', 'Οκτωβρίου', 'Νοεμβρίου', 'Δεκεμβρίου'] - }, - MMM: ['Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιουν', 'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ'], - dddd: ['Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο'], - ddd: ['Κυρ', 'Δευ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ'], - dd: ['Κυ', 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σα'], - A: ['πμ', 'μμ'], - formatter: { - MMMM: function (d, formatString) { - return this.MMMM[/D.*MMMM/.test(formatString) ? 'genitive' : 'nominative'][d.getMonth()]; - }, - hh: function (d) { - return ('0' + d.getHours() % 12).slice(-2); - }, - h: function (d) { - return d.getHours() % 12; - } - }, - parser: { - MMMM: function (str, formatString) { - return this.parser.find(this.MMMM[/D.*MMMM/.test(formatString) ? 'genitive' : 'nominative'], str); - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 167 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Spanish (es) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('es', { - MMMM: ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'], - MMM: ['ene.', 'feb.', 'mar.', 'abr.', 'may.', 'jun.', 'jul.', 'ago.', 'sep.', 'oct.', 'nov.', 'dic.'], - dddd: ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'], - ddd: ['dom.', 'lun.', 'mar.', 'mié.', 'jue.', 'vie.', 'sáb.'], - dd: ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sá'], - A: ['de la mañana', 'de la tarde', 'de la noche'], - formatter: { - A: function (d) { - var h = d.getHours(); - if (h < 12) { - return this.A[0]; // de la mañana - } else if (h < 19) { - return this.A[1]; // de la tarde - } - return this.A[2]; // de la noche - } - }, - parser: { - h: function (h, a) { - if (a < 1) { - return h; // de la mañana - } - return h > 11 ? h : h + 12; // de la tarde, de la noche - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 168 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Persian (fa) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - var num = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'], - map = { '۰': 0, '۱': 1, '۲': 2, '۳': 3, '۴': 4, '۵': 5, '۶': 6, '۷': 7, '۸': 8, '۹': 9 }; - - date.setLocales('fa', { - MMMM: ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], - MMM: ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], - dddd: ['یک‌شنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنج‌شنبه', 'جمعه', 'شنبه'], - ddd: ['یک‌شنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنج‌شنبه', 'جمعه', 'شنبه'], - dd: ['ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش'], - A: ['قبل از ظهر', 'بعد از ظهر'], - formatter: { - post: function (str) { - return str.replace(/\d/g, function (i) { - return num[i | 0]; - }); - } - }, - parser: { - pre: function (str) { - return str.replace(/[۰۱۲۳۴۵۶۷۸۹]/g, function (i) { - return '' + map[i]; - }); - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 169 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve French (fr) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('fr', { - MMMM: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'], - MMM: ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'], - dddd: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'], - ddd: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'], - dd: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'], - A: ['matin', 'l\'après-midi'] - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 170 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Hindi (hi) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('hi', { - MMMM: ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], - MMM: ['जन.', 'फ़र.', 'मार्च', 'अप्रै.', 'मई', 'जून', 'जुल.', 'अग.', 'सित.', 'अक्टू.', 'नव.', 'दिस.'], - dddd: ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरूवार', 'शुक्रवार', 'शनिवार'], - ddd: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरू', 'शुक्र', 'शनि'], - dd: ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'], - A: ['रात', 'सुबह', 'दोपहर', 'शाम'], - formatter: { - A: function (d) { - var h = d.getHours(); - if (h < 4) { - return this.A[0]; // रात - } else if (h < 10) { - return this.A[1]; // सुबह - } else if (h < 17) { - return this.A[2]; // दोपहर - } else if (h < 20) { - return this.A[3]; // शाम - } - return this.A[0]; // रात - } - }, - parser: { - h: function (h, a) { - if (a < 1) { - return h < 4 || h > 11 ? h : h + 12; // रात - } else if (a < 2) { - return h; // सुबह - } else if (a < 3) { - return h > 9 ? h : h + 12; // दोपहर - } - return h + 12; // शाम - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 171 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Hungarian (hu) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('hu', { - MMMM: ['január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december'], - MMM: ['jan', 'feb', 'márc', 'ápr', 'máj', 'jún', 'júl', 'aug', 'szept', 'okt', 'nov', 'dec'], - dddd: ['vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat'], - ddd: ['vas', 'hét', 'kedd', 'sze', 'csüt', 'pén', 'szo'], - dd: ['v', 'h', 'k', 'sze', 'cs', 'p', 'szo'], - A: ['de', 'du'] - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 172 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Indonesian (id) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('id', { - MMMM: ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'], - MMM: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nov', 'Des'], - dddd: ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu'], - ddd: ['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'], - dd: ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sb'], - A: ['pagi', 'siang', 'sore', 'malam'], - formatter: { - A: function (d) { - var h = d.getHours(); - if (h < 11) { - return this.A[0]; // pagi - } else if (h < 15) { - return this.A[1]; // siang - } else if (h < 19) { - return this.A[2]; // sore - } - return this.A[3]; // malam - } - }, - parser: { - h: function (h, a) { - if (a < 1) { - return h; // pagi - } else if (a < 2) { - return h >= 11 ? h : h + 12; // siang - } - return h + 12; // sore, malam - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 173 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Italian (it) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('it', { - MMMM: ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'], - MMM: ['gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'], - dddd: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'], - ddd: ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab'], - dd: ['Do', 'Lu', 'Ma', 'Me', 'Gi', 'Ve', 'Sa'], - A: ['di mattina', 'di pomerrigio'] - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 174 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Japanese (ja) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('ja', { - MMMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], - MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], - dddd: ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'], - ddd: ['日', '月', '火', '水', '木', '金', '土'], - dd: ['日', '月', '火', '水', '木', '金', '土'], - A: ['午前', '午後'], - formatter: { - hh: function (d) { - return ('0' + d.getHours() % 12).slice(-2); - }, - h: function (d) { - return d.getHours() % 12; - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 175 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Javanese (jv) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('jv', { - MMMM: ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'Nopember', 'Desember'], - MMM: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nop', 'Des'], - dddd: ['Minggu', 'Senen', 'Seloso', 'Rebu', 'Kemis', 'Jemuwah', 'Septu'], - ddd: ['Min', 'Sen', 'Sel', 'Reb', 'Kem', 'Jem', 'Sep'], - dd: ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sp'], - A: ['enjing', 'siyang', 'sonten', 'ndalu'], - formatter: { - A: function (d) { - var h = d.getHours(); - if (h < 11) { - return this.A[0]; // enjing - } else if (h < 15) { - return this.A[1]; // siyang - } else if (h < 19) { - return this.A[2]; // sonten - } - return this.A[3]; // ndalu - } - }, - parser: { - h: function (h, a) { - if (a < 1) { - return h; // enjing - } else if (a < 2) { - return h >= 11 ? h : h + 12; // siyang - } - return h + 12; // sonten, ndalu - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 176 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Korean (ko) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('ko', { - MMMM: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], - MMM: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], - dddd: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'], - ddd: ['일', '월', '화', '수', '목', '금', '토'], - dd: ['일', '월', '화', '수', '목', '금', '토'], - A: ['오전', '오후'] - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 177 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Burmese (my) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - var num = ['၀', '၁', '၂', '၃', '၄', '၅', '၆', '၇', '၈', '၉'], - map = { '၀': 0, '၁': 1, '၂': 2, '၃': 3, '၄': 4, '၅': 5, '၆': 6, '၇': 7, '၈': 8, '၉': 9 }; - - date.setLocales('my', { - MMMM: ['ဇန်နဝါရီ', 'ဖေဖော်ဝါရီ', 'မတ်', 'ဧပြီ', 'မေ', 'ဇွန်', 'ဇူလိုင်', 'သြဂုတ်', 'စက်တင်ဘာ', 'အောက်တိုဘာ', 'နိုဝင်ဘာ', 'ဒီဇင်ဘာ'], - MMM: ['ဇန်', 'ဖေ', 'မတ်', 'ပြီ', 'မေ', 'ဇွန်', 'လိုင်', 'သြ', 'စက်', 'အောက်', 'နို', 'ဒီ'], - dddd: ['တနင်္ဂနွေ', 'တနင်္လာ', 'အင်္ဂါ', 'ဗုဒ္ဓဟူး', 'ကြာသပတေး', 'သောကြာ', 'စနေ'], - ddd: ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'], - dd: ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'], - formatter: { - post: function (str) { - return str.replace(/\d/g, function (i) { - return num[i | 0]; - }); - } - }, - parser: { - pre: function (str) { - return str.replace(/[၀၁၂၃၄၅၆၇၈၉]/g, function (i) { - return '' + map[i]; - }); - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 178 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Dutch (nl) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('nl', { - MMMM: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], - MMM: { - withdots: ['jan.', 'feb.', 'mrt.', 'apr.', 'mei', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'], - withoutdots: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'] - }, - dddd: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], - ddd: ['zo.', 'ma.', 'di.', 'wo.', 'do.', 'vr.', 'za.'], - dd: ['Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za'], - formatter: { - MMM: function (d, formatString) { - return this.MMM[/-MMM-/.test(formatString) ? 'withoutdots' : 'withdots'][d.getMonth()]; - } - }, - parser: { - MMM: function (str, formatString) { - return this.parser.find(this.MMM[/-MMM-/.test(formatString) ? 'withoutdots' : 'withdots'], str); - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 179 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Punjabi (pa-in) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - var num = ['੦', '੧', '੨', '੩', '੪', '੫', '੬', '੭', '੮', '੯'], - map = { '੦': 0, '੧': 1, '੨': 2, '੩': 3, '੪': 4, '੫': 5, '੬': 6, '੭': 7, '੮': 8, '੯': 9 }; - - date.setLocales('pa-in', { - MMMM: ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'], - MMM: ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'], - dddd: ['ਐਤਵਾਰ', 'ਸੋਮਵਾਰ', 'ਮੰਗਲਵਾਰ', 'ਬੁਧਵਾਰ', 'ਵੀਰਵਾਰ', 'ਸ਼ੁੱਕਰਵਾਰ', 'ਸ਼ਨੀਚਰਵਾਰ'], - ddd: ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁਧ', 'ਵੀਰ', 'ਸ਼ੁਕਰ', 'ਸ਼ਨੀ'], - dd: ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁਧ', 'ਵੀਰ', 'ਸ਼ੁਕਰ', 'ਸ਼ਨੀ'], - A: ['ਰਾਤ', 'ਸਵੇਰ', 'ਦੁਪਹਿਰ', 'ਸ਼ਾਮ'], - formatter: { - A: function (d) { - var h = d.getHours(); - if (h < 4) { - return this.A[0]; // ਰਾਤ - } else if (h < 10) { - return this.A[1]; // ਸਵੇਰ - } else if (h < 17) { - return this.A[2]; // ਦੁਪਹਿਰ - } else if (h < 20) { - return this.A[3]; // ਸ਼ਾਮ - } - return this.A[0]; // ਰਾਤ - }, - post: function (str) { - return str.replace(/\d/g, function (i) { - return num[i | 0]; - }); - } - }, - parser: { - h: function (h, a) { - if (a < 1) { - return h < 4 || h > 11 ? h : h + 12; // ਰਾਤ - } else if (a < 2) { - return h; // ਸਵੇਰ - } else if (a < 3) { - return h >= 10 ? h : h + 12; // ਦੁਪਹਿਰ - } - return h + 12; // ਸ਼ਾਮ - }, - pre: function (str) { - return str.replace(/[੦੧੨੩੪੫੬੭੮੯]/g, function (i) { - return '' + map[i]; - }); - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 180 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Polish (pl) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('pl', { - MMMM: { - nominative: ['styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień'], - subjective: ['stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 'sierpnia', 'września', 'października', 'listopada', 'grudnia'] - }, - MMM: ['sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru'], - dddd: ['niedziela', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota'], - ddd: ['nie', 'pon', 'wt', 'śr', 'czw', 'pt', 'sb'], - dd: ['Nd', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'So'], - formatter: { - MMMM: function (d, formatString) { - return this.MMMM[/D MMMM/.test(formatString) ? 'subjective' : 'nominative'][d.getMonth()]; - } - }, - parser: { - MMMM: function (str, formatString) { - return this.parser.find(this.MMMM[/D MMMM/.test(formatString) ? 'subjective' : 'nominative'], str); - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 181 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Portuguese (pt) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('pt', { - MMMM: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'], - MMM: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'], - dddd: ['Domingo', 'Segunda-Feira', 'Terça-Feira', 'Quarta-Feira', 'Quinta-Feira', 'Sexta-Feira', 'Sábado'], - ddd: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'], - dd: ['Dom', '2ª', '3ª', '4ª', '5ª', '6ª', 'Sáb'], - A: ['da madrugada', 'da manhã', 'da tarde', 'da noite'], - formatter: { - A: function (d) { - var h = d.getHours(); - if (h < 5) { - return this.A[0]; // da madrugada - } else if (h < 12) { - return this.A[1]; // da manhã - } else if (h < 19) { - return this.A[2]; // da tarde - } - return this.A[3]; // da noite - } - }, - parser: { - h: function (h, a) { - if (a < 2) { - return h; // da madrugada, da manhã - } - return h > 11 ? h : h + 12; // da tarde, da noite - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 182 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Romanian (ro) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('ro', { - MMMM: ['ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie'], - MMM: ['ian.', 'febr.', 'mart.', 'apr.', 'mai', 'iun.', 'iul.', 'aug.', 'sept.', 'oct.', 'nov.', 'dec.'], - dddd: ['duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă'], - ddd: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'], - dd: ['Du', 'Lu', 'Ma', 'Mi', 'Jo', 'Vi', 'Sâ'] - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 183 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Russian (ru) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('ru', { - MMMM: ['Января', 'Февраля', 'Марта', 'Апреля', 'Мая', 'Июня', 'Июля', 'Августа', 'Сентября', 'Октября', 'Ноября', 'Декабря'], - MMM: ['янв', 'фев', 'мар', 'апр', 'мая', 'июня', 'июля', 'авг', 'сен', 'окт', 'ноя', 'дек'], - dddd: ['Воскресенье', 'Понедельник', 'Вторник', 'Среду', 'Четверг', 'Пятницу', 'Субботу'], - ddd: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'], - dd: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'], - A: ['ночи', 'утра', 'дня', 'вечера'], - formatter: { - A: function (d) { - var h = d.getHours(); - if (h < 4) { - return this.A[0]; // ночи - } else if (h < 12) { - return this.A[1]; // утра - } else if (h < 17) { - return this.A[2]; // дня - } - return this.A[3]; // вечера - } - }, - parser: { - h: function (h, a) { - if (a < 2) { - return h; // ночи, утра - } - return h > 11 ? h : h + 12; // дня, вечера - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 184 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Serbian (sr) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('sr', { - MMMM: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'], - MMM: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'], - dddd: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], - ddd: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'], - dd: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'] - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 185 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Thai (th) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('th', { - MMMM: ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'], - MMM: ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'], - dddd: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'], - ddd: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัส', 'ศุกร์', 'เสาร์'], - dd: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'], - A: ['ก่อนเที่ยง', 'หลังเที่ยง'] - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 186 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Turkish (tr) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('tr', { - MMMM: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'], - MMM: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'], - dddd: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'], - ddd: ['Paz', 'Pts', 'Sal', 'Çar', 'Per', 'Cum', 'Cts'], - dd: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'] - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 187 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Ukrainian (uk) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('uk', { - MMMM: ['січня', 'лютого', 'березня', 'квітня', 'травня', 'червня', 'липня', 'серпня', 'вересня', 'жовтня', 'листопада', 'грудня'], - MMM: ['січ', 'лют', 'бер', 'квіт', 'трав', 'черв', 'лип', 'серп', 'вер', 'жовт', 'лист', 'груд'], - dddd: { - nominative: ['неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'п’ятниця', 'субота'], - accusative: ['неділю', 'понеділок', 'вівторок', 'середу', 'четвер', 'п’ятницю', 'суботу'], - genitive: ['неділі', 'понеділка', 'вівторка', 'середи', 'четверга', 'п’ятниці', 'суботи'] - }, - ddd: ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'], - dd: ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'], - A: ['ночі', 'ранку', 'дня', 'вечора'], - formatter: { - A: function (d) { - var h = d.getHours(); - if (h < 4) { - return this.A[0]; // ночі - } else if (h < 12) { - return this.A[1]; // ранку - } else if (h < 17) { - return this.A[2]; // дня - } - return this.A[3]; // вечора - }, - dddd: function (d, formatString) { - var type = 'nominative'; - if (/(\[[ВвУу]\]) ?dddd/.test(formatString)) { - type = 'accusative'; - } else if (/\[?(?:минулої|наступної)? ?\] ?dddd/.test(formatString)) { - type = 'genitive'; - } - return this.dddd[type][d.getDay()]; - } - }, - parser: { - h: function (h, a) { - if (a < 2) { - return h; // ночі, ранку - } - return h > 11 ? h : h + 12; // дня, вечора - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 188 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Uzbek (uz) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('uz', { - MMMM: ['январ', 'феврал', 'март', 'апрел', 'май', 'июн', 'июл', 'август', 'сентябр', 'октябр', 'ноябр', 'декабр'], - MMM: ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], - dddd: ['Якшанба', 'Душанба', 'Сешанба', 'Чоршанба', 'Пайшанба', 'Жума', 'Шанба'], - ddd: ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'], - dd: ['Як', 'Ду', 'Се', 'Чо', 'Па', 'Жу', 'Ша'] - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 189 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Vietnamese (vi) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('vi', { - MMMM: ['tháng 1', 'tháng 2', 'tháng 3', 'tháng 4', 'tháng 5', 'tháng 6', 'tháng 7', 'tháng 8', 'tháng 9', 'tháng 10', 'tháng 11', 'tháng 12'], - MMM: ['Th01', 'Th02', 'Th03', 'Th04', 'Th05', 'Th06', 'Th07', 'Th08', 'Th09', 'Th10', 'Th11', 'Th12'], - dddd: ['chủ nhật', 'thứ hai', 'thứ ba', 'thứ tư', 'thứ năm', 'thứ sáu', 'thứ bảy'], - ddd: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], - dd: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], - A: ['sa', 'ch'] - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 190 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Chinese (zh-cn) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('zh-cn', { - MMMM: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], - MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], - dddd: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], - ddd: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], - dd: ['日', '一', '二', '三', '四', '五', '六'], - A: ['凌晨', '早上', '上午', '中午', '下午', '晚上'], - formatter: { - A: function (d) { - var hm = d.getHours() * 100 + d.getMinutes(); - if (hm < 600) { - return this.A[0]; // 凌晨 - } else if (hm < 900) { - return this.A[1]; // 早上 - } else if (hm < 1130) { - return this.A[2]; // 上午 - } else if (hm < 1230) { - return this.A[3]; // 中午 - } else if (hm < 1800) { - return this.A[4]; // 下午 - } - return this.A[5]; // 晚上 - } - }, - parser: { - h: function (h, a) { - if (a < 4) { - return h; // 凌晨, 早上, 上午, 中午 - } - return h > 11 ? h : h + 12; // 下午, 晚上 - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 191 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** - * @preserve date-and-time.js locale configuration - * @preserve Chinese (zh-tw) - * @preserve It is using moment.js locale configuration as a reference. - */ -(function (global) { - 'use strict'; - - var locale = function (date) { - date.setLocales('zh-tw', { - MMMM: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], - MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], - dddd: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], - ddd: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], - dd: ['日', '一', '二', '三', '四', '五', '六'], - A: ['早上', '上午', '中午', '下午', '晚上'], - formatter: { - A: function (d) { - var hm = d.getHours() * 100 + d.getMinutes(); - if (hm < 900) { - return this.A[0]; // 早上 - } else if (hm < 1130) { - return this.A[1]; // 上午 - } else if (hm < 1230) { - return this.A[2]; // 中午 - } else if (hm < 1800) { - return this.A[3]; // 下午 - } - return this.A[4]; // 晚上 - } - }, - parser: { - h: function (h, a) { - if (a < 3) { - return h; // 早上, 上午, 中午 - } - return h > 11 ? h : h + 12; // 下午, 晚上 - } - } - }); - }; - - if (typeof module === 'object' && typeof module.exports === 'object') { - locale(__webpack_require__(1)); - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (locale), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - locale(global.date); - } - -}(this)); - - -/***/ }), -/* 192 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 193 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 194 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 195 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 196 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 197 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 198 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 199 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 200 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 201 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 202 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 203 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 204 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 205 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 206 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 207 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 208 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 209 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 210 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 211 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 212 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 213 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 214 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 215 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 216 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../typings.d.ts"} - -/***/ }), -/* 217 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 218 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 219 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 220 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 221 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 222 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 223 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 224 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 225 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 226 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 227 */ -/***/ (function(module, exports) { - -module.exports = {"typings":"../../typings.d.ts"} - -/***/ }), -/* 228 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_index__ = __webpack_require__(229); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_type__ = __webpack_require__(230); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_date_fns__ = __webpack_require__(125); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_date_fns___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_date_fns__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_date_and_time__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_date_and_time___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_date_and_time__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_events__ = __webpack_require__(330); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__defaultOptions__ = __webpack_require__(331); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__templates_calendar__ = __webpack_require__(332); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__templates_days__ = __webpack_require__(333); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - -// import date from 'date' - - - - - - - -var _supportsPassive = false; -try { - var opts = Object.defineProperty({}, 'passive', { - get: function get() { - _supportsPassive = true; - } - }); - window.addEventListener('testPassive', null, opts); - window.removeEventListener('testPassive', null, opts); -} catch (e) {} - -var bulmaCalendar = function (_EventEmitter) { - _inherits(bulmaCalendar, _EventEmitter); - - function bulmaCalendar(selector) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - _classCallCheck(this, bulmaCalendar); - - var _this = _possibleConstructorReturn(this, (bulmaCalendar.__proto__ || Object.getPrototypeOf(bulmaCalendar)).call(this)); - - _this.element = __WEBPACK_IMPORTED_MODULE_1__utils_type__["a" /* isString */](selector) ? document.querySelector(selector) : selector; - // An invalid selector or non-DOM node has been provided. - if (!_this.element) { - throw new Error('An invalid selector or non-DOM node has been provided.'); - } - _this._clickEvents = ['click', 'touch']; - - /// Set default options and merge with instance defined - _this.options = _extends({}, __WEBPACK_IMPORTED_MODULE_5__defaultOptions__["a" /* default */], options); - - _this.onToggleDatePicker = _this.onToggleDatePicker.bind(_this); - _this.onCloseDatePicker = _this.onCloseDatePicker.bind(_this); - _this.onPreviousDatePicker = _this.onPreviousDatePicker.bind(_this); - _this.onNextDatePicker = _this.onNextDatePicker.bind(_this); - _this.onSelectMonthDatePicker = _this.onSelectMonthDatePicker.bind(_this); - _this.onMonthClickDatePicker = _this.onMonthClickDatePicker.bind(_this); - _this.onSelectYearDatePicker = _this.onSelectYearDatePicker.bind(_this); - _this.onYearClickDatePicker = _this.onYearClickDatePicker.bind(_this); - _this.onDateClickDatePicker = _this.onDateClickDatePicker.bind(_this); - _this.onDocumentClickDatePicker = _this.onDocumentClickDatePicker.bind(_this); - _this.onValidateClickDatePicker = _this.onValidateClickDatePicker.bind(_this); - _this.onTodayClickDatePicker = _this.onTodayClickDatePicker.bind(_this); - _this.onClearClickDatePicker = _this.onClearClickDatePicker.bind(_this); - _this.onCancelClickDatePicker = _this.onCancelClickDatePicker.bind(_this); - - // Initiate plugin - _this._init(); - return _this; - } - - /** - * Initiate all DOM element containing datePicker class - * @method - * @return {Array} Array of all datePicker instances - */ - - - _createClass(bulmaCalendar, [{ - key: 'isRange', - - - /**************************************************** - * * - * PUBLIC FUNCTIONS * - * * - ****************************************************/ - value: function isRange() { - return this.options.isRange; - } - - /** - * Returns true if calendar picker is open, otherwise false. - * @method isOpen - * @return {boolean} - */ - - }, { - key: 'isOpen', - value: function isOpen() { - return this._open; - } - - /** - * Get / Set datePicker value - * @param {*} date - */ - - }, { - key: 'value', - value: function value() { - var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (date) { - var newDate = void 0; - if (this.options.isRange) { - var dates = this.element.value.split(' - '); - if (dates.length) { - this.startDate = __WEBPACK_IMPORTED_MODULE_3_date_and_time___default.a.parse(dates[0], this.dateFormat); - } - if (dates.length === 2) { - this.endDate = __WEBPACK_IMPORTED_MODULE_3_date_and_time___default.a.parse(dates[1], this.dateFormat); - } - } else { - this.startDate = __WEBPACK_IMPORTED_MODULE_3_date_and_time___default.a.parse(this.element.value, this.dateFormat); - } - } else { - var value = ''; - if (this.options.isRange) { - if (this.startDate && this._isValidDate(this.startDate) && this.endDate && this._isValidDate(this.endDate)) { - value = __WEBPACK_IMPORTED_MODULE_2_date_fns__["format"](this.startDate, this.dateFormat, { locale: this.locale }) + ' - ' + __WEBPACK_IMPORTED_MODULE_2_date_fns__["format"](this.endDate, this.dateFormat, { locale: this.locale }); - } - } else if (this.startDate && this._isValidDate(this.startDate)) { - value = __WEBPACK_IMPORTED_MODULE_2_date_fns__["format"](this.startDate, this.dateFormat, { - locale: this.locale - }); - } - this.emit('date:selected', this.date, this); - return value; - } - } - }, { - key: 'clear', - value: function clear() { - this._clear(); - } - - /** - * Show datePicker HTML Component - * @method show - * @return {void} - */ - - }, { - key: 'show', - value: function show() { - this._snapshots = []; - this._snapshot(); - if (this.element.value) { - this.value(this.element.value); - } - this._visibleDate = this._isValidDate(this.startDate, this.minDate, this.maxDate) ? this.startDate : this._visibleDate; - this._refreshCalendar(); - this._ui.body.dates.classList.add('is-active'); - this._ui.body.months.classList.remove('is-active'); - this._ui.body.years.classList.remove('is-active'); - this._ui.navigation.previous.removeAttribute('disabled'); - this._ui.navigation.next.removeAttribute('disabled'); - this._ui.container.classList.add('is-active'); - this._open = true; - this._focus = true; - - this.emit('show', this); - } - - /** - * Hide datePicker HTML Component - * @method hide - * @return {void} - */ - - }, { - key: 'hide', - value: function hide() { - this._open = false; - this._focus = false; - this._ui.container.classList.remove('is-active'); - this.emit('hide', this); - } - - /** - * Destroy datePicker - * @method destroy - * @return {[type]} [description] - */ - - }, { - key: 'destroy', - value: function destroy() { - this._ui.container.remove(); - } - - /**************************************************** - * * - * EVENTS FUNCTIONS * - * * - ****************************************************/ - - }, { - key: 'onDocumentClickDatePicker', - value: function onDocumentClickDatePicker(e) { - if (!_supportsPassive) { - e.preventDefault(); - } - e.stopPropagation(); - - if (this.options.displayMode !== 'inline' && this._open) { - this.onCloseDatePicker(e); - } - } - }, { - key: 'onToggleDatePicker', - value: function onToggleDatePicker(e) { - if (!_supportsPassive) { - e.preventDefault(); - } - e.stopPropagation(); - - if (this._open) { - this.hide(); - } else { - this.show(); - } - } - }, { - key: 'onValidateClickDatePicker', - value: function onValidateClickDatePicker(e) { - if (!_supportsPassive) { - e.preventDefault(); - } - e.stopPropagation(); - - this.onCloseDatePicker(e); - } - }, { - key: 'onTodayClickDatePicker', - value: function onTodayClickDatePicker(e) { - if (!_supportsPassive) { - e.preventDefault(); - } - e.stopPropagation(); - - if (!this.options.isRange) { - this.startDate = new Date(); - this._visibleDate = this.startDate; - } else { - this._setStartAndEnd(new Date()); - this._visibleDate = this.startDate; - } - this.element.value = this.value(); - this.element.setAttribute('value', this.value()); - this._refreshCalendar(); - } - }, { - key: 'onClearClickDatePicker', - value: function onClearClickDatePicker(e) { - if (!_supportsPassive) { - e.preventDefault(); - } - e.stopPropagation(); - - this._clear(); - } - }, { - key: 'onCancelClickDatePicker', - value: function onCancelClickDatePicker(e) { - if (!_supportsPassive) { - e.preventDefault(); - } - e.stopPropagation(); - - if (this._snapshots.length) { - this.startDate = this._snapshots[0].start; - this.endDate = this._snapshots[0].end; - } - this.element.value = this.value(); - this.element.setAttribute('value', this.value()); - this.onCloseDatePicker(e); - } - }, { - key: 'onCloseDatePicker', - value: function onCloseDatePicker(e) { - if (!_supportsPassive) { - e.preventDefault(); - } - e.stopPropagation(); - - this.hide(); - } - }, { - key: 'onPreviousDatePicker', - value: function onPreviousDatePicker(e) { - if (!_supportsPassive) { - e.preventDefault(); - } - e.stopPropagation(); - - var prevMonth = __WEBPACK_IMPORTED_MODULE_2_date_fns__["lastDayOfMonth"](__WEBPACK_IMPORTED_MODULE_2_date_fns__["subMonths"](new Date(__WEBPACK_IMPORTED_MODULE_2_date_fns__["getYear"](this._visibleDate), __WEBPACK_IMPORTED_MODULE_2_date_fns__["getMonth"](this._visibleDate)), 1)); - var day = Math.min(__WEBPACK_IMPORTED_MODULE_2_date_fns__["getDaysInMonth"](prevMonth), __WEBPACK_IMPORTED_MODULE_2_date_fns__["getDate"](this._visibleDate)); - this._visibleDate = this.minDate ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["max"](__WEBPACK_IMPORTED_MODULE_2_date_fns__["setDate"](prevMonth, day), this.minDate) : __WEBPACK_IMPORTED_MODULE_2_date_fns__["setDate"](prevMonth, day); - - this._refreshCalendar(); - } - }, { - key: 'onNextDatePicker', - value: function onNextDatePicker(e) { - if (!_supportsPassive) { - e.preventDefault(); - } - e.stopPropagation(); - - var nextMonth = __WEBPACK_IMPORTED_MODULE_2_date_fns__["addMonths"](this._visibleDate, 1); - var day = Math.min(__WEBPACK_IMPORTED_MODULE_2_date_fns__["getDaysInMonth"](nextMonth), __WEBPACK_IMPORTED_MODULE_2_date_fns__["getDate"](this._visibleDate)); - this._visibleDate = this.maxDate ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["min"](__WEBPACK_IMPORTED_MODULE_2_date_fns__["setDate"](nextMonth, day), this.maxDate) : __WEBPACK_IMPORTED_MODULE_2_date_fns__["setDate"](nextMonth, day); - - this._refreshCalendar(); - } - }, { - key: 'onDateClickDatePicker', - value: function onDateClickDatePicker(e) { - if (!_supportsPassive) { - e.preventDefault(); - } - e.stopPropagation(); - - if (!e.currentTarget.classList.contains('is-disabled')) { - this._setStartAndEnd(e.currentTarget.dataset.date); - - this._refreshCalendar(); - if (this.options.displayMode === 'inline' || this.options.closeOnSelect) { - this.element.value = this.value(); - this.element.setAttribute('value', this.value()); - } - - if ((!this.options.isRange || this.startDate && this._isValidDate(this.startDate) && this.endDate && this._isValidDate(this.endDate)) && this.options.closeOnSelect) { - this.hide(); - } - } - } - }, { - key: 'onSelectMonthDatePicker', - value: function onSelectMonthDatePicker(e) { - e.stopPropagation(); - this._ui.body.dates.classList.remove('is-active'); - this._ui.body.years.classList.remove('is-active'); - this._ui.body.months.classList.add('is-active'); - this._ui.navigation.previous.setAttribute('disabled', 'disabled'); - this._ui.navigation.next.setAttribute('disabled', 'disabled'); - } - }, { - key: 'onSelectYearDatePicker', - value: function onSelectYearDatePicker(e) { - e.stopPropagation(); - - this._ui.body.dates.classList.remove('is-active'); - this._ui.body.months.classList.remove('is-active'); - this._ui.body.years.classList.add('is-active'); - this._ui.navigation.previous.setAttribute('disabled', 'disabled'); - this._ui.navigation.next.setAttribute('disabled', 'disabled'); - - var currentYear = this._ui.body.years.querySelector('.calendar-year.is-active'); - if (currentYear) { - this._ui.body.years.scrollTop = currentYear.offsetTop - this._ui.body.years.offsetTop - this._ui.body.years.clientHeight / 2; - } - } - }, { - key: 'onMonthClickDatePicker', - value: function onMonthClickDatePicker(e) { - if (!_supportsPassive) { - e.preventDefault(); - } - - e.stopPropagation(); - var newDate = __WEBPACK_IMPORTED_MODULE_2_date_fns__["setMonth"](this._visibleDate, parseInt(e.currentTarget.dataset.month) - 1); - this._visibleDate = this.minDate ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["max"](newDate, this.minDate) : newDate; - this._visibleDate = this.maxDate ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["min"](this._visibleDate, this.maxDate) : this._visibleDate; - - this._refreshCalendar(); - } - }, { - key: 'onYearClickDatePicker', - value: function onYearClickDatePicker(e) { - if (!_supportsPassive) { - e.preventDefault(); - } - - e.stopPropagation(); - var newDate = __WEBPACK_IMPORTED_MODULE_2_date_fns__["setYear"](this._visibleDate, parseInt(e.currentTarget.dataset.year)); - this._visibleDate = this.minDate ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["max"](newDate, this.minDate) : newDate; - this._visibleDate = this.maxDate ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["min"](this._visibleDate, this.maxDate) : this._visibleDate; - - this._refreshCalendar(); - } - - /**************************************************** - * * - * PRIVATE FUNCTIONS * - * * - ****************************************************/ - /** - * Initiate plugin instance - * @method _init - * @return {datePicker} Current plugin instance - */ - - }, { - key: '_init', - value: function _init() { - var _this2 = this; - - this._id = __WEBPACK_IMPORTED_MODULE_0__utils_index__["a" /* uuid */]('datePicker'); - this._snapshots = []; - - // Cahnge element type to prevent browser default type="date" behavior - if (this.element.tagName.toLowerCase() === 'input' && this.element.getAttribute('type').toLowerCase() === 'date') { - this.element.setAttribute('type', 'text'); - } - - // Use Element dataset values to override options - var elementConfig = this.element.dataset ? Object.keys(this.element.dataset).filter(function (key) { - return Object.keys(__WEBPACK_IMPORTED_MODULE_5__defaultOptions__["a" /* default */]).includes(key); - }).reduce(function (obj, key) { - return _extends({}, obj, _defineProperty({}, key, _this2.element.dataset[key])); - }, {}) : {}; - this.options = _extends({}, this.options, elementConfig); - - this.lang = this.options.lang; - this.dateFormat = this.options.dateFormat || 'MM/DD/YYYY'; - this._date = { - start: undefined, - end: undefined - }; - this._open = false; - if (this.options.displayMode !== 'inline' && window.matchMedia('screen and (max-width: 768px)').matches) { - this.options.displayMode = 'dialog'; - } - - this._initDates(); - this._build(); - this._bindEvents(); - - this.emit('ready', this); - - return this; - } - - // Init dates used by datePicker core system - - }, { - key: '_initDates', - value: function _initDates() { - // Transform start date according to dateFormat option - this.minDate = this.options.minDate ? __WEBPACK_IMPORTED_MODULE_3_date_and_time___default.a.parse(this.options.minDate, this.dateFormat) : undefined; - this.maxDate = this.options.maxDate ? __WEBPACK_IMPORTED_MODULE_3_date_and_time___default.a.parse(this.options.maxDate, this.dateFormat) : undefined; - - var today = new Date(); - var startDateToday = this._isValidDate(today, this.options.minDate, this.options.maxDate) ? today : this.minDate; - - this.startDate = this.options.startDate; - this.endDate = this.options.isRange ? this.options.endDate : undefined; - - if (this.element.value) { - if (this.options.isRange) { - var dates = this.element.value.split(' - '); - if (dates.length) { - this.startDate = __WEBPACK_IMPORTED_MODULE_3_date_and_time___default.a.parse(dates[0], this.dateFormat); - } - if (dates.length === 2) { - this.endDate = __WEBPACK_IMPORTED_MODULE_3_date_and_time___default.a.parse(dates[1], this.dateFormat); - } - } else { - this.startDate = __WEBPACK_IMPORTED_MODULE_3_date_and_time___default.a.parse(this.element.value, this.dateFormat); - } - } - this._visibleDate = this._isValidDate(this.startDate) ? this.startDate : startDateToday; - - if (this.options.disabledDates) { - if (!Array.isArray(this.options.disabledDates)) { - this.options.disabledDates = [this.options.disabledDates]; - } - for (var i = 0; i < this.options.disabledDates.length; i++) { - this.options.disabledDates[i] = __WEBPACK_IMPORTED_MODULE_2_date_fns__["format"](this.options.disabledDates[i], this.options.dateFormat, { - locale: this.locale - }); - } - } - - this._snapshot(); - } - - /** - * Build datePicker HTML component and append it to the DOM - * @method _build - * @return {datePicker} Current plugin instance - */ - - }, { - key: '_build', - value: function _build() { - var _this3 = this; - - // the 7 days of the week (Sun-Sat) - var labels = new Array(7).fill(__WEBPACK_IMPORTED_MODULE_2_date_fns__["startOfWeek"](this._visibleDate)).map(function (d, i) { - return __WEBPACK_IMPORTED_MODULE_2_date_fns__["format"](__WEBPACK_IMPORTED_MODULE_2_date_fns__["addDays"](d, i + _this3.options.weekStart), 'ddd', { - locale: _this3.locale - }); - }); - // the 12 months of the year (Jan-SDecat) - var months = new Array(12).fill(__WEBPACK_IMPORTED_MODULE_2_date_fns__["startOfWeek"](this._visibleDate)).map(function (d, i) { - return __WEBPACK_IMPORTED_MODULE_2_date_fns__["format"](__WEBPACK_IMPORTED_MODULE_2_date_fns__["addMonths"](d, i), 'MM', { - locale: _this3.locale - }); - }); - // the 7 days of the week (Sun-Sat) - var years = new Array(100).fill(__WEBPACK_IMPORTED_MODULE_2_date_fns__["subYears"](this._visibleDate, 50)).map(function (d, i) { - return __WEBPACK_IMPORTED_MODULE_2_date_fns__["format"](__WEBPACK_IMPORTED_MODULE_2_date_fns__["addYears"](d, i), 'YYYY', { - locale: _this3.locale - }); - }); - - // Create datePicker HTML Fragment based on Template - var datePickerFragment = document.createRange().createContextualFragment(Object(__WEBPACK_IMPORTED_MODULE_6__templates_calendar__["a" /* default */])(_extends({}, this.options, { - id: this.id, - date: this.date, - locale: this.locale, - visibleDate: this._visibleDate, - labels: { - from: this.options.labelFrom, - to: this.options.labelTo, - weekdays: labels - }, - months: months, - years: years, - isRange: this.options.isRange, - month: __WEBPACK_IMPORTED_MODULE_2_date_fns__["format"](this.month, 'MM', { - locale: this.locale - }) - }))); - - // Save pointer to each datePicker element for later use - var container = datePickerFragment.querySelector('#' + this.id); - this._ui = { - container: container, - calendar: container.querySelector('.calendar'), - overlay: this.options.displayMode === 'dialog' ? { - background: container.querySelector('.modal-background'), - close: container.querySelector('.modal-close') - } : undefined, - header: { - container: container.querySelector('.calendar-header'), - start: { - container: container.querySelector('.calendar-selection-start'), - day: container.querySelector('.calendar-selection-start .calendar-selection-day'), - month: container.querySelector('.calendar-selection-start .calendar-selection-month'), - weekday: container.querySelector('.calendar-selection-start .calendar-selection-weekday'), - empty: container.querySelector('.calendar-selection-start .empty') - }, - end: this.options.isRange ? { - container: container.querySelector('.calendar-selection-end'), - day: container.querySelector('.calendar-selection-end .calendar-selection-day'), - month: container.querySelector('.calendar-selection-end .calendar-selection-month'), - weekday: container.querySelector('.calendar-selection-end .calendar-selection-weekday'), - empty: container.querySelector('.calendar-selection-start .empty') - } : undefined - }, - navigation: { - container: container.querySelector('.calendar-nav'), - previous: container.querySelector('.calendar-nav-previous'), - next: container.querySelector('.calendar-nav-next'), - month: container.querySelector('.calendar-nav-month'), - year: container.querySelector('.calendar-nav-year') - }, - footer: { - container: container.querySelector('.calendar-footer'), - validate: container.querySelector('.calendar-footer-validate'), - today: container.querySelector('.calendar-footer-today'), - clear: container.querySelector('.calendar-footer-clear'), - cancel: container.querySelector('.calendar-footer-cancel') - }, - body: { - dates: container.querySelector('.calendar-dates'), - days: container.querySelector('.calendar-days'), - weekdays: container.querySelector('.calendar-weekdays'), - months: container.querySelector('.calendar-months'), - years: container.querySelector('.calendar-years') - } - }; - - if (!this.options.showHeader) { - this._ui.header.container.classList.add('is-hidden'); - } - if (!this.options.showFooter) { - this._ui.footer.container.classList.add('is-hidden'); - } - if (!this.options.todayButton) { - this._ui.footer.today.classList.add('is-hidden'); - } - if (!this.options.clearButton) { - this._ui.footer.clear.classList.add('is-hidden'); - } - - if (this.options.displayMode === 'inline' && this._ui.footer.validate) { - this._ui.footer.validate.classList.add('is-hidden'); - } - if (this.options.displayMode === 'inline' && this._ui.footer.cancel) { - this._ui.footer.cancel.classList.add('is-hidden'); - } - if (this.options.closeOnSelect && this._ui.footer.validate) { - this._ui.footer.validate.classList.add('is-hidden'); - } - - // Add datepicker HTML element to DOM - if (this.options.displayMode !== 'dialog') { - var wrapper = document.createElement('div'); - this.element.parentNode.insertBefore(wrapper, this.element); - wrapper.appendChild(this.element); - if (this.options.displayMode === 'inline') { - container.classList.add('is-inline'); - this.element.classList.add('is-hidden'); - container.classList.remove('datepicker'); - } - wrapper.appendChild(datePickerFragment); - this._refreshCalendar(); - } else { - document.body.appendChild(datePickerFragment); - } - } - - /** - * Bind all events - * @method _bindEvents - * @return {void} - */ - - }, { - key: '_bindEvents', - value: function _bindEvents() { - var _this4 = this; - - document.addEventListener('keydown', function (e) { - if (_this4._focus) { - switch (e.keyCode || e.which) { - case 37: - _this4.onPreviousDatePicker(e); - break; - case 39: - _this4.onNextDatePicker(e); - break; - } - } - }); - - // Bind event to element in order to display/hide datePicker on click - if (this.options.toggleOnInputClick === true) { - this._clickEvents.forEach(function (clickEvent) { - _this4.element.addEventListener(clickEvent, _this4.onToggleDatePicker); - }); - } - - if (this.options.displayMode === 'dialog' && this._ui.overlay) { - // Bind close event on Close button - if (this._ui.overlay.close) { - this._clickEvents.forEach(function (clickEvent) { - _this4.this._ui.overlay.close.addEventListener(clickEvent, _this4.onCloseDatePicker); - }); - } - // Bind close event on overlay based on options - if (this.options.closeOnOverlayClick && this._ui.overlay.background) { - this._clickEvents.forEach(function (clickEvent) { - _this4._ui.overlay.background.addEventListener(clickEvent, _this4.onCloseDatePicker); - }); - } - } - - // Bind year navigation events - if (this._ui.navigation.previous) { - this._clickEvents.forEach(function (clickEvent) { - _this4._ui.navigation.previous.addEventListener(clickEvent, _this4.onPreviousDatePicker); - }); - } - if (this._ui.navigation.next) { - this._clickEvents.forEach(function (clickEvent) { - _this4._ui.navigation.next.addEventListener(clickEvent, _this4.onNextDatePicker); - }); - } - - if (this._ui.navigation.month) { - this._clickEvents.forEach(function (clickEvent) { - _this4._ui.navigation.month.addEventListener(clickEvent, _this4.onSelectMonthDatePicker); - }); - } - if (this._ui.navigation.year) { - this._clickEvents.forEach(function (clickEvent) { - _this4._ui.navigation.year.addEventListener(clickEvent, _this4.onSelectYearDatePicker); - }); - } - - var months = this._ui.body.months.querySelectorAll('.calendar-month') || []; - months.forEach(function (month) { - _this4._clickEvents.forEach(function (clickEvent) { - month.addEventListener(clickEvent, _this4.onMonthClickDatePicker); - }); - }); - - var years = this._ui.body.years.querySelectorAll('.calendar-year') || []; - years.forEach(function (year) { - _this4._clickEvents.forEach(function (clickEvent) { - year.addEventListener(clickEvent, _this4.onYearClickDatePicker); - }); - }); - - if (this._ui.footer.validate) { - this._clickEvents.forEach(function (clickEvent) { - _this4._ui.footer.validate.addEventListener(clickEvent, _this4.onValidateClickDatePicker); - }); - } - if (this._ui.footer.today) { - this._clickEvents.forEach(function (clickEvent) { - _this4._ui.footer.today.addEventListener(clickEvent, _this4.onTodayClickDatePicker); - }); - } - if (this._ui.footer.clear) { - this._clickEvents.forEach(function (clickEvent) { - _this4._ui.footer.clear.addEventListener(clickEvent, _this4.onClearClickDatePicker); - }); - } - if (this._ui.footer.cancel) { - this._clickEvents.forEach(function (clickEvent) { - _this4._ui.footer.cancel.addEventListener(clickEvent, _this4.onCancelClickDatePicker); - }); - } - } - - /** - * Bind events on each Day item - * @method _bindDaysEvents - * @return {void} - */ - - }, { - key: '_bindDaysEvents', - value: function _bindDaysEvents() { - var _this5 = this; - - [].forEach.call(this._ui.days, function (day) { - _this5._clickEvents.forEach(function (clickEvent) { - // if not in range, no click action - // if in this month, select the date - // if out of this month, jump to the date - var onClick = !_this5._isValidDate(new Date(day.dataset.date), _this5.minDate, _this5.maxDate) ? null : _this5.onDateClickDatePicker; - day.addEventListener(clickEvent, onClick); - }); - - day.addEventListener('hover', function (e) { - e.preventDEfault(); - }); - }); - } - }, { - key: '_renderDays', - value: function _renderDays() { - var _this6 = this; - - // first day of current month view - var start = __WEBPACK_IMPORTED_MODULE_2_date_fns__["startOfWeek"](__WEBPACK_IMPORTED_MODULE_2_date_fns__["startOfMonth"](this._visibleDate)); - // last day of current month view - var end = __WEBPACK_IMPORTED_MODULE_2_date_fns__["endOfWeek"](__WEBPACK_IMPORTED_MODULE_2_date_fns__["endOfMonth"](this._visibleDate)); - - // get all days and whether they are within the current month and range - var days = new Array(__WEBPACK_IMPORTED_MODULE_2_date_fns__["differenceInDays"](end, start) + 1).fill(start).map(function (s, i) { - var theDate = __WEBPACK_IMPORTED_MODULE_2_date_fns__["addDays"](s, i + _this6.options.weekStart); - var isThisMonth = __WEBPACK_IMPORTED_MODULE_2_date_fns__["isSameMonth"](_this6._visibleDate, theDate); - var isInRange = _this6.options.isRange && __WEBPACK_IMPORTED_MODULE_2_date_fns__["isWithinRange"](theDate, _this6.startDate, _this6.endDate); - var isDisabled = _this6.maxDate ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["isAfter"](theDate, _this6.maxDate) : false; - isDisabled = !isDisabled && _this6.minDate ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["isBefore"](theDate, _this6.minDate) : isDisabled; - - if (_this6.options.disabledDates) { - for (var j = 0; j < _this6.options.disabledDates.length; j++) { - if (__WEBPACK_IMPORTED_MODULE_2_date_fns__["getTime"](theDate) == __WEBPACK_IMPORTED_MODULE_2_date_fns__["getTime"](_this6.options.disabledDates[j])) { - isDisabled = true; - } - } - } - - if (_this6.options.disabledWeekDays) { - var disabledWeekDays = __WEBPACK_IMPORTED_MODULE_1__utils_type__["a" /* isString */](_this6.options.disabledWeekDays) ? _this6.options.disabledWeekDays.split(',') : _this6.options.disabledWeekDays; - disabledWeekDays.forEach(function (day) { - if (__WEBPACK_IMPORTED_MODULE_2_date_fns__["getDay"](theDate) == day) { - isDisabled = true; - } - }); - } - - return { - date: theDate, - isRange: _this6.options.isRange, - isToday: __WEBPACK_IMPORTED_MODULE_2_date_fns__["isToday"](theDate), - isStartDate: __WEBPACK_IMPORTED_MODULE_2_date_fns__["isEqual"](_this6.startDate, theDate), - isEndDate: __WEBPACK_IMPORTED_MODULE_2_date_fns__["isEqual"](_this6.endDate, theDate), - isDisabled: isDisabled, - isThisMonth: isThisMonth, - isInRange: isInRange - }; - }); - - this._ui.body.days.appendChild(document.createRange().createContextualFragment(Object(__WEBPACK_IMPORTED_MODULE_7__templates_days__["a" /* default */])(days))); - this._ui.days = this._ui.body.days.querySelectorAll('.calendar-date'); - this._bindDaysEvents(); - - this.emit('rendered', this); - } - }, { - key: '_togglePreviousButton', - value: function _togglePreviousButton() { - var active = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - - if (!active) { - this._ui.navigation.previous.setAttribute('disabled', 'disabled'); - } else { - this._ui.navigation.previous.removeAttribute('disabled'); - } - } - }, { - key: '_toggleNextButton', - value: function _toggleNextButton() { - var active = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - - if (!active) { - this._ui.navigation.next.setAttribute('disabled', 'disabled'); - } else { - this._ui.navigation.next.removeAttribute('disabled'); - } - } - }, { - key: '_setStartAndEnd', - value: function _setStartAndEnd(date) { - var _this7 = this; - - this._snapshot(); - if (this.options.isRange && (!this._isValidDate(this.startDate) || this._isValidDate(this.startDate) && this._isValidDate(this.endDate))) { - this.startDate = __WEBPACK_IMPORTED_MODULE_2_date_fns__["parse"](date); - this.endDate = undefined; - this.emit('startDate:selected', this.date, this); - } else if (this.options.isRange && !this._isValidDate(this.endDate)) { - if (__WEBPACK_IMPORTED_MODULE_2_date_fns__["isBefore"](date, this.startDate)) { - this.endDate = this.startDate; - this.startDate = __WEBPACK_IMPORTED_MODULE_2_date_fns__["parse"](date); - this.emit('startDate:selected', this.date, this); - this.emit('endDate:selected', this.date, this); - } else if (__WEBPACK_IMPORTED_MODULE_2_date_fns__["isAfter"](date, this.startDate)) { - this.endDate = __WEBPACK_IMPORTED_MODULE_2_date_fns__["parse"](date); - this.emit('endDate:selected', this.date, this); - } else { - this.startDate = __WEBPACK_IMPORTED_MODULE_2_date_fns__["parse"](date); - this.endDate = undefined; - } - } else { - this.startDate = __WEBPACK_IMPORTED_MODULE_2_date_fns__["parse"](date); - this.endDate = undefined; - } - - if (this.options.isRange && this._isValidDate(this.startDate) && this._isValidDate(this.endDate)) { - new Array(__WEBPACK_IMPORTED_MODULE_2_date_fns__["differenceInDays"](this.endDate, this.startDate) + 1).fill(this.startDate).map(function (s, i) { - var theDate = __WEBPACK_IMPORTED_MODULE_2_date_fns__["addDays"](s, i); - var dateElement = _this7._ui.body.dates.querySelector('.calendar-date[data-date="' + theDate.toString() + '"]'); - if (dateElement) { - if (__WEBPACK_IMPORTED_MODULE_2_date_fns__["isEqual"](_this7.startDate, theDate)) { - dateElement.classList.add('calendar-range-start'); - } - if (__WEBPACK_IMPORTED_MODULE_2_date_fns__["isEqual"](_this7.endDate, theDate)) { - dateElement.classList.add('calendar-range-end'); - } - dateElement.classList.add('calendar-range'); - } - }); - } - } - }, { - key: '_clear', - value: function _clear() { - this.startDate = undefined; - this.endDate = undefined; - this.element.value = this.value(); - this.element.setAttribute('value', this.value()); - if (this.options.displayMode !== 'inline' && this._open) { - this.hide(); - } - this._refreshCalendar(); - } - - /** - * Refresh calendar with new year/month days - * @method _refreshCalendar - * @return {[type]} [description] - */ - - }, { - key: '_refreshCalendar', - value: function _refreshCalendar() { - var _this8 = this; - - // this.elementCalendarNavDay.innerHTML = this.date.date(); - this._ui.body.days.innerHTML = ''; - - if (this.minDate && __WEBPACK_IMPORTED_MODULE_2_date_fns__["differenceInMonths"](this._visibleDate, this.minDate) === 0) { - this._togglePreviousButton(false); - } else { - this._togglePreviousButton(); - } - - if (this.maxDate && __WEBPACK_IMPORTED_MODULE_2_date_fns__["differenceInMonths"](this._visibleDate, this.maxDate) === 0) { - this._toggleNextButton(false); - } else { - this._toggleNextButton(); - } - - this._refreshCalendarHeader(); - - this._ui.navigation.month.innerHTML = __WEBPACK_IMPORTED_MODULE_2_date_fns__["format"](this._visibleDate, 'MMMM', { - locale: this.locale - }); - this._ui.navigation.year.innerHTML = __WEBPACK_IMPORTED_MODULE_2_date_fns__["format"](this._visibleDate, 'YYYY', { - locale: this.locale - }); - - var months = this._ui.body.months.querySelectorAll('.calendar-month') || []; - months.forEach(function (month) { - month.classList.remove('is-active'); - if (month.dataset.month === __WEBPACK_IMPORTED_MODULE_2_date_fns__["format"](_this8._visibleDate, 'MM', { - locale: _this8.locale - })) { - month.classList.add('is-active'); - } - }); - var years = this._ui.body.years.querySelectorAll('.calendar-year') || []; - years.forEach(function (year) { - year.classList.remove('is-active'); - if (year.dataset.year === __WEBPACK_IMPORTED_MODULE_2_date_fns__["format"](_this8._visibleDate, 'YYYY', { - locale: _this8.locale - })) { - year.classList.add('is-active'); - } - }); - - this._renderDays(); - - this._ui.body.dates.classList.add('is-active'); - this._ui.body.months.classList.remove('is-active'); - this._ui.body.years.classList.remove('is-active'); - this._ui.navigation.previous.removeAttribute('disabled'); - this._ui.navigation.next.removeAttribute('disabled'); - - return this; - } - }, { - key: '_refreshCalendarHeader', - value: function _refreshCalendarHeader() { - this._ui.header.start.day.innerHTML = this._isValidDate(this.startDate) ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["getDate"](this.startDate) : ' '; - this._ui.header.start.weekday.innerHTML = this._isValidDate(this.startDate) ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["format"](this.startDate, 'dddd', { - locale: this.locale - }) : ' '; - this._ui.header.start.month.innerHTML = this._isValidDate(this.startDate) ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["format"](this.startDate, 'MMMM YYYY', { - locale: this.locale - }) : ' '; - - if (this._ui.header.end) { - this._ui.header.end.day.innerHTML = this.options.isRange && this._isValidDate(this.endDate) ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["getDate"](this.endDate) : ' '; - this._ui.header.end.weekday.innerHTML = this.options.isRange && this._isValidDate(this.endDate) ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["format"](this.endDate, 'dddd', { - locale: this.locale - }) : ' '; - this._ui.header.end.month.innerHTML = this.options.isRange && this._isValidDate(this.endDate) ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["format"](this.endDate, 'MMMM YYYY', { - locale: this.locale - }) : ' '; - } - } - }, { - key: '_isValidDate', - value: function _isValidDate(date, minDate, maxDate) { - try { - if (!date) { - return false; - } - if (__WEBPACK_IMPORTED_MODULE_2_date_fns__["isValid"](date)) { - if (!minDate && !maxDate) { - return true; - } - if (minDate && maxDate) { - return __WEBPACK_IMPORTED_MODULE_2_date_fns__["isWithinRange"](date, minDate, maxDate); - } - if (maxDate) { - return __WEBPACK_IMPORTED_MODULE_2_date_fns__["isBefore"](date, maxDate) || __WEBPACK_IMPORTED_MODULE_2_date_fns__["isEqual"](date, maxDate); - } - return __WEBPACK_IMPORTED_MODULE_2_date_fns__["isAfter"](date, minDate) || __WEBPACK_IMPORTED_MODULE_2_date_fns__["isEqual"](date, minDate); - } else { - return false; - } - } catch (e) { - return false; - } - } - }, { - key: '_snapshot', - value: function _snapshot() { - this._snapshots.push(_extends({}, this._date)); - } - }, { - key: 'id', - - - /**************************************************** - * * - * GETTERS and SETTERS * - * * - ****************************************************/ - - /** - * Get id of current datePicker - */ - get: function get() { - return this._id; - } - - // Get current datePicker language - - }, { - key: 'lang', - get: function get() { - return this._lang; - } - - // Set datePicker language - , - set: function set() { - var lang = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'en'; - - this._lang = lang; - this._locale = __webpack_require__(334)("./" + lang); - } - }, { - key: 'locale', - get: function get() { - return this._locale; - } - - // Get date object - - }, { - key: 'date', - get: function get() { - return this._date || { - start: undefined, - end: undefined - }; - } - }, { - key: 'startDate', - get: function get() { - return this._date.start; - }, - set: function set(date) { - this._date.start = date ? this._isValidDate(date, this.minDate, this.maxDate) ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["startOfDay"](date) : undefined : undefined; - } - }, { - key: 'endDate', - get: function get() { - return this._date.end; - }, - set: function set(date) { - this._date.end = date ? this._isValidDate(date, this.minDate, this.maxDate) ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["startOfDay"](date) : undefined : undefined; - } - - // Get minDate - - }, { - key: 'minDate', - get: function get() { - return this._minDate; - } - - // Set minDate - , - set: function set() { - var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; - - this._minDate = date ? this._isValidDate(date) ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["startOfDay"](date) : this._minDate : undefined; - return this; - } - - // Get maxDate - - }, { - key: 'maxDate', - get: function get() { - return this._maxDate; - } - - // Set maxDate - , - set: function set() { - var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - this._maxDate = date ? this._isValidDate(date) ? __WEBPACK_IMPORTED_MODULE_2_date_fns__["startOfDay"](date) : this._maxDate : undefined; - return this; - } - - // Get dateFormat - - }, { - key: 'dateFormat', - get: function get() { - return this._dateFormat; - } - - // Set dateFormat (set to yyyy-mm-dd by default) - , - set: function set(dateFormat) { - this._dateFormat = dateFormat; - return this; - } - }], [{ - key: 'attach', - value: function attach() { - var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'input[type="date"]'; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var datepickerInstances = new Array(); - - var datepickers = __WEBPACK_IMPORTED_MODULE_1__utils_type__["a" /* isString */](selector) ? document.querySelectorAll(selector) : Array.isArray(selector) ? selector : [selector]; - [].forEach.call(datepickers, function (datepicker) { - datepickerInstances.push(new bulmaCalendar(datepicker, options)); - }); - return datepickerInstances; - } - }]); - - return bulmaCalendar; -}(__WEBPACK_IMPORTED_MODULE_4__utils_events__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["default"] = (bulmaCalendar); - -/***/ }), -/* 229 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return uuid; }); -var uuid = function uuid() { - var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - return prefix + ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function (c) { - return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16); - }); -}; - -/***/ }), -/* 230 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isString; }); -/* unused harmony export isDate */ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var isString = function isString(unknown) { - return typeof unknown === 'string' || !!unknown && (typeof unknown === 'undefined' ? 'undefined' : _typeof(unknown)) === 'object' && Object.prototype.toString.call(unknown) === '[object String]'; -}; -var isDate = function isDate(unknown) { - return (Object.prototype.toString.call(unknown) === '[object Date]' || unknown instanceof Date) && !isNaN(unknown.valueOf()); -}; - -/***/ }), -/* 231 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Range Helpers - * @summary Is the given date range overlapping with another date range? - * - * @description - * Is the given date range overlapping with another date range? - * - * @param {Date|String|Number} initialRangeStartDate - the start of the initial range - * @param {Date|String|Number} initialRangeEndDate - the end of the initial range - * @param {Date|String|Number} comparedRangeStartDate - the start of the range to compare it with - * @param {Date|String|Number} comparedRangeEndDate - the end of the range to compare it with - * @returns {Boolean} whether the date ranges are overlapping - * @throws {Error} startDate of a date range cannot be after its endDate - * - * @example - * // For overlapping date ranges: - * areRangesOverlapping( - * new Date(2014, 0, 10), new Date(2014, 0, 20), new Date(2014, 0, 17), new Date(2014, 0, 21) - * ) - * //=> true - * - * @example - * // For non-overlapping date ranges: - * areRangesOverlapping( - * new Date(2014, 0, 10), new Date(2014, 0, 20), new Date(2014, 0, 21), new Date(2014, 0, 22) - * ) - * //=> false - */ -function areRangesOverlapping (dirtyInitialRangeStartDate, dirtyInitialRangeEndDate, dirtyComparedRangeStartDate, dirtyComparedRangeEndDate) { - var initialStartTime = parse(dirtyInitialRangeStartDate).getTime() - var initialEndTime = parse(dirtyInitialRangeEndDate).getTime() - var comparedStartTime = parse(dirtyComparedRangeStartDate).getTime() - var comparedEndTime = parse(dirtyComparedRangeEndDate).getTime() - - if (initialStartTime > initialEndTime || comparedStartTime > comparedEndTime) { - throw new Error('The start of the range cannot be after the end of the range') - } - - return initialStartTime < comparedEndTime && comparedStartTime < initialEndTime -} - -module.exports = areRangesOverlapping - - -/***/ }), -/* 232 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Common Helpers - * @summary Return an index of the closest date from the array comparing to the given date. - * - * @description - * Return an index of the closest date from the array comparing to the given date. - * - * @param {Date|String|Number} dateToCompare - the date to compare with - * @param {Date[]|String[]|Number[]} datesArray - the array to search - * @returns {Number} an index of the date closest to the given date - * @throws {TypeError} the second argument must be an instance of Array - * - * @example - * // Which date is closer to 6 September 2015? - * var dateToCompare = new Date(2015, 8, 6) - * var datesArray = [ - * new Date(2015, 0, 1), - * new Date(2016, 0, 1), - * new Date(2017, 0, 1) - * ] - * var result = closestIndexTo(dateToCompare, datesArray) - * //=> 1 - */ -function closestIndexTo (dirtyDateToCompare, dirtyDatesArray) { - if (!(dirtyDatesArray instanceof Array)) { - throw new TypeError(toString.call(dirtyDatesArray) + ' is not an instance of Array') - } - - var dateToCompare = parse(dirtyDateToCompare) - var timeToCompare = dateToCompare.getTime() - - var result - var minDistance - - dirtyDatesArray.forEach(function (dirtyDate, index) { - var currentDate = parse(dirtyDate) - var distance = Math.abs(timeToCompare - currentDate.getTime()) - if (result === undefined || distance < minDistance) { - result = index - minDistance = distance - } - }) - - return result -} - -module.exports = closestIndexTo - - -/***/ }), -/* 233 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Common Helpers - * @summary Return a date from the array closest to the given date. - * - * @description - * Return a date from the array closest to the given date. - * - * @param {Date|String|Number} dateToCompare - the date to compare with - * @param {Date[]|String[]|Number[]} datesArray - the array to search - * @returns {Date} the date from the array closest to the given date - * @throws {TypeError} the second argument must be an instance of Array - * - * @example - * // Which date is closer to 6 September 2015: 1 January 2000 or 1 January 2030? - * var dateToCompare = new Date(2015, 8, 6) - * var result = closestTo(dateToCompare, [ - * new Date(2000, 0, 1), - * new Date(2030, 0, 1) - * ]) - * //=> Tue Jan 01 2030 00:00:00 - */ -function closestTo (dirtyDateToCompare, dirtyDatesArray) { - if (!(dirtyDatesArray instanceof Array)) { - throw new TypeError(toString.call(dirtyDatesArray) + ' is not an instance of Array') - } - - var dateToCompare = parse(dirtyDateToCompare) - var timeToCompare = dateToCompare.getTime() - - var result - var minDistance - - dirtyDatesArray.forEach(function (dirtyDate) { - var currentDate = parse(dirtyDate) - var distance = Math.abs(timeToCompare - currentDate.getTime()) - if (result === undefined || distance < minDistance) { - result = currentDate - minDistance = distance - } - }) - - return result -} - -module.exports = closestTo - - -/***/ }), -/* 234 */ -/***/ (function(module, exports, __webpack_require__) { - -var startOfISOWeek = __webpack_require__(4) - -var MILLISECONDS_IN_MINUTE = 60000 -var MILLISECONDS_IN_WEEK = 604800000 - -/** - * @category ISO Week Helpers - * @summary Get the number of calendar ISO weeks between the given dates. - * - * @description - * Get the number of calendar ISO weeks between the given dates. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @returns {Number} the number of calendar ISO weeks - * - * @example - * // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014? - * var result = differenceInCalendarISOWeeks( - * new Date(2014, 6, 21), - * new Date(2014, 6, 6) - * ) - * //=> 3 - */ -function differenceInCalendarISOWeeks (dirtyDateLeft, dirtyDateRight) { - var startOfISOWeekLeft = startOfISOWeek(dirtyDateLeft) - var startOfISOWeekRight = startOfISOWeek(dirtyDateRight) - - var timestampLeft = startOfISOWeekLeft.getTime() - - startOfISOWeekLeft.getTimezoneOffset() * MILLISECONDS_IN_MINUTE - var timestampRight = startOfISOWeekRight.getTime() - - startOfISOWeekRight.getTimezoneOffset() * MILLISECONDS_IN_MINUTE - - // Round the number of days to the nearest integer - // because the number of milliseconds in a week is not constant - // (e.g. it's different in the week of the daylight saving time clock shift) - return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK) -} - -module.exports = differenceInCalendarISOWeeks - - -/***/ }), -/* 235 */ -/***/ (function(module, exports, __webpack_require__) { - -var getQuarter = __webpack_require__(135) -var parse = __webpack_require__(0) - -/** - * @category Quarter Helpers - * @summary Get the number of calendar quarters between the given dates. - * - * @description - * Get the number of calendar quarters between the given dates. - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @returns {Number} the number of calendar quarters - * - * @example - * // How many calendar quarters are between 31 December 2013 and 2 July 2014? - * var result = differenceInCalendarQuarters( - * new Date(2014, 6, 2), - * new Date(2013, 11, 31) - * ) - * //=> 3 - */ -function differenceInCalendarQuarters (dirtyDateLeft, dirtyDateRight) { - var dateLeft = parse(dirtyDateLeft) - var dateRight = parse(dirtyDateRight) - - var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear() - var quarterDiff = getQuarter(dateLeft) - getQuarter(dateRight) - - return yearDiff * 4 + quarterDiff -} - -module.exports = differenceInCalendarQuarters - - -/***/ }), -/* 236 */ -/***/ (function(module, exports, __webpack_require__) { - -var startOfWeek = __webpack_require__(79) - -var MILLISECONDS_IN_MINUTE = 60000 -var MILLISECONDS_IN_WEEK = 604800000 - -/** - * @category Week Helpers - * @summary Get the number of calendar weeks between the given dates. - * - * @description - * Get the number of calendar weeks between the given dates. - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @param {Object} [options] - the object with options - * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @returns {Number} the number of calendar weeks - * - * @example - * // How many calendar weeks are between 5 July 2014 and 20 July 2014? - * var result = differenceInCalendarWeeks( - * new Date(2014, 6, 20), - * new Date(2014, 6, 5) - * ) - * //=> 3 - * - * @example - * // If the week starts on Monday, - * // how many calendar weeks are between 5 July 2014 and 20 July 2014? - * var result = differenceInCalendarWeeks( - * new Date(2014, 6, 20), - * new Date(2014, 6, 5), - * {weekStartsOn: 1} - * ) - * //=> 2 - */ -function differenceInCalendarWeeks (dirtyDateLeft, dirtyDateRight, dirtyOptions) { - var startOfWeekLeft = startOfWeek(dirtyDateLeft, dirtyOptions) - var startOfWeekRight = startOfWeek(dirtyDateRight, dirtyOptions) - - var timestampLeft = startOfWeekLeft.getTime() - - startOfWeekLeft.getTimezoneOffset() * MILLISECONDS_IN_MINUTE - var timestampRight = startOfWeekRight.getTime() - - startOfWeekRight.getTimezoneOffset() * MILLISECONDS_IN_MINUTE - - // Round the number of days to the nearest integer - // because the number of milliseconds in a week is not constant - // (e.g. it's different in the week of the daylight saving time clock shift) - return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK) -} - -module.exports = differenceInCalendarWeeks - - -/***/ }), -/* 237 */ -/***/ (function(module, exports, __webpack_require__) { - -var differenceInMilliseconds = __webpack_require__(82) - -var MILLISECONDS_IN_HOUR = 3600000 - -/** - * @category Hour Helpers - * @summary Get the number of hours between the given dates. - * - * @description - * Get the number of hours between the given dates. - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @returns {Number} the number of hours - * - * @example - * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00? - * var result = differenceInHours( - * new Date(2014, 6, 2, 19, 0), - * new Date(2014, 6, 2, 6, 50) - * ) - * //=> 12 - */ -function differenceInHours (dirtyDateLeft, dirtyDateRight) { - var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_HOUR - return diff > 0 ? Math.floor(diff) : Math.ceil(diff) -} - -module.exports = differenceInHours - - -/***/ }), -/* 238 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) -var differenceInCalendarISOYears = __webpack_require__(133) -var compareAsc = __webpack_require__(10) -var subISOYears = __webpack_require__(138) - -/** - * @category ISO Week-Numbering Year Helpers - * @summary Get the number of full ISO week-numbering years between the given dates. - * - * @description - * Get the number of full ISO week-numbering years between the given dates. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @returns {Number} the number of full ISO week-numbering years - * - * @example - * // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012? - * var result = differenceInISOYears( - * new Date(2012, 0, 1), - * new Date(2010, 0, 1) - * ) - * //=> 1 - */ -function differenceInISOYears (dirtyDateLeft, dirtyDateRight) { - var dateLeft = parse(dirtyDateLeft) - var dateRight = parse(dirtyDateRight) - - var sign = compareAsc(dateLeft, dateRight) - var difference = Math.abs(differenceInCalendarISOYears(dateLeft, dateRight)) - dateLeft = subISOYears(dateLeft, sign * difference) - - // Math.abs(diff in full ISO years - diff in calendar ISO years) === 1 - // if last calendar ISO year is not full - // If so, result must be decreased by 1 in absolute value - var isLastISOYearNotFull = compareAsc(dateLeft, dateRight) === -sign - return sign * (difference - isLastISOYearNotFull) -} - -module.exports = differenceInISOYears - - -/***/ }), -/* 239 */ -/***/ (function(module, exports, __webpack_require__) { - -var differenceInMilliseconds = __webpack_require__(82) - -var MILLISECONDS_IN_MINUTE = 60000 - -/** - * @category Minute Helpers - * @summary Get the number of minutes between the given dates. - * - * @description - * Get the number of minutes between the given dates. - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @returns {Number} the number of minutes - * - * @example - * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00? - * var result = differenceInMinutes( - * new Date(2014, 6, 2, 12, 20, 0), - * new Date(2014, 6, 2, 12, 7, 59) - * ) - * //=> 12 - */ -function differenceInMinutes (dirtyDateLeft, dirtyDateRight) { - var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_MINUTE - return diff > 0 ? Math.floor(diff) : Math.ceil(diff) -} - -module.exports = differenceInMinutes - - -/***/ }), -/* 240 */ -/***/ (function(module, exports, __webpack_require__) { - -var differenceInMonths = __webpack_require__(120) - -/** - * @category Quarter Helpers - * @summary Get the number of full quarters between the given dates. - * - * @description - * Get the number of full quarters between the given dates. - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @returns {Number} the number of full quarters - * - * @example - * // How many full quarters are between 31 December 2013 and 2 July 2014? - * var result = differenceInQuarters( - * new Date(2014, 6, 2), - * new Date(2013, 11, 31) - * ) - * //=> 2 - */ -function differenceInQuarters (dirtyDateLeft, dirtyDateRight) { - var diff = differenceInMonths(dirtyDateLeft, dirtyDateRight) / 3 - return diff > 0 ? Math.floor(diff) : Math.ceil(diff) -} - -module.exports = differenceInQuarters - - -/***/ }), -/* 241 */ -/***/ (function(module, exports, __webpack_require__) { - -var differenceInDays = __webpack_require__(137) - -/** - * @category Week Helpers - * @summary Get the number of full weeks between the given dates. - * - * @description - * Get the number of full weeks between the given dates. - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @returns {Number} the number of full weeks - * - * @example - * // How many full weeks are between 5 July 2014 and 20 July 2014? - * var result = differenceInWeeks( - * new Date(2014, 6, 20), - * new Date(2014, 6, 5) - * ) - * //=> 2 - */ -function differenceInWeeks (dirtyDateLeft, dirtyDateRight) { - var diff = differenceInDays(dirtyDateLeft, dirtyDateRight) / 7 - return diff > 0 ? Math.floor(diff) : Math.ceil(diff) -} - -module.exports = differenceInWeeks - - -/***/ }), -/* 242 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) -var differenceInCalendarYears = __webpack_require__(136) -var compareAsc = __webpack_require__(10) - -/** - * @category Year Helpers - * @summary Get the number of full years between the given dates. - * - * @description - * Get the number of full years between the given dates. - * - * @param {Date|String|Number} dateLeft - the later date - * @param {Date|String|Number} dateRight - the earlier date - * @returns {Number} the number of full years - * - * @example - * // How many full years are between 31 December 2013 and 11 February 2015? - * var result = differenceInYears( - * new Date(2015, 1, 11), - * new Date(2013, 11, 31) - * ) - * //=> 1 - */ -function differenceInYears (dirtyDateLeft, dirtyDateRight) { - var dateLeft = parse(dirtyDateLeft) - var dateRight = parse(dirtyDateRight) - - var sign = compareAsc(dateLeft, dateRight) - var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight)) - dateLeft.setFullYear(dateLeft.getFullYear() - sign * difference) - - // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full - // If so, result must be decreased by 1 in absolute value - var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign - return sign * (difference - isLastYearNotFull) -} - -module.exports = differenceInYears - - -/***/ }), -/* 243 */ -/***/ (function(module, exports, __webpack_require__) { - -var compareDesc = __webpack_require__(119) -var parse = __webpack_require__(0) -var differenceInSeconds = __webpack_require__(121) -var enLocale = __webpack_require__(6) - -var MINUTES_IN_DAY = 1440 -var MINUTES_IN_MONTH = 43200 -var MINUTES_IN_YEAR = 525600 - -/** - * @category Common Helpers - * @summary Return the distance between the given dates in words. - * - * @description - * Return the distance between the given dates in words, using strict units. - * This is like `distanceInWords`, but does not use helpers like 'almost', 'over', - * 'less than' and the like. - * - * | Distance between dates | Result | - * |------------------------|---------------------| - * | 0 ... 59 secs | [0..59] seconds | - * | 1 ... 59 mins | [1..59] minutes | - * | 1 ... 23 hrs | [1..23] hours | - * | 1 ... 29 days | [1..29] days | - * | 1 ... 11 months | [1..11] months | - * | 1 ... N years | [1..N] years | - * - * @param {Date|String|Number} dateToCompare - the date to compare with - * @param {Date|String|Number} date - the other date - * @param {Object} [options] - the object with options - * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first - * @param {'s'|'m'|'h'|'d'|'M'|'Y'} [options.unit] - if specified, will force a unit - * @param {'floor'|'ceil'|'round'} [options.partialMethod='floor'] - which way to round partial units - * @param {Object} [options.locale=enLocale] - the locale object - * @returns {String} the distance in words - * - * @example - * // What is the distance between 2 July 2014 and 1 January 2015? - * var result = distanceInWordsStrict( - * new Date(2014, 6, 2), - * new Date(2015, 0, 2) - * ) - * //=> '6 months' - * - * @example - * // What is the distance between 1 January 2015 00:00:15 - * // and 1 January 2015 00:00:00? - * var result = distanceInWordsStrict( - * new Date(2015, 0, 1, 0, 0, 15), - * new Date(2015, 0, 1, 0, 0, 0), - * ) - * //=> '15 seconds' - * - * @example - * // What is the distance from 1 January 2016 - * // to 1 January 2015, with a suffix? - * var result = distanceInWordsStrict( - * new Date(2016, 0, 1), - * new Date(2015, 0, 1), - * {addSuffix: true} - * ) - * //=> '1 year ago' - * - * @example - * // What is the distance from 1 January 2016 - * // to 1 January 2015, in minutes? - * var result = distanceInWordsStrict( - * new Date(2016, 0, 1), - * new Date(2015, 0, 1), - * {unit: 'm'} - * ) - * //=> '525600 minutes' - * - * @example - * // What is the distance from 1 January 2016 - * // to 28 January 2015, in months, rounded up? - * var result = distanceInWordsStrict( - * new Date(2015, 0, 28), - * new Date(2015, 0, 1), - * {unit: 'M', partialMethod: 'ceil'} - * ) - * //=> '1 month' - * - * @example - * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto? - * var eoLocale = require('date-fns/locale/eo') - * var result = distanceInWordsStrict( - * new Date(2016, 7, 1), - * new Date(2015, 0, 1), - * {locale: eoLocale} - * ) - * //=> '1 jaro' - */ -function distanceInWordsStrict (dirtyDateToCompare, dirtyDate, dirtyOptions) { - var options = dirtyOptions || {} - - var comparison = compareDesc(dirtyDateToCompare, dirtyDate) - - var locale = options.locale - var localize = enLocale.distanceInWords.localize - if (locale && locale.distanceInWords && locale.distanceInWords.localize) { - localize = locale.distanceInWords.localize - } - - var localizeOptions = { - addSuffix: Boolean(options.addSuffix), - comparison: comparison - } - - var dateLeft, dateRight - if (comparison > 0) { - dateLeft = parse(dirtyDateToCompare) - dateRight = parse(dirtyDate) - } else { - dateLeft = parse(dirtyDate) - dateRight = parse(dirtyDateToCompare) - } - - var unit - var mathPartial = Math[options.partialMethod ? String(options.partialMethod) : 'floor'] - var seconds = differenceInSeconds(dateRight, dateLeft) - var offset = dateRight.getTimezoneOffset() - dateLeft.getTimezoneOffset() - var minutes = mathPartial(seconds / 60) - offset - var hours, days, months, years - - if (options.unit) { - unit = String(options.unit) - } else { - if (minutes < 1) { - unit = 's' - } else if (minutes < 60) { - unit = 'm' - } else if (minutes < MINUTES_IN_DAY) { - unit = 'h' - } else if (minutes < MINUTES_IN_MONTH) { - unit = 'd' - } else if (minutes < MINUTES_IN_YEAR) { - unit = 'M' - } else { - unit = 'Y' - } - } - - // 0 up to 60 seconds - if (unit === 's') { - return localize('xSeconds', seconds, localizeOptions) - - // 1 up to 60 mins - } else if (unit === 'm') { - return localize('xMinutes', minutes, localizeOptions) - - // 1 up to 24 hours - } else if (unit === 'h') { - hours = mathPartial(minutes / 60) - return localize('xHours', hours, localizeOptions) - - // 1 up to 30 days - } else if (unit === 'd') { - days = mathPartial(minutes / MINUTES_IN_DAY) - return localize('xDays', days, localizeOptions) - - // 1 up to 12 months - } else if (unit === 'M') { - months = mathPartial(minutes / MINUTES_IN_MONTH) - return localize('xMonths', months, localizeOptions) - - // 1 year up to max Date - } else if (unit === 'Y') { - years = mathPartial(minutes / MINUTES_IN_YEAR) - return localize('xYears', years, localizeOptions) - } - - throw new Error('Unknown unit: ' + unit) -} - -module.exports = distanceInWordsStrict - - -/***/ }), -/* 244 */ -/***/ (function(module, exports, __webpack_require__) { - -var distanceInWords = __webpack_require__(139) - -/** - * @category Common Helpers - * @summary Return the distance between the given date and now in words. - * - * @description - * Return the distance between the given date and now in words. - * - * | Distance to now | Result | - * |-------------------------------------------------------------------|---------------------| - * | 0 ... 30 secs | less than a minute | - * | 30 secs ... 1 min 30 secs | 1 minute | - * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes | - * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour | - * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours | - * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day | - * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days | - * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month | - * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months | - * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months | - * | 1 yr ... 1 yr 3 months | about 1 year | - * | 1 yr 3 months ... 1 yr 9 month s | over 1 year | - * | 1 yr 9 months ... 2 yrs | almost 2 years | - * | N yrs ... N yrs 3 months | about N years | - * | N yrs 3 months ... N yrs 9 months | over N years | - * | N yrs 9 months ... N+1 yrs | almost N+1 years | - * - * With `options.includeSeconds == true`: - * | Distance to now | Result | - * |---------------------|----------------------| - * | 0 secs ... 5 secs | less than 5 seconds | - * | 5 secs ... 10 secs | less than 10 seconds | - * | 10 secs ... 20 secs | less than 20 seconds | - * | 20 secs ... 40 secs | half a minute | - * | 40 secs ... 60 secs | less than a minute | - * | 60 secs ... 90 secs | 1 minute | - * - * @param {Date|String|Number} date - the given date - * @param {Object} [options] - the object with options - * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed - * @param {Boolean} [options.addSuffix=false] - result specifies if the second date is earlier or later than the first - * @param {Object} [options.locale=enLocale] - the locale object - * @returns {String} the distance in words - * - * @example - * // If today is 1 January 2015, what is the distance to 2 July 2014? - * var result = distanceInWordsToNow( - * new Date(2014, 6, 2) - * ) - * //=> '6 months' - * - * @example - * // If now is 1 January 2015 00:00:00, - * // what is the distance to 1 January 2015 00:00:15, including seconds? - * var result = distanceInWordsToNow( - * new Date(2015, 0, 1, 0, 0, 15), - * {includeSeconds: true} - * ) - * //=> 'less than 20 seconds' - * - * @example - * // If today is 1 January 2015, - * // what is the distance to 1 January 2016, with a suffix? - * var result = distanceInWordsToNow( - * new Date(2016, 0, 1), - * {addSuffix: true} - * ) - * //=> 'in about 1 year' - * - * @example - * // If today is 1 January 2015, - * // what is the distance to 1 August 2016 in Esperanto? - * var eoLocale = require('date-fns/locale/eo') - * var result = distanceInWordsToNow( - * new Date(2016, 7, 1), - * {locale: eoLocale} - * ) - * //=> 'pli ol 1 jaro' - */ -function distanceInWordsToNow (dirtyDate, dirtyOptions) { - return distanceInWords(Date.now(), dirtyDate, dirtyOptions) -} - -module.exports = distanceInWordsToNow - - -/***/ }), -/* 245 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Day Helpers - * @summary Return the array of dates within the specified range. - * - * @description - * Return the array of dates within the specified range. - * - * @param {Date|String|Number} startDate - the first date - * @param {Date|String|Number} endDate - the last date - * @param {Number} [step=1] - the step between each day - * @returns {Date[]} the array with starts of days from the day of startDate to the day of endDate - * @throws {Error} startDate cannot be after endDate - * - * @example - * // Each day between 6 October 2014 and 10 October 2014: - * var result = eachDay( - * new Date(2014, 9, 6), - * new Date(2014, 9, 10) - * ) - * //=> [ - * // Mon Oct 06 2014 00:00:00, - * // Tue Oct 07 2014 00:00:00, - * // Wed Oct 08 2014 00:00:00, - * // Thu Oct 09 2014 00:00:00, - * // Fri Oct 10 2014 00:00:00 - * // ] - */ -function eachDay (dirtyStartDate, dirtyEndDate, dirtyStep) { - var startDate = parse(dirtyStartDate) - var endDate = parse(dirtyEndDate) - var step = dirtyStep !== undefined ? dirtyStep : 1 - - var endTime = endDate.getTime() - - if (startDate.getTime() > endTime) { - throw new Error('The first date cannot be after the second date') - } - - var dates = [] - - var currentDate = startDate - currentDate.setHours(0, 0, 0, 0) - - while (currentDate.getTime() <= endTime) { - dates.push(parse(currentDate)) - currentDate.setDate(currentDate.getDate() + step) - } - - return dates -} - -module.exports = eachDay - - -/***/ }), -/* 246 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Hour Helpers - * @summary Return the end of an hour for the given date. - * - * @description - * Return the end of an hour for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the end of an hour - * - * @example - * // The end of an hour for 2 September 2014 11:55:00: - * var result = endOfHour(new Date(2014, 8, 2, 11, 55)) - * //=> Tue Sep 02 2014 11:59:59.999 - */ -function endOfHour (dirtyDate) { - var date = parse(dirtyDate) - date.setMinutes(59, 59, 999) - return date -} - -module.exports = endOfHour - - -/***/ }), -/* 247 */ -/***/ (function(module, exports, __webpack_require__) { - -var endOfWeek = __webpack_require__(140) - -/** - * @category ISO Week Helpers - * @summary Return the end of an ISO week for the given date. - * - * @description - * Return the end of an ISO week for the given date. - * The result will be in the local timezone. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the end of an ISO week - * - * @example - * // The end of an ISO week for 2 September 2014 11:55:00: - * var result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Sun Sep 07 2014 23:59:59.999 - */ -function endOfISOWeek (dirtyDate) { - return endOfWeek(dirtyDate, {weekStartsOn: 1}) -} - -module.exports = endOfISOWeek - - -/***/ }), -/* 248 */ -/***/ (function(module, exports, __webpack_require__) { - -var getISOYear = __webpack_require__(3) -var startOfISOWeek = __webpack_require__(4) - -/** - * @category ISO Week-Numbering Year Helpers - * @summary Return the end of an ISO week-numbering year for the given date. - * - * @description - * Return the end of an ISO week-numbering year, - * which always starts 3 days before the year's first Thursday. - * The result will be in the local timezone. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the end of an ISO week-numbering year - * - * @example - * // The end of an ISO week-numbering year for 2 July 2005: - * var result = endOfISOYear(new Date(2005, 6, 2)) - * //=> Sun Jan 01 2006 23:59:59.999 - */ -function endOfISOYear (dirtyDate) { - var year = getISOYear(dirtyDate) - var fourthOfJanuaryOfNextYear = new Date(0) - fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4) - fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0) - var date = startOfISOWeek(fourthOfJanuaryOfNextYear) - date.setMilliseconds(date.getMilliseconds() - 1) - return date -} - -module.exports = endOfISOYear - - -/***/ }), -/* 249 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Minute Helpers - * @summary Return the end of a minute for the given date. - * - * @description - * Return the end of a minute for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the end of a minute - * - * @example - * // The end of a minute for 1 December 2014 22:15:45.400: - * var result = endOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400)) - * //=> Mon Dec 01 2014 22:15:59.999 - */ -function endOfMinute (dirtyDate) { - var date = parse(dirtyDate) - date.setSeconds(59, 999) - return date -} - -module.exports = endOfMinute - - -/***/ }), -/* 250 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Quarter Helpers - * @summary Return the end of a year quarter for the given date. - * - * @description - * Return the end of a year quarter for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the end of a quarter - * - * @example - * // The end of a quarter for 2 September 2014 11:55:00: - * var result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Sep 30 2014 23:59:59.999 - */ -function endOfQuarter (dirtyDate) { - var date = parse(dirtyDate) - var currentMonth = date.getMonth() - var month = currentMonth - currentMonth % 3 + 3 - date.setMonth(month, 0) - date.setHours(23, 59, 59, 999) - return date -} - -module.exports = endOfQuarter - - -/***/ }), -/* 251 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Second Helpers - * @summary Return the end of a second for the given date. - * - * @description - * Return the end of a second for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the end of a second - * - * @example - * // The end of a second for 1 December 2014 22:15:45.400: - * var result = endOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400)) - * //=> Mon Dec 01 2014 22:15:45.999 - */ -function endOfSecond (dirtyDate) { - var date = parse(dirtyDate) - date.setMilliseconds(999) - return date -} - -module.exports = endOfSecond - - -/***/ }), -/* 252 */ -/***/ (function(module, exports, __webpack_require__) { - -var endOfDay = __webpack_require__(122) - -/** - * @category Day Helpers - * @summary Return the end of today. - * - * @description - * Return the end of today. - * - * @returns {Date} the end of today - * - * @example - * // If today is 6 October 2014: - * var result = endOfToday() - * //=> Mon Oct 6 2014 23:59:59.999 - */ -function endOfToday () { - return endOfDay(new Date()) -} - -module.exports = endOfToday - - -/***/ }), -/* 253 */ -/***/ (function(module, exports) { - -/** - * @category Day Helpers - * @summary Return the end of tomorrow. - * - * @description - * Return the end of tomorrow. - * - * @returns {Date} the end of tomorrow - * - * @example - * // If today is 6 October 2014: - * var result = endOfTomorrow() - * //=> Tue Oct 7 2014 23:59:59.999 - */ -function endOfTomorrow () { - var now = new Date() - var year = now.getFullYear() - var month = now.getMonth() - var day = now.getDate() - - var date = new Date(0) - date.setFullYear(year, month, day + 1) - date.setHours(23, 59, 59, 999) - return date -} - -module.exports = endOfTomorrow - - -/***/ }), -/* 254 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Year Helpers - * @summary Return the end of a year for the given date. - * - * @description - * Return the end of a year for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the end of a year - * - * @example - * // The end of a year for 2 September 2014 11:55:00: - * var result = endOfYear(new Date(2014, 8, 2, 11, 55, 00)) - * //=> Wed Dec 31 2014 23:59:59.999 - */ -function endOfYear (dirtyDate) { - var date = parse(dirtyDate) - var year = date.getFullYear() - date.setFullYear(year + 1, 0, 0) - date.setHours(23, 59, 59, 999) - return date -} - -module.exports = endOfYear - - -/***/ }), -/* 255 */ -/***/ (function(module, exports) { - -/** - * @category Day Helpers - * @summary Return the end of yesterday. - * - * @description - * Return the end of yesterday. - * - * @returns {Date} the end of yesterday - * - * @example - * // If today is 6 October 2014: - * var result = endOfYesterday() - * //=> Sun Oct 5 2014 23:59:59.999 - */ -function endOfYesterday () { - var now = new Date() - var year = now.getFullYear() - var month = now.getMonth() - var day = now.getDate() - - var date = new Date(0) - date.setFullYear(year, month, day - 1) - date.setHours(23, 59, 59, 999) - return date -} - -module.exports = endOfYesterday - - -/***/ }), -/* 256 */ -/***/ (function(module, exports, __webpack_require__) { - -var getDayOfYear = __webpack_require__(142) -var getISOWeek = __webpack_require__(123) -var getISOYear = __webpack_require__(3) -var parse = __webpack_require__(0) -var isValid = __webpack_require__(144) -var enLocale = __webpack_require__(6) - -/** - * @category Common Helpers - * @summary Format the date. - * - * @description - * Return the formatted date string in the given format. - * - * Accepted tokens: - * | Unit | Token | Result examples | - * |-------------------------|-------|----------------------------------| - * | Month | M | 1, 2, ..., 12 | - * | | Mo | 1st, 2nd, ..., 12th | - * | | MM | 01, 02, ..., 12 | - * | | MMM | Jan, Feb, ..., Dec | - * | | MMMM | January, February, ..., December | - * | Quarter | Q | 1, 2, 3, 4 | - * | | Qo | 1st, 2nd, 3rd, 4th | - * | Day of month | D | 1, 2, ..., 31 | - * | | Do | 1st, 2nd, ..., 31st | - * | | DD | 01, 02, ..., 31 | - * | Day of year | DDD | 1, 2, ..., 366 | - * | | DDDo | 1st, 2nd, ..., 366th | - * | | DDDD | 001, 002, ..., 366 | - * | Day of week | d | 0, 1, ..., 6 | - * | | do | 0th, 1st, ..., 6th | - * | | dd | Su, Mo, ..., Sa | - * | | ddd | Sun, Mon, ..., Sat | - * | | dddd | Sunday, Monday, ..., Saturday | - * | Day of ISO week | E | 1, 2, ..., 7 | - * | ISO week | W | 1, 2, ..., 53 | - * | | Wo | 1st, 2nd, ..., 53rd | - * | | WW | 01, 02, ..., 53 | - * | Year | YY | 00, 01, ..., 99 | - * | | YYYY | 1900, 1901, ..., 2099 | - * | ISO week-numbering year | GG | 00, 01, ..., 99 | - * | | GGGG | 1900, 1901, ..., 2099 | - * | AM/PM | A | AM, PM | - * | | a | am, pm | - * | | aa | a.m., p.m. | - * | Hour | H | 0, 1, ... 23 | - * | | HH | 00, 01, ... 23 | - * | | h | 1, 2, ..., 12 | - * | | hh | 01, 02, ..., 12 | - * | Minute | m | 0, 1, ..., 59 | - * | | mm | 00, 01, ..., 59 | - * | Second | s | 0, 1, ..., 59 | - * | | ss | 00, 01, ..., 59 | - * | 1/10 of second | S | 0, 1, ..., 9 | - * | 1/100 of second | SS | 00, 01, ..., 99 | - * | Millisecond | SSS | 000, 001, ..., 999 | - * | Timezone | Z | -01:00, +00:00, ... +12:00 | - * | | ZZ | -0100, +0000, ..., +1200 | - * | Seconds timestamp | X | 512969520 | - * | Milliseconds timestamp | x | 512969520900 | - * - * The characters wrapped in square brackets are escaped. - * - * The result may vary by locale. - * - * @param {Date|String|Number} date - the original date - * @param {String} [format='YYYY-MM-DDTHH:mm:ss.SSSZ'] - the string of tokens - * @param {Object} [options] - the object with options - * @param {Object} [options.locale=enLocale] - the locale object - * @returns {String} the formatted date string - * - * @example - * // Represent 11 February 2014 in middle-endian format: - * var result = format( - * new Date(2014, 1, 11), - * 'MM/DD/YYYY' - * ) - * //=> '02/11/2014' - * - * @example - * // Represent 2 July 2014 in Esperanto: - * var eoLocale = require('date-fns/locale/eo') - * var result = format( - * new Date(2014, 6, 2), - * 'Do [de] MMMM YYYY', - * {locale: eoLocale} - * ) - * //=> '2-a de julio 2014' - */ -function format (dirtyDate, dirtyFormatStr, dirtyOptions) { - var formatStr = dirtyFormatStr ? String(dirtyFormatStr) : 'YYYY-MM-DDTHH:mm:ss.SSSZ' - var options = dirtyOptions || {} - - var locale = options.locale - var localeFormatters = enLocale.format.formatters - var formattingTokensRegExp = enLocale.format.formattingTokensRegExp - if (locale && locale.format && locale.format.formatters) { - localeFormatters = locale.format.formatters - - if (locale.format.formattingTokensRegExp) { - formattingTokensRegExp = locale.format.formattingTokensRegExp - } - } - - var date = parse(dirtyDate) - - if (!isValid(date)) { - return 'Invalid Date' - } - - var formatFn = buildFormatFn(formatStr, localeFormatters, formattingTokensRegExp) - - return formatFn(date) -} - -var formatters = { - // Month: 1, 2, ..., 12 - 'M': function (date) { - return date.getMonth() + 1 - }, - - // Month: 01, 02, ..., 12 - 'MM': function (date) { - return addLeadingZeros(date.getMonth() + 1, 2) - }, - - // Quarter: 1, 2, 3, 4 - 'Q': function (date) { - return Math.ceil((date.getMonth() + 1) / 3) - }, - - // Day of month: 1, 2, ..., 31 - 'D': function (date) { - return date.getDate() - }, - - // Day of month: 01, 02, ..., 31 - 'DD': function (date) { - return addLeadingZeros(date.getDate(), 2) - }, - - // Day of year: 1, 2, ..., 366 - 'DDD': function (date) { - return getDayOfYear(date) - }, - - // Day of year: 001, 002, ..., 366 - 'DDDD': function (date) { - return addLeadingZeros(getDayOfYear(date), 3) - }, - - // Day of week: 0, 1, ..., 6 - 'd': function (date) { - return date.getDay() - }, - - // Day of ISO week: 1, 2, ..., 7 - 'E': function (date) { - return date.getDay() || 7 - }, - - // ISO week: 1, 2, ..., 53 - 'W': function (date) { - return getISOWeek(date) - }, - - // ISO week: 01, 02, ..., 53 - 'WW': function (date) { - return addLeadingZeros(getISOWeek(date), 2) - }, - - // Year: 00, 01, ..., 99 - 'YY': function (date) { - return addLeadingZeros(date.getFullYear(), 4).substr(2) - }, - - // Year: 1900, 1901, ..., 2099 - 'YYYY': function (date) { - return addLeadingZeros(date.getFullYear(), 4) - }, - - // ISO week-numbering year: 00, 01, ..., 99 - 'GG': function (date) { - return String(getISOYear(date)).substr(2) - }, - - // ISO week-numbering year: 1900, 1901, ..., 2099 - 'GGGG': function (date) { - return getISOYear(date) - }, - - // Hour: 0, 1, ... 23 - 'H': function (date) { - return date.getHours() - }, - - // Hour: 00, 01, ..., 23 - 'HH': function (date) { - return addLeadingZeros(date.getHours(), 2) - }, - - // Hour: 1, 2, ..., 12 - 'h': function (date) { - var hours = date.getHours() - if (hours === 0) { - return 12 - } else if (hours > 12) { - return hours % 12 - } else { - return hours - } - }, - - // Hour: 01, 02, ..., 12 - 'hh': function (date) { - return addLeadingZeros(formatters['h'](date), 2) - }, - - // Minute: 0, 1, ..., 59 - 'm': function (date) { - return date.getMinutes() - }, - - // Minute: 00, 01, ..., 59 - 'mm': function (date) { - return addLeadingZeros(date.getMinutes(), 2) - }, - - // Second: 0, 1, ..., 59 - 's': function (date) { - return date.getSeconds() - }, - - // Second: 00, 01, ..., 59 - 'ss': function (date) { - return addLeadingZeros(date.getSeconds(), 2) - }, - - // 1/10 of second: 0, 1, ..., 9 - 'S': function (date) { - return Math.floor(date.getMilliseconds() / 100) - }, - - // 1/100 of second: 00, 01, ..., 99 - 'SS': function (date) { - return addLeadingZeros(Math.floor(date.getMilliseconds() / 10), 2) - }, - - // Millisecond: 000, 001, ..., 999 - 'SSS': function (date) { - return addLeadingZeros(date.getMilliseconds(), 3) - }, - - // Timezone: -01:00, +00:00, ... +12:00 - 'Z': function (date) { - return formatTimezone(date.getTimezoneOffset(), ':') - }, - - // Timezone: -0100, +0000, ... +1200 - 'ZZ': function (date) { - return formatTimezone(date.getTimezoneOffset()) - }, - - // Seconds timestamp: 512969520 - 'X': function (date) { - return Math.floor(date.getTime() / 1000) - }, - - // Milliseconds timestamp: 512969520900 - 'x': function (date) { - return date.getTime() - } -} - -function buildFormatFn (formatStr, localeFormatters, formattingTokensRegExp) { - var array = formatStr.match(formattingTokensRegExp) - var length = array.length - - var i - var formatter - for (i = 0; i < length; i++) { - formatter = localeFormatters[array[i]] || formatters[array[i]] - if (formatter) { - array[i] = formatter - } else { - array[i] = removeFormattingTokens(array[i]) - } - } - - return function (date) { - var output = '' - for (var i = 0; i < length; i++) { - if (array[i] instanceof Function) { - output += array[i](date, formatters) - } else { - output += array[i] - } - } - return output - } -} - -function removeFormattingTokens (input) { - if (input.match(/\[[\s\S]/)) { - return input.replace(/^\[|]$/g, '') - } - return input.replace(/\\/g, '') -} - -function formatTimezone (offset, delimeter) { - delimeter = delimeter || '' - var sign = offset > 0 ? '-' : '+' - var absOffset = Math.abs(offset) - var hours = Math.floor(absOffset / 60) - var minutes = absOffset % 60 - return sign + addLeadingZeros(hours, 2) + delimeter + addLeadingZeros(minutes, 2) -} - -function addLeadingZeros (number, targetLength) { - var output = Math.abs(number).toString() - while (output.length < targetLength) { - output = '0' + output - } - return output -} - -module.exports = format - - -/***/ }), -/* 257 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Day Helpers - * @summary Get the day of the month of the given date. - * - * @description - * Get the day of the month of the given date. - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the day of month - * - * @example - * // Which day of the month is 29 February 2012? - * var result = getDate(new Date(2012, 1, 29)) - * //=> 29 - */ -function getDate (dirtyDate) { - var date = parse(dirtyDate) - var dayOfMonth = date.getDate() - return dayOfMonth -} - -module.exports = getDate - - -/***/ }), -/* 258 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Weekday Helpers - * @summary Get the day of the week of the given date. - * - * @description - * Get the day of the week of the given date. - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the day of week - * - * @example - * // Which day of the week is 29 February 2012? - * var result = getDay(new Date(2012, 1, 29)) - * //=> 3 - */ -function getDay (dirtyDate) { - var date = parse(dirtyDate) - var day = date.getDay() - return day -} - -module.exports = getDay - - -/***/ }), -/* 259 */ -/***/ (function(module, exports, __webpack_require__) { - -var isLeapYear = __webpack_require__(145) - -/** - * @category Year Helpers - * @summary Get the number of days in a year of the given date. - * - * @description - * Get the number of days in a year of the given date. - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the number of days in a year - * - * @example - * // How many days are in 2012? - * var result = getDaysInYear(new Date(2012, 0, 1)) - * //=> 366 - */ -function getDaysInYear (dirtyDate) { - return isLeapYear(dirtyDate) ? 366 : 365 -} - -module.exports = getDaysInYear - - -/***/ }), -/* 260 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Hour Helpers - * @summary Get the hours of the given date. - * - * @description - * Get the hours of the given date. - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the hours - * - * @example - * // Get the hours of 29 February 2012 11:45:00: - * var result = getHours(new Date(2012, 1, 29, 11, 45)) - * //=> 11 - */ -function getHours (dirtyDate) { - var date = parse(dirtyDate) - var hours = date.getHours() - return hours -} - -module.exports = getHours - - -/***/ }), -/* 261 */ -/***/ (function(module, exports, __webpack_require__) { - -var startOfISOYear = __webpack_require__(9) -var addWeeks = __webpack_require__(118) - -var MILLISECONDS_IN_WEEK = 604800000 - -/** - * @category ISO Week-Numbering Year Helpers - * @summary Get the number of weeks in an ISO week-numbering year of the given date. - * - * @description - * Get the number of weeks in an ISO week-numbering year of the given date. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the number of ISO weeks in a year - * - * @example - * // How many weeks are in ISO week-numbering year 2015? - * var result = getISOWeeksInYear(new Date(2015, 1, 11)) - * //=> 53 - */ -function getISOWeeksInYear (dirtyDate) { - var thisYear = startOfISOYear(dirtyDate) - var nextYear = startOfISOYear(addWeeks(thisYear, 60)) - var diff = nextYear.valueOf() - thisYear.valueOf() - // Round the number of weeks to the nearest integer - // because the number of milliseconds in a week is not constant - // (e.g. it's different in the week of the daylight saving time clock shift) - return Math.round(diff / MILLISECONDS_IN_WEEK) -} - -module.exports = getISOWeeksInYear - - -/***/ }), -/* 262 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Millisecond Helpers - * @summary Get the milliseconds of the given date. - * - * @description - * Get the milliseconds of the given date. - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the milliseconds - * - * @example - * // Get the milliseconds of 29 February 2012 11:45:05.123: - * var result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123)) - * //=> 123 - */ -function getMilliseconds (dirtyDate) { - var date = parse(dirtyDate) - var milliseconds = date.getMilliseconds() - return milliseconds -} - -module.exports = getMilliseconds - - -/***/ }), -/* 263 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Minute Helpers - * @summary Get the minutes of the given date. - * - * @description - * Get the minutes of the given date. - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the minutes - * - * @example - * // Get the minutes of 29 February 2012 11:45:05: - * var result = getMinutes(new Date(2012, 1, 29, 11, 45, 5)) - * //=> 45 - */ -function getMinutes (dirtyDate) { - var date = parse(dirtyDate) - var minutes = date.getMinutes() - return minutes -} - -module.exports = getMinutes - - -/***/ }), -/* 264 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Month Helpers - * @summary Get the month of the given date. - * - * @description - * Get the month of the given date. - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the month - * - * @example - * // Which month is 29 February 2012? - * var result = getMonth(new Date(2012, 1, 29)) - * //=> 1 - */ -function getMonth (dirtyDate) { - var date = parse(dirtyDate) - var month = date.getMonth() - return month -} - -module.exports = getMonth - - -/***/ }), -/* 265 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -var MILLISECONDS_IN_DAY = 24 * 60 * 60 * 1000 - -/** - * @category Range Helpers - * @summary Get the number of days that overlap in two date ranges - * - * @description - * Get the number of days that overlap in two date ranges - * - * @param {Date|String|Number} initialRangeStartDate - the start of the initial range - * @param {Date|String|Number} initialRangeEndDate - the end of the initial range - * @param {Date|String|Number} comparedRangeStartDate - the start of the range to compare it with - * @param {Date|String|Number} comparedRangeEndDate - the end of the range to compare it with - * @returns {Number} the number of days that overlap in two date ranges - * @throws {Error} startDate of a date range cannot be after its endDate - * - * @example - * // For overlapping date ranges adds 1 for each started overlapping day: - * getOverlappingDaysInRanges( - * new Date(2014, 0, 10), new Date(2014, 0, 20), new Date(2014, 0, 17), new Date(2014, 0, 21) - * ) - * //=> 3 - * - * @example - * // For non-overlapping date ranges returns 0: - * getOverlappingDaysInRanges( - * new Date(2014, 0, 10), new Date(2014, 0, 20), new Date(2014, 0, 21), new Date(2014, 0, 22) - * ) - * //=> 0 - */ -function getOverlappingDaysInRanges (dirtyInitialRangeStartDate, dirtyInitialRangeEndDate, dirtyComparedRangeStartDate, dirtyComparedRangeEndDate) { - var initialStartTime = parse(dirtyInitialRangeStartDate).getTime() - var initialEndTime = parse(dirtyInitialRangeEndDate).getTime() - var comparedStartTime = parse(dirtyComparedRangeStartDate).getTime() - var comparedEndTime = parse(dirtyComparedRangeEndDate).getTime() - - if (initialStartTime > initialEndTime || comparedStartTime > comparedEndTime) { - throw new Error('The start of the range cannot be after the end of the range') - } - - var isOverlapping = initialStartTime < comparedEndTime && comparedStartTime < initialEndTime - - if (!isOverlapping) { - return 0 - } - - var overlapStartDate = comparedStartTime < initialStartTime - ? initialStartTime - : comparedStartTime - - var overlapEndDate = comparedEndTime > initialEndTime - ? initialEndTime - : comparedEndTime - - var differenceInMs = overlapEndDate - overlapStartDate - - return Math.ceil(differenceInMs / MILLISECONDS_IN_DAY) -} - -module.exports = getOverlappingDaysInRanges - - -/***/ }), -/* 266 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Second Helpers - * @summary Get the seconds of the given date. - * - * @description - * Get the seconds of the given date. - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the seconds - * - * @example - * // Get the seconds of 29 February 2012 11:45:05.123: - * var result = getSeconds(new Date(2012, 1, 29, 11, 45, 5, 123)) - * //=> 5 - */ -function getSeconds (dirtyDate) { - var date = parse(dirtyDate) - var seconds = date.getSeconds() - return seconds -} - -module.exports = getSeconds - - -/***/ }), -/* 267 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Timestamp Helpers - * @summary Get the milliseconds timestamp of the given date. - * - * @description - * Get the milliseconds timestamp of the given date. - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the timestamp - * - * @example - * // Get the timestamp of 29 February 2012 11:45:05.123: - * var result = getTime(new Date(2012, 1, 29, 11, 45, 5, 123)) - * //=> 1330515905123 - */ -function getTime (dirtyDate) { - var date = parse(dirtyDate) - var timestamp = date.getTime() - return timestamp -} - -module.exports = getTime - - -/***/ }), -/* 268 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Year Helpers - * @summary Get the year of the given date. - * - * @description - * Get the year of the given date. - * - * @param {Date|String|Number} date - the given date - * @returns {Number} the year - * - * @example - * // Which year is 2 July 2014? - * var result = getYear(new Date(2014, 6, 2)) - * //=> 2014 - */ -function getYear (dirtyDate) { - var date = parse(dirtyDate) - var year = date.getFullYear() - return year -} - -module.exports = getYear - - -/***/ }), -/* 269 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Common Helpers - * @summary Is the first date after the second one? - * - * @description - * Is the first date after the second one? - * - * @param {Date|String|Number} date - the date that should be after the other one to return true - * @param {Date|String|Number} dateToCompare - the date to compare with - * @returns {Boolean} the first date is after the second date - * - * @example - * // Is 10 July 1989 after 11 February 1987? - * var result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11)) - * //=> true - */ -function isAfter (dirtyDate, dirtyDateToCompare) { - var date = parse(dirtyDate) - var dateToCompare = parse(dirtyDateToCompare) - return date.getTime() > dateToCompare.getTime() -} - -module.exports = isAfter - - -/***/ }), -/* 270 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Common Helpers - * @summary Is the first date before the second one? - * - * @description - * Is the first date before the second one? - * - * @param {Date|String|Number} date - the date that should be before the other one to return true - * @param {Date|String|Number} dateToCompare - the date to compare with - * @returns {Boolean} the first date is before the second date - * - * @example - * // Is 10 July 1989 before 11 February 1987? - * var result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11)) - * //=> false - */ -function isBefore (dirtyDate, dirtyDateToCompare) { - var date = parse(dirtyDate) - var dateToCompare = parse(dirtyDateToCompare) - return date.getTime() < dateToCompare.getTime() -} - -module.exports = isBefore - - -/***/ }), -/* 271 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Common Helpers - * @summary Are the given dates equal? - * - * @description - * Are the given dates equal? - * - * @param {Date|String|Number} dateLeft - the first date to compare - * @param {Date|String|Number} dateRight - the second date to compare - * @returns {Boolean} the dates are equal - * - * @example - * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal? - * var result = isEqual( - * new Date(2014, 6, 2, 6, 30, 45, 0) - * new Date(2014, 6, 2, 6, 30, 45, 500) - * ) - * //=> false - */ -function isEqual (dirtyLeftDate, dirtyRightDate) { - var dateLeft = parse(dirtyLeftDate) - var dateRight = parse(dirtyRightDate) - return dateLeft.getTime() === dateRight.getTime() -} - -module.exports = isEqual - - -/***/ }), -/* 272 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Month Helpers - * @summary Is the given date the first day of a month? - * - * @description - * Is the given date the first day of a month? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is the first day of a month - * - * @example - * // Is 1 September 2014 the first day of a month? - * var result = isFirstDayOfMonth(new Date(2014, 8, 1)) - * //=> true - */ -function isFirstDayOfMonth (dirtyDate) { - return parse(dirtyDate).getDate() === 1 -} - -module.exports = isFirstDayOfMonth - - -/***/ }), -/* 273 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Weekday Helpers - * @summary Is the given date Friday? - * - * @description - * Is the given date Friday? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is Friday - * - * @example - * // Is 26 September 2014 Friday? - * var result = isFriday(new Date(2014, 8, 26)) - * //=> true - */ -function isFriday (dirtyDate) { - return parse(dirtyDate).getDay() === 5 -} - -module.exports = isFriday - - -/***/ }), -/* 274 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Common Helpers - * @summary Is the given date in the future? - * - * @description - * Is the given date in the future? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is in the future - * - * @example - * // If today is 6 October 2014, is 31 December 2014 in the future? - * var result = isFuture(new Date(2014, 11, 31)) - * //=> true - */ -function isFuture (dirtyDate) { - return parse(dirtyDate).getTime() > new Date().getTime() -} - -module.exports = isFuture - - -/***/ }), -/* 275 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) -var endOfDay = __webpack_require__(122) -var endOfMonth = __webpack_require__(141) - -/** - * @category Month Helpers - * @summary Is the given date the last day of a month? - * - * @description - * Is the given date the last day of a month? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is the last day of a month - * - * @example - * // Is 28 February 2014 the last day of a month? - * var result = isLastDayOfMonth(new Date(2014, 1, 28)) - * //=> true - */ -function isLastDayOfMonth (dirtyDate) { - var date = parse(dirtyDate) - return endOfDay(date).getTime() === endOfMonth(date).getTime() -} - -module.exports = isLastDayOfMonth - - -/***/ }), -/* 276 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Weekday Helpers - * @summary Is the given date Monday? - * - * @description - * Is the given date Monday? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is Monday - * - * @example - * // Is 22 September 2014 Monday? - * var result = isMonday(new Date(2014, 8, 22)) - * //=> true - */ -function isMonday (dirtyDate) { - return parse(dirtyDate).getDay() === 1 -} - -module.exports = isMonday - - -/***/ }), -/* 277 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Common Helpers - * @summary Is the given date in the past? - * - * @description - * Is the given date in the past? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is in the past - * - * @example - * // If today is 6 October 2014, is 2 July 2014 in the past? - * var result = isPast(new Date(2014, 6, 2)) - * //=> true - */ -function isPast (dirtyDate) { - return parse(dirtyDate).getTime() < new Date().getTime() -} - -module.exports = isPast - - -/***/ }), -/* 278 */ -/***/ (function(module, exports, __webpack_require__) { - -var startOfDay = __webpack_require__(5) - -/** - * @category Day Helpers - * @summary Are the given dates in the same day? - * - * @description - * Are the given dates in the same day? - * - * @param {Date|String|Number} dateLeft - the first date to check - * @param {Date|String|Number} dateRight - the second date to check - * @returns {Boolean} the dates are in the same day - * - * @example - * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day? - * var result = isSameDay( - * new Date(2014, 8, 4, 6, 0), - * new Date(2014, 8, 4, 18, 0) - * ) - * //=> true - */ -function isSameDay (dirtyDateLeft, dirtyDateRight) { - var dateLeftStartOfDay = startOfDay(dirtyDateLeft) - var dateRightStartOfDay = startOfDay(dirtyDateRight) - - return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime() -} - -module.exports = isSameDay - - -/***/ }), -/* 279 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Weekday Helpers - * @summary Is the given date Saturday? - * - * @description - * Is the given date Saturday? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is Saturday - * - * @example - * // Is 27 September 2014 Saturday? - * var result = isSaturday(new Date(2014, 8, 27)) - * //=> true - */ -function isSaturday (dirtyDate) { - return parse(dirtyDate).getDay() === 6 -} - -module.exports = isSaturday - - -/***/ }), -/* 280 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Weekday Helpers - * @summary Is the given date Sunday? - * - * @description - * Is the given date Sunday? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is Sunday - * - * @example - * // Is 21 September 2014 Sunday? - * var result = isSunday(new Date(2014, 8, 21)) - * //=> true - */ -function isSunday (dirtyDate) { - return parse(dirtyDate).getDay() === 0 -} - -module.exports = isSunday - - -/***/ }), -/* 281 */ -/***/ (function(module, exports, __webpack_require__) { - -var isSameHour = __webpack_require__(147) - -/** - * @category Hour Helpers - * @summary Is the given date in the same hour as the current date? - * - * @description - * Is the given date in the same hour as the current date? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is in this hour - * - * @example - * // If now is 25 September 2014 18:30:15.500, - * // is 25 September 2014 18:00:00 in this hour? - * var result = isThisHour(new Date(2014, 8, 25, 18)) - * //=> true - */ -function isThisHour (dirtyDate) { - return isSameHour(new Date(), dirtyDate) -} - -module.exports = isThisHour - - -/***/ }), -/* 282 */ -/***/ (function(module, exports, __webpack_require__) { - -var isSameISOWeek = __webpack_require__(149) - -/** - * @category ISO Week Helpers - * @summary Is the given date in the same ISO week as the current date? - * - * @description - * Is the given date in the same ISO week as the current date? - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is in this ISO week - * - * @example - * // If today is 25 September 2014, is 22 September 2014 in this ISO week? - * var result = isThisISOWeek(new Date(2014, 8, 22)) - * //=> true - */ -function isThisISOWeek (dirtyDate) { - return isSameISOWeek(new Date(), dirtyDate) -} - -module.exports = isThisISOWeek - - -/***/ }), -/* 283 */ -/***/ (function(module, exports, __webpack_require__) { - -var isSameISOYear = __webpack_require__(150) - -/** - * @category ISO Week-Numbering Year Helpers - * @summary Is the given date in the same ISO week-numbering year as the current date? - * - * @description - * Is the given date in the same ISO week-numbering year as the current date? - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is in this ISO week-numbering year - * - * @example - * // If today is 25 September 2014, - * // is 30 December 2013 in this ISO week-numbering year? - * var result = isThisISOYear(new Date(2013, 11, 30)) - * //=> true - */ -function isThisISOYear (dirtyDate) { - return isSameISOYear(new Date(), dirtyDate) -} - -module.exports = isThisISOYear - - -/***/ }), -/* 284 */ -/***/ (function(module, exports, __webpack_require__) { - -var isSameMinute = __webpack_require__(151) - -/** - * @category Minute Helpers - * @summary Is the given date in the same minute as the current date? - * - * @description - * Is the given date in the same minute as the current date? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is in this minute - * - * @example - * // If now is 25 September 2014 18:30:15.500, - * // is 25 September 2014 18:30:00 in this minute? - * var result = isThisMinute(new Date(2014, 8, 25, 18, 30)) - * //=> true - */ -function isThisMinute (dirtyDate) { - return isSameMinute(new Date(), dirtyDate) -} - -module.exports = isThisMinute - - -/***/ }), -/* 285 */ -/***/ (function(module, exports, __webpack_require__) { - -var isSameMonth = __webpack_require__(153) - -/** - * @category Month Helpers - * @summary Is the given date in the same month as the current date? - * - * @description - * Is the given date in the same month as the current date? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is in this month - * - * @example - * // If today is 25 September 2014, is 15 September 2014 in this month? - * var result = isThisMonth(new Date(2014, 8, 15)) - * //=> true - */ -function isThisMonth (dirtyDate) { - return isSameMonth(new Date(), dirtyDate) -} - -module.exports = isThisMonth - - -/***/ }), -/* 286 */ -/***/ (function(module, exports, __webpack_require__) { - -var isSameQuarter = __webpack_require__(154) - -/** - * @category Quarter Helpers - * @summary Is the given date in the same quarter as the current date? - * - * @description - * Is the given date in the same quarter as the current date? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is in this quarter - * - * @example - * // If today is 25 September 2014, is 2 July 2014 in this quarter? - * var result = isThisQuarter(new Date(2014, 6, 2)) - * //=> true - */ -function isThisQuarter (dirtyDate) { - return isSameQuarter(new Date(), dirtyDate) -} - -module.exports = isThisQuarter - - -/***/ }), -/* 287 */ -/***/ (function(module, exports, __webpack_require__) { - -var isSameSecond = __webpack_require__(156) - -/** - * @category Second Helpers - * @summary Is the given date in the same second as the current date? - * - * @description - * Is the given date in the same second as the current date? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is in this second - * - * @example - * // If now is 25 September 2014 18:30:15.500, - * // is 25 September 2014 18:30:15.000 in this second? - * var result = isThisSecond(new Date(2014, 8, 25, 18, 30, 15)) - * //=> true - */ -function isThisSecond (dirtyDate) { - return isSameSecond(new Date(), dirtyDate) -} - -module.exports = isThisSecond - - -/***/ }), -/* 288 */ -/***/ (function(module, exports, __webpack_require__) { - -var isSameWeek = __webpack_require__(124) - -/** - * @category Week Helpers - * @summary Is the given date in the same week as the current date? - * - * @description - * Is the given date in the same week as the current date? - * - * @param {Date|String|Number} date - the date to check - * @param {Object} [options] - the object with options - * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @returns {Boolean} the date is in this week - * - * @example - * // If today is 25 September 2014, is 21 September 2014 in this week? - * var result = isThisWeek(new Date(2014, 8, 21)) - * //=> true - * - * @example - * // If today is 25 September 2014 and week starts with Monday - * // is 21 September 2014 in this week? - * var result = isThisWeek(new Date(2014, 8, 21), {weekStartsOn: 1}) - * //=> false - */ -function isThisWeek (dirtyDate, dirtyOptions) { - return isSameWeek(new Date(), dirtyDate, dirtyOptions) -} - -module.exports = isThisWeek - - -/***/ }), -/* 289 */ -/***/ (function(module, exports, __webpack_require__) { - -var isSameYear = __webpack_require__(158) - -/** - * @category Year Helpers - * @summary Is the given date in the same year as the current date? - * - * @description - * Is the given date in the same year as the current date? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is in this year - * - * @example - * // If today is 25 September 2014, is 2 July 2014 in this year? - * var result = isThisYear(new Date(2014, 6, 2)) - * //=> true - */ -function isThisYear (dirtyDate) { - return isSameYear(new Date(), dirtyDate) -} - -module.exports = isThisYear - - -/***/ }), -/* 290 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Weekday Helpers - * @summary Is the given date Thursday? - * - * @description - * Is the given date Thursday? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is Thursday - * - * @example - * // Is 25 September 2014 Thursday? - * var result = isThursday(new Date(2014, 8, 25)) - * //=> true - */ -function isThursday (dirtyDate) { - return parse(dirtyDate).getDay() === 4 -} - -module.exports = isThursday - - -/***/ }), -/* 291 */ -/***/ (function(module, exports, __webpack_require__) { - -var startOfDay = __webpack_require__(5) - -/** - * @category Day Helpers - * @summary Is the given date today? - * - * @description - * Is the given date today? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is today - * - * @example - * // If today is 6 October 2014, is 6 October 14:00:00 today? - * var result = isToday(new Date(2014, 9, 6, 14, 0)) - * //=> true - */ -function isToday (dirtyDate) { - return startOfDay(dirtyDate).getTime() === startOfDay(new Date()).getTime() -} - -module.exports = isToday - - -/***/ }), -/* 292 */ -/***/ (function(module, exports, __webpack_require__) { - -var startOfDay = __webpack_require__(5) - -/** - * @category Day Helpers - * @summary Is the given date tomorrow? - * - * @description - * Is the given date tomorrow? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is tomorrow - * - * @example - * // If today is 6 October 2014, is 7 October 14:00:00 tomorrow? - * var result = isTomorrow(new Date(2014, 9, 7, 14, 0)) - * //=> true - */ -function isTomorrow (dirtyDate) { - var tomorrow = new Date() - tomorrow.setDate(tomorrow.getDate() + 1) - return startOfDay(dirtyDate).getTime() === startOfDay(tomorrow).getTime() -} - -module.exports = isTomorrow - - -/***/ }), -/* 293 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Weekday Helpers - * @summary Is the given date Tuesday? - * - * @description - * Is the given date Tuesday? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is Tuesday - * - * @example - * // Is 23 September 2014 Tuesday? - * var result = isTuesday(new Date(2014, 8, 23)) - * //=> true - */ -function isTuesday (dirtyDate) { - return parse(dirtyDate).getDay() === 2 -} - -module.exports = isTuesday - - -/***/ }), -/* 294 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Weekday Helpers - * @summary Is the given date Wednesday? - * - * @description - * Is the given date Wednesday? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is Wednesday - * - * @example - * // Is 24 September 2014 Wednesday? - * var result = isWednesday(new Date(2014, 8, 24)) - * //=> true - */ -function isWednesday (dirtyDate) { - return parse(dirtyDate).getDay() === 3 -} - -module.exports = isWednesday - - -/***/ }), -/* 295 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Weekday Helpers - * @summary Does the given date fall on a weekend? - * - * @description - * Does the given date fall on a weekend? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date falls on a weekend - * - * @example - * // Does 5 October 2014 fall on a weekend? - * var result = isWeekend(new Date(2014, 9, 5)) - * //=> true - */ -function isWeekend (dirtyDate) { - var date = parse(dirtyDate) - var day = date.getDay() - return day === 0 || day === 6 -} - -module.exports = isWeekend - - -/***/ }), -/* 296 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Range Helpers - * @summary Is the given date within the range? - * - * @description - * Is the given date within the range? - * - * @param {Date|String|Number} date - the date to check - * @param {Date|String|Number} startDate - the start of range - * @param {Date|String|Number} endDate - the end of range - * @returns {Boolean} the date is within the range - * @throws {Error} startDate cannot be after endDate - * - * @example - * // For the date within the range: - * isWithinRange( - * new Date(2014, 0, 3), new Date(2014, 0, 1), new Date(2014, 0, 7) - * ) - * //=> true - * - * @example - * // For the date outside of the range: - * isWithinRange( - * new Date(2014, 0, 10), new Date(2014, 0, 1), new Date(2014, 0, 7) - * ) - * //=> false - */ -function isWithinRange (dirtyDate, dirtyStartDate, dirtyEndDate) { - var time = parse(dirtyDate).getTime() - var startTime = parse(dirtyStartDate).getTime() - var endTime = parse(dirtyEndDate).getTime() - - if (startTime > endTime) { - throw new Error('The start of the range cannot be after the end of the range') - } - - return time >= startTime && time <= endTime -} - -module.exports = isWithinRange - - -/***/ }), -/* 297 */ -/***/ (function(module, exports, __webpack_require__) { - -var startOfDay = __webpack_require__(5) - -/** - * @category Day Helpers - * @summary Is the given date yesterday? - * - * @description - * Is the given date yesterday? - * - * @param {Date|String|Number} date - the date to check - * @returns {Boolean} the date is yesterday - * - * @example - * // If today is 6 October 2014, is 5 October 14:00:00 yesterday? - * var result = isYesterday(new Date(2014, 9, 5, 14, 0)) - * //=> true - */ -function isYesterday (dirtyDate) { - var yesterday = new Date() - yesterday.setDate(yesterday.getDate() - 1) - return startOfDay(dirtyDate).getTime() === startOfDay(yesterday).getTime() -} - -module.exports = isYesterday - - -/***/ }), -/* 298 */ -/***/ (function(module, exports, __webpack_require__) { - -var lastDayOfWeek = __webpack_require__(159) - -/** - * @category ISO Week Helpers - * @summary Return the last day of an ISO week for the given date. - * - * @description - * Return the last day of an ISO week for the given date. - * The result will be in the local timezone. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the last day of an ISO week - * - * @example - * // The last day of an ISO week for 2 September 2014 11:55:00: - * var result = lastDayOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Sun Sep 07 2014 00:00:00 - */ -function lastDayOfISOWeek (dirtyDate) { - return lastDayOfWeek(dirtyDate, {weekStartsOn: 1}) -} - -module.exports = lastDayOfISOWeek - - -/***/ }), -/* 299 */ -/***/ (function(module, exports, __webpack_require__) { - -var getISOYear = __webpack_require__(3) -var startOfISOWeek = __webpack_require__(4) - -/** - * @category ISO Week-Numbering Year Helpers - * @summary Return the last day of an ISO week-numbering year for the given date. - * - * @description - * Return the last day of an ISO week-numbering year, - * which always starts 3 days before the year's first Thursday. - * The result will be in the local timezone. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the end of an ISO week-numbering year - * - * @example - * // The last day of an ISO week-numbering year for 2 July 2005: - * var result = lastDayOfISOYear(new Date(2005, 6, 2)) - * //=> Sun Jan 01 2006 00:00:00 - */ -function lastDayOfISOYear (dirtyDate) { - var year = getISOYear(dirtyDate) - var fourthOfJanuary = new Date(0) - fourthOfJanuary.setFullYear(year + 1, 0, 4) - fourthOfJanuary.setHours(0, 0, 0, 0) - var date = startOfISOWeek(fourthOfJanuary) - date.setDate(date.getDate() - 1) - return date -} - -module.exports = lastDayOfISOYear - - -/***/ }), -/* 300 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Month Helpers - * @summary Return the last day of a month for the given date. - * - * @description - * Return the last day of a month for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the last day of a month - * - * @example - * // The last day of a month for 2 September 2014 11:55:00: - * var result = lastDayOfMonth(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Sep 30 2014 00:00:00 - */ -function lastDayOfMonth (dirtyDate) { - var date = parse(dirtyDate) - var month = date.getMonth() - date.setFullYear(date.getFullYear(), month + 1, 0) - date.setHours(0, 0, 0, 0) - return date -} - -module.exports = lastDayOfMonth - - -/***/ }), -/* 301 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Quarter Helpers - * @summary Return the last day of a year quarter for the given date. - * - * @description - * Return the last day of a year quarter for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the last day of a quarter - * - * @example - * // The last day of a quarter for 2 September 2014 11:55:00: - * var result = lastDayOfQuarter(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Tue Sep 30 2014 00:00:00 - */ -function lastDayOfQuarter (dirtyDate) { - var date = parse(dirtyDate) - var currentMonth = date.getMonth() - var month = currentMonth - currentMonth % 3 + 3 - date.setMonth(month, 0) - date.setHours(0, 0, 0, 0) - return date -} - -module.exports = lastDayOfQuarter - - -/***/ }), -/* 302 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Year Helpers - * @summary Return the last day of a year for the given date. - * - * @description - * Return the last day of a year for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the last day of a year - * - * @example - * // The last day of a year for 2 September 2014 11:55:00: - * var result = lastDayOfYear(new Date(2014, 8, 2, 11, 55, 00)) - * //=> Wed Dec 31 2014 00:00:00 - */ -function lastDayOfYear (dirtyDate) { - var date = parse(dirtyDate) - var year = date.getFullYear() - date.setFullYear(year + 1, 0, 0) - date.setHours(0, 0, 0, 0) - return date -} - -module.exports = lastDayOfYear - - -/***/ }), -/* 303 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Common Helpers - * @summary Return the latest of the given dates. - * - * @description - * Return the latest of the given dates. - * - * @param {...(Date|String|Number)} dates - the dates to compare - * @returns {Date} the latest of the dates - * - * @example - * // Which of these dates is the latest? - * var result = max( - * new Date(1989, 6, 10), - * new Date(1987, 1, 11), - * new Date(1995, 6, 2), - * new Date(1990, 0, 1) - * ) - * //=> Sun Jul 02 1995 00:00:00 - */ -function max () { - var dirtyDates = Array.prototype.slice.call(arguments) - var dates = dirtyDates.map(function (dirtyDate) { - return parse(dirtyDate) - }) - var latestTimestamp = Math.max.apply(null, dates) - return new Date(latestTimestamp) -} - -module.exports = max - - -/***/ }), -/* 304 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Common Helpers - * @summary Return the earliest of the given dates. - * - * @description - * Return the earliest of the given dates. - * - * @param {...(Date|String|Number)} dates - the dates to compare - * @returns {Date} the earliest of the dates - * - * @example - * // Which of these dates is the earliest? - * var result = min( - * new Date(1989, 6, 10), - * new Date(1987, 1, 11), - * new Date(1995, 6, 2), - * new Date(1990, 0, 1) - * ) - * //=> Wed Feb 11 1987 00:00:00 - */ -function min () { - var dirtyDates = Array.prototype.slice.call(arguments) - var dates = dirtyDates.map(function (dirtyDate) { - return parse(dirtyDate) - }) - var earliestTimestamp = Math.min.apply(null, dates) - return new Date(earliestTimestamp) -} - -module.exports = min - - -/***/ }), -/* 305 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Day Helpers - * @summary Set the day of the month to the given date. - * - * @description - * Set the day of the month to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} dayOfMonth - the day of the month of the new date - * @returns {Date} the new date with the day of the month setted - * - * @example - * // Set the 30th day of the month to 1 September 2014: - * var result = setDate(new Date(2014, 8, 1), 30) - * //=> Tue Sep 30 2014 00:00:00 - */ -function setDate (dirtyDate, dirtyDayOfMonth) { - var date = parse(dirtyDate) - var dayOfMonth = Number(dirtyDayOfMonth) - date.setDate(dayOfMonth) - return date -} - -module.exports = setDate - - -/***/ }), -/* 306 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) -var addDays = __webpack_require__(7) - -/** - * @category Weekday Helpers - * @summary Set the day of the week to the given date. - * - * @description - * Set the day of the week to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} day - the day of the week of the new date - * @param {Object} [options] - the object with options - * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday) - * @returns {Date} the new date with the day of the week setted - * - * @example - * // Set Sunday to 1 September 2014: - * var result = setDay(new Date(2014, 8, 1), 0) - * //=> Sun Aug 31 2014 00:00:00 - * - * @example - * // If week starts with Monday, set Sunday to 1 September 2014: - * var result = setDay(new Date(2014, 8, 1), 0, {weekStartsOn: 1}) - * //=> Sun Sep 07 2014 00:00:00 - */ -function setDay (dirtyDate, dirtyDay, dirtyOptions) { - var weekStartsOn = dirtyOptions ? (Number(dirtyOptions.weekStartsOn) || 0) : 0 - var date = parse(dirtyDate) - var day = Number(dirtyDay) - var currentDay = date.getDay() - - var remainder = day % 7 - var dayIndex = (remainder + 7) % 7 - - var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay - return addDays(date, diff) -} - -module.exports = setDay - - -/***/ }), -/* 307 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Day Helpers - * @summary Set the day of the year to the given date. - * - * @description - * Set the day of the year to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} dayOfYear - the day of the year of the new date - * @returns {Date} the new date with the day of the year setted - * - * @example - * // Set the 2nd day of the year to 2 July 2014: - * var result = setDayOfYear(new Date(2014, 6, 2), 2) - * //=> Thu Jan 02 2014 00:00:00 - */ -function setDayOfYear (dirtyDate, dirtyDayOfYear) { - var date = parse(dirtyDate) - var dayOfYear = Number(dirtyDayOfYear) - date.setMonth(0) - date.setDate(dayOfYear) - return date -} - -module.exports = setDayOfYear - - -/***/ }), -/* 308 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Hour Helpers - * @summary Set the hours to the given date. - * - * @description - * Set the hours to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} hours - the hours of the new date - * @returns {Date} the new date with the hours setted - * - * @example - * // Set 4 hours to 1 September 2014 11:30:00: - * var result = setHours(new Date(2014, 8, 1, 11, 30), 4) - * //=> Mon Sep 01 2014 04:30:00 - */ -function setHours (dirtyDate, dirtyHours) { - var date = parse(dirtyDate) - var hours = Number(dirtyHours) - date.setHours(hours) - return date -} - -module.exports = setHours - - -/***/ }), -/* 309 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) -var addDays = __webpack_require__(7) -var getISODay = __webpack_require__(146) - -/** - * @category Weekday Helpers - * @summary Set the day of the ISO week to the given date. - * - * @description - * Set the day of the ISO week to the given date. - * ISO week starts with Monday. - * 7 is the index of Sunday, 1 is the index of Monday etc. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} day - the day of the ISO week of the new date - * @returns {Date} the new date with the day of the ISO week setted - * - * @example - * // Set Sunday to 1 September 2014: - * var result = setISODay(new Date(2014, 8, 1), 7) - * //=> Sun Sep 07 2014 00:00:00 - */ -function setISODay (dirtyDate, dirtyDay) { - var date = parse(dirtyDate) - var day = Number(dirtyDay) - var currentDay = getISODay(date) - var diff = day - currentDay - return addDays(date, diff) -} - -module.exports = setISODay - - -/***/ }), -/* 310 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) -var getISOWeek = __webpack_require__(123) - -/** - * @category ISO Week Helpers - * @summary Set the ISO week to the given date. - * - * @description - * Set the ISO week to the given date, saving the weekday number. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} isoWeek - the ISO week of the new date - * @returns {Date} the new date with the ISO week setted - * - * @example - * // Set the 53rd ISO week to 7 August 2004: - * var result = setISOWeek(new Date(2004, 7, 7), 53) - * //=> Sat Jan 01 2005 00:00:00 - */ -function setISOWeek (dirtyDate, dirtyISOWeek) { - var date = parse(dirtyDate) - var isoWeek = Number(dirtyISOWeek) - var diff = getISOWeek(date) - isoWeek - date.setDate(date.getDate() - diff * 7) - return date -} - -module.exports = setISOWeek - - -/***/ }), -/* 311 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Millisecond Helpers - * @summary Set the milliseconds to the given date. - * - * @description - * Set the milliseconds to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} milliseconds - the milliseconds of the new date - * @returns {Date} the new date with the milliseconds setted - * - * @example - * // Set 300 milliseconds to 1 September 2014 11:30:40.500: - * var result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300) - * //=> Mon Sep 01 2014 11:30:40.300 - */ -function setMilliseconds (dirtyDate, dirtyMilliseconds) { - var date = parse(dirtyDate) - var milliseconds = Number(dirtyMilliseconds) - date.setMilliseconds(milliseconds) - return date -} - -module.exports = setMilliseconds - - -/***/ }), -/* 312 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Minute Helpers - * @summary Set the minutes to the given date. - * - * @description - * Set the minutes to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} minutes - the minutes of the new date - * @returns {Date} the new date with the minutes setted - * - * @example - * // Set 45 minutes to 1 September 2014 11:30:40: - * var result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45) - * //=> Mon Sep 01 2014 11:45:40 - */ -function setMinutes (dirtyDate, dirtyMinutes) { - var date = parse(dirtyDate) - var minutes = Number(dirtyMinutes) - date.setMinutes(minutes) - return date -} - -module.exports = setMinutes - - -/***/ }), -/* 313 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) -var setMonth = __webpack_require__(160) - -/** - * @category Quarter Helpers - * @summary Set the year quarter to the given date. - * - * @description - * Set the year quarter to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} quarter - the quarter of the new date - * @returns {Date} the new date with the quarter setted - * - * @example - * // Set the 2nd quarter to 2 July 2014: - * var result = setQuarter(new Date(2014, 6, 2), 2) - * //=> Wed Apr 02 2014 00:00:00 - */ -function setQuarter (dirtyDate, dirtyQuarter) { - var date = parse(dirtyDate) - var quarter = Number(dirtyQuarter) - var oldQuarter = Math.floor(date.getMonth() / 3) + 1 - var diff = quarter - oldQuarter - return setMonth(date, date.getMonth() + diff * 3) -} - -module.exports = setQuarter - - -/***/ }), -/* 314 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Second Helpers - * @summary Set the seconds to the given date. - * - * @description - * Set the seconds to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} seconds - the seconds of the new date - * @returns {Date} the new date with the seconds setted - * - * @example - * // Set 45 seconds to 1 September 2014 11:30:40: - * var result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45) - * //=> Mon Sep 01 2014 11:30:45 - */ -function setSeconds (dirtyDate, dirtySeconds) { - var date = parse(dirtyDate) - var seconds = Number(dirtySeconds) - date.setSeconds(seconds) - return date -} - -module.exports = setSeconds - - -/***/ }), -/* 315 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Year Helpers - * @summary Set the year to the given date. - * - * @description - * Set the year to the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} year - the year of the new date - * @returns {Date} the new date with the year setted - * - * @example - * // Set year 2013 to 1 September 2014: - * var result = setYear(new Date(2014, 8, 1), 2013) - * //=> Sun Sep 01 2013 00:00:00 - */ -function setYear (dirtyDate, dirtyYear) { - var date = parse(dirtyDate) - var year = Number(dirtyYear) - date.setFullYear(year) - return date -} - -module.exports = setYear - - -/***/ }), -/* 316 */ -/***/ (function(module, exports, __webpack_require__) { - -var parse = __webpack_require__(0) - -/** - * @category Month Helpers - * @summary Return the start of a month for the given date. - * - * @description - * Return the start of a month for the given date. - * The result will be in the local timezone. - * - * @param {Date|String|Number} date - the original date - * @returns {Date} the start of a month - * - * @example - * // The start of a month for 2 September 2014 11:55:00: - * var result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Mon Sep 01 2014 00:00:00 - */ -function startOfMonth (dirtyDate) { - var date = parse(dirtyDate) - date.setDate(1) - date.setHours(0, 0, 0, 0) - return date -} - -module.exports = startOfMonth - - -/***/ }), -/* 317 */ -/***/ (function(module, exports, __webpack_require__) { - -var startOfDay = __webpack_require__(5) - -/** - * @category Day Helpers - * @summary Return the start of today. - * - * @description - * Return the start of today. - * - * @returns {Date} the start of today - * - * @example - * // If today is 6 October 2014: - * var result = startOfToday() - * //=> Mon Oct 6 2014 00:00:00 - */ -function startOfToday () { - return startOfDay(new Date()) -} - -module.exports = startOfToday - - -/***/ }), -/* 318 */ -/***/ (function(module, exports) { - -/** - * @category Day Helpers - * @summary Return the start of tomorrow. - * - * @description - * Return the start of tomorrow. - * - * @returns {Date} the start of tomorrow - * - * @example - * // If today is 6 October 2014: - * var result = startOfTomorrow() - * //=> Tue Oct 7 2014 00:00:00 - */ -function startOfTomorrow () { - var now = new Date() - var year = now.getFullYear() - var month = now.getMonth() - var day = now.getDate() - - var date = new Date(0) - date.setFullYear(year, month, day + 1) - date.setHours(0, 0, 0, 0) - return date -} - -module.exports = startOfTomorrow - - -/***/ }), -/* 319 */ -/***/ (function(module, exports) { - -/** - * @category Day Helpers - * @summary Return the start of yesterday. - * - * @description - * Return the start of yesterday. - * - * @returns {Date} the start of yesterday - * - * @example - * // If today is 6 October 2014: - * var result = startOfYesterday() - * //=> Sun Oct 5 2014 00:00:00 - */ -function startOfYesterday () { - var now = new Date() - var year = now.getFullYear() - var month = now.getMonth() - var day = now.getDate() - - var date = new Date(0) - date.setFullYear(year, month, day - 1) - date.setHours(0, 0, 0, 0) - return date -} - -module.exports = startOfYesterday - - -/***/ }), -/* 320 */ -/***/ (function(module, exports, __webpack_require__) { - -var addDays = __webpack_require__(7) - -/** - * @category Day Helpers - * @summary Subtract the specified number of days from the given date. - * - * @description - * Subtract the specified number of days from the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of days to be subtracted - * @returns {Date} the new date with the days subtracted - * - * @example - * // Subtract 10 days from 1 September 2014: - * var result = subDays(new Date(2014, 8, 1), 10) - * //=> Fri Aug 22 2014 00:00:00 - */ -function subDays (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - return addDays(dirtyDate, -amount) -} - -module.exports = subDays - - -/***/ }), -/* 321 */ -/***/ (function(module, exports, __webpack_require__) { - -var addHours = __webpack_require__(126) - -/** - * @category Hour Helpers - * @summary Subtract the specified number of hours from the given date. - * - * @description - * Subtract the specified number of hours from the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of hours to be subtracted - * @returns {Date} the new date with the hours subtracted - * - * @example - * // Subtract 2 hours from 11 July 2014 01:00:00: - * var result = subHours(new Date(2014, 6, 11, 1, 0), 2) - * //=> Thu Jul 10 2014 23:00:00 - */ -function subHours (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - return addHours(dirtyDate, -amount) -} - -module.exports = subHours - - -/***/ }), -/* 322 */ -/***/ (function(module, exports, __webpack_require__) { - -var addMilliseconds = __webpack_require__(8) - -/** - * @category Millisecond Helpers - * @summary Subtract the specified number of milliseconds from the given date. - * - * @description - * Subtract the specified number of milliseconds from the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of milliseconds to be subtracted - * @returns {Date} the new date with the milliseconds subtracted - * - * @example - * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000: - * var result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) - * //=> Thu Jul 10 2014 12:45:29.250 - */ -function subMilliseconds (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - return addMilliseconds(dirtyDate, -amount) -} - -module.exports = subMilliseconds - - -/***/ }), -/* 323 */ -/***/ (function(module, exports, __webpack_require__) { - -var addMinutes = __webpack_require__(129) - -/** - * @category Minute Helpers - * @summary Subtract the specified number of minutes from the given date. - * - * @description - * Subtract the specified number of minutes from the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of minutes to be subtracted - * @returns {Date} the new date with the mintues subtracted - * - * @example - * // Subtract 30 minutes from 10 July 2014 12:00:00: - * var result = subMinutes(new Date(2014, 6, 10, 12, 0), 30) - * //=> Thu Jul 10 2014 11:30:00 - */ -function subMinutes (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - return addMinutes(dirtyDate, -amount) -} - -module.exports = subMinutes - - -/***/ }), -/* 324 */ -/***/ (function(module, exports, __webpack_require__) { - -var addMonths = __webpack_require__(81) - -/** - * @category Month Helpers - * @summary Subtract the specified number of months from the given date. - * - * @description - * Subtract the specified number of months from the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of months to be subtracted - * @returns {Date} the new date with the months subtracted - * - * @example - * // Subtract 5 months from 1 February 2015: - * var result = subMonths(new Date(2015, 1, 1), 5) - * //=> Mon Sep 01 2014 00:00:00 - */ -function subMonths (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - return addMonths(dirtyDate, -amount) -} - -module.exports = subMonths - - -/***/ }), -/* 325 */ -/***/ (function(module, exports, __webpack_require__) { - -var addQuarters = __webpack_require__(130) - -/** - * @category Quarter Helpers - * @summary Subtract the specified number of year quarters from the given date. - * - * @description - * Subtract the specified number of year quarters from the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of quarters to be subtracted - * @returns {Date} the new date with the quarters subtracted - * - * @example - * // Subtract 3 quarters from 1 September 2014: - * var result = subQuarters(new Date(2014, 8, 1), 3) - * //=> Sun Dec 01 2013 00:00:00 - */ -function subQuarters (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - return addQuarters(dirtyDate, -amount) -} - -module.exports = subQuarters - - -/***/ }), -/* 326 */ -/***/ (function(module, exports, __webpack_require__) { - -var addSeconds = __webpack_require__(131) - -/** - * @category Second Helpers - * @summary Subtract the specified number of seconds from the given date. - * - * @description - * Subtract the specified number of seconds from the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of seconds to be subtracted - * @returns {Date} the new date with the seconds subtracted - * - * @example - * // Subtract 30 seconds from 10 July 2014 12:45:00: - * var result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30) - * //=> Thu Jul 10 2014 12:44:30 - */ -function subSeconds (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - return addSeconds(dirtyDate, -amount) -} - -module.exports = subSeconds - - -/***/ }), -/* 327 */ -/***/ (function(module, exports, __webpack_require__) { - -var addWeeks = __webpack_require__(118) - -/** - * @category Week Helpers - * @summary Subtract the specified number of weeks from the given date. - * - * @description - * Subtract the specified number of weeks from the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of weeks to be subtracted - * @returns {Date} the new date with the weeks subtracted - * - * @example - * // Subtract 4 weeks from 1 September 2014: - * var result = subWeeks(new Date(2014, 8, 1), 4) - * //=> Mon Aug 04 2014 00:00:00 - */ -function subWeeks (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - return addWeeks(dirtyDate, -amount) -} - -module.exports = subWeeks - - -/***/ }), -/* 328 */ -/***/ (function(module, exports, __webpack_require__) { - -var addYears = __webpack_require__(132) - -/** - * @category Year Helpers - * @summary Subtract the specified number of years from the given date. - * - * @description - * Subtract the specified number of years from the given date. - * - * @param {Date|String|Number} date - the date to be changed - * @param {Number} amount - the amount of years to be subtracted - * @returns {Date} the new date with the years subtracted - * - * @example - * // Subtract 5 years from 1 September 2014: - * var result = subYears(new Date(2014, 8, 1), 5) - * //=> Tue Sep 01 2009 00:00:00 - */ -function subYears (dirtyDate, dirtyAmount) { - var amount = Number(dirtyAmount) - return addYears(dirtyDate, -amount) -} - -module.exports = subYears - - -/***/ }), -/* 329 */ -/***/ (function(module, exports, __webpack_require__) { - -var map = { - "./ar": 161, - "./ar.js": 161, - "./az": 162, - "./az.js": 162, - "./bn": 163, - "./bn.js": 163, - "./cs": 164, - "./cs.js": 164, - "./de": 165, - "./de.js": 165, - "./el": 166, - "./el.js": 166, - "./es": 167, - "./es.js": 167, - "./fa": 168, - "./fa.js": 168, - "./fr": 169, - "./fr.js": 169, - "./hi": 170, - "./hi.js": 170, - "./hu": 171, - "./hu.js": 171, - "./id": 172, - "./id.js": 172, - "./it": 173, - "./it.js": 173, - "./ja": 174, - "./ja.js": 174, - "./jv": 175, - "./jv.js": 175, - "./ko": 176, - "./ko.js": 176, - "./my": 177, - "./my.js": 177, - "./nl": 178, - "./nl.js": 178, - "./pa-in": 179, - "./pa-in.js": 179, - "./pl": 180, - "./pl.js": 180, - "./pt": 181, - "./pt.js": 181, - "./ro": 182, - "./ro.js": 182, - "./ru": 183, - "./ru.js": 183, - "./sr": 184, - "./sr.js": 184, - "./th": 185, - "./th.js": 185, - "./tr": 186, - "./tr.js": 186, - "./uk": 187, - "./uk.js": 187, - "./uz": 188, - "./uz.js": 188, - "./vi": 189, - "./vi.js": 189, - "./zh-cn": 190, - "./zh-cn.js": 190, - "./zh-tw": 191, - "./zh-tw.js": 191 -}; -function webpackContext(req) { - return __webpack_require__(webpackContextResolve(req)); -}; -function webpackContextResolve(req) { - var id = map[req]; - if(!(id + 1)) // check for number or string - throw new Error("Cannot find module '" + req + "'."); - return id; -}; -webpackContext.keys = function webpackContextKeys() { - return Object.keys(map); -}; -webpackContext.resolve = webpackContextResolve; -module.exports = webpackContext; -webpackContext.id = 329; - -/***/ }), -/* 330 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var EventEmitter = function () { - function EventEmitter() { - var listeners = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - - _classCallCheck(this, EventEmitter); - - this._listeners = new Map(listeners); - this._middlewares = new Map(); - } - - _createClass(EventEmitter, [{ - key: "listenerCount", - value: function listenerCount(eventName) { - if (!this._listeners.has(eventName)) { - return 0; - } - - var eventListeners = this._listeners.get(eventName); - return eventListeners.length; - } - }, { - key: "removeListeners", - value: function removeListeners() { - var _this = this; - - var eventName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var middleware = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (eventName !== null) { - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this.removeListeners(e, middleware); - }); - } else { - this._listeners.delete(eventName); - - if (middleware) { - this.removeMiddleware(eventName); - } - } - } else { - this._listeners = new Map(); - } - } - }, { - key: "middleware", - value: function middleware(eventName, fn) { - var _this2 = this; - - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this2.middleware(e, fn); - }); - } else { - if (!Array.isArray(this._middlewares.get(eventName))) { - this._middlewares.set(eventName, []); - } - - this._middlewares.get(eventName).push(fn); - } - } - }, { - key: "removeMiddleware", - value: function removeMiddleware() { - var _this3 = this; - - var eventName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (eventName !== null) { - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this3.removeMiddleware(e); - }); - } else { - this._middlewares.delete(eventName); - } - } else { - this._middlewares = new Map(); - } - } - }, { - key: "on", - value: function on(name, callback) { - var _this4 = this; - - var once = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - if (Array.isArray(name)) { - name.forEach(function (e) { - return _this4.on(e, callback); - }); - } else { - name = name.toString(); - var split = name.split(/,|, | /); - - if (split.length > 1) { - split.forEach(function (e) { - return _this4.on(e, callback); - }); - } else { - if (!Array.isArray(this._listeners.get(name))) { - this._listeners.set(name, []); - } - - this._listeners.get(name).push({ once: once, callback: callback }); - } - } - } - }, { - key: "once", - value: function once(name, callback) { - this.on(name, callback, true); - } - }, { - key: "emit", - value: function emit(name, data) { - var _this5 = this; - - var silent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - name = name.toString(); - var listeners = this._listeners.get(name); - var middlewares = null; - var doneCount = 0; - var execute = silent; - - if (Array.isArray(listeners)) { - listeners.forEach(function (listener, index) { - // Start Middleware checks unless we're doing a silent emit - if (!silent) { - middlewares = _this5._middlewares.get(name); - // Check and execute Middleware - if (Array.isArray(middlewares)) { - middlewares.forEach(function (middleware) { - middleware(data, function () { - var newData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (newData !== null) { - data = newData; - } - doneCount++; - }, name); - }); - - if (doneCount >= middlewares.length) { - execute = true; - } - } else { - execute = true; - } - } - - // If Middleware checks have been passed, execute - if (execute) { - if (listener.once) { - listeners[index] = null; - } - listener.callback(data); - } - }); - - // Dirty way of removing used Events - while (listeners.indexOf(null) !== -1) { - listeners.splice(listeners.indexOf(null), 1); - } - } - } - }]); - - return EventEmitter; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (EventEmitter); - -/***/ }), -/* 331 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var defaultOptions = { - startDate: undefined, - endDate: undefined, - minDate: null, - maxDate: null, - isRange: false, - disabledDates: [], - disabledWeekDays: undefined, - lang: 'en', // internationalization - dateFormat: 'MM/DD/YYYY', - displayMode: 'default', - showHeader: true, - showFooter: true, - todayButton: true, - clearButton: true, - labelFrom: '', - labelTo: '', - weekStart: 0, - closeOnOverlayClick: true, - closeOnSelect: true, - toggleOnInputClick: true, - icons: { - previous: '\n \n ', - next: '\n \n ' - } -}; - -/* harmony default export */ __webpack_exports__["a"] = (defaultOptions); - -/***/ }), -/* 332 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_date_fns__ = __webpack_require__(125); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_date_fns___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_date_fns__); - - -/* harmony default export */ __webpack_exports__["a"] = (function (data) { - return '
\n ' + (data.displayMode === 'dialog' ? '' : '') + '\n
\n
\n
\n
' + data.labels.from + '
\n
\n
\n
\n
\n
\n
\n
\n
\n ' + (data.isRange ? '
\n
' + data.labels.to + '
\n
\n
\n
\n
\n
\n
\n
\n
' : '') + '\n
\n
\n \n
\n
' + Object(__WEBPACK_IMPORTED_MODULE_0_date_fns__["format"])(data.visibleDate, 'MMMM', { locale: data.locale }) + '
\n  \n
' + Object(__WEBPACK_IMPORTED_MODULE_0_date_fns__["format"])(data.visibleDate, 'YYYY', { locale: data.locale }) + '
\n
\n \n
\n
\n
\n
\n ' + data.labels.weekdays.map(function (day) { - return '
' + day + '
'; - }).join('') + '\n
\n
\n
\n
\n ' + new Array(12).fill(new Date('01/01/1970')).map(function (d, i) { - return '
' + Object(__WEBPACK_IMPORTED_MODULE_0_date_fns__["format"])(Object(__WEBPACK_IMPORTED_MODULE_0_date_fns__["addMonths"])(d, i), 'MMM', { - locale: data.locale - }) + '
'; - }).join('') + '\n
\n
\n ' + data.years.map(function (year) { - return '
' + year + '
'; - }).join('') + '\n
\n
\n \n
\n
'; -}); - -/***/ }), -/* 333 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony default export */ __webpack_exports__["a"] = (function (days) { - return '' + days.map(function (theDate) { - return '
\n \n
'; - }).join(''); -}); - -/***/ }), -/* 334 */ -/***/ (function(module, exports, __webpack_require__) { - -var map = { - "./_lib/build_formatting_tokens_reg_exp": 2, - "./_lib/build_formatting_tokens_reg_exp/": 2, - "./_lib/build_formatting_tokens_reg_exp/index": 2, - "./_lib/build_formatting_tokens_reg_exp/index.js": 2, - "./_lib/package": 192, - "./_lib/package.json": 192, - "./ar": 83, - "./ar/": 83, - "./ar/build_distance_in_words_locale": 13, - "./ar/build_distance_in_words_locale/": 13, - "./ar/build_distance_in_words_locale/index": 13, - "./ar/build_distance_in_words_locale/index.js": 13, - "./ar/build_format_locale": 14, - "./ar/build_format_locale/": 14, - "./ar/build_format_locale/index": 14, - "./ar/build_format_locale/index.js": 14, - "./ar/index": 83, - "./ar/index.js": 83, - "./ar/package": 193, - "./ar/package.json": 193, - "./bg": 84, - "./bg/": 84, - "./bg/build_distance_in_words_locale": 15, - "./bg/build_distance_in_words_locale/": 15, - "./bg/build_distance_in_words_locale/index": 15, - "./bg/build_distance_in_words_locale/index.js": 15, - "./bg/build_format_locale": 16, - "./bg/build_format_locale/": 16, - "./bg/build_format_locale/index": 16, - "./bg/build_format_locale/index.js": 16, - "./bg/index": 84, - "./bg/index.js": 84, - "./bg/package": 194, - "./bg/package.json": 194, - "./ca": 85, - "./ca/": 85, - "./ca/build_distance_in_words_locale": 17, - "./ca/build_distance_in_words_locale/": 17, - "./ca/build_distance_in_words_locale/index": 17, - "./ca/build_distance_in_words_locale/index.js": 17, - "./ca/build_format_locale": 18, - "./ca/build_format_locale/": 18, - "./ca/build_format_locale/index": 18, - "./ca/build_format_locale/index.js": 18, - "./ca/index": 85, - "./ca/index.js": 85, - "./ca/package": 195, - "./ca/package.json": 195, - "./cs": 86, - "./cs/": 86, - "./cs/build_distance_in_words_locale": 19, - "./cs/build_distance_in_words_locale/": 19, - "./cs/build_distance_in_words_locale/index": 19, - "./cs/build_distance_in_words_locale/index.js": 19, - "./cs/build_format_locale": 20, - "./cs/build_format_locale/": 20, - "./cs/build_format_locale/index": 20, - "./cs/build_format_locale/index.js": 20, - "./cs/index": 86, - "./cs/index.js": 86, - "./cs/package": 196, - "./cs/package.json": 196, - "./da": 87, - "./da/": 87, - "./da/build_distance_in_words_locale": 21, - "./da/build_distance_in_words_locale/": 21, - "./da/build_distance_in_words_locale/index": 21, - "./da/build_distance_in_words_locale/index.js": 21, - "./da/build_format_locale": 22, - "./da/build_format_locale/": 22, - "./da/build_format_locale/index": 22, - "./da/build_format_locale/index.js": 22, - "./da/index": 87, - "./da/index.js": 87, - "./da/package": 197, - "./da/package.json": 197, - "./de": 88, - "./de/": 88, - "./de/build_distance_in_words_locale": 23, - "./de/build_distance_in_words_locale/": 23, - "./de/build_distance_in_words_locale/index": 23, - "./de/build_distance_in_words_locale/index.js": 23, - "./de/build_format_locale": 24, - "./de/build_format_locale/": 24, - "./de/build_format_locale/index": 24, - "./de/build_format_locale/index.js": 24, - "./de/index": 88, - "./de/index.js": 88, - "./de/package": 198, - "./de/package.json": 198, - "./el": 89, - "./el/": 89, - "./el/build_distance_in_words_locale": 25, - "./el/build_distance_in_words_locale/": 25, - "./el/build_distance_in_words_locale/index": 25, - "./el/build_distance_in_words_locale/index.js": 25, - "./el/build_format_locale": 26, - "./el/build_format_locale/": 26, - "./el/build_format_locale/index": 26, - "./el/build_format_locale/index.js": 26, - "./el/index": 89, - "./el/index.js": 89, - "./el/package": 199, - "./el/package.json": 199, - "./en": 6, - "./en/": 6, - "./en/build_distance_in_words_locale": 11, - "./en/build_distance_in_words_locale/": 11, - "./en/build_distance_in_words_locale/index": 11, - "./en/build_distance_in_words_locale/index.js": 11, - "./en/build_format_locale": 12, - "./en/build_format_locale/": 12, - "./en/build_format_locale/index": 12, - "./en/build_format_locale/index.js": 12, - "./en/index": 6, - "./en/index.js": 6, - "./en/package": 200, - "./en/package.json": 200, - "./eo": 90, - "./eo/": 90, - "./eo/build_distance_in_words_locale": 27, - "./eo/build_distance_in_words_locale/": 27, - "./eo/build_distance_in_words_locale/index": 27, - "./eo/build_distance_in_words_locale/index.js": 27, - "./eo/build_format_locale": 28, - "./eo/build_format_locale/": 28, - "./eo/build_format_locale/index": 28, - "./eo/build_format_locale/index.js": 28, - "./eo/index": 90, - "./eo/index.js": 90, - "./eo/package": 201, - "./eo/package.json": 201, - "./es": 91, - "./es/": 91, - "./es/build_distance_in_words_locale": 29, - "./es/build_distance_in_words_locale/": 29, - "./es/build_distance_in_words_locale/index": 29, - "./es/build_distance_in_words_locale/index.js": 29, - "./es/build_format_locale": 30, - "./es/build_format_locale/": 30, - "./es/build_format_locale/index": 30, - "./es/build_format_locale/index.js": 30, - "./es/index": 91, - "./es/index.js": 91, - "./es/package": 202, - "./es/package.json": 202, - "./fi": 92, - "./fi/": 92, - "./fi/build_distance_in_words_locale": 31, - "./fi/build_distance_in_words_locale/": 31, - "./fi/build_distance_in_words_locale/index": 31, - "./fi/build_distance_in_words_locale/index.js": 31, - "./fi/build_format_locale": 32, - "./fi/build_format_locale/": 32, - "./fi/build_format_locale/index": 32, - "./fi/build_format_locale/index.js": 32, - "./fi/index": 92, - "./fi/index.js": 92, - "./fi/package": 203, - "./fi/package.json": 203, - "./fil": 93, - "./fil/": 93, - "./fil/build_distance_in_words_locale": 33, - "./fil/build_distance_in_words_locale/": 33, - "./fil/build_distance_in_words_locale/index": 33, - "./fil/build_distance_in_words_locale/index.js": 33, - "./fil/build_format_locale": 34, - "./fil/build_format_locale/": 34, - "./fil/build_format_locale/index": 34, - "./fil/build_format_locale/index.js": 34, - "./fil/index": 93, - "./fil/index.js": 93, - "./fil/package": 204, - "./fil/package.json": 204, - "./fr": 94, - "./fr/": 94, - "./fr/build_distance_in_words_locale": 35, - "./fr/build_distance_in_words_locale/": 35, - "./fr/build_distance_in_words_locale/index": 35, - "./fr/build_distance_in_words_locale/index.js": 35, - "./fr/build_format_locale": 36, - "./fr/build_format_locale/": 36, - "./fr/build_format_locale/index": 36, - "./fr/build_format_locale/index.js": 36, - "./fr/index": 94, - "./fr/index.js": 94, - "./fr/package": 205, - "./fr/package.json": 205, - "./hr": 95, - "./hr/": 95, - "./hr/build_distance_in_words_locale": 37, - "./hr/build_distance_in_words_locale/": 37, - "./hr/build_distance_in_words_locale/index": 37, - "./hr/build_distance_in_words_locale/index.js": 37, - "./hr/build_format_locale": 38, - "./hr/build_format_locale/": 38, - "./hr/build_format_locale/index": 38, - "./hr/build_format_locale/index.js": 38, - "./hr/index": 95, - "./hr/index.js": 95, - "./hr/package": 206, - "./hr/package.json": 206, - "./hu": 96, - "./hu/": 96, - "./hu/build_distance_in_words_locale": 39, - "./hu/build_distance_in_words_locale/": 39, - "./hu/build_distance_in_words_locale/index": 39, - "./hu/build_distance_in_words_locale/index.js": 39, - "./hu/build_format_locale": 40, - "./hu/build_format_locale/": 40, - "./hu/build_format_locale/index": 40, - "./hu/build_format_locale/index.js": 40, - "./hu/index": 96, - "./hu/index.js": 96, - "./hu/package": 207, - "./hu/package.json": 207, - "./id": 97, - "./id/": 97, - "./id/build_distance_in_words_locale": 41, - "./id/build_distance_in_words_locale/": 41, - "./id/build_distance_in_words_locale/index": 41, - "./id/build_distance_in_words_locale/index.js": 41, - "./id/build_format_locale": 42, - "./id/build_format_locale/": 42, - "./id/build_format_locale/index": 42, - "./id/build_format_locale/index.js": 42, - "./id/index": 97, - "./id/index.js": 97, - "./id/package": 208, - "./id/package.json": 208, - "./is": 98, - "./is/": 98, - "./is/build_distance_in_words_locale": 43, - "./is/build_distance_in_words_locale/": 43, - "./is/build_distance_in_words_locale/index": 43, - "./is/build_distance_in_words_locale/index.js": 43, - "./is/build_format_locale": 44, - "./is/build_format_locale/": 44, - "./is/build_format_locale/index": 44, - "./is/build_format_locale/index.js": 44, - "./is/index": 98, - "./is/index.js": 98, - "./is/package": 209, - "./is/package.json": 209, - "./it": 99, - "./it/": 99, - "./it/build_distance_in_words_locale": 45, - "./it/build_distance_in_words_locale/": 45, - "./it/build_distance_in_words_locale/index": 45, - "./it/build_distance_in_words_locale/index.js": 45, - "./it/build_format_locale": 46, - "./it/build_format_locale/": 46, - "./it/build_format_locale/index": 46, - "./it/build_format_locale/index.js": 46, - "./it/index": 99, - "./it/index.js": 99, - "./it/package": 210, - "./it/package.json": 210, - "./ja": 100, - "./ja/": 100, - "./ja/build_distance_in_words_locale": 47, - "./ja/build_distance_in_words_locale/": 47, - "./ja/build_distance_in_words_locale/index": 47, - "./ja/build_distance_in_words_locale/index.js": 47, - "./ja/build_format_locale": 48, - "./ja/build_format_locale/": 48, - "./ja/build_format_locale/index": 48, - "./ja/build_format_locale/index.js": 48, - "./ja/index": 100, - "./ja/index.js": 100, - "./ja/package": 211, - "./ja/package.json": 211, - "./ko": 101, - "./ko/": 101, - "./ko/build_distance_in_words_locale": 49, - "./ko/build_distance_in_words_locale/": 49, - "./ko/build_distance_in_words_locale/index": 49, - "./ko/build_distance_in_words_locale/index.js": 49, - "./ko/build_format_locale": 50, - "./ko/build_format_locale/": 50, - "./ko/build_format_locale/index": 50, - "./ko/build_format_locale/index.js": 50, - "./ko/index": 101, - "./ko/index.js": 101, - "./ko/package": 212, - "./ko/package.json": 212, - "./mk": 102, - "./mk/": 102, - "./mk/build_distance_in_words_locale": 51, - "./mk/build_distance_in_words_locale/": 51, - "./mk/build_distance_in_words_locale/index": 51, - "./mk/build_distance_in_words_locale/index.js": 51, - "./mk/build_format_locale": 52, - "./mk/build_format_locale/": 52, - "./mk/build_format_locale/index": 52, - "./mk/build_format_locale/index.js": 52, - "./mk/index": 102, - "./mk/index.js": 102, - "./mk/package": 213, - "./mk/package.json": 213, - "./nb": 103, - "./nb/": 103, - "./nb/build_distance_in_words_locale": 53, - "./nb/build_distance_in_words_locale/": 53, - "./nb/build_distance_in_words_locale/index": 53, - "./nb/build_distance_in_words_locale/index.js": 53, - "./nb/build_format_locale": 54, - "./nb/build_format_locale/": 54, - "./nb/build_format_locale/index": 54, - "./nb/build_format_locale/index.js": 54, - "./nb/index": 103, - "./nb/index.js": 103, - "./nb/package": 214, - "./nb/package.json": 214, - "./nl": 104, - "./nl/": 104, - "./nl/build_distance_in_words_locale": 55, - "./nl/build_distance_in_words_locale/": 55, - "./nl/build_distance_in_words_locale/index": 55, - "./nl/build_distance_in_words_locale/index.js": 55, - "./nl/build_format_locale": 56, - "./nl/build_format_locale/": 56, - "./nl/build_format_locale/index": 56, - "./nl/build_format_locale/index.js": 56, - "./nl/index": 104, - "./nl/index.js": 104, - "./nl/package": 215, - "./nl/package.json": 215, - "./package": 216, - "./package.json": 216, - "./pl": 105, - "./pl/": 105, - "./pl/build_distance_in_words_locale": 57, - "./pl/build_distance_in_words_locale/": 57, - "./pl/build_distance_in_words_locale/index": 57, - "./pl/build_distance_in_words_locale/index.js": 57, - "./pl/build_format_locale": 58, - "./pl/build_format_locale/": 58, - "./pl/build_format_locale/index": 58, - "./pl/build_format_locale/index.js": 58, - "./pl/index": 105, - "./pl/index.js": 105, - "./pl/package": 217, - "./pl/package.json": 217, - "./pt": 106, - "./pt/": 106, - "./pt/build_distance_in_words_locale": 59, - "./pt/build_distance_in_words_locale/": 59, - "./pt/build_distance_in_words_locale/index": 59, - "./pt/build_distance_in_words_locale/index.js": 59, - "./pt/build_format_locale": 60, - "./pt/build_format_locale/": 60, - "./pt/build_format_locale/index": 60, - "./pt/build_format_locale/index.js": 60, - "./pt/index": 106, - "./pt/index.js": 106, - "./pt/package": 218, - "./pt/package.json": 218, - "./ro": 107, - "./ro/": 107, - "./ro/build_distance_in_words_locale": 61, - "./ro/build_distance_in_words_locale/": 61, - "./ro/build_distance_in_words_locale/index": 61, - "./ro/build_distance_in_words_locale/index.js": 61, - "./ro/build_format_locale": 62, - "./ro/build_format_locale/": 62, - "./ro/build_format_locale/index": 62, - "./ro/build_format_locale/index.js": 62, - "./ro/index": 107, - "./ro/index.js": 107, - "./ro/package": 219, - "./ro/package.json": 219, - "./ru": 108, - "./ru/": 108, - "./ru/build_distance_in_words_locale": 63, - "./ru/build_distance_in_words_locale/": 63, - "./ru/build_distance_in_words_locale/index": 63, - "./ru/build_distance_in_words_locale/index.js": 63, - "./ru/build_format_locale": 64, - "./ru/build_format_locale/": 64, - "./ru/build_format_locale/index": 64, - "./ru/build_format_locale/index.js": 64, - "./ru/index": 108, - "./ru/index.js": 108, - "./ru/package": 220, - "./ru/package.json": 220, - "./sk": 109, - "./sk/": 109, - "./sk/build_distance_in_words_locale": 65, - "./sk/build_distance_in_words_locale/": 65, - "./sk/build_distance_in_words_locale/index": 65, - "./sk/build_distance_in_words_locale/index.js": 65, - "./sk/build_format_locale": 66, - "./sk/build_format_locale/": 66, - "./sk/build_format_locale/index": 66, - "./sk/build_format_locale/index.js": 66, - "./sk/index": 109, - "./sk/index.js": 109, - "./sk/package": 221, - "./sk/package.json": 221, - "./sl": 110, - "./sl/": 110, - "./sl/build_distance_in_words_locale": 67, - "./sl/build_distance_in_words_locale/": 67, - "./sl/build_distance_in_words_locale/index": 67, - "./sl/build_distance_in_words_locale/index.js": 67, - "./sl/build_format_locale": 68, - "./sl/build_format_locale/": 68, - "./sl/build_format_locale/index": 68, - "./sl/build_format_locale/index.js": 68, - "./sl/index": 110, - "./sl/index.js": 110, - "./sl/package": 222, - "./sl/package.json": 222, - "./sv": 111, - "./sv/": 111, - "./sv/build_distance_in_words_locale": 69, - "./sv/build_distance_in_words_locale/": 69, - "./sv/build_distance_in_words_locale/index": 69, - "./sv/build_distance_in_words_locale/index.js": 69, - "./sv/build_format_locale": 70, - "./sv/build_format_locale/": 70, - "./sv/build_format_locale/index": 70, - "./sv/build_format_locale/index.js": 70, - "./sv/index": 111, - "./sv/index.js": 111, - "./sv/package": 223, - "./sv/package.json": 223, - "./th": 112, - "./th/": 112, - "./th/build_distance_in_words_locale": 71, - "./th/build_distance_in_words_locale/": 71, - "./th/build_distance_in_words_locale/index": 71, - "./th/build_distance_in_words_locale/index.js": 71, - "./th/build_format_locale": 72, - "./th/build_format_locale/": 72, - "./th/build_format_locale/index": 72, - "./th/build_format_locale/index.js": 72, - "./th/index": 112, - "./th/index.js": 112, - "./th/package": 224, - "./th/package.json": 224, - "./tr": 113, - "./tr/": 113, - "./tr/build_distance_in_words_locale": 73, - "./tr/build_distance_in_words_locale/": 73, - "./tr/build_distance_in_words_locale/index": 73, - "./tr/build_distance_in_words_locale/index.js": 73, - "./tr/build_format_locale": 74, - "./tr/build_format_locale/": 74, - "./tr/build_format_locale/index": 74, - "./tr/build_format_locale/index.js": 74, - "./tr/index": 113, - "./tr/index.js": 113, - "./tr/package": 225, - "./tr/package.json": 225, - "./zh_cn": 114, - "./zh_cn/": 114, - "./zh_cn/build_distance_in_words_locale": 75, - "./zh_cn/build_distance_in_words_locale/": 75, - "./zh_cn/build_distance_in_words_locale/index": 75, - "./zh_cn/build_distance_in_words_locale/index.js": 75, - "./zh_cn/build_format_locale": 76, - "./zh_cn/build_format_locale/": 76, - "./zh_cn/build_format_locale/index": 76, - "./zh_cn/build_format_locale/index.js": 76, - "./zh_cn/index": 114, - "./zh_cn/index.js": 114, - "./zh_cn/package": 226, - "./zh_cn/package.json": 226, - "./zh_tw": 115, - "./zh_tw/": 115, - "./zh_tw/build_distance_in_words_locale": 77, - "./zh_tw/build_distance_in_words_locale/": 77, - "./zh_tw/build_distance_in_words_locale/index": 77, - "./zh_tw/build_distance_in_words_locale/index.js": 77, - "./zh_tw/build_format_locale": 78, - "./zh_tw/build_format_locale/": 78, - "./zh_tw/build_format_locale/index": 78, - "./zh_tw/build_format_locale/index.js": 78, - "./zh_tw/index": 115, - "./zh_tw/index.js": 115, - "./zh_tw/package": 227, - "./zh_tw/package.json": 227 -}; -function webpackContext(req) { - return __webpack_require__(webpackContextResolve(req)); -}; -function webpackContextResolve(req) { - var id = map[req]; - if(!(id + 1)) // check for number or string - throw new Error("Cannot find module '" + req + "'."); - return id; -}; -webpackContext.keys = function webpackContextKeys() { - return Object.keys(map); -}; -webpackContext.resolve = webpackContextResolve; -module.exports = webpackContext; -webpackContext.id = 334; - -/***/ }) -/******/ ])["default"]; -}); \ No newline at end of file diff --git a/django_simple_bulma/js/bulma-carousel.js b/django_simple_bulma/js/bulma-carousel.js deleted file mode 100644 index 767c4c0..0000000 --- a/django_simple_bulma/js/bulma-carousel.js +++ /dev/null @@ -1,760 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["bulmaCarousel"] = factory(); - else - root["bulmaCarousel"] = factory(); -})(typeof self !== 'undefined' ? self : this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__events__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__defaultOptions__ = __webpack_require__(2); -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - -var BULMA_CAROUSEL_EVENTS = { - 'ready': 'carousel:ready', - 'slideBefore': 'carousel:slide:before', - 'slideAfter': 'carousel:slide:after' -}; - -var onSwipeStart = Symbol('onSwipeStart'); -var onSwipeMove = Symbol('onSwipeMove'); -var onSwipeEnd = Symbol('onSwipeEnd'); - -var supportsPassive = false; -try { - var opts = Object.defineProperty({}, 'passive', { - get: function get() { - supportsPassive = true; - } - }); - window.addEventListener("testPassive", null, opts); - window.removeEventListener("testPassive", null, opts); -} catch (e) {} - -var bulmaCarousel = function (_EventEmitter) { - _inherits(bulmaCarousel, _EventEmitter); - - function bulmaCarousel(selector) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - _classCallCheck(this, bulmaCarousel); - - var _this = _possibleConstructorReturn(this, (bulmaCarousel.__proto__ || Object.getPrototypeOf(bulmaCarousel)).call(this)); - - _this.element = typeof selector === 'string' ? document.querySelector(selector) : selector; - // An invalid selector or non-DOM node has been provided. - if (!_this.element) { - throw new Error('An invalid selector or non-DOM node has been provided.'); - } - - _this._clickEvents = ['click']; - _this.options = Object.assign({}, __WEBPACK_IMPORTED_MODULE_1__defaultOptions__["a" /* default */], options); - if (_this.element.dataset.autoplay) { - _this.options.autoplay = _this.element.dataset.autoplay; - } - if (_this.element.dataset.delay) { - _this.options.delay = _this.element.dataset.delay; - } - if (_this.element.dataset.size && !_this.element.classList.contains('carousel-animate-fade')) { - _this.options.size = _this.element.dataset.size; - } - if (_this.element.classList.contains('carousel-animate-fade')) { - _this.options.size = 1; - } - - _this.forceHiddenNavigation = false; - - _this[onSwipeStart] = _this[onSwipeStart].bind(_this); - _this[onSwipeMove] = _this[onSwipeMove].bind(_this); - _this[onSwipeEnd] = _this[onSwipeEnd].bind(_this); - - _this.init(); - return _this; - } - - /** - * Initiate all DOM element containing carousel class - * @method - * @return {Array} Array of all Carousel instances - */ - - - _createClass(bulmaCarousel, [{ - key: 'init', - - - /** - * Initiate plugin - * @method init - * @return {void} - */ - value: function init() { - this.container = this.element.querySelector('.carousel-container'); - this.items = this.element.querySelectorAll('.carousel-item'); - this.currentItem = { - element: this.element, - node: this.element.querySelector('.carousel-item.is-active'), - pos: -1 - }; - this.currentItem.pos = this.currentItem.node ? Array.from(this.items).indexOf(this.currentItem.node) : -1; - if (!this.currentItem.node) { - this.currentItem.node = this.items[0]; - this.currentItem.node.classList.add('is-active'); - this.currentItem.pos = 0; - } - this.forceHiddenNavigation = this.items.length <= 1; - - var images = this.element.querySelectorAll('img'); - [].forEach.call(images, function (img) { - img.setAttribute('draggable', false); - }); - - this._resize(); - this._setOrder(); - this._initNavigation(); - this._bindEvents(); - - if (this.options.autoplay) { - this._autoPlay(this.options.delay); - } - - this.emit(BULMA_CAROUSEL_EVENTS.ready, this.currentItem); - } - }, { - key: '_resize', - value: function _resize() { - var _this2 = this; - - var computedStyle = window.getComputedStyle(this.element); - var width = parseInt(computedStyle.getPropertyValue('width'), 10); - - // Detect which animation is setup and auto-calculate size and transformation - if (this.options.size > 1) { - if (this.options.size >= Array.from(this.items).length) { - this.offset = 0; - } else { - this.offset = width / this.options.size; - } - - this.container.style.left = 0 - this.offset + 'px'; - this.container.style.transform = 'translateX(' + this.offset + 'px)'; - [].forEach.call(this.items, function (item) { - item.style.flexBasis = _this2.offset + 'px'; - }); - } - - // If animation is fade then force carouselContainer size (due to the position: absolute) - if (this.element.classList.contains('carousel-animate-fade') && this.items.length) { - var img = this.items[0].querySelector('img'); - var scale = 1; - if (img.naturalWidth) { - scale = width / img.naturalWidth; - this.container.style.height = img.naturalHeight * scale + 'px'; - } else { - img.onload = function () { - scale = width / img.naturalWidth; - _this2.container.style.height = img.naturalHeight * scale + 'px'; - }; - } - } - } - - /** - * Bind all events - * @method _bindEvents - * @return {void} - */ - - }, { - key: '_bindEvents', - value: function _bindEvents() { - var _this3 = this; - - if (this.previousControl) { - this._clickEvents.forEach(function (clickEvent) { - _this3.previousControl.addEventListener(clickEvent, function (e) { - if (!supportsPassive) { - e.preventDefault(); - } - if (_this3._autoPlayInterval) { - clearInterval(_this3._autoPlayInterval); - _this3._autoPlay(_this3.optionsdelay); - } - _this3._slide('previous'); - }, supportsPassive ? { passive: true } : false); - }); - } - - if (this.nextControl) { - this._clickEvents.forEach(function (clickEvent) { - _this3.nextControl.addEventListener(clickEvent, function (e) { - if (!supportsPassive) { - e.preventDefault(); - } - if (_this3._autoPlayInterval) { - clearInterval(_this3._autoPlayInterval); - _this3._autoPlay(_this3.options.delay); - } - _this3._slide('next'); - }, supportsPassive ? { passive: true } : false); - }); - } - - // Bind swipe events - this.element.addEventListener('touchstart', this[onSwipeStart], supportsPassive ? { passive: true } : false); - this.element.addEventListener('mousedown', this[onSwipeStart], supportsPassive ? { passive: true } : false); - this.element.addEventListener('touchmove', this[onSwipeMove], supportsPassive ? { passive: true } : false); - this.element.addEventListener('mousemove', this[onSwipeMove], supportsPassive ? { passive: true } : false); - this.element.addEventListener('touchend', this[onSwipeEnd], supportsPassive ? { passive: true } : false); - this.element.addEventListener('mouseup', this[onSwipeEnd], supportsPassive ? { passive: true } : false); - } - }, { - key: 'destroy', - value: function destroy() { - this.element.removeEventListener('touchstart', this[onSwipeStart], supportsPassive ? { passive: true } : false); - this.element.removeEventListener('mousedown', this[onSwipeStart], supportsPassive ? { passive: true } : false); - this.element.removeEventListener('touchmove', this[onSwipeMove], supportsPassive ? { passive: true } : false); - this.element.removeEventListener('mousemove', this[onSwipeMove], supportsPassive ? { passive: true } : false); - this.element.removeEventListener('touchend', this[onSwipeEnd], supportsPassive ? { passive: true } : false); - this.element.removeEventListener('mouseup', this[onSwipeEnd], supportsPassive ? { passive: true } : false); - } - - /** - * Save current position on start swiping - * @method onSwipeStart - * @param {Event} e Swipe event - * @return {void} - */ - - }, { - key: onSwipeStart, - value: function value(e) { - if (!supportsPassive) { - e.preventDefault(); - } - - e = e ? e : window.event; - e = 'changedTouches' in e ? e.changedTouches[0] : e; - this._touch = { - start: { - time: new Date().getTime(), // record time when finger first makes contact with surface - x: e.pageX, - y: e.pageY - }, - dist: { - x: 0, - y: 0 - } - }; - } - - /** - * Save current position on end swiping - * @method onSwipeMove - * @param {Event} e swipe event - * @return {void} - */ - - }, { - key: onSwipeMove, - value: function value(e) { - if (!supportsPassive) { - e.preventDefault(); - } - } - - /** - * Save current position on end swiping - * @method onSwipeEnd - * @param {Event} e swipe event - * @return {void} - */ - - }, { - key: onSwipeEnd, - value: function value(e) { - if (!supportsPassive) { - e.preventDefault(); - } - - e = e ? e : window.event; - e = 'changedTouches' in e ? e.changedTouches[0] : e; - this._touch.dist = { - x: e.pageX - this._touch.start.x, // get horizontal dist traveled by finger while in contact with surface - y: e.pageY - this._touch.start.y // get vertical dist traveled by finger while in contact with surface - }; - - this._handleGesture(); - } - - /** - * Identify the gestureand slide if necessary - * @method _handleGesture - * @return {void} - */ - - }, { - key: '_handleGesture', - value: function _handleGesture() { - var elapsedTime = new Date().getTime() - this._touch.start.time; // get time elapsed - if (elapsedTime <= this.options.allowedTime) { - // first condition for awipe met - if (Math.abs(this._touch.dist.x) >= this.options.threshold && Math.abs(this._touch.dist.y) <= this.options.restraint) { - // 2nd condition for horizontal swipe met - this._touch.dist.x < 0 ? this._slide('next') : this._slide('previous'); // if dist traveled is negative, it indicates left swipe - } - } - } - - /** - * Initiate Navigation area and Previous/Next buttons - * @method _initNavigation - * @return {[type]} [description] - */ - - }, { - key: '_initNavigation', - value: function _initNavigation() { - this.previousControl = this.element.querySelector('.carousel-nav-left'); - this.nextControl = this.element.querySelector('.carousel-nav-right'); - - if (this.items.length <= 1 || this.forceHiddenNavigation) { - if (this.container) { - this.container.style.left = '0'; - } - if (this.previousControl) { - this.previousControl.style.display = 'none'; - } - if (this.nextControl) { - this.nextControl.style.display = 'none'; - } - } - } - - /** - * Update each item order - * @method _setOrder - */ - - }, { - key: '_setOrder', - value: function _setOrder() { - this.currentItem.node.style.order = '1'; - this.currentItem.node.style.zIndex = '1'; - var item = this.currentItem.node; - var i = void 0, - j = void 0, - ref = void 0; - for (i = j = 2, ref = Array.from(this.items).length; 2 <= ref ? j <= ref : j >= ref; i = 2 <= ref ? ++j : --j) { - item = this._next(item); - item.style.order = '' + i % Array.from(this.items).length; - item.style.zIndex = '0'; - } - } - - /** - * Find next item to display - * @method _next - * @param {Node} element Current Node element - * @return {Node} Next Node element - */ - - }, { - key: '_next', - value: function _next(element) { - if (element.nextElementSibling) { - return element.nextElementSibling; - } else { - return this.items[0]; - } - } - - /** - * Find previous item to display - * @method _previous - * @param {Node} element Current Node element - * @return {Node} Previous Node element - */ - - }, { - key: '_previous', - value: function _previous(element) { - if (element.previousElementSibling) { - return element.previousElementSibling; - } else { - return this.items[this.items.length - 1]; - } - } - - /** - * Update slides to display the wanted one - * @method _slide - * @param {String} [direction='next'] Direction in which items need to move - * @return {void} - */ - - }, { - key: '_slide', - value: function _slide() { - var _this4 = this; - - var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'next'; - - if (this.items.length) { - this.oldItemNode = this.currentItem.node; - this.emit(BULMA_CAROUSEL_EVENTS.slideBefore, this.currentItem); - // initialize direction to change order - if (direction === 'previous') { - this.currentItem.node = this._previous(this.currentItem.node); - // add reverse class - if (!this.element.classList.contains('carousel-animate-fade')) { - this.element.classList.add('is-reversing'); - this.container.style.transform = 'translateX(' + -Math.abs(this.offset) + 'px)'; - } - } else { - // Reorder items - this.currentItem.node = this._next(this.currentItem.node); - // re_slide reverse class - this.element.classList.remove('is-reversing'); - this.container.style.transform = 'translateX(' + Math.abs(this.offset) + 'px)'; - } - this.currentItem.node.classList.add('is-active'); - this.oldItemNode.classList.remove('is-active'); - - // Disable transition to instant change order - this.element.classList.remove('carousel-animated'); - // Enable transition to animate order 1 to order 2 - setTimeout(function () { - _this4.element.classList.add('carousel-animated'); - }, 50); - - this._setOrder(); - this.emit(BULMA_CAROUSEL_EVENTS.slideAfter, this.currentItem); - } - } - - /** - * Initiate autoplay system - * @method _autoPlay - * @param {Number} [delay=5000] Delay between slides in milliseconds - * @return {void} - */ - - }, { - key: '_autoPlay', - value: function _autoPlay() { - var _this5 = this; - - var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 5000; - - this._autoPlayInterval = setInterval(function () { - _this5._slide('next'); - }, delay); - } - }], [{ - key: 'attach', - value: function attach() { - var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '.carousel, .hero-carousel'; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var instances = new Array(); - - var elements = document.querySelectorAll(selector); - [].forEach.call(elements, function (element) { - setTimeout(function () { - instances.push(new bulmaCarousel(element, options)); - }, 100); - }); - return instances; - } - }]); - - return bulmaCarousel; -}(__WEBPACK_IMPORTED_MODULE_0__events__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["default"] = (bulmaCarousel); - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var EventEmitter = function () { - function EventEmitter() { - var listeners = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - - _classCallCheck(this, EventEmitter); - - this._listeners = new Map(listeners); - this._middlewares = new Map(); - } - - _createClass(EventEmitter, [{ - key: "listenerCount", - value: function listenerCount(eventName) { - if (!this._listeners.has(eventName)) { - return 0; - } - - var eventListeners = this._listeners.get(eventName); - return eventListeners.length; - } - }, { - key: "removeListeners", - value: function removeListeners() { - var _this = this; - - var eventName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var middleware = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (eventName !== null) { - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this.removeListeners(e, middleware); - }); - } else { - this._listeners.delete(eventName); - - if (middleware) { - this.removeMiddleware(eventName); - } - } - } else { - this._listeners = new Map(); - } - } - }, { - key: "middleware", - value: function middleware(eventName, fn) { - var _this2 = this; - - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this2.middleware(e, fn); - }); - } else { - if (!Array.isArray(this._middlewares.get(eventName))) { - this._middlewares.set(eventName, []); - } - - this._middlewares.get(eventName).push(fn); - } - } - }, { - key: "removeMiddleware", - value: function removeMiddleware() { - var _this3 = this; - - var eventName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (eventName !== null) { - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this3.removeMiddleware(e); - }); - } else { - this._middlewares.delete(eventName); - } - } else { - this._middlewares = new Map(); - } - } - }, { - key: "on", - value: function on(name, callback) { - var _this4 = this; - - var once = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - if (Array.isArray(name)) { - name.forEach(function (e) { - return _this4.on(e, callback); - }); - } else { - name = name.toString(); - var split = name.split(/,|, | /); - - if (split.length > 1) { - split.forEach(function (e) { - return _this4.on(e, callback); - }); - } else { - if (!Array.isArray(this._listeners.get(name))) { - this._listeners.set(name, []); - } - - this._listeners.get(name).push({ once: once, callback: callback }); - } - } - } - }, { - key: "once", - value: function once(name, callback) { - this.on(name, callback, true); - } - }, { - key: "emit", - value: function emit(name, data) { - var _this5 = this; - - var silent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - name = name.toString(); - var listeners = this._listeners.get(name); - var middlewares = null; - var doneCount = 0; - var execute = silent; - - if (Array.isArray(listeners)) { - listeners.forEach(function (listener, index) { - // Start Middleware checks unless we're doing a silent emit - if (!silent) { - middlewares = _this5._middlewares.get(name); - // Check and execute Middleware - if (Array.isArray(middlewares)) { - middlewares.forEach(function (middleware) { - middleware(data, function () { - var newData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (newData !== null) { - data = newData; - } - doneCount++; - }, name); - }); - - if (doneCount >= middlewares.length) { - execute = true; - } - } else { - execute = true; - } - } - - // If Middleware checks have been passed, execute - if (execute) { - if (listener.once) { - listeners[index] = null; - } - listener.callback(data); - } - }); - - // Dirty way of removing used Events - while (listeners.indexOf(null) !== -1) { - listeners.splice(listeners.indexOf(null), 1); - } - } - } - }]); - - return EventEmitter; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (EventEmitter); - -/***/ }), -/* 2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var defaultOptions = { - size: 1, - autoplay: false, - delay: 5000, - threshold: 50, //required min distance traveled to be considered swipe - restraint: 100, // maximum distance allowed at the same time in perpendicular direction - allowedTime: 500 // maximum time allowed to travel that distance -}; - -/* harmony default export */ __webpack_exports__["a"] = (defaultOptions); - -/***/ }) -/******/ ])["default"]; -}); \ No newline at end of file diff --git a/django_simple_bulma/js/bulma-iconpicker.js b/django_simple_bulma/js/bulma-iconpicker.js deleted file mode 100644 index 58e25e4..0000000 --- a/django_simple_bulma/js/bulma-iconpicker.js +++ /dev/null @@ -1,636 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["bulmaIconpicker"] = factory(); - else - root["bulmaIconpicker"] = factory(); -})(typeof self !== 'undefined' ? self : this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__events__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__defaultOptions__ = __webpack_require__(2); -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - -var fetchStyle = function fetchStyle(url) { - return new Promise(function (resolve, reject) { - var link = document.createElement('link'); - link.type = 'text/css'; - link.rel = 'stylesheet'; - link.onload = function () { - resolve(); - }; - link.href = url; - - if (!document.querySelector('link[href="' + url + '"]')) { - var headScript = document.querySelector('head'); - headScript.append(link); - } - }); -}; - -var bulmaIconpicker = function (_EventEmitter) { - _inherits(bulmaIconpicker, _EventEmitter); - - function bulmaIconpicker(selector) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - _classCallCheck(this, bulmaIconpicker); - - var _this = _possibleConstructorReturn(this, (bulmaIconpicker.__proto__ || Object.getPrototypeOf(bulmaIconpicker)).call(this)); - - _this.element = typeof selector === 'string' ? document.querySelector(selector) : selector; - // An invalid selector or non-DOM node has been provided. - if (!_this.element) { - throw new Error('An invalid selector or non-DOM node has been provided.'); - } - - _this._clickEvents = ['click']; - /// Set default options and merge with instance defined - _this.options = _extends({}, __WEBPACK_IMPORTED_MODULE_1__defaultOptions__["a" /* default */], options); - - _this.icons = []; - _this.id = 'iconPicker' + new Date().getTime(); - _this.init(); - return _this; - } - - /** - * Initiate all DOM element containing carousel class - * @method - * @return {Array} Array of all Carousel instances - */ - - - _createClass(bulmaIconpicker, [{ - key: 'init', - value: function init() { - var _this2 = this; - - this.createModal(); - this.createPreview(); - - this.options.iconSets.forEach(function (iconSet) { - fetchStyle(iconSet.css); - // Parse CSS file to get array of all available icons - fetch(iconSet.css, { mode: 'cors' }).then(function (res) { - return res.text(); - }).then(function (css) { - _this2.icons[iconSet.name] = _this2.parseCSS(css, iconSet.prefix || 'fa-', iconSet.displayPrefix || ''); - _this2.modalSetTabs.querySelector('a').click(); - var touchEvent = new Event('touchstart'); - _this2.modalSetTabs.querySelector('a').dispatchEvent(touchEvent); - }); - }); - } - }, { - key: 'createPreview', - value: function createPreview() { - var _this3 = this; - - this.preview = document.createElement('div'); - this.preview.className = 'icon is-large'; - this.preview.classList.add('iconpicker-preview'); - var iconPreview = document.createElement('i'); - iconPreview.className = 'iconpicker-icon-preview'; - if (this.element.value.length) { - var classes = this.element.value.split(' '); - classes.forEach(function (cls) { - iconPreview.classList.add(cls); - }); - } - this.preview.appendChild(iconPreview); - - this._clickEvents.forEach(function (event) { - _this3.preview.addEventListener(event, function (e) { - e.preventDefault(); - - _this3.modal.classList.add('is-active'); - }); - }); - - this.element.parentNode.insertBefore(this.preview, this.element.nextSibling); - } - }, { - key: 'parseCSS', - value: function parseCSS(css) { - var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'fa-'; - var displayPrefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; - - var iconPattern = new RegExp('\\.' + prefix + '([^\\.!:]*)::?before\\s*{\\s*content:\\s*["|\']\\\\[^\'|"]*["|\'];?\\s*}', 'g'); - var index = 1; - var icons = [], - icon = void 0, - match = void 0; - - while (match = iconPattern.exec(css)) { - icon = { - prefix: prefix, - selector: prefix + match[index].trim(':'), - name: this.ucwords(match[index]).trim(':'), - filter: match[index].trim(':'), - displayPrefix: displayPrefix - }; - icons[match[index]] = icon; - } - - if (Object.getOwnPropertyNames(this.icons).length == 0) { - console.warn("No icons found in CSS file"); - } - return icons; - } - }, { - key: 'ucwords', - value: function ucwords(str) { - return (str + '').replace(/^(.)|\s+(.)/g, function ($1) { - return $1.toUpperCase(); - }); - } - }, { - key: 'drawIcons', - value: function drawIcons(iconSet) { - this.iconsList.innerHTML = ''; - - if (iconSet) { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = Object.entries(iconSet)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _ref = _step.value; - - var _ref2 = _slicedToArray(_ref, 2); - - var iconName = _ref2[0]; - var icon = _ref2[1]; - - this.iconsList.appendChild(this.createIconPreview(icon)); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } - } - }, { - key: 'createIconPreview', - value: function createIconPreview(icon) { - var _this4 = this; - - var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'fa-'; - - var iconLink = document.createElement('a'); - iconLink.dataset.title = icon['name']; - iconLink.setAttribute('title', icon['name']); - iconLink.dataset.icon = icon['selector']; - iconLink.dataset.filter = icon['filter']; - var iconPreview = document.createElement('i'); - iconPreview.className = 'iconpicker-icon-preview'; - if (icon['displayPrefix'].length) { - prefix = icon['displayPrefix'].split(' '); - prefix.forEach(function (pfx) { - iconPreview.classList.add(pfx); - }); - } - iconPreview.classList.add(icon['selector']); - iconLink.appendChild(iconPreview); - this._clickEvents.forEach(function (event) { - iconLink.addEventListener(event, function (e) { - e.preventDefault(); - _this4.preview.innerHTML = ''; - _this4.element.value = e.target.classList; - _this4.preview.appendChild(e.target.cloneNode(true)); - _this4.modal.classList.remove('is-active'); - }); - }); - return iconLink; - } - }, { - key: 'createModal', - value: function createModal() { - var _this5 = this; - - this.modal = document.createElement('div'); - this.modal.className = 'modal'; - this.modal.classList.add('iconpicker-modal'); - this.modal.id = this.id; - var modalBackground = document.createElement('div'); - modalBackground.className = 'modal-background'; - var modalCard = document.createElement('div'); - modalCard.className = 'modal-card'; - - var modalHeader = document.createElement('header'); - modalHeader.className = 'modal-card-head'; - var modalHeaderTitle = document.createElement('p'); - modalHeaderTitle.className = 'modal-card-title'; - modalHeaderTitle.innerHTML = 'iconPicker'; - this.modalHeaderSearch = document.createElement('input'); - this.modalHeaderSearch.setAttribute('type', 'search'); - this.modalHeaderSearch.setAttribute('placeholder', 'Search'); - this.modalHeaderSearch.className = 'iconpicker-search'; - this.modalHeaderSearch.addEventListener('input', function (e) { - _this5.filter(e.target.value); - }); - var modalHeaderClose = document.createElement('button'); - modalHeaderClose.className = 'delete'; - this._clickEvents.forEach(function (event) { - modalHeaderClose.addEventListener(event, function (e) { - e.preventDefault(); - - _this5.modal.classList.remove('is-active'); - }); - }); - - modalCard.appendChild(modalHeader); - - this.modalBody = document.createElement('section'); - this.modalBody.className = 'modal-card-body'; - - if (this.options.iconSets.length >= 1) { - var modalSets = document.createElement('div'); - modalSets.className = 'iconpicker-sets'; - modalSets.classList.add('tabs'); - this.modalSetTabs = document.createElement('ul'); - this.options.iconSets.forEach(function (iconSet) { - var modalSetTab = document.createElement('li'); - var modalSetTabLink = document.createElement('a'); - modalSetTabLink.dataset.iconset = iconSet.name; - modalSetTabLink.innerHTML = iconSet.name; - _this5._clickEvents.forEach(function (event) { - modalSetTabLink.addEventListener(event, function (e) { - e.preventDefault(); - - var activeModalTabs = _this5.modalSetTabs.querySelectorAll('.is-active'); - [].forEach.call(activeModalTabs, function (activeModalTab) { - activeModalTab.classList.remove('is-active'); - }); - - e.target.parentNode.classList.add('is-active'); - _this5.drawIcons(_this5.icons[e.target.dataset.iconset]); - _this5.filter(_this5.modalHeaderSearch.value); - }); - }); - modalSetTab.appendChild(modalSetTabLink); - _this5.modalSetTabs.appendChild(modalSetTab); - }); - modalSets.appendChild(this.modalSetTabs); - modalCard.appendChild(modalSets); - } - - this.iconsList = document.createElement('div'); - this.iconsList.className = 'iconpicker-icons'; - - modalHeader.appendChild(modalHeaderTitle); - modalHeader.appendChild(this.modalHeaderSearch); - modalHeader.appendChild(modalHeaderClose); - - this.modalBody.appendChild(this.iconsList); - modalCard.appendChild(this.modalBody); - - this.modal.appendChild(modalBackground); - this.modal.appendChild(modalCard); - document.body.appendChild(this.modal); - } - }, { - key: 'filter', - value: function filter() { - var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - - if (value === '') { - this.iconsList.querySelectorAll('[data-filter]').forEach(function (el) { - el.classList.remove('is-hidden'); - }); - return; - } - this.iconsList.querySelectorAll('[data-filter]').forEach(function (el) { - el.classList.remove('is-hidden'); - }); - this.iconsList.querySelectorAll('[data-filter]:not([data-filter*="' + value + '"])').forEach(function (el) { - el.classList.add('is-hidden'); - }); - } - }], [{ - key: 'attach', - value: function attach() { - var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '[data-action="iconPicker"]'; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var instances = new Array(); - - var elements = document.querySelectorAll(selector); - [].forEach.call(elements, function (element) { - setTimeout(function () { - instances.push(new bulmaIconpicker(element, options)); - }, 100); - }); - return instances; - } - }]); - - return bulmaIconpicker; -}(__WEBPACK_IMPORTED_MODULE_0__events__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["default"] = (bulmaIconpicker); - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var EventEmitter = function () { - function EventEmitter() { - var listeners = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - - _classCallCheck(this, EventEmitter); - - this._listeners = new Map(listeners); - this._middlewares = new Map(); - } - - _createClass(EventEmitter, [{ - key: "listenerCount", - value: function listenerCount(eventName) { - if (!this._listeners.has(eventName)) { - return 0; - } - - var eventListeners = this._listeners.get(eventName); - return eventListeners.length; - } - }, { - key: "removeListeners", - value: function removeListeners() { - var _this = this; - - var eventName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var middleware = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (eventName !== null) { - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this.removeListeners(e, middleware); - }); - } else { - this._listeners.delete(eventName); - - if (middleware) { - this.removeMiddleware(eventName); - } - } - } else { - this._listeners = new Map(); - } - } - }, { - key: "middleware", - value: function middleware(eventName, fn) { - var _this2 = this; - - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this2.middleware(e, fn); - }); - } else { - if (!Array.isArray(this._middlewares.get(eventName))) { - this._middlewares.set(eventName, []); - } - - this._middlewares.get(eventName).push(fn); - } - } - }, { - key: "removeMiddleware", - value: function removeMiddleware() { - var _this3 = this; - - var eventName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (eventName !== null) { - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this3.removeMiddleware(e); - }); - } else { - this._middlewares.delete(eventName); - } - } else { - this._middlewares = new Map(); - } - } - }, { - key: "on", - value: function on(name, callback) { - var _this4 = this; - - var once = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - if (Array.isArray(name)) { - name.forEach(function (e) { - return _this4.on(e, callback); - }); - } else { - name = name.toString(); - var split = name.split(/,|, | /); - - if (split.length > 1) { - split.forEach(function (e) { - return _this4.on(e, callback); - }); - } else { - if (!Array.isArray(this._listeners.get(name))) { - this._listeners.set(name, []); - } - - this._listeners.get(name).push({ once: once, callback: callback }); - } - } - } - }, { - key: "once", - value: function once(name, callback) { - this.on(name, callback, true); - } - }, { - key: "emit", - value: function emit(name, data) { - var _this5 = this; - - var silent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - name = name.toString(); - var listeners = this._listeners.get(name); - var middlewares = null; - var doneCount = 0; - var execute = silent; - - if (Array.isArray(listeners)) { - listeners.forEach(function (listener, index) { - // Start Middleware checks unless we're doing a silent emit - if (!silent) { - middlewares = _this5._middlewares.get(name); - // Check and execute Middleware - if (Array.isArray(middlewares)) { - middlewares.forEach(function (middleware) { - middleware(data, function () { - var newData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (newData !== null) { - data = newData; - } - doneCount++; - }, name); - }); - - if (doneCount >= middlewares.length) { - execute = true; - } - } else { - execute = true; - } - } - - // If Middleware checks have been passed, execute - if (execute) { - if (listener.once) { - listeners[index] = null; - } - listener.callback(data); - } - }); - - // Dirty way of removing used Events - while (listeners.indexOf(null) !== -1) { - listeners.splice(listeners.indexOf(null), 1); - } - } - } - }]); - - return EventEmitter; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (EventEmitter); - -/***/ }), -/* 2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var defaultOptions = { - iconSets: [{ - name: 'simpleLine', // Name displayed on tab - css: 'https://cdnjs.cloudflare.com/ajax/libs/simple-line-icons/2.4.1/css/simple-line-icons.css', // CSS url containing icons rules - prefix: 'icon-', // CSS rules prefix to identify icons - displayPrefix: '' - }, { - name: 'fontAwesome', // Name displayed on tab - css: 'https://use.fontawesome.com/releases/v5.0.13/css/all.css', // CSS url containing icons rules - prefix: 'fa-', // CSS rules prefix to identify icons - displayPrefix: 'fas fa-icon' - }] -}; - -/* harmony default export */ __webpack_exports__["a"] = (defaultOptions); - -/***/ }) -/******/ ])["default"]; -}); \ No newline at end of file diff --git a/django_simple_bulma/js/bulma-quickview.js b/django_simple_bulma/js/bulma-quickview.js deleted file mode 100644 index a2a8589..0000000 --- a/django_simple_bulma/js/bulma-quickview.js +++ /dev/null @@ -1,413 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["bulmaQuickview"] = factory(); - else - root["bulmaQuickview"] = factory(); -})(typeof self !== 'undefined' ? self : this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__events__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__defaultOptions__ = __webpack_require__(2); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - -var onQuickviewShowClick = Symbol('onQuickviewShowClick'); -var onQuickviewDismissClick = Symbol('onQuickviewDismissClick'); - -var bulmaQuickview = function (_EventEmitter) { - _inherits(bulmaQuickview, _EventEmitter); - - function bulmaQuickview(selector) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - _classCallCheck(this, bulmaQuickview); - - var _this = _possibleConstructorReturn(this, (bulmaQuickview.__proto__ || Object.getPrototypeOf(bulmaQuickview)).call(this)); - - _this.element = typeof selector === 'string' ? document.querySelector(selector) : selector; - // An invalid selector or non-DOM node has been provided. - if (!_this.element) { - throw new Error('An invalid selector or non-DOM node has been provided.'); - } - - _this._clickEvents = ['click']; - /// Set default options and merge with instance defined - _this.options = _extends({}, __WEBPACK_IMPORTED_MODULE_1__defaultOptions__["a" /* default */], options); - - _this[onQuickviewShowClick] = _this[onQuickviewShowClick].bind(_this); - _this[onQuickviewDismissClick] = _this[onQuickviewDismissClick].bind(_this); - - _this.init(); - return _this; - } - - /** - * Initiate all DOM element containing carousel class - * @method - * @return {Array} Array of all Carousel instances - */ - - - _createClass(bulmaQuickview, [{ - key: 'init', - - - /** - * Initiate plugin - * @method init - * @return {void} - */ - value: function init() { - this.quickview = document.getElementById(this.element.dataset['target']); - this.dismissElements = document.querySelectorAll('[data-dismiss="quickview"]'); - - this._bindEvents(); - - this.emit('quickview:ready', { - element: this.element, - quickview: this.quickview - }); - } - - /** - * Bind all events - * @method _bindEvents - * @return {void} - */ - - }, { - key: '_bindEvents', - value: function _bindEvents() { - var _this2 = this; - - this._clickEvents.forEach(function (event) { - _this2.element.addEventListener(event, _this2[onQuickviewShowClick], false); - }); - - [].forEach.call(this.dismissElements, function (dismissElement) { - _this2._clickEvents.forEach(function (event) { - dismissElement.addEventListener(event, _this2[onQuickviewDismissClick], false); - }); - }); - } - }, { - key: onQuickviewShowClick, - value: function value(e) { - this.quickview.classList.add('is-active'); - - this.emit('quickview:show', { - element: this.element, - quickview: this.quickview - }); - } - }, { - key: onQuickviewDismissClick, - value: function value(e) { - this.quickview.classList.remove('is-active'); - - this.emit('quickview:hide', { - element: this.element, - quickview: this.quickview - }); - } - }], [{ - key: 'attach', - value: function attach() { - var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '[data-show="quickview"]'; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var instances = new Array(); - - var elements = document.querySelectorAll(selector); - [].forEach.call(elements, function (element) { - setTimeout(function () { - instances.push(new bulmaQuickview(element, options)); - }, 100); - }); - return instances; - } - }]); - - return bulmaQuickview; -}(__WEBPACK_IMPORTED_MODULE_0__events__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["default"] = (bulmaQuickview); - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var EventEmitter = function () { - function EventEmitter() { - var listeners = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - - _classCallCheck(this, EventEmitter); - - this._listeners = new Map(listeners); - this._middlewares = new Map(); - } - - _createClass(EventEmitter, [{ - key: "listenerCount", - value: function listenerCount(eventName) { - if (!this._listeners.has(eventName)) { - return 0; - } - - var eventListeners = this._listeners.get(eventName); - return eventListeners.length; - } - }, { - key: "removeListeners", - value: function removeListeners() { - var _this = this; - - var eventName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var middleware = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (eventName !== null) { - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this.removeListeners(e, middleware); - }); - } else { - this._listeners.delete(eventName); - - if (middleware) { - this.removeMiddleware(eventName); - } - } - } else { - this._listeners = new Map(); - } - } - }, { - key: "middleware", - value: function middleware(eventName, fn) { - var _this2 = this; - - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this2.middleware(e, fn); - }); - } else { - if (!Array.isArray(this._middlewares.get(eventName))) { - this._middlewares.set(eventName, []); - } - - this._middlewares.get(eventName).push(fn); - } - } - }, { - key: "removeMiddleware", - value: function removeMiddleware() { - var _this3 = this; - - var eventName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (eventName !== null) { - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this3.removeMiddleware(e); - }); - } else { - this._middlewares.delete(eventName); - } - } else { - this._middlewares = new Map(); - } - } - }, { - key: "on", - value: function on(name, callback) { - var _this4 = this; - - var once = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - if (Array.isArray(name)) { - name.forEach(function (e) { - return _this4.on(e, callback); - }); - } else { - name = name.toString(); - var split = name.split(/,|, | /); - - if (split.length > 1) { - split.forEach(function (e) { - return _this4.on(e, callback); - }); - } else { - if (!Array.isArray(this._listeners.get(name))) { - this._listeners.set(name, []); - } - - this._listeners.get(name).push({ once: once, callback: callback }); - } - } - } - }, { - key: "once", - value: function once(name, callback) { - this.on(name, callback, true); - } - }, { - key: "emit", - value: function emit(name, data) { - var _this5 = this; - - var silent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - name = name.toString(); - var listeners = this._listeners.get(name); - var middlewares = null; - var doneCount = 0; - var execute = silent; - - if (Array.isArray(listeners)) { - listeners.forEach(function (listener, index) { - // Start Middleware checks unless we're doing a silent emit - if (!silent) { - middlewares = _this5._middlewares.get(name); - // Check and execute Middleware - if (Array.isArray(middlewares)) { - middlewares.forEach(function (middleware) { - middleware(data, function () { - var newData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (newData !== null) { - data = newData; - } - doneCount++; - }, name); - }); - - if (doneCount >= middlewares.length) { - execute = true; - } - } else { - execute = true; - } - } - - // If Middleware checks have been passed, execute - if (execute) { - if (listener.once) { - listeners[index] = null; - } - listener.callback(data); - } - }); - - // Dirty way of removing used Events - while (listeners.indexOf(null) !== -1) { - listeners.splice(listeners.indexOf(null), 1); - } - } - } - }]); - - return EventEmitter; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (EventEmitter); - -/***/ }), -/* 2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var defaultOptions = {}; - -/* harmony default export */ __webpack_exports__["a"] = (defaultOptions); - -/***/ }) -/******/ ])["default"]; -}); \ No newline at end of file diff --git a/django_simple_bulma/js/bulma-slider.js b/django_simple_bulma/js/bulma-slider.js deleted file mode 100644 index 0a52e86..0000000 --- a/django_simple_bulma/js/bulma-slider.js +++ /dev/null @@ -1,455 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["bulmaSlider"] = factory(); - else - root["bulmaSlider"] = factory(); -})(typeof self !== 'undefined' ? self : this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__events__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__defaultOptions__ = __webpack_require__(2); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - -var onSliderInput = Symbol('onSliderInput'); - -var bulmaSlider = function (_EventEmitter) { - _inherits(bulmaSlider, _EventEmitter); - - function bulmaSlider(selector) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - _classCallCheck(this, bulmaSlider); - - var _this = _possibleConstructorReturn(this, (bulmaSlider.__proto__ || Object.getPrototypeOf(bulmaSlider)).call(this)); - - _this.element = typeof selector === 'string' ? document.querySelector(selector) : selector; - // An invalid selector or non-DOM node has been provided. - if (!_this.element) { - throw new Error('An invalid selector or non-DOM node has been provided.'); - } - - _this._clickEvents = ['click']; - /// Set default options and merge with instance defined - _this.options = _extends({}, __WEBPACK_IMPORTED_MODULE_1__defaultOptions__["a" /* default */], options); - - _this[onSliderInput] = _this[onSliderInput].bind(_this); - - _this.init(); - return _this; - } - - /** - * Initiate all DOM element containing carousel class - * @method - * @return {Array} Array of all Carousel instances - */ - - - _createClass(bulmaSlider, [{ - key: 'init', - - - /** - * Initiate plugin - * @method init - * @return {void} - */ - value: function init() { - this._id = 'bulmaSlider' + new Date().getTime() + Math.floor(Math.random() * Math.floor(9999)); - this.output = this._findOutputForSlider(); - - if (this.output) { - if (this.element.classList.contains('has-output-tooltip')) { - // Get new output position - var newPosition = this._getSliderOutputPosition(); - - // Set output position - this.output.style['left'] = newPosition.position; - } - } - - this.emit('bulmaslider:ready', this.element.value); - } - }, { - key: '_findOutputForSlider', - value: function _findOutputForSlider() { - var _this2 = this; - - var outputs = document.getElementsByTagName('output'); - [].forEach.call(outputs, function (output) { - if (output.htmlFor == _this2.element.getAttribute('id')) { - return output; - } - }); - return null; - } - }, { - key: '_getSliderOutputPosition', - value: function _getSliderOutputPosition() { - // Update output position - var newPlace, minValue; - - var style = window.getComputedStyle(this.element, null); - // Measure width of range input - var sliderWidth = parseInt(style.getPropertyValue('width'), 10); - - // Figure out placement percentage between left and right of input - if (!this.element.getAttribute('min')) { - minValue = 0; - } else { - minValue = this.element.getAttribute('min'); - } - var newPoint = (this.element.value - minValue) / (this.element.getAttribute('max') - minValue); - - // Prevent bubble from going beyond left or right (unsupported browsers) - if (newPoint < 0) { - newPlace = 0; - } else if (newPoint > 1) { - newPlace = sliderWidth; - } else { - newPlace = sliderWidth * newPoint; - } - - return { - 'position': newPlace + 'px' - }; - } - - /** - * Bind all events - * @method _bindEvents - * @return {void} - */ - - }, { - key: '_bindEvents', - value: function _bindEvents() { - if (this.output) { - // Add event listener to update output when slider value change - this.element.addEventListener('input', this[onSliderInput], false); - } - } - }, { - key: onSliderInput, - value: function value(e) { - e.preventDefault(); - - if (this.element.classList.contains('has-output-tooltip')) { - // Get new output position - var newPosition = this._getSliderOutputPosition(); - - // Set output position - this.output.style['left'] = newPosition.position; - } - - // Check for prefix and postfix - var prefix = this.output.hasAttribute('data-prefix') ? this.output.getAttribute('data-prefix') : ''; - var postfix = this.output.hasAttribute('data-postfix') ? this.output.getAttribute('data-postfix') : ''; - - // Update output with slider value - this.output.value = prefix + this.element.value + postfix; - - this.emit('bulmaslider:ready', this.element.value); - } - }], [{ - key: 'attach', - value: function attach() { - var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'input[type="range"].slider'; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var instances = new Array(); - - var elements = document.querySelectorAll(selector); - [].forEach.call(elements, function (element) { - setTimeout(function () { - instances.push(new bulmaSlider(element, options)); - }, 100); - }); - return instances; - } - }]); - - return bulmaSlider; -}(__WEBPACK_IMPORTED_MODULE_0__events__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["default"] = (bulmaSlider); - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var EventEmitter = function () { - function EventEmitter() { - var listeners = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - - _classCallCheck(this, EventEmitter); - - this._listeners = new Map(listeners); - this._middlewares = new Map(); - } - - _createClass(EventEmitter, [{ - key: "listenerCount", - value: function listenerCount(eventName) { - if (!this._listeners.has(eventName)) { - return 0; - } - - var eventListeners = this._listeners.get(eventName); - return eventListeners.length; - } - }, { - key: "removeListeners", - value: function removeListeners() { - var _this = this; - - var eventName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var middleware = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (eventName !== null) { - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this.removeListeners(e, middleware); - }); - } else { - this._listeners.delete(eventName); - - if (middleware) { - this.removeMiddleware(eventName); - } - } - } else { - this._listeners = new Map(); - } - } - }, { - key: "middleware", - value: function middleware(eventName, fn) { - var _this2 = this; - - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this2.middleware(e, fn); - }); - } else { - if (!Array.isArray(this._middlewares.get(eventName))) { - this._middlewares.set(eventName, []); - } - - this._middlewares.get(eventName).push(fn); - } - } - }, { - key: "removeMiddleware", - value: function removeMiddleware() { - var _this3 = this; - - var eventName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (eventName !== null) { - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this3.removeMiddleware(e); - }); - } else { - this._middlewares.delete(eventName); - } - } else { - this._middlewares = new Map(); - } - } - }, { - key: "on", - value: function on(name, callback) { - var _this4 = this; - - var once = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - if (Array.isArray(name)) { - name.forEach(function (e) { - return _this4.on(e, callback); - }); - } else { - name = name.toString(); - var split = name.split(/,|, | /); - - if (split.length > 1) { - split.forEach(function (e) { - return _this4.on(e, callback); - }); - } else { - if (!Array.isArray(this._listeners.get(name))) { - this._listeners.set(name, []); - } - - this._listeners.get(name).push({ once: once, callback: callback }); - } - } - } - }, { - key: "once", - value: function once(name, callback) { - this.on(name, callback, true); - } - }, { - key: "emit", - value: function emit(name, data) { - var _this5 = this; - - var silent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - name = name.toString(); - var listeners = this._listeners.get(name); - var middlewares = null; - var doneCount = 0; - var execute = silent; - - if (Array.isArray(listeners)) { - listeners.forEach(function (listener, index) { - // Start Middleware checks unless we're doing a silent emit - if (!silent) { - middlewares = _this5._middlewares.get(name); - // Check and execute Middleware - if (Array.isArray(middlewares)) { - middlewares.forEach(function (middleware) { - middleware(data, function () { - var newData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (newData !== null) { - data = newData; - } - doneCount++; - }, name); - }); - - if (doneCount >= middlewares.length) { - execute = true; - } - } else { - execute = true; - } - } - - // If Middleware checks have been passed, execute - if (execute) { - if (listener.once) { - listeners[index] = null; - } - listener.callback(data); - } - }); - - // Dirty way of removing used Events - while (listeners.indexOf(null) !== -1) { - listeners.splice(listeners.indexOf(null), 1); - } - } - } - }]); - - return EventEmitter; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (EventEmitter); - -/***/ }), -/* 2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var defaultOptions = {}; - -/* harmony default export */ __webpack_exports__["a"] = (defaultOptions); - -/***/ }) -/******/ ])["default"]; -}); \ No newline at end of file diff --git a/django_simple_bulma/js/bulma-steps.js b/django_simple_bulma/js/bulma-steps.js deleted file mode 100644 index 319dcf1..0000000 --- a/django_simple_bulma/js/bulma-steps.js +++ /dev/null @@ -1,594 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["bulmaSteps"] = factory(); - else - root["bulmaSteps"] = factory(); -})(typeof self !== 'undefined' ? self : this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__events__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__defaultOptions__ = __webpack_require__(2); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - -var onStepsPrevious = Symbol('onStepsPrevious'); -var onStepsNext = Symbol('onStepsNext'); - -var bulmaSteps = function (_EventEmitter) { - _inherits(bulmaSteps, _EventEmitter); - - function bulmaSteps(selector) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - _classCallCheck(this, bulmaSteps); - - var _this = _possibleConstructorReturn(this, (bulmaSteps.__proto__ || Object.getPrototypeOf(bulmaSteps)).call(this)); - - _this.element = typeof selector === 'string' ? document.querySelector(selector) : selector; - // An invalid selector or non-DOM node has been provided. - if (!_this.element) { - throw new Error('An invalid selector or non-DOM node has been provided.'); - } - - _this._clickEvents = ['click']; - /// Set default options and merge with instance defined - _this.options = _extends({}, __WEBPACK_IMPORTED_MODULE_1__defaultOptions__["a" /* default */], options); - - _this[onStepsPrevious] = _this[onStepsPrevious].bind(_this); - _this[onStepsNext] = _this[onStepsNext].bind(_this); - - _this.init(); - return _this; - } - - /** - * Initiate all DOM element containing carousel class - * @method - * @return {Array} Array of all Carousel instances - */ - - - _createClass(bulmaSteps, [{ - key: 'init', - - - /** - * Initiate plugin - * @method init - * @return {void} - */ - value: function init() { - this._id = 'bulmaSteps' + new Date().getTime() + Math.floor(Math.random() * Math.floor(9999)); - - this.steps = this.element.querySelectorAll(this.options.selector); - this.contents = this.element.querySelectorAll(this.options.selector_content); - this.previous_btn = this.element.querySelector(this.options.previous_selector); - this.next_btn = this.element.querySelector(this.options.next_selector); - - [].forEach.call(this.steps, function (step, index) { - step.setAttribute('data-step-id', index); - }); - - if (this.steps && this.steps.length) { - this.activate_step(0); - this.updateActions(this.steps[0]); - } - - this._bindEvents(); - - this.emit('bulmasteps:ready', this.element.value); - } - - /** - * Bind all events - * @method _bindEvents - * @return {void} - */ - - }, { - key: '_bindEvents', - value: function _bindEvents() { - var _this2 = this; - - if (this.previous_btn != null) { - this._clickEvents.forEach(function (event) { - _this2.previous_btn.addEventListener(event, _this2[onStepsPrevious], false); - }); - } - - if (this.next_btn != null) { - this._clickEvents.forEach(function (event) { - _this2.next_btn.addEventListener(event, _this2[onStepsNext], false); - }); - } - - if (this.options.stepClickable) { - [].forEach.call(this.steps, function (step, index) { - _this2._clickEvents.forEach(function (event) { - while (index > _this2.current_id) { - _this2[onStepsNext](event); - } - while (index < _this2.current_id) { - _this2[onStepsPrevious](event); - } - }); - }); - } - } - }, { - key: onStepsPrevious, - value: function value(e) { - e.preventDefault(); - - if (!e.target.getAttribute('disabled')) { - this.previous_step(); - } - } - }, { - key: onStepsNext, - value: function value(e) { - e.preventDefault(); - - if (!e.target.getAttribute('disabled')) { - this.next_step(); - } - } - }, { - key: 'get_current_step_id', - value: function get_current_step_id() { - for (var i = 0; i < this.steps.length; i++) { - var step = this.steps[i]; - - if (step.classList.contains(this.options.active_class)) { - return parseInt(step.getAttribute('data-step-id')); - } - } - - return null; - } - }, { - key: 'updateActions', - value: function updateActions(step) { - var stepId = parseInt(step.getAttribute('data-step-id')); - if (stepId == 0) { - if (this.previous_btn != null) { - this.previous_btn.setAttribute('disabled', 'disabled'); - } - if (this.next_btn != null) { - this.next_btn.removeAttribute('disabled', 'disabled'); - } - } else if (stepId == this.steps.length - 1) { - if (this.previous_btn != null) { - this.previous_btn.removeAttribute('disabled', 'disabled'); - } - if (this.next_btn != null) { - this.next_btn.setAttribute('disabled', 'disabled'); - } - } else { - if (this.previous_btn != null) { - this.previous_btn.removeAttribute('disabled', 'disabled'); - } - if (this.next_btn != null) { - this.next_btn.removeAttribute('disabled', 'disabled'); - } - } - } - }, { - key: 'next_step', - value: function next_step() { - var current_id = this.get_current_step_id(); - - if (current_id == null) { - return; - } - - var next_id = current_id + 1, - errors = []; - - if (typeof this.options.beforeNext != 'undefined' && this.options.beforeNext != null && this.options.beforeNext) { - errors = this.options.beforeNext(current_id); - } - this.emit('bulmasteps:before:next', current_id); - - if (typeof errors == 'undefined') { - errors = []; - } - - if (errors.length > 0) { - this.emit('bulmasteps:errors', errors); - for (var i = 0; i < errors.length; i++) { - if (typeof this.options.onError != 'undefined' && this.options.onError != null && this.options.onError) { - this.options.onError(errors[i]); - } - } - - return; - } - - if (next_id >= this.steps.length - 1) { - if (typeof this.options.onFinish != 'undefined' && this.options.onFinish != null && this.options.onFinish) { - this.options.onFinish(current_id); - } - this.emit('bulmasteps:finish', current_id); - } - if (next_id < this.steps.length) { - this.complete_step(current_id); - this.activate_step(next_id); - } - } - }, { - key: 'previous_step', - value: function previous_step() { - var current_id = this.get_current_step_id(); - if (current_id == null) { - return; - } - - this.uncomplete_step(current_id - 1); - this.activate_step(current_id - 1); - } - - /** - * Activate a single step, - * will deactivate all other steps. - */ - - }, { - key: 'activate_step', - value: function activate_step(step_id) { - this.updateActions(this.steps[step_id]); - - for (var i = 0; i < this.steps.length; i++) { - var _step = this.steps[i]; - - if (_step == this.steps[step_id]) { - continue; - } - - this.deactivate_step(i); - } - - this.steps[step_id].classList.add(this.options.active_class); - if (typeof this.contents[step_id] !== 'undefined') { - this.contents[step_id].classList.add(this.options.active_class); - } - - if (typeof this.options.onShow != 'undefined' && this.options.onShow != null && this.options.onShow) { - this.options.onShow(step_id); - } - - this.emit('bulmasteps:step:show', step_id); - } - }, { - key: 'complete_step', - value: function complete_step(step_id) { - this.steps[step_id].classList.add(this.options.completed_class); - this.emit('bulmasteps:step:completed', step_id); - } - }, { - key: 'uncomplete_step', - value: function uncomplete_step(step_id) { - this.steps[step_id].classList.remove(this.options.completed_class); - this.emit('bulmasteps:step:uncompleted', step_id); - } - }, { - key: 'deactivate_step', - value: function deactivate_step(step_id) { - this.steps[step_id].classList.remove(this.options.active_class); - if (typeof this.contents[step_id] !== 'undefined') { - this.contents[step_id].classList.remove(this.options.active_class); - } - } - }], [{ - key: 'attach', - value: function attach() { - var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '.steps'; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var instances = new Array(); - - var elements = document.querySelectorAll(selector); - [].forEach.call(elements, function (element) { - setTimeout(function () { - instances.push(new bulmaSteps(element, options)); - }, 100); - }); - return instances; - } - }]); - - return bulmaSteps; -}(__WEBPACK_IMPORTED_MODULE_0__events__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["default"] = (bulmaSteps); - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var EventEmitter = function () { - function EventEmitter() { - var listeners = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - - _classCallCheck(this, EventEmitter); - - this._listeners = new Map(listeners); - this._middlewares = new Map(); - } - - _createClass(EventEmitter, [{ - key: "listenerCount", - value: function listenerCount(eventName) { - if (!this._listeners.has(eventName)) { - return 0; - } - - var eventListeners = this._listeners.get(eventName); - return eventListeners.length; - } - }, { - key: "removeListeners", - value: function removeListeners() { - var _this = this; - - var eventName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var middleware = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (eventName !== null) { - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this.removeListeners(e, middleware); - }); - } else { - this._listeners.delete(eventName); - - if (middleware) { - this.removeMiddleware(eventName); - } - } - } else { - this._listeners = new Map(); - } - } - }, { - key: "middleware", - value: function middleware(eventName, fn) { - var _this2 = this; - - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this2.middleware(e, fn); - }); - } else { - if (!Array.isArray(this._middlewares.get(eventName))) { - this._middlewares.set(eventName, []); - } - - this._middlewares.get(eventName).push(fn); - } - } - }, { - key: "removeMiddleware", - value: function removeMiddleware() { - var _this3 = this; - - var eventName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (eventName !== null) { - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this3.removeMiddleware(e); - }); - } else { - this._middlewares.delete(eventName); - } - } else { - this._middlewares = new Map(); - } - } - }, { - key: "on", - value: function on(name, callback) { - var _this4 = this; - - var once = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - if (Array.isArray(name)) { - name.forEach(function (e) { - return _this4.on(e, callback); - }); - } else { - name = name.toString(); - var split = name.split(/,|, | /); - - if (split.length > 1) { - split.forEach(function (e) { - return _this4.on(e, callback); - }); - } else { - if (!Array.isArray(this._listeners.get(name))) { - this._listeners.set(name, []); - } - - this._listeners.get(name).push({ once: once, callback: callback }); - } - } - } - }, { - key: "once", - value: function once(name, callback) { - this.on(name, callback, true); - } - }, { - key: "emit", - value: function emit(name, data) { - var _this5 = this; - - var silent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - name = name.toString(); - var listeners = this._listeners.get(name); - var middlewares = null; - var doneCount = 0; - var execute = silent; - - if (Array.isArray(listeners)) { - listeners.forEach(function (listener, index) { - // Start Middleware checks unless we're doing a silent emit - if (!silent) { - middlewares = _this5._middlewares.get(name); - // Check and execute Middleware - if (Array.isArray(middlewares)) { - middlewares.forEach(function (middleware) { - middleware(data, function () { - var newData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (newData !== null) { - data = newData; - } - doneCount++; - }, name); - }); - - if (doneCount >= middlewares.length) { - execute = true; - } - } else { - execute = true; - } - } - - // If Middleware checks have been passed, execute - if (execute) { - if (listener.once) { - listeners[index] = null; - } - listener.callback(data); - } - }); - - // Dirty way of removing used Events - while (listeners.indexOf(null) !== -1) { - listeners.splice(listeners.indexOf(null), 1); - } - } - } - }]); - - return EventEmitter; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (EventEmitter); - -/***/ }), -/* 2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var defaultOptions = { - 'selector': '.step-item', - 'selector_content': '.step-content', - 'previous_selector': '[data-nav="previous"]', - 'next_selector': '[data-nav="next"]', - 'active_class': 'is-active', - 'completed_class': 'is-completed', - 'stepClickable': false, - 'beforeNext': null, - 'onShow': null, - 'onFinish': null, - 'onError': null -}; - -/* harmony default export */ __webpack_exports__["a"] = (defaultOptions); - -/***/ }) -/******/ ])["default"]; -}); \ No newline at end of file diff --git a/django_simple_bulma/js/bulma-tagsinput.js b/django_simple_bulma/js/bulma-tagsinput.js deleted file mode 100644 index 45961ed..0000000 --- a/django_simple_bulma/js/bulma-tagsinput.js +++ /dev/null @@ -1,706 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["bulmaTagsinput"] = factory(); - else - root["bulmaTagsinput"] = factory(); -})(typeof self !== 'undefined' ? self : this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_events__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__defaultOptions__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_type__ = __webpack_require__(3); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - - - -var KEY_BACKSPACE = 8, - KEY_TAB = 9, - KEY_ENTER = 13, - KEY_LEFT = 37, - KEY_RIGHT = 39, - KEY_DELETE = 46, - KEY_COMMA = 188; - -var bulmaTagsinput = function (_EventEmitter) { - _inherits(bulmaTagsinput, _EventEmitter); - - function bulmaTagsinput(selector) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - _classCallCheck(this, bulmaTagsinput); - - var _this = _possibleConstructorReturn(this, (bulmaTagsinput.__proto__ || Object.getPrototypeOf(bulmaTagsinput)).call(this)); - - _this.element = __WEBPACK_IMPORTED_MODULE_2__utils_type__["a" /* isString */](selector) ? document.querySelector(selector) : selector; - // An invalid selector or non-DOM node has been provided. - if (!_this.element) { - throw new Error('An invalid selector or non-DOM node has been provided.'); - } - _this._clickEvents = ['click']; - - /// Set default options and merge with instance defined - _this.options = _extends({}, __WEBPACK_IMPORTED_MODULE_1__defaultOptions__["a" /* default */], options); - - if (_this.element.dataset.hasOwnProperty('lowercase')) { - _this.options.lowercase = _this.element.dataset('lowercase'); - } - if (_this.element.dataset.hasOwnProperty('uppercase')) { - _this.options.lowercase = _this.element.dataset('uppercase'); - } - if (_this.element.dataset.hasOwnProperty('duplicates')) { - _this.options.lowercase = _this.element.dataset('duplicates'); - } - - _this.init(); - return _this; - } - - /** - * Initiate all DOM element containing tagsinput class - * @method - * @return {Array} Array of all TagsInput instances - */ - - - _createClass(bulmaTagsinput, [{ - key: 'init', - value: function init() { - if (!this.options.disabled) { - this.tags = []; - // The container will visually looks like an input - this.container = document.createElement('div'); - this.container.className = 'tagsinput'; - this.container.classList.add('field'); - this.container.classList.add('is-grouped'); - this.container.classList.add('is-grouped-multiline'); - this.container.classList.add('input'); - - var inputType = this.element.getAttribute('type'); - if (!inputType || inputType === 'tags') { - inputType = 'text'; - } - // Create an invisible input element so user will be able to enter value - this.input = document.createElement('input'); - this.input.setAttribute('type', inputType); - if (this.element.getAttribute('placeholder')) { - this.input.setAttribute('placeholder', this.element.getAttribute('placeholder')); - } else { - this.input.setAttribute('placeholder', 'Add a Tag'); - } - this.container.appendChild(this.input); - - var sib = this.element.nextSibling; - this.element.parentNode[sib ? 'insertBefore' : 'appendChild'](this.container, sib); - this.element.style.cssText = 'position:absolute;left:0;top:0;width:1px;height:1px;opacity:0.01;'; - this.element.tabIndex = -1; - - this.enable(); - } - } - }, { - key: 'enable', - value: function enable() { - var _this2 = this; - - if (!this.enabled && !this.options.disabled) { - - this.element.addEventListener('focus', function () { - _this2.container.classList.add('is-focused'); - _this2.select(Array.prototype.slice.call(_this2.container.querySelectorAll('.tag:not(.is-delete)')).pop()); - }); - - this.input.addEventListener('focus', function () { - _this2.container.classList.add('is-focused'); - _this2.select(Array.prototype.slice.call(_this2.container.querySelectorAll('.tag:not(.is-delete)')).pop()); - }); - this.input.addEventListener('blur', function () { - _this2.container.classList.remove('is-focused'); - _this2.select(Array.prototype.slice.call(_this2.container.querySelectorAll('.tag:not(.is-delete)')).pop()); - _this2.savePartial(); - }); - this.input.addEventListener('keydown', function (e) { - var key = e.charCode || e.keyCode || e.which, - selectedTag = void 0, - activeTag = _this2.container.querySelector('.tag.is-active'), - last = Array.prototype.slice.call(_this2.container.querySelectorAll('.tag:not(.is-delete)')).pop(), - atStart = _this2.caretAtStart(_this2.input); - - if (activeTag) { - selectedTag = _this2.container.querySelector('[data-tag="' + activeTag.innerHTML.trim() + '"]'); - } - _this2.setInputWidth(); - - if (key === KEY_ENTER || key === _this2.options.delimiter.charCodeAt(0) || key === KEY_COMMA || key === KEY_TAB) { - if (!_this2.input.value && (key !== _this2.options.delimiter.charCodeAt(0) || key === KEY_COMMA)) { - return; - } - _this2.savePartial(); - } else if (key === KEY_DELETE && selectedTag) { - if (selectedTag.nextSibling) { - _this2.select(selectedTag.nextSibling.querySelector('.tag')); - } else if (selectedTag.previousSibling) { - _this2.select(selectedTag.previousSibling.querySelector('.tag')); - } - _this2.container.removeChild(selectedTag); - _this2.tags.splice(_this2.tags.indexOf(selectedTag.getAttribute('data-tag')), 1); - _this2.setInputWidth(); - _this2.save(); - } else if (key === KEY_BACKSPACE) { - if (selectedTag) { - if (selectedTag.previousSibling) { - _this2.select(selectedTag.previousSibling.querySelector('.tag')); - } else if (selectedTag.nextSibling) { - _this2.select(selectedTag.nextSibling.querySelector('.tag')); - } - _this2.container.removeChild(selectedTag); - _this2.tags.splice(_this2.tags.indexOf(selectedTag.getAttribute('data-tag')), 1); - _this2.setInputWidth(); - _this2.save(); - } else if (last && atStart) { - _this2.select(last); - } else { - return; - } - } else if (key === KEY_LEFT) { - if (selectedTag) { - if (selectedTag.previousSibling) { - _this2.select(selectedTag.previousSibling.querySelector('.tag')); - } - } else if (!atStart) { - return; - } else { - _this2.select(last); - } - } else if (key === KEY_RIGHT) { - if (!selectedTag) { - return; - } - _this2.select(selectedTag.nextSibling.querySelector('.tag')); - } else { - return _this2.select(); - } - - e.preventDefault(); - return false; - }); - this.input.addEventListener('input', function () { - _this2.element.value = _this2.getValue(); - _this2.element.dispatchEvent(new Event('input')); - }); - this.input.addEventListener('paste', function () { - return setTimeout(savePartial, 0); - }); - - this.container.addEventListener('mousedown', function (e) { - _this2.refocus(e); - }); - this.container.addEventListener('touchstart', function (e) { - _this2.refocus(e); - }); - - this.savePartial(this.element.value); - - this.enabled = true; - } - } - }, { - key: 'disable', - value: function disable() { - if (this.enabled && !this.options.disabled) { - this.reset(); - - this.enabled = false; - } - } - }, { - key: 'select', - value: function select(el) { - var sel = this.container.querySelector('.is-active'); - if (sel) { - sel.classList.remove('is-active'); - } - if (el) { - el.classList.add('is-active'); - } - } - }, { - key: 'addTag', - value: function addTag(text) { - var _this3 = this; - - if (~text.indexOf(this.options.delimiter)) { - text = text.split(this.options.delimiter); - } - if (Array.isArray(text)) { - return text.forEach(function (text) { - _this3.addTag(text); - }); - } - - var tag = text && text.trim(); - if (!tag) { - return false; - } - - if (this.options['lowercase'] == 'true') { - tag = tag.toLowerCase(); - } - if (this.options['uppercase'] == 'true') { - tag = tag.toUpperCase(); - } - if (this.options['duplicates'] || this.tags.indexOf(tag) === -1) { - this.tags.push(tag); - - var newTagWrapper = document.createElement('div'); - newTagWrapper.className = 'control'; - newTagWrapper.setAttribute('data-tag', tag); - - var newTag = document.createElement('div'); - newTag.className = 'tags'; - newTag.classList.add('has-addons'); - - var newTagContent = document.createElement('span'); - newTagContent.className = 'tag'; - newTagContent.classList.add('is-active'); - this.select(newTagContent); - newTagContent.innerHTML = tag; - - newTag.appendChild(newTagContent); - if (this.options.allowDelete) { - var newTagDeleteButton = document.createElement('a'); - newTagDeleteButton.className = 'tag'; - newTagDeleteButton.classList.add('is-delete'); - this._clickEvents.forEach(function (event) { - newTagDeleteButton.addEventListener(event, function (e) { - var selectedTag = void 0, - activeTag = e.target.parentNode, - last = Array.prototype.slice.call(_this3.container.querySelectorAll('.tag')).pop(), - atStart = _this3.caretAtStart(_this3.input); - - if (activeTag) { - selectedTag = _this3.container.querySelector('[data-tag="' + activeTag.innerText.trim() + '"]'); - } - - if (selectedTag) { - _this3.select(selectedTag.previousSibling); - _this3.container.removeChild(selectedTag); - _this3.tags.splice(_this3.tags.indexOf(selectedTag.getAttribute('data-tag')), 1); - _this3.setInputWidth(); - _this3.save(); - } else if (last && atStart) { - _this3.select(last); - } else { - return; - } - }); - }); - newTag.appendChild(newTagDeleteButton); - } - newTagWrapper.appendChild(newTag); - - this.container.insertBefore(newTagWrapper, this.input); - } - } - }, { - key: 'getValue', - value: function getValue() { - return this.tags.join(this.options.delimiter); - } - }, { - key: 'setValue', - value: function setValue(value) { - var _this4 = this; - - Array.prototype.slice.call(this.container.querySelectorAll('.tag')).forEach(function (tag) { - _this4.tags.splice(_this4.tags.indexOf(tag.innerHTML), 1); - _this4.container.removeChild(tag); - }); - this.savePartial(value); - } - }, { - key: 'setInputWidth', - value: function setInputWidth() { - var last = Array.prototype.slice.call(this.container.querySelectorAll('.control')).pop(); - - if (!this.container.offsetWidth) { - return; - } - this.input.style.width = Math.max(this.container.offsetWidth - (last ? last.offsetLeft + last.offsetWidth : 30) - 30, this.container.offsetWidth / 4) + 'px'; - } - }, { - key: 'savePartial', - value: function savePartial(value) { - if (typeof value !== 'string' && !Array.isArray(value)) { - value = this.input.value; - } - if (this.addTag(value) !== false) { - this.input.value = ''; - this.save(); - this.setInputWidth(); - } - } - }, { - key: 'save', - value: function save() { - this.element.value = this.tags.join(this.options.delimiter); - this.element.dispatchEvent(new Event('change')); - } - }, { - key: 'caretAtStart', - value: function caretAtStart(el) { - try { - return el.selectionStart === 0 && el.selectionEnd === 0; - } catch (e) { - return el.value === ''; - } - } - }, { - key: 'refocus', - value: function refocus(e) { - if (e.target.classList.contains('tag')) { - this.select(e.target); - } - if (e.target === this.input) { - return this.select(); - } - this.input.focus(); - e.preventDefault(); - return false; - } - }, { - key: 'reset', - value: function reset() { - this.tags = []; - } - }, { - key: 'destroy', - value: function destroy() { - this.disable(); - this.reset(); - this.element = null; - } - }], [{ - key: 'attach', - value: function attach() { - var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'input[type="tags"]'; - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - var instances = new Array(); - - var elements = document.querySelectorAll(selector); - [].forEach.call(elements, function (element) { - setTimeout(function () { - instances.push(new bulmaTagsinput(element, options)); - }, 100); - }); - return instances; - } - }]); - - return bulmaTagsinput; -}(__WEBPACK_IMPORTED_MODULE_0__utils_events__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["default"] = (bulmaTagsinput); - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var EventEmitter = function () { - function EventEmitter() { - var listeners = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - - _classCallCheck(this, EventEmitter); - - this._listeners = new Map(listeners); - this._middlewares = new Map(); - } - - _createClass(EventEmitter, [{ - key: "listenerCount", - value: function listenerCount(eventName) { - if (!this._listeners.has(eventName)) { - return 0; - } - - var eventListeners = this._listeners.get(eventName); - return eventListeners.length; - } - }, { - key: "removeListeners", - value: function removeListeners() { - var _this = this; - - var eventName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var middleware = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (eventName !== null) { - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this.removeListeners(e, middleware); - }); - } else { - this._listeners.delete(eventName); - - if (middleware) { - this.removeMiddleware(eventName); - } - } - } else { - this._listeners = new Map(); - } - } - }, { - key: "middleware", - value: function middleware(eventName, fn) { - var _this2 = this; - - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this2.middleware(e, fn); - }); - } else { - if (!Array.isArray(this._middlewares.get(eventName))) { - this._middlewares.set(eventName, []); - } - - this._middlewares.get(eventName).push(fn); - } - } - }, { - key: "removeMiddleware", - value: function removeMiddleware() { - var _this3 = this; - - var eventName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (eventName !== null) { - if (Array.isArray(eventName)) { - name.forEach(function (e) { - return _this3.removeMiddleware(e); - }); - } else { - this._middlewares.delete(eventName); - } - } else { - this._middlewares = new Map(); - } - } - }, { - key: "on", - value: function on(name, callback) { - var _this4 = this; - - var once = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - if (Array.isArray(name)) { - name.forEach(function (e) { - return _this4.on(e, callback); - }); - } else { - name = name.toString(); - var split = name.split(/,|, | /); - - if (split.length > 1) { - split.forEach(function (e) { - return _this4.on(e, callback); - }); - } else { - if (!Array.isArray(this._listeners.get(name))) { - this._listeners.set(name, []); - } - - this._listeners.get(name).push({ once: once, callback: callback }); - } - } - } - }, { - key: "once", - value: function once(name, callback) { - this.on(name, callback, true); - } - }, { - key: "emit", - value: function emit(name, data) { - var _this5 = this; - - var silent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - name = name.toString(); - var listeners = this._listeners.get(name); - var middlewares = null; - var doneCount = 0; - var execute = silent; - - if (Array.isArray(listeners)) { - listeners.forEach(function (listener, index) { - // Start Middleware checks unless we're doing a silent emit - if (!silent) { - middlewares = _this5._middlewares.get(name); - // Check and execute Middleware - if (Array.isArray(middlewares)) { - middlewares.forEach(function (middleware) { - middleware(data, function () { - var newData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - if (newData !== null) { - data = newData; - } - doneCount++; - }, name); - }); - - if (doneCount >= middlewares.length) { - execute = true; - } - } else { - execute = true; - } - } - - // If Middleware checks have been passed, execute - if (execute) { - if (listener.once) { - listeners[index] = null; - } - listener.callback(data); - } - }); - - // Dirty way of removing used Events - while (listeners.indexOf(null) !== -1) { - listeners.splice(listeners.indexOf(null), 1); - } - } - } - }]); - - return EventEmitter; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (EventEmitter); - -/***/ }), -/* 2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -var defaultOptions = { - disabled: false, - delimiter: ',', - allowDelete: true, - lowercase: false, - uppercase: false, - duplicates: true -}; - -/* harmony default export */ __webpack_exports__["a"] = (defaultOptions); - -/***/ }), -/* 3 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isString; }); -/* unused harmony export isDate */ -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var isString = function isString(unknown) { - return typeof unknown === 'string' || !!unknown && (typeof unknown === 'undefined' ? 'undefined' : _typeof(unknown)) === 'object' && Object.prototype.toString.call(unknown) === '[object String]'; -}; -var isDate = function isDate(unknown) { - return (Object.prototype.toString.call(unknown) === '[object Date]' || unknown instanceof Date) && !isNaN(unknown.valueOf()); -}; - -/***/ }) -/******/ ])["default"]; -}); \ No newline at end of file diff --git a/django_simple_bulma/templatetags/django_simple_bulma.py b/django_simple_bulma/templatetags/django_simple_bulma.py index fa509b3..d67edc5 100644 --- a/django_simple_bulma/templatetags/django_simple_bulma.py +++ b/django_simple_bulma/templatetags/django_simple_bulma.py @@ -4,24 +4,13 @@ These are loaded when {% load django_simple_bulma %} is called. """ -from pathlib import Path - from django import template -from django.conf import settings from django.templatetags.static import static from django.utils.safestring import SafeString, mark_safe - -# If BULMA_SETTINGS has not been declared if no extensions -# have been defined, default to all extensions. -if hasattr(settings, "BULMA_SETTINGS"): - extensions = settings.BULMA_SETTINGS.get("extensions", "_all") -else: - extensions = "_all" +from ..utils import get_js_files register = template.Library() -simple_bulma_path = Path(__file__).resolve().parent.parent -js_folder = simple_bulma_path / "js" @register.simple_tag @@ -32,12 +21,8 @@ def bulma() -> SafeString: html = [f''] # Build html to include all the js files required. - for filename in js_folder.iterdir(): - js_file = static(f"js/{filename.name}") - extension_name = filename.stem - - if extension_name in extensions or extensions == "_all": - html.append(f'{" " * 8}') + for js_file in map(static, get_js_files()): + html.append(f'') return mark_safe("\n".join(html)) # noqa diff --git a/django_simple_bulma/utils.py b/django_simple_bulma/utils.py new file mode 100644 index 0000000..4b82ad4 --- /dev/null +++ b/django_simple_bulma/utils.py @@ -0,0 +1,70 @@ +"""Django Simple Bulma utilities. Ultimately helps ensure DRY code.""" + +from pathlib import Path +from typing import Generator, List, Union + +from django.conf import settings + +# If BULMA_SETTINGS has not been declared if no extensions +# have been defined, default to all extensions. +if hasattr(settings, "BULMA_SETTINGS"): + extensions = settings.BULMA_SETTINGS.get("extensions", []) +else: + extensions = [] + +simple_bulma_path = Path(__file__).resolve().parent + +# (Path, str) pairs describing a relative path in an extension and a glob pattern to search for +sass_files_searchs = ( + (Path("src/sass"), "_all.sass"), + (Path("src/sass"), "*.sass"), + (Path("src"), "*.s[ac]ss"), + (Path("dist"), "*.sass"), + (Path("dist"), "*.min.css"), + (Path("dist"), "*.css"), + (Path(""), "*.s[ac]ss"), +) + + +def is_enabled(extension: Union[Path, str]) -> bool: + """Return whether an extension is enabled or not""" + if isinstance(extension, Path): + return extensions == "all" or extension.name in extensions + return extensions == "all" or extension in extensions + + +def get_js_files() -> Generator[str, None, None]: + """Yield all the js files that are needed for the users selected extensions.""" + # For every extension... + for ext in (simple_bulma_path / "extensions").iterdir(): + # ...check if it is enabled... + if is_enabled(ext): + dist_folder = ext / "dist" + + # ...and add its JS file. + # This really makes a lot of assumptions about the extension, + # but so does everything else up until here. + # Basically, try get a minified version first before settling + # for whatever might be there. + js_file = next(dist_folder.rglob("*.min.js"), None) or \ + next(dist_folder.rglob("*.js"), None) + if js_file: + yield js_file.relative_to(simple_bulma_path).as_posix() + + +def get_sass_files(ext: Path) -> List[Path]: + """Given the path to an extension, find and yield all files that should be imported""" + for rel_path, glob in sass_files_searchs: + src_files = list((ext / rel_path).rglob(glob)) + + for i, src in enumerate(src_files): + # Remove suffix from css files, otherwise they wont get compiled, only referenced + if glob.endswith(".css"): + src = src.with_suffix("") + src_files[i] = src.relative_to(simple_bulma_path) + + if src_files: + return src_files + + # Extension has no stylesheets + return []