commit 4cd1695f5881c2b555191f51f684369e72c68734 Author: Mitja Stachowiak Date: Mon Aug 21 15:04:36 2023 +0200 Aktueller Stand diff --git a/css/Zahnrad.svg b/css/Zahnrad.svg new file mode 100644 index 0000000..203df83 --- /dev/null +++ b/css/Zahnrad.svg @@ -0,0 +1,61 @@ + + + + + + + + image/svg+xml + + + + + + + + diff --git a/css/beipackzettel.css b/css/beipackzettel.css new file mode 100644 index 0000000..8eac4ef --- /dev/null +++ b/css/beipackzettel.css @@ -0,0 +1,61 @@ +@font-face { + font-family: "Source Sans Pro"; + src: url("fonts/source-sans-pro.extralight.ttf"); + font-weight: 200; +} +@font-face { + font-family: "Source Sans Pro"; + src: url("fonts/source-sans-pro.extralight-italic.ttf"); + font-weight: 200; + font-style: italic; +} +@font-face { + font-family: "Source Sans Pro"; + src: url("fonts/source-sans-pro.light.ttf"); + font-weight: 300; +} +@font-face { + font-family: "Source Sans Pro"; + src: url("fonts/source-sans-pro.light-italic.ttf"); + font-weight: 300; + font-style: italic; +} +@font-face { + font-family: "Source Sans Pro"; + src: url("fonts/source-sans-pro.regular.ttf"); + font-weight: 400; +} +@font-face { + font-family: "Source Sans Pro"; + src: url("fonts/source-sans-pro.italic.ttf"); + font-weight: 400; + font-style: italic; +} +@font-face { + font-family: "Source Sans Pro"; + src: url("fonts/source-sans-pro.bold.ttf"); + font-weight: 700; +} +@font-face { + font-family: "Source Sans Pro"; + src: url("fonts/source-sans-pro.bold-italic.ttf"); + font-weight: 700; + font-style: italic; +} +@font-face { + font-family: "Source Sans Pro"; + src: url("fonts/source-sans-pro.black.ttf"); + font-weight: 900; +} +@font-face { + font-family: "Source Sans Pro"; + src: url("fonts/source-sans-pro.black-italic.ttf"); + font-weight: 900; + font-style: italic; +} +* { + font-family: 'Source Sans Pro' !important; +} +#BoxTop h1, #BoxTop h2, #BoxTop h1 a, #BoxTop h2 a { + font-family: 'Perspective Sans' !important; +} diff --git a/css/blocks/blocks.css b/css/blocks/blocks.css new file mode 100644 index 0000000..ae36a78 --- /dev/null +++ b/css/blocks/blocks.css @@ -0,0 +1,105 @@ +.blocks > h1, +.blocks > h2, +.blocks > h3, +.blocks > h4, +.blocks > h5, +.blocks > h6, +.blocks > p, +.blocks > ul, +.blocks > ol, +.blocks > hr { + max-width : none; + width : 100%; + margin-left: auto; + margin-right: auto; + margin-top: var(--space-2); +} +.blocks > h1:first-child { + margin-top: var(--space-30); +} +@media (max-width: 500px) { + .blocks > h1 { + font-size: 1.8rem; + } + .blocks > h2 { + font-size: 1.3rem; + } + .blocks > h3 { + font-size: 1.1rem; + } + .blocks > h4, + .blocks > h5, + .blocks > h6 { + font-size: 1rem; + } +} +.blocks > p { + margin-top: 0; + margin-bottom: var(--space-4); +} +.blocks > ul, +.blocks > ol { + margin-top: 0; + margin-bottom: var(--space-4); + padding-left: var(--space-4); +} +.blocks > ul > li, +.blocks > ol > li { + line-height: 1.6; + margin-bottom: var(--space-1); +} +.blocks > ul > li > p, +.blocks > ol > li > p { + margin-bottom: var(--space-1); +} +.blocks > figure { + max-width: var(--block-text-wide-width); + margin: var(--space-7) auto; +} +.blocks > figure > figcaption { + text-align: center; + color: var(--grey); + margin-top: var(--space-3); + max-width: 87.5vw; + margin-left: auto; + margin-right: auto; +} + +.blocks > blockquote { + font-style: italic; + font-size: 1.4rem; + line-height: 1.5; + width: 87.5vw; + max-width: var(--block-text-wide-width); + margin: var(--space-4) auto var(--space-8) auto; +} +.blocks > blockquote > footer { + margin-top: var(--space-2); + color: var(--grey); + text-align: right; + font-size: 1rem; + line-height: 1.5; +} + +.blocks > p:last-child, +.blocks > ul:last-child, +.blocks > ol:last-child, +.blocks > figure:last-child, +.blocks > blockquote:last-child, +.blocks > .two-column-list:last-child, +.blocks > .text-and-list:last-child { + margin-bottom: var(--space-20); +} + +.blocks > .block-button { + justify-content: center; + margin-top: var(--space-8); + margin-bottom: var(--space-10); +} + +.blocks > hr { + height: 0.3em; + border: none; + background: var(--grey-light); + margin: var(--space-4) auto var(--space-8) auto; +} diff --git a/css/blocks/carousel.css b/css/blocks/carousel.css new file mode 100644 index 0000000..b874710 --- /dev/null +++ b/css/blocks/carousel.css @@ -0,0 +1,49 @@ +.carousel { + padding-top: var(--block-space); + padding-bottom: var(--block-space); +} +.carousel__title { + margin: 0; + margin-bottom: var(--space-5); +} +.carousel__more-link { + margin-top: var(--space-5); + margin-bottom: var(--space-5); +} +.carousel__more-link::after { + content: " →"; + position: relative; + font-size: 1.1em; + top: 0.05em; +} +@media (min-width: 800px) { + .carousel__more-link { + margin-top: 0; + } +} +.carousel__horizontal { + overflow-x: auto; + scroll-snap-type: x mandatory; + scroll-behavior: smooth; + overscroll-behavior-x: contain; + -webkit-overflow-scrolling: touch; /* iOS 12 snap bug fix */ + scrollbar-width: none; /* hide Firefox scrollbars */ +} +.carousel__horizontal::after { + /* this fixes the space after the last item not showing */ + content: ""; + display: block; + width: 1px; + height: 1px; +} +.carousel__horizontal::-webkit-scrollbar { + display: none; /* hide Chrome + Safari scrollbars */ +} +.carousel--bold { + --bg-color: var(--green); + --highlight-color: var(--white); +} +.carousel--bold .carousel__title { + font-family: var(--headline); + font-weight: var(--headline-bold); +} diff --git a/css/blocks/countdown.css b/css/blocks/countdown.css new file mode 100644 index 0000000..6bf2299 --- /dev/null +++ b/css/blocks/countdown.css @@ -0,0 +1,18 @@ +.countdown { + grid-column: 1 / -1; + padding-top: var(--block-space); + padding-bottom: var(--block-space); +} +.countdown--bold { + --bg-color: var(--green); + --highlight-color: var(--white); +} + +.countdown__text { + position: relative; + width: 87.5vw; + max-width: var(--block-text-wide-width); + margin-left: auto; + margin-right: auto; + text-align: center; +} diff --git a/css/blocks/events-preview.css b/css/blocks/events-preview.css new file mode 100644 index 0000000..57b92a9 --- /dev/null +++ b/css/blocks/events-preview.css @@ -0,0 +1,29 @@ +.events-preview { + grid-column: 1 / -1; + padding-top: var(--block-space); + padding-bottom: var(--block-space); + justify-items: center; +} +.events-preview--bold { + --bg-color: var(--green); + --highlight-color: var(--white); +} +.events-preview__title { + grid-row: 1; + margin: 0; + margin-bottom: var(--space-5); +} +.events-preview__more-link { + margin-top: var(--space-5); + margin-bottom: var(--space-5); +} +.events-preview__more-link::after { + content: " →"; + position: relative; + font-size: 1.1em; + top: 0.05em; +} +.events-preview--bold .events-preview__title { + font-family: var(--headline); + font-weight: var(--headline-bold); +} diff --git a/css/blocks/intro-with-columns.css b/css/blocks/intro-with-columns.css new file mode 100644 index 0000000..4f08a97 --- /dev/null +++ b/css/blocks/intro-with-columns.css @@ -0,0 +1,44 @@ +.intro-with-columns { + grid-column: 1 / -1; + grid-template-rows: var(--space-30); + width: 100%; + padding-bottom: var(--space-10); +} +.intro-with-columns__text-top, +.intro-with-columns__text-bottom { + grid-column: 2 / 16; +} +.intro-with-columns__text-top { + grid-row: 2; +} +.intro-with-columns__text-bottom { + margin-top: var(--space-2); +} +.intro__with-columns-right { + grid-column: 2 / 16; +} +@media (min-width: 800px) { + .intro-with-columns__text-top, + .intro-with-columns__text-bottom { + grid-column: 2 / 9; + } + .intro-with-columns__text-top { + grid-row: 2; + } + .intro-with-columns__text-bottom { + grid-row: 3; + } + .intro__with-columns-right { + grid-column: 10 / 16; + grid-row: 2 / span 2; + } +} +.intro-with-columns__images { + display: grid; + grid-template-columns: 1fr 1fr; + grid-gap: var(--space-2); + margin-bottom: var(--space-5); +} +.intro-with-columns__right-text p { + font-size: 0.8rem; +} diff --git a/css/blocks/intro-with-title.css b/css/blocks/intro-with-title.css new file mode 100644 index 0000000..092e3f6 --- /dev/null +++ b/css/blocks/intro-with-title.css @@ -0,0 +1,31 @@ +.intro-with-title { + grid-column: 1 / -1; + background-color: var(--green); + padding-bottom: calc(var(--diagonal-space) + var(--block-space) / 2); + margin-bottom: calc(var(--diagonal-space) + var(--block-space) / 2); + clip-path: polygon( + 0% 0%, + 100% 0, + 100% calc(100% - calc(var(--diagonal) / 2)), + 0% 100% + ); + z-index: -1; +} +.intro-with-title h1 { + padding-top: var(--space-30); +} + +.intro-with-title h1, +.intro-with-title__text { + width: 87.5vw; + margin-left: auto; + margin-right: auto; + max-width: var(--block-text-width); +} +.intro-with-title__text > p:last-child, +.intro-with-title__text > ul:last-child, +.intro-with-title__text > ol:last-child, +.intro-with-title__text > figure:last-child, +.intro-with-title__text > blockquote:last-child { + margin-bottom: 0; +} diff --git a/css/blocks/intro.css b/css/blocks/intro.css new file mode 100644 index 0000000..c55a599 --- /dev/null +++ b/css/blocks/intro.css @@ -0,0 +1,62 @@ +.intro { + background-color: #333; + margin-bottom: calc(var(--diagonal-space) - var(--block-space) / 2 + 30px); +} +.intro__background-image { + width: 100%; + object-fit: cover; + object-position: center 35%; + height: 52vh; +} +@media (min-width: 400px) { + .intro__background-image { + height: 68vh; + } +} +.intro__content { + position: relative; + padding-top: var(--space-6); + padding-bottom: var(--space-1); +} +.intro__headline { + margin: 0; + margin-bottom: var(--space-5); + font-size: calc(0.5rem + 4vw); +} +@media (min-width: 900px) { + .intro__headline { + font-size: 2.4rem; + } +} +.intro__text { + margin: 0; + margin-bottom: var(--space-5); + font-size: calc(0.5rem + 2vw); + line-height: 1.5; +} +@media (min-width: 1000px) { + .intro__text { + font-size: 1.4rem; + } +} +.intro__social-networks { + list-style: none; + margin: 0; + padding: 0; + width: 100%; + max-width: 320px; +} +.intro__social-network { + width: 24px; + transition: transform 0.2s; +} +@media (min-width: 500px) { + .intro__social-network { + width: 32px; + } +} +.intro__social-network:hover, +.intro__social-network:focus { + transform: scale(1.2); +} + diff --git a/css/blocks/logo-wall.css b/css/blocks/logo-wall.css new file mode 100644 index 0000000..fe81ef3 --- /dev/null +++ b/css/blocks/logo-wall.css @@ -0,0 +1,28 @@ +.logo-wall { + padding-top: calc(var(--block-space) / 2); + padding-bottom: var(--block-space); +} + +.logo-wall__headline { + margin-bottom: var(--space-10); + text-align: center; + font-size: 1rem; + font-family: var(--text); + font-weight: var(--text-bold); + color: var(--grey); +} + +.logo-wall__images { + grid-column: 2 / -2; + display: grid; + column-gap: var(--space-8); + row-gap: var(--space-8); + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); + justify-items: center; + align-items: center; + margin-bottom: var(--space-8); +} + +.logo-wall__image { + max-width: 200px; +} diff --git a/css/blocks/text-and-image.css b/css/blocks/text-and-image.css new file mode 100644 index 0000000..bf367a9 --- /dev/null +++ b/css/blocks/text-and-image.css @@ -0,0 +1,55 @@ +.text-and-image { + grid-column: 1 / -1; + padding-top: var(--block-space); + padding-bottom: var(--block-space); +} +.text-and-image__text { + margin-bottom: var(--space-8); +} +.text-and-image__images { + --columns: 3; + display: grid; + grid-template-columns: repeat(var(--columns), 1fr); + grid-gap: var(--space-2); + align-content: flex-start; + justify-self: center; +} +@media (min-width: 900px) { + .text-and-image { + grid-template-rows: auto 1fr; + } + .text-and-image__headline { + grid-column: 2 / 9; + } + .text-and-image__text { + margin-bottom: 0; + grid-column: 2 / 9; + } + .text-and-image__images { + grid-column: 10 / -2; + grid-row: 1 / 3; + grid-gap: var(--space-1); + } +} +.text-and-image__links { + display: flex; + list-style: none; + margin: 0; + padding: 0; +} +.text-and-image__links li:before { + display : none; +} +.text-and-image__links li:not(:last-child) .link { + margin-right: 2rem; +} +.text-and-image--bold { + --bg-color: var(--green); + --highlight-color: var(--white); + padding-top: var(--space-10); + padding-bottom: var(--space-10); +} +.text-and-image--bold .text-and-image__headline { + font-family: var(--headline); + font-weight: var(--headline-bold); +} diff --git a/css/blocks/text-and-list.css b/css/blocks/text-and-list.css new file mode 100644 index 0000000..67e1729 --- /dev/null +++ b/css/blocks/text-and-list.css @@ -0,0 +1,26 @@ +.text-and-list { + grid-column: 1 / -1; + padding-top: calc(var(--block-space) / 2); + padding-bottom: calc(var(--block-space) / 2); +} +.text-and-list__list { + margin-top: var(--space-4); + margin-bottom: var(--space-4); + padding-top: var(--space-5); + padding-bottom: var(--space-5); + border-top: 4px solid var(--black); + word-break: break-word; +} +@media (min-width: 900px) { + .text-and-list__headline { + grid-column: 2 / 11; + } + .text-and-list__text { + grid-column: 2 / 11; + } + .text-and-list__list { + margin-top: 0; + grid-row: 1 / 3; + grid-column: 12 / -2; + } +} diff --git a/css/blocks/text-and-steps.css b/css/blocks/text-and-steps.css new file mode 100644 index 0000000..6843794 --- /dev/null +++ b/css/blocks/text-and-steps.css @@ -0,0 +1,88 @@ +.text-and-steps { + grid-column: 1 / -1; + row-gap: var(--space-8); + padding-top: calc(var(--block-space) / 2); + padding-bottom: calc(var(--block-space) / 2); +} +.text-and-steps__steps { + margin-top: var(--space-4); + margin-bottom: var(--space-4); + padding-bottom: var(--space-5); +} + +.text-and-steps__steps ol { + list-style: none; + margin: 0; + padding: 0; + counter-reset: text-and-steps; +} +.text-and-steps__steps ol li { + display: flex; + align-items: baseline; + margin-bottom: var(--space-2); + counter-increment: text-and-steps; +} +.text-and-steps__steps ol li::before { + display: flex; + justify-content: center; + align-items: center; + flex-shrink: 0; + margin-right: var(--space-3); + color: var(--blue); + content: counter(text-and-steps); + width: 38px; + height: 38px; + font-size: 1.2rem; + font-family: var(--text); + font-weight: var(--text-bold); + border: 2px solid currentColor; + border-radius: 100%; +} + +.text-and-steps__steps li code { + display: inline-block; + margin-bottom: var(--space-1); + font-family: var(--text); + font-weight: var(--text-semi-bold); + font-size: 1rem; +} + +.text-and-steps__buttons { + display: flex; + flex-direction: column; + margin-top: var(--space-4); + align-items: center; +} +.text-and-steps__buttons > * { + margin-bottom: var(--space-4); +} + +@media (min-width: 500px) { + .text-and-steps__steps ol li::before { + font-size: 1.2rem; + width: 40px; + height: 40px; + } +} + +@media (min-width: 900px) { + .text-and-steps__text { + grid-column: 2 / 9; + } + .text-and-steps__buttons { + flex-direction: row; + justify-content: flex-start; + align-items: baseline; + } + .text-and-steps__buttons > * { + margin-bottom: 0; + flex-shrink: 0; + } + .text-and-steps__buttons > :first-child { + margin-right: var(--space-4); + } + .text-and-steps__steps { + margin-top: 0; + grid-column: 10 / -2; + } +} diff --git a/css/blocks/two-column-list.css b/css/blocks/two-column-list.css new file mode 100644 index 0000000..4e42edd --- /dev/null +++ b/css/blocks/two-column-list.css @@ -0,0 +1,12 @@ +.two-column-list { + width: 87.5vw; + margin: var(--space-4) auto; + padding-top: calc(var(--block-space) / 2); + padding-bottom: calc(var(--block-space) / 2); + max-width: var(--block-text-width); + border-top: 4px solid var(--black); +} + +.two-column-list h3 { + margin-bottom: var(--space-5); +} \ No newline at end of file diff --git a/css/blocks/youtube.css b/css/blocks/youtube.css new file mode 100644 index 0000000..a7f8365 --- /dev/null +++ b/css/blocks/youtube.css @@ -0,0 +1,72 @@ +.youtube { + grid-column: 1 / -1; + padding-top: var(--space-10); + padding-bottom: var(--space-10); +} + +.youtube__headline, +.youtube__container, +.youtube__text { + width: 87.5vw; + margin-left: auto; + margin-right: auto; +} + +.youtube__headline { + margin-bottom: var(--space-7); +} +@media (min-width: 600px) { + .youtube__headline { + text-align: center; + max-width: var(--block-text-width); + } +} + +.youtube__container, +.youtube__text { + max-width: var(--block-text-wide-width); +} + +.youtube__play-button { + position: absolute; + top: calc(50% - 30px); + left: calc(50% - 30px); + display: block; + width: 60px; + height: 60px; + transform: scale(1); + transition: transform 0.2s; +} +@media (min-width: 600px) { + .youtube__play-button { + top: calc(50% - 60px); + left: calc(50% - 60px); + width: 120px; + height: 120px; + } +} + +.youtube__video:hover .youtube__play-button { + transform: scale(1.1); +} + +.youtube__video { + position: relative; + display: block; + height: 0; + margin-bottom: var(--space-7); + padding-bottom: 56.25%; +} +.youtube__thumbnail, +.youtube__video--playing iframe { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.intro + .youtube { + padding-top: var(--space-20); + padding-bottom: 0; +} diff --git a/css/calendar.css b/css/calendar.css new file mode 100644 index 0000000..880c01d --- /dev/null +++ b/css/calendar.css @@ -0,0 +1,122 @@ +.calendar ul.dates { + list-style-type : none; + overflow-y : scroll; + overflow-x : visible; + padding-right : 0px; + padding-left : 0px; + position : relative; +} +.calendar:not(.noGrayout) ul.dates { + max-height : 400px; + mask-image : linear-gradient(black 80%, transparent 100%); +} +.calendar.noGrayout ul.dates { + overflow-y : visible; +} +.calendar ul.dates li:before { display : none; } +.calendar ul.dates li:after { + content : ''; + clear : both; + display : block; + margin-bottom : 10px; +} +.calendar ul.dates li.nowLine { + border-top : 2px solid black; + padding-top : 10px; +} +.calendar ul.dates li.cancelled { + opacity : 0.5; +} +.calendar:not(.noGrayout) ul.dates li.passed { + color : gray; +} +.calendar:not(.noGrayout) ul.dates li.passed a { + color : gray; +} +.calendar .split { + display : table-row; +} +.calendar .split .left { + display : table-cell; + min-height : 1em; + border-right : 2px solid gray; + margin-right : -2px; + padding-right : 10px; + font-size : 1.5em; + white-space : nowrap; +} +.calendar .split .right { + display : table-cell; + padding-left : 10px; + white-space : normal; +} +.calendar ul.dates .time:before { content : "\A"; white-space : pre; } +.calendar ul.dates .time:after { content : " Uhr"; } +.calendar ul.dates .title { font-weight : bold; } +.calendar ul.dates .location:before { content : "\A"; white-space : pre; } +.calendar ul.dates .location { font-style : italic; } +.calendar ul.dates .description:before { content : "\A"; white-space : pre; } +.calendar ul.dates .protokoll { + background-image:url('PDF.png'); + background-repeat:no-repeat; + background-size:15px 19px; + padding-left:17px; + margin-left:3px; + font-weight:bold; + line-height:25px; +} +.calendar ul.dates a { + color : black; + text-decoration : none; + display : block; + border-bottom : 0px none transparent !important; +} +.calendar ul.dates a:link { background-color : transparent; } +.calendar ul.dates a:visited { background-color : transparent; } +.calendar ul.dates a:hover { background-color : #AFA; } +.calendar ul.dates a:active { background-color : #0F0; } +.calendar form { + vertical-align : top; + display : inline-block; + border-left : 1px solid gray; + border-right : 1px solid gray; + margin-right : -1px; + padding : 3px; +} +.calendar p a { + cursor : help; +} +.calendar a.button { + margin-right : 10px; +} +.calendar a.earlierDatesLink { + margin-left : 30px; + margin-bottom : 30px; +} +.calendar .radioRow label { + margin-right : 1em; +} +.calendar .filterList label { + display : block; +} + +@media handheld, screen and (max-width: 650px) { + .calendar .split .left { + font-size : 1.3em; + } +} + +@media handheld, screen and (max-width: 560px) { + .calendar .split { + display : block; + } + .calendar .split .left { + display : block; + border-right : 0px none transparent; + font-size : 1.3em; + } + .calendar .split .right { + display : block; + padding-left : 0px; + } +} diff --git a/css/config/diagonal.css b/css/config/diagonal.css new file mode 100644 index 0000000..211c714 --- /dev/null +++ b/css/config/diagonal.css @@ -0,0 +1,3 @@ +.diagonal { + position: relative; +} diff --git a/css/config/fonts.css b/css/config/fonts.css new file mode 100644 index 0000000..c166e9e --- /dev/null +++ b/css/config/fonts.css @@ -0,0 +1,155 @@ +/* Webfont: Lato-Thin */ +@font-face { + font-family: "Lato"; + src: url("/assets/fonts/lato/Lato-Thin.eot"); /* IE9 Compat Modes */ + src: url("/assets/fonts/lato/Lato-Thin.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ + url("/assets/fonts/lato/Lato-Thin.woff2") format("woff2"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-Thin.woff") format("woff"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-Thin.ttf") format("truetype"); + font-style: normal; + font-weight: 200; + text-rendering: optimizeLegibility; +} + +/* Webfont: Lato-ThinItalic */ +@font-face { + font-family: "LatoWebThin"; + src: url("/assets/fonts/lato/Lato-ThinItalic.eot"); /* IE9 Compat Modes */ + src: url("/assets/fonts/lato/Lato-ThinItalic.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ + url("/assets/fonts/lato/Lato-ThinItalic.woff2") format("woff2"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-ThinItalic.woff") format("woff"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-ThinItalic.ttf") format("truetype"); + font-style: italic; + font-weight: 200; + text-rendering: optimizeLegibility; +} + +/* Webfont: Lato-Light */ +@font-face { + font-family: "Lato"; + src: url("/assets/fonts/lato/Lato-Light.eot"); /* IE9 Compat Modes */ + src: url("/assets/fonts/lato/Lato-Light.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ + url("/assets/fonts/lato/Lato-Light.woff2") format("woff2"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-Light.woff") format("woff"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-Light.ttf") format("truetype"); + font-style: normal; + font-weight: 300; + text-rendering: optimizeLegibility; +} + +/* Webfont: Lato-LightItalic */ +@font-face { + font-family: "Lato"; + src: url("/assets/fonts/lato/Lato-LightItalic.eot"); /* IE9 Compat Modes */ + src: url("/assets/fonts/lato/Lato-LightItalic.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ + url("/assets/fonts/lato/Lato-LightItalic.woff2") format("woff2"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-LightItalic.woff") format("woff"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-LightItalic.ttf") format("truetype"); + font-style: italic; + font-weight: 300; + text-rendering: optimizeLegibility; +} + +/* Webfont: Lato-Medium */ +@font-face { + font-family: "Lato"; + src: url("/assets/fonts/lato/Lato-Medium.eot"); /* IE9 Compat Modes */ + src: url("/assets/fonts/lato/Lato-Medium.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ + url("/assets/fonts/lato/Lato-Medium.woff2") format("woff2"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-Medium.woff") format("woff"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-Medium.ttf") format("truetype"); + font-style: normal; + font-weight: 400; + text-rendering: optimizeLegibility; +} + +/* Webfont: Lato-MediumItalic */ +@font-face { + font-family: "Lato"; + src: url("/assets/fonts/lato/Lato-MediumItalic.eot"); /* IE9 Compat Modes */ + src: url("/assets/fonts/lato/Lato-MediumItalic.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ + url("/assets/fonts/lato/Lato-MediumItalic.woff2") format("woff2"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-MediumItalic.woff") format("woff"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-MediumItalic.ttf") format("truetype"); + font-style: italic; + font-weight: 400; + text-rendering: optimizeLegibility; +} + +/* Webfont: Lato-Semibold */ +@font-face { + font-family: "Lato"; + src: url("/assets/fonts/lato/Lato-Semibold.eot"); /* IE9 Compat Modes */ + src: url("/assets/fonts/lato/Lato-Semibold.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ + url("/assets/fonts/lato/Lato-Semibold.woff2") format("woff2"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-Semibold.woff") format("woff"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-Semibold.ttf") format("truetype"); + font-style: normal; + font-weight: 600; + text-rendering: optimizeLegibility; +} + +/* Webfont: Lato-SemiboldItalic */ +@font-face { + font-family: "Lato"; + src: url("/assets/fonts/lato/Lato-SemiboldItalic.eot"); /* IE9 Compat Modes */ + src: url("/assets/fonts/lato/Lato-SemiboldItalic.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ + url("/assets/fonts/lato/Lato-SemiboldItalic.woff2") format("woff2"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-SemiboldItalic.woff") format("woff"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-SemiboldItalic.ttf") format("truetype"); + font-style: italic; + font-weight: 600; + text-rendering: optimizeLegibility; +} + +/* Webfont: Lato-Bold */ +@font-face { + font-family: "Lato"; + src: url("/assets/fonts/lato/Lato-Bold.eot"); /* IE9 Compat Modes */ + src: url("/assets/fonts/lato/Lato-Bold.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ + url("/assets/fonts/lato/Lato-Bold.woff2") format("woff2"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-Bold.woff") format("woff"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-Bold.ttf") format("truetype"); + font-style: normal; + font-weight: 700; + text-rendering: optimizeLegibility; +} + +/* Webfont: Lato-BoldItalic */ +@font-face { + font-family: "Lato"; + src: url("/assets/fonts/lato/Lato-BoldItalic.eot"); /* IE9 Compat Modes */ + src: url("/assets/fonts/lato/Lato-BoldItalic.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ + url("/assets/fonts/lato/Lato-BoldItalic.woff2") format("woff2"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-BoldItalic.woff") format("woff"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-BoldItalic.ttf") format("truetype"); + font-style: italic; + font-weight: 700; + text-rendering: optimizeLegibility; +} + +/* Webfont: Lato-Black */ +@font-face { + font-family: "Lato"; + src: url("/assets/fonts/lato/Lato-Black.eot"); /* IE9 Compat Modes */ + src: url("/assets/fonts/lato/Lato-Black.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ + url("/assets/fonts/lato/Lato-Black.woff2") format("woff2"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-Black.woff") format("woff"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-Black.ttf") format("truetype"); + font-style: normal; + font-weight: 800; + text-rendering: optimizeLegibility; +} + +/* Webfont: Lato-BlackItalic */ +@font-face { + font-family: "Lato"; + src: url("/assets/fonts/lato/Lato-BlackItalic.eot"); /* IE9 Compat Modes */ + src: url("/assets/fonts/lato/Lato-BlackItalic.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */ + url("/assets/fonts/lato/Lato-BlackItalic.woff2") format("woff2"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-BlackItalic.woff") format("woff"), /* Modern Browsers */ + url("/assets/fonts/lato/Lato-BlackItalic.ttf") format("truetype"); + font-style: italic; + font-weight: 800; + text-rendering: optimizeLegibility; +} diff --git a/css/config/grid.css b/css/config/grid.css new file mode 100644 index 0000000..a3264e2 --- /dev/null +++ b/css/config/grid.css @@ -0,0 +1,9 @@ +.grid { + display: grid; + grid-template-columns: + minmax(var(--grid-gutter), 1fr) repeat(14, minmax(20px, 80px)) + minmax(var(--grid-gutter), 1fr); +} +.grid > * { + grid-column: 2 / -2; +} \ No newline at end of file diff --git a/css/config/reset.css b/css/config/reset.css new file mode 100644 index 0000000..aeb109c --- /dev/null +++ b/css/config/reset.css @@ -0,0 +1,39 @@ +* { + box-sizing: border-box; +} + +html { + font-family: var(--text); + background: var(--white); + font-size: 16px; +} +@media (min-width: 500px) { + html { + font-size: 20px; + } +} + +body { + margin: 0; + display: flex; + flex-direction: column; +} +@media (min-width: 500px) { + body { + min-height: 100vh; + } +} + +main { + min-height: 61.8vh; +} + +img, +svg { + vertical-align: middle; + max-width: 100%; +} + +figure { + margin: 0; +} \ No newline at end of file diff --git a/css/config/variables.css b/css/config/variables.css new file mode 100644 index 0000000..aa3df12 --- /dev/null +++ b/css/config/variables.css @@ -0,0 +1,49 @@ +:root { + /* fonts */ + --headline: "Linux Biolinum"; + --text: "Linux Biolinum"; + + /* font weights */ + --headline-extrabold: 800; + --text-regular: 400; + --text-semi-bold: 600; + --text-bold: 700; + + /* colors */ + --white: #fff; + --black: #000; + --grey-light: #efebdc; + --grey: #808080; + + --blue: #00aff0; + --green: #bedc0a; + + /* units */ + --base: 6px; + --grid-gutter: 6.25vw; + + --space-1: var(--base); + --space-2: calc(var(--base) * 2); + --space-3: calc(var(--base) * 3); + --space-4: calc(var(--base) * 4); + --space-5: calc(var(--base) * 5); + --space-6: calc(var(--base) * 6); + --space-7: calc(var(--base) * 7); + --space-8: calc(var(--base) * 8); + --space-10: calc(var(--base) * 9); + --space-15: calc(var(--base) * 10); + --space-20: calc(var(--base) * 11); + --space-30: calc(var(--base) * 12); + + --block-space: var(--space-15); + --block-text-width: 800px; + --block-text-wide-width: 800px; + + --diagonal: 5vw; + --diagonal-space: calc(var(--diagonal) / 2); +} +@media (min-width: 800px) { + :root { + --base: 8px; + } +} diff --git a/css/default.css b/css/default.css new file mode 100755 index 0000000..f81e048 --- /dev/null +++ b/css/default.css @@ -0,0 +1,633 @@ +@font-face { + font-family: "Perspective Sans"; + src: url("fonts/PerspectiveSans-Regular.otf"); +} +@font-face { + font-family: "Perspective Sans"; + src: url("fonts/PerspectiveSans-Italic.otf"); + font-style: italic; +} +@font-face { + font-family: "Perspective Sans"; + src: url("fonts/PerspectiveSans-Bold.otf"); + font-weight: bold; +} +@font-face { + font-family: "Perspective Sans"; + src: url("fonts/PerspectiveSans-BoldItalic.otf"); + font-weight: bold; + font-style: italic; +} +@font-face { + font-family: "Perspective Sans"; + src: url("fonts/PerspectiveSans-Black.otf"); + font-weight: 900; +} +@font-face { + font-family: "Perspective Sans"; + src: url("fonts/PerspectiveSans-BlackItalic.otf"); + font-weight: 900; + font-style: italic; +} + +@font-face { + font-family: "Linux Biolinum"; + src: url("fonts/LinBiolinum_R.otf"); +} +@font-face { + font-family: "Linux Biolinum"; + src: url("fonts/LinBiolinum_RI.otf"); + font-style: italic; +} +@font-face { + font-family: "Linux Biolinum"; + src: url("fonts/LinBiolinum_RB.otf"); + font-weight: bold; +} + + +body { + font-size : 1.2em; + font-family : "Linux Biolinum"; + font-weight: 400; + color : #404040; + line-height : 1.5em; +} + +body, .body { + padding-left : 2em; + padding-right : 2em; + padding-top : 1.5em; + padding-bottom : 1.5em; +} + +body.commented { + padding-left : 2em; + padding-right : 240px; +} + +a { + color : #00aff0; + text-decoration : underline; +} +a:link { } +a:visited { color : #306080; } +a:focus { } +a:hover { color : #1da64a; text-decoration : underline; } +a:active { color : #1da64a; text-decoration : underline; } + +a.button { + color : white; + background-color : #00aff0; + padding : 4px; + font-weight : bold; + text-decoration : none; + position : relative; + top : 0px; + left : 0px; + right : 4px; + bottom : 4px; + box-shadow: 4px 4px 0px 0px rgba(0, 0, 0, 0.2); +} + +a.button:link { } +a.button:visited { } +a.button:focus { } +a.button:hover { background-color : #bedc0a; } +a.button:active { + background-color : #bedc0a; + box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0.2); + top : 4px; + left : 4px; + right : 0px; + bottom : 0px; +} +a.button.active { + background-color : black; + cursor : default; +} + +p { + margin-top : 0.1em; + margin-bottom : 0.5em; + text-align : justify; +} + +hr { + margin-top : 5px; + margin-bottom : 5px; + border : 0px none transparent; + height : 30px; + background-color : transparent; + background-image : url("../../media/logos/logo-A4.svg"); + background-size : 30px 21px; + background-repeat : no-repeat; + background-position : center; +} +hr:before, hr:after { + content : ''; + height : 2px; + width : calc(50% - 100px); + background-color : #bedc0a; + margin-top : 14px; +} +hr:before { + float : left; + margin-left : 50px; +} +hr:after { + float : right; + margin-right : 50px; +} + +h1 { + font-size : 1.8em; + padding : 0px; + margin-top : 1.2em; +} +h2 { + font-size : 1.5em; + padding : 0px; + margin-top : 1em; + margin-bottom : 0.14em; + text-decoration : underline; +} +h3 { + font-size : 1.3em; + padding : 0px; + margin-top : 0.6em; + margin-bottom : 0.12em; +} +h4 { + font-size : 1.1em; + padding : 0px; + margin-top : 0.4em; + margin-bottom : 0.1em; +} + + +ul { + padding-left : 1.5em; +} + +ul li { + margin-bottom : 0.5em; + list-style-type : none; +} +ul li:before { + content : ''; + float : left; + width : 1.5em; + height : 1.2em; + vertical-align : top; + margin : 0px; + padding : 0px; + margin-left : -1.5em; + background-image : url('../images/Stichpunkt.svg'); + background-repeat : no-repeat; + background-size : 0.8em 0.6em; + background-position : center bottom; +} + +blockquote { + position : relative; + padding : 0px; + padding-left : 1em; + margin : 0px; + text-align : justify; +} +blockquote:before { + content : '\201C'; + display : block; + position : absolute; + width : 0.4em; + left : 0px; + top : 3px; + bottom : 0px; + font-size : 2em; + font-weight : bold; + line-height : 0.2em; + box-sizing : border-box; + padding-top : 0.5em; + margin-bottom : 0.2em; + text-align : left; + background-color : #efebdc; +} + +sub { + line-height : 0.4em; +} + +table { + border-collapse : collapse; +} + +table td { + border : 1px solid gray; + padding : 3px; +} +table th { + padding : 1px; + vertical-align : bottom; +} +table.thborder th { + border : 1px solid gray; + padding: 3px; +} + +.accepted { + background-color: #CFC; +} +.rejected { + background-color: #FCC; +} + +img.rejected { + border: 8px solid #FCC; +} + +acceptance { + display: none; +} + +commentnote { + z-index: 1; + width: 0px; + height: 0px; + float: left; + margin-right: 0px; + margin-left: 0px; + position : relative; + white-space : pre-wrap; +} + +commentnote div { + counter-increment: comment; + position : absolute; + right : calc(-100vw + 75px); + top : 0px; + max-height : 100px; + width : 200px; + overflow : hidden; + background-color: #FFA; + border : 2px solid #DA5; + font-size: 17px; + font-weight: normal; + text-decoration: none; +} + +commentnote.redaction div { + background-color: #CCF; +} +commentnote.accepted div { + background-color: #CFC; +} +commentnote.rejected div { + background-color: #FCC; +} +commentnote:hover { + z-index: 2; +} +commentnote:hover div { + max-height: 80vh; + min-height: 100px; + width: 80vw; + right : calc(-100vw + 95px); +} + +commentnote:before { + content : ''; + position : absolute; + display : block; + height : 2px; + background-color: #DA5; + width : calc(100vw - 275px); + left : calc(0px); +} + +.footnotelink { + font-size : 0.7em; + font-weight : bold; + line-height : 0.6em; +} +.footnotelink a:before { + content : '['; +} +.footnotelink a:after { + content : ']'; +} +.footnotelink a { + text-decoration : none; +} + +footnote, .footnote { + display : none; +} + +#footer footnote, #footer .footnote { + display : block; + padding-left : 3em; + font-size : 0.9em; + margin-bottom : 0.4em; +} + +#footer footnote .number, #footer .footnote .number { + margin-left : -3em; + display : inline-block; + width : 2.5em; + text-align : right; + padding-right : 0.5em; +} + +#footer footnote.active, #footer .footnote.active { + background-color : #efebdc; +} + +.videolink { + float : right; + margin : 4px; + width : 80px; + height : 40px; + background-image : url('kamera.svg'); + background-size : contain; + background-repeat : no-repeat; +} +.videolink:link { } +.videolink:visited { } +.videolink:focus { } +.videolink:hover { width : 88px; height : 48px; margin : 0px; } +.videolink:active { width : 88px; height : 48px; margin : 0px; } +.videolink.left { + float : left; +} + + +body .calendar ul.dates a { + color : #3f3f3f; +} + +div.video-js { + width : 100%; + height : 100%; + overflow : hidden; +} + +.video-next-but, .video-prev-but { + position : absolute; + top : -50px; + color : white; + border : 1px solid white; + padding : 4px; + border-radius : 2px; + font-weight : bold; + font-size : 15px; + text-decoration : none; + z-index : 1; +} + +.video-next-but { right : 0px; } +.video-prev-but { left : 0px; } + +.video-next-but:hover, .video-prev-but:hover { + color : white; + text-decoration : none; +} + +.vjs-menu-button-popup { + background-image : url('Zahnrad.svg'); + background-size : contain; + background-repeat : no-repeat; + background-position : center; + z-index : 2; +} + +.vjs-menu-button-popup div.vjs-menu { + left : auto; + right : 0px; +} + + +.figure { + float : right; + width : 40%; + padding : 10px; + margin-left : 20px; + border : 1px solid #008bd0; + position : relative; + font-size : 0.9em; +} +.figure img { + width : 100%; +} + + +svg * { + font-family : 'Linux Biolinum'; +} + +body .JSW.OuterBox .JSW.Title, body .video-js { + font-family : 'Perspective Sans'; +} + + + +ol.faq { + counter-reset : faq; + padding-left : 1.3em; +} + +ol.faq li { + list-style-type : none; + background-color : #efebdc; + padding : 3px; + margin-bottom : 6px; +} + +ol.faq li b { + display : block; + cursor : s-resize; +} + +ol.faq li b:before { + counter-increment : faq; + content : counter(faq) ". "; +} + +ol.faq li.open b { + cursor : n-resize; +} + +ol.faq li:before { + content : ''; + float : left; + width : 1.3em; + height : 1.2em; + vertical-align : top; + margin : 0px; + padding : 0px; + margin-left : -1.3em; + background-image : url('../images/Stichpunkt.svg'); + background-repeat : no-repeat; + background-size : 0.8em 0.6em; + background-position : left bottom; + transform : rotate(0deg); + transition : transform 0.8s; + transform-origin : 0.5em 1em; +} + +ol.faq li.open:before { + transform : rotate(45deg); +} + +ol.faq li .compressing { + overflow: hidden; + transition : 0.5s; +} +ol.faq li.open .compressing { + height : 0px !important; +} + +ol.faq li .expanding { + max-height : 0px; + overflow : hidden; + margin-bottom : 0px; + transition : 0.5s; + transition-timing-function: linear(0, 0.9, 0.96, 0.975, 0.983, 0.99, 0.995, 1); +} + +ol.faq li.open .expanding { + max-height : 10000px; + margin-bottom : inherit; + transition : 1s; + transition-timing-function: linear(0, 0.005, 0.01, 0.017, 0.025, 0.04, 0.1, 1); +} + +ol.faq li .expanding:last-child { + margin-bottom : 0px; +} + + +.carousel-item, .collection-items__item { + display: inline-block; + padding: 5px; + padding-bottom: calc(1.2em + 5px); + margin-right: 0px; + width: 26vw; + max-width: 350px; + min-width: 230px; + background-color: #efebdc; + border: 3px solid #bedc0a; + text-decoration: none; + color : black; + position : relative; +} +.carousel-item:hover, .collection-items__item:hover { + border-color : #00aff0; + color : black; + text-decoration : none; +} +.carousel-item:active, .collection-items__item:active { + color : black; + text-decoration : none; +} +.carousel-item img, .collection-items__item img { + width: 100%; +} +.carousel-item b, .collection-items__item b { + font-size: 1.2em; + display: block; +} +.collection-items { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; +} +.collection-items .collection-items__item { + margin-bottom: 20px; +} + +.carousel__horizontal { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: flex-start; + overflow-x: scroll; + -ms-overflow-style: none; + scrollbar-width: none; +} +.carousel__horizontal::-webkit-scrollbar { + display : none; +} + +.carousel__horizontal .carousel-item { + margin-right: 20px; +} + +.collection-items h2 { + font-size: 1.3em; + text-decoration: none; + margin-top: 5px; +} + +.collection-items time { + font-size: 1.2em; + color: #444; + position: absolute; + bottom: 5px; + right: 5px; + font-style: italic; + font-weight: bold; +} + +.collection__list { + padding: 0px; + text-align: center; +} +.collection__list li { + display: inline-block; + margin-right : 20px; +} +.collection__list li:before { + display: none; +} + +.text-intro-image, .text-and-image__image, .event-intro__image { + display: block; + width: 80%; + margin-left: 10%; +} + +aside { + float: right; + margin-left: 10px; + width: 30%; + border: 1px solid gray; + padding: 5px; +} + +.event-intro__meta { + margin-bottom: 20px; +} + + + +.dateList { + list-style-type : none; +} +.dateList .date { + font-weight : bold; +} +.dateList .date:after { + content : ': '; +} + +.categoryList { + text-align: center; + margin-top: 10px; + margin-bottom: 30px; +} +.categoryList .button { + margin-right: 20px; +} + diff --git a/css/default/windows.css b/css/default/windows.css new file mode 100644 index 0000000..6d74bf4 --- /dev/null +++ b/css/default/windows.css @@ -0,0 +1,238 @@ +.JSW.OuterBox { + padding-top : 22px; + padding-left : 2px; + padding-right : 2px; + padding-bottom : 2px; + min-width : 100px; + min-height : 50px; + background-color : #BBB; +} +.JSW.OuterBox.active { background-color : #888; } + +.JSW .InnerBox { + box-sizing : border-box; + position : relative; + width : 100%; + height : 100%; + border-right : 4px none transparent; + border-bottom : 24px none transparent; + overflow : auto; + background-color : #FFF +} +.JSW.autoheight .InnerBox { + height : auto; + border-bottom : 0px none transparent; +} +.JSW.autowidth .InnerBox { + width : auto; + border-right : 0px none transparent; +} +.JSW.maximized .InnerBox { + width : 100%; + height : 100%; + border-right : 4px none transparent; + border-bottom : 24px none transparent; +} + + +.JSW.FrameCover { + position : absolute; + top : 22px; + left : 2px; + right : 2px; + bottom : 2px; + background-color : transparent; +} + +.JSW.Disabled { + position : absolute; + top : 0px; + left : 0px; + right : 0px; + bottom : 0px; +} + +.JSW.Bar { + position : absolute; + top : 2px; + left : 5px; + right : 5px; + cursor : default; + height : 20px; + white-space : nowrap; + line-height : 18px; + color : #FFF; + font-size : 12px; + font-family : Arial; + font-weight : bold; +} + +.JSW .JSW.Icon { + height : 1em; + width : 1em; + display : inline; + margin-right : 4px; +} + +.JSW.OuterBox .JSW.Title { + margin : 0px; + vertical-align : top; +} + +.JSW.Buttons { + position : absolute; + top : 0px; + right : 0px; +} +.JSW.Buttons a { + cursor : default; + color : #FFF; + display : inline-block; + padding : 0px; + height : 18px; + width : 18px; + margin-top : 1px; + margin-left : 1px; + vertical-align : top; + background-color : #444; + text-align : center; + text-decoration : none; +} + +.JSW.ButtonClose:before { content : 'X'; } +.JSW.ButtonMinimize:before { content : '\2581'; } +.JSW.ButtonMaximize:before { content : '\25AD'; } +.JSW.ButtonExclude:before { content : '\2594'; } + +.JSW.Buttons.nonexcludable .ButtonExclude { display : none; } +.JSW.Buttons.nonminimizable .ButtonMinimize { display : none; } +.JSW.Buttons.nonmaximizable .ButtonMaximize { display : none; } +.JSW.Buttons.nonclosable .ButtonClose { display : none; } + +.JSW.BarExtension { + position : absolute; + top : 22px; + left : 2px; + right : 2px; + overflow : hidden; + height : 0px; + background : #1A991A; + background : var(--low-color); +} +.JSW.active .BarExtension { + background : #0E9A0E; + background : var(--active-low-color); +} + + +.JSW.BorderTop { + position : absolute; + top : 0px; + left : 5px; + right : 5px; + cursor : n-resize; + height : 0px; + border-top : 2.1px solid #444; +} +.JSW.nonresizable .BorderTop { cursor : default; } + +.JSW.BorderBottom { + position : absolute; + bottom : 0px; + left : 5px; + right : 5px; + cursor : n-resize; + height : 0px; + border-top : 2.1px solid #444; +} +.JSW.nonresizable .BorderBottom { cursor : default; } + +.JSW.BorderRight { + position : absolute; + top : 22px; + right : 0px; + bottom : 5px; + cursor : e-resize; + width : 0px; + border-left : 2.1px solid #444; +} +.JSW.nonresizable .BorderRight { cursor : default; } + +.JSW.BorderLeft { + position : absolute; + bottom : 5px; + left : 0px; + top : 22px; + cursor : e-resize; + width : 0px; + border-right : 2.1px solid #444; +} +.JSW.nonresizable .BorderLeft { cursor : default; } + +.JSW.EdgeTopLeft { + position : absolute; + top : 0px; + left : 0px; + cursor : nw-resize; + width : 5px; + height : 22px; + border-top : 2.1px solid #444; + border-left : 2.1px solid #444; +} +.JSW.nonresizable .EdgeTopLeft { cursor : default; } + +.JSW.EdgeTopRight { + position : absolute; + top : 0px; + right : 0px; + cursor : ne-resize; + width : 5px; + height : 22px; + border-top : 2.1px solid #444; + border-right : 2.1px solid #444; +} +.JSW.nonresizable .EdgeTopRight { cursor : default; } + +.JSW.EdgeBottomLeft { + position : absolute; + bottom : 0px; + left : 0px; + cursor : ne-resize; + width : 5px; + height : 5px; + border-bottom : 2.1px solid #444; + border-left : 2.1px solid #444; +} +.JSW.nonresizable .EdgeBottomLeft { cursor : default; } + +.JSW.EdgeBottomRight { + position : absolute; + bottom : 0px; + right : 0px; + cursor : nw-resize; + width : 5px; + height : 5px; + border-bottom : 2px solid #444; + border-right : 2px solid #444; +} +.JSW.nonresizable .EdgeBottomRight { cursor : default; } + +.JSW.OuterBox.excluded { + box-sizing : border-box; +} + +.JSW.OuterBox.maximized { + padding-left : 0px; + padding-right : 0px; + padding-bottom : 0px; + position : fixed !important; +} +.JSW.maximized .EdgeTopLeft { display : none; } +.JSW.maximized .EdgeTopRight { display : none; } +.JSW.maximized .EdgeBottomLeft { display : none; } +.JSW.maximized .EdgeBottomRight { display : none; } +.JSW.maximized .BorderTop { cursor : default; left : 0px; right : 0px; } +.JSW.maximized .BorderLeft { display : none; } +.JSW.maximized .BorderRight { display : none; } +.JSW.maximized .BorderBottom { display : none; } +.JSW.maximized .Bar { left : 0px; right : 0px; } diff --git a/css/fonts/KaTeX_AMS-Regular.ttf b/css/fonts/KaTeX_AMS-Regular.ttf new file mode 100644 index 0000000..c6f9a5e Binary files /dev/null and b/css/fonts/KaTeX_AMS-Regular.ttf differ diff --git a/css/fonts/KaTeX_AMS-Regular.woff b/css/fonts/KaTeX_AMS-Regular.woff new file mode 100644 index 0000000..b804d7b Binary files /dev/null and b/css/fonts/KaTeX_AMS-Regular.woff differ diff --git a/css/fonts/KaTeX_AMS-Regular.woff2 b/css/fonts/KaTeX_AMS-Regular.woff2 new file mode 100644 index 0000000..0acaaff Binary files /dev/null and b/css/fonts/KaTeX_AMS-Regular.woff2 differ diff --git a/css/fonts/KaTeX_Caligraphic-Bold.ttf b/css/fonts/KaTeX_Caligraphic-Bold.ttf new file mode 100644 index 0000000..9ff4a5e Binary files /dev/null and b/css/fonts/KaTeX_Caligraphic-Bold.ttf differ diff --git a/css/fonts/KaTeX_Caligraphic-Bold.woff b/css/fonts/KaTeX_Caligraphic-Bold.woff new file mode 100644 index 0000000..9759710 Binary files /dev/null and b/css/fonts/KaTeX_Caligraphic-Bold.woff differ diff --git a/css/fonts/KaTeX_Caligraphic-Bold.woff2 b/css/fonts/KaTeX_Caligraphic-Bold.woff2 new file mode 100644 index 0000000..f390922 Binary files /dev/null and b/css/fonts/KaTeX_Caligraphic-Bold.woff2 differ diff --git a/css/fonts/KaTeX_Caligraphic-Regular.ttf b/css/fonts/KaTeX_Caligraphic-Regular.ttf new file mode 100644 index 0000000..f522294 Binary files /dev/null and b/css/fonts/KaTeX_Caligraphic-Regular.ttf differ diff --git a/css/fonts/KaTeX_Caligraphic-Regular.woff b/css/fonts/KaTeX_Caligraphic-Regular.woff new file mode 100644 index 0000000..9bdd534 Binary files /dev/null and b/css/fonts/KaTeX_Caligraphic-Regular.woff differ diff --git a/css/fonts/KaTeX_Caligraphic-Regular.woff2 b/css/fonts/KaTeX_Caligraphic-Regular.woff2 new file mode 100644 index 0000000..75344a1 Binary files /dev/null and b/css/fonts/KaTeX_Caligraphic-Regular.woff2 differ diff --git a/css/fonts/KaTeX_Fraktur-Bold.ttf b/css/fonts/KaTeX_Fraktur-Bold.ttf new file mode 100644 index 0000000..4e98259 Binary files /dev/null and b/css/fonts/KaTeX_Fraktur-Bold.ttf differ diff --git a/css/fonts/KaTeX_Fraktur-Bold.woff b/css/fonts/KaTeX_Fraktur-Bold.woff new file mode 100644 index 0000000..e7730f6 Binary files /dev/null and b/css/fonts/KaTeX_Fraktur-Bold.woff differ diff --git a/css/fonts/KaTeX_Fraktur-Bold.woff2 b/css/fonts/KaTeX_Fraktur-Bold.woff2 new file mode 100644 index 0000000..395f28b Binary files /dev/null and b/css/fonts/KaTeX_Fraktur-Bold.woff2 differ diff --git a/css/fonts/KaTeX_Fraktur-Regular.ttf b/css/fonts/KaTeX_Fraktur-Regular.ttf new file mode 100644 index 0000000..b8461b2 Binary files /dev/null and b/css/fonts/KaTeX_Fraktur-Regular.ttf differ diff --git a/css/fonts/KaTeX_Fraktur-Regular.woff b/css/fonts/KaTeX_Fraktur-Regular.woff new file mode 100644 index 0000000..acab069 Binary files /dev/null and b/css/fonts/KaTeX_Fraktur-Regular.woff differ diff --git a/css/fonts/KaTeX_Fraktur-Regular.woff2 b/css/fonts/KaTeX_Fraktur-Regular.woff2 new file mode 100644 index 0000000..735f694 Binary files /dev/null and b/css/fonts/KaTeX_Fraktur-Regular.woff2 differ diff --git a/css/fonts/KaTeX_Main-Bold.ttf b/css/fonts/KaTeX_Main-Bold.ttf new file mode 100644 index 0000000..4060e62 Binary files /dev/null and b/css/fonts/KaTeX_Main-Bold.ttf differ diff --git a/css/fonts/KaTeX_Main-Bold.woff b/css/fonts/KaTeX_Main-Bold.woff new file mode 100644 index 0000000..f38136a Binary files /dev/null and b/css/fonts/KaTeX_Main-Bold.woff differ diff --git a/css/fonts/KaTeX_Main-Bold.woff2 b/css/fonts/KaTeX_Main-Bold.woff2 new file mode 100644 index 0000000..ab2ad21 Binary files /dev/null and b/css/fonts/KaTeX_Main-Bold.woff2 differ diff --git a/css/fonts/KaTeX_Main-BoldItalic.ttf b/css/fonts/KaTeX_Main-BoldItalic.ttf new file mode 100644 index 0000000..dc00797 Binary files /dev/null and b/css/fonts/KaTeX_Main-BoldItalic.ttf differ diff --git a/css/fonts/KaTeX_Main-BoldItalic.woff b/css/fonts/KaTeX_Main-BoldItalic.woff new file mode 100644 index 0000000..67807b0 Binary files /dev/null and b/css/fonts/KaTeX_Main-BoldItalic.woff differ diff --git a/css/fonts/KaTeX_Main-BoldItalic.woff2 b/css/fonts/KaTeX_Main-BoldItalic.woff2 new file mode 100644 index 0000000..5931794 Binary files /dev/null and b/css/fonts/KaTeX_Main-BoldItalic.woff2 differ diff --git a/css/fonts/KaTeX_Main-Italic.ttf b/css/fonts/KaTeX_Main-Italic.ttf new file mode 100644 index 0000000..0e9b0f3 Binary files /dev/null and b/css/fonts/KaTeX_Main-Italic.ttf differ diff --git a/css/fonts/KaTeX_Main-Italic.woff b/css/fonts/KaTeX_Main-Italic.woff new file mode 100644 index 0000000..6f43b59 Binary files /dev/null and b/css/fonts/KaTeX_Main-Italic.woff differ diff --git a/css/fonts/KaTeX_Main-Italic.woff2 b/css/fonts/KaTeX_Main-Italic.woff2 new file mode 100644 index 0000000..b50920e Binary files /dev/null and b/css/fonts/KaTeX_Main-Italic.woff2 differ diff --git a/css/fonts/KaTeX_Main-Regular.ttf b/css/fonts/KaTeX_Main-Regular.ttf new file mode 100644 index 0000000..dd45e1e Binary files /dev/null and b/css/fonts/KaTeX_Main-Regular.ttf differ diff --git a/css/fonts/KaTeX_Main-Regular.woff b/css/fonts/KaTeX_Main-Regular.woff new file mode 100644 index 0000000..21f5812 Binary files /dev/null and b/css/fonts/KaTeX_Main-Regular.woff differ diff --git a/css/fonts/KaTeX_Main-Regular.woff2 b/css/fonts/KaTeX_Main-Regular.woff2 new file mode 100644 index 0000000..eb24a7b Binary files /dev/null and b/css/fonts/KaTeX_Main-Regular.woff2 differ diff --git a/css/fonts/KaTeX_Math-BoldItalic.ttf b/css/fonts/KaTeX_Math-BoldItalic.ttf new file mode 100644 index 0000000..728ce7a Binary files /dev/null and b/css/fonts/KaTeX_Math-BoldItalic.ttf differ diff --git a/css/fonts/KaTeX_Math-BoldItalic.woff b/css/fonts/KaTeX_Math-BoldItalic.woff new file mode 100644 index 0000000..0ae390d Binary files /dev/null and b/css/fonts/KaTeX_Math-BoldItalic.woff differ diff --git a/css/fonts/KaTeX_Math-BoldItalic.woff2 b/css/fonts/KaTeX_Math-BoldItalic.woff2 new file mode 100644 index 0000000..2965702 Binary files /dev/null and b/css/fonts/KaTeX_Math-BoldItalic.woff2 differ diff --git a/css/fonts/KaTeX_Math-Italic.ttf b/css/fonts/KaTeX_Math-Italic.ttf new file mode 100644 index 0000000..70d559b Binary files /dev/null and b/css/fonts/KaTeX_Math-Italic.ttf differ diff --git a/css/fonts/KaTeX_Math-Italic.woff b/css/fonts/KaTeX_Math-Italic.woff new file mode 100644 index 0000000..eb5159d Binary files /dev/null and b/css/fonts/KaTeX_Math-Italic.woff differ diff --git a/css/fonts/KaTeX_Math-Italic.woff2 b/css/fonts/KaTeX_Math-Italic.woff2 new file mode 100644 index 0000000..215c143 Binary files /dev/null and b/css/fonts/KaTeX_Math-Italic.woff2 differ diff --git a/css/fonts/KaTeX_SansSerif-Bold.ttf b/css/fonts/KaTeX_SansSerif-Bold.ttf new file mode 100644 index 0000000..2f65a8a Binary files /dev/null and b/css/fonts/KaTeX_SansSerif-Bold.ttf differ diff --git a/css/fonts/KaTeX_SansSerif-Bold.woff b/css/fonts/KaTeX_SansSerif-Bold.woff new file mode 100644 index 0000000..8d47c02 Binary files /dev/null and b/css/fonts/KaTeX_SansSerif-Bold.woff differ diff --git a/css/fonts/KaTeX_SansSerif-Bold.woff2 b/css/fonts/KaTeX_SansSerif-Bold.woff2 new file mode 100644 index 0000000..cfaa3bd Binary files /dev/null and b/css/fonts/KaTeX_SansSerif-Bold.woff2 differ diff --git a/css/fonts/KaTeX_SansSerif-Italic.ttf b/css/fonts/KaTeX_SansSerif-Italic.ttf new file mode 100644 index 0000000..d5850df Binary files /dev/null and b/css/fonts/KaTeX_SansSerif-Italic.ttf differ diff --git a/css/fonts/KaTeX_SansSerif-Italic.woff b/css/fonts/KaTeX_SansSerif-Italic.woff new file mode 100644 index 0000000..7e02df9 Binary files /dev/null and b/css/fonts/KaTeX_SansSerif-Italic.woff differ diff --git a/css/fonts/KaTeX_SansSerif-Italic.woff2 b/css/fonts/KaTeX_SansSerif-Italic.woff2 new file mode 100644 index 0000000..349c06d Binary files /dev/null and b/css/fonts/KaTeX_SansSerif-Italic.woff2 differ diff --git a/css/fonts/KaTeX_SansSerif-Regular.ttf b/css/fonts/KaTeX_SansSerif-Regular.ttf new file mode 100644 index 0000000..537279f Binary files /dev/null and b/css/fonts/KaTeX_SansSerif-Regular.ttf differ diff --git a/css/fonts/KaTeX_SansSerif-Regular.woff b/css/fonts/KaTeX_SansSerif-Regular.woff new file mode 100644 index 0000000..31b8482 Binary files /dev/null and b/css/fonts/KaTeX_SansSerif-Regular.woff differ diff --git a/css/fonts/KaTeX_SansSerif-Regular.woff2 b/css/fonts/KaTeX_SansSerif-Regular.woff2 new file mode 100644 index 0000000..a90eea8 Binary files /dev/null and b/css/fonts/KaTeX_SansSerif-Regular.woff2 differ diff --git a/css/fonts/KaTeX_Script-Regular.ttf b/css/fonts/KaTeX_Script-Regular.ttf new file mode 100644 index 0000000..fd679bf Binary files /dev/null and b/css/fonts/KaTeX_Script-Regular.ttf differ diff --git a/css/fonts/KaTeX_Script-Regular.woff b/css/fonts/KaTeX_Script-Regular.woff new file mode 100644 index 0000000..0e7da82 Binary files /dev/null and b/css/fonts/KaTeX_Script-Regular.woff differ diff --git a/css/fonts/KaTeX_Script-Regular.woff2 b/css/fonts/KaTeX_Script-Regular.woff2 new file mode 100644 index 0000000..b3048fc Binary files /dev/null and b/css/fonts/KaTeX_Script-Regular.woff2 differ diff --git a/css/fonts/KaTeX_Size1-Regular.ttf b/css/fonts/KaTeX_Size1-Regular.ttf new file mode 100644 index 0000000..871fd7d Binary files /dev/null and b/css/fonts/KaTeX_Size1-Regular.ttf differ diff --git a/css/fonts/KaTeX_Size1-Regular.woff b/css/fonts/KaTeX_Size1-Regular.woff new file mode 100644 index 0000000..7f292d9 Binary files /dev/null and b/css/fonts/KaTeX_Size1-Regular.woff differ diff --git a/css/fonts/KaTeX_Size1-Regular.woff2 b/css/fonts/KaTeX_Size1-Regular.woff2 new file mode 100644 index 0000000..c5a8462 Binary files /dev/null and b/css/fonts/KaTeX_Size1-Regular.woff2 differ diff --git a/css/fonts/KaTeX_Size2-Regular.ttf b/css/fonts/KaTeX_Size2-Regular.ttf new file mode 100644 index 0000000..7a212ca Binary files /dev/null and b/css/fonts/KaTeX_Size2-Regular.ttf differ diff --git a/css/fonts/KaTeX_Size2-Regular.woff b/css/fonts/KaTeX_Size2-Regular.woff new file mode 100644 index 0000000..d241d9b Binary files /dev/null and b/css/fonts/KaTeX_Size2-Regular.woff differ diff --git a/css/fonts/KaTeX_Size2-Regular.woff2 b/css/fonts/KaTeX_Size2-Regular.woff2 new file mode 100644 index 0000000..e1bccfe Binary files /dev/null and b/css/fonts/KaTeX_Size2-Regular.woff2 differ diff --git a/css/fonts/KaTeX_Size3-Regular.ttf b/css/fonts/KaTeX_Size3-Regular.ttf new file mode 100644 index 0000000..00bff34 Binary files /dev/null and b/css/fonts/KaTeX_Size3-Regular.ttf differ diff --git a/css/fonts/KaTeX_Size3-Regular.woff b/css/fonts/KaTeX_Size3-Regular.woff new file mode 100644 index 0000000..e6e9b65 Binary files /dev/null and b/css/fonts/KaTeX_Size3-Regular.woff differ diff --git a/css/fonts/KaTeX_Size3-Regular.woff2 b/css/fonts/KaTeX_Size3-Regular.woff2 new file mode 100644 index 0000000..249a286 Binary files /dev/null and b/css/fonts/KaTeX_Size3-Regular.woff2 differ diff --git a/css/fonts/KaTeX_Size4-Regular.ttf b/css/fonts/KaTeX_Size4-Regular.ttf new file mode 100644 index 0000000..74f0892 Binary files /dev/null and b/css/fonts/KaTeX_Size4-Regular.ttf differ diff --git a/css/fonts/KaTeX_Size4-Regular.woff b/css/fonts/KaTeX_Size4-Regular.woff new file mode 100644 index 0000000..e1ec545 Binary files /dev/null and b/css/fonts/KaTeX_Size4-Regular.woff differ diff --git a/css/fonts/KaTeX_Size4-Regular.woff2 b/css/fonts/KaTeX_Size4-Regular.woff2 new file mode 100644 index 0000000..680c130 Binary files /dev/null and b/css/fonts/KaTeX_Size4-Regular.woff2 differ diff --git a/css/fonts/KaTeX_Typewriter-Regular.ttf b/css/fonts/KaTeX_Typewriter-Regular.ttf new file mode 100644 index 0000000..c83252c Binary files /dev/null and b/css/fonts/KaTeX_Typewriter-Regular.ttf differ diff --git a/css/fonts/KaTeX_Typewriter-Regular.woff b/css/fonts/KaTeX_Typewriter-Regular.woff new file mode 100644 index 0000000..2432419 Binary files /dev/null and b/css/fonts/KaTeX_Typewriter-Regular.woff differ diff --git a/css/fonts/KaTeX_Typewriter-Regular.woff2 b/css/fonts/KaTeX_Typewriter-Regular.woff2 new file mode 100644 index 0000000..771f1af Binary files /dev/null and b/css/fonts/KaTeX_Typewriter-Regular.woff2 differ diff --git a/css/fonts/LinBiolinum_R.otf b/css/fonts/LinBiolinum_R.otf new file mode 100644 index 0000000..ada5880 Binary files /dev/null and b/css/fonts/LinBiolinum_R.otf differ diff --git a/css/fonts/LinBiolinum_RB.otf b/css/fonts/LinBiolinum_RB.otf new file mode 100644 index 0000000..d86721e Binary files /dev/null and b/css/fonts/LinBiolinum_RB.otf differ diff --git a/css/fonts/LinBiolinum_RI.otf b/css/fonts/LinBiolinum_RI.otf new file mode 100644 index 0000000..86d0cf4 Binary files /dev/null and b/css/fonts/LinBiolinum_RI.otf differ diff --git a/css/fonts/PerspectiveSans-Black.otf b/css/fonts/PerspectiveSans-Black.otf new file mode 100644 index 0000000..3016ea0 Binary files /dev/null and b/css/fonts/PerspectiveSans-Black.otf differ diff --git a/css/fonts/PerspectiveSans-BlackItalic.otf b/css/fonts/PerspectiveSans-BlackItalic.otf new file mode 100644 index 0000000..114de68 Binary files /dev/null and b/css/fonts/PerspectiveSans-BlackItalic.otf differ diff --git a/css/fonts/PerspectiveSans-Bold.otf b/css/fonts/PerspectiveSans-Bold.otf new file mode 100644 index 0000000..2e0c8bf Binary files /dev/null and b/css/fonts/PerspectiveSans-Bold.otf differ diff --git a/css/fonts/PerspectiveSans-BoldItalic.otf b/css/fonts/PerspectiveSans-BoldItalic.otf new file mode 100644 index 0000000..de72d49 Binary files /dev/null and b/css/fonts/PerspectiveSans-BoldItalic.otf differ diff --git a/css/fonts/PerspectiveSans-Italic.otf b/css/fonts/PerspectiveSans-Italic.otf new file mode 100644 index 0000000..428b879 Binary files /dev/null and b/css/fonts/PerspectiveSans-Italic.otf differ diff --git a/css/fonts/PerspectiveSans-Regular.otf b/css/fonts/PerspectiveSans-Regular.otf new file mode 100644 index 0000000..414f349 Binary files /dev/null and b/css/fonts/PerspectiveSans-Regular.otf differ diff --git a/css/fonts/source-sans-pro.black-italic.ttf b/css/fonts/source-sans-pro.black-italic.ttf new file mode 100644 index 0000000..b686e79 Binary files /dev/null and b/css/fonts/source-sans-pro.black-italic.ttf differ diff --git a/css/fonts/source-sans-pro.black.ttf b/css/fonts/source-sans-pro.black.ttf new file mode 100644 index 0000000..f373008 Binary files /dev/null and b/css/fonts/source-sans-pro.black.ttf differ diff --git a/css/fonts/source-sans-pro.bold-italic.ttf b/css/fonts/source-sans-pro.bold-italic.ttf new file mode 100644 index 0000000..5c36edd Binary files /dev/null and b/css/fonts/source-sans-pro.bold-italic.ttf differ diff --git a/css/fonts/source-sans-pro.bold.ttf b/css/fonts/source-sans-pro.bold.ttf new file mode 100644 index 0000000..62a0a4d Binary files /dev/null and b/css/fonts/source-sans-pro.bold.ttf differ diff --git a/css/fonts/source-sans-pro.extralight-italic.ttf b/css/fonts/source-sans-pro.extralight-italic.ttf new file mode 100644 index 0000000..7dc8c02 Binary files /dev/null and b/css/fonts/source-sans-pro.extralight-italic.ttf differ diff --git a/css/fonts/source-sans-pro.extralight.ttf b/css/fonts/source-sans-pro.extralight.ttf new file mode 100644 index 0000000..e28a62a Binary files /dev/null and b/css/fonts/source-sans-pro.extralight.ttf differ diff --git a/css/fonts/source-sans-pro.italic.ttf b/css/fonts/source-sans-pro.italic.ttf new file mode 100644 index 0000000..a2706c0 Binary files /dev/null and b/css/fonts/source-sans-pro.italic.ttf differ diff --git a/css/fonts/source-sans-pro.light-italic.ttf b/css/fonts/source-sans-pro.light-italic.ttf new file mode 100644 index 0000000..24940e8 Binary files /dev/null and b/css/fonts/source-sans-pro.light-italic.ttf differ diff --git a/css/fonts/source-sans-pro.light.ttf b/css/fonts/source-sans-pro.light.ttf new file mode 100644 index 0000000..c72dd21 Binary files /dev/null and b/css/fonts/source-sans-pro.light.ttf differ diff --git a/css/fonts/source-sans-pro.regular.ttf b/css/fonts/source-sans-pro.regular.ttf new file mode 100644 index 0000000..ffe2786 Binary files /dev/null and b/css/fonts/source-sans-pro.regular.ttf differ diff --git a/css/fonts/source-sans-pro.semibold-italic.ttf b/css/fonts/source-sans-pro.semibold-italic.ttf new file mode 100644 index 0000000..e96f8db Binary files /dev/null and b/css/fonts/source-sans-pro.semibold-italic.ttf differ diff --git a/css/fonts/source-sans-pro.semibold.ttf b/css/fonts/source-sans-pro.semibold.ttf new file mode 100644 index 0000000..6562cbb Binary files /dev/null and b/css/fonts/source-sans-pro.semibold.ttf differ diff --git a/css/green/windows.css b/css/green/windows.css new file mode 100644 index 0000000..67907ca --- /dev/null +++ b/css/green/windows.css @@ -0,0 +1,298 @@ +@import url("../default/windows.css"); + + +.JSW { + --active-high-color : rgba(153, 153, 153, 0.7); /* Obere Farbe der aktiven Fensterleiste */ + --high-color : rgba(26, 153, 26, 1); /* Obere Farbe der Fensterleiste */ + --active-low-color : rgba(14, 154, 14, 1); /* Untere Farbe der aktiven Fensterleiste und Farbe der aktiven Raender */ + --low-color : rgba(153, 153, 153, 1); /* Untere Farbe der Fensterleise und Farbe der Raender */ + --bg-color : rgba(252, 255, 250, 1); /* Hintergrundfarbe der Fenster */ + --title-color : rgba(200, 200, 200, 1); /* Farbe des Fenstertitels */ + --active-title-color : rgba(255, 255, 255, 1); /* Farbe des Fenstertitels */ + --button-color : rgba(200, 200, 200, 1); /* Farbe der Fensterbuttons */ + --button-hover-color : rgba(255, 255, 255, 1); /* Farbe der mit Maus ueberfahrenen Fensterbuttons */ + --button-active-color : rgba(200, 200, 200, 1); /* Farbe der angeklickten Fensterbuttons */ + --disabled-color : rgba(200, 240, 200, 0.3); /* Farbe des deaktiviert-Schleiers */ +} + + +.JSW.OuterBox { + background-color : transparent; +} +.JSW.OuterBox.active { + background-color : transparent; +} + +.JSW.InnerBox { /* Hier nur ein Class-Attribut verwenden, damit Eigenschaften leichter von anderen Stylesheets ueberschrieben werden koennen. */ + background-color : rgba(252, 255, 250, 1); background-color : var(--bg-color); +} + + + + +.JSW.Disabled { + background-color : rgba(200, 220, 200, 0.3); background-color : var(--disabled-color); + border-radius : 5px; +} + +.JSW.Bar { + background : #1A991A; + background : linear-gradient(to bottom, #1A991A 5px, #999 15px); + background : linear-gradient(to bottom, var(--high-color) 5px, var(--low-color) 15px); +} +.JSW.active .Bar { + background : #0E9A0E; + background : linear-gradient(to bottom, rgba(153, 153, 153, 0.7) 0px, #0E9A0E 20px); + background : linear-gradient(to bottom, var(--active-high-color) 0px, var(--active-low-color) 20px); +} + +.JSW .JSW.Icon { + margin-right : 4px; +} + +.JSW.OuterBox .JSW.Title { + color : #C8C8C8; + color : var(--title-color); + font-size : 12px; + font-family : Arial; + font-weight : bold; + margin : 0px; + vertical-align : top; +} +.JSW.active .JSW.Title { color : #FFF; color : var(--active-title-color); } + + + +/* The Button-Icons are inspired from http://css-tricks.com/examples/ShapesOfCSS/ */ + +.JSW.Buttons a { + background-color : transparent; +} + +.JSW.ButtonExclude:before { + content : ''; + position : relative; + top : 4px; + left : -2px; + display : block; + width: 0px; + height: 0px; + border-bottom: 6px solid transparent; + border-left: 6px solid transparent; + border-right : 6px solid #C8C8C8; + border-right : 6px solid var(--button-color); + box-shadow : 10px -5px 0px -2px #C8C8C8; + box-shadow : 10px -5px 0px -2px var(--button-color); +} +.JSW.ButtonExclude:after { + content : ''; + position : relative; + top : 0px; + left : 3.5px; + display : block; + width: 8px; + height: 8px; + border: 0 solid transparent; + border-top: 3px solid #C8C8C8; + border-top: 3px solid var(--button-color); + border-radius: 11px 0 0 0; + transform:rotate(-45deg); +} +.JSW.ButtonExclude:hover:before { + border-right : 6px solid #FFF; + border-right : 6px solid var(--button-hover-color); + box-shadow : 10px -5px 0px -2px #FFF; + box-shadow : 10px -5px 0px -2px var(--button-hover-color); +} +.JSW.ButtonExclude:hover:after { + border-top: 3px solid #FFF; + border-top: 3px solid var(--button-hover-color); +} +.JSW.ButtonExclude:active:before { + border-right : 6px solid #C8C8C8; + border-right : 6px solid var(--button-active-color); + box-shadow : 10px -5px 0px -2px #C8C8C8; + box-shadow : 10px -5px 0px -2px var(--button-active-color); +} +.JSW.ButtonExclude:active:after { + border-top: 3px solid #C8C8C8; + border-top: 3px solid var(--button-active-color); +} +.JSW.Buttons.nonexcludable .ButtonExclude { display : none; } + + +.JSW.ButtonMinimize:before { + content : ''; + position : relative; + top : 12px; + left : 2px; + display : block; + width: 10px; + height: 2px; + background-color : #C8C8C8; + background-color : var(--button-color); +} +.JSW.ButtonMinimize:hover:before { background-color : #FFF; background-color : var(--button-hover-color); } +.JSW.ButtonMinimize:active:before { background-color : #C8C8C8; background-color : var(--button-active-color); } +.JSW.Buttons.nonminimizable .ButtonMinimize { display : none; } + + +.JSW.ButtonMaximize:before { + content : ''; + position : relative; + top : 2px; + left : 2px; + display : block; + width: 12px; + height: 11px; + border-style : solid; + border-left-width : 1px; + border-right-width : 1px; + border-bottom-width : 1px; + border-top-width : 2px; + border-color : #C8C8C8; + border-color : var(--button-color); +} +.JSW.maximized .ButtonMaximize:before { + top : 5px; + left : 2px; + display : block; + width : 10px; + height : 8px; +} +.JSW.maximized .ButtonMaximize:after { + content : ''; + position : relative; + top : -8px; + left : 4px; + display : block; + width : 10px; + height : 8px; + border-style : solid; + border-left-width : 0px; + border-right-width : 1px; + border-bottom-width : 0px; + border-top-width : 2px; + border-color : #C8C8C8; + border-color : var(--button-color); +} +.JSW.ButtonMaximize:hover:before, .JSW.ButtonMaximize:hover:after { border-color : #FFF; border-color : var(--button-hover-color); } +.JSW.ButtonMaximize:active:before, .JSW.ButtonMaximize:active:after { border-color : #C8C8C8; border-color : var(--button-active-color); } +.JSW.Buttons.nonmaximizable .ButtonMaximize { display : none; } + + +.JSW.ButtonClose:before, .JSW.ButtonClose:after { + content : ''; + position : relative; + top : 8px; + left : 2px; + display : block; + width : 16px; + height : 2px; + margin-bottom : -2px; + background-color : #C8C8C8; + background-color : var(--button-color); + transform : rotate(45deg); +} +.JSW.ButtonClose:after { + transform : rotate(-45deg); +} +.JSW.ButtonClose:hover:before, .JSW.ButtonClose:hover:after { background-color : #FFF; background-color : var(--button-hover-color); } +.JSW.ButtonClose:active:before, .JSW.ButtonClose:active:after { background-color : #C8C8C8; background-color : var(--button-active-color); } +.JSW.Buttons.nonclosable .ButtonClose { display : none; } + + +.JSW.BarExtension { + background : #1A991A; + background : var(--low-color); +} +.JSW.active .BarExtension { + background : #0E9A0E; + background : var(--active-low-color); +} + + +.JSW.BorderTop { + height : 2px; + border-top : 0px none transparent; + background-color : #1A991A; + background-color : var(--high-color); +} +.JSW.active .BorderTop { background : #0E9A0E; background : linear-gradient(to bottom, rgba(153, 153, 153, 0.7), rgba(153, 153, 153, 0.7)); background : var(--active-high-color); } +.JSW.nonresizable .BorderTop { cursor : default; } + +.JSW.BorderBottom { + border-top : 2px solid #999; + border-top : 2px solid var(--low-color); +} +.JSW.active .BorderBottom { border-top : 2px solid #0E9A0E; border-top : 2px solid var(--active-low-color); } +.JSW.nonresizable .BorderBottom { cursor : default; } + +.JSW.BorderRight { + border-left : 2px solid #999; + border-left : 2px solid var(--low-color); +} +.JSW.active .BorderRight { border-left : 2px solid #0E9A0E; border-left : 2px solid var(--active-low-color); } +.JSW.nonresizable .BorderRight { cursor : default; } + +.JSW.BorderLeft { + border-right : 2px solid #999; + border-right : 2px solid var(--low-color); +} +.JSW.active .BorderLeft { border-right : 2px solid #0E9A0E; border-right : 2px solid var(--active-low-color); } +.JSW.nonresizable .BorderLeft { cursor : default; } + +.JSW.EdgeTopLeft { + border-top : 0px none transparent; + border-left : 0px none transparent; + background : #1A991A; + background : linear-gradient(to bottom, #1A991A 7px, #999 17px); + background : linear-gradient(to bottom, var(--high-color) 7px, var(--low-color) 17px); + border-top-left-radius : 5px; +} +.JSW.active .EdgeTopLeft { background : #0E9A0E; background : linear-gradient(to bottom, rgba(153, 153, 153, 0.7) 2px, #0E9A0E 22px); background : linear-gradient(to bottom, var(--active-high-color) 2px, var(--active-low-color) 22px); } +.JSW.nonresizable .EdgeTopLeft { cursor : default; } + +.JSW.EdgeTopRight { + border-top : 0px none transparent; + border-right : 0px none transparent; + background : #1A991A; + background : linear-gradient(to bottom, #1A991A 7px, #999 17px); + background : linear-gradient(to bottom, var(--high-color) 7px, var(--low-color) 17px); + border-top-right-radius : 5px; +} +.JSW.active .EdgeTopRight { background : #0E9A0E; background : linear-gradient(to bottom, rgba(153, 153, 153, 0.7) 2px, #0E9A0E 22px); background : linear-gradient(to bottom, var(--active-high-color) 2px, var(--active-low-color) 22px); } +.JSW.nonresizable .EdgeTopRight { cursor : default; } + +.JSW.EdgeBottomLeft { + border-style : solid; + border-width : 0px; + border-left-width : 2px; + border-bottom-width : 2px; + border-color : #999; + border-color : var(--low-color); + border-bottom-left-radius : 5px; +} +.JSW.active .EdgeBottomLeft { border-color : #0E9A0E; border-color : var(--active-low-color); } +.JSW.nonresizable .EdgeBottomLeft { cursor : default; } + +.JSW.EdgeBottomRight { + border-style : solid; + border-width : 0px; + border-right-width : 2px; + border-bottom-width : 2px; + border-color : #999; + border-color : var(--low-color); + border-bottom-right-radius : 5px; +} +.JSW.active .EdgeBottomRight { border-color : #0E9A0E; border-color : var(--active-low-color); } +.JSW.nonresizable .EdgeBottomRight { cursor : default; } + + + + +.JSW.ThrowingBorder { + position : fixed; + border : 2px solid #0E9A0E; + border : 2px solid var(--active-low-color); +} \ No newline at end of file diff --git a/css/kamera.svg b/css/kamera.svg new file mode 100644 index 0000000..58467f3 --- /dev/null +++ b/css/kamera.svg @@ -0,0 +1,51 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/css/katex.css b/css/katex.css new file mode 100644 index 0000000..ef0aa62 --- /dev/null +++ b/css/katex.css @@ -0,0 +1,976 @@ +@font-face { + font-family: 'KaTeX_AMS'; + src: url('fonts/KaTeX_AMS-Regular.eot'); + src: url('fonts/KaTeX_AMS-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_AMS-Regular.woff2') format('woff2'), url('fonts/KaTeX_AMS-Regular.woff') format('woff'), url('fonts/KaTeX_AMS-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Caligraphic'; + src: url('fonts/KaTeX_Caligraphic-Bold.eot'); + src: url('fonts/KaTeX_Caligraphic-Bold.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Caligraphic-Bold.woff2') format('woff2'), url('fonts/KaTeX_Caligraphic-Bold.woff') format('woff'), url('fonts/KaTeX_Caligraphic-Bold.ttf') format('truetype'); + font-weight: bold; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Caligraphic'; + src: url('fonts/KaTeX_Caligraphic-Regular.eot'); + src: url('fonts/KaTeX_Caligraphic-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Caligraphic-Regular.woff2') format('woff2'), url('fonts/KaTeX_Caligraphic-Regular.woff') format('woff'), url('fonts/KaTeX_Caligraphic-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Fraktur'; + src: url('fonts/KaTeX_Fraktur-Bold.eot'); + src: url('fonts/KaTeX_Fraktur-Bold.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Fraktur-Bold.woff2') format('woff2'), url('fonts/KaTeX_Fraktur-Bold.woff') format('woff'), url('fonts/KaTeX_Fraktur-Bold.ttf') format('truetype'); + font-weight: bold; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Fraktur'; + src: url('fonts/KaTeX_Fraktur-Regular.eot'); + src: url('fonts/KaTeX_Fraktur-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Fraktur-Regular.woff2') format('woff2'), url('fonts/KaTeX_Fraktur-Regular.woff') format('woff'), url('fonts/KaTeX_Fraktur-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Main'; + src: url('fonts/KaTeX_Main-Bold.eot'); + src: url('fonts/KaTeX_Main-Bold.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Main-Bold.woff2') format('woff2'), url('fonts/KaTeX_Main-Bold.woff') format('woff'), url('fonts/KaTeX_Main-Bold.ttf') format('truetype'); + font-weight: bold; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Main'; + src: url('fonts/KaTeX_Main-Italic.eot'); + src: url('fonts/KaTeX_Main-Italic.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Main-Italic.woff2') format('woff2'), url('fonts/KaTeX_Main-Italic.woff') format('woff'), url('fonts/KaTeX_Main-Italic.ttf') format('truetype'); + font-weight: normal; + font-style: italic; +} +@font-face { + font-family: 'KaTeX_Main'; + src: url('fonts/KaTeX_Main-Regular.eot'); + src: url('fonts/KaTeX_Main-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Main-Regular.woff2') format('woff2'), url('fonts/KaTeX_Main-Regular.woff') format('woff'), url('fonts/KaTeX_Main-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Math'; + src: url('fonts/KaTeX_Math-Italic.eot'); + src: url('fonts/KaTeX_Math-Italic.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Math-Italic.woff2') format('woff2'), url('fonts/KaTeX_Math-Italic.woff') format('woff'), url('fonts/KaTeX_Math-Italic.ttf') format('truetype'); + font-weight: normal; + font-style: italic; +} +@font-face { + font-family: 'KaTeX_SansSerif'; + src: url('fonts/KaTeX_SansSerif-Regular.eot'); + src: url('fonts/KaTeX_SansSerif-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_SansSerif-Regular.woff2') format('woff2'), url('fonts/KaTeX_SansSerif-Regular.woff') format('woff'), url('fonts/KaTeX_SansSerif-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Script'; + src: url('fonts/KaTeX_Script-Regular.eot'); + src: url('fonts/KaTeX_Script-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Script-Regular.woff2') format('woff2'), url('fonts/KaTeX_Script-Regular.woff') format('woff'), url('fonts/KaTeX_Script-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Size1'; + src: url('fonts/KaTeX_Size1-Regular.eot'); + src: url('fonts/KaTeX_Size1-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Size1-Regular.woff2') format('woff2'), url('fonts/KaTeX_Size1-Regular.woff') format('woff'), url('fonts/KaTeX_Size1-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Size2'; + src: url('fonts/KaTeX_Size2-Regular.eot'); + src: url('fonts/KaTeX_Size2-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Size2-Regular.woff2') format('woff2'), url('fonts/KaTeX_Size2-Regular.woff') format('woff'), url('fonts/KaTeX_Size2-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Size3'; + src: url('fonts/KaTeX_Size3-Regular.eot'); + src: url('fonts/KaTeX_Size3-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Size3-Regular.woff2') format('woff2'), url('fonts/KaTeX_Size3-Regular.woff') format('woff'), url('fonts/KaTeX_Size3-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Size4'; + src: url('fonts/KaTeX_Size4-Regular.eot'); + src: url('fonts/KaTeX_Size4-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Size4-Regular.woff2') format('woff2'), url('fonts/KaTeX_Size4-Regular.woff') format('woff'), url('fonts/KaTeX_Size4-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Typewriter'; + src: url('fonts/KaTeX_Typewriter-Regular.eot'); + src: url('fonts/KaTeX_Typewriter-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Typewriter-Regular.woff2') format('woff2'), url('fonts/KaTeX_Typewriter-Regular.woff') format('woff'), url('fonts/KaTeX_Typewriter-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +.katex-display { + display: block; + margin: 1em 0; + text-align: center; +} +.katex-display > .katex { + display: inline-block; + text-align: initial; +} +.katex { + font: normal 1.21em KaTeX_Main, Times New Roman, serif; + line-height: 1.2; + white-space: nowrap; + text-indent: 0; +} +.katex .katex-html { + display: inline-block; +} +.katex .katex-mathml { + position: absolute; + clip: rect(1px, 1px, 1px, 1px); + padding: 0; + border: 0; + height: 1px; + width: 1px; + overflow: hidden; +} +.katex .base { + display: inline-block; +} +.katex .strut { + display: inline-block; +} +.katex .mathrm { + font-style: normal; +} +.katex .textit { + font-style: italic; +} +.katex .mathit { + font-family: KaTeX_Math; + font-style: italic; +} +.katex .mathbf { + font-family: KaTeX_Main; + font-weight: bold; +} +.katex .amsrm { + font-family: KaTeX_AMS; +} +.katex .mathbb { + font-family: KaTeX_AMS; +} +.katex .mathcal { + font-family: KaTeX_Caligraphic; +} +.katex .mathfrak { + font-family: KaTeX_Fraktur; +} +.katex .mathtt { + font-family: KaTeX_Typewriter; +} +.katex .mathscr { + font-family: KaTeX_Script; +} +.katex .mathsf { + font-family: KaTeX_SansSerif; +} +.katex .mainit { + font-family: KaTeX_Main; + font-style: italic; +} +.katex .mord + .mop { + margin-left: 0.16667em; +} +.katex .mord + .mbin { + margin-left: 0.22222em; +} +.katex .mord + .mrel { + margin-left: 0.27778em; +} +.katex .mord + .minner { + margin-left: 0.16667em; +} +.katex .mop + .mord { + margin-left: 0.16667em; +} +.katex .mop + .mop { + margin-left: 0.16667em; +} +.katex .mop + .mrel { + margin-left: 0.27778em; +} +.katex .mop + .minner { + margin-left: 0.16667em; +} +.katex .mbin + .mord { + margin-left: 0.22222em; +} +.katex .mbin + .mop { + margin-left: 0.22222em; +} +.katex .mbin + .mopen { + margin-left: 0.22222em; +} +.katex .mbin + .minner { + margin-left: 0.22222em; +} +.katex .mrel + .mord { + margin-left: 0.27778em; +} +.katex .mrel + .mop { + margin-left: 0.27778em; +} +.katex .mrel + .mopen { + margin-left: 0.27778em; +} +.katex .mrel + .minner { + margin-left: 0.27778em; +} +.katex .mclose + .mop { + margin-left: 0.16667em; +} +.katex .mclose + .mbin { + margin-left: 0.22222em; +} +.katex .mclose + .mrel { + margin-left: 0.27778em; +} +.katex .mclose + .minner { + margin-left: 0.16667em; +} +.katex .mpunct + .mord { + margin-left: 0.16667em; +} +.katex .mpunct + .mop { + margin-left: 0.16667em; +} +.katex .mpunct + .mrel { + margin-left: 0.16667em; +} +.katex .mpunct + .mopen { + margin-left: 0.16667em; +} +.katex .mpunct + .mclose { + margin-left: 0.16667em; +} +.katex .mpunct + .mpunct { + margin-left: 0.16667em; +} +.katex .mpunct + .minner { + margin-left: 0.16667em; +} +.katex .minner + .mord { + margin-left: 0.16667em; +} +.katex .minner + .mop { + margin-left: 0.16667em; +} +.katex .minner + .mbin { + margin-left: 0.22222em; +} +.katex .minner + .mrel { + margin-left: 0.27778em; +} +.katex .minner + .mopen { + margin-left: 0.16667em; +} +.katex .minner + .mpunct { + margin-left: 0.16667em; +} +.katex .minner + .minner { + margin-left: 0.16667em; +} +.katex .mord.mtight { + margin-left: 0; +} +.katex .mop.mtight { + margin-left: 0; +} +.katex .mbin.mtight { + margin-left: 0; +} +.katex .mrel.mtight { + margin-left: 0; +} +.katex .mopen.mtight { + margin-left: 0; +} +.katex .mclose.mtight { + margin-left: 0; +} +.katex .mpunct.mtight { + margin-left: 0; +} +.katex .minner.mtight { + margin-left: 0; +} +.katex .mord + .mop.mtight { + margin-left: 0.16667em; +} +.katex .mop + .mord.mtight { + margin-left: 0.16667em; +} +.katex .mop + .mop.mtight { + margin-left: 0.16667em; +} +.katex .mclose + .mop.mtight { + margin-left: 0.16667em; +} +.katex .minner + .mop.mtight { + margin-left: 0.16667em; +} +.katex .reset-textstyle.textstyle { + font-size: 1em; +} +.katex .reset-textstyle.scriptstyle { + font-size: 0.7em; +} +.katex .reset-textstyle.scriptscriptstyle { + font-size: 0.5em; +} +.katex .reset-scriptstyle.textstyle { + font-size: 1.42857em; +} +.katex .reset-scriptstyle.scriptstyle { + font-size: 1em; +} +.katex .reset-scriptstyle.scriptscriptstyle { + font-size: 0.71429em; +} +.katex .reset-scriptscriptstyle.textstyle { + font-size: 2em; +} +.katex .reset-scriptscriptstyle.scriptstyle { + font-size: 1.4em; +} +.katex .reset-scriptscriptstyle.scriptscriptstyle { + font-size: 1em; +} +.katex .style-wrap { + position: relative; +} +.katex .vlist { + display: inline-block; +} +.katex .vlist > span { + display: block; + height: 0; + position: relative; +} +.katex .vlist > span > span { + display: inline-block; +} +.katex .vlist .baseline-fix { + display: inline-table; + table-layout: fixed; +} +.katex .msupsub { + text-align: left; +} +.katex .mfrac > span > span { + text-align: center; +} +.katex .mfrac .frac-line { + width: 100%; +} +.katex .mfrac .frac-line:before { + border-bottom-style: solid; + border-bottom-width: 1px; + content: ""; + display: block; +} +.katex .mfrac .frac-line:after { + border-bottom-style: solid; + border-bottom-width: 0.04em; + content: ""; + display: block; + margin-top: -1px; +} +.katex .mspace { + display: inline-block; +} +.katex .mspace.negativethinspace { + margin-left: -0.16667em; +} +.katex .mspace.thinspace { + width: 0.16667em; +} +.katex .mspace.negativemediumspace { + margin-left: -0.22222em; +} +.katex .mspace.mediumspace { + width: 0.22222em; +} +.katex .mspace.thickspace { + width: 0.27778em; +} +.katex .mspace.sixmuspace { + width: 0.333333em; +} +.katex .mspace.eightmuspace { + width: 0.444444em; +} +.katex .mspace.enspace { + width: 0.5em; +} +.katex .mspace.twelvemuspace { + width: 0.666667em; +} +.katex .mspace.quad { + width: 1em; +} +.katex .mspace.qquad { + width: 2em; +} +.katex .llap, +.katex .rlap { + width: 0; + position: relative; +} +.katex .llap > .inner, +.katex .rlap > .inner { + position: absolute; +} +.katex .llap > .fix, +.katex .rlap > .fix { + display: inline-block; +} +.katex .llap > .inner { + right: 0; +} +.katex .rlap > .inner { + left: 0; +} +.katex .katex-logo .a { + font-size: 0.75em; + margin-left: -0.32em; + position: relative; + top: -0.2em; +} +.katex .katex-logo .t { + margin-left: -0.23em; +} +.katex .katex-logo .e { + margin-left: -0.1667em; + position: relative; + top: 0.2155em; +} +.katex .katex-logo .x { + margin-left: -0.125em; +} +.katex .rule { + display: inline-block; + border: solid 0; + position: relative; +} +.katex .overline .overline-line, +.katex .underline .underline-line { + width: 100%; +} +.katex .overline .overline-line:before, +.katex .underline .underline-line:before { + border-bottom-style: solid; + border-bottom-width: 1px; + content: ""; + display: block; +} +.katex .overline .overline-line:after, +.katex .underline .underline-line:after { + border-bottom-style: solid; + border-bottom-width: 0.04em; + content: ""; + display: block; + margin-top: -1px; +} +.katex .sqrt > .sqrt-sign { + position: relative; +} +.katex .sqrt .sqrt-line { + width: 100%; +} +.katex .sqrt .sqrt-line:before { + border-bottom-style: solid; + border-bottom-width: 1px; + content: ""; + display: block; +} +.katex .sqrt .sqrt-line:after { + border-bottom-style: solid; + border-bottom-width: 0.04em; + content: ""; + display: block; + margin-top: -1px; +} +.katex .sqrt > .root { + margin-left: 0.27777778em; + margin-right: -0.55555556em; +} +.katex .sizing, +.katex .fontsize-ensurer { + display: inline-block; +} +.katex .sizing.reset-size1.size1, +.katex .fontsize-ensurer.reset-size1.size1 { + font-size: 1em; +} +.katex .sizing.reset-size1.size2, +.katex .fontsize-ensurer.reset-size1.size2 { + font-size: 1.4em; +} +.katex .sizing.reset-size1.size3, +.katex .fontsize-ensurer.reset-size1.size3 { + font-size: 1.6em; +} +.katex .sizing.reset-size1.size4, +.katex .fontsize-ensurer.reset-size1.size4 { + font-size: 1.8em; +} +.katex .sizing.reset-size1.size5, +.katex .fontsize-ensurer.reset-size1.size5 { + font-size: 2em; +} +.katex .sizing.reset-size1.size6, +.katex .fontsize-ensurer.reset-size1.size6 { + font-size: 2.4em; +} +.katex .sizing.reset-size1.size7, +.katex .fontsize-ensurer.reset-size1.size7 { + font-size: 2.88em; +} +.katex .sizing.reset-size1.size8, +.katex .fontsize-ensurer.reset-size1.size8 { + font-size: 3.46em; +} +.katex .sizing.reset-size1.size9, +.katex .fontsize-ensurer.reset-size1.size9 { + font-size: 4.14em; +} +.katex .sizing.reset-size1.size10, +.katex .fontsize-ensurer.reset-size1.size10 { + font-size: 4.98em; +} +.katex .sizing.reset-size2.size1, +.katex .fontsize-ensurer.reset-size2.size1 { + font-size: 0.71428571em; +} +.katex .sizing.reset-size2.size2, +.katex .fontsize-ensurer.reset-size2.size2 { + font-size: 1em; +} +.katex .sizing.reset-size2.size3, +.katex .fontsize-ensurer.reset-size2.size3 { + font-size: 1.14285714em; +} +.katex .sizing.reset-size2.size4, +.katex .fontsize-ensurer.reset-size2.size4 { + font-size: 1.28571429em; +} +.katex .sizing.reset-size2.size5, +.katex .fontsize-ensurer.reset-size2.size5 { + font-size: 1.42857143em; +} +.katex .sizing.reset-size2.size6, +.katex .fontsize-ensurer.reset-size2.size6 { + font-size: 1.71428571em; +} +.katex .sizing.reset-size2.size7, +.katex .fontsize-ensurer.reset-size2.size7 { + font-size: 2.05714286em; +} +.katex .sizing.reset-size2.size8, +.katex .fontsize-ensurer.reset-size2.size8 { + font-size: 2.47142857em; +} +.katex .sizing.reset-size2.size9, +.katex .fontsize-ensurer.reset-size2.size9 { + font-size: 2.95714286em; +} +.katex .sizing.reset-size2.size10, +.katex .fontsize-ensurer.reset-size2.size10 { + font-size: 3.55714286em; +} +.katex .sizing.reset-size3.size1, +.katex .fontsize-ensurer.reset-size3.size1 { + font-size: 0.625em; +} +.katex .sizing.reset-size3.size2, +.katex .fontsize-ensurer.reset-size3.size2 { + font-size: 0.875em; +} +.katex .sizing.reset-size3.size3, +.katex .fontsize-ensurer.reset-size3.size3 { + font-size: 1em; +} +.katex .sizing.reset-size3.size4, +.katex .fontsize-ensurer.reset-size3.size4 { + font-size: 1.125em; +} +.katex .sizing.reset-size3.size5, +.katex .fontsize-ensurer.reset-size3.size5 { + font-size: 1.25em; +} +.katex .sizing.reset-size3.size6, +.katex .fontsize-ensurer.reset-size3.size6 { + font-size: 1.5em; +} +.katex .sizing.reset-size3.size7, +.katex .fontsize-ensurer.reset-size3.size7 { + font-size: 1.8em; +} +.katex .sizing.reset-size3.size8, +.katex .fontsize-ensurer.reset-size3.size8 { + font-size: 2.1625em; +} +.katex .sizing.reset-size3.size9, +.katex .fontsize-ensurer.reset-size3.size9 { + font-size: 2.5875em; +} +.katex .sizing.reset-size3.size10, +.katex .fontsize-ensurer.reset-size3.size10 { + font-size: 3.1125em; +} +.katex .sizing.reset-size4.size1, +.katex .fontsize-ensurer.reset-size4.size1 { + font-size: 0.55555556em; +} +.katex .sizing.reset-size4.size2, +.katex .fontsize-ensurer.reset-size4.size2 { + font-size: 0.77777778em; +} +.katex .sizing.reset-size4.size3, +.katex .fontsize-ensurer.reset-size4.size3 { + font-size: 0.88888889em; +} +.katex .sizing.reset-size4.size4, +.katex .fontsize-ensurer.reset-size4.size4 { + font-size: 1em; +} +.katex .sizing.reset-size4.size5, +.katex .fontsize-ensurer.reset-size4.size5 { + font-size: 1.11111111em; +} +.katex .sizing.reset-size4.size6, +.katex .fontsize-ensurer.reset-size4.size6 { + font-size: 1.33333333em; +} +.katex .sizing.reset-size4.size7, +.katex .fontsize-ensurer.reset-size4.size7 { + font-size: 1.6em; +} +.katex .sizing.reset-size4.size8, +.katex .fontsize-ensurer.reset-size4.size8 { + font-size: 1.92222222em; +} +.katex .sizing.reset-size4.size9, +.katex .fontsize-ensurer.reset-size4.size9 { + font-size: 2.3em; +} +.katex .sizing.reset-size4.size10, +.katex .fontsize-ensurer.reset-size4.size10 { + font-size: 2.76666667em; +} +.katex .sizing.reset-size5.size1, +.katex .fontsize-ensurer.reset-size5.size1 { + font-size: 0.5em; +} +.katex .sizing.reset-size5.size2, +.katex .fontsize-ensurer.reset-size5.size2 { + font-size: 0.7em; +} +.katex .sizing.reset-size5.size3, +.katex .fontsize-ensurer.reset-size5.size3 { + font-size: 0.8em; +} +.katex .sizing.reset-size5.size4, +.katex .fontsize-ensurer.reset-size5.size4 { + font-size: 0.9em; +} +.katex .sizing.reset-size5.size5, +.katex .fontsize-ensurer.reset-size5.size5 { + font-size: 1em; +} +.katex .sizing.reset-size5.size6, +.katex .fontsize-ensurer.reset-size5.size6 { + font-size: 1.2em; +} +.katex .sizing.reset-size5.size7, +.katex .fontsize-ensurer.reset-size5.size7 { + font-size: 1.44em; +} +.katex .sizing.reset-size5.size8, +.katex .fontsize-ensurer.reset-size5.size8 { + font-size: 1.73em; +} +.katex .sizing.reset-size5.size9, +.katex .fontsize-ensurer.reset-size5.size9 { + font-size: 2.07em; +} +.katex .sizing.reset-size5.size10, +.katex .fontsize-ensurer.reset-size5.size10 { + font-size: 2.49em; +} +.katex .sizing.reset-size6.size1, +.katex .fontsize-ensurer.reset-size6.size1 { + font-size: 0.41666667em; +} +.katex .sizing.reset-size6.size2, +.katex .fontsize-ensurer.reset-size6.size2 { + font-size: 0.58333333em; +} +.katex .sizing.reset-size6.size3, +.katex .fontsize-ensurer.reset-size6.size3 { + font-size: 0.66666667em; +} +.katex .sizing.reset-size6.size4, +.katex .fontsize-ensurer.reset-size6.size4 { + font-size: 0.75em; +} +.katex .sizing.reset-size6.size5, +.katex .fontsize-ensurer.reset-size6.size5 { + font-size: 0.83333333em; +} +.katex .sizing.reset-size6.size6, +.katex .fontsize-ensurer.reset-size6.size6 { + font-size: 1em; +} +.katex .sizing.reset-size6.size7, +.katex .fontsize-ensurer.reset-size6.size7 { + font-size: 1.2em; +} +.katex .sizing.reset-size6.size8, +.katex .fontsize-ensurer.reset-size6.size8 { + font-size: 1.44166667em; +} +.katex .sizing.reset-size6.size9, +.katex .fontsize-ensurer.reset-size6.size9 { + font-size: 1.725em; +} +.katex .sizing.reset-size6.size10, +.katex .fontsize-ensurer.reset-size6.size10 { + font-size: 2.075em; +} +.katex .sizing.reset-size7.size1, +.katex .fontsize-ensurer.reset-size7.size1 { + font-size: 0.34722222em; +} +.katex .sizing.reset-size7.size2, +.katex .fontsize-ensurer.reset-size7.size2 { + font-size: 0.48611111em; +} +.katex .sizing.reset-size7.size3, +.katex .fontsize-ensurer.reset-size7.size3 { + font-size: 0.55555556em; +} +.katex .sizing.reset-size7.size4, +.katex .fontsize-ensurer.reset-size7.size4 { + font-size: 0.625em; +} +.katex .sizing.reset-size7.size5, +.katex .fontsize-ensurer.reset-size7.size5 { + font-size: 0.69444444em; +} +.katex .sizing.reset-size7.size6, +.katex .fontsize-ensurer.reset-size7.size6 { + font-size: 0.83333333em; +} +.katex .sizing.reset-size7.size7, +.katex .fontsize-ensurer.reset-size7.size7 { + font-size: 1em; +} +.katex .sizing.reset-size7.size8, +.katex .fontsize-ensurer.reset-size7.size8 { + font-size: 1.20138889em; +} +.katex .sizing.reset-size7.size9, +.katex .fontsize-ensurer.reset-size7.size9 { + font-size: 1.4375em; +} +.katex .sizing.reset-size7.size10, +.katex .fontsize-ensurer.reset-size7.size10 { + font-size: 1.72916667em; +} +.katex .sizing.reset-size8.size1, +.katex .fontsize-ensurer.reset-size8.size1 { + font-size: 0.28901734em; +} +.katex .sizing.reset-size8.size2, +.katex .fontsize-ensurer.reset-size8.size2 { + font-size: 0.40462428em; +} +.katex .sizing.reset-size8.size3, +.katex .fontsize-ensurer.reset-size8.size3 { + font-size: 0.46242775em; +} +.katex .sizing.reset-size8.size4, +.katex .fontsize-ensurer.reset-size8.size4 { + font-size: 0.52023121em; +} +.katex .sizing.reset-size8.size5, +.katex .fontsize-ensurer.reset-size8.size5 { + font-size: 0.57803468em; +} +.katex .sizing.reset-size8.size6, +.katex .fontsize-ensurer.reset-size8.size6 { + font-size: 0.69364162em; +} +.katex .sizing.reset-size8.size7, +.katex .fontsize-ensurer.reset-size8.size7 { + font-size: 0.83236994em; +} +.katex .sizing.reset-size8.size8, +.katex .fontsize-ensurer.reset-size8.size8 { + font-size: 1em; +} +.katex .sizing.reset-size8.size9, +.katex .fontsize-ensurer.reset-size8.size9 { + font-size: 1.19653179em; +} +.katex .sizing.reset-size8.size10, +.katex .fontsize-ensurer.reset-size8.size10 { + font-size: 1.43930636em; +} +.katex .sizing.reset-size9.size1, +.katex .fontsize-ensurer.reset-size9.size1 { + font-size: 0.24154589em; +} +.katex .sizing.reset-size9.size2, +.katex .fontsize-ensurer.reset-size9.size2 { + font-size: 0.33816425em; +} +.katex .sizing.reset-size9.size3, +.katex .fontsize-ensurer.reset-size9.size3 { + font-size: 0.38647343em; +} +.katex .sizing.reset-size9.size4, +.katex .fontsize-ensurer.reset-size9.size4 { + font-size: 0.43478261em; +} +.katex .sizing.reset-size9.size5, +.katex .fontsize-ensurer.reset-size9.size5 { + font-size: 0.48309179em; +} +.katex .sizing.reset-size9.size6, +.katex .fontsize-ensurer.reset-size9.size6 { + font-size: 0.57971014em; +} +.katex .sizing.reset-size9.size7, +.katex .fontsize-ensurer.reset-size9.size7 { + font-size: 0.69565217em; +} +.katex .sizing.reset-size9.size8, +.katex .fontsize-ensurer.reset-size9.size8 { + font-size: 0.83574879em; +} +.katex .sizing.reset-size9.size9, +.katex .fontsize-ensurer.reset-size9.size9 { + font-size: 1em; +} +.katex .sizing.reset-size9.size10, +.katex .fontsize-ensurer.reset-size9.size10 { + font-size: 1.20289855em; +} +.katex .sizing.reset-size10.size1, +.katex .fontsize-ensurer.reset-size10.size1 { + font-size: 0.20080321em; +} +.katex .sizing.reset-size10.size2, +.katex .fontsize-ensurer.reset-size10.size2 { + font-size: 0.2811245em; +} +.katex .sizing.reset-size10.size3, +.katex .fontsize-ensurer.reset-size10.size3 { + font-size: 0.32128514em; +} +.katex .sizing.reset-size10.size4, +.katex .fontsize-ensurer.reset-size10.size4 { + font-size: 0.36144578em; +} +.katex .sizing.reset-size10.size5, +.katex .fontsize-ensurer.reset-size10.size5 { + font-size: 0.40160643em; +} +.katex .sizing.reset-size10.size6, +.katex .fontsize-ensurer.reset-size10.size6 { + font-size: 0.48192771em; +} +.katex .sizing.reset-size10.size7, +.katex .fontsize-ensurer.reset-size10.size7 { + font-size: 0.57831325em; +} +.katex .sizing.reset-size10.size8, +.katex .fontsize-ensurer.reset-size10.size8 { + font-size: 0.69477912em; +} +.katex .sizing.reset-size10.size9, +.katex .fontsize-ensurer.reset-size10.size9 { + font-size: 0.8313253em; +} +.katex .sizing.reset-size10.size10, +.katex .fontsize-ensurer.reset-size10.size10 { + font-size: 1em; +} +.katex .delimsizing.size1 { + font-family: KaTeX_Size1; +} +.katex .delimsizing.size2 { + font-family: KaTeX_Size2; +} +.katex .delimsizing.size3 { + font-family: KaTeX_Size3; +} +.katex .delimsizing.size4 { + font-family: KaTeX_Size4; +} +.katex .delimsizing.mult .delim-size1 > span { + font-family: KaTeX_Size1; +} +.katex .delimsizing.mult .delim-size4 > span { + font-family: KaTeX_Size4; +} +.katex .nulldelimiter { + display: inline-block; + width: 0.12em; +} +.katex .op-symbol { + position: relative; +} +.katex .op-symbol.small-op { + font-family: KaTeX_Size1; +} +.katex .op-symbol.large-op { + font-family: KaTeX_Size2; +} +.katex .op-limits > .vlist > span { + text-align: center; +} +.katex .accent > .vlist > span { + text-align: center; +} +.katex .accent .accent-body > span { + width: 0; +} +.katex .accent .accent-body.accent-vec > span { + position: relative; + left: 0.326em; +} +.katex .mtable .vertical-separator { + display: inline-block; + margin: 0 -0.025em; + border-right: 0.05em solid black; +} +.katex .mtable .arraycolsep { + display: inline-block; +} +.katex .mtable .col-align-c > .vlist { + text-align: center; +} +.katex .mtable .col-align-l > .vlist { + text-align: left; +} +.katex .mtable .col-align-r > .vlist { + text-align: right; +} diff --git a/css/kirby.css b/css/kirby.css new file mode 100644 index 0000000..96de56a --- /dev/null +++ b/css/kirby.css @@ -0,0 +1,43 @@ +@import "main.css"; +@import "default.css"; +@import "calendar.css"; +/*@import "config/variables.css"; +@import "config/reset.css"; +@import "config/grid.css"; +@import "config/diagonal.css"; + +@import "blocks/blocks.css"; +@import "blocks/carousel.css"; +@import "blocks/countdown.css"; +@import "blocks/events-preview.css"; +@import "blocks/logo-wall.css"; +@import "blocks/intro-with-columns.css"; +@import "blocks/intro-with-title.css"; +@import "blocks/intro.css"; +@import "blocks/text-and-image.css"; +@import "blocks/text-and-list.css"; +@import "blocks/text-and-steps.css"; +@import "blocks/two-column-list.css"; +@import "blocks/youtube.css"; + +@import "snippets/carousel-item.css"; +@import "snippets/collection-items.css"; +@import "snippets/district-list.css"; +@import "snippets/event-intro.css"; +@import "snippets/event.css"; +@import "snippets/footer.css"; +@import "snippets/sibling-navigator.css"; +@import "snippets/text-intro.css"; + +@import "templates/candidate.css"; +@import "templates/collection.css"; +@import "templates/district.css"; +@import "templates/donations.css"; +@import "templates/events.css"; +@import "templates/program.css"; +@import "templates/program-chapter.css"; +@import "templates/questions.css"; +@import "templates/question.css"; +@import "templates/livestream.css";*/ + +@import "beipackzettel.css"; diff --git a/css/main.css b/css/main.css new file mode 100755 index 0000000..012029b --- /dev/null +++ b/css/main.css @@ -0,0 +1,468 @@ +body.main { + overflow-y : scroll; + overflow-x : hidden; + text-align : center; + padding : 0px; + margin : 0px; + position : absolute; + bottom : 0px; + top : 0px; + left : 0px; + right : 0px; +} + +.JSW.OuterBox { + z-index : 5; +} + +iframe { + background-color : transparent; + border-radius : 4px; +} + +.NoJsHeight { + bottom : 0px; +} + +#BoxTop { + font-family: 'Perspective Sans'; + color : #000; + position : absolute; + height : 300px; + top : 0px; + left : 0px; + right : 0px; + border-bottom : 1px solid #eaeaea; + text-align : left; + z-index : 4; +} + +#BoxMiddle { + text-align : left; + position : absolute; + top : 300px; + right : 0px; + left : 0px; + padding-bottom : 20px; + text-align : center; + box-sizing: border-box; +} +#BoxMiddle.NoJsHeight { + left : 0px !important; +} + +#BoxTop .bgImage { + background-size : cover; + background-position : center; + position : absolute; + top : 0px; + left : 0px; + bottom : 0px; + right : 0px; +} + +#BoxTop #ListSocialmedia { + position : absolute; + writing-mode : vertical-rl; + text-orientation : upright; + text-align : left; + white-space : normal; + font-size : 10px; + top : 0px; + padding : 5px; + padding-right : 10px; + bottom : 0px; + right : 0px; + background-color : rgba(255, 255, 255, 0.7); +} + +#BoxTop #ListSocialmedia a { + display : inline-block; + width : 40px; + height : 40px; + background-size : 100% 100%; + background-repeat : no-repeat; + margin-left : 5px; +} + +#BoxTop #ListSocialmedia a svg { + display : inline-block; + width : 40px; + height : 40px; +} + +#BoxTop .logo { + float : left; + height : 114px; + margin-right : 8px; + position : relative; + top : 64px; + left : 10%; +} + +#BoxTop h1, #BoxTop h2 { + font-size : 65px; + letter-spacing: -0.02em; + margin : 0px; + text-decoration : none; + font-style : italic; + font-weight : bold; + height : 40px; + white-space : nowrap; + position : relative; + width : 0px; + overflow : visible; + top : 64px; + left : 10%; +} + +#BoxTop h1 a, #BoxTop h2 a { + text-decoration : none; + color : inherit; +} + +#BoxTop h1 { + color : #00aff0; + line-height : 1em; +} + +#BoxTop h2 { + color : #bedc0a; + line-height : 104px; +} + +#BoxTop .subheadingLink { + margin-left : 10%; + font-size : 1.5em; +} + +#BoxLinksPos { + position : absolute; + top : 100%; + margin-top : -66px; + left : 0px; + text-align : center; + width : 100%; +} + +#BoxLinks { + width : 100%; + overflow-x : scroll; + -ms-overflow-style: none; + scrollbar-width: none; + white-space : nowrap; + text-align : center; + display : block; +} +#BoxLinks::-webkit-scrollbar { + display : none; +} +#BoxLinks::after { + content: ''; + display: inline-block; + width:95px; + height:1px; +} + +#BoxLinks a.MenuLink { + display : inline-block; + color : black; + text-shadow: 0px 0px 8px white, 0px 0px 8px white, 0px 0px 8px white, 0px 0px 8px white; + font-size : 22.4px; + padding-left : 15px; + padding-right : 15px; + line-height : 66px; + font-weight : bold; + text-decoration : none; + position : relative; + vertical-align: top; +} +#BoxLinks a:link { } +#BoxLinks a:visited { } +#BoxLinks a:focus { } +#BoxLinks a:hover { color: #00aff0; } +#BoxLinks a:active { color: #42A62A; } +#BoxLinks a.MenuLink.active { + text-decoration : underline; + color : #000; + text-shadow: 0px 0px 8px #bedc0a, 0px 0px 8px #bedc0a, 0px 0px 8px #bedc0a, 0px 0px 8px #bedc0a; + cursor : default; + background-color : transparent; +} + +#BoxLinks .submenu { + display: inline-block; + position: relative; + vertical-align: top; +} +#BoxLinks .submenu a.MenuLink { + cursor: default; +} +#BoxLinks .submenu .flapoutcontainer { + display: inline-block; + width : 0px; +} +#BoxLinks .submenu .flapout { + background-color : rgba(255, 255, 255, 0.7); + backdrop-filter: blur(2px); + display: none; + text-align: left; + margin-top : 66px; +} +#BoxLinks .submenu:hover .flapout { + display: inline-block; +} +#BoxLinks .submenu .submenu .flapoutcontainer { + display: inline-block; + width : 0px; + float:right; +} +#BoxLinks .submenu .submenu .flapout { + display: none; + margin-top : 0px; +} +#BoxLinks .submenu .submenu:hover .flapout { + display: inline-block; +} +#BoxLinks .submenu .flapout a.MenuLink { + cursor: pointer; + display: block; +} + + +#BoxBottom { + background-color: #efebdc; + margin-top: 20px; +} +#BoxBottom .footer__ternary-navigation { + display: inline-block; + text-align: left; +} +#BoxBottom .footer__ternary-navigation li:before { + display: none; +} + + + +#BoxCenter { + position : relative; + display : inline-block; + width : 100%; + max-width : 1200px; + box-sizing : border-box; + padding-left : 30px; + padding-right : 30px; + text-align : left; +} +#BoxCenter.NoJsHeight { + height : 100%; +} + +#FrameBox { + width : 100%; + z-index : 3; +} +#FrameBox.NoJsHeight { + height : 100%; +} +#FrameBox iframe { + position : relative; + left : -30px; + width : 100%; + width : calc(100% + 60px); + height : 100%; + margin-right : -100%; + margin-right : calc(-100% - 60px); + float : left; + border : 0px none white; +} +#BoxLeft { + position : static; + width : 300px; + margin-left : -300px; + float : left; + overflow : hidden; + white-space : nowrap; +} +#BoxMiddle.leftBoxVisible { + padding-left : 300px; +} +.NoJsHeight #BoxLeft { + display : none; +} +#inhaltsverzeichnis { + margin : 0px; + padding-top : 10px; + position : relative; + padding-left : 0px; + width : calc(100% - 20px); + vertical-align : top; + white-space : normal; + color : white; + font-size : 0.8em; + text-align : left; + padding-left : 20px; +} +#inhaltsverzeichnis li { + list-style-type : none; + padding-left : 1em; + line-height : 1.3em; + margin-bottom : 0.2em; +} +#inhaltsverzeichnis li span { + display : inline-block; + margin-right : 0.08em; + margin-left : -1em; + min-width : 1em; +} +#inhaltsverzeichnis ol li { + padding-left : 2em; +} +#inhaltsverzeichnis ol li span { + margin-left : -2em; + min-width : 2em; +} +#inhaltsverzeichnis ol ol li { + padding-left : 3em; +} +#inhaltsverzeichnis ol ol li span { + margin-left : -3em; + min-width : 3em; +} +#inhaltsverzeichnis ol { + padding : 0px; + padding-left : 10px; + margin : 0px; +} +#inhaltsverzeichnis a { + text-decoration : none; +} +#inhaltsverzeichnis a.active { + text-decoration : underline; + color : black; +} + + + +@media handheld, screen and (max-width: 1100px) { + body.main { + overflow-x : auto; + } + #BoxTop .logo, #BoxTop h1, #BoxTop h2 { + top : 20px; + left : 5%; + } + #BoxTop .subheadingLink { + font-size : 1.3em; + margin-left : 5%; + } + #BoxTop { + top : 0px; + height : 200px; + } + #BoxTop .bgImage { + padding-top : 13px; + } + #hessenlink { + display : none; + } + #BoxLeft { + position: absolute; + top: 0px; + left: 0px; + padding-left: 1em; + padding-right: 1em; + width: 100vw; + z-index: 3; + margin-left: 0px; + background-color: white; + } + #BoxLeft::before { + content: '\25C0'; + position: absolute; + top: 0px; + left: 0px; + } + #BoxLeft::after { + content: '\25B6'; + position: absolute; + top: 5px; + right: 0px; + } + #BoxMiddle.withLeftBox { + left : 0px !important; + } + #BoxMiddle { + left : 0px !important; + top : 200px; + } + #BoxMiddle.withLeftBox #BoxLeft { + margin-left : 0px !important; + margin-right : 0px; + } + #BoxMiddle.withLeftBox #BoxCenter { + top : 3em; + left : 0px; + } + .NoJsHeight #BoxMiddle.withLeftBox #BoxCenter { + left : 0px; + } + #BoxCenter { + width : 100vw; + } + #BoxCenter { + padding-left : 10px; + padding-right : 10px; + } + #BoxLeft { + position: absolute; + top : 0px; + left : 0px; + padding-left : 1em; + padding-right : 1em; + width : 100vw; + z-index : 3; + margin-left : 0px; + background-color : white; + } + #BoxMiddle.leftBoxVisible { + padding-left : 0px; + } + #BoxLeft:before { + content : '\25C0'; + position : absolute; + top : 0px; + left : 0px; + } + #BoxLeft:after { + content : '\25B6'; + position : absolute; + top : 5px; + right : 0px; + } + #inhaltsverzeichnis { + margin-top : 0px !important; + white-space : nowrap; + overflow-x : scroll; + padding-bottom : 5px; + } + #BoxLeft ol ol { + display : none; + } + #BoxLeft ol li { + display : inline-block; + margin-right : 2em; + } + #genderlabel { display: none !important; } +} + + +@media handheld, screen and (max-width: 800px) { + #BoxMiddle { + right : auto; + width : 800px; + } + #BoxCenter { + width : 800px; + } +} diff --git a/css/snippets/carousel-item.css b/css/snippets/carousel-item.css new file mode 100644 index 0000000..b615a52 --- /dev/null +++ b/css/snippets/carousel-item.css @@ -0,0 +1,68 @@ +.carousel-item { + scroll-snap-align: center; +} +@media (min-width: 400px) { + .carousel-item { + padding: 2rem; + margin-right: var(--space-5); + } +} +.carousel-item--candidate, +.carousel-item--livestream, +.carousel-item--blog-post, +.carousel-item--press-release, +.carousel-item--press-external { + padding: 0; +} +.carousel-item-preview { + padding: 1.5rem; + height: 100%; +} +.carousel-item-preview p:last-child { + margin-bottom: 0; +} +.carousel-item-label { + margin-bottom: var(--space-2); + font-family: var(--text); + font-weight: var(--text-semi-bold); + color: var(--green); + font-size: 0.8rem; +} +.carousel-item-title { + font-family: var(--headline); + font-weight: var(--headline-extrabold); + margin-bottom: var(--space-2); +} +.carousel-item-date { + margin-top: auto; + font-family: var(--text); + font-weight: var(--text-semi-bold); + color: var(--grey); + font-size: 1rem; +} +[data-whatintent="keyboard"] .carousel-item:focus.carousel-item:focus { + border-color: var(--black); + background-color: var(--black); + color: var(--white); + outline: 0; +} +.carousel-item:first-child { + margin-left: var(--grid-gutter); +} +@media (min-width: 1200px) { + .carousel-item:first-child { + margin-left: calc((100vw - 1120px) / 2); + } +} +.carousel-item-text { + font-size: 0.875rem; + margin-bottom: var(--space-2); +} +@media (min-width: 400px) { + .carousel-item-text { + font-size: 1rem; + } +} +.carousel-item-link { + margin-top: auto; +} diff --git a/css/snippets/collection-items.css b/css/snippets/collection-items.css new file mode 100644 index 0000000..d890da8 --- /dev/null +++ b/css/snippets/collection-items.css @@ -0,0 +1,28 @@ +.collection-items { + margin-bottom: var(--space-5); +} +.collection-items__item { + width: auto; + max-width: auto; +} +.collection-items__preview { + padding: 1.2rem; + height: 100%; +} +.collection-items__label { + font-family: var(--text); + font-weight: var(--text-semi-bold); + color: var(--green); + font-size: 0.8rem; + margin-bottom: var(--space-2); +} +.collection-items__title { + margin-bottom: var(--space-2); + font-size: 1.3rem; +} +.collection-items__date { + margin-top: auto; + font-family: var(--text); + font-weight: var(--text-semi-bold); + color: var(--grey); +} diff --git a/css/snippets/district-list.css b/css/snippets/district-list.css new file mode 100644 index 0000000..f0dd436 --- /dev/null +++ b/css/snippets/district-list.css @@ -0,0 +1,122 @@ +.district-list { + padding-top: var(--block-space); + padding-bottom: var(--block-space); +} +.district-list--bold { + --bg-color: var(--green); + --highlight-color: var(--white); +} + +.district-list__title { + margin-bottom: var(--space-5); + text-align: center; +} + +.district-list__content { + position: relative; + width: 87.5vw; + max-width: var(--block-text-wide-width); + margin-left: auto; + margin-right: auto; +} + +.district-list__list { + margin: 0; + padding: 0; + list-style: none; +} + +.district-list__position { + font-family: var(--text); + font-weight: var(--text-bold); + text-align: center; +} + +.district-list__candidate-neutral { + padding: var(--space-2) 0; + column-gap: var(--space-3); + margin-bottom: var(--space-2); + width: 100%; + max-width: var(--block-text-wide-width); + min-height: calc(50px + var(--space-2) * 2); + text-decoration: none; + row-gap: var(--space-2); + border-bottom: 2px solid var(--grey-light); +} +.district-list__list > li:last-child .district-list__candidate-neutral { + border-bottom: 0; +} + +.district-list__candidate-bold { + margin-bottom: var(--space-2); + text-decoration: none; +} +.district-list__candidate-bold div.district-list__photo { + box-shadow: 0 0 0 2px var(--black); +} +.district-list__photo { + width: 50px; + height: 50px; + border-radius: 100%; + object-fit: cover; + background: var(--green); +} +.district-list__name { + font-family: var(--text); + font-weight: var(--text-semi-bold); +} +.district-list__arrow { + display: none; +} +@media (min-width: 600px) { + .district-list__candidate-neutral { + min-height: calc(80px + var(--space-2) * 2); + padding: var(--space-4); + margin-bottom: 0; + } + .district-list__list > li:first-child .district-list__candidate-neutral { + border-top: 2px solid var(--grey-light); + } + .district-list__list > li:last-child .district-list__candidate-neutral { + border-bottom: 2px solid var(--grey-light); + } + + .district-list__candidate-bold { + padding: var(--space-2) var(--space-4); + background: var(--white); + border: 4px solid var(--black); + } + .district-list__candidate-bold div.district-list__photo { + box-shadow: none; + } + .district-list__photo { + width: 80px; + height: 80px; + } + .district-list__position { + font-family: var(--text); + font-weight: var(--text-bold); + font-size: 1.3rem; + } + .district-list__name { + margin-bottom: 0; + font-family: var(--headline); + font-weight: var(--headline-extrabold); + font-size: 1.3rem; + } + .district-list__arrow { + display: block; + transform: scale(1.5); + } + [data-whatintent="keyboard"] .district-list__candidate-bold:focus { + color: var(--white); + background: var(--black); + outline: 0; + } + [data-whatintent="keyboard"] + .district-list__candidate-bold:focus + .district-list__arrow + path { + stroke: white; + } +} diff --git a/css/snippets/event-intro.css b/css/snippets/event-intro.css new file mode 100644 index 0000000..2d8b5f5 --- /dev/null +++ b/css/snippets/event-intro.css @@ -0,0 +1,54 @@ +.event-intro { + margin: var(--space-30) auto var(--space-7) auto; + width: 87.5vw; + max-width: var(--block-text-wide-width); +} +@media (max-width: 500px) { + .event-intro h1 { + font-size: 1.8rem; + } +} +.event-intro__meta { + margin-bottom: var(--space-7); + align-content: baseline; +} +@media (min-width: 600px) { +} + +.event-intro__bottom { + margin: var(--space-5) auto var(--space-10) auto; + width: 87.5vw; + max-width: var(--block-text-width); +} +.event-intro__bottom:last-child { + margin-bottom: var(--space-20); +} + +.event-intro__description { + font-family: var(--headline); + font-weight: var(--headline-extra-bold); + color: var(--grey); +} + +.event-intro__date, +.event-intro__from-to, +.event-intro__place { + font-family: var(--text); + font-weight: var(--text-bold); +} +.event-intro__date { + display: block; +} + +@media (min-width: 400px) { + .event-intro__date { + display: inline; + } + .event-intro__from-to::before { + content: " | "; + } +} + +.event-intro__image { + align-self: center; +} diff --git a/css/snippets/event.css b/css/snippets/event.css new file mode 100644 index 0000000..7b0bdce --- /dev/null +++ b/css/snippets/event.css @@ -0,0 +1,66 @@ +.event { + margin-bottom: var(--space-2); + padding: var(--space-4); + width: 100%; + max-width: var(--block-text-wide-width); + align-items: center; + border: 4px solid var(--grey-light); + background: var(--white); + text-decoration: none; +} +.event--bold { + border-color: var(--black); +} +.event__date { + font-family: var(--text); + font-weight: var(--text-bold); + line-height: 1; + margin-bottom: var(--space-1); +} +.event__date::after { + content: " – "; +} +.event__time { + font-family: var(--text); + font-weight: var(--text-semi-bold); + color: var(--green); +} +.event__title { + margin-bottom: var(--space-2); +} +.event__description { + font-weight: var(--text-semi-bold); + margin-bottom: 0; + color: var(--grey); +} +.event__arrow { + display: none; +} +@media (min-width: 600px) { + .event { + padding: var(--space-4) var(--space-5); + } + .event__date { + display: block; + font-size: 1.6rem; + } + .event__date::after { + content: initial; + } + .event__title { + transform: translateY(0.1em); + margin-bottom: 0; + } + .event__arrow { + display: block; + transform: scale(1.5); + } + [data-whatintent="keyboard"] .event:focus { + color: var(--white); + background: var(--black); + outline: 0; + } + [data-whatintent="keyboard"] .event:focus .event__arrow path { + stroke: white; + } +} diff --git a/css/snippets/footer.css b/css/snippets/footer.css new file mode 100644 index 0000000..1e881dc --- /dev/null +++ b/css/snippets/footer.css @@ -0,0 +1,93 @@ +.footer { + margin-top: calc(var(--diagonal-space) * -1); + padding-top: calc(var(--diagonal-space) + var(--space-10)); + padding-bottom: var(--space-10); + background-color: var(--grey-light); + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + row-gap: 4rem; +} +.footer__primary-navigation, +.footer__secondary-navigation, +.footer__ternary-navigation { + margin: 0; + padding: 0; + list-style: none; +} +.footer__primary-navigation li, +.footer__secondary-navigation li, +.footer__ternary-navigation li { + margin-bottom: var(--space-3); +} + +.footer__link { + font-size: 0.8rem; +} +.footer__link:hover, +.footer__link:focus { + border-color: transparent; +} + +.footer__newsletter-form fieldset { + border: 0; + margin: 0; + padding: 0; +} +.footer__newsletter-input { + margin-bottom: var(--space-3); + padding: 1.25em 1.75em; + width: 100%; + font-family: var(--text); + font-weight: var(--text-regular); + font-size: 1rem; + background: transparent; + border: 1px solid var(--white); +} +.footer__newsletter-input::placeholder { + font-family: var(--text); + font-weight: var(--text-regular); +} +.footer__newsletter-button { + font-size: 1rem; +} +.footer__newsletter-button:hover, +.footer__newsletter-button:focus { +} + +.footer__social-networks { + list-style: none; + margin: 0; + padding: 0; +} + +.footer__social-network { + filter: invert(1); + width: 24px; + transition: transform 0.2s; +} +.footer__social-network:hover, +.footer__social-network:focus { + transform: scale(1.2); +} +@media (min-width: 500px) { + .footer__social-network { + width: 32px; + } + .footer__social-networks li:not(:first-child) { + margin-left: var(--space-7); + } +} +@media (min-width: 800px) { + .footer { + padding-bottom: var(--space-20); + } + .footer__ternary-navigation { + margin-bottom: 0; + } + .footer__ternary-navigation li { + margin-bottom: 0; + } + .footer__ternary-navigation li:not(:last-child) { + margin-right: 4rem; + } +} diff --git a/css/snippets/navigation.css b/css/snippets/navigation.css new file mode 100644 index 0000000..465d498 --- /dev/null +++ b/css/snippets/navigation.css @@ -0,0 +1,252 @@ +.nav { + --color: var(--black); + --color--active: var(--white); + --color-background: var(--black); + + --button-text: var(--black); + --button-background: transparent; + --button-text--active: var(--white); + --button-background--active: var(--black); + --button-outline: var(--black); + --button-outline--active: transparent; + z-index: 10; +} +.nav--blackAndActiveIsWhite { + --color: var(--black); + --color--active: var(--black); + --color-background: var(--white); +} +.nav--whiteAndActiveIsBlack { + --color: var(--white); + --color--active: var(--white); + --color-background: var(--black); +} +.nav--whiteAndActiveIsWhite { + --color: var(--white); + --color--active: var(--black); + --color-background: var(--white); +} +.nav--whiteAndActiveIsBlack, +.nav--whiteAndActiveIsWhite { + --button-text: var(--white); + --button-background: transparent; + --button-text--active: var(--black); + --button-background--active: var(--white); + --button-outline: var(--white); + --button-outline--active: transparent; +} +.nav--showNavigationGradient, +.nav--showNavigationGradient.nav--blackAndActiveIsWhite, +.nav--showNavigationGradient.nav--whiteAndActiveIsBlack, +.nav--showNavigationGradient.nav--whiteAndActiveIsWhite { + --button-text: var(--black); + --button-background: var(--green); + --button-text--active: var(--black); + --button-background--active: var(--white); + --button-outline: transparent; + --button-outline--active: transparent; +} + +.nav { + position: absolute; + width: 100%; + height: 120px; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; +} +.nav__container { + align-items: center; +} +@media (min-width: 800px) { + .nav { + height: 200px; + } +} +.nav__logo { + z-index: 3; +} +.nav__logo img { + max-height: 80px; + max-width: 100%; + object-fit: contain; +} +.nav__links { + visibility: hidden; + padding-top: var(--space-20); + padding-bottom: var(--space-10); + background: var(--green); + transition: clip-path 0.3s, visibility 0.3s; + clip-path: polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%); +} +@media (max-width: 1079px) { + .nav__container { + pointer-events: none; + } + .nav__logo, + .nav__menu-button { + pointer-events: all; + } + .nav[aria-expanded="true"] .nav__container { + pointer-events: all; + } + .nav[aria-expanded="true"] .nav__links { + z-index: 2; + clip-path: polygon( + 0% 0%, + 100% 0%, + 100% calc(100% - calc(var(--diagonal) / 2)), + 0% 100% + ); + } +} +@media (min-width: 1080px) { + .nav__links { + visibility: visible; + padding: 0; + } +} +@media (max-width: 1079px) { + .nav[aria-expanded="true"] .nav__links { + visibility: visible; + } +} +.nav__item { + color: var(--color); + font-family: var(--headline); + font-weight: var(--headline-extrabold); + text-decoration: none; +} +@media (max-width: 1079px) { + .nav__item { + color: var(--black); + font-size: 1.25rem; + } +} +.nav__item--active { + position: relative; + color: var(--color--active); + z-index: 1; +} +.nav__item--active::before { + position: absolute; + top: -40%; + left: -15%; + content: ""; + width: 130%; + height: calc(180% + 5px); + background-color: var(--color-background); + transform: rotate(-1.5deg); + z-index: -1; +} +.nav__link:hover, +.nav__item--active .nav__link, +.nav__item:focus .nav__link { + border-bottom: 0.15em solid currentColor; +} +.nav__item:focus { + outline: 0; +} +.nav__menu-button { + justify-self: flex-end; + grid-row: 2 / 3; + grid-column: 11 / 16; + padding: 0.75em 1.25em; + font-size: 0.8rem; + font-family: var(--headline); + font-weight: var(--headline-extrabold); + text-decoration: none; + background: transparent; + border: none; + color: var(--button-text); + background: var(--button-background); + box-shadow: inset 0 0 0 2px var(--button-outline); + border-radius: 100px; + cursor: pointer; + z-index: 3; +} +.nav[aria-expanded="true"] .nav__menu-button { + box-shadow: inset 0 0 0 2px var(--black); +} +[data-whatinput="mouse"] .nav__menu-button { + outline: 0; +} + +@media (min-width: 600px) { + .nav__menu-button { + grid-column: 14 / 16; + } +} +@media (min-width: 1080px) { + .nav__links { + clip-path: none; + background: transparent; + } + .nav__menu-button { + display: none; + } + .nav__item:last-child { + padding: 0.75em 1.25em; + font-family: var(--headline); + font-weight: var(--headline-extrabold); + text-decoration: none; + color: var(--color); + background: transparent; + border: none; + border-radius: 100px; + cursor: pointer; + color: var(--button-text); + background: var(--button-background); + box-shadow: inset 0 0 0 2px var(--button-outline); + transition: transform 0.2s ease-out; + } + .nav__item.nav__item--active { + color: var(--color--active); + background: var(--color); + } + .nav__item--active:last-child::before { + content: initial; + } + .nav__item--active:last-child .nav__link, + .nav__item:last-child:hover .nav__link, + .nav__item:last-child:focus .nav__link { + border: none; + } + .nav__item:last-child:hover, + .nav__item:last-child:focus { + color: var(--button-text--active); + background: var(--button-background--active); + box-shadow: inset 0 0 0 2px var(--button-outline--active); + } + .nav__item:last-child:active { + transform: scale(0.96); + } +} +@media (max-width: 1079px) { + .nav[aria-expanded="true"].nav--whiteAndActiveIsWhite, + .nav[aria-expanded="true"].nav--whiteAndActiveIsBlack { + --color: var(--black); + --color--active: var(--black); + --color-background: var(--white); + } + .nav[aria-expanded="true"].nav--whiteAndActiveIsWhite .nav__logo, + .nav[aria-expanded="true"].nav--whiteAndActiveIsBlack .nav__logo { + filter: invert(1); + transition: filter 0.2s; + } +} +.nav--whiteAndActiveIsBlack .nav__logo, +.nav--whiteAndActiveIsWhite .nav__logo { + filter: none; +} + +.nav--showNavigationGradient { + background: linear-gradient( + to bottom, + rgba(255, 255, 255, 0.9), + rgba(255, 255, 255, 0) + ); +} +.nav--showNavigationGradient.nav--whiteAndActiveIsBlack, +.nav--showNavigationGradient.nav--whiteAndActiveIsWhite { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0)); +} diff --git a/css/snippets/sibling-navigator.css b/css/snippets/sibling-navigator.css new file mode 100644 index 0000000..79e56ec --- /dev/null +++ b/css/snippets/sibling-navigator.css @@ -0,0 +1,39 @@ +.sibling-navigator { + grid-column: 3 / -3; + display: grid; + row-gap: var(--space-5); + margin-top: var(--space-10); + margin-bottom: var(--space-20); + padding-top: var(--space-10); + border-top: 4px solid var(--black); +} + +@media (min-width: 800px) { + .sibling-navigator { + grid-template-columns: repeat(2, 1fr); + column-gap: var(--space-15); + } + .sibling-navigator__prev { + grid-row: 1; + } + .sibling-navigator__next { + grid-column: 2; + } +} + +.sibling-navigator__next { + grid-row: 1; +} + +.sibling-navigator__prev, +.sibling-navigator__next { + display: block; + text-decoration: none; +} + +.sibling-navigator__label { + font-family: var(--text); + font-weight: var(--text-semi-bold); + margin-bottom: var(--space-2); + color: var(--green); +} diff --git a/css/snippets/text-intro.css b/css/snippets/text-intro.css new file mode 100644 index 0000000..cdf8f6b --- /dev/null +++ b/css/snippets/text-intro.css @@ -0,0 +1,30 @@ +.text-intro { + margin: var(--space-30) auto var(--space-7) auto; + width: 100%; +} +.redaktion { + font-style: italic; + font-family: 'Perspective Sans'; +} +@media (max-width: 500px) { + .text-intro h1 { + font-size: 1.8rem; + } +} +.text-intro__meta { + font-family: var(--text); + font-weight: var(--text-bold); + color: var(--grey); + margin-bottom: var(--space-2); +} +.text-intro__first { + display: block; +} +@media (min-width: 600px) { + .text-intro__first { + display: inline; + } + .text-intro__second::before { + content: " | "; + } +} diff --git a/css/templates/candidate.css b/css/templates/candidate.css new file mode 100644 index 0000000..e97d14b --- /dev/null +++ b/css/templates/candidate.css @@ -0,0 +1,101 @@ +.candidate { + margin-bottom: var(--space-20); +} + +.candidate__photo { + margin-top: var(--space-30); + margin-bottom: var(--space-8); + margin-left: auto; + margin-right: auto; + width: 61.8%; + box-shadow: 2vw 2vw 0 0 var(--green); +} + +.candidate__name { + font-size: 1.5rem; + text-align: center; +} +.candidate__name:first-child { + margin-top: var(--space-30); +} + +.candidate__social-media { + justify-content: center; + margin: 0; + margin-bottom: var(--space-2); + padding: 0; + list-style: none; +} + +.candidate__social-network { + margin-right: var(--space-2); + width: 24px; + transition: transform 0.2s; +} +@media (min-width: 1000px) { + .candidate__social-network { + width: 32px; + } +} +.candidate__social-network:hover, +.candidate__social-network:focus { + transform: scale(1.2); +} + +.candidate__details { + margin-top: var(--space-5); + margin-bottom: var(--space-10); +} +.candidate__details dd { + font-family: var(--text); + font-weight: var(--text-regular); +} +.candidate__details dd:nth-last-child(2n) { + margin-bottom: 0; +} +.candidate__details dd li p { + margin-bottom: var(--space-1); +} + +@media (min-width: 501px) { + .candidate h2 { + font-size: 1.5rem; + } +} + +@media (min-width: 600px) { + .candidate__details { + display: block; + margin-left: auto; + margin-right: auto; + } + .candidate__details dd { + margin-bottom: var(--space-2); + } +} + +@media (min-width: 1000px) { + .candidate__photo { + grid-column: 2 / 6; + grid-row: 1 / 3; + width: 100%; + } + .candidate__info { + margin-top: var(--space-30); + grid-column: 7 / -2; + } + .candidate__name { + font-size: 2.4rem; + text-align: left; + } + .candidate__name:first-child { + margin-top: 0; + } + .candidate__details { + margin-left: initial; + margin-right: initial; + } + .candidate__photo + .candidate__name { + margin-top: var(--space-30); + } +} diff --git a/css/templates/collection.css b/css/templates/collection.css new file mode 100644 index 0000000..bba7b1a --- /dev/null +++ b/css/templates/collection.css @@ -0,0 +1,30 @@ +.collection { + padding-top: var(--space-30); + padding-bottom: var(--space-10); +} +.collection__list { + margin: 0; + padding: 0; + list-style: none; + margin-bottom: var(--space-4); +} +.collection__list li:before { + display: none; +} +.collection__link { + display: block; + font-family: var(--text); + font-weight: var(--text-semi-bold); + font-size: 0.8rem; + text-decoration: none; + padding: 0.5em 0.75em; + border: 0.15em solid var(--black); + margin-right: var(--space-2); + margin-bottom: var(--space-2); +} +.collection__link:hover, +.collection__link:focus, +.collection__link--active { + color: var(--white); + background-color: var(--black); +} diff --git a/css/templates/district.css b/css/templates/district.css new file mode 100644 index 0000000..b96ed99 --- /dev/null +++ b/css/templates/district.css @@ -0,0 +1,4 @@ +.district { + margin-top: var(--space-15); + margin-bottom: var(--space-20); +} diff --git a/css/templates/donations.css b/css/templates/donations.css new file mode 100644 index 0000000..1865b11 --- /dev/null +++ b/css/templates/donations.css @@ -0,0 +1,116 @@ +.donations { + padding-bottom: var(--space-10); +} + +.donations__intro { +} +.donations__intro-text { + margin-bottom: var(--space-8); +} +.donations__intro-text h1 { + max-width: 16ch; +} +.donations__intro-text h1 u { + background: var(--white); +} +.donations__intro-text p { + max-width: 60ch; +} +.donations__intro-widget { + padding: var(--space-5); + min-height: 300px; + background: var(--white); + border: 0.2rem solid var(--black); +} +.donations__intro-widget iframe { + vertical-align: middle; +} +@media (min-width: 900px) { + .donations__intro-text { + grid-column: 2 / 8; + } + .donations__intro-widget { + grid-column: 9 / -2; + } +} + +.donations__block { + --bg-color: var(--green); + --highlight-color: var(--white); + padding: var(--space-10) 0; + margin-top: var(--space-8); + margin-bottom: var(--space-10); +} + +.donations__headline { + margin-bottom: var(--space-5); +} + +.donations__box { + padding: var(--space-3); + margin-bottom: var(--space-5); + column-gap: var(--space-10); + background: var(--white); + border: 4px solid var(--black); +} +@media (min-width: 400px) { + .donations__box { + padding: var(--space-5); + width: 100%; + max-width: 500px; + margin-left: auto; + margin-right: auto; + } +} + +.donations__box-giro > div { + font-family: var(--text); + margin-bottom: var(--space-1); +} +.donations__box-giro > h4 { + margin-top: var(--space-4); +} + +.donations__box-image { + margin-bottom: var(--space-4); +} +.donations__box-giro .donations__box-image { + margin-bottom: 0; + max-width: 200px; +} + +.donations__outcome { + width: 87.5vw; + margin-left: auto; + margin-right: auto; + max-width: var(--block-text-width); + margin-bottom: var(--space-10); +} +.donations__outcome-list em { + line-height: 1.5; + font-size: 0.8rem; + color: var(--grey); + font-style: normal; +} + +.donations__outcome-list em a { + color: var(--grey); +} + +.donations__other-options { + padding-top: var(--block-space); + padding-bottom: var(--block-space); + margin-bottom: var(--space-10); +} +.donations__other-options h2 { + margin-bottom: var(--space-3); +} +.donations__other-options p { + margin-bottom: var(--space-5); +} + +@media (min-width: 1120px) { + .donations__box { + max-width: none; + } +} diff --git a/css/templates/events.css b/css/templates/events.css new file mode 100644 index 0000000..f933c41 --- /dev/null +++ b/css/templates/events.css @@ -0,0 +1,18 @@ +.events::before { + content: ""; + position: absolute; + width: 100%; + height: 82vh; + background: var(--green); + z-index: -1; + clip-path: polygon(0% 0%, 100% 0, 100% calc(100% - 2.5vw), 0% 100%); +} + +.events__list { + margin-top: var(--space-5); + margin-bottom: var(--space-20); + width: 87.5vw; + margin-left: auto; + margin-right: auto; + max-width: var(--block-text-wide-width); +} \ No newline at end of file diff --git a/css/templates/livestream.css b/css/templates/livestream.css new file mode 100644 index 0000000..0cc785f --- /dev/null +++ b/css/templates/livestream.css @@ -0,0 +1,86 @@ +.livestream { + padding-bottom: var(--space-10); + grid-column: 1 / -1; +} +.livestream::before { + content: ""; + background: var(--green); + grid-column: 1 / -1; + grid-row: 1 / 4; + clip-path: polygon(0% 0%, 100% 0, 100% calc(100% - 2.5vw), 0% 100%); + z-index: -1; +} +.livestream__title { + margin-top: var(--space-30); + grid-row: 1 / 2; +} +@media (max-width: 500px) { + .livestream__title { + font-size: 1.8rem; + } +} +.livestream__date { + font-family: var(--text); + font-weight: var(--text-bold); + margin-bottom: var(--space-4); + grid-row: 2 / 3; +} +@media (min-width: 900px) { + .livestream__title { + grid-column: 4 / -4; + } + .livestream__date { + grid-column: 4 / -4; + } +} + +.livestream__container { + position: relative; + height: 0; + padding-bottom: 56.25%; + grid-row: 3 / 5; +} +@media (min-width: 900px) { + .livestream__container { + grid-column: 3 / -3; + } +} + +.livestream__play-button { + position: absolute; + top: calc(50% - 30px); + left: calc(50% - 30px); + display: block; + width: 60px; + height: 60px; + transform: scale(1); + transition: transform 0.2s; +} +@media (min-width: 600px) { + .livestream__play-button { + top: calc(50% - 60px); + left: calc(50% - 60px); + width: 120px; + height: 120px; + } +} + +.livestream__video:hover .livestream__play-button { + transform: scale(1.1); +} + +.livestream__video { + position: relative; + display: block; + height: 0; + margin-bottom: var(--space-7); + padding-bottom: 56.25%; +} +.livestream__thumbnail, +.livestream__video--playing iframe { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} diff --git a/css/templates/program-chapter.css b/css/templates/program-chapter.css new file mode 100644 index 0000000..ba16eec --- /dev/null +++ b/css/templates/program-chapter.css @@ -0,0 +1,81 @@ +.program-chapter__anchor { + position: relative; + float: right; + margin-left: 1.25em; + margin-top: -0.1em; + vertical-align: middle; + text-decoration: none; + opacity: 0.5; + transition: opacity 0.2s; +} + +[data-whatintent="mouse"] .program-chapter__anchor:focus { + outline: 0; +} + +.program-chapter__anchor:after { + position: absolute; + bottom: 2px; + display: block; + padding: 0.3em 1em; + left: -120px; + color: #fff; + content: attr(data-copied); + font-size: 14px; + white-space: nowrap; + background: #000; + border-radius: 0.3em; + visibility: hidden; + opacity: 0; + transition: opacity 0.2s linear; +} + +.program-chapter__anchor:before { + position: absolute; + left: -13px; + bottom: 12px; + display: block; + content: ""; + z-index: 99; + border: solid; + border-color: #000 transparent; + border-width: 0 5px 5px 5px; + transform: rotate(90deg); + visibility: hidden; + opacity: 0; + transition: opacity 0.2s linear; +} + +@media (min-width: 800px) { + .program-chapter__anchor { + float: left; + margin-left: -1.25em; + margin-top: -0.075em; + transition: opacity 0.2s; + } + + .program-chapter__anchor:after { + bottom: 36px; + left: -42px; + border-radius: 0.5em; + } + .program-chapter__anchor:before { + left: 5px; + bottom: 29px; + border-width: 7px 7px 0 7px; + transform: none; + } +} + +h3:hover .program-chapter__anchor { + opacity: 1; +} + +.program-chapter__anchor--copied { + opacity: 1; +} +.program-chapter__anchor--copied:after, +.program-chapter__anchor--copied:before { + visibility: visible; + opacity: 1; +} diff --git a/css/templates/program.css b/css/templates/program.css new file mode 100644 index 0000000..53aaa6e --- /dev/null +++ b/css/templates/program.css @@ -0,0 +1,118 @@ +.program__sections { + margin-top: var(--block-space); + margin-bottom: var(--space-10); + grid-column: 2 / -2; +} +.program__topic-list { + display: flex; + flex-wrap: wrap; + margin: 0; + padding: 0; + list-style: none; + margin-bottom: var(--space-3); +} +.program__topic-link { + display: block; + font-family: var(--text); + font-weight: var(--text-semi-bold); + font-size: 0.8rem; + text-decoration: none; + padding: 0.5em 0.75em; + border: 0.15em solid var(--black); + margin-right: var(--space-2); + margin-bottom: var(--space-2); +} +.program__topic-link:hover, +.program__topic-link:focus, +.program__topic-link--active { + color: var(--white); + background-color: var(--black); +} +.program__download-link { + display: inline-block; +} + +.program__chapters-wrapper { + --bg-color: var(--green); + position: relative; + margin-bottom: var(--space-10); + padding-bottom: var(--space-15); +} +.program__chapters-wrapper::before { + content: ""; + position: absolute; + top: calc(-0.5 * var(--diagonal)); + left: 0; + width: 100%; + height: calc(100% + var(--diagonal)); + clip-path: polygon( + 0% calc(var(--diagonal) / 2 + 20%), + 100% 20%, + 100% calc(100% - calc(var(--diagonal) / 2)), + 0% 100% + ); + background: var(--bg-color); + z-index: 1; +} +.program__chapters-wrapper > * { + z-index: 1; +} + +.program__chapters { + grid-column: 2 / -2; + display: grid; + grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); + grid-gap: var(--space-5); +} + +p.program__chapter-label { + font-family: var(--text); + font-weight: var(--text-semi-bold); + margin-bottom: var(--space-2); + color: var(--green); +} + +p + .program__chapter-label { + margin-top: var(--space-10); +} + +.program__chapter { + display: flex; + flex-direction: column; + padding: 1.5rem; + background-color: var(--white); + border: 4px solid var(--black); + text-decoration: none; +} +.program__chapter .program__read-more { + align-self: flex-start; + margin-top: auto; + font-family: var(--text); + font-weight: var(--text-bold); + border-bottom: 0.15em solid currentColor; +} +@media (min-width: 500px) { + .program__chapter p, + .program__chapter .program__read-more { + font-size: 0.8rem; + } +} + +.program__follow-up { + display: grid; + row-gap: var(--space-15); + margin-top: var(--space-10); + margin-bottom: var(--space-20); + grid-column: 2 / -2; +} + +.program__follow-up .button { + display: inline-block; +} + +@media (min-width: 800px) { + .program__follow-up { + grid-template-columns: repeat(2, 1fr); + column-gap: var(--space-10); + } +} diff --git a/css/templates/question.css b/css/templates/question.css new file mode 100644 index 0000000..604c809 --- /dev/null +++ b/css/templates/question.css @@ -0,0 +1,43 @@ +.question__navigation { + grid-column: 1 / -1; + max-width: var(--block-text-width); + width: 87.5vw; + margin-left: auto; + margin-right: auto; + display: grid; + grid-template-columns: 3fr 1fr 3fr; + grid-template-rows: auto auto; + row-gap: var(--space-5); + margin-top: var(--space-4); + margin-bottom: var(--space-4); + padding-top: var(--space-5); + padding-bottom: var(--space-5); + border-top: 4px solid var(--black); + word-break: break-word; +} + +.question__navigation-left { + grid-column: 1 / -1; +} +.question__navigation-right { + grid-row-start: 1; + grid-column: 1 / -1; +} +.question__navigation-all { + grid-column: 1 / -1; + justify-self: center; + margin-top: var(--space-4); + margin-bottom: var(--space-7); +} + +@media (min-width: 400px) { + .question__navigation-left { + grid-column: 1 / 2; + } + .question__navigation-right { + grid-column: 3 / 4; + } + .question__navigation-all { + grid-row-start: 2; + } +} diff --git a/css/templates/questions.css b/css/templates/questions.css new file mode 100644 index 0000000..a408243 --- /dev/null +++ b/css/templates/questions.css @@ -0,0 +1,7 @@ +.questions { + margin-top: var(--space-5) !important; +} + +.questions__question { + margin-bottom: var(--space-4); +} \ No newline at end of file diff --git a/css/twingle.css b/css/twingle.css new file mode 100644 index 0000000..21cf68a --- /dev/null +++ b/css/twingle.css @@ -0,0 +1,16 @@ +.widget-header.widget { + background: white; +} + +.progress-meter { + background-color: #00eccd; +} + +.progress .progress-meter + .text, +.progress .progress-meter + .text span { + color: black; +} + +.progress .target { + color: black; +} diff --git a/css/video-js.min.css b/css/video-js.min.css new file mode 100644 index 0000000..17702b1 --- /dev/null +++ b/css/video-js.min.css @@ -0,0 +1 @@ +@charset "UTF-8";.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.vjs-modal-dialog .vjs-modal-dialog-content{position:absolute;top:0;left:0;width:100%;height:100%}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.vjs-button>.vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABDkAAsAAAAAG6gAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV3hY21hcAAAAYQAAADaAAADPv749/pnbHlmAAACYAAAC3AAABHQZg6OcWhlYWQAAA3QAAAAKwAAADYZw251aGhlYQAADfwAAAAdAAAAJA+RCLFobXR4AAAOHAAAABMAAACM744AAGxvY2EAAA4wAAAASAAAAEhF6kqubWF4cAAADngAAAAfAAAAIAE0AIFuYW1lAAAOmAAAASUAAAIK1cf1oHBvc3QAAA/AAAABJAAAAdPExYuNeJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGS7wTiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGJHcRdyA4RZgQRADK3CxEAAHic7dFZbsMgAEXRS0ycyZnnOeG7y+qC8pU1dHusIOXxuoxaOlwZYWQB0Aea4quIEN4E9LzKbKjzDeM6H/mua6Lmc/p8yhg0lvdYx15ZG8uOLQOGjMp3EzqmzJizYMmKNRu27Nhz4MiJMxeu3Ljz4Ekqm7T8P52G8PP3lnTOVk++Z6iN6QZzNN1F7ptuN7eGOjDUoaGODHVsuvU8MdTO9Hd5aqgzQ50b6sJQl4a6MtS1oW4MdWuoO0PdG+rBUI+GejLUs6FeDPVqqDdDvRvqw1CfhpqM9At0iFLaAAB4nJ1YDXBTVRZ+5/22TUlJ8we0pHlJm7RJf5O8F2j6EymlSPkpxaL8U2xpa3DKj0CBhc2IW4eWKSokIoLsuMqssM64f+jA4HSdWXXXscBq67IOs3FXZ1ZYWVyRFdo899yXtIBQZ90k7717zz3v3HPPOfd854YCCj9cL9dL0RQFOqCbGJnrHb5EayiKIWN8iA/hWBblo6hUWm8TtCDwE80WMJus/irwyxOdxeB0MDb14VNJHnXYoLLSl6FfCUYO9nYPTA8Epg9090LprfbBbZ2hY0UlJUXHQp3/vtWkS6EBv8+rPMq5u9692f/dNxJNiqwC1xPE9TCUgCsSdQWgE3XQD25lkG4CN2xmTcOXWBOyser6RN6KnGbKSbmQ3+d0OI1m2W8QzLLkI2sykrWAgJJEtA8vGGW/2Q+CmT3n8zS9wZwu2DCvtuZKZN3xkrLh36yCZuUomQSqGpY8t/25VfHVhw8z4ebGBtfLb0ya9PCaDc+8dGTvk2dsh6z7WzvowlXKUSWo9MJ15a3KrEP2loOr2Ojhw6iW6hf2BDdEccQvZGpaAy7YovSwq8kr7HGllxpd71rkS6G0Sf11sl9OvMK1+jwPPODxjUwkOim9CU3ix1wNjXDfmJSEn618Bs6lpWwUpU+8PCqLMY650zjq8VhCIP17NEKTx3eaLL+s5Pi6yJWaWjTHLR1jYzPSV9VF/6Ojdb/1kO3Mk3uhHC0x6gc1BjlKQ+nQFxTYdaJkZ7ySVxLBbhR1dsboNXp1tCYKW2LRaEzpYcIx2BKNxaL0ZaUnSqfFoiNhHKR/GkX6PWUSAaJelQaqZL1EpoHNsajSEyPSoJ9IjhIxTdjHLmwZvhRDOiFTY/YeQnvrVZmiTQtGncECXtFTBZLOVwwMRgoXHAkXzMzPn1nAJJ8jYSbMDaqN2waGLzNhih/bZynUBMpIWSg7VYi7DRx2m8ALkIdRCJwI6ArJx2EI8kaDWeTQKeAFk9fjl/1AvwktjQ1P7NjyMGQyfd4vjipX6M/i52D7Cq80kqlcxEcGXRr/FEcgs0u5uGgB4VWuMFfpdn2Re6Hi3PqzmxWKsz6+ae2Pn9hXXw/fqM859UiGC0oKYYILJBqJrsn1Z1E5qOs9rQCiUQRREjm8yJcbHF5cUJufX1vAHlefw0XgUoboS3ETfQlTxBC4SOtuE8VPRJTBSCQSjZCpk7Gqzu+masaZ2y7Zjehho4F3g82BNDkAHpORG4+OCS+f6JTPmtRn/PH1kch6d04sp7AQb25aQ/pqUyXeQ8vrebG8OYQdXOQ+585u0sdW9rqalzRURiJ+9F4MweRFrKUjl1GUYhH1A27WOHw5cTFSFPMo9EeUIGnQTZHIaJ7AHLaOKsOODaNF9jkBjYG2QEsQ2xjMUAx2bBEbeTBWMHwskBjngq56S/yfgkBnWBa4K9sqKtq2t1UI8S9He5XuBRbawAdatrQEAi30Aks2+LM8WeCbalVZkWNylvJ+dqJnzVb+OHlSoKW8nPCP7Rd+CcZ2DdWAGqJ2CBFOphgywFFCFBNtfAbGtNPBCwxvygHeYMZMY9ZboBqwq/pVrsbgN5tkv152ODlbMfiqwGMBgxa4Exz3QhovRIUp6acqZmQzRq0ypDXS2TPLT02YIkQETnOE445oOGxOmXAqUJNNG7XgupMjPq2ua9asrj5yY/yuKteO1Kx0YNJTufrirLe1mZnat7OL6rnUdCWenpW6I8mAnbsY8KWs1PuSovCW9A/Z25PQ24a7cNOqgmTkLmBMgh4THgc4b9k2IVv1/g/F5nGljwPLfOgHAzJzh45V/4+WenTzmMtR5Z7us2Tys909UHqrPY7KbckoxRvRHhmVc3cJGE97uml0R1S0jdULVl7EvZtDFVBF35N9cEdjpgmAiOlFZ+Dtoh93+D3zzHr8RRNZQhnCNMNbcegOvpEwZoL+06cJQ07h+th3fZ/7PVbVC6ngTAV/KoLFuO6+2KFcU651gEb5ugPSIb1D+Xp8V4+k3sEIGnw5mYe4If4k1lFYr6SCzmM2EQ8iWtmwjnBI9kTwe1TlfAmXh7H02by9fW2gsjKwtv0aaURKil4OdV7rDL1MXIFNrhdxohcZXYTnq47WisrKitaObbf5+yvkLi5J6lCNZZ+B6GC38VNBZBDidSS/+mSvh6s+srgC8pyKMvDtt+de3c9fU76ZPfuM8ud4Kv0fyP/LqfepMT/3oZxSqpZaTa1DaQYLY8TFsHYbWYsPoRhRWfL5eSSQbhUGgGC3YLbVMk6PitTFNGpAsNrC6D1VNBKgBHMejaiuRWEWGgsSDBTJjqWIl8kJLlsaLJ2tXDr6xGfT85bM2Q06a46x2HTgvdnV8z5YDy/27J4zt6x2VtkzjoYpkq36kaBr4eQSg7tyiVweWubXZugtadl58ydapfbORfKsDTuZ0OBgx4cfdjCf5tbWNITnL120fdOi1RV1C3uKGzNdwYLcMvZ3BxoPyTOCD1XvXTp7U10gWCVmTV9b3r2z0SkGWovb2hp9I89O8a2smlyaO8muMU+dRmtzp60IzAoFpjLr1n388boLyf0dRvxhsHZ0qbWqDkwqvvpkj4l0fY6EIXRi5sQSrAvsVYwXRy4qJ2EVtD1AN7a0HWth9ymvL1xc3WTUKK/TAHA/bXDVtVWfOMfuGxGZv4Ln/jVr9jc3j1yMv0tndmyt9Vq88Y9gH1wtLX3KWjot5++jWHgAoZZkQ14wGQ20Fli71UmKJAy4xKMSTGbVdybW7FDDAut9XpD5AzWrYO7zQ8qffqF8+Ynd/clrHcdyxGy3a/3+mfNnzC/cBsveTjnTvXf1o6vzOlZw7WtqtdmPK/Errz/6NNtD72zmNOZfbmYdTGHfoofqI79Oc+R2n1lrnL6pOm0Up7kwxhTW12Amm7WYkXR2qYrF2AmgmbAsxZjwy1xpg/m1Je2vrp8v/nz2xpmlBg4E9hrMU341wVpTOh/OfmGvAnra8q6uctr60ZQHV3Q+WMQJykMj8ZsWn2QBOmmHMB+m5pDIpTFonYigiaKAhGEiAHF7EliVnQkjoLVIMPtJpBKHYd3A8GYH9jJzrWwmHx5Qjp7vDAX0suGRym1vtm/9W1/HyR8vczfMs6Sk8DSv855/5dlX9oQq52hT8syyp2rx5Id17IAyAM3wIjQPMOHzytEB64q6D5zT91yNbnx3V/nqnd017S9Y0605k3izoXLpsxde2n38yoOV9s1LcjwzNjbdX6asnBVaBj/6/DwKwPkpcqbDG7BnsXoSqWnUAmottYF6jMSdVyYZh3zVXCjwTiwwHH6sGuRiEHQGzuRX6whZkp123oy1BWE2mEfJ/tvIRtM4ZM5bDXiMsPMaAKOTyc5uL57rqyyc5y5JE5pm1i2S2iUX0CcaQ6lC6Zog7JqSqZmYlosl2K6pwNA84zRnQW6SaALYZQGW5lhCtU/W34N6o+bKfZ8cf3/Cl/+iTX3wBzpOY4mRkeNf3rptycGSshQWgGbYt5jFc2e0+DglIrwl6DVWQ7BuwaJ3Xk1J4VL5urnLl/Wf+gHU/hZoZdKNym6lG+I34FaNeZKcSpJIo2IeCVvpdsDGfKvzJnAwmeD37Ow65ZWwSowpgwX5T69s/rB55dP5BcpgDKFV8p7q2sn/1uc93bVzT/w6UrCqDTWvfCq/oCD/qZXNoUj8BL5Kp6GU017frfNXkAtiiyf/SOCEeLqnd8R/Ql9GlCRfctS6k5chvIBuQ1zCCjoCHL2DHNHIXxMJ3kQeO8lbsUXONeSfA5EjcG6/E+KdhN4bP04vBhdi883+BFBzQbxFbvZzQeY9LNBZc0FNfn5NwfDn6rCTnTw6R8o+gfpf5hCom33cRuiTlss3KHmZjD+BPN+5gXuA2ziS/Q73mLxUkpbKN/eqwz5uK0X9F3h2d1V4nGNgZGBgAOJd776+iue3+crAzc4AAje5Bfcg0xz9YHEOBiYQBQA8FQlFAHicY2BkYGBnAAGOPgaG//85+hkYGVCBMgBGGwNYAAAAeJxjYGBgYB8EmKOPgQEAQ04BfgAAAAAAAA4AaAB+AMwA4AECAUIBbAGYAcICGAJYArQC4AMwA7AD3gQwBJYE3AUkBWYFigYgBmYGtAbqB1gIEghYCG4IhAi2COh4nGNgZGBgUGYoZWBnAAEmIOYCQgaG/2A+AwAYCQG2AHicXZBNaoNAGIZfE5PQCKFQ2lUps2oXBfOzzAESyDKBQJdGR2NQR3QSSE/QE/QEPUUPUHqsvsrXjTMw83zPvPMNCuAWP3DQDAejdm1GjzwS7pMmwi75XngAD4/CQ/oX4TFe4Qt7uMMbOzjuDc0EmXCP/C7cJ38Iu+RP4QEe8CU8pP8WHmOPX2EPz87TPo202ey2OjlnQSXV/6arOjWFmvszMWtd6CqwOlKHq6ovycLaWMWVydXKFFZnmVFlZU46tP7R2nI5ncbi/dDkfDtFBA2DDXbYkhKc+V0Bqs5Zt9JM1HQGBRTm/EezTmZNKtpcAMs9Yu6AK9caF76zoLWIWcfMGOSkVduvSWechqZsz040Ib2PY3urxBJTzriT95lipz+TN1fmAAAAeJxtkMl2wjAMRfOAhABlKm2h80C3+ajgCKKDY6cegP59TYBzukAL+z1Zsq8ctaJTTKPrsUQLbXQQI0EXKXroY4AbDDHCGBNMcYsZ7nCPB8yxwCOe8IwXvOIN7/jAJ76wxHfUqWX+OzgumWAjJMV17i0Ndlr6irLKO+qftdT7i6y4uFSUvCknay+lFYZIZaQcmfH/xIFdYn98bqhra1aKTM/6lWMnyaYirx1rFUQZFBkb2zJUtoXeJCeg0WnLtHeSFc3OtrnozNwqi0TkSpBMDB1nSde5oJXW23hTS2/T0LilglXX7dmFVxLnq5U0vYATHFk3zX3BOisoQHNDFDeZnqKDy9hRNawN7Vh727hFzcJ5c8TILrKZfH7tIPxAFP0BpLeJPA==) format("woff");font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder,.vjs-icon-play{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.vjs-icon-play:before{content:"\f101"}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:"\f102"}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.vjs-icon-pause{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.vjs-icon-pause:before{content:"\f103"}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.vjs-icon-volume-mute{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.vjs-icon-volume-mute:before{content:"\f104"}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.vjs-icon-volume-low{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.vjs-icon-volume-low:before{content:"\f105"}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.vjs-icon-volume-mid{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.vjs-icon-volume-mid:before{content:"\f106"}.video-js .vjs-mute-control .vjs-icon-placeholder,.vjs-icon-volume-high{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control .vjs-icon-placeholder:before,.vjs-icon-volume-high:before{content:"\f107"}.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-enter:before{content:"\f108"}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-exit:before{content:"\f109"}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:"\f10a"}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:"\f10b"}.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-subtitles{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-subtitles:before{content:"\f10c"}.video-js .vjs-captions-button .vjs-icon-placeholder,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-captions{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-captions-button .vjs-icon-placeholder:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-captions:before{content:"\f10d"}.video-js .vjs-chapters-button .vjs-icon-placeholder,.vjs-icon-chapters{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.vjs-icon-chapters:before{content:"\f10e"}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:"\f10f"}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:"\f110"}.video-js .vjs-play-progress,.video-js .vjs-volume-level,.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-progress:before,.video-js .vjs-volume-level:before,.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before{content:"\f111"}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:"\f112"}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:"\f113"}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:"\f114"}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.vjs-icon-cancel{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.vjs-icon-cancel:before{content:"\f115"}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.vjs-icon-replay{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.vjs-icon-replay:before{content:"\f116"}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:"\f117"}.vjs-icon-gplus{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-gplus:before{content:"\f118"}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:"\f119"}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:"\f11a"}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:"\f11b"}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:"\f11c"}.video-js .vjs-descriptions-button .vjs-icon-placeholder,.vjs-icon-audio-description{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.vjs-icon-audio-description:before{content:"\f11d"}.video-js .vjs-audio-button .vjs-icon-placeholder,.vjs-icon-audio{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-audio-button .vjs-icon-placeholder:before,.vjs-icon-audio:before{content:"\f11e"}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:"\f11f"}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:"\f120"}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-enter:before{content:"\f121"}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-exit:before{content:"\f122"}.video-js{display:block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:0}.video-js *,.video-js :after,.video-js :before{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-fluid{width:100%;max-width:100%;height:0}.video-js.vjs-16-9{padding-top:56.25%}.video-js.vjs-4-3{padding-top:75%}.video-js.vjs-fill{width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}body.vjs-full-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs){width:100%!important;height:100%!important;padding-top:0!important}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1;visibility:visible}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:10px;left:10px;padding:0;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;transition:all .4s}.vjs-big-play-centered .vjs-big-play-button{top:50%;left:50%;margin-top:-.81666em;margin-left:-1.5em}.video-js .vjs-big-play-button:focus,.video-js:hover .vjs-big-play-button{border-color:#fff;background-color:#73859f;background-color:rgba(115,133,159,.5);transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-error .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button{display:block}.video-js button{background:0 0;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),rgba(255,255,255,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.js-focus-visible .vjs-menu li.vjs-menu-item:hover,.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:rgba(115,133,159,.5)}.js-focus-visible .vjs-menu li.vjs-selected:hover,.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em 0;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0;margin-bottom:1.5em;border-top-color:rgba(43,51,63,.7)}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-menu-button-popup .vjs-menu.vjs-lock-showing,.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover,.video-js.vjs-no-flex .vjs-menu-button-inline{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline:hover .vjs-menu{display:block;opacity:1}.vjs-no-flex .vjs-menu-button-inline .vjs-menu{display:block;opacity:1;position:relative;width:auto}.vjs-no-flex .vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-no-flex .vjs-menu-button-inline:focus .vjs-menu,.vjs-no-flex .vjs-menu-button-inline:hover .vjs-menu{width:auto}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.vjs-has-started .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-error .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible}.vjs-has-started.vjs-no-flex .vjs-control-bar{display:table}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.video-js .vjs-control:focus,.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before{text-shadow:0 0 1em #fff}.video-js .vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.vjs-no-flex .vjs-control{display:table-cell;vertical-align:middle}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.vjs-no-flex .vjs-progress-control{width:auto}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.video-js .vjs-progress-holder .vjs-play-progress{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;top:-.3333333333em;z-index:1}.video-js .vjs-load-progress{background:rgba(115,133,159,.5)}.video-js .vjs-load-progress div{background:rgba(115,133,159,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.vjs-no-flex .vjs-progress-control .vjs-mouse-display{z-index:0}.video-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display{display:none}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em 0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#73859f;background-color:rgba(115,133,159,.5)}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em;visibility:visible;opacity:1;position:relative;transition:none}.video-js.vjs-no-flex .vjs-volume-control.vjs-volume-vertical,.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{position:absolute;bottom:3em;left:.5em}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{top:-.3em;right:-.5em}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.vjs-poster{display:inline-block;vertical-align:middle;background-repeat:no-repeat;background-position:50% 50%;background-size:contain;background-color:#000;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster{display:block}.vjs-using-native-controls .vjs-poster{display:none}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.vjs-no-flex .vjs-live-control{display:table-cell;width:auto;text-align:left}.video-js.vjs-liveui .vjs-live-control,.video-js:not(.vjs-live) .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.vjs-no-flex .vjs-seek-to-live-control{display:table-cell;width:auto;text-align:left}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.vjs-live .vjs-time-control{display:none}.video-js .vjs-current-time,.vjs-no-flex .vjs-current-time{display:none}.video-js .vjs-duration,.vjs-no-flex .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.vjs-live .vjs-time-divider{display:none}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.vjs-playback-rate .vjs-playback-rate-value,.vjs-playback-rate>.vjs-menu-button{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-error .vjs-error-display:before{color:#fff;content:"X";font-family:Arial,Helvetica,sans-serif;font-size:4em;left:0;line-height:1;margin-top:-.5em;position:absolute;text-shadow:.05em .05em .1em #000;text-align:center;top:50%;vertical-align:middle;width:100%}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;opacity:.85;text-align:left;border:6px solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:50px;height:50px;border-radius:25px;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:block;-webkit-animation:vjs-spinner-show 0s linear .3s forwards;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-loading-spinner:after,.vjs-loading-spinner:before{content:"";position:absolute;margin:-6px;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before{-webkit-animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite;animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;-webkit-animation-delay:.44s;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@-webkit-keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{100%{transform:rotate(360deg)}}@-webkit-keyframes vjs-spinner-spin{100%{-webkit-transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}100%{border-top-color:#73859f}}@-webkit-keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}100%{border-top-color:#73859f}}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"";font-size:1.5em;line-height:inherit}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" ";font-size:1.5em;line-height:inherit}.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-audio-button,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-captions-button,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-chapters-button,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-current-time,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-descriptions-button,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-duration,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-playback-rate,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-remaining-time,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-subtitles-button,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-time-divider,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-volume-control,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-audio-button,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-captions-button,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-chapters-button,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-current-time,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-descriptions-button,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-duration,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-playback-rate,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-remaining-time,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-subtitles-button,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-time-divider,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-volume-control,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-audio-button,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-captions-button,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-chapters-button,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-current-time,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-descriptions-button,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-duration,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-playback-rate,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-remaining-time,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-subtitles-button,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-time-divider,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-volume-control{display:none}.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover{width:auto;width:initial}.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-subs-caps-button,.video-js:not(.vjs-fullscreen).vjs-layout-x-small:not(.vjs-live) .vjs-subs-caps-button,.video-js:not(.vjs-fullscreen).vjs-layout-x-small:not(.vjs-liveui) .vjs-subs-caps-button{display:none}.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-custom-control-spacer,.video-js:not(.vjs-fullscreen).vjs-layout-x-small.vjs-liveui .vjs-custom-control-spacer{flex:auto;display:block}.video-js:not(.vjs-fullscreen).vjs-layout-tiny.vjs-no-flex .vjs-custom-control-spacer,.video-js:not(.vjs-fullscreen).vjs-layout-x-small.vjs-liveui.vjs-no-flex .vjs-custom-control-spacer{width:auto}.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-progress-control,.video-js:not(.vjs-fullscreen).vjs-layout-x-small.vjs-liveui .vjs-progress-control{display:none}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:rgba(43,51,63,.75);color:#fff;height:70%}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-controls,.vjs-text-track-settings .vjs-track-settings-font{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display:grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0 24px}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:5px;padding:3px;border:none}.vjs-text-track-settings fieldset span{display:inline-block}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;margin:0 0 5px 0}.vjs-text-track-settings .vjs-label{position:absolute;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px);display:block;margin:0 0 5px 0;padding:0;border:0;height:1px;width:1px;overflow:hidden}.vjs-track-settings-controls button:active,.vjs-track-settings-controls button:focus{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f 100%)}.vjs-track-settings-controls button:hover{color:rgba(43,51,63,.75)}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f 100%);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}@media print{.video-js>:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js :focus:not(.focus-visible){outline:0;background:0 0}.video-js .vjs-menu :focus:not(:focus-visible),.video-js :focus:not(:focus-visible){outline:0;background:0 0} \ No newline at end of file diff --git a/images/Stichpunkt.svg b/images/Stichpunkt.svg new file mode 100644 index 0000000..90c8dfa --- /dev/null +++ b/images/Stichpunkt.svg @@ -0,0 +1,35 @@ + + + + + + + image/svg+xml + + + + + + + + + diff --git a/images/facebook.svg b/images/facebook.svg new file mode 100644 index 0000000..ca6effc --- /dev/null +++ b/images/facebook.svg @@ -0,0 +1,27 @@ + +image/svg+xml \ No newline at end of file diff --git a/images/instagram.svg b/images/instagram.svg new file mode 100644 index 0000000..73b40ba --- /dev/null +++ b/images/instagram.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/images/mastodon.svg b/images/mastodon.svg new file mode 100644 index 0000000..8c8d043 --- /dev/null +++ b/images/mastodon.svg @@ -0,0 +1,59 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/images/play.svg b/images/play.svg new file mode 100644 index 0000000..1ae7a51 --- /dev/null +++ b/images/play.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/images/twitter.svg b/images/twitter.svg new file mode 100644 index 0000000..a0cd1a4 --- /dev/null +++ b/images/twitter.svg @@ -0,0 +1,13 @@ + + + diff --git a/js/DynamicIFrame.js b/js/DynamicIFrame.js new file mode 100644 index 0000000..c781771 --- /dev/null +++ b/js/DynamicIFrame.js @@ -0,0 +1,1036 @@ +/* + Dieses Script wurde geschrieben von Mitja Stachowiak (www.mitjastachowiak.de) + Es benoetigt ausserdem frameCommunicator.js. + + Dokumentation unter http://www.mitjastachowiak.de/code/js/dynamicIFrame +*/ + + + + + +function getTickCount () { // returns the milliseconds since beginning of the current year + var T = new Date(); + return T.getMilliseconds() + T.getSeconds() * 1000 + T.getMinutes() * 60000 + T.getHours() * 3600000 + T.getDay() * 86400000; +} +function createOverscrollListener (doc, wait, callback) { + var o = new Object(); + o.doc = doc; + o.lastScroll = 0; + o.lastTry = 0; + o.lastInnerWidth = window.innerWidth; + o.wait = wait / 2; + o.callback = callback; + o.scrollFkt = function () { + o.lastScroll = getTickCount(); + } + o.scrollEventFkt = function (ev) { + if (getTickCount() < o.lastScroll + o.wait) { o.lastTry = 0; return; } + if (o.lastTry == 0) o.lastTry = getTickCount(); + if (getTickCount() < o.lastTry + o.wait) { o.lastInnerWidth = window.innerWidth; return; } + if (o.lastInnerWidth != window.innerWidth) { o.lastInnerWidth = window.innerWidth; return; } + o.lastTry = 0; + if (!ev) ev = window.event; + var dir = ev.wheelDelta || -ev.detail; + if (!callback) return; + if (dir) { o.callback(dir < 0); return; } + if (window.pageYOffset > 0) { o.callback(true); return; } + if (ev.keyCode) { o.callback(ev.keyCode == 40); return; } + } + o.free = function () { + o.doc.removeEventListener('scroll', o.scrollFkt, false); + o.doc.removeEventListener('DOMMouseScroll', o.scrollEventFkt, false); + o.doc.removeEventListener('mousewheel', o.scrollEventFkt, false); + o.doc.removeEventListener('keypress', o.scrollEventFkt, false); + o.callback = null; + o.doc = null; + o = null; + } + // EventListener setzen + var d = o.doc; + var _d = null; + while (d && d != _d) { + try { + _d = d; + d.addEventListener('scroll', o.scrollFkt, false); + d = d.defaultView.parent.document; + } catch (e) { break; } + } + o.doc.addEventListener('DOMMouseScroll', o.scrollEventFkt, false); + o.doc.addEventListener('mousewheel', o.scrollEventFkt, false); + o.doc.addEventListener('keypress', o.scrollEventFkt, false); + return o; +} + + +/* + Dies sind zwei standard-Effekte. Diese koennen Sie als Vorlage fuer eigene Effekte verwenden + + Parameter: + el : iframe-Element + s : Wert zwischen 0 und 1; Ausnahme -1 (0 = Effekt beginnt, 0.5 = Effekt ist bei der Haelfte, 1 = Effekt ist fertig, -1 = saemtliche von diesem Effekt benutzten css-Eigenschaften zuruecksetzen) + blendIn : Wenn true, soll das iframe eingeblendet werden, ansonsten ausgeblendet +*/ + +function EffectBlend (el, s, blendIn) { + if (s < 0) { el.style.opacity = 1; return; } + if (!blendIn) s = 1-s; + el.style.opacity = s; +} + +function EffectBlendAndSlide (el, s, blendIn) { + if (s < 0) { el.style.marginTop = '0px'; el.style.opacity = 1; return; } + if (!blendIn) s = 1-s; + el.style.opacity = s; + el.style.marginTop = -100 * (1-s) * (1-s) + 'px'; +} + +function EffectAppendAndSlide (el1, el2, s, dir) { + if (s < 0) { + el1.style.marginTop = '0px'; + el2.style.marginTop = '0px'; + el1.parentElement.style.overflow = 'visible'; + return; + } + el1.parentElement.style.overflow = 'hidden'; + if (dir) { + el1.style.marginTop = -el1.offsetHeight * (1-s); + el2.style.marginTop = el1.offsetHeight * (s); + } else { + el2.style.marginTop = -el2.offsetHeight * (s); + el1.style.marginTop = el2.offsetHeight * (1-s); + } +} + + + + +/* + Dieses Objekt darf nur einmal in einem HTML-Dokument erstellt werden und erlaubt, das Laden von Seiten in einem iframe mit Effekt zu versehen. + + Parameter: + FrameBox : ein DIV-Element, das genau 2 iframes enthaellt. Jedes IFrame benoetigt ein eindeutriges name-Attribut. Nur so kann die Kompatibilitaet mit Links ohne JavaScript gewaehrleistet werden (). + + Eigenschaften und Funktionen: + whitelist : Array aus RegExp-Objekten. Alle Seiten, die im Frame geladen werden sollen, muessen entweder von der gleichen Domain sein, oder auf die Whitelist passen + addURLToWhitelist : Wandelt die uebergebene URL in ein RegExp-Objekt um und fuegt sie der whitelist hinzu. In der URL sind *-Zeichen erlaubt. Innerhalb des Hostname-Bereiches haben diese jedoch spezielle Aufgaben und es kann nicht jede beliebige Zeichenfolge fuer ein * stehen. + differentQueryDifferentSites : Boolean - wenn true, dann werden Menuelinks nur hervorgehoen, wenn auch das QUerystring des Menuelinks und der Seite im Frame gleich ist. + whitelist : Array aus Strigs (Darf Platzhalter (*) enthalten). Nur Seiten, die in dieses Profil passen, duerfen im Frame geladen werden. Seiten von der eigenen Domain duerfen immer geladen werden. + maxWaitForSite : diese Zeit (ms) wird maximal gewartet, bis die neue Seite eingeblendet wird. Ist die Seite bis dahin nicht vollstaendig geladen, kann der Besucher beobachten, wie sie im iframe fertig laedt. + blendOutTime : Dauer des Ausblendens (ms) + blendInDelay : Verzoegerung - so viele Millisekunden nach Beginn des Ausblendens beginnt das Einblenden + blendInTime : Dauer des Einblendens (ms) + blendInEffect : Uebergeben Sie hier die Effekt-Funktion fuer das Einblenden + blendOutEffect : Uebergeben Sie hier die Effekt-Funktion fuer das Ausblenden + function loadSite : Rufen Sie diese Funktion mit einer URL auf, um diese URL mit Effekt in den iframe zu laden (Die Seite wird nur geladen, wenn sie von der gleichen Domain ist oder auf die Whitelist passt) + function scrollTo : uebergeben werden kann eine y-Koordinate aus Sicht des aktuellen Iframes oder der Name eines Ankers innerhalb des aktuellen Iframes. ScrollTo scrollt dann zu diesem Ziel. Ein zweiter Parameter darf nur vom Objekt selbst uebergeben werden. + autoFillMenu : Falls die Menu-Links ein Inhaltsverzeichnis darstellen, kann fuer autoFillMenu eine Zahl eingesetzt werden, bis zu der H*-Elemente der Frame-Seite gescant und automatisch im Inhaltsverzeichnis ergaenzt werden. Ein Wert von 3 z.B. bedeutet, dass fuer alle H1, H2 und H3-Elemente automatisch Links im Inhaltsverzeichnis beim Laden der Seite angelegt werden. +*/ +function DynamicIFrame (FrameBox, debugLogging=false) { with (this) { + // private + var box = FrameBox; + var frames = FrameBox.getElementsByTagName('iframe'); + var current = 0; + var next = 1; + var communicators = new Array(); + var aTarget, aTarget2; + var isAutoFrameHeight = true; + var menuLinks = new Array(); + var printLinks = new Array(); + var blendInfo = new Object(); + var scrollInfo = new Object(); + var autoHeightEl = new Array(); // Alle Elemente, deren NoJsHeight-Classname gesetzt/entfernt wird + var loadWithoutEffect = false; + var startPage = ''; + var incompatibleBrowser = false; + var domWasReady = false; + var selfHostname; + var currentSite = ''; + var loadingSiteAnchor = ''; // Anker der zu ladenden Seite aus URL, wird gespeichert fuer scroll-Effekt + var currentSiteAnchors = new Array(); // Array aus allen Ueberschrifen-Ankern der aktuellen Seite (kann nach absOffsetTop der Anker sortiert werden) + var anchorPos = 0; // index in currentSiteAnchors des gerade aktiven Ankers + var overscrollListener = null; + var currentHirachy = null; + var oldQuery = ''; + var scriptLoadingPage = ''; + + // public + this.differentQueryDifferentSites = false; + this.whitelist = new Array(); + this.maxWaitForSite = 1000; // Nach dieser Zeit wird die Seite anzegeigt, auch wenn noch nicht vollst. geladen + this.blendOutTime = 0; + this.blendInDelay = 0; + this.blendInTime = 0; + this.scrollTime = 500; + this.blendInEffect = null; + this.blendOutEffect = null; + this.browseEffect = EffectAppendAndSlide; + this.browseDuration = 2000; + this.scrollFunction = function (s) { return (-2*s+3)*s*s; } + this.browseScrollFunction = function (s) { return s; } + this.autoFillMenu = 0; // Bis zu dieser Zahl * werden H*-Elemente im Menue ergaenzt + this.autoChangeAnchor = false; + this.nummerateMenu = false; + this.onSiteLoaded = null; + this.onLinkActivate = null; + this.onMenuChange = null; + this.onTitleChange = null; + this.onContentResize = null; + + var _this = this; + var onEvent = /* private */ function (el, event, fkt, param, behavior) { // provides easy eventListeners. el: Element to set the listener; event: string-name of the event(without "on"); fkt: a Function to call ift the event occours, fkt is called in the scope of _this; param: any parameter, that is given to fkt; behavior: flags - 1=only the param is given to fkt (otherwise there is also given the element and the event), 2=event is not given to the element + var f; + if (behavior & 1) f = function (ev) { + if (!ev) ev = window.event; + fkt.call(_this,param); + if (behavior & 2) { if (ev.preventDefault) ev.preventDefault(); return false; } + } + else f = function (ev) { + if (!ev) ev = window.event; + fkt.call(_this,this,ev,param); + if (behavior & 2) { if (ev.preventDefault) ev.preventDefault(); return false; } + } + if (window.addEventListener) el.addEventListener(event, f, false); + else el.attachEvent('on'+event,f); + return false; + }; + + var getAbsOffsetTop = function (el) { // returns the offset top of the given element seen from the document top (el CAN be in the current IFRAME) + var pos = el.offsetTop; + while (el.offsetParent) { + if (el.offsetParent == el) break; + el = el.offsetParent; + pos += el.offsetTop; + } + try { + if (el == frames[current].contentWindow.document.body || el == frames[current].contentWindow.document.documentElement) pos += getAbsOffsetTop(frames[current]); + } catch (e) { } + return pos; + }; + + var getAnchorFromURL = /* private */ function (url) { + var i = url.lastIndexOf('#'); + if (i < 0) return ''; + var a = url.substring(i+1, url.length); + if ((/[^(A-Za-z0-9_)]/).test(a)) return ''; + return a; + }; + + var getSiteFromURL = /* private */ function (url) { + var i = url.lastIndexOf('#'); + var j = url.indexOf('?'); + if (!differentQueryDifferentSites && j >= 0 && j < j) i = j; + if (i < 0) i = url.length; + return url.substring(0,i); + }; + + var create = /* private */ function () { + if ((!window.addEventListener && !window.attachEvent) || !document.body || !document.getElementsByTagName) { incompatibleBrowser = true; return; } + if (!window.fapi) { incompatibleBrowser = true; throw 'DynamicIFrame benoetigt frameCommunicator.js!'; } + if (window.jsw && jsw.units.switchableDesign) jsw.units.switchableDesign.unit.requireDesignFile('dynamicIFrame', box); + selfHostname = getHostnameAndProtocol(self.location.href); + // Re-Create Frame elements, because browser does stupid things on hard coded iframes when re-loading a site... + startPage = frames[0].src; + aTarget = frames[0].getAttribute('name', 0); + aTarget2 = frames[1].getAttribute('name', 0); + frames[1].parentElement.removeChild(frames[1]); + frames[0].parentElement.removeChild(frames[0]); + if (frames.length > 0) throw 'Not more than two frames allowed in HTML!'; + var f = document.createElement('iframe'); + f.setAttribute('name', aTarget); + f.id = aTarget; + FrameBox.appendChild(f); + f = document.createElement('iframe'); + f.setAttribute('name', aTarget2); + f.id = aTarget2; + FrameBox.appendChild(f); + // prepare communicators + communicators[0] = new FrameCommunicator(frames[0], (debugLogging)?'0':''); + communicators[1] = new FrameCommunicator(frames[1], (debugLogging)?'1':''); + communicators[0].autoHeight = true; + communicators[1].autoHeight = true; + communicators[0].onContentResize = function (w, h) { siteResize(0, h); }; + communicators[1].onContentResize = function (w, h) { siteResize(1, h); }; + communicators[0].onURLChanged = setQueryString; + communicators[1].onURLChanged = setQueryString; + communicators[0].onload = manipulateCurrentSite; + communicators[1].onload = manipulateCurrentSite; + communicators[0].onTitleChanged = titleChange; + communicators[1].onTitleChanged = titleChange; + if (document.addEventListener) document.addEventListener("DOMContentLoaded", domReady, false); + else { + var oldReadyStateChange = document.onreadystatechange; + document.onreadystatechange = function () { + try { oldReadyStateChange(); } catch (e) { } + if(document.readyState == "interactive" || document.readyState == "complete") domReady(); + } + } + // QueryString untersuchen + if (window.addEventListener) window.addEventListener('popstate', evalQueryString, false); + } + + var domReady = /* private */ function () { + if (domWasReady) return; + domWasReady = true; + // Links auf JavaScript umstellen + for (var i = 0; i < document.getElementsByTagName('a').length; i++) + linkJSenhance(document.getElementsByTagName('a')[i]); + if (nummerateMenu) buildMenuNumbers(); + activateCurrentLink(); + // AutoHeight-Elemente finden + for (var i = 0; i < document.getElementsByTagName('div').length; i++) if (document.getElementsByTagName('div')[i].className.indexOf('NoJsHeight') >= 0) autoHeightEl.push(document.getElementsByTagName('div')[i]) + if (!isAutoFrameHeight) { + isAutoFrameHeight = true; + autoFrameHeight(false); + } + // Scroll-Event setzen + window.addEventListener('scroll', sitescroll, false); + // Seite aus Querystring laden + window.setTimeout(function () { // for whatever reason, events do not pass before dom content is loaded. + if (scriptLoadingPage != '' || !evalQueryString()) { + if (scriptLoadingPage != '') { + debugLog('Load site set by script: '+scriptLoadingPage); + loadSite(scriptLoadingPage, 1); + } else { + debugLog('Load start site: '+startPage); + var hashtag = window.location.href.split('#'); + if (hashtag.length > 1) hashtag = '#'+hashtag.pop(); + else hashtag = ''; + loadSite(startPage+hashtag, 1); + } + } + }, 0); + }; + + var debugLog = /* private */ function (msg) { + if (!debugLogging) return; + var d = new Date(); + console.log('['+d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate()+' '+d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds()+'] '+msg); + } + + var evalQueryString = /* private */ function (effect) { + // Wird in domready und beim klicken auf den Vorwaerts/Rueckwaerts-Button im Browser aufgerufen + var newSite = self.location.href.split('?'); + newSite.shift(); + if (newSite.length == 0) return false; + newSite[0] = newSite[0].split('&'); + var isFB = false; + for (var i = 0; i < newSite[0].length; i++) + if (newSite[0][i].indexOf('fbclid=') == 0 || newSite[0][i].indexOf('\/gclid=') == 0) { + newSite[0].splice(i, 1); + isFB = true; + break; + } + if (newSite[0].length == 0) return false; + newSite[0] = newSite[0].join('&'); + if (isFB) newSite[0] = newSite[0].split('%2F').join('\/'); + var newSite = absolutePath(newSite.join('?')); + if (isNotInWhitelist(newSite)) return false; + debugLog('Load site by query: '+newSite); + loadSite(newSite, (effect)?0:1); + return true; + }; + + this.addURLToWhitelist = /* public */ function (url) { + var rep = new RegExp('([^\\w&^\\*])', 'g'); + var host = getHostnameAndProtocol(url); + var i = host.length; + host = host.replace(rep, '\\$1'); + var path = url.substring(i, url.length).replace(rep, '\\$1'); + if (path == '' && host.length > 0 && host.charAt(host.length-1) == '*') path = '*'; + while (host.length > 0 && host.charAt(host.length-1) == '*') host = host.substring(0, host.length-1); + if (host == '') throw 'URL has wrong syntax'; + rep = new RegExp('\\*', 'g'); + path = path.replace(rep, '[a|^a]*'); // innerhalb des path-Bereiches koennen die * fuer beliebige Inhalte stehen + // innerhalb des hostname-Bereiches haben die * spezielle Aufgaben + var a = host.split('\\\:\\\/\\\/'); + if (a.length == 1) { + a = a[0].split('*'); + if (a.length == 2) + host = a[0] + '(\\w)*\\:\\/\\/((\\w)+\\.)*' + a[1]; + else throw 'URL has wrong syntax'; + } else if (a.length == 2) { + rep = new RegExp('(\\*)', 'g'); + a[0] = a[0].replace(rep, '(\\w)*'); + a[1] = a[1].replace(rep, '((\\w)+\\.)*'); + host = a[0] + '\\:\\/\\/' + a[1]; + } else throw 'URL has wrong syntax'; + whitelist.push(new RegExp('\^'+host+path)); + }; + + var isNotInWhitelist = /* private */ function (src) { + if (getHostnameAndProtocol(src) == selfHostname) return false; + for (var i = 0; i < whitelist.length; i++) if (whitelist[i].test(src)) return false; + return true; + }; + + var buildMenuNumbers = /* private */ function () { + if (!nummerateMenu) return; + for (var i = 0; i < menuLinks.length; i++) { + if (menuLinks[i]['el'].parentElement.tagName.toLowerCase() != 'li') continue; + var ol = menuLinks[i]['el'].parentElement; + var a = new Array(); + while (ol.parentElement && ol.parentElement.tagName.toLowerCase() == 'ol') { + var nr = 1; + var el = ol.parentElement.firstElementChild; + while (el && el != ol) { + el = el.nextElementSibling; + if (el.tagName.toLowerCase() == 'li') nr++; + } + a.unshift(nr); + ol = ol.parentElement; + } + if (!menuLinks[i]['numberEl']) { + menuLinks[i]['numberEl'] = document.createElement('span'); + menuLinks[i]['el'].insertBefore(menuLinks[i]['numberEl'], menuLinks[i]['el'].firstChild); + } + menuLinks[i]['numberEl'].innerHTML = a.join('.')+'. '; + } + }; + + var activateLink = /* private */ function (link) { // das in link uebergebene MenuLink-Objekt wird aktiviert, ggf. akuell aktive Links werden deaktiviert + if (window.opera && link) { link['el'].style.visibility = 'hidden'; link['el'].style.visibility = 'visible'; } // Komisches Bug + if (link && link['active']) return; + for (var i = 0; i < menuLinks.length; i++) if (menuLinks[i]['active']) { + menuLinks[i]['active'] = false; + var c = menuLinks[i]['el'].className.split(' '); + for (var j = c.length-1; j >= 0; j--) if (c[j] == 'active') c.splice(j, 1); + menuLinks[i]['el'].className = c.join(' '); + } + if (!link) { if (onLinkActivate) onLinkActivate(null); return; } + link['active'] = true; + link['el'].className += ' active'; + if (onLinkActivate) onLinkActivate(link['el']); + activateCurrentHirachy(); + }; + + var activateCurrentHirachy = /* private */ function () { + var link = null; + for (var i = 0; i < menuLinks.length; i++) + if (menuLinks[i]['active']) { + link = menuLinks[i]; + break; + } + if (!link || !currentHirachy) return; + var found = false; + for (var i = currentHirachy.length-1; i >= 0; i--) + if (found) { + if (currentHirachy[i].link && currentHirachy[i].link['el'].getAttribute('alwaysactive') == 'yes' && !currentHirachy[i].link['active']) { + currentHirachy[i].link['active'] = true; + currentHirachy[i].link['el'].className += ' active'; + } + } else if (currentHirachy[i].link == link) found = true; + }; + + var activateCurrentLink = /* private */ function () { + // Seite und Anker ermitteln + var site = currentSite; + var anchor = getAnchorFromURL(communicators[current].contentURL); + if (site.indexOf('?') != -1) site = site.substring(0, site.indexOf('?')); + // Links mit gleicher Seite suchen + var a = new Array(); + for (var i = 0; i < menuLinks.length; i++) + if (site == menuLinks[i]['site']) + a.push(menuLinks[i]); + // Keinen passenden Link gefunden + if (a.length == 0) { + activateLink(null); + return; + } + // Falls aktueller Anker direkt existiert + for (var i = 0; i < a.length; i++) + if (a[i]['anchor'] == anchor) { + activateLink(a[i]); + return; + } + // Falls keine Ueberschriften-Anker bekannt + if (currentSiteAnchors.length == 0) { + activateLink(a[0]); + return; + } + // Falls verknuepfter menuLink schon bekannt + if (currentSiteAnchors.length != 0 && currentSiteAnchors[anchorPos]['link']) { + activateLink(currentSiteAnchors[anchorPos]['link']); + return; + } + // Anker-Rangfolge erstellen + var b = new Array(); + var j = anchorPos-1; + var h = currentSiteAnchors[anchorPos]['hNr']; + b[currentSiteAnchors[anchorPos]['hNr']] = currentSiteAnchors[anchorPos]; + for (var i = anchorPos-1; i >= 0; i--) + if (currentSiteAnchors[i]['hNr'] < h) { + h = currentSiteAnchors[i]['hNr']; + b[h] = currentSiteAnchors[i]; + } + // naheliegensten Menulink aktivieren + for (var i = b.length-1; i >= 0; i--) { + if (!b[i]) continue; + for (var j = 0; j < a.length; j++) if (a[j]['anchor'] == b[i]['name']) { activateLink(a[j]); return; } + } + activateLink(a[0]); + }; + + var setQueryString = /* private */ function () { // Diese Funktion haengt an die URL der aktuellen Seite das ?UrlVonFrame an. + var P = communicators[current].contentURL; + if (P == '') P = communicators[current].contentHostname; + if (P == '' || P.indexOf('about:blank') == 0) return; + currentSite = getSiteFromURL(P); + if (isNotInWhitelist(P)) { + frames[current].style.visibility = 'hidden'; + frames[current].setAttribute('notInWhitelist', 'yes'); + } else { + frames[current].style.visibility = 'visible'; + frames[current].removeAttribute('notInWhitelist'); + } + activateCurrentLink(); + var L = self.location.href; + i = L.indexOf('?'); + if (i < 0) i = L.length; + var Q = L.substring(i+1, L.length); + L = L.substring(0, i); + i = L.indexOf('#'); + if (i > 0) L = L.substring(0, i); + if (P.split('#')[0].toLowerCase() == startPage.toLowerCase()) { + if (P.split('#').length == 2) P = '#'+P.split('#').pop(); + else P = ''; + } else { + var H = getHostnameAndProtocol(communicators[current].contentURL); + if (H == '') return; + if (selfHostname == H) P = P.substring(H.length, P.length); + if (P == Q) return; + P = '?' + P; + } + if (history.pushState && window.location.href != L+P) { + var stateObj = { foo: "bar" }; + var title = ''; + try { title = frames[current].contentWindow.document.title; } catch (e) {} + if (oldQuery.split('#')[0] == P.split('#')[0]) history.replaceState(stateObj, document.title+': '+title, L+P); + else history.pushState(stateObj, document.title+': '+title, L+P); + oldQuery = P; + } + }; + + this.linkJSenhance = function (el, inFrameSite=false) { // replace simple links by javascript-enhanced links + if (inFrameSite) { + if ((el.target == '_self' || el.target == '') && el.href != '') { + var a = el.href.split('#'); + if (a[0].indexOf('javascript:') != 0 && a[0].indexOf('callto:') != 0 && a[0].indexOf('mailto:') != 0 && a[0].indexOf('webcal:') != 0 && el.download == '') { // check, this is a common link + if (isNotInWhitelist(el.href)) el.target = '_blank'; + else if (a[0] == frames[current].contentWindow.location.href.split('#')[0] && a.length > 1) onEvent(el, 'click', scrollTo, a[1], 3); + else if ((' '+el.className+' ').indexOf(' WindowLink ') == -1) onEvent(el, 'click', loadSite, el.href, 3); + } + } + } else { + if (el.target == aTarget) { + if ((' '+el.className+' ').indexOf(' MenuLink ') >= 0) { // Menue-Links, die hervorgehoben werden sollen, vorbereiten + var href = absolutePath(el.href); + menuLinks.push({ // menuLinks koennen auch in manipulateCurrentSite erzeugt werden! + el : el, + href : href, + anchor : getAnchorFromURL(href), + site : getSiteFromURL(href), + subMenuId : el.getAttribute('submenu'), + active : false + }); + } + onEvent(el, 'click', loadSite, el.href, 3); + } + if (el.href.toLowerCase() == 'javascript:'+aTarget.toLowerCase()+'.print()') printLinks.push(el); + } + }; + + var scanElements = function (el, comm) { + for (var i = 0; i < el.childNodes.length; i++) + if (el.childNodes[i].nodeType == 1) { + var eli = el.childNodes[i]; + var tagName = eli.tagName.toLowerCase(); + if (tagName == 'a') + linkJSenhance(eli, true); + else if ((/h\d/i).test(tagName)) { // add headlines to currentSiteAnchors + // find or create headline's id + var id = eli.id; + if (!id && eli.getElementsByTagName('a').length > 0) id = eli.getElementsByTagName('a')[0].id; + if (!id) { // auto-generate an id + var txt = eli.textContent.toLowerCase(); + id = ''; + for (var j = 0; j < txt.length; j++) + if (txt.charAt(j) == ' ' && id != '') id += '_'; + else if (txt.charCodeAt(j) >= 97 && txt.charCodeAt(j) <= 122) id += txt.charAt(j); + else if (txt.charCodeAt(j) >= 48 && txt.charCodeAt(j) <= 57 && id != '') id += txt.charAt(j); + else if (txt.charCodeAt(j) == 228) id += 'ae'; + else if (txt.charCodeAt(j) == 246) id += 'oe'; + else if (txt.charCodeAt(j) == 252) id += 'ue'; + else if (txt.charCodeAt(j) == 223) id += 'ss'; + var j = 2; + while (document.getElementById(id)) { + id += '_'+j; + j++; + } + eli.id = id; + } + // add headline to current site anchors + currentSiteAnchors.push({ + el: eli, + hNr: parseInt(tagName.substring(1)), + id: id, + content: eli.textContent, + site: comm.contentURL.split('#')[0], + pos: getAbsOffsetTop(eli), + link: null + }); + } + scanElements(eli, comm); + } + } + + var manipulateCurrentSite = /* private */ function (comm) { // wird von iframe.communicator.onload aufgerufen, sobald der Inhalt des frames geladen hat und dessen Hoehe bekannt ist. + var _this = this; + var frameNr = communicators.indexOf(comm); + if (frameNr != current) + return; + debugLog('manipulate frame '+frameNr+'; url='+comm.contentURL); + currentSiteAnchors = new Array(); + anchorPos = 0; + try { // Innerhalb von try-catch: Aenderungen an der Frame-Seite + frames[current].contentWindow.document.body.style.overflow = (isAutoFrameHeight)?'auto':'hidden'; + if (window.jsw) window.jsw.processSite(frames[current].contentWindow.document.body, jswMainWindow); + scanElements(frames[current].contentWindow.document.body, comm); + } catch (e) {} + // find this site's root menu link (first menu link, that points to this site) + var hirachy = new Array(); + hirachy.push(new Object()); + hirachy[0]['link'] = null; + hirachy[0]['subMenu'] = null; + for (var i = 0; i < menuLinks.length; i++) + if (menuLinks[i]['site'] == comm.contentURL.split('#')[0]) { + hirachy[0]['link'] = menuLinks[i]; + hirachy[0]['subMenu'] = null; + if (menuLinks[i]['el'].getAttribute('submenu')) + hirachy[0]['subMenu'] = document.getElementById(menuLinks[i]['el'].getAttribute('submenu')); + if (!hirachy[0]['subMenu'] && menuLinks[i]['el'].parentElement.tagName.toLowerCase() == 'li') { + var nextEl = menuLinks[i]['el'].parentElement.nextElementSibling; + while (nextEl) + if (nextEl.tagName.toLowerCase() == 'li' || nextEl.tagName.toLowerCase() == 'ol') break; + else nextEl = nextEl.nextElementSibling; + if (nextEl && nextEl.tagName.toLowerCase() == 'ol') hirachy[0]['subMenu'] = nextEl; + else if (autoFillMenu > 0) { + hirachy[0]['subMenu'] = document.createElement('ol'); + if (nextEl) menuLinks[i]['el'].parentElement.parentElement.insertBefore(hirachy[0]['subMenu'], nextEl); + else menuLinks[i]['el'].parentElement.parentElement.appendChild(hirachy[0]['subMenu']); + } + } + break; + } + // here, hirachy[0] contains the root link to this site and the destination ol-list for headline anchors. Now expand hirachy towards higher levels + linkBaseSearch: + while (hirachy[0]['link'] && hirachy[0]['link']['el'].parentElement.tagName.toLowerCase() == 'li') { + var ol = hirachy[0]['link']['el'].parentElement.parentElement; + while (ol.tagName.toLowerCase() == 'ol') { + hirachy.unshift({ + link: null, + subMenu: ol + }); + if (ol.id != '') + for (var i = 0; i < menuLinks.length; i++) + if (menuLinks[i].subMenuId == ol.id) { + hirachy[0].link = menuLinks[i]; + continue linkBaseSearch; + } + ol = ol.parentElement; + } + break; + } + // actualize menu with currentSiteAnchors + var h = hirachy.length-1; + if (h >= 0 && hirachy[h]['subMenu'] && currentSiteAnchors.length > 0) { + for (var i = 0; i < currentSiteAnchors.length; i++) { // search or create related links for all anchors (don't do this in try..catch) + // find related menu link to this anchor + var isSingleTopHeadline = (currentSiteAnchors[i]['el'].tagName.toLowerCase() == 'h1') && (currentSiteAnchors[i]['el'].ownerDocument.getElementsByTagName('h1').length == 1); + for (var j = 0; j < menuLinks.length; j++) + if (menuLinks[j]['site'] == comm.contentURL.split('#')[0] && (menuLinks[j]['anchor'] == currentSiteAnchors[i]['id'] || isSingleTopHeadline && menuLinks[j]['anchor'] == '')) { + var pel = menuLinks[j]['el'].parentElement; + if (pel.tagName.toLowerCase() != 'li') + if (isSingleTopHeadline) { + currentSiteAnchors[i]['link'] = menuLinks[j]; + currentSiteAnchors[i]['isSingleTopHeadline'] = true; + break; + } else continue; // this link is not a list-element. Ignore! + while (pel) + if (pel == hirachy[0]['subMenu']) break + else pel = pel.parentElement; + if (!pel) continue; // this link is outside of the hirachy-ol and has to remain untouched! + currentSiteAnchors[i]['link'] = menuLinks[j]; + break; + } + var link = currentSiteAnchors[i]['link']; + if (link) { + // remove li-element from DOM (maybe add it to an other location, later) + if (link == hirachy[h]['link']) continue; // don't touch root link + link['el'].parentElement.parentElement.removeChild(currentSiteAnchors[i]['link']['el'].parentElement); + } else if (currentSiteAnchors[i]['hNr'] <= autoFillMenu) { + // create a new menu link, if missing + link = { + href: comm.contentURL.split('#')[0] + '#' + currentSiteAnchors[i]['id'], + anchor: currentSiteAnchors[i]['id'], + site: comm.contentURL.split('#')[0], + active: false, + el: document.createElement('a') + }; + link['el'].textContent = currentSiteAnchors[i]['content']; + link['el'].className = 'MenuLink'; + link['el'].target = aTarget; + link['el'].href = link['href']; + onEvent(link['el'], 'click', loadSite, link['href'], 3); + currentSiteAnchors[i]['link'] = link; + document.createElement('li').appendChild(link['el']); + menuLinks.push(link); + } + if (!link) continue; + // insert menu link at correct position, create missing ol-hirachies + if (i == 0 || currentSiteAnchors[i-1]['isSingleTopHeadline']) + hirachy[h]['subMenu'].insertBefore(link['el'].parentElement, hirachy[h]['subMenu'].firstChild); + else { + var hnr = currentSiteAnchors[i-1]['hNr']; + var nextSiblingForLi = currentSiteAnchors[i-1]['el'].parentElement.nextSibling; + // enter necessary sub-menus + while (hnr < currentSiteAnchors[i]['hNr']) { + var newOl = null; + if (hnr == currentSiteAnchors[i-1]['hNr']) { + if (currentSiteAnchors[i-1]['link']['el'].parentElement.nextElementSibling && currentSiteAnchors[i-1]['link']['el'].parentElement.nextElementSibling.tagName.toLowerCase() == 'ol') newOl = currentSiteAnchors[i-1]['link']['el'].parentElement.nextElementSibling; + else { + newOl = document.createElement('ol'); + hirachy[h]['subMenu'].insertBefore(newOl, currentSiteAnchors[i-1]['el'].parentElement.nextSibling); + } + } else { + if (hirachy[h]['subMenu'].firstElementChild && hirachy[h]['subMenu'].firstElementChild.tagName.toLowerCase() == 'ol') + newOl = hirachy[h]['subMenu'].firstElementChild; + else { + newOl = document.createElement('ol'); + hirachy[h]['subMenu'].insertBefore(newOl, hirachy[h]['subMenu'].firstChild); + } + } + hnr++; + h++; + hirachy.push({ + link: null, + subMenu: newOl + }); + nextSiblingForLi = newOl.firstChild; + } + // exit unneccessary sub-menus + while (hnr > currentSiteAnchors[i]['hNr'] && h > 0) { + nextSiblingForLi = hirachy[h]['subMenu'].nextSibling; + h--; + hnr--; + hirachy.pop(); + } + hirachy[h]['subMenu'].insertBefore(link['el'].parentElement, nextSiblingForLi); + } + } + } + currentHirachy = hirachy; + activateCurrentHirachy(); + // Nummerierung + if (nummerateMenu) { + buildMenuNumbers(); + for (var i = 0; i < currentSiteAnchors.length; i++) + if (currentSiteAnchors[i]['link'] && currentSiteAnchors[i]['link']['numberEl']) { + var nrEl = currentSiteAnchors[i]['el'].getElementsByTagName('span')[0]; + if (!nrEl || (' '+nrEl.className+' ').indexOf(' number ') < 0) { + nrEl = frames[current].contentWindow.document.createElement('span'); + currentSiteAnchors[i]['el'].insertBefore(nrEl, currentSiteAnchors[i]['el'].firstChild); + } + nrEl.innerHTML = currentSiteAnchors[i]['link']['numberEl'].innerHTML; + } + } + if (onMenuChange) onMenuChange(); + // sonstiges + setQueryString(); + blendInfo['currentSiteReady'] = true; + if (onSiteLoaded) { + debugLog('Call onSiteLoaded'+((loadWithoutEffect)?' without effect':'')); + onSiteLoaded(frames[current].contentWindow, loadWithoutEffect); + } + loadingSiteAnchor = getAnchorFromURL(communicators[current].contentURL); + if (loadWithoutEffect && loadingSiteAnchor != '') { + debugLog('Try to scroll to #'+loadingSiteAnchor); + scrollTo(loadingSiteAnchor, 2); + } + }; + + var sitescroll = /* private */ function () { // funktion fuer Scrollevent + if (!autoChangeAnchor || currentSiteAnchors.length == 0 || scrollInfo['scrolling']) return; + // richtigen Anker ermitteln + var pos = window.pageYOffset; + var nr = anchorPos; + while (nr > 0 && currentSiteAnchors[nr]['pos'] > pos + 100) nr--; + while (nr < currentSiteAnchors.length-1 && currentSiteAnchors[nr+1]['pos'] <= pos + 100) nr++; + // Ankerposition testen + if (!currentSiteAnchors[nr]) return; // ToDo: unknown error! + var top = getAbsOffsetTop(currentSiteAnchors[nr]['el']); + if (Math.abs(top - currentSiteAnchors[nr]['pos']) > 5) { + currentSiteAnchors[nr]['pos'] = top; + sitescroll(); + return; + } + if (pos < getAbsOffsetTop(frames[current])) nr = -1; + // Anker wechseln + if (nr != anchorPos) { + anchorPos = nr; + var i = frames[current].contentWindow.location.href.lastIndexOf('#'); + if (i < 0) i = frames[current].contentWindow.location.href.length; + var stateObj = { foo: "bar" }; + var anchorHashtag = ''; + if (nr >= 0) anchorHashtag = '#'+currentSiteAnchors[nr]['id']; + frames[current].contentWindow.history.replaceState(stateObj, '', frames[current].contentWindow.location.href.substring(0,i)+anchorHashtag); + communicators[current].newURL(frames[current].contentWindow.location.href.substring(0,i)+anchorHashtag); // Bugfix: Beim reload der Seite werden im Frame die Funktionen replaceState und pushState nicht ueberwacht + } + }; + + var autoFrameHeight = /* private */ function (auto) { + // wenn true uebergeben wird, wird die Hoehe des iframe-Bereiches auf ~100% der Seitenhoehe (das ClassName 'NoJsHeight' wird wieder an alle Elemente, die dies zu Anfang trugen, angehaengt) angepasst, ansonsten richtet sich die Hoehe nach dem Inhalt des aktuellen frames. + if (auto == isAutoFrameHeight) { + debugLog('Auto frame height already '+((auto)?'activated':'deactivated')+'.'); + return; + } + debugLog(((auto)?'Activate':'Deactivate')+' auto frame height...'); + isAutoFrameHeight = auto; + for (var i = 0; i < autoHeightEl.length; i++) { + var a = autoHeightEl[i].className.split(' '); + var n = ''; + for (var j = 0; j < a.length; j++) { + if (a[j] == 'NoJsHeight') continue; + if (n != '') n += ' '; + n += a[j]; + } + autoHeightEl[i].className = n; + } + if (auto) { + for (var i = 0; i < autoHeightEl.length; i++) { + if (autoHeightEl[i].className != '') autoHeightEl[i].className = autoHeightEl[i].className + ' '; + autoHeightEl[i].className = autoHeightEl[i].className + 'NoJsHeight'; + } + frames[current].style.height = '100%'; + try { frames[current].contentWindow.document.body.style.overflow = 'auto'; } catch (e) { } + } else { + try { frames[current].contentWindow.document.body.style.overflow = 'hidden'; } catch (e) { } + } + }; + + var siteResize = /* private */ function (nr, h) { + if (nr != current) return; + debugLog('Resize info from frame '+nr+' received. Height = '+h); + if (loadingSiteAnchor != '') scrollTo(loadingSiteAnchor, 2); + if (onContentResize) onContentResize(communicators[current].contentWidth, communicators[current].contentHeight, communicators[current]); + if (blendInfo['blending'] && !(blendInfo['state'] & 2)) return; // kein Resize fuer noch nicht sichtbare Seiten + if (blendInfo['blending'] && isAutoFrameHeight && h >= 0) frames[next].style.height = frames[next].offsetHeight + 'px'; // automatisch gegebene Hoehe einfrieren, bevor autoFrameHeight false wird + autoFrameHeight(h < 0); + }; + + var titleChange = /* private */ function (title, communicator) { + if (communicator != communicators[current]) return; + if (onTitleChange) onTitleChange(title); + }; + + var blend = /* private */ function () { + // Loop fuer Einblendeeffekt + if (!blendInfo['timer']) blendInfo['timer'] = window.setInterval(blend, 40); + var t = getTickCount(); + // blendState - Flags: 1 = alter Frame wurde ausgeblendet 2 = neue Seite hat geladen und Verzoegerung ist um 4 = neue Seite wurde eingeblendet + if ((blendInfo['state'] & 1) != 1 && !blendInfo['browse']) { // Wenn Flag 1 nicht gesetzt (alte Seite ausblenden) + if (t - blendInfo['start'] < blendOutTime) { + if (blendOutEffect) blendOutEffect(frames[next], (t - blendInfo['start'])/blendOutTime, false); + } else { + blendInfo['state'] += 1; + frames[next].style.display = 'none'; + communicators[next].setSrc('about:blank'); + if (blendOutEffect) blendOutEffect(frames[next], -1, false); + } + } + if (((blendInfo['state'] & 2) != 2) && (blendInfo['currentSiteReady'] || t - blendInfo['start'] > maxWaitForSite) && (t - blendInfo['start'] > blendInDelay)) { // Wenn Flag 2 nicht gesetzt und Bedingungen fuer Einblenden von neuer Seite erfuellt (neue Seite anzeigen) + if (blendInEffect && !blendInfo['browse']) blendInEffect(frames[current], 0, true); + else if (browseEffect && blendInfo['browse']) browseEffect(frames[current], frames[next], 0, blendInfo['dir']); + frames[current].style.maxHeight = 'none'; + blendInfo['startDelay'] = t; + blendInfo['state'] += 2; + siteResize(current, communicators[current].contentHeight); + if (blendInfo['browse']) { + if (blendInfo['dir']) loadingSiteAnchor = communicators[current].contentHeight + frames[current].parentElement.offsetTop - window.innerHeight; + else loadingSiteAnchor = 0; + } + if (blendInfo['browse']) scrollTo(loadingSiteAnchor, 5); + else if (loadingSiteAnchor != '') scrollTo(loadingSiteAnchor, 1); + } + if (((blendInfo['state'] & 4) != 4) && (blendInfo['state'] & 2)) { // wenn Flag 2 gesetzt aber Flag 4 noch nicht (neue Seite einblenden) + if (blendInfo['browse']) { + if (t - blendInfo['startDelay'] < browseDuration) { + if (browseEffect) browseEffect(frames[current], frames[next], (t-blendInfo['startDelay'])/browseDuration, blendInfo['dir']); + } else { + blendInfo['state'] |= 5; + frames[next].style.display = 'none'; + communicators[next].setSrc('about:blank'); + if (browseEffect) browseEffect(frames[current], frames[next], -1, blendInfo['dir']); + } + } else { + if (t - blendInfo['startDelay'] < blendInTime) { + if (blendInEffect) blendInEffect(frames[current], (t - blendInfo['startDelay'])/blendInTime, true); + } else { + blendInfo['state'] |= 4; + if (blendInEffect) blendInEffect(frames[current], -1, true); + } + } + } + if ((blendInfo['state'] & 5) == 5) { // wenn Flag 1 und 4 gesetzt (Blendvorgang beenden) + if (blendInfo['timer']) window.clearInterval(blendInfo['timer']); + blendInfo['timer'] = null; + blendInfo['blending'] = false; + } + }; + + this.loadSite = /* public */ function (src, behavior) { // behavior : 0=normal, 1=kein Effekt, 2=blaettern, 4=nach oben blaettern + if (!behavior) behavior = 0; + if (incompatibleBrowser || src == 'about:blank') { + debugLog('Incompatible site load blocked: '+src); + return; + } + src = absolutePath(src); + if (isNotInWhitelist(src)) { + debugLog('Not whitelisted site blocked: '+src); + return; + } + if (!domWasReady && behavior == 1) { + this.scriptLoadingPage = src; + return; + } + // Wenn neue Seite gleich aktueller Seite, nur scrollTo ausfuehren + if (getSiteFromURL(src) == currentSite) { + if (~behavior & 2) scrollTo(getAnchorFromURL(src)); + debugLog('Loading of site blocked, because it already is loaded! ('+src+')'); + return; + } + // Einstellungen + loadWithoutEffect = (behavior & 1) == 1; + if (loadWithoutEffect) debugLog('Load without effect'); + else debugLog('Load with effect'); + currentSiteAnchors = new Array(); + anchorPos = 0; + // Wenn Effekt aktiv, nur neue Seite in aktuellen Frame laden + if (blendInfo['blending']) { + debugLog('Replacing url of currently loading site in frame '+current+' with '+src); + communicators[current].setSrc(src); + return; + } + // current und next wechseln + current = next; + next = (current == 0)?1:0; + // neue Seite laden + if (!loadWithoutEffect) { + blendInfo['currentSiteReady'] = false; + blendInfo['blending'] = true; + } + debugLog('Frame '+current+' starts loading of '+src+' | behavior = '+behavior); + communicators[current].setSrc(src); + // PrintLinks umstellen + if (current == 0) + for (var i = 0; i < printLinks.length; i++) + printLinks[i].href = 'javascript:'+aTarget+'.print()'; + else + for (var i = 0; i < printLinks.length; i++) + printLinks[i].href = 'javascript:'+aTarget2+'.print()'; + // Blenduebergang starten + if (loadWithoutEffect) { + frames[next].style.display = 'none'; + frames[current].style.display = 'block'; + } else { + frames[current].style.maxHeight = '0px'; + frames[current].style.display = 'block'; // display = block ist notwendig, damit Seite im Frame beginnt zu laden! + blendInfo['state'] = 0; + blendInfo['browse'] = (behavior & 2) == 2; + blendInfo['dir'] = (behavior & 4) == 4; + blendInfo['start'] = getTickCount(); + blend(); + } + }; + + var scroll = /* private */ function () { + // Loop fuer Scroll-Effekt + if (!scrollInfo['timer']) scrollInfo['timer'] = window.setInterval(scroll, 40); + var t = getTickCount(); + var d = scrollInfo['blendEffectTime']; + if (scrollInfo['start'] + d > t) { + var s = (t - scrollInfo['start']) / d; + s = scrollInfo['fkt'](s); + s = scrollInfo['startPos'] * (1-s) + scrollInfo['endPos'] * s; + window.scrollTo(window.pageXOffset, s); + } else { + scrollInfo['scrolling'] = false; + if (scrollInfo['timer']) window.clearInterval(scrollInfo['timer'], 40); + scrollInfo['timer'] = null; + window.scrollTo(window.pageXOffset, scrollInfo['endPos']); + } + }; + + this.scrollTo = /* public */ function (target, scrollbehavior) { // scrollbehavior: 0=normal, 1=scrollt so lange, wie Einblendeeffekt, 2=springt sofort zu neuer Position (kein Effekt), 4=scrollFkt = browseScrollFkt + if (!scrollbehavior) scrollbehavior = 0; + if (incompatibleBrowser) return; + if (scrollbehavior & 4) scrollInfo['fkt'] = browseScrollFunction; + else scrollInfo['fkt'] = scrollFunction; + // Scrollziel suchen + var pos = 0; + if (!isNaN(target)) pos = target; + else { + try { + var el = frames[current].contentWindow.document.getElementById(target); + if (!el) el = frames[current].contentWindow.document.getElementsByName(target)[0]; + if (el) pos = getAbsOffsetTop(el); + } catch (e) { return; } + try { + var L = frames[current].contentWindow.location.href; + var i = L.lastIndexOf('#'); + if (i > 0 && L.lastIndexOf('?') < i) L = L.substring(0, i); + var stateObj = { foo: "bar" }; + if (frames[current].contentWindow.location.href != L+'#'+target) + frames[current].contentWindow.history.replaceState(stateObj, document.title+': '+frames[current].contentWindow.document.title, L+'#'+target); + } catch (e) { } + } + // Scrollziel setzen + if (loadingSiteAnchor != '' && getAbsOffsetTop(frames[current]) + frames[current].offsetHeight >= pos) { + debugLog('Anchor of loading site is reachable.'); + loadingSiteAnchor = ''; + } + scrollInfo['endPos'] = pos; + if (scrollInfo['scrolling']) return; + // Scrolleffekt starten + scrollInfo['scrolling'] = true; + scrollInfo['start'] = getTickCount(); + if (scrollbehavior & 2) scrollInfo['start'] = 0; + scrollInfo['startPos'] = window.pageYOffset; + scrollInfo['blendEffectTime'] = scrollTime; + if (scrollbehavior & 1) scrollInfo['blendEffectTime'] = blendInTime; + if (scrollbehavior & 5 == 5) scrollInfo['blendEffectTime'] = browseDuration; + scroll(); + return; + }; + + this.enableOverscroll = function () { + if (overscrollListener) return; + overscrollListener = createOverscrollListener(document, 1000, function (dir) { + for (var i = 0; i < menuLinks.length; i++) if (menuLinks[i]['active']) { + if (dir && i < menuLinks.length - 1) { loadSite(menuLinks[i+1].href, 2); activateLink(menuLinks[i+1]); } + else if (!dir && i > 0) { loadSite(menuLinks[i-1].href, 6); activateLink(menuLinks[i-1]); } + return; + } + }); + }; + + this.getActiveContentWindow = function () { + return frames[current].contentWindow; + }; + + this.getActiveCommunicator = function () { + return communicators[current]; + }; + + create(); // Objekt sollte vollstaendig geladen sein, bevor Create aufgerufen wird +} } diff --git a/js/JSWSystem.js b/js/JSWSystem.js new file mode 100644 index 0000000..477c5dd --- /dev/null +++ b/js/JSWSystem.js @@ -0,0 +1,570 @@ +var JSWSelfScriptPath = document.getElementsByTagName('script')[document.getElementsByTagName('script').length-1].src; +var JSWDefaultPaths = { units : ['modules/'], libraries : ['other/'], applications : ['applications/'], icons : '../icons/', designInfo : '../css/designinfo.json' }; +function unitLoadDefault () { throw 'No unit manager active in current window!'; } +var unitLoad = unitLoadDefault; + +function JSWUnitManager (paths) { + this.paths = paths; + // set selfScriptPath + if (!this.paths.selfScriptPath) { + this.paths.selfScriptPath = JSWSelfScriptPath; + if (this.paths.selfScriptPath.indexOf('\/JSWSystem.js') < 0) throw 'JSWSystem.js kann seinen eigenen Pfad nicht feststellen! Die Datei JSWSystem.js darf nicht umbenannt werden und muss beim laden der Seite geladen werden.'; + this.paths.selfScriptPath = this.paths.selfScriptPath.substring(0, this.paths.selfScriptPath.lastIndexOf('\/')+1); + } + // make paths absolute + for (var key in this.paths) { + if (typeof this.paths[key] == 'string') this.paths[key] = absolutePath(this.paths[key], this.paths.selfScriptPath); + else for (var i = 0; i < this.paths[key].length; i++) this.paths[key][i] = absolutePath(this.paths[key][i], this.paths.selfScriptPath); + } + // rest of init + if (!this.paths.libraries) this.paths.libraries = this.paths.units; + this.units = new Object(); + var _this = this; + if (unitLoad != unitLoadDefault) throw 'There is already an active unit manager in current window!'; + unitLoad = function (uName, units, unitFkt) { + if (units && units.length > 0) _this.uses(_this.units[uName], units, function () { new unitFkt(_this.units[uName], _this); }); + else new unitFkt(_this.units[uName], _this); + }; +} +JSWUnitManager.prototype = { + // public + defaultDesign : 'default', + // public readonly + stylesheets : null, + // protected + units : null, + paths : null, // contains: selfScriptPath:Path of this js-file units:Array of unit search paths libraries:Array of library search paths applications:Array of application search paths designInfo:Path of design info json icons + onDesignLoaded : null, + onUnitLoaded : null, + + // garantees, that the unit uName is loaded when callback is called. Adds dependency to unit's dependencies. Can also load scripts, that are no units by setting isLib to true. uPaths is an array of one or more possible folders of the unit; tries first folder, if unit isn't located there (404-error) tries second folder, etc. + loadUnit : /* protected */ function (uPaths, uName, dependency, callback, isLib) { // can be called recoursively! + if (!uPaths) uPaths = ['']; + var u = this.units[uName]; + if (u && this.units[uName].loaded) { // Unit wurde vollstaendig geladen + u.dependencies.push(dependency); + callback(u); + } else if (u) { // Unit wird bereits geladen + u.dependencies.push(dependency); + var oldOnload = u.onload; + u.onload = function (unit, err) { + oldOnload(unit, err); + callback(u); + }; + } else { // Unit wurde noch nicht geladen + var _this = this; + if (isLib) for (var key in this.units) if (this.units[key].isLib && !this.units[key].loaded) { // ensure, to load not more than one library at a time due to inter-library dependencies + var oldOnload = this.units[key].onload; + this.units[key].onload = function (unit, err) { + oldOnload(unit, err); + _this.loadUnit(uPaths, uName, dependency, callback, isLib); + }; + return; + } + u = new Object(); + this.units[uName] = u; + u.name = uName; + u.manager = _this; + u.isLib = isLib; + u.dependencies = new Array(dependency); // units/windows, die diese Unit benoetigen + u.loaded = false; + u.onload = function (unit, err) { + if (u.loaded) throw 'Unit "'+u.name+'" is already loaded!'; + u.loaded = true; + u.err = err; + if (unit) u.unit = unit; + if (err) throw err; // no callback on error + if (_this.onUnitLoaded) _this.onUnitLoaded(u); + if (callback) callback(u); + }; + u.forceUnload = function () { + try { u.unit.free(); } catch (e) { } + document.getElementsByTagName('head')[0].removeChild(u.script); + delete _this.units[u.name]; + _this.removeDependencies(u); + for (var key in u) if (typeof u[key] == 'object') u[key] = null; + u = null; + }; + pathNr = 0; + function testNextLocation () { + u.script = document.createElement('script'); + if (isLib) u.script.addEventListener('load', function () { u.onload(null); }, false); + u.script.addEventListener('error', function () { + document.getElementsByTagName('head')[0].removeChild(u.script); + u.script = null; + if (pathNr < uPaths.length-1) { + pathNr++; + testNextLocation(); + } else u.onload(null, 'Unit "'+uName+'" not found!'); // call onload even in error-case for not blocking i.e. the loading of further libraries + }, false); + u.script.type = 'text/javascript'; + u.script.src = uPaths[pathNr] + uName + '.js'; + document.getElementsByTagName('head')[0].appendChild(u.script); + } + this.addOnStart(testNextLocation); // ensure, that units will not load before start of inherited class (i.e. JSWSystem) + } + }, + + // simple function for loading a unit without need of a dependency object. For holding the dependency, a dummy-object is created and returned by this function. If this object isn't stored, the unit cannot be unloaded later. This function can also load a unit by it's full path name. + dynamicallyLoadUnit : /* public */ function (uLocation, callback) { + if (!callback) callback = function () { }; + var uPath = uLocation.split('\/'); + var uName = uPath.pop().split('.')[0]; + if (uPath.length == 0) uPath = this.paths.units; + else uPath = [uPath.join('\/') + '\/']; + var dependency = new Object(); + this.loadUnit(uPath, uName, dependency, callback); + return dependency; + }, + + checkForApplicationStart : /* protected */ function () { }, // to be overridden + iterateDocuments : /* protected */ function (callback) { callback(window.document); }, // to be overridden + addOnStart : /* public */ function (fkt) { fkt(); }, // to be overridden + + // loads one or more units for an object (i.e. window or unit-obj) as dependency and additionally stores it in obj.jswUnits if obj is a window (required in checkForApplicationStart) + uses : /* public */ function (obj, units, callback) { + if (typeof units == 'string') units = [units]; + var loaded = 0; + var lastLib = 0; + for (var i = 0; i < units.length; i++) { + // check, if units[i] is a library + var isLib = false; + if (units[i].indexOf('lib:') == 0) { + isLib = true; + units[i] = units[i].substring(4, units[i].length); + } + // store used units in obj (if obj is a window) + if (obj.self == obj) { + if (!obj.jswUnits) obj.jswUnits = new Array(); + if (obj.jswUnits.indexOf(units[i]) == -1) obj.jswUnits.push(units[i]); + } + // load... + var _this = this; + this.loadUnit((isLib)?_this.paths.libraries:_this.paths.units, units[i], obj, function (u) { + if (obj.self == obj && obj.jswApplication) _this.checkForApplicationStart(obj.jswApplication); + if (u.onUsed) u.onUsed(obj); + loaded++; + if (loaded >= units.length && callback) callback((units.length==1)?u.unit:null); + }, isLib); + } + }, + + // returns the file name without ending of a JSW-managed style element + styName : /* public */ function (sty) { + if (sty.rel != 'stylesheet' || (' '+sty.className+' ').indexOf(' JSW ') == -1) return ''; // not a JSW-managed stylesheet + if (!sty.jswName) { + sty.jswName = sty.href.split('\/').pop(); + if (sty.jswName.lastIndexOf('.css') == sty.jswName.length-4) sty.jswName = sty.jswName.substring(0, sty.jswName.length-4); + } + return sty.jswName; + }, + + applyDesign : /* public */ function (info, infoUrl, design, recursiveCall) { + if (!recursiveCall) this.stylesheets = new Array(); + var s = info[design]; + if (!s) throw 'Design "'+design+'" not found!'; + if (s.inherits) this.applyDesign(info, infoUrl, s.inherits, true); + for (key in s.files) this.stylesheets[key] = absolutePath(s.files[key].url, infoUrl); + }, + + // call this, when obj requires the stylesheet with name css in document doc + usesCSS : /* public */ function (obj, doc, css, callback) { + if (!this.stylesheets) { // no design loaded. Load standard design and try again... + var _this = this; + if (!this.onDesignLoaded) { + this.onDesignLoaded = [function () { _this.usesCSS(obj, doc, css, callback); }]; + // load default design + jsw.parseJSONFile(this.paths.designInfo, function (json) { + _this.applyDesign(json, _this.paths.designInfo, _this.defaultDesign); + for (var i = 0; i < _this.onDesignLoaded.length; i++) _this.onDesignLoaded[i](); + }); + } else this.onDesignLoaded.push(function () { _this.usesCSS(obj, doc, css, callback); }); + return; + } + var head = doc.getElementsByTagName('head')[0]; + var stys = head.getElementsByTagName('link'); + var sty = null; + for (var i = 0; i < stys.length; i++) if (this.styName(stys[i]) == css) { sty = stys[i]; break; } + if (sty == null) { + var styleInfo = this.stylesheets[css]; + if (!styleInfo) throw 'Stylesheet "'+css+'" not availlable in current design!'; + sty = doc.createElement('link'); + sty.rel = 'stylesheet'; + sty.className = 'JSW'; + sty.href = styleInfo; + head.appendChild(sty); + } + if (obj) { + if (!sty.jswDependencies) sty.jswDependencies = new Array(); + if (sty.jswDependencies.indexOf(obj) == -1) sty.jswDependencies.push(obj); + } else sty.jswDependencies = [null]; // never unload this stylesheet + if (callback) callback(); + }, + + // call this function, when the obj is freed and does not longer require any other unit or stylesheet + removeDependencies : /* private */ function (obj) { + // remove unnecessary units + var a = new Array(); + for (var key in this.units) { + if (!this.units[key]) continue; + for (var j = this.units[key].dependencies.length - 1; j >= 0; j--) if (this.units[key].dependencies[j] == obj) this.units[key].dependencies.splice(j, 1); + if (this.units[key].dependencies.length == 0) a.push(this.units[key]); + } + for (var i = 0; i < a.length; i++) a[i].forceUnload(); + a = null; + // remove unneccessary styles + this.iterateDocuments(function (doc) { + var head = doc.getElementsByTagName('head')[0]; + var stys = head.getElementsByTagName('link'); + for (var i = stys.length-1; i >= 0; i--) { + if (!stys[i].jswDependencies) continue; + var j = stys[i].jswDependencies.indexOf(obj); + if (j != -1) stys[i].jswDependencies.splice(j, 1); + if (stys[i].jswDependencies.length == 0) head.removeChild(stys[i]); + } + }); + } +} + +function JSWUnitManagerPrototype () { } +JSWUnitManagerPrototype.prototype = JSWUnitManager.prototype; + + + + +function JSWSystem /* extends JSWUnitManager */ () { + // inherited Constructor + JSWUnitManager.call(this, JSWDefaultPaths); + + // private + var onStart = new Array(); + var applications = new Array(); + var standardConsole = new JSWConsole(); + var _this = this; + + // protected + this.selfHostname = ''; + + // public (Readonly) + this.mgr = null; + this.taskbar = null; + this.whitelist = new Array(); + this.idWin = new Object(); + this.standardPos = { top : 100, left : 100, width : 400, height : 200, right : Number.NaN, bottom : Number.NaN }; + this.standardBehavoir = 16; + + this.start = /* public */ function () { + // check + if (_this.mgr) return; + var el = document.body; + if (!el) return; + if (!window.JSWManager) throw 'JSWManager.js must be imported before JSWSystem.js!'; + if (!window.FrameCommunicator) throw 'Zum Erstellen von JSWSystem wird frameCommunicator.js benoetigt!'; + // initialization + selfHostname = getHostnameAndProtocol(self.location.href); + _this.mgr = new JSWManager(el); + _this.taskbar = new JSWTaskbar(_this.mgr); + if (document.getElementById('menu')) _this.taskbar.setMenu(document.getElementById('menu')); + autoCreateWindows(); + for (var i = 0; i < onStart.length; i++) onStart[i](); + onStart = null; + _this.mgr.addEventListener('hide', onWinHide); + window.setTimeout(function () { _this.processSite(document.body); }, 1000); + }; + + if (document.addEventListener) document.addEventListener('DOMContentLoaded', _this.start, false); + + var onWinHide = /* private */ function (win) { // wird aufgerufen, wenn ein Fenster geschlossen wird. Nach dem Schliessen werden auch die ContentWindows der Iframes des Fensters freigegeben (Auch, wenn das Fenster selbst nicht freigegeben wird)! + for (var i = 0; i < win.el['InnerBox'].getElementsByTagName('iframe').length; i++) _this.removeDependencies(win.el['InnerBox'].getElementsByTagName('iframe')[i].contentWindow); + }; + + var autoCreateWindows = function () { + var el = _this.mgr.parentElement.getElementsByTagName('div'); + for (var i = 0; i < el.length; i++) { + var n = ' '+el[i].className+' '; + if (n.indexOf(' JSW ') < 0 || n.indexOf(' OuterBox ') < 0) continue; + (new JSWindowManaged(_this.mgr, null, el[i])).setRecoveryURL((el[i].id)?'$'+el[i].id:''); + } + }; + + var isNotInWhitelist = /* private */ function (src) { + if (getHostnameAndProtocol(src) == selfHostname) return false; + for (var i = 0; i < _this.whitelist.length; i++) if (_this.whitelist[i].test(src)) return false; + return true; + }; + + var titleFormURL = /* private */ function (url) { + url = url.split('\/'); + var i = url.length-1; + while (i > 0 && url[i] == '') i--; + return url[i]; + }; + + this.iterateDocuments = /* protected */ function (callback) { + JSWUnitManager.prototype.iterateDocuments.call(this, callback); // inherited + this.iterateWindows(function (win) { if (win.mainFrame) try { callback(win.mainFrame.contentWindow.document); } catch (e) {} }); + }; + + this.iterateWindows = /* public */ function (callback) { + if (!_this.mgr) return; + for (var i = 0; i < _this.mgr.layers.length; i++) for (var j = 0; j < _this.mgr.layers[i].windows.length; j++) callback(_this.mgr.layers[i].windows[j]); + }; + + this.processSite = /* public */ function (el, mainWindow) { + function addListener (el, max, ex, sameLayer) { + el.addEventListener('click', function (ev) { + var b = 19; + if (max) b += 4; + if (ex) b += 8; + var l = null; + if (sameLayer && mainWindow) l = mainWindow.layer; + var w = jsw.createWindowFromSite(this.href, b, l); + if (ev.preventDefault) ev.preventDefault(); + return false; + }, false); + el.jswProcessed = true; + } + var a = el.getElementsByTagName('a'); + for (var i = 0; i < a.length; i++) if ((' '+a[i].className+' ').indexOf(' WindowLink ') != -1 && !a[i].jswProcessed) addListener(a[i], ((' '+a[i].className+' ').indexOf(' openMaximized ') != -1), ((' '+a[i].className+' ').indexOf(' openExcludable ') != -1), ((' '+a[i].className+' ').indexOf(' openInSameLayer ') != -1)); + }; + + this.addOnStart = /* public */ function (fkt) { + if (_this.mgr) fkt(); + else onStart.push(fkt); + }; + + this.addURLToWhitelist = /* private */ function (url) { + var rep = new RegExp('([^\\w&^\\*])', 'g'); + var host = getHostnameAndProtocol(url); + var i = host.length; + host = host.replace(rep, '\\$1'); + var path = url.substring(i, url.length).replace(rep, '\\$1'); + if (path == '' && host.length > 0 && host.charAt(host.length-1) == '*') path = '*'; + while (host.length > 0 && host.charAt(host.length-1) == '*') host = host.substring(0, host.length-1); + if (host == '') throw 'URL has wrong syntax'; + rep = new RegExp('\\*', 'g'); + path = path.replace(rep, '[a|^a]*'); // innerhalb des path-Bereiches koennen die * fuer beliebige Inhalte stehen + // innerhalb des hostname-Bereiches haben die * spezielle Aufgaben + var a = host.split('\\\:\\\/\\\/'); + if (a.length == 1) { + a = a[0].split('*'); + if (a.length == 2) { + host = a[0] + '(\\w)*\\:\\/\\/((\\w)+\\.)*' + a[1]; + } else throw 'URL has wrong syntax'; + } else if (a.length == 2) { + rep = new RegExp('(\\*)', 'g'); + a[0] = a[0].replace(rep, '(\\w)*'); + a[1] = a[1].replace(rep, '((\\w)+\\.)*'); + host = a[0] + '\\:\\/\\/' + a[1]; + } else throw 'URL has wrong syntax'; + _this.whitelist.push(new RegExp('\^'+host+path)); + }; + + this.checkForApplicationStart = /* protected */ function (app) { + if (app.started || !app.loaded || app.terminated) return; + if (app.win.jswUnits) for (var i = 0; i < app.win.jswUnits.length; i++) if (!_this.units[app.win.jswUnits[i]].loaded) return; + if (!app.win.main) throw app.frame.src + ' is not a valid jsw-application!'; + app.started = true; + app.win.main(app.outerBox); + }; + + this.runApplication = /* public */ function (url, params, console, callback, launchedFromAdressbar) { + if (!console) console = standardConsole; + // makeup url + if (url.lastIndexOf('.html') != url.length-5) url += '.html'; + // ensure params is an array + if (typeof params == 'string') params = [params]; + if (!params) params = new Array(); + // prepare application object + var a = new Object(); + applications.push(a); + a.loaded = false; + a.started = false; + a.terminated = false; + a.console = console; + a.params = params; + a.onConsoleEnter = null; + // application functions + a.createMainWindow = function (pos) { + if (a == null) throw 'Application terminated!'; + var w = new JSWindowManaged(_this.mgr, null, a.outerBox); + w.freeOnHide = true; + a.mainWindow = w; + w.mainFrame = a.frame; + a.communicator = new FrameCommunicator(a.frame); + w.pos = (pos)?pos:clone(_this.standardPos); + w.setPos(); + w.title = a.communicator.contentTitle; + w.addEventListener('free', function (w) { // call application.terminate if main window gets freed + if (a == null || a.terminated) return; + a.mainWindow = null; + a.terminate(); + }); + w.show(); + } + a.terminate = function () { + if (a == null) throw 'Application terminated!'; + if (a.win) { + if (a.win.terminate) a.win.terminate(); + _this.removeDependencies(a.win); + a.win.jswApplication = null; + } + if (a.console && a.console.listeningApps) a.console.listeningApps.splice(a.console.listeningApps.indexOf(a), 1); + a.terminated = true; + a.frame.src = ''; + if (a.mainWindow) a.mainWindow.free(); + else try { document.body.removeChild(a.outerBox); } catch (e) {} + for (var key in a) if (typeof a == 'object') a[key] = null; + a = null; + if (callback) callback(); + } + // inner- und Outer box, falls Anwendung ein MainWindow erzeugen möchte + a.outerBox = document.createElement('div'); + a.outerBox.className = 'JSW OuterBox'; + a.outerBox.style.visibility = 'hidden'; + document.body.appendChild(a.outerBox); + a.innerBox = document.createElement('div'); + a.innerBox.className = 'JSW InnerBox'; + a.outerBox.appendChild(a.innerBox); + // create application frame + a.frame = document.createElement('iframe'); + a.frame.addEventListener('load', function () { + a.loaded = true; + a.win = a.frame.contentWindow; + if (launchedFromAdressbar && !a.win.enableAdressBarLaunch) throw 'Application does not allow launch from adressbar!'; + a.win.jswApplication = a; + _this.checkForApplicationStart(a); + }); + a.frame.style.marginBottom = '-4px'; + a.frame.style.width = '100%'; + a.frame.style.height = '100%'; + a.frame.style.border = '0px none transparent'; + // append application to console + if (a.console && a.console.listeningApps) a.console.listeningApps.push(a); + // run application frame + a.innerBox.appendChild(a.frame); + var pathNr = 0; + function testNextLocation () { + if (pathNr >= _this.paths.applications.length) throw 'Application "'+url+'" not found!'; + var path = absolutePath(url, _this.paths.applications[pathNr]); + if (path.indexOf(getHostnameAndProtocol(window.location.href)) != 0) throw 'Applications must be of the same domain!'; + pathNr++; + a.frame.src = path; + } + a.frame.addEventListener('error', testNextLocation, false); + testNextLocation(); + // delete unnecessary function parameters + params = null; + console = null; + }; + + this.findCorrespondingWindow = /* public */ function (el) { + var p = el; + while (p) { + if (p.jswLinkedWindow) return p.jswLinkedWindow; + p = p.parentElement; + } + p = el.ownerDocument.defaultView; + if (p.jswApplication) return p.jswApplication.mainWindow; + else return p.jswMainWindow; + }; + + this.createWindowFromSite = /* public */ function (url, behavoir, layer) { + if (!behavoir) behavoir = _this.standardBehavoir; + _this.start(); + url = absolutePath(url); + if (isNotInWhitelist(url)) return; + // window erstellen + var w = new JSWindowManaged(_this.mgr, layer, null); + if (w.freed) return null; // Fenster hat sich selbst freigegeben + w.pos = clone(_this.standardPos); + w.title = titleFormURL(url); + // iframe-Element erstellen + var f = document.createElement('iframe'); + f.style.marginBottom = '-4px'; + f.style.width = '100%'; + f.style.height = '100%'; + f.style.border = '0px none transparent'; + w.el['InnerBox'].appendChild(f); + // communicator erstellen + var c = new FrameCommunicator(f); + c.onTitleChanged = function (title) { if (title != '') w.title = title; }; + c.onURLChanged = function (host, url) { w.setRecoveryURL(url); }; + w.mainFrame = f; + // Seite laden + w.showFrameload(_this.mgr.parentElement); + var load = function () { + if (w.freed) return null; // Fenster hat sich selbst freigegeben + if (behavoir & 4) w.maximize(); + if (behavoir & 8) w.excludable = true; + if (behavoir & 16) w.titleToID(); + if (w.freed) return null; // Fenster hat sich selbst freigegeben + w.show(); + if (behavoir & 1) w.activate(); + if (behavoir & 2) w.bringToFront(); + if (behavoir & 32) w.exclude(); + if (behavoir & 64) w.minimize(); + if (behavoir & 128) JSWEffect_terminate(w); + } + if (document.addEventListener) f.addEventListener('load', load, false); else f.attachEvent('onload', load); + f.src = url; + return w; + }; + + this.parseJSON = function (str, callback) { + var blob = new Blob(["addEventListener('message', function (ev) { var json; eval('json='+ev.data); postMessage(json); }, false);"]); + var worker = new Worker(URL.createObjectURL(blob)); + worker.addEventListener('message', function (ev) { + worker.terminate(); + callback(ev.data); + }, false); + worker.postMessage(str); + }; + + this.parseJSONFile = function (src, callback) { + var loader = new XMLHttpRequest(); + loader.overrideMimeType("application/json"); + loader.open('GET', absolutePath(src), true); + var _this = this; + loader.onreadystatechange = function () { + if (loader.readyState == 4) _this.parseJSON(loader.responseText, callback); + }; + loader.send(null); + }; + + _this.start(); +} + +JSWSystem.prototype = new JSWUnitManagerPrototype(); + + + +JSWConsole = function () { +}; + +JSWConsole.prototype = { + log : function (text) { } +}; + +function JSWConsolePrototype () { } +JSWConsolePrototype.prototype = JSWConsole.prototype; + + + +// initialization +window.jswMainWindow = null; +window.jsw = (function () { + if (document.getElementsByTagName('script')[document.getElementsByTagName('script').length-1].getAttribute('noautostart') != null) return null; + else if (parent != self && parent.jsw) { + for (var i = 0; i < parent.document.getElementsByTagName('iframe').length; i++) { + if (parent.document.getElementsByTagName('iframe')[i].contentWindow == window) { + var el = parent.document.getElementsByTagName('iframe')[i]; + while (el && !el.jswLinkedWindow) el = el.parentElement; + if (el) jswMainWindow = el.jswLinkedWindow; + } + } + if (document.body) parent.jsw.processSite(document.body, jswMainWindow); + else document.addEventListener('DOMContentLoaded', function () { parent.jsw.processSite(document.body, jswMainWindow); }, false); + return parent.jsw; + } else return new JSWSystem(); +})(); diff --git a/js/JSWindow.js b/js/JSWindow.js new file mode 100644 index 0000000..a8e2e01 --- /dev/null +++ b/js/JSWindow.js @@ -0,0 +1,954 @@ +// Alg. Funktionen +function getTickCount () { + var T = new Date(); + return T.getMilliseconds() + T.getSeconds() * 1000 + T.getMinutes() * 60000 + T.getHours() * 3600000 + T.getDay() * 86400000; +} + +function clone (obj, runConstructors, chain) { // Abgeaendert von http://forum.de.selfhtml.org/archiv/2009/3/t185276/ + if (obj == null || typeof(obj) != 'object') return obj; + if (!chain) chain = new Array(obj); + else { + for (var i = 0; i < chain.length; i++) if (chain[i] == obj) return obj; + chain.push(obj); + } + if (runConstructors) var c = new obj.constructor(); else var c = new Object(); + for (var key in obj) if (typeof(obj) == 'object') c[key] = clone(obj[key], runConstructors, chain); else c[key] = obj[key]; + return c; +} + +function JSWEffect_terminate (win, _break) { + if (!win.effect) return; + if (win.effect['interval']) window.clearInterval(win.effect['interval']); + win.effect['interval'] = null; + win.effect['stop'] = Number.NaN; + var b = false; + if (!_break) b = win.effect['fkt'](win); + win.effect = null; + return b; +} + + + + + +// Effekte +function JSWEffect_Blend (win, duration, onTerminate, opacity) { + if (duration) { // start + if (!window.getComputedStyle) return; // Keinen Effekt fuer alten IE + var style = window.getComputedStyle(win.el['OuterBox']); + + if (JSWEffect_terminate(win, (win.effect && win.effect['fkt'] == JSWEffect_Blend && !win.effect.onTerminate)?true:false)) return; // Falls aktiv, laufenden Effekt beenden; falls laufender Effekt JSWEffect_Blend ist, nur abbrechen + win.effect = new Object(); + win.effect['fkt'] = JSWEffect_Blend; + win.effect['onTerminate'] = onTerminate; + win.effect['start'] = getTickCount(); + win.effect['stop'] = win.effect['start'] + duration; + if (style && style['visibility'] == 'visible') win.effect['startOP'] = parseFloat(style['opacity']); + else { + win.effect['startOP'] = 0; + win.el['OuterBox'].style.opacity = 0; + win.el['OuterBox'].style.visibility = 'visible'; + } + win.effect['stopOP'] = opacity; + win.effect['interval'] = window.setInterval(JSWEffect_Blend, 20, win); + } + var t = getTickCount(); + if (isNaN(win.effect['stop']) || t >= win.effect['stop']) { // stop + if (win.effect['interval']) window.clearInterval(win.effect['interval']); + win.effect['interval'] = null; + win.el['OuterBox'].style.opacity = win.effect['stopOP']; + var onTerm = win.effect['onTerminate']; + win.effect = null; + if (onTerm) return onTerm(win); + } else { // effect + var s = (t - win.effect['start']) / (win.effect['stop'] - win.effect['start']); + win.el['OuterBox'].style.opacity = s * win.effect['stopOP'] + (1-s) * win.effect['startOP']; + } +} + +function JSWEffect_ThrowBorder (win, duration, onTerminate, top, left, width, height, reverse) { + if (duration) { // start + if (JSWEffect_terminate(win)) return; // Falls aktiv, laufenden Effekt beenden + win.effect = new Object(); + win.effect['fkt'] = JSWEffect_ThrowBorder; + win.effect['start'] = getTickCount(); + win.effect['stop'] = win.effect['start'] + duration; + win.effect['onTerminate'] = onTerminate; + var p = win.getWindowPos(); + win.effect['startTop'] = (reverse)?top:p[1]; + win.effect['startLeft'] = (reverse)?left:p[0]; + win.effect['startWidth'] = (reverse)?width:win.el['OuterBox'].offsetWidth; + win.effect['startHeight'] = (reverse)?height:win.el['OuterBox'].offsetHeight; + win.effect['stopTop'] = (reverse)?p[1]:top; + win.effect['stopLeft'] = (reverse)?p[0]:left; + win.effect['stopWidth'] = (reverse)?win.el['OuterBox'].offsetWidth:width; + win.effect['stopHeight'] = (reverse)?win.el['OuterBox'].offsetHeight:height; + win.effect['border'] = document.createElement('div'); + win.effect['border'].className = 'JSW ThrowingBorder'; + document.body.appendChild(win.effect['border']); + win.effect['border'].style.top = win.effect['startTop'] + 'px'; + win.effect['border'].style.left = win.effect['startLeft'] + 'px'; + win.effect['border'].style.width = win.effect['startWidth'] + 'px'; + win.effect['border'].style.height = win.effect['startHeight'] + 'px'; + if (win.mgr) win.effect['border'].style.zIndex = win.mgr.maxZ + 1; + win.effect['interval'] = window.setInterval(JSWEffect_ThrowBorder, 20, win); + } + var t = getTickCount(); + if (isNaN(win.effect['stop']) || t >= win.effect['stop']) { // stop + if (win.effect['interval']) window.clearInterval(win.effect['interval']); + win.effect['interval'] = null; + document.body.removeChild(win.effect['border']); + win.effect['border'] = null; + win.setOffsetPosition(win.effect['stopTop'], win.effect['stopLeft'], win.effect['stopWidth'], win.effect['stopHeight']); + var onTerm = win.effect['onTerminate']; + win.effect = null; + if (onTerm) return onTerm(win); + } else { // effect + var s = (t - win.effect['start']) / (win.effect['stop'] - win.effect['start']); + win.effect['border'].style.top = s * win.effect['stopTop'] + (1-s) * win.effect['startTop'] + 'px'; + win.effect['border'].style.left = s * win.effect['stopLeft'] + (1-s) * win.effect['startLeft'] + 'px'; + win.effect['border'].style.width = s * win.effect['stopWidth'] + (1-s) * win.effect['startWidth'] + 'px'; + win.effect['border'].style.height = s * win.effect['stopHeight'] + (1-s) * win.effect['startHeight'] + 'px'; + } +} + + + + + +// JSWindow +function JSWindow (_el) { + // Objekte/Arrays initialisieren + this.eventListeners = new Array(); + this.selfEventListeners = new Object(); + this.parentElement = (_el)?_el.parentElement:null; + this.appended = (this.parentElement)?true:false; + this.el = new Object(); + this.el['OuterBox'] = _el; + this.visible = this.appended; + this.pos = new Object(); + this.pos['position'] = 'absolute'; + // Alle Elemente verlinken/erstellen + var search = true; // falls (spaeter) auf falls gesetzt, so spart sich autoCreateEl die Suche und erstellt das ELement sofort. + var _this = this; + function autoCreateEl(tag, className, parentEl) { // versucht, ein Element vom typ tag und mit entsprechendem className in parentEl zu finden. Wenn nicht vorhanden, wird ein entsprechendes Element erstellt. + if (search) for (var i = 0; i < parentEl.childNodes.length; i++) { + if (parentEl.childNodes[i].nodeType != 1) continue; + if (parentEl.childNodes[i].nodeName.toLowerCase() != tag) continue; + var _className = ' '+parentEl.childNodes[i].className+' '; + if (_className.indexOf(' '+className+' ') < 0) continue; + if (_className.indexOf(' JSW ') < 0) continue; + _this.el[className] = parentEl.childNodes[i]; + return; + } + _this.el[className] = document.createElement(tag); + _this.el[className].className = 'JSW ' + className; + if (parentEl) parentEl.appendChild(_this.el[className]); + } + if (!this.el['OuterBox']) { + search = false; + this.el['OuterBox'] = document.createElement('div'); + this.el['OuterBox'].className = 'JSW OuterBox'; + } + this.el['OuterBox'].jswLinkedWindow = this; + autoCreateEl('div', 'InnerBox', this.el['OuterBox']); + autoCreateEl('div', 'BorderTop', this.el['OuterBox']); + autoCreateEl('div', 'BorderLeft', this.el['OuterBox']); + autoCreateEl('div', 'BorderRight', this.el['OuterBox']); + autoCreateEl('div', 'BorderBottom', this.el['OuterBox']); + autoCreateEl('div', 'EdgeTopLeft', this.el['OuterBox']); + autoCreateEl('div', 'EdgeTopRight', this.el['OuterBox']); + autoCreateEl('div', 'EdgeBottomLeft', this.el['OuterBox']); + autoCreateEl('div', 'EdgeBottomRight', this.el['OuterBox']); + autoCreateEl('div', 'Bar', this.el['OuterBox']); + autoCreateEl('span', 'Title', this.el['Bar']); + autoCreateEl('div', 'Buttons', this.el['Bar']); + autoCreateEl('a', 'ButtonExclude', this.el['Buttons']); this.el['ButtonExclude'].href = 'javascript: \/* '+this.lang.get('newWin')+' *\/'; + autoCreateEl('a', 'ButtonMinimize', this.el['Buttons']); this.el['ButtonMinimize'].href = 'javascript: \/* '+this.lang.get('minimize')+' *\/'; + autoCreateEl('a', 'ButtonMaximize', this.el['Buttons']); this.el['ButtonMaximize'].href = 'javascript: \/* '+this.lang.get('maximize')+' *\/'; + autoCreateEl('a', 'ButtonClose', this.el['Buttons']); this.el['ButtonClose'].href = 'javascript: \/* '+this.lang.get('close')+' *\/'; + // Kontextmenue + this.el['Bar'].contextmenu = new Array( + {'text':this.lang.get('newWin'), 'obj':this, 'fkt':this.exclude, 'isenabled':function(){return _this.excludable;}}, + {'text':this.lang.get('minimize'), 'obj':this, 'fkt':this.minimize, 'isenabled':function(){return _this.minimizable;}}, + {'text':this.lang.get('maximize'), 'obj':this, 'fkt':this.maximize, 'isenabled':function(){return _this.maximizable;}}, + {'text':this.lang.get('close'), 'obj':this, 'fkt':this.hide, 'isenabled':function(){return _this.closable;}} + ); + // Positionsstyle feststellen + if (_el) { + this.offsetParent = this.el['OuterBox'].offsetParent; + var style = (window.getComputedStyle)?window.getComputedStyle(this.el['OuterBox'], null):this.el['OuterBox'].currentStyle; + if (!style) throw 'Existing Element is not completely initialized. This can be the case, if the element is not inserted into the document or sometimes if the site is in an iframe.'; + var realStyle = new Object(); + var s = this.el['OuterBox'].getAttribute('style', false).replace(/\s/g, '').toLowerCase().split(';'); + for (var i = 0; i < s.length; i++) { s[i] = s[i].split(':'); if (!s[i][0]) continue; realStyle[s[i][0]] = s[i][1]; } + var posNumX = 0; + var posNumY = 0; + this.pos['position'] = style.position; + function positionToInt (p, x) { + if (realStyle[p] && realStyle[p] != 'auto') { + if (x) posNumX++; else posNumY++; + _this.pos[p] = parseInt(style[p]); + if (realStyle[p].indexOf('%') > 0) _this.pos[p+'Percent'] = true; + else _this.pos[p+'Percent'] = false; + } else { + _this.pos[p] = Number.NaN; + _this.pos[p+'Percent'] = false; + } + } + positionToInt('top', false); + positionToInt('left', true); + positionToInt('right', true); + positionToInt('bottom', false); + positionToInt('width', true); + positionToInt('height', false); + if (posNumX == 0) { posNumX++; this.pos['left'] = this.el['OuterBox'].offsetLeft; } + if (posNumY == 0) { posNumY++; this.pos['top'] = this.el['OuterBox'].offsetTop; } + if (posNumX == 1) { if (isNaN(this.pos['width'])) this.pos['width'] = this.el['OuterBox'].offsetWidth; else this.pos['left'] = this.el['OuterBox'].offsetLeft; } + if (posNumY == 1) { if (isNaN(this.pos['height'])) this.pos['height'] = this.el['OuterBox'].offsetHeight; else this.pos['top'] = this.el['OuterBox'].offsetTop; } + if (posNumX == 3) this.pos['right'] = Number.NaN; + if (posNumY == 3) this.pos['bottom'] = Number.NaN; + } else { + this.pos.top = 0; + this.pos.left = 0; + this.pos.width = this.minWidth; + this.pos.height = this.minHeight; + } + // Event-Listener setzen + this.onEvent(this.el['OuterBox'], 'mousedown', this.mouseDown); + this.onEvent(document, 'resize', this.documentResize); + this.onEvent(this.el['ButtonExclude'], 'click', function () { this.exclude(true); }); + this.onEvent(this.el['ButtonMinimize'], 'click', this.minimize); + this.onEvent(this.el['ButtonMaximize'], 'click', function () { if (this.maximized) this.normalize(); else this.maximize(); }); + this.onEvent(this.el['ButtonClose'], 'click', this.hide); + // setter aufrufen + var s = ' '+this.el['Buttons'].className+' '; + if (s.indexOf(' nonmaximizable ') >= 0) this.maximizable = false; + if (s.indexOf(' nonminimizable ') >= 0) this.minimizable = false; + if (s.indexOf(' nonclosable ') >= 0) this.closable = false; + if (s.indexOf(' nonexcludable ') >= 0) this.excludable = false; + s = ' '+this.el['OuterBox'].className+' '; + if (s.indexOf(' nonresizable ') >= 0) this.resizable = false; + if (s.indexOf(' nonmovable ') >= 0) this.movable = false; + if (s.indexOf(' autoheight ') >= 0) this.autoHeight = true; + if (s.indexOf(' autowidth ') >= 0) this.autoWidth = true; + if (this.el['Title'].innerHTML != '') this.title = this.el['Title'].innerHTML; + for (var i = 0; i < this.el['Bar'].getElementsByTagName('img'); i++) { + var ic = this.el['Bar'].getElementsByTagName('img')[i]; + if ((' '+ic.className+' ').indexOf('Icon') >= 0) { + this.el['Bar'].removeChild(ic); + this.icon = ic.src; + } + } + // sonstiges + if (this.hasAtr(this.el['OuterBox'], 'maximized')) this.maximize(); + this.setOrRmAtr(this.el['Buttons'], 'nonexcludable', !this._excludable); + if (_el) this.freeOnHide = false; +} + +JSWindow.prototype = { + lang : { + de : { minimize:'Minimieren', maximize:'Maximieren', close:'Schliessen', newWin:'In neuem Fenster oeffnen' }, + en : { minimize:'minimize', maximize:'maximize', close:'close', newWin:'open in new window' }, + get : function (key) { + if (!this.l) { + this.l = navigator.language; + if (!this[this.l]) this.l = 'en'; + } + return (this[this.l][key])?this[this.l][key]:key; + } + }, + + // private + eventListeners : null, // EventListener, die von diesem Objekt gesetzt wurden + selfEventListeners : null, // EventListener, die auf dieses Objekt gesetzt wurden + disabledCount : 0, + // public readonly (darf von public gelesen werden, aber nur von ausgewaehlten Scripts geschrieben) + parentElement : null, + appended : false, + el : null, + visible : false, + pos : null, + effect : null, + maximized : false, + minimized : false, + excluded : false, + freed : false, + // public + _resizable : true, get resizable () { return this._resizable; }, set resizable (v) { this._resizable = v; this.setOrRmAtr(this.el['OuterBox'], 'nonresizable', !v); }, + _movable : true, get movable () { return this._movable; }, set movable (v) { this._movable = v; this.setOrRmAtr(this.el['OuterBox'], 'nonmovable', !v); }, + effects : null, + mainFrame : null, + minWidth : 40, + minHeight : 25, + freeOnHide : true, + _maximizable : true, get maximizable () { return this._maximizable; }, set maximizable (v) { this._maximizable = v; this.setOrRmAtr(this.el['Buttons'], 'nonmaximizable', !v); }, + _minimizable : true, get minimizable () { return this._minimizable; }, set minimizable (v) { this._minimizable = v; this.setOrRmAtr(this.el['Buttons'], 'nonminimizable', !v); }, + _closable : true, get closable () { return this._closable; }, set closable (v) { this._closable = v; this.setOrRmAtr(this.el['Buttons'], 'nonclosable', !v); }, + _excludable : false, get excludable () { return this._excludable; }, set excludable (v) { this._excludable = v; this.setOrRmAtr(this.el['Buttons'], 'nonexcludable', !v); }, + minimizePoint : function () { return new Array(0, 0); }, + minimalVisible : new Array(0, -10, -10, -10), + _title : '', get title () { return this._title; }, set title (v) { this.setTitle(v); }, + _icon : '', get icon () { return this._icon; }, set icon (v) { this.setIcon(v); }, + _autoHeight : false, get autoHeight () { return this._autoHeight; }, set autoHeight (v) { + if (this.freed) throw 'Object is freed'; + if (v == this._autoHeight) return; + this._autoHeight = v; + this.setOrRmAtr(this.el['OuterBox'], 'autoheight', v); + if (this.mainFrame && this.mainFrame.communicator) this.mainFrame.communicator.autoHeight = v; + if (v) { + if (isNaN(this.pos.height)) this.el['OuterBox'].style.bottom = 'auto'; else this.el['OuterBox'].style.height = 'auto'; + } else { + this.actualizePos(); + this.setPos(); + if (this.mainFrame) this.mainFrame.style.height = '100%'; + } + }, + _autoWidth : false, get autoWidth () { return this._autoWidth; }, set autoWidth (v) { + if (this.freed) throw 'Object is freed'; + if (v == this._autoWidth) return; + this._autoWidth = v; + this.setOrRmAtr(this.el['OuterBox'], 'autowidth', v); + if (this.mainFrame && this.mainFrame.communicator) this.mainFrame.communicator.autoWidth = v; + if (v) { + if (isNaN(this.pos.width)) this.el['OuterBox'].style.right = 'auto'; else this.el['OuterBox'].style.width = 'auto'; + } else { + this.actualizePos(); + this.setPos(); + if (this.mainFrame) this.mainFrame.style.width = '100%'; + } + }, + + extendBar : /* public */ function () { + if (this.el.BarExtension) return this.el.BarExtension; + this.el.BarExtension = document.createElement('div'); + this.el.BarExtension.className = 'JSW BarExtension'; + function onResize () { + this.el.BarExtension.style.height = this.el.BarExtension.scrollHeight + 'px'; + this.el.OuterBox.style.paddingTop = (this.el.BorderTop.offsetHeight + this.el.Bar.offsetHeight + this.el.BarExtension.offsetHeight) + 'px'; + } + this.onEvent(this.el.BarExtension, 'overflow', onResize); + this.onEvent(this.el.BarExtension, 'underflow', onResize); + this.el.OuterBox.appendChild(this.el.BarExtension); + return this.el.BarExtension; + }, + + setIcon : /* protected */ function (v) { // to be overridden + if (v == '' && this.el['Icon']) { + this.el['Bar'].removeChild(this.el['Icon']); + delete this.el['Icon']; + } + if (v != '' && !this.el['Icon']) { + this.el['Icon'] = document.createElement('img'); + this.el['Icon'].className = 'JSW Icon'; + this.el['Bar'].insertBefore(this.el['Icon'], this.el['Title']); + } + this._icon = v; + if (v != '') this.el['Icon'].src = v; + }, + + setTitle : /* protected */ function (v) { // to be overridden + if (this.freed) throw 'Object is freed'; + this.el['Title'].innerHTML = v; + this._title = v; + }, + + addEventListener : /* public */ function (type, fkt) { + if (this.freed) throw 'Object is freed'; + if (!this.selfEventListeners[type]) this.selfEventListeners[type] = new Array(); + this.selfEventListeners[type].push(fkt); + }, + + removeEventListener : /* public */ function (type, fkt) { + if (this.freed) throw 'Object is freed'; + if (!this.selfEventListeners[type]) return; + var i = 0; + while (i < this.selfEventListeners[type].length) if (this.selfEventListeners[type][i] == fkt) this.selfEventListeners[type].splice(i, 1); else i++; + if (this.selfEventListeners[type].length == 0) delete this.selfEventListeners[type]; + }, + + callEventListener : /* protected */ function (type, param) { + try { // try notwendig, weil Fenster durch einen EventListener freigegeben werden koennte + if (this.selfEventListeners[type]) for (var i = 0; i < this.selfEventListeners[type].length; i++) this.selfEventListeners[type][i](this, param); + if (this.mgr && this.mgr.eventListeners[type]) for (var i = 0; i < this.mgr.eventListeners[type].length; i++) this.mgr.eventListeners[type][i](this, param); + } catch (e) {} + }, + + disable : /* public */ function () { + if (this.freed) throw 'Object is freed'; + if (this.disabledCount == 0) { + this.el['Disabled'] = document.createElement('div'); + this.el['Disabled'].className = 'JSW Disabled'; + this.el['OuterBox'].appendChild(this.el['Disabled']); + } + this.disabledCount++; + }, + + enable : /* public */ function () { + if (this.freed) throw 'Object is freed'; + this.disabledCount--; + if (this.disabledCount <= 0) { + this.disabledCount = 0; + this.el['OuterBox'].removeChild(this.el['Disabled']); + } + }, + + hiddenCover : /* protected */ function (covered) { + if (covered) { + if (this.el['FrameCover']) return; + this.el['FrameCover'] = document.createElement('div'); + this.el['FrameCover'].className = 'JSW FrameCover'; + this.el['OuterBox'].appendChild(this.el['FrameCover']); + } else if (this.el['FrameCover']) { + this.el['OuterBox'].removeChild(this.el['FrameCover']); + this.el['FrameCover'] = null; + } + }, + + showFrameload : /* public */ function (parent) { + if (this.freed) throw 'Object is freed'; + if (this.appended) return; + if (parent) this.parentElement = parent; + this.el['OuterBox'].style.visibility = 'hidden'; + this.parentElement.appendChild(this.el['OuterBox']); + this.appended = true; + }, + + show : /* public */ function (parent) { + if (this.freed) throw 'Object is freed'; + JSWEffect_terminate(this); // falls gerade ein hide-Effekt laeuft, muss dieser beendet werden, damit appended auf false gesetzt wird, bevor show durchlaeuft! + if ((this.visible && (!parent || parent == this.parentElement)) || (!this.parentElement && !parent)) return; + if (parent) this.parentElement = parent; + this.visible = true; + if (!this.excluded) this.el['OuterBox'].style.visibility = 'hidden'; + if (!this.appended) { + if (!this.parentElement) throw 'Parent element of the window is not specified!'; + try { this.parentElement.appendChild(this.el['OuterBox']); } + catch (e) { + // Fuer IE: Alle Elemente neu erstellen statt umhaengen + this.parentElement.innerHTML = this.el['OuterBox'].outerHTML; + var oldEl = this.el; + this.el = new Object(); + this.el['OuterBox'] = this.parentElement.getElementsByTagName('div')[0]; + var found; + do { + found = false; + for (var key in oldEl) { + if (this.el[key]) continue; + var n = oldEl[key].nodeName; + for (var i = 0; i < oldEl['OuterBox'].getElementsByTagName(n).length; i++) if (oldEl['OuterBox'].getElementsByTagName(n)[i] == oldEl[key]) { + this.el[key] = this.el['OuterBox'].getElementsByTagName(n)[i]; + found = true; + break; + } + } + } while (found); + } + this.appended = true; + } + if (!this.excluded) { + this.setPos(); + if (this.effects && this.effects['Show']) this.effects['Show'](this, this.effects['duration'], null, this.effects['ShowParams']); + else this.el['OuterBox'].style.visibility = 'visible'; + } + this.documentResize(); + this.callEventListener('show'); + this.callEventListener('move'); + }, + + hide : /* public */ function () { + if (this.freed) throw 'Object is freed'; + if (!this.visible || !this.closable) return; + this.visible = false; + if (this.excluded) { + this.excludedWindow.close(); + return; + } + var onEffectTerminate = function (win) { + win.el['OuterBox'].style.visibility = 'hidden'; + win.callEventListener('hide'); + if (win.parentElement /* ToDo: wenn win.effects = null tritt hier ohne if ein Fehler auf */) win.parentElement.removeChild(win.el['OuterBox']); + win.appended = false; + var b = win.freeOnHide; + if (b) win.free(); + return b; + } + if (this.effects && this.effects['Hide']) this.effects['Hide'](this, this.effects['duration'], onEffectTerminate, this.effects['HideParams']); + else window.setTimeout(onEffectTerminate, 0, this); + }, + + setPos : /* public */ function (newPos) { // Wendet den in Pos gespeicherten Style auf OuterBox an + // Hinweis: Neben setPos greift auch mouseMove:applyChange auf die Positionsstyles von OuterBox zu! + if (this.freed) throw 'Object is freed'; + var pw = this.parentOffsetWidth(); + var ph = this.parentOffsetHeight(); + if (newPos) { + var _this = this; + var i, s; + var rect = function (site) { if (site == -1) return 0; if (_this.minimalVisible[site] < 0) return 0; else return _this.minimalVisible[site]; } + var interpret = function (type, ps, site) { + i = newPos.indexOf(';' + type + ':'); + if (i == -1) _this.pos[type] = Number.NaN; else { + s = newPos.substring(i+2+type.length, newPos.indexOf(';', i+2+type.length)); + if (s.indexOf('%') == -1) _this.pos[type+'Percent'] = false; else { s = ps*parseFloat(s)/100; _this.pos[type+'Percent'] = true; } + _this.pos[type] = parseFloat(s) + rect(site); + } + } + newPos = ';'+newPos.split(' ').join(''); + interpret('top', ph, 0); + interpret('left', pw, 1); + interpret('right', pw, 2); + interpret('bottom', ph, 3); + interpret('width', pw, -1); + interpret('height', ph, -1); + i = newPos.indexOf(';position:'); if (i >= 0 && newPos.substring(i+10, newPos.indexOf(';', i+10)).indexOf('fixed') >= 0) this.pos.position = 'fixed'; else this.pos.position = 'absolute'; + } + if (this.excluded) { + // ToDo + return; + } + if (!this.appended) return; + if (!this.pos['position']) this.pos['position'] = 'absolute'; + this.el['OuterBox'].style.position = this.pos['position']; + if (this.maximized) { + this.el['OuterBox'].style.top = ((this.minimalVisible[0] > 0)?this.minimalVisible[0]:0) + 'px'; + this.el['OuterBox'].style.left = ((this.minimalVisible[1] > 0)?this.minimalVisible[1]:0) + 'px'; + this.el['OuterBox'].style.right = ((this.minimalVisible[2] > 0)?this.minimalVisible[2]:0) + 'px'; + this.el['OuterBox'].style.bottom = ((this.minimalVisible[3] > 0)?this.minimalVisible[3]:0) + 'px'; + this.el['OuterBox'].style.width = 'auto'; + this.el['OuterBox'].style.height = 'auto'; + return; + } + this.el['OuterBox'].style.top = (isNaN(this.pos['top'])) ?'auto':((this.pos['topPercent']) ?(this.pos['top'] / ph * 100 + '%'):(this.pos['top'] + 'px')); + this.el['OuterBox'].style.left = (isNaN(this.pos['left'])) ?'auto':((this.pos['leftPercent']) ?(this.pos['left'] / pw * 100 + '%'):(this.pos['left'] + 'px')); + if (!this.autoWidth || isNaN(this.pos.left)) this.el['OuterBox'].style.right = (isNaN(this.pos['right'])) ?'auto':((this.pos['rightPercent']) ?(this.pos['right'] / pw * 100 + '%'):(this.pos['right'] + 'px')); + else this.el['OuterBox'].style.right = 'auto'; + if (!this.autoHeight || isNaN(this.pos.top)) this.el['OuterBox'].style.bottom = (isNaN(this.pos['bottom']))?'auto':((this.pos['bottomPercent'])?(this.pos['bottom'] / ph * 100 + '%'):(this.pos['bottom'] + 'px')); + else this.el['OuterBox'].style.bottom = 'auto'; + if (!this.autoWidth) this.el['OuterBox'].style.width = (isNaN(this.pos['width'])) ?'auto':((this.pos['widthPercent']) ?(this.pos['width'] / pw * 100 + '%'):(this.pos['width'] + 'px')); + if (!this.autoHeight) this.el['OuterBox'].style.height = (isNaN(this.pos['height']))?'auto':((this.pos['heightPercent'])?(this.pos['height'] / ph * 100 + '%'):(this.pos['height'] + 'px')); + this.callEventListener('move'); + }, + + getWindowPos : /* protected */ function () { // Returns an Array, that contains the Position of OuterBox, seen from the inner Window + if (this.freed) throw 'Object is freed'; + var pos; + if (window.getComputedStyle(this.el['OuterBox']).position == 'fixed') pos = new Array(this.el['OuterBox'].offsetLeft, this.el['OuterBox'].offsetTop); + else pos = new Array(this.offsetLeftFrom(this.el['OuterBox'], document.body) - window.pageXOffset, this.offsetTopFrom(this.el['OuterBox'], document.body) - window.pageYOffset); + return pos; + }, + + hasAtr : /* private */ function (el, atr) { + if (!el) return false; + if ((' '+el.className+' ').indexOf(' '+atr+' ') >= 0) return true; + else return false; + }, + + setAtr : /* private */ function (el, atr) { + if (!el) return; + if ((' '+el.className+' ').indexOf(' '+atr+' ') >= 0) return; + el.className += ' '+atr; + }, + + rmAtr : /* private */ function (el, atr) { + if (!el) return; + var a = el.className.split(' '); + var s = ''; + for (var i = 0; i < a.length; i++) { + if (!a[i] || a[i] == atr) continue; + if (i > 0) s += ' '; + s += a[i]; + } + el.className = s; + }, + + setOrRmAtr : /* private */ function (el, atr, set) { if (this.freed) throw 'Object is freed'; if (set) this.setAtr(el, atr); else this.rmAtr(el, atr); }, + + onEvent : /* private */ function (el, event, fkt, bubbles) { // provides easy eventListeners. el: Element to set the listener; event: string-name of the event(without "on"); fkt: a Function to call if the event occours, fkt is called in the scope of _this + if (!el) return; + var _this = this; + var oev = new Object(); + oev['f'] = function (ev) { + // Browseruebergreifende Kompatibilitaet + if (!ev) ev = window.event; + if (!ev.target) ev.target = ev.srcElement; + if (!ev.offsetX && ev.pageX) { + ev.offsetX = ev.pageX - _this.offsetLeftFrom(ev.target, document.body); + ev.offsetY = ev.pageY - _this.offsetTopFrom(ev.target, document.body); + } + fkt.call(_this, ev); + } + oev['event'] = event; + oev['el'] = el; + el.addEventListener(event, oev['f'], bubbles); + this.eventListeners.push(oev); + return oev; + }, + + rmEvent : function (oev) { // oev wird von onEvent zurueckgegeben + var nr = oev; + if (isNaN(nr)) { + nr = 0; + while (nr < this.eventListeners.length) if (this.eventListeners[nr] == oev) break; else nr++; + if (nr >= this.eventListeners.length || this.eventListeners[nr] != oev) return; + } else { + if (nr < 0 || nr >= this.eventListeners.length) return; + oev = this.eventListeners[nr]; + } + if (document.removeEventListener) oev['el'].removeEventListener(oev['event'], oev['f'], false); else oev['el'].detachEvent('on'+oev['event'], oev['f']); + this.eventListeners.splice(nr, 1); + }, + + actualizePos : /* private */ function () { // falls prozentuale Angaben oder autoHeight/autoWidth verwendet werden, wird die Pixelposition neu berechnet + // Falls prozentuale Angaben verwendet werden, Position aktualisieren + if (!this.visible || this.excluded || this.minimized || this.maximized) return; + var style = null; + var _this = this; + function checkStyle (type) { + if (isNaN(_this.pos[type])) return; + if (!style) style = window.getComputedStyle(_this.el['OuterBox']); + _this.pos[type] = parseInt(style[type]); + } + checkStyle('top'); + checkStyle('left'); + checkStyle('right'); + checkStyle('bottom'); + checkStyle('width'); + checkStyle('height'); + }, + + offsetLeftFrom : /* private */ function (el, offsetEl) { // Ermittelt den Linken Abstand eines Elements bis zu einem bestimmten Eltern-ELement + var r = 0; + do { + r += el.offsetLeft; + el = el.offsetParent; + } while (el && el != offsetEl); + return r; + }, + + offsetTopFrom : /* private */ function (el, offsetEl) { // Ermittelt den Oberen Abstand eines Elements bis zu einem bestimmten Eltern-ELement + var r = 0; + do { + r += el.offsetTop; + el = el.offsetParent; + } while (el && el != offsetEl); + return r; + }, + + parentOffsetWidth : /* private */ function () { // Gibt die Breite des fuer das Fenster verfuegbaren Anzeigebereiches zurueck + if (this.excluded) return screen.availWidth; + if (!this.el['OuterBox'].offsetParent || this.el['OuterBox'].offsetParent == document.body) return window.innerWidth; + else return this.el['OuterBox'].offsetParent.offsetWidth; + }, + + parentOffsetHeight : /* private */ function () { // Gibt die Hoehe des fuer das Fenster verfuegbaren Anzeigebereiches zurueck + if (this.excluded) return screen.availHeight; + if (!this.el['OuterBox'].offsetParent || this.el['OuterBox'].offsetParent == document.body) return window.innerHeight; + else return this.el['OuterBox'].offsetParent.offsetHeight; + }, + + offsetTop : /* private */ function () { // Gibt den Abstand von oben bis zum offsetParent des normalisierten Fensters in Pixeln zurueck + if (!isNaN(this.pos.top)) return this.pos.top; + return this.parentOffsetHeight() - this.pos.height - this.pos.bottom; + }, + + offsetLeft : /* private */ function () { // Gibt den Abstand von links bis zum offsetParent des normalisierten Fensters in Pixeln zurueck + if (!isNaN(this.pos.left)) return this.pos.left; + return this.parentOffsetWidth() - this.pos.width - this.pos.right; + }, + + offsetWidth : /* private */ function () { // Gibt die Breite des normalisierten Fensters in Pixeln zurueck + if (!isNaN(this.pos.width)) return this.pos.width; + return this.parentOffsetWidth() - this.pos.left - this.pos.right; + }, + + offsetHeight : /* private */ function () { // Gibt die Hoehe des normalisierten Fensters in Pixeln zurueck + if (!isNaN(this.pos.height)) return this.pos.height; + return this.parentOffsetHeight() - this.pos.top - this.pos.bottom; + }, + + setOffsetPosition : /* public */ function (top, left, width, height) { // rechnet die gegebenen Parameter auf die Positionierung des Fensters um, sodass Anker und prozentuale Angaben erhalten bleiben + if (this.freed) throw 'Object is freed'; + if (!this.visible || this.maximized || this.minimized) return; + if (this.excluded) { + // ToDo + return; + } + var pw = this.parentOffsetWidth(); + var ph = this.parentOffsetHeight(); + if (!isNaN(this.pos['top'])) this.pos['top'] = top; + if (!isNaN(this.pos['left'])) this.pos['left'] = left; + if (!isNaN(this.pos['right'])) this.pos['right'] = (isNaN(pw))?0:(pw - width - left); + if (!isNaN(this.pos['bottom'])) this.pos['bottom'] = (isNaN(ph))?0:(ph - height - top); + if (!isNaN(this.pos['width'])) this.pos['width'] = width; + if (!isNaN(this.pos['height'])) this.pos['height'] = height; + this.setPos(); + }, + + mouseDown : /* private */ function (ev) { + if (ev.button && ev.button != 0) return; + this.lastMouseDown = ev; + if (this.maximized) return; + // Aktion fuer move und resize einrichten + var p = ev.target; + var target = p; + ev.target = null; + do { + p = p.parentElement; + if (p == this.el['Bar'] || p == this.el['Buttons']) { + target = p; + break; + } + } while (p); + var b = false; + if ((target == this.el['EdgeTopLeft'] || target == this.el['EdgeTopRight'] || target == this.el['EdgeBottomLeft'] || target == this.el['EdgeBottomRight']) && this.resizable) { this.autoHeight = false; this.autoWidth = false; b = true; } + else if ((target == this.el['BorderTop'] || target == this.el['BorderBottom']) && this.resizable) { this.autoHeight = false; b = true; } + else if ((target == this.el['BorderLeft'] || target == this.el['BorderRight']) && this.resizable) { this.autoWidth = false; b = true; } + else if (target == this.el['Bar'] && this.movable) b = true; + if (b) { // Ein Element fuer resize/move wurde angeklickt + this.actualizePos(); + // Startposition festhalten + this.startPos = clone(this.pos); + this.startPos['mausX'] = ev.clientX; + this.startPos['mausY'] = ev.clientY; + this.startPos['target'] = target; + // Cursor-Element und Events setzen + this.hiddenCover(true); + this.el['FrameCover'].style.margin = '-50px'; + this.startPos['oldMouseDown'] = document.onmousedown; + document.onmousedown = function () { return false; } + this.startPos['mouseUpOev'] = this.onEvent(document, 'mouseup', this.mouseUp); + this.startPos['mouseMoveOev'] = this.onEvent(document, 'mousemove', this.mouseMove, true); + } + }, + + documentResize : /* private */ function () { + if (!this.visible || this.excluded || this.maximized || this.minimized) return; + // falls ausserhalb von Anzeigebereich, zuruecksetzen + if (this.minimalVisible) { + if (this.minimalVisible[0] >= 0) { if (this.el['OuterBox'].offsetTop < this.minimalVisible[0]) this.setOffsetPosition(this.minimalVisible[0], this.el['OuterBox'].offsetLeft, this.el['OuterBox'].offsetWidth, this.el['OuterBox'].offsetHeight); } + else { /* ToDo */ } + if (this.minimalVisible[1] >= 0) { /* ToDo */ } + else { if (this.el['OuterBox'].offsetLeft + this.el['OuterBox'].offsetWidth < - this.minimalVisible[1]) this.setOffsetPosition(this.el['OuterBox'].offsetTop, - this.minimalVisible[1] - this.el['OuterBox'].offsetWidth, this.el['OuterBox'].offsetWidth, this.el['OuterBox'].offsetHeight); } + if (this.minimalVisible[2] >= 0) { /* ToDo */ } + else { if (this.el['OuterBox'].offsetLeft > this.parentOffsetWidth() + this.minimalVisible[2] && (window.getComputedStyle(this.el['OuterBox'].offsetParent).overflow == 'hidden' || this.pos.position == 'fixed')) this.setOffsetPosition(this.el['OuterBox'].offsetTop, this.parentOffsetWidth() + this.minimalVisible[2], this.el['OuterBox'].offsetWidth, this.el['OuterBox'].offsetHeight); } + if (this.minimalVisible[3] >= 0) { /* ToDo */ } + else { if (this.el['OuterBox'].offsetTop > this.parentOffsetHeight() + this.minimalVisible[3] && (window.getComputedStyle(this.el['OuterBox'].offsetParent).overflow == 'hidden' || this.pos.position == 'fixed')) this.setOffsetPosition(this.parentOffsetHeight() + this.minimalVisible[3], this.el['OuterBox'].offsetLeft, this.el['OuterBox'].offsetWidth, this.el['OuterBox'].offsetHeight); } + } + }, + + mouseUp : /* private */ function (ev) { + if (this.startPos) { + // Move-Events und Einstellungen zuruecknehmen + this.el['FrameCover'].style.margin = '0px'; + this.hiddenCover(false); + this.rmEvent(this.startPos['mouseUpOev']); + this.rmEvent(this.startPos['mouseMoveOev']); + document.onmousedown = this.startPos['oldMouseDown']; + this.startPos = null; + this.documentResize(); + } + }, + + mouseMove : /* private */ function (ev) { + if (!this.startPos) return; + // OuterBox bewegen + var _this = this; + function applyChange (type, horizontal, invert) { + _this.pos[type] = _this.startPos[type] + (-_this.startPos['maus'+(horizontal?'X':'Y')] + (horizontal?ev.clientX:ev.clientY)) * (invert?(-1):(1)); + if (_this.startPos[type+'Percent']) { + var size; + size = (horizontal?_this.parentOffsetWidth():_this.parentOffsetHeight()); + _this.el['OuterBox'].style[type] = _this.pos[type] / size * 100 + '%'; + } else _this.el['OuterBox'].style[type] = _this.pos[type] + 'px'; + } + if (this.startPos['target'] == this.el['Bar']) { + if (isNaN(this.startPos['right'])) { applyChange('left', true, false); } + else if (isNaN(this.startPos['left'])) { applyChange('right', true, true); } + else if (isNaN(this.startPos['width'])) { applyChange('left', true, false); if (!this.autoWidth) applyChange('right', true, true); } + if (isNaN(this.startPos['bottom'])) { applyChange('top', false, false); } + else if (isNaN(this.startPos['top'])) { applyChange('bottom', false, true); } + else if (isNaN(this.startPos['height'])) { applyChange('top', false, false); if (!this.autoHeight) applyChange('bottom', false, true); } + } + if (this.startPos['target'] == this.el['BorderTop'] || this.startPos['target'] == this.el['EdgeTopLeft'] || this.startPos['target'] == this.el['EdgeTopRight']) { + if (isNaN(this.startPos['bottom'])) { applyChange('top', false, false); applyChange('height', false, true); } + else if (isNaN(this.startPos['top'])) { applyChange('height', false, true); } + else if (isNaN(this.startPos['height'])) { applyChange('top', false, false); } + this.autoHeight = false; + } + if (this.startPos['target'] == this.el['BorderLeft'] || this.startPos['target'] == this.el['EdgeTopLeft'] || this.startPos['target'] == this.el['EdgeBottomLeft']) { + if (isNaN(this.startPos['right'])) { applyChange('left', true, false); applyChange('width', true, true); } + else if (isNaN(this.startPos['left'])) { applyChange('width', true, true); } + else if (isNaN(this.startPos['width'])) { applyChange('left', true, false); } + this.autoWidth = false; + } + if (this.startPos['target'] == this.el['BorderRight'] || this.startPos['target'] == this.el['EdgeTopRight'] || this.startPos['target'] == this.el['EdgeBottomRight']) { + if (isNaN(this.startPos['right'])) { applyChange('width', true, false); } + else if (isNaN(this.startPos['left'])) { applyChange('width', true, false); applyChange('right', true, true); } + else if (isNaN(this.startPos['width'])) { applyChange('right', true, true); } + this.autoWidth = false; + } + if (this.startPos['target'] == this.el['BorderBottom'] || this.startPos['target'] == this.el['EdgeBottomLeft'] || this.startPos['target'] == this.el['EdgeBottomRight']) { + if (isNaN(this.startPos['bottom'])) { applyChange('height', false, false); } + else if (isNaN(this.startPos['top'])) { applyChange('height', false, false); applyChange('bottom', false, true); } + else if (isNaN(this.startPos['height'])) { applyChange('bottom', false, true); } + this.autoHeight = false; + } + this.callEventListener('move'); + }, + + exclude : /* public */ function (click) { + if (this.freed) throw 'Object is freed'; + if (!this.excludable || this.excluded) return; + // Fenster oeffnen + var p = this.getWindowPos(); + var pos = new Array(this.el['OuterBox'].offsetWidth, this.el['OuterBox'].offsetHeight, p[0], p[1]); + var w = window.open('', '', 'width='+pos[0]+',height='+pos[1]+',left='+pos[2]+',top='+pos[3]); + if (!w) return; // Popup blockiert! + if (click) { + if (window.opera) { // Nur im echten Opera kann die Position pixelgenau berechnet werden! + var zoom = pos[0] / w.innerWidth; + pos[2] = pos[2] * zoom + (w.outerWidth - w.innerWidth * zoom) / 2; + pos[3] = pos[3] * zoom + w.outerHeight - w.innerHeight * zoom - (w.outerWidth - w.innerWidth * zoom) / 2; + pos[0] = pos[0] * zoom; + pos[1] = pos[1] * zoom; + w.resizeTo(pos[0], pos[1]); + } else if (w.innerWidth > 0) { + var zoom = w.innerWidth / pos[0]; // Annahme: Neues Fenster hat gleichen Zoomfaktor, wie Hauptfenster + pos[2] = this.lastMouseDown.screenX - (this.lastMouseDown.clientX - pos[2]) * zoom; + pos[3] = this.lastMouseDown.screenY - (this.lastMouseDown.clientY - pos[3]) * zoom; + } + w.moveTo(pos[2], pos[3]); + } + this.excludedWindow = w; + // Fenster umhaengen + this.parentElement.removeChild(this.el['OuterBox']); + this.appended = false; + this.el['OuterBox'].className += ' excluded'; + this.el['OuterBox'].style.position = 'absolute'; + this.el['OuterBox'].style.top = '0px'; + this.el['OuterBox'].style.left = '0px'; + this.el['OuterBox'].style.width = '100%'; + this.el['OuterBox'].style.height = '100%'; + for (var i = 0; i < this.el['OuterBox'].childNodes.length; i++) + if (this.el['OuterBox'].childNodes[i].nodeType == 1) + this.el['OuterBox'].childNodes[i].style.display = 'none'; + this.el['InnerBox'].style.display = 'block'; + this.el['InnerBox'].style.position = 'absolute'; + this.el['InnerBox'].style.top = '0px'; + this.el['InnerBox'].style.left = '0px'; + this.el['InnerBox'].style.right = '0px'; + this.el['InnerBox'].style.bottom = '0px'; + w.document.title = this.el['Title'].innerHTML; + var sty = document.getElementsByTagName('head')[0].getElementsByTagName('link'); + for (var i = 0; i < sty.length; i++) { + if (sty[i].rel.toLowerCase() != 'stylesheet') continue; + var cloneSty = document.createElement('link'); + cloneSty.rel = 'stylesheet'; + cloneSty.href = sty[i].href; + w.document.getElementsByTagName('head')[0].appendChild(cloneSty); + } + sty = document.getElementsByTagName('head')[0].getElementsByTagName('style'); + for (var i = 0; i < sty.length; i++) + w.document.getElementsByTagName('head')[0].innerHTML += sty[i].outerHTML; + this.excluded = true; + this.show(w.document.body); + var _this = this; + this.onEvent(w, 'beforeunload', function () { _this.free(); }); + this.excludedClosedTimer = window.setInterval(function () { if (w.closed) _this.free(); }, 100); + this.callEventListener('exclude'); + }, + + maximize : /* public */ function () { + if (this.freed) throw 'Object is freed'; + if (!this.maximizable) return; + if (this.excluded) { + // Todo + return; + } + this.maximized = true; + var t = (this.minimalVisible[0] > 0)?this.minimalVisible[0]:0; + var l = (this.minimalVisible[1] > 0)?this.minimalVisible[1]:0; + var r = (this.minimalVisible[2] > 0)?this.minimalVisible[2]:0; + var b = (this.minimalVisible[3] > 0)?this.minimalVisible[3]:0; + var onEffectTerminate = function (win) { + win.el['OuterBox'].style.top = t+'px'; + win.el['OuterBox'].style.left = l+'px'; + win.el['OuterBox'].style.right = r+'px'; + win.el['OuterBox'].style.bottom = b+'px'; + win.el['OuterBox'].style.width = 'auto'; + win.el['OuterBox'].style.height = 'auto'; + win.el['OuterBox'].style.position = (this.parentElement == document.body)?'fixed':'absolute'; + win.setAtr(win.el['OuterBox'], 'maximized'); + win.callEventListener('move'); + } + if (this.visible && this.effects && this.effects['Maximize']) this.effects['Maximize'](this, this.effects['duration'], onEffectTerminate, t, l, this.parentOffsetWidth()-r, this.parentOffsetHeight()-b, this.effects['MaximizeParams']); + else onEffectTerminate(this); + this.callEventListener('maximize'); + }, + + normalize : /* public */ function () { + if (this.freed) throw 'Object is freed'; + if (!this.visible) { this.maximized = false; return; } + if (this.excluded) { + // ToDo + return; + } + var onEffectTerminate = function (win) { + win.maximized = false; + win.rmAtr(win.el['OuterBox'], 'maximized'); + win.setPos(); + } + var fixed = this.pos['position'] == 'fixed'; + if (this.effects && this.effects['Normalize']) this.effects['Normalize'](this, this.effects['duration'], onEffectTerminate, this.offsetTop() - ((fixed)?0:window.pageYOffset), this.offsetLeft() - ((fixed)?0:window.pageXOffset), this.offsetWidth(), this.offsetHeight(), this.effects['NormalizeParams']); + else onEffectTerminate(this); + this.callEventListener('normalize'); + }, + + minimize : /* public */ function () { + if (this.freed) throw 'Object is freed'; + if (!this.visible || !this.minimizable) return; + if (this.excluded) { + // ToDo + return; + } + this.minimized = true; + var p = this.minimizePoint(); + var onEffectTerminate = function (win) { + win.el['OuterBox'].style.visibility = 'hidden'; + } + if (this.effects && this.effects['Minimize']) this.effects['Minimize'](this, this.effects['duration'], onEffectTerminate, p[0], p[1], this.effects['MinimizeParams']); + else onEffectTerminate(this); + this.callEventListener('minimize'); + }, + + unminimize : /* public */ function () { + if (this.freed) throw 'Object is freed'; + if (!this.visible || !this.minimized) return; + if (this.excluded) { + // ToDo + return; + } + var p = this.minimizePoint(); + var onEffectTerminate = function (win) { + win.minimized = false; + win.el['OuterBox'].style.visibility = 'visible'; + } + if (this.effects && this.effects['Unminimize']) this.effects['Unminimize'](this, this.effects['duration'], onEffectTerminate, p[0], p[1], this.effects['UnminimizeParams']); + else onEffectTerminate(this); + this.callEventListener('unminimize'); + }, + + free : /* public */ function () { + try { + if (this.excludedClosedTimer) window.clearInterval(this.excludedClosedTimer); + for (var i = this.eventListeners.length-1; i >= 0; i--) this.rmEvent(i); + JSWEffect_terminate(this); + if (this.scrollRectListener) this.scrollRectListener.free(); + if (this.appended) this.parentElement.removeChild(this.el['OuterBox']); + } catch (e) {} + this.callEventListener('free'); + this.freed = true; + for (var key in this) if (typeof this[key] == 'object') this[key] = null; + } +} diff --git a/js/boxeffects.js b/js/boxeffects.js new file mode 100644 index 0000000..3a96428 --- /dev/null +++ b/js/boxeffects.js @@ -0,0 +1,193 @@ +unitLoad('boxeffects', null, function (unitObj) { + + function getTickCount () { + var T = new Date(); + return T.getMilliseconds() + T.getSeconds() * 1000 + T.getMinutes() * 60000 + T.getHours() * 3600000 + T.getDay() * 86400000; + } + + function cssEffect (el, duration, behaviour, from, to, callback) { // Style-effekt: behaviour=Funktion:[0..1]-->[0..1] from,to=Objekt mit Style-Eigenschaften + function splitNum (s) { + var a = new Array(''); + for (var i = 0; i < s.length; i++) { + if ((s.charCodeAt(i) >= 48 && s.charCodeAt(i) <= 57 || s.charCodeAt(i) == 45) || (s.charAt(i) == '.' && a[a.length-1].charAt(0) == '0')) { if (a[a.length-1].charAt(0) != '0') a.push('0'); } + else { if (a[a.length-1].charAt(0) == '0') { a[a.length-1] = parseFloat(a[a.length-1].substring(1)); a.push(''); } } + a[a.length-1] += s.charAt(i); + } + if (a[a.length-1].charAt(0) == '0') a[a.length-1] = parseFloat(a[a.length-1].substring(1)); + return a; + } + duration = parseInt(duration); + if (behaviour == null) behaviour = function (s) { return s; }; + if (!from) from = window.getComputedStyle(el); + else for (var key in from) el.style[key] = from[key]; + for (var key in to) { + from[key] = splitNum(from[key]); + to[key] = splitNum(to[key]); + } + var startTime = getTickCount(); + var stop = false; + function f (end) { + if (stop) return; + var t = getTickCount(); + if ((end == 0) || (end == 1) && (startTime + duration > t)) { + s = behaviour((t - startTime) / duration); + for (var key in to) { + var v = ''; + var r = 0; + for (var i = 0; i < to[key].length; i++) { + if (typeof to[key][i] == 'string') { if (to[key][i].indexOf('rgb') != -1) r = 3; v += to[key][i]; } + else if (r > 0) { v += (from[key][i] * (1-s) + to[key][i] * s); r--; } + else v += (from[key][i] * (1-s) + to[key][i] * s); + } + el.style[key] = v; + } + window.setTimeout(f, 10, 1); + } else { + stop = true; + for (var key in to) el.style[key] = to[key].join(''); + if (callback) callback(); + } + } + f(0); + if (duration == 0) window.setTimeout(f, 0, 2); + else window.setTimeout(f, 10, 1); + return function (finish) { + if (stop) return; + if (finish) f(2); + else { + stop = true; + if (callback) callback(); + } + }; + } + + function move (el, duration, behaviour, blendIn, callback, dir) { + var p = el.offsetParent; + var d = 0; + var t; + switch (dir) { + case 1 : + t = 'top'; + d = el.offsetTop + el.offsetHeight; + break; + case 2 : + t = 'left'; + d = el.offsetLeft + el.offsetWidth; + break; + case 3 : + t = 'left'; + d = - p.offsetWidth + el.offsetLeft; + break; + case 4 : + t = 'top'; + d = - p.offsetHeight + el.offsetTop; + break; + } + var s = window.getComputedStyle(el); + if (s.position != 'fixed' && s.position != 'absolute' && s.position != 'relative') el.style.position = 'relative'; + var from = new Object(); + var to = new Object(); + from[t] = parseFloat(s[t]) - ((blendIn)?d:0) + 'px'; + to[t] = parseFloat(s[t]) - ((blendIn)?0:d) + 'px'; + return cssEffect(el, duration, behaviour, from, to, callback); + } + + function clip (el, duration, behaviour, blendIn, callback, dir) { + var st = window.getComputedStyle(el); + var oldOverflow = el.style.overflow; + var oldPosition = el.style.position; + var oldTop = el.style.top; + var oldLeft = el.style.left; + var oldWidth = el.style.width; + var oldHeight = el.style.height; + el.style.overflow = 'hidden'; + if (st.position != 'absolute' && st.position != 'fixed') { + var x = el.offsetLeft; + var y = el.offsetTop; + var w = el.offsetWidth; + var h = el.offsetHeight; + el.style.position = 'absolute'; + el.style.top = y+'px'; + el.style.left = x+'px'; + el.style.height = h+'px'; + el.style.width = w+'px'; + } + switch (dir) { + case 1: + var from = { clip:'rect(0px,'+el.offsetWidth+'px,'+el.offsetHeight+'px,0px)' }; + var to = { clip:'rect('+(el.offsetHeight/2)+'px,'+el.offsetWidth+'px,'+(el.offsetHeight/2)+'px,0px)' }; + break; + case 2: + var from = { clip:'rect(0px,'+el.offsetWidth+'px,'+el.offsetHeight+'px,0px)' }; + var to = { clip:'rect(0px,'+(el.offsetWidth/2)+'px,'+el.offsetHeight+'px,'+(el.offsetWidth/2)+'px)' }; + break; + } + if (blendIn) { var r = from; from = to; to = r; } + return cssEffect(el, duration, behaviour, from, to, function () { + el.style.position = oldPosition; + el.style.top = oldTop; + el.style.left = oldLeft; + el.style.width = oldWidth; + el.style.height = oldHeight; + el.style.overflow = oldOverflow; + el.style.clip = 'auto'; + if (callback) callback(); + }); + } + + function torteFillFilter (el, duration, b, i, callback) { + var startTime = getTickCount(); + var stop = false; + function f (end) { + if (stop) return; + var t = getTickCount(); + var s = (t - startTime) / duration; + if ((end == 0) || (end == 1) && (s < 1)) { + var angle = 2 * Math.PI * s; + if (s < 0.25) el.style.clipPath = 'polygon(50% 50%, 50% -250%, '+(50 + 300*Math.sin(angle))+'% '+(50 - 300*Math.cos(angle))+'%)'; + else if (s < 0.5) el.style.clipPath = 'polygon(50% 50%, 50% -250%, 350% 50%, '+(50 + 300*Math.sin(angle))+'% '+(50 - 300*Math.cos(angle))+'%)'; + else if (s < 0.75) el.style.clipPath = 'polygon(50% 50%, 50% -250%, 350% 50%, 50% 350%, '+(50 + 300*Math.sin(angle))+'% '+(50 - 300*Math.cos(angle))+'%)'; + else el.style.clipPath = 'polygon(50% 50%, 50% -250%, 350% 50%, 50% 350%, -250% 50%, '+(50 + 300*Math.sin(angle))+'% '+(50 - 300*Math.cos(angle))+'%)'; + window.setTimeout(f, 10, 1); + } else { + stop = true; + el.style.clipPath = 'initial'; + if (callback) callback(); + } + } + f(0); + if (duration == 0) window.setTimeout(f, 0, 2); + else window.setTimeout(f, 10, 1); + return function (finish) { + if (stop) return; + if (finish) f(2); + else { + stop = true; + if (callback) callback(); + } + }; + } + + /* + el : element to perform the effect on + d : duration + b : behaviour - a function [0,1] -> [0,1] to modify the progress speed + i : true for blend in, false for blend out + c : callback + */ + this.boxEffects = { + torteFill : function (el, d, b, i, c) { return torteFillFilter(el, d, b, i, c); }, + blend : function (el, d, b, i, c) { return cssEffect(el, d, b, {opacity:(i)?'0':'1'}, {opacity:(i)?'1':'0'}, c); }, + moveTop : function (el, d, b, i, c) { return move(el, d, b, i, c, 1); }, + moveLeft : function (el, d, b, i, c) { return move(el, d, b, i, c, 2); }, + moveRight : function (el, d, b, i, c) { return move(el, d, b, i, c, 3); }, + moveBottom : function (el, d, b, i, c) { return move(el, d, b, i, c, 4); }, + clipHorizontal : function (el, d, b, i, c) { return clip(el, d, b, i, c, 1); }, + clipVertical : function (el, d, b, i, c) { return clip(el, d, b, i, c, 2); }, + evaporate : function (el, d, b, i, c) { return cssEffect(el, d, b, {opacity:'1', transform:'translate(0px,0px) scale(1,1)', filter:'blur(0px)'}, {opacity:'0', transform:'translate(0px,-50px) scale(1.5,1.7)', filter:'blur(5px)'}, c); } + }; + + // unit loaded + unitObj.unit = this; + unitObj.onload(); +}); diff --git a/js/csv.js b/js/csv.js new file mode 100644 index 0000000..bace6fb --- /dev/null +++ b/js/csv.js @@ -0,0 +1,288 @@ +function CSV (url, callback, xColumnParse, httpReadyCallback) { + var xhttp = new XMLHttpRequest(); + var _this = this; + if (typeof url == 'object') { // create from existing CSV-as-object + this.interpolation = url.interpolation; + this.columnNames = url.columnNames; + this.matrix = url.matrix; + this.periodY = (url.periodY)?url.periodY:0; + this.periodX = (url.periodX)?url.periodX:0; + if (url.buf) this.buf = url.buf; + else { + try { + _this.buf = new SharedArrayBuffer(url.columns * url.rows * 8); + } catch (e) { + _this.buf = new ArrayBuffer(url.columns * url.rows * 8); + } + } + this.sorted = url.sorted; + if (url.columns == 0) this.data = null; + else { + this.data = new Array(); + let nRows = Math.trunc(this.buf.byteLength / (8 * url.columns)); + for (let i = 0; i < url.columns; i++) + this.data.push(new Float64Array(this.buf, nRows * i * 8, url.rows)); + if (url.data) { + for (let i = 0; i < url.data.length; i++) + for (let j = 0; j < url.data[i].length; j++) + this.data[i][j] = url.data[i][j]; + } + } + if (callback) callback(_this); + return; + } + xhttp.onreadystatechange = function () { + if (this.readyState != 4 || this.status != 200) return; + if (httpReadyCallback) httpReadyCallback(_this); + try { + if (xhttp.responseText.indexOf("\r") >= 0) var lines = xhttp.responseText.split("\r").join('').split("\n"); + else var lines = xhttp.responseText.split("\n"); + } catch (e) { } + let nColumns = -1; + let nRows = 0; + let row = 0; + _this.columnNames = new Array(); + _this.data = new Array(); + for (let i = 0; i < lines.length; i++) { + if (lines[i] == '' || lines[i].indexOf('#') == 0) continue; // comment + lines[i] = lines[i].split("\t"); + if (nColumns < 0) { + nColumns = lines[i].length; + nRows = lines.length - i - 1; + try { + _this.buf = new SharedArrayBuffer(nColumns * nRows * 8); + } catch (e) { + _this.buf = new ArrayBuffer(nColumns * nRows * 8); + _this.err('Your browser does not support SharedArrayBuffer or it is disabled. This can reduce performance!'); + } + for (let j = 0; j < lines[i].length; j++) { + if (lines[i][j] == '' || _this.columnNames[lines[i][j]]) _this.err('Column name invalid!'); + else _this.columnNames[lines[i][j]] = j; + _this.data.push(new Float64Array(_this.buf, nRows * j * 8, nRows)); + } + } else { + let j = 0; + if (xColumnParse && lines[i].length > 0 && nColumns > 0) { + _this.data[j][row] = xColumnParse(lines[i][j]); + j = 1; + } + for (j = j; j < lines[i].length && j < nColumns; j++) + _this.data[j][row] = parseFloat(lines[i][j]); + for (j = j; j < nColumns; j++) + _this.data[j][row] = Number.NaN; + if (_this.sorted) { + if (row > 0 && (isNaN(_this.data[0][row]) || isNaN(_this.data[0][row-1]) || _this.data[0][row] <= _this.data[0][row-1])) + _this.sorted = false; + } + row++; + } + } + if (!_this.data || _this.data.length == 0 || _this.data[0].length == 0) _this.data = null; // never accept empty array + else if (row < nRows) + for (let i = 0; i < _this.data.length; i++) + _this.data[i] = new Float64Array(_this.buf, nRows * i * 8, row); // just reduce mapped length of views to real data set + if (callback) callback(_this); + }; + xhttp.open("GET", url, true); + xhttp.send(); +} + +CSV.prototype = { + // public + interpolation : 1, // 0=nearest 1=linear 2=linear, return NaN outside of range + // private + buf : null, + // public readonly + columnNames : null, + sorted : true, + matrix : false, // if true, data is handled as an 2D-map, where first column is the (sorted) x-axis and first row is the (sorted) y-axis (data[0][0] is NaN) + periodY : 0, + periodX : 0, + data : null, + get loaded () { return this.data != null; }, + get xMin () { + if (!this.sorted || this.data === null) return Number.NaN; + else return this.data[0][(this.matrix)?1:0]; + }, + get xMax () { + if (!this.sorted || this.data === null) return Number.NaN; + else return this.data[0][this.data[0].length-1]; + }, + + asObject : /* public */ function (clone=false) { // meant to be used to create a copy of CSV in a web-worker. + let obj = { + interpolation: this.interpolation, + columnNames: this.columnNames, + buf: this.buf, + columns: (this.data === null)?0:this.data.length, + rows: (this.data === null)?0:this.data[0].length, + sorted: this.sorted, + matrix: this.matrix, + periodY: this.periodY, + periodX: this.periodX + }; + if (clone) { + try { + obj.buf = new SharedArrayBuffer(this.buf.byteLength); + } catch (e) { + obj.buf = new ArrayBuffer(this.buf.byteLength); + } + new Uint8Array(obj.buf).set(new Uint8Array(this.buf)); + } + return obj; + }, + + toString : /* public */ function (indentation=0, digits=0) { + let space = ''; + for (let i = 0; i < indentation; i++) space += ' '; + let s = "{\n"; + let obj = this.asObject(); + for (let key in obj) { + if (key == 'buf') continue; + s += space+' "'+key+'": '+JSON.stringify(obj[key])+",\n"; + } + s += space+' "data": ['+"\n"; + for (let i = 0; i < this.data.length; i++) { + if (i != 0) s += ",\n"; + s += space+" ["; + for (let j = 0; j < this.data[i].length; j++) { + if (j != 0) s += ','; + if (digits == 0) s += (isNaN(this.data[i][j]))?'"NaN"':this.data[i][j]; + else s += (isNaN(this.data[i][j]))?'"NaN"':this.data[i][j].toPrecision(digits).replace(/\.?0+$/,""); + } + s += ']'; + } + s += "\n"+space+" ]\n"; + s += space+"}"; + return s; + }, + + columnName : /* public */ function (i) { + for (var key in this.columnNames) + if (this.columnNames[key] == i) + return key; + return ''; + }, + + prevNext : /* private */ function (column, x) { + if (!this.sorted || this.data === null) return null; + var prev = (this.matrix)?1:0; + var next = this.data[0].length-1; + while (prev < next-1) { + let m = Math.floor((prev + next) / 2); + if (this.data[0][m] <= x) prev = m; + else next = m; + } + if (this.matrix) { + var prevY = 1; + var nextY = this.data.length-1; + while (prevY < nextY-1) { + let m = Math.floor((prevY + nextY) / 2); + if (this.data[m][0] <= column) prevY = m; + else nextY = m; + } + return [prev, next, prevY, nextY]; + } else { + var j = this.columnNames[column]; + if (!j) return null; + while (prev > 0 && isNaN(this.data[j][prev])) prev--; + while (next < this.data[0].length-1 && isNaN(this.data[j][next])) next++; + if (isNaN(this.data[j][next])) next = prev; + else if (isNaN(this.data[j][prev])) prev = next; + return [prev, next]; + } + }, + + interpolate : /* public */ function (column, x) { + var pn = this.prevNext(column, x); + if (!pn) return Number.NaN; + if (this.periodX > 0) { + x %= this.periodX; + if (x < this.data[0][pn[0]] || x > this.data[0][pn[1]]) { + pn[0] = this.data.length-1; + pn[1] = (this.matrix)?1:0; + } + } + if (this.matrix) { + if (isNaN(column)) return Number.NaN; + if (this.periodY > 0) { + column %= this.periodY; + if (column < this.data[pn[2]][0] || column > this.data[pn[3]][0]) { + pn[2] = this.data.length-1; + pn[3] = 1; + } + } + let sx = (x - this.data[0][pn[0]] + ((x < this.data[0][1])?this.periodX:0)) / (this.data[0][pn[1]] - this.data[0][pn[0]] + ((pn[0] > pn[1])?this.periodX:0)); + let sy = (column - this.data[pn[2]][0] + ((column < this.data[1][0])?this.periodY:0)) / (this.data[pn[3]][0] - this.data[pn[2]][0] + ((pn[2] > pn[3])?this.periodY:0)); + return this.data[pn[2]][pn[0]]*(1-sx)*(1-sy) + this.data[pn[2]][pn[1]]*(sx)*(1-sy) + this.data[pn[3]][pn[0]]*(1-sx)*(sy) + this.data[pn[3]][pn[1]]*(sx)*(sy); + } else { + var j = this.columnNames[column]; + if (pn[0] == pn[1]) { + if (this.interpolation == 2) return Number.NaN; + else return this.data[j][pn[0]]; // just one interpolation point + } + if (this.interpolation == 0) { + if (x - this.data[0][pn[0]] < this.data[0][pn[1]] - x) return this.data[j][pn[0]]; // TODO: regard periodX special case here + else return this.data[j][pn[1]]; + } else { + if (this.periodX == 0) { + if (x < this.data[0][pn[0]]) return this.data[j][pn[0]]; + if (x > this.data[0][pn[1]]) return this.data[j][pn[1]]; + } + let s = (x - this.data[0][pn[0]] + ((x < this.data[0][0])?this.periodX:0)) / (this.data[0][pn[1]] - this.data[0][pn[0]] + ((pn[0] > pn[1])?this.periodX:0)); + return this.data[j][pn[1]] * s + this.data[j][pn[0]] * (1-s); + } + } + }, + + integrate : /* public */ function (column, x1, x2) { + if (this.matrix) return Number.NaN; + var pn = this.prevNext(column, x1); + if (!pn) return Number.NaN; + var j = this.columnNames[column]; + if (!j) return Number.NaN; + if (pn[0] == pn[1]) return this.data[j][pn[0]] * (x2-x1); + var area = 0; + if (this.data[0][pn[0]] > x1) area += this.data[j][pn[0]] * (this.data[0][pn[0]] - x1); // add area lower outside of data range + do { + // add interval area + var _x1 = this.data[0][pn[0]]; + var y1 = this.data[j][pn[0]]; + var _x2 = this.data[0][pn[1]]; + var y2 = this.data[j][pn[1]]; + if (this.interpolation == 0) { + var m = (_x1 + _x2) / 2; + if (_x1 < x1) _x1 = x1; + if (_x2 > x2) _x2 = x2; + if (_x1 < m) area += y1 * (m-_x1); + if (m < _x2) area += y2 * (_x2-m); + } else { + if (_x1 < x1) { + y1 += (y2-y1) * (x1-_x1) / (_x2-_x1); + _x1 = x1; + } + if (_x2 > x2) { + y2 -= (y2-y1) * (_x2-x2) / (_x2-_x1); + _x2 = x2; + } + area += (y1+y2)/2 * (_x2-_x1); + } + // calc next interval + pn[0] = pn[1]; + do pn[1]++; + while (pn[1] < this.data[j].length && isNaN(this.data[j][pn[1]])); + } while (pn[1] < this.data[0].length && this.data[0][pn[0]] < x2); + if (this.data[0][pn[1]] < x2) area += this.data[j][pn[1]] * (x2 - this.data[0][pn[1]]); // add area upper outside of data range + return area; + }, + + average : /* public */ function (column, x1, x2) { + var av = this.integrate(column, x1, x2); + if (!isNaN(av)) av = av / (x2-x1); + return av; + }, + + err : function (msg) { + console.log(msg); + } +}; diff --git a/js/fetchText.js b/js/fetchText.js new file mode 100644 index 0000000..4c060bb --- /dev/null +++ b/js/fetchText.js @@ -0,0 +1,417 @@ +var freeFetchedText = null; +var makeupForm = null; +var chartAcceptanceData = null; +var chartAcceptance = null; +function createAcceptanceChart (id) { + chartAcceptance = Highcharts.chart(id, { + chart: { + type: 'column' + }, + yAxis: { + title: { + enabled: false + } + }, + xAxis: { + categories: ['-5', '-4', '-3', '-2', '-1', '+1', '+2', '+3', '+4', '+5'] + }, + legend:{ enabled:false }, + title: { + text: 'Zustimmung' + }, + series: [ + { + name: 'Umfrage, erste Iteration', + color: 'black', + data: [5,8,1,10,3,3,2,6,3,2] + } + ], + }); +}; +window.showAcceptance = function (arr) { + if (arr && makeupForm.showAcceptance.checked) { + document.getElementById('Acceptance').style.display = 'block'; + if (arr == chartAcceptanceData) return; + chartAcceptanceData = arr; + chartAcceptance.series[0].setData(arr); + } else if (document.getElementById('Acceptance')) + document.getElementById('Acceptance').style.display = 'none'; +}; + +function setMakeupForm (el, showingRelease) { + makeupForm = el; + if (showingRelease) { + makeupForm.showingRelease = true; + makeupForm.showComments.checked = false; + makeupForm.showAccepted.checked = false; + makeupForm.showDeletedContent.checked = false; + makeupForm.showAcceptance.checked = false; + } + let inp = el.getElementsByTagName('input'); + for (let i = 0; i < inp.length; i++) + inp[i].addEventListener('input', function () { + makeupText(currentSite); + }, false); + el.genderSelect.addEventListener('input', function () { + makeupText(currentSite); + }, false); + el.createRelease.addEventListener('click', function () { + makeupForm.isRelease = true; + dynFrame.getActiveCommunicator().el.src += ''; // reload + el.createRelease.disabled = true; + }, false); +} + +function makeupText (win) { + let sty = win.document.getElementById('makeupStyle'); + if (!sty) { + sty = win.document.createElement('style'); + sty.setAttribute('id', 'makeupStyle'); + win.document.getElementsByTagName('head')[0].appendChild(sty); + } + let css = ''; + if (makeupForm.showComments.checked) css += "body { padding-right:250px; }\n"; + else css += "commentnote { display: none; }\n"; + if (makeupForm.showAccepted.checked) + css += "" + +".accepted, commentnote.accepted div {\n" + +" background-color: #CFC;\n" + +"}\n" + +".rejected, commentnote.rejected div {\n" + +" background-color: #FCC;\n" + +"}\n"; + switch (makeupForm.genderSelect.selectedIndex) { + case 0: + css += "" + +":lang(de-f)::after { content: 'innen'; }\n" + +":lang(de-m)::before { content: ' und '; }\n" + +".or:lang(de-m)::before { content: ' oder '; }\n" + +".dash:lang(de-m)::before { content: '- und '; }\n"; + break; + case 1: + css += "" + +":lang(de-f)::after { content: '*innen'; }\n" + +":lang(de-m) { display: none; }\n"; + break; + case 2: + css += "" + +":lang(de-f)::after { content: ':innen'; }\n" + +":lang(de-m) { display: none; }\n"; + break; + case 3: + css += "" + +":lang(de-f)::after { content: 'Innen'; }\n" + +":lang(de-m) { display: none; }\n"; + break; + case 4: + css += "" + +":lang(de-f) { display: none; }\n"; + break; + case 5: + css += "" + +":lang(de-f)::after { content: 'innen'; }\n" + +":lang(de-m) { display: none; }\n"; + break; + } + if (!makeupForm.showDeletedContent.checked) css += "del, .rejected { display: none; }\n"; + sty.innerHTML = css; +} + +function fetchText (win) { + if (makeupForm.showingRelease) { + makeupText(win); + return; + } + if (freeFetchedText) freeFetchedText(); + var counterComments = 0; + var release = false; + if (makeupForm.isRelease) release = true; + + function deleteElementExtra (el) { + let p = el.parentElement; + p.removeChild(el); + let empty = true; + for (let i = 0; i < p.childNodes.length; i++) { + if (p.childNodes[i].nodeType == 1) { + empty = false; + break; + } + if (p.childNodes[i].nodeType == 3) { + let str = p.childNodes[i].textContent; + if (str.split(' ').join('').split("\n").join('') != '') { + empty = false; + break; + } + } + } + if (empty && (p.tagName.toLowerCase() == 'p' || p.tagName.toLowerCase() == 'h1' || p.tagName.toLowerCase() == 'h2' || p.tagName.toLowerCase() == 'h3' || p.tagName.toLowerCase() == 'li' || p.tagName.toLowerCase() == 'ul' || p.tagName.toLowerCase() == 'ol')) + deleteElementExtra(p); + } + + function interpretAcceptance (str) { + let arr = str.split(','); + if (arr.length != 10) return null; + let accepted = false; + let nPositiv = 0; + let average = 0; + let sum = 0; + for (let j = 0; j < 10; j++) { + arr[j] = parseInt(arr[j]); + sum += arr[j]; + if (j < 5) { + average += arr[j] * (j-5); + } else { + nPositiv += arr[j]; + average += arr[j] * (j-4); + } + } + average /= sum; + accepted = (average > 0) && (nPositiv >= sum / 3 * 2); + return { + arr: arr, + average: average, + accepted: accepted + }; + } + + function iterateContent (el) { + for (let i = el.childNodes.length-1; i >= 0; i--) { + if (el.childNodes[i].nodeType == 8) { + if (release) { + el.removeChild(el.childNodes[i]); + continue; + } else { // convert comment to element + let insertEl = win.document.createElement('commentnote'); + let textbox = win.document.createElement('div'); + textbox.style.top = (counterComments % 3 - 2) * 0.4 + 'em'; + counterComments++; + textbox.textContent = el.childNodes[i].nodeValue.trim(); + if (textbox.textContent.indexOf('Überarbeitung:') == 0) insertEl.className += ' redaction'; + insertEl.appendChild(textbox); + el.insertBefore(insertEl, el.childNodes[i]); + el.removeChild(el.childNodes[i+1]); + if (textbox.textContent.indexOf('zustimmung="') == 0) { + let zuEnd = textbox.textContent.indexOf('"', 12); + insertEl.setAttribute('zustimmung', textbox.textContent.substring(12, zuEnd)); + textbox.textContent = textbox.textContent.substring(zuEnd+2, textbox.textContent.length); + } + } + } + if (el.childNodes[i].nodeType == 1) { + if (el.childNodes[i].tagName.toLowerCase() == 'del' && release) { + deleteElementExtra(el.childNodes[i]); + continue; + } + let str = el.childNodes[i].getAttribute('zustimmung'); + if (str !== null && str != '') { + let acceptance = interpretAcceptance(str); + if (acceptance) { + el.childNodes[i].acceptance = acceptance; + if (!acceptance.accepted && release) { + deleteElementExtra(el.childNodes[i]); + continue; + } + if (release) + el.childNodes[i].removeAttribute('zustimmung'); + else { + if (acceptance.accepted) el.childNodes[i].className += ' accepted'; + else el.childNodes[i].className = ' rejected'; + } + } + } + iterateContent(el.childNodes[i]); + } + } + } + iterateContent(win.document.body); + if (release) { + document.getElementById('Codeblock').textContent = win.document.body.innerHTML; + document.getElementById('Codeblock').style.display = 'block'; + } else + win.addEventListener('mousemove', function (ev) { + let el = ev.target; + let arr = null; + while (el) + if (el.acceptance) { + arr = el.acceptance.arr; + break; + } else el = el.parentElement; + parent.showAcceptance(arr); + }, false); + makeupText(win); + + /* + if (!document.getElementById('loadTextBranch').checked) return; + var backup = win.document.createElement('div'); + backup.getElementById = function (id) { + var el = null; + function searchId (p) { + for (let i = 0; i < p.childNodes.length; i++) + if (p.childNodes[i].nodeType == 1) + if (p.childNodes[i].id == id) { + el = p.childNodes[i]; + return; + } else searchId(p.childNodes[i]); + } + searchId(backup); + return el; + }; + while (win.document.body.firstChild) + backup.appendChild(win.document.body.firstChild); + if (backup.getElementById('footer')) win.document.body.appendChild(backup.getElementById('footer')); + win.document.body.className += ' commented'; + var release = false; + if (window.location.href.indexOf('generateFinalHTML') >= 0) release = true; + var counterComments = 0; + freeFetchedText = function () { + counterComments = 0; + backup = null; + } + function scanEmbeddings (el) { + let childs = new Array(); + for (let i = 0; i < el.childNodes.length; i++) + childs.push(el.childNodes[i]); + for (let i = 0; i < childs.length; i++) + if (childs[i].nodeType == 1) scanEmbeddings(childs[i]); + else if (childs[i].nodeType == 3) { + let pos = 0; + let lastReplacePos = 0; + let replaceArr = new Array(); + while (pos < childs[i].textContent.length) { + let start = childs[i].textContent.indexOf('[', pos); + let stop = childs[i].textContent.indexOf(']', pos); + if (stop >= 0) pos = stop+1; + else { + if (lastReplacePos > 0) replaceArr.push(win.document.createTextNode(childs[i].textContent.substring(lastReplacePos, childs[i].textContent.length))); + break; + } + if (start >= 0 && start < stop) { + let shortcode = childs[i].textContent.substring(start+1, stop); + let insertEl = null; + if (shortcode.toLowerCase().indexOf('quelle: ') == 0) { + insertEl = win.document.createElement('footnote'); + let p = shortcode.indexOf(' #'); + if (p > 0 && shortcode.indexOf(' ##') == p) { + let notename = shortcode.substring(p+3, (shortcode.indexOf(' ', p+3) >= 0)?shortcode.indexOf(' ', p+3):shortcode.length); + insertEl.setAttribute('noteref', notename); + } else { + if (p > 0) { + let notename = shortcode.substring(p+2, (shortcode.indexOf(' ', p+2) >= 0)?shortcode.indexOf(' ', p+2):shortcode.length); + insertEl.setAttribute('notename', notename); + shortcode = shortcode.substring(0, p) + shortcode.substring(p+1+notename.length, shortcode.length); + } + insertEl.textContent = shortcode.substring(8, shortcode.length); + } + } else if (shortcode.toLowerCase().indexOf('kommentar: ') == 0) { + insertEl = win.document.createElement('commentnote'); + let textbox = win.document.createElement('div'); + textbox.style.top = (counterComments % 3 - 2) * 0.4 + 'em'; + counterComments++; + textbox.textContent = shortcode.substring(11, shortcode.length); + if (textbox.textContent.indexOf('Überarbeitung:') == 0) insertEl.className += ' redaction'; + insertEl.appendChild(textbox); + } else if (shortcode.toLowerCase().indexOf('zustimmung: ') == 0) { + insertEl = win.document.createElement('acceptance'); + insertEl.textContent = shortcode.substring(12, shortcode.length); + } else insertEl = backup.getElementById(shortcode); + if (insertEl) { + replaceArr.push(win.document.createTextNode(childs[i].textContent.substring(lastReplacePos, start))); + replaceArr.push(insertEl); + lastReplacePos = pos; + } + } + } + if (lastReplacePos > 0) { + while (replaceArr.length > 0) + el.insertBefore(replaceArr.shift(), childs[i]); + el.removeChild(childs[i]); + } + } + } + var srcFile = win.document.getElementsByTagName('title')[0].textContent; //win.document.body.getAttribute('textsource'); + if (!srcFile) return; + var xhttp = new XMLHttpRequest(); + xhttp.onreadystatechange = function () { + if (this.readyState == 4 && this.status == 200) { + let md = new Remarkable(); + let div = win.document.createElement('div'); + div.innerHTML = md.render(xhttp.responseText); + scanEmbeddings(div); + for (let i = div.childNodes.length-1; i >= 0; i--) + win.document.body.insertBefore(div.childNodes[i], win.document.body.firstChild); + } + }; + let branch = 'master'; + if (document.getElementById('branchSelect')) + branch = document.getElementById('branchSelect').value; + let textPath = 'https:\/\/klimaliste-darmstadt-dieburg.de\/system\/php\/cors.php?path='+branch+'\/'+srcFile+'.txt&rand='+Math.round(Math.random()*10000000); + if (win.location.href.indexOf('file:\/\/\/') == 0) textPath = '..\/text\/'+srcFile+'.txt'; + xhttp.open("GET", textPath, false); + xhttp.send(); + + let z = win.document.getElementsByTagName('acceptance'); + for (let i = 0; i < z.length; i++) { + let arr = z[i].textContent.split(','); + let accepted = false; + if (arr.length == 10) { + let nPositiv = 0; + let average = 0; + let sum = 0; + for (let j = 0; j < 10; j++) { + arr[j] = parseInt(arr[j]); + sum += arr[j]; + if (j < 5) { + average += arr[j] * (j-5); + } else { + nPositiv += arr[j]; + average += arr[j] * (j-4); + } + } + z[i].arr = arr; + average /= sum; + accepted = (average > 0) && (nPositiv >= sum / 3 * 2); + z[i].average = average; + } + z[i].accepted = accepted; + z[i].textContent = ''; + let target = z[i].parentElement; + if (target == win.document.body || target.acceptance) target = z[i].nextElementSibling; + if (target) { + target.acceptance = z[i]; + if (target.nodeType == 1) target.setAttribute('zustimmung', z[i].arr.join(',')); + if (release) { + //if (!accepted) target.parentElement.removeChild(target); + } else { + if (accepted) target.className += ' accepted'; + else target.className = ' rejected'; + } + } + } + if (release) { + let comments = win.document.getElementsByTagName('commentnote'); + for (let i = comments.length-1; i >= 0; i--) { + var a = ''; + if (comments[i].acceptance) a = 'zustimmung="'+comments[i].acceptance.arr.join(',')+'" '; + let comment = document.createComment(' '+a+comments[i].textContent+' '); + comments[i].parentElement.insertBefore(comment, comments[i]); + comments[i].parentElement.removeChild(comments[i]); + } + while (win.document.getElementsByTagName('acceptance').length > 0) + win.document.getElementsByTagName('acceptance')[0].parentElement.removeChild(win.document.getElementsByTagName('acceptance')[0]); + //while (win.document.getElementsByTagName('del').length > 0) + // win.document.getElementsByTagName('del')[0].parentElement.removeChild(win.document.getElementsByTagName('del')[0]); + document.getElementById('Codeblock').textContent = win.document.body.innerHTML; + document.getElementById('Codeblock').style.display = 'block'; + } else + win.addEventListener('mousemove', function (ev) { + let el = ev.target; + let arr = null; + while (el) + if (el.acceptance) { + arr = el.acceptance.arr; + break; + } else el = el.parentElement; + parent.showAcceptance(arr); + }, false); + */ +}; diff --git a/js/frameCommunicator.js b/js/frameCommunicator.js new file mode 100644 index 0000000..3e5d0a4 --- /dev/null +++ b/js/frameCommunicator.js @@ -0,0 +1,685 @@ +/* + Dieses Script wurde entwickelt von Mitja Stachowiak. + Fuer Details lesen Sie unter "http://www.mitjastachowiak.de/components/ecmascript/framecommunicator/index.html" nach. +*/ + +var selfScriptSource_huwheigif = document.getElementsByTagName('script')[document.getElementsByTagName('script').length-1].src; +var fapiStandard = 41; + +// window.fapi und window.fapiFull werden am Ende des Scripts gesetzt + + +function getHostnameAndProtocol (loc) { + if (!loc) loc = ''; + let i = loc.indexOf('?'); + if (i < 0) i = loc.length; + let j = loc.indexOf('#'); + if (j > 0 && j < i) i = j; + j = -1; + do { + j = loc.indexOf('\/', j+1); + } while (j >= 0 && !((j == 0 || loc.charAt(j-1) != '\/') && (j == loc.length-1 || loc.charAt(j+1) != '\/'))); + if (j >= 0 && j < i) i = j; + let h = loc.substring(0,i); + return h; +} + +function absolutePath (rel, absFrom) { // Diese Funktion wird nicht in diesem Script benoetigt, jedoch von vielen Scripts, die dieses verwenden. + if (!absFrom) absFrom = self.location.href; + let i = rel.indexOf('?'); + if (i < 0) i = rel.length; + let j = rel.indexOf('#'); + if (j >= 0 && j < i) i = j; + let Q = ''; + if (i < rel.length) Q = rel.substring(i,rel.length); + rel = rel.substring(0,i); // ab hier: Querystring/Anker wurde von rel abgetrennt und in Q gespeichert + if (rel.indexOf(':') >= 0 && rel.charAt(0) != '\/') return rel+Q; // rel ist schon absolut; + i = absFrom.indexOf('?'); + if (i < 0) i = absFrom.length; + j = absFrom.indexOf('#'); + if (j >= 0 && j < i) i = j; + j = absFrom.lastIndexOf('/',i); + if (j >= 0 && j < i-1) i = j+1; + j = absFrom.lastIndexOf(':',i); + if (j > i) i = j+1; + absFrom = absFrom.substring(0,i); // ab hier: abs ist ohne Anker, Querystring und Dateiname + let host = getHostnameAndProtocol(absFrom); + if (rel.indexOf('/') == 0) return host + rel + Q; // rel ist relativ zu Root + while (rel.indexOf('./') == 0) rel = rel.substring(2,rel.length); + while (rel.indexOf('../') == 0) { + rel = rel.substring(3,rel.length); + j = absFrom.lastIndexOf('/',absFrom.length-2); + if (j >= host.length) absFrom = absFrom.substring(0,j+1); + } + if (absFrom.lastIndexOf('/') != absFrom.length-1) absFrom += '/'; // ab hier: fuer jedes ../ wurde ein Ordner von absFrom abgehaengt + return absFrom + rel + Q; // rel ist relativ zur Seite +} + +function relativePath (abs, absFrom) { + if (!absFrom) absFrom = self.location.href; + let h = getHostnameAndProtocol(abs); + if (h == '' && abs.indexOf('\/') == 0) { // falls abs relativ zu Root ist, absolut machen + abs = absolutePath(abs, absFrom); + h = getHostnameAndProtocol(abs); + } + if (h == '') return abs; // abs ist schon relativ + if (h != getHostnameAndProtocol(absFrom)) return abs; // abs kann nicht relativ werden + let i = absFrom.length; + let j = absFrom.indexOf('#'); + if (j != -1 && j < i) i = j; + j = absFrom.indexOf('?'); + if (j != -1 && j < i) i = j; + j = (absFrom.indexOf('\/', h.length) == h.length)?h.length+1:h.length; + i = absFrom.lastIndexOf('\/', i); + let fromPath = new Array(); + if (i > j) fromPath = absFrom.substring(j, i).split('\/'); // ab hier: fromPath besteht nur noch aus den Ordnern von absFrom + i = abs.length; + j = abs.indexOf('#'); + if (j != -1 && j < i) i = j; + j = abs.indexOf('?'); + if (j != -1 && j < i) i = j; + j = (abs.indexOf('\/', h.length) == h.length)?h.length+1:h.length; + i = abs.lastIndexOf('\/', i); + let targetPath = new Array(); + if (i > j) targetPath = abs.substring(j, i).split('\/'); // ab hier: targetPath besteht nur noch aus den Ordnern von abs + if (abs.indexOf('\/', i) == i) i++; + let datQ = abs.substring(i, abs.length); // alles nach den Ordnern + i = 0; + while (targetPath.length > i && fromPath.length > i && targetPath[i] == fromPath[i]) i++; + let rel = ''; + for (j = i; j < fromPath.length; j++) rel += '../'; + for (j = i; j < targetPath.length; j++) rel += targetPath[j] + '/'; + rel += datQ; + return rel; +} + +function createScrollRectEventListener (el, callback, win) { + //console.log('ScrollRectListener startet for '+win.location.href+'!'); + var o = new Object(); + o.el = el; + o.el2 = (el.tagName.toLowerCase() == 'html')?((el.getElementsByTagName('body').length == 0)?null:el.getElementsByTagName('body')[0]):el; // wenn el == documentElement, versuche, body zum einhaengen von heihtGetter zu finden + o.callback = callback; + o.win = win; + o.lastH = -1; + o.lastW = -1; + o.pause = 0; + o.pauseTimer = null; + o.search = true; + o.padding = 0; + o.freed = false; + o.resize = function () { + if (o.freed) return; + if (o.pause != 0) { o.pause = 2; return; } + o.pause = 1; + o.pauseTimer = win.setTimeout(function () { + o.pauseTimer = null; + if (o.pause == 2) { + o.pause = 0; + o.resize(); + } else o.pause = 0; + }, 50); + try { o.win.document.body.width = '500px'; } catch (e) {} + let w = o.el.scrollWidth; + let h = o.el.scrollHeight; + let wh = 0; + if (o.win) try { wh = o.win.innerHeight; } catch (e) {} + else wh = o.el.offsetHeight; + if (h > wh + 4) o.search = true; // nach Overflow max-Suche wiederholen + else if (o.el2) { // wenn scrollHeigt nicht groesser, als offsetHeight + if (!o.heightGetter) { // beim Erstaufruf heightGetter einfuegen + o.heightGetter = o.win.document.createElement('hr'); + o.heightGetter.style.height = '1px'; // komisches null-height-Bug erkennen + o.heightGetter.style.margin = '0px'; + o.heightGetter.style.visibility = 'hidden'; + o.heightGetter.style.clear = 'both'; + o.el2.appendChild(o.heightGetter); + o.max = o.heightGetter; + } + if (o.el2.lastChild != o.heightGetter) { + o.el2.removeChild(o.heightGetter); + o.el2.appendChild(o.heightGetter); + } + try { + h = o.max.offsetTop + o.max.offsetHeight; + if (isNaN(h)) { + h = -1; + o.search = true; + } + } catch (e) { + h = -1; + o.search = true; + } + if (h == 0) return; // null-height-Bug: Eine nicht mehr geladene Seite hat das Event ausgeloest + if (o.search) { // Tiefstes Element suchen und in o.max speichern + for (let i = 0; i < o.el2.childNodes.length; i++) { + let _el = o.el2.childNodes[i]; + if (_el.nodeType != 1) continue; + let ch = _el.offsetTop + _el.offsetHeight; + try { ch += parseInt(o.win.getComputedStyle(_el).marginBottom); } catch (e) {} + if (!isNaN(ch) && ch > h) { + h = ch; + o.max = _el; + } + } + try { + o.padding = parseInt(o.win.getComputedStyle(o.max).marginBottom) + parseInt(o.win.getComputedStyle(o.el2).paddingBottom); + } catch (e) { + o.padding = 0; + } + if (isNaN(o.padding)) o.padding = 0; + o.search = false; + } + h += o.padding; + } else if (o.el.getElementsByTagName('body').length != 0) { // versuche body zu finden + o.el2 = o.el.getElementsByTagName('body')[0]; + o.resize(); + return; + } + if (Math.abs(h + 2 - o.lastH) <= 2 && Math.abs(w + 2 - o.lastW) <= 2) return; // keine Aenderung seit letztem Event + o.lastH = h; + o.lastW = w; + //console.log('New height for '+win.location.href+' = '+h); + o.callback(o.el, w, h); + } + // destructor + o.free = function () { + if (o.freed) return; + try { o.observer.disconnect(); } catch (e) { + o.el.removeEventListener('DOMNodeInserted', o.resize); + o.el.removeEventListener('DOMNodeRemoved', o.resize); + o.el.removeEventListener('DOMCharacterDataModified', o.resize); + o.el.removeEventListener('DOMAttrModified', o.resize); + o.el.removeEventListener('DOMContentLoaded', o.resize); + } + o.win.removeEventListener('resize', o.resize); + o.el.removeEventListener('overflow', o.resize); + o.el.removeEventListener('overflowchanged', o.resize); + if (o.pauseTimer) o.win.clearTimeout(o.pauseTimer); + o.win.clearInterval(o.timer); + if (o.heightGetter) o.el2.removeChild(o.heightGetter); + o.freed = true; + for (let key in o) if (typeof o[key] == 'object') o[key] = null; + } + // constructor + try { + o.observer = new MutationObserver(o.resize); + let config = { attributes: true, childList: true, characterData: true, subtree: true }; + o.observer.observe(el, config); + } catch (e) { + el.addEventListener('DOMNodeInserted', o.resize, false); + el.addEventListener('DOMNodeRemoved', o.resize, false); + el.addEventListener('DOMCharacterDataModified', o.resize, false); + el.addEventListener('DOMAttrModified', o.resize, false); + el.addEventListener('DOMContentLoaded', o.resize, false); + } + o.win.addEventListener('resize', o.resize, false); + o.timer = o.win.setInterval(function () { o.search = true; o.resize() }, 10000); + el.addEventListener('overflow', o.resize, false); + el.addEventListener('overflowchanged', o.resize, false); + o.resize(); + return o; +} + +function hostsAreFromSameDomain (host1, host2) { + var hosts = ['', '']; + for (var i = 0; i < 2; i++) { + hosts[i] = getHostnameAndProtocol(arguments[i]).split('\/\/'); + if (hosts[i].length == 2) hosts[i] = hosts[i][1]; // remove protocol if exists + else hosts[i] = hosts[i][0]; + hosts[i] = hosts[i].split(':')[0]; // remove port if exists + hosts[i] = hosts[i].split('.'); + } + return hosts[0].length > 0 && hosts[1].length > 0 && hosts[0][hosts[0].length-1] == hosts[1][hosts[1].length-1] && (hosts[0].length == 1 || hosts[1].length == 1 || hosts[0][hosts[0].length-2] == hosts[1][hosts[1].length-2]); +} + + + + + + +function FrameCommunicator (iframe, debugLogName='') { + this.debugLogName = debugLogName; + // protected + this.el = iframe; + this.el.communicator = this; + // restliche proterties stehen nach Konstruktor + // init + var _this = this; + window.addEventListener('message', function (msg) { + _this.interpretMessage.call(_this, msg); + }, false); + this.el.addEventListener('load', function () { + _this.debugLog('onload fired'); + _this.checkForNewSite(2); + if (_this.onload) _this.onload(_this); + }, false); +} + +FrameCommunicator.prototype = { + // private + currentLoc : null, + currentPostMsg : null, + resizeRepeatH : 0, + resizeRepeatW : 0, + currentSiteHasFapi : false, + debugLogName : '', + // public readonly + siteAllows : 0, + contentHeight : -1, + contentWidth : -1, + contentHostname : '', + contentURL : '', + contentTitle : '', + // public + onContentResize : null, // wenn frame-seite ihre Groesse aendert + onSiteReady : null, // wenn frame-seite geparst/geladen wurde - wie onload, aber eventuell frueher, noch vor DOMReady + onURLChanged : null, // wenn frame-seite ihre URL aendert + onTitleChanged : null, // wenn frame-seite ihren Titel aendert + onload : null, // wenn frame-seite geladen - wie iframe.onload, wird jedoch erst aufgerufen, wenn Seitenhoehe bekannt ist + _autoHeight : false, get autoHeight () { return this._autoHeight; }, set autoHeight (v) { this._autoHeight = v; if (v) this.el.style.height = (this.contentHeight >= 0)?(this.contentHeight+'px'):this.autoHeightValue; }, + _autoWidth : false, get autoWidth () { return this._autoWidth; }, set autoWidth (v) { this._autoWidth = v; if (v) this.el.style.width = (this.contentWidth >= 0)?(this.contentWidth+'px'):this.autoWidthValue; }, + autoHeightValue : '100%', + autoWidthValue : '100px' +} + +FrameCommunicator.prototype.checkForNewSite = /* private */ function (load, knownURL) { + if (load & 1 != 0) this.currentSiteHasFapi = true; + try { if (this.currentDoc != this.el.contentWindow.document.documentElement) { this.newSite(knownURL); return; } } catch (e) { + try { + if (this.el.contentWindow && this.currentLoc != this.el.contentWindow.location) { + this.newSite(knownURL); + return; + } + } catch (e) {} + if (this.el.contentWindow.postMessage == this.el.contentWindow.postMessage && this.currentPostMsg != this.el.contentWindow.postMessage) this.newSite(knownURL); + else if (load & 2 != 0 && this.el.contentWindow.postMessage != this.el.contentWindow.postMessage) this.newSite(knownURL); + } +} + +FrameCommunicator.prototype.setSrc = /* public */ function (url) { + try { + el.contentWindow.location.replace(url); // tries to change URL without browser history change + } catch (e) { + this.el.src = url; + } + this.checkForNewSite(0, url); +} + +FrameCommunicator.prototype.newSite = /* private */ function (knownURL) { + this.debugLog('New site detected...'); + this.currentLoc = this.el.contentWindow.location; + this.currentPostMsg = this.el.contentWindow.postMessage; + try { this.currentDoc = this.el.contentWindow.document.documentElement; } catch (e) { this.currentDoc = null; } + // Informationen ueber Seite loeschen + this.contentHeight = -1; + this.contentWidth = -1; + this.contentHostname = (knownURL)?getHostnameAndProtocol(knownURL):''; + this.contentURL = (knownURL)?knownURL:''; + this.siteAllows = 0; + this.contentHeight = -1; + this.contentWidth = -1; + this.contentTitle = ''; + // Events ausfuehren + if (this.onSiteReady) this.onSiteReady(); + if (this.onContentResize) this.onContentResize(this.contentWidth, this.contentHeight); + if (this.onURLChanged) this.onURLChanged(this.contentHostname, this.contentURL); + if (this.onTitleChanged) this.onTitleChanged(this.contentTitle); + // Versuchen, neue Informationen zu bekommen / FrameAPI in der Seite zu erzeugen + try { + if (this.el.contentWindow.fapi) { + this.debugLog('Site is on same location ('+this.el.contentWindow.location.href+') and has fapi. Allow all messages...'); + this.el.contentWindow.fapi.setTarget(this); + this.el.contentWindow.fapi.setAllowed(65535); + } else if (this.el.contentWindow.document.documentElement) { + this.debugLog('Site is on same location ('+this.el.contentWindow.location.href+') and has no fapi. Create fapi with all messages...'); + let scr = this.el.contentWindow.document.createElement('script'); + scr.src = selfScriptSource_huwheigif; + this.el.contentWindow.document.body.appendChild(scr); + } + } catch (e) {} +} + +FrameCommunicator.prototype.checkForNewHostname = /* private */ function (host) { + try { host = getHostnameAndProtocol(this.el.contentWindow.location.href); } catch (e) {} + if (this.contentHostname == host) return; + this.contentHostname = host; + this.debugLog('New Hostname detected: '+this.contentHostname); + if (this.contentURL.indexOf(host) != 0) this.contentURL = ''; + if (this.onURLChanged) this.onURLChanged(this.contentHostname, this.contentURL); +} + +FrameCommunicator.prototype.interpretMessage = /* private */ function (msg) { + if (msg.source != this.el.contentWindow) { + this.debugLog('Message "'+msg.data+'" dropped because from wrong source!'); + return; + } else this.debugLog('Message "'+msg.data+'" accepted!'); + var data = msg.data.split('&'); + this.checkForNewSite(1); + this.checkForNewHostname(msg.origin); + switch (data[0]) { + case 'FrameCommunicator' : + this.setState((data.length > 0)?parseInt(data[1]):0); + break; + case 'mousedown' : + var x = undefined; + var y = undefined; + if (data.length >= 3) { + x = parseInt(data[1]); + y = parseInt(data[2]); + } + this.raiseMouseEvent('mousedown', x, y); + break; + case 'mouseup' : + var x = undefined; + var y = undefined; + if (data.length >= 3) { + x = parseInt(data[1]); + y = parseInt(data[2]); + } + this.raiseMouseEvent('mouseup', x, y); + break; + case 'click' : + this.raiseMouseEvent('click'); + break; + case 'resize' : + this.resize(parseInt(data[1]), parseInt(data[2])); + break; + case 'URLchange' : + if (data.length < 2) break; + var url = decodeURIComponent(data[1]); + var fromSameOrigin = false; + try { if (this.el.contentWindow.document) fromSameOrigin = true; } catch (e) {} + if (fromSameOrigin || msg.origin == getHostnameAndProtocol(url)) this.newURL(url); + break; + case 'TitleChange' : + if (data.length < 2) break; + this.setTitle(decodeURIComponent(data[1])); + break; + case 'mousewheel' : + this.raiseMouseEvent('mousewheel', parseInt(data[1])); + break; + } +} + +FrameCommunicator.prototype.raiseMouseEvent = /* protected */ function (type, x, y) { + this.checkForNewSite(1); + if (type == 'click') this.siteAllows |= 4; + if (type == 'mousedown') this.siteAllows |= 8; + if (type == 'mouseup') this.siteAllows |= 16; + if (type == 'mousewheel') this.siteAllows |= 512; + if (document.dispatchEvent) { + var ev; + // Bei MouseEvent sind offsetX/Y und pageX/y nicht ueberschreibbar! daher document.createEvent(). + ev = document.createEvent("Events"); + ev.initEvent(type, true, true); + if (type == 'mousewheel') { + ev.wheelDelta = x; + } else if (!isNaN(x) && !isNaN(x)) { // falls gegeben, Cursorposition an Event haengen + this.siteAllows |= 2; + ev.offsetX = x; + ev.offsetY = y; + p = this.el; + do { + x += p.offsetLeft; + y += p.offsetTop; + p = p.offsetParent; + } while (p); + ev.pageX = x; + ev.pageY = y; + } + this.el.dispatchEvent(ev); + } else { + var ev = document.createEventObject(); + this.el.fireEvent('on' + type, ev); + } +} + +FrameCommunicator.prototype.debugLog = /* private */ function (msg) { + if (this.debugLogName == '') return; + var d = new Date(); + console.log('['+d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate()+' '+d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds()+'] Frame "'+this.debugLogName+'": '+msg); +} + +FrameCommunicator.prototype.setState = /* protected */ function (_allowed) { + this.checkForNewSite(1); + this.siteAllows = _allowed; +} + +FrameCommunicator.prototype.resize = /* protected */ function (w, h) { + if (isNaN(w)) w = -1; + if (isNaN(h)) h = -1; + this.debugLog('Resize w='+w+' h='+h); + this.checkForNewSite(1); + if (this.contentWidth == w && this.contentHeight == h) return; + if (w != -1) this.siteAllows |= 64; + if (h != -1) this.siteAllows |= 32; + this.contentWidth = w; + this.contentHeight = h; + + if (h >= 0 && this.autoHeight) { + var ch = this.el.offsetHeight; + if (h + 15 <= ch) this.resizeRepeatH++; + if (this.resizeRepeatH > 5) return; // Rekursion verhindern + if (h + 10 > ch || h < ch + 20) this.el.style.height = h + 15 + 'px'; + if (this.resizeRepeatHTimer) window.clearTimeout(this.resizeRepeatHTimer); + var _this = this; + this.resizeRepeatHTimer = window.setTimeout(function () { _this.resizeRepeatH = 0; }, 100); + } else if (this.autoHeight) this.el.style.height = this.autoHeightValue; + + if (w >= 0 && this.autoWidth) { + var cw = this.el.offsetWidth; + if (w <= cw) this.resizeRepeatW++; + if (this.resizeRepeatW > 5) return; // Rekursion verhindern + if (w > cw || w < cw - 5) this.el.style.width = w + 'px'; + if (this.resizeRepeatWTimer) window.clearTimeout(this.resizeRepeatWTimer); + var _this = this; + this.resizeRepeatWTimer = window.setTimeout(function () { _this.resizeRepeatW = 0; }, 100); + } else if (this.autoWidth) this.el.style.width = this.autoWidthValue; + + if (this.onContentResize) this.onContentResize(w, h); +} + +FrameCommunicator.prototype.newURL = /* protected */ function (url) { + this.checkForNewSite(1); + if (!url) url = ''; + if (url != '') this.siteAllows |= 128; + this.contentHostname = getHostnameAndProtocol(url); + this.contentURL = url; + if (this.onURLChanged) this.onURLChanged(this.contentHostname, this.contentURL); +} + +FrameCommunicator.prototype.setTitle = /* protected */ function (title) { + this.checkForNewSite(1); + this.siteAllows |= 256; + this.contentTitle = title; + if (this.onTitleChanged) this.onTitleChanged(title, this); +} + + + + + +function FrameAPI (__allowed, _target) { + // private + var win = (_target)?_target.el.contentWindow:window; + if (win.fapi) return win.fapi; + win.fapi = this; + var target = _target; + var allowed = 0; + var evListeners = new Object(); + var _this = this; + var lastURL = ''; + var autoFrameSize = false; + + var debugLog = /* private */ function (msg) { + if (!target || target.debugLogName == '') return; + var d = new Date(); + console.log('['+d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate()+' '+d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds()+'] Frame "'+target.debugLogName+'": '+msg); + }; + + var mouseevent = /* private */ function (ev, type) { + if (!ev) ev = win.event; + if (type == 'DOMMouseScroll') type = 'mousewheel'; + var msg = [type]; + if (type == 'mousewheel') msg.push(ev.wheelDelta || -ev.detail); + else if ((allowed & 2) && type != 'click') { + msg.push(ev.clientX); + msg.push(ev.clientY); + } + if (target) target.raiseMouseEvent.apply(target, msg); + else win.parent.postMessage(msg.join('&'), '*'); + }; + + var postState = /* private */ function () { + /*if (target) target.setState(allowed); + else */win.parent.postMessage('FrameCommunicator&'+allowed, '*'); + }; + + var resize = /* private */ function (el, w, h) { + try { if (autoFrameSize) return; } catch (e) { return; } + if (!(allowed & 32) || isNaN(h)) h = -1; + if (!(allowed & 64) || isNaN(w)) w = -1; + /*if (target) target.resize(w, h); + else */win.parent.postMessage('resize&'+w+'&'+h, '*'); + }; + + var sendURL = /* private */ function () { + if (lastURL == win.location.href) return; + lastURL = win.location.href; + /*if (target) target.newURL(lastURL); + else */win.parent.postMessage('URLchange&'+encodeURIComponent(lastURL), '*'); + }; + + var sendTitle = /* private */ function () { + /*if (target) target.setTitle(win.document.title); + else */win.parent.postMessage('TitleChange&'+encodeURIComponent(win.document.title), '*'); + }; + + var redirectLink = /* private */ function (a) { + if (a.href.indexOf('http') != 0) return; + var hp = getHostnameAndProtocol(a.href); + }; + + this.setTarget = /* public */ function (_target) { + target = _target; + }; + + this.overrideAutoFrameSize = /* public */ function () { + autoFrameSize = true; + /*if (target) target.resize(-1, -1); + else */win.parent.postMessage('resize&-1&-1', '*'); + }; + + this.redirectLinks = /* public */ function () { + var observer = new MutationObserver(function(mutationsList, observer) { + for (let mutation of mutationsList) + if (mutation.type === 'childList') + for (let i = 0; i < mutation.addedNodes.length; i++) + if (mutation.addedNodes[i].nodeType == 1 && mutation.addedNodes[i].tagName == 'a') + redirectLink(mutation-addedNodes[i]); + }); + observer.observe(document.documentElement, { childList: true, subtree: true }); + let a = document.documentElement.getElementsByTagName('a'); + for (var i = 0; i < a.length; i++) + redirectLink(a[i]); + }; + + this.setAllowed = /* public */ function (_allowed) { + if (allowed == _allowed) { + //if (evListeners['resize']) evListeners['resize'].resize(); + debugLog('New allowed flags ignored, because already set ('+win.location.href+').'); + return; + } + if (win.parent == win) { + debugLog('New allowed flags ignored, because not in frame ('+win.location.href+').'); + return; + } + allowed = _allowed; + debugLog('New allowed flags accepted ('+win.location.href+').'); + + function addListener (name, type, f, el, b) { + if (evListeners[name]) return; + if (!el) el = win.document; + var ev = new Object(); + ev['event'] = type; + ev['el'] = el; + ev['fkt'] = function (ev) { f.call(_this, ev, type); } + el.addEventListener(type, ev['fkt'], b); + evListeners[name] = ev; + } + function rmListener (name) { + if (!evListeners[name]) return; + evListeners[name]['el'].removeEventListener(evListeners[name]['event'], evListeners[name]['fkt']); + delete evListeners[name]; + } + + if (allowed & 1) { postState(); addListener('postState', 'load', postState, win); } else rmListener('postState'); + if (allowed & 4) addListener('mouseeventC', 'click', mouseevent); else rmListener('mouseeventC'); + if (allowed & 8) addListener('mouseeventD', 'mousedown', mouseevent); else rmListener('mouseeventD'); + if (allowed & 16) addListener('mouseeventU', 'mouseup', mouseevent); else rmListener('mouseeventU'); + if (allowed & 96) { if (!evListeners['resize']) evListeners['resize'] = createScrollRectEventListener(win.document.documentElement, resize, win); } + else { if (evListeners['resize']) { evListeners['resize'].free(); delete evListeners['resize']; } } + if (allowed & 128) { + lastURL = ''; + sendURL(); + addListener('sendURLL', 'load', sendURL, win); + addListener('sendURLH', 'hashchange', sendURL, win); + addListener('sendURLP', 'popstate', sendURL, win); + try { // bekanntes Bug: Das abhoeren von replaceState und PushState funktioniert nach reload der Seite nicht! + if (!evListeners['OldPushState']) { evListeners['OldPushState'] = win.history.pushState; win.history.pushState = function (obj, title, url) { evListeners['OldPushState'].call(win.history, obj, title, url); sendURL(); }; } + if (!evListeners['OldReplaceState']) { evListeners['OldReplaceState'] = win.history.replaceState; win.history.replaceState = function (obj, title, url) { evListeners['OldReplaceState'].call(win.history, obj, title, url); sendURL(); }; } + } catch (e) {} + } else { + rmListener('sendURLL'); + rmListener('sendURLH'); + rmListener('sendURLP'); + try { + if (evListeners['OldPushState']) { win.history.pushState = evListeners['OldPushState']; delete evListeners['OldPushState']; } + if (evListeners['OldReplaceState']) { win.history.replaceState = evListeners['OldReplaceState']; delete evListeners['OldReplaceState']; } + } catch (e) {} + } + if (allowed & 256) { + sendTitle(); + addListener('sendTitleL', 'load', sendTitle, win); + try { + if (!evListeners['titleObserver']) { + evListeners['titleObserver'] = new MutationObserver(sendTitle); + var config = { childList: true }; + evListeners['titleObserver'].observe(win.document.getElementsByTagName('title')[0], config); + } + } catch (e) { addListener('sendTitleI', 'DOMNodeInserted', sendTitle, win.document.getElementsByTagName('title')[0]); } + } else { + rmListener('sendTitleL'); + try { + if (evListeners['titleObserver']) { + evListeners['titleObserver'].disconnect(); + delete evListeners['titleObserver']; + } + } catch (e) { rmListener('sendTitleI'); } + } + if (allowed & 512) { + addListener('sendMousewheel1', 'mousewheel', mouseevent, win.document); + addListener('sendMousewheel2', 'DOMMouseScroll', mouseevent, win.document); + } else { + rmListener('sendMousewheel1'); + rmListener('sendMousewheel2'); + } + } + + // init + if (__allowed) this.setAllowed(__allowed); +} + +function fapiIndexLocation (loc) { + if (navigator.userAgent.indexOf(' Atom\/') >= 0) return; // keep simple site without frame in Atom-preview + if (/bot|googlebot|bingbot|crawler|spider|robot|crawling/i.test(navigator.userAgent)) return; // don't forward crawlers! + if (loc != '' && parent == self) + parent.location.href = absolutePath(loc, self.location.href) + '?' + self.location.href; +} +(function () { + let fapiAllowed = fapiStandard; + try { + if (parent.fapi) fapiAllowed = 65535; + } catch (e) { } + if (!window.fapi) new FrameAPI(fapiAllowed); +})(); diff --git a/js/headerimage.js b/js/headerimage.js new file mode 100644 index 0000000..bfe812f --- /dev/null +++ b/js/headerimage.js @@ -0,0 +1,70 @@ +var defaultHeaderImage = (function () { + let box = document.getElementById('BoxTop'); + for (let i = 0; i < box.getElementsByTagName('div').length; i++) + if ((' '+box.getElementsByTagName('div')[i].className+' ').indexOf('bgImage') >= 0) { + let spl = box.getElementsByTagName('div')[i].style.backgroundImage.split('"'); + if (spl.length == 3) + return absolutePath(spl[1], self.location.href); + break; + } + return ''; +})(); +var currentHeaderImage = defaultHeaderImage; +function loadHeader (src, vPos='center', loadWithoutEffect=false) { + if (src == currentHeaderImage) return; + currentHeaderImage = src; + if (vPos == '') + vPos = 'center'; + var img = new Image(); + img.onload = function () { + var op = 0; + var oldEl = null; + var newEl = document.createElement('div'); + var box = document.getElementById('BoxTop'); + newEl.className = 'bgImage'; + if (vPos) + newEl.style.backgroundPosition = 'center '+vPos; + newEl.style.backgroundImage = "url('"+img.src+"')"; + for (let i = box.getElementsByTagName('div').length-1; i >= 0; i--) + if ((' '+box.getElementsByTagName('div')[i].className+' ').indexOf('bgImage') >= 0) { + oldEl = box.getElementsByTagName('div')[i]; + break; + } + if (oldEl) { + newEl.style.opacity = 0; + box.insertBefore(newEl, oldEl.nextSibling); + if (loadWithoutEffect) { + newEl.style.opacity = 1; + box.removeChild(oldEl); + return; + } + } else { + box.insertBefore(newEl, box.firstChild); + return; + } + var tmr = window.setInterval(function () { + op += 0.01; + if (op >= 1) { + newEl.style.opacity = 1; + box.removeChild(oldEl); + img = null; + window.clearInterval(tmr); + } else + newEl.style.opacity = op; + }, 10); + }; + img.src = src; +} +function searchHeaderImage (site, loadWithoutEffect) { + try { + let meta = site.document.getElementsByTagName('head')[0].getElementsByTagName('meta'); + for (let i = 0; i < meta.length; i++) + if (meta[i].getAttribute('property') == 'og:image') { + let newPath = absolutePath(meta[i].getAttribute('content'), site.location.href); + if (currentHeaderImage != newPath) + loadHeader(newPath, meta[i].getAttribute('position'), loadWithoutEffect); + return; + } + } catch (e) { } + loadHeader(defaultHeaderImage, loadWithoutEffect); +} diff --git a/js/highcharts.js b/js/highcharts.js new file mode 100644 index 0000000..cf810fd --- /dev/null +++ b/js/highcharts.js @@ -0,0 +1,596 @@ +/* + Highcharts JS v9.2.2 (2021-08-24) + + (c) 2009-2021 Torstein Honsi + + License: www.highcharts.com/license +*/ +'use strict';(function(aa,M){"object"===typeof module&&module.exports?(M["default"]=M,module.exports=aa.document?M(aa):M):"function"===typeof define&&define.amd?define("highcharts/highcharts",function(){return M(aa)}):(aa.Highcharts&&aa.Highcharts.error(16,!0),aa.Highcharts=M(aa))})("undefined"!==typeof window?window:this,function(aa){function M(r,a,C,E){r.hasOwnProperty(a)||(r[a]=E.apply(null,C))}var a={};M(a,"Core/Globals.js",[],function(){var r="undefined"!==typeof aa?aa:"undefined"!==typeof window? +window:{},a;(function(a){a.SVG_NS="http://www.w3.org/2000/svg";a.product="Highcharts";a.version="9.2.2";a.win=r;a.doc=a.win.document;a.svg=a.doc&&a.doc.createElementNS&&!!a.doc.createElementNS(a.SVG_NS,"svg").createSVGRect;a.userAgent=a.win.navigator&&a.win.navigator.userAgent||"";a.isChrome=-1!==a.userAgent.indexOf("Chrome");a.isFirefox=-1!==a.userAgent.indexOf("Firefox");a.isMS=/(edge|msie|trident)/i.test(a.userAgent)&&!a.win.opera;a.isSafari=!a.isChrome&&-1!==a.userAgent.indexOf("Safari");a.isTouchDevice= +/(Mobile|Android|Windows Phone)/.test(a.userAgent);a.isWebKit=-1!==a.userAgent.indexOf("AppleWebKit");a.deg2rad=2*Math.PI/360;a.hasBidiBug=a.isFirefox&&4>parseInt(a.userAgent.split("Firefox/")[1],10);a.hasTouch=!!a.win.TouchEvent;a.marginNames=["plotTop","marginRight","marginBottom","plotLeft"];a.noop=function(){};a.supportsPassiveEvents=function(){var r=!1;if(!a.isMS){var w=Object.defineProperty({},"passive",{get:function(){r=!0}});a.win.addEventListener&&a.win.removeEventListener&&(a.win.addEventListener("testPassive", +a.noop,w),a.win.removeEventListener("testPassive",a.noop,w))}return r}();a.charts=[];a.dateFormats={};a.seriesTypes={};a.symbolSizes={};a.chartCount=0})(a||(a={}));"";return a});M(a,"Core/Utilities.js",[a["Core/Globals.js"]],function(a){function r(b,d,e,p){var y=d?"Highcharts error":"Highcharts warning";32===b&&(b=y+": Deprecated member");var F=m(b),c=F?y+" #"+b+": www.highcharts.com/errors/"+b+"/":b.toString();if("undefined"!==typeof p){var k="";F&&(c+="?");I(p,function(b,K){k+="\n - "+K+": "+b; +F&&(c+=encodeURI(K)+"="+encodeURI(b))});c+=k}B(a,"displayError",{chart:e,code:b,message:c,params:p},function(){if(d)throw Error(c);h.console&&-1===r.messages.indexOf(c)&&console.warn(c)});r.messages.push(c)}function C(b,d){var y={};I(b,function(h,c){if(J(b[c],!0)&&!b.nodeType&&d[c])h=C(b[c],d[c]),Object.keys(h).length&&(y[c]=h);else if(J(b[c])||b[c]!==d[c])y[c]=b[c]});return y}function E(b,d){return parseInt(b,d||10)}function z(b){return"string"===typeof b}function x(b){b=Object.prototype.toString.call(b); +return"[object Array]"===b||"[object Array Iterator]"===b}function J(b,d){return!!b&&"object"===typeof b&&(!d||!x(b))}function u(b){return J(b)&&"number"===typeof b.nodeType}function n(b){var d=b&&b.constructor;return!(!J(b,!0)||u(b)||!d||!d.name||"Object"===d.name)}function m(b){return"number"===typeof b&&!isNaN(b)&&Infinity>b&&-Infinity=d-1&&(d=Math.floor(c)),Math.max(0,d-(y(b,"padding-left",!0)||0)-(y(b,"padding-right",!0)||0));if("height"===d)return Math.max(0,Math.min(b.offsetHeight,b.scrollHeight)-(y(b,"padding-top",!0)||0)-(y(b,"padding-bottom",!0)||0));h.getComputedStyle||r(27,!0);if(b=h.getComputedStyle(b, +void 0)){var e=b.getPropertyValue(d);l(c,"opacity"!==d)&&(e=E(e))}return e}function I(b,d,h){for(var y in b)Object.hasOwnProperty.call(b,y)&&d.call(h||b[y],b[y],y,b)}function D(b,d,h){function y(d,H){var K=b.removeEventListener||a.removeEventListenerPolyfill;K&&K.call(b,d,H,!1)}function c(h){var H;if(b.nodeName){if(d){var K={};K[d]=!0}else K=h;I(K,function(b,d){if(h[d])for(H=h[d].length;H--;)y(d,h[d][H].fn)})}}var e="function"===typeof b&&b.prototype||b;if(Object.hasOwnProperty.call(e,"hcEvents")){var p= +e.hcEvents;d?(e=p[d]||[],h?(p[d]=e.filter(function(b){return h!==b.fn}),y(d,h)):(c(p),p[d]=[])):(c(p),delete e.hcEvents)}}function B(b,d,h,c){h=h||{};if(t.createEvent&&(b.dispatchEvent||b.fireEvent&&b!==a)){var y=t.createEvent("Events");y.initEvent(d,!0,!0);h=e(y,h);b.dispatchEvent?b.dispatchEvent(h):b.fireEvent(d,h)}else if(b.hcEvents){h.target||e(h,{preventDefault:function(){h.defaultPrevented=!0},target:b,type:d});y=[];for(var p=b,k=!1;p.hcEvents;)Object.hasOwnProperty.call(p,"hcEvents")&&p.hcEvents[d]&& +(y.length&&(k=!0),y.unshift.apply(y,p.hcEvents[d])),p=Object.getPrototypeOf(p);k&&y.sort(function(b,d){return b.order-d.order});y.forEach(function(d){!1===d.fn.call(b,h)&&h.preventDefault()})}c&&!h.defaultPrevented&&c.call(b,h)}var O=a.charts,t=a.doc,h=a.win;(r||(r={})).messages=[];var d;Math.easeInOutSine=function(b){return-.5*(Math.cos(Math.PI*b)-1)};var b=Array.prototype.find?function(b,d){return b.find(d)}:function(b,d){var h,y=b.length;for(h=0;hh&&(h=b[d]);return h},arrayMin:function(b){for(var d=b.length,h=b[0];d--;)b[d]d?b=h&&(d=[1/h])));for(c=0;c=b||!p&&k<=(d[c]+ +(d[c+1]||d[c]))/2);c++);return e=q(e*h,-Math.round(Math.log(.001)/Math.LN10))},objectEach:I,offset:function(b){var d=t.documentElement;b=b.parentElement||b.parentNode?b.getBoundingClientRect():{top:0,left:0,width:0,height:0};return{top:b.top+(h.pageYOffset||d.scrollTop)-(d.clientTop||0),left:b.left+(h.pageXOffset||d.scrollLeft)-(d.clientLeft||0),width:b.width,height:b.height}},pad:function(b,d,h){return Array((d||2)+1-String(b).replace("-","").length).join(h||"0")+b},pick:l,pInt:E,relativeLength:function(b, +d,h){return/%$/.test(b)?d*parseFloat(b)/100+(h||0):parseFloat(b)},removeEvent:D,splat:function(b){return x(b)?b:[b]},stableSort:function(b,d){var h=b.length,c,p;for(p=0;p>16,(m&65280)>>8,m&255,1]:4===n&&(u=[(m&3840)>>4|(m&3840)>>8,(m&240)>>4|m&240,(m&15)<<4|m&15,1])}if(!u)for(m=x.parsers.length;m--&&!u;){var g= +x.parsers[m];(n=g.regex.exec(a))&&(u=g.parse(n))}}u&&(this.rgba=u)};x.prototype.get=function(a){var u=this.input,n=this.rgba;if("object"===typeof u&&"undefined"!==typeof this.stops){var m=E(u);m.stops=[].slice.call(m.stops);this.stops.forEach(function(g,c){m.stops[c]=[m.stops[c][0],g.get(a)]});return m}return n&&r(n[0])?"rgb"===a||!a&&1===n[3]?"rgb("+n[0]+","+n[1]+","+n[2]+")":"a"===a?""+n[3]:"rgba("+n.join(",")+")":u};x.prototype.brighten=function(a){var u=this.rgba;if(this.stops)this.stops.forEach(function(m){m.brighten(a)}); +else if(r(a)&&0!==a)for(var n=0;3>n;n++)u[n]+=z(255*a),0>u[n]&&(u[n]=0),255q?"AM":"PM",P:12>q?"am":"pm",S:m(l.getSeconds()),L:m(Math.floor(e%1E3),3)},a.dateFormats);n(l,function(b,d){for(;-1!==c.indexOf("%"+d);)c=c.replace("%"+d,"function"===typeof b?b.call(k,e):b)});return f?c.substr(0,1).toUpperCase()+c.substr(1):c};v.prototype.resolveDTLFormat=function(e){return J(e,!0)?e:(e=c(e),{main:e[0],from:e[1],to:e[2]})};v.prototype.getTimeTicks=function(c,k,f,l){var q=this,v=[],t={},h=new q.Date(k),d=c.unitRange,b=c.count||1,p;l=g(l,1);if(E(k)){q.set("Milliseconds",h, +d>=e.second?0:b*Math.floor(q.get("Milliseconds",h)/b));d>=e.second&&q.set("Seconds",h,d>=e.minute?0:b*Math.floor(q.get("Seconds",h)/b));d>=e.minute&&q.set("Minutes",h,d>=e.hour?0:b*Math.floor(q.get("Minutes",h)/b));d>=e.hour&&q.set("Hours",h,d>=e.day?0:b*Math.floor(q.get("Hours",h)/b));d>=e.day&&q.set("Date",h,d>=e.month?1:Math.max(1,b*Math.floor(q.get("Date",h)/b)));if(d>=e.month){q.set("Month",h,d>=e.year?0:b*Math.floor(q.get("Month",h)/b));var G=q.get("FullYear",h)}d>=e.year&&q.set("FullYear", +h,G-G%b);d===e.week&&(G=q.get("Day",h),q.set("Date",h,q.get("Date",h)-G+l+(G4*e.month||q.getTimezoneOffset(k)!==q.getTimezoneOffset(f));k=h.getTime();for(h=1;kv.length&&v.forEach(function(b){0===b%18E5&&"000000000"===q.dateFormat("%H%M%S%L",b)&&(t[b]="day")})}v.info=x(c,{higherRanks:t,totalRange:d*b});return v};v.prototype.getDateFormat=function(c,k,f,g){var l=this.dateFormat("%m-%d %H:%M:%S.%L",k),q={millisecond:15,second:12,minute:9,hour:6,day:3},t="millisecond";for(h in e){if(c===e.week&&+this.dateFormat("%w",k)===f&&"00:00:00.000"===l.substr(6)){var h="week";break}if(e[h]>c){h=t;break}if(q[h]&&l.substr(q[h])!=="01-01 00:00:00.000".substr(q[h]))break; +"week"!==h&&(t=h)}if(h)var d=this.resolveDTLFormat(g[h]).main;return d};return v}();"";return w});M(a,"Core/DefaultOptions.js",[a["Core/Chart/ChartDefaults.js"],a["Core/Color/Color.js"],a["Core/Globals.js"],a["Core/Color/Palette.js"],a["Core/Time.js"],a["Core/Utilities.js"]],function(a,w,C,E,z,x){w=w.parse;var r=x.merge,u={colors:E.colors,symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January February March April May June July August September October November December".split(" "), +shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),decimalPoint:".",numericSymbols:"kMGTPE".split(""),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{},time:{Date:void 0,getTimezoneOffset:void 0,timezone:void 0,timezoneOffset:0,useUTC:!0},chart:a,title:{text:"Chart title",align:"center",margin:15,widthAdjust:-44},subtitle:{text:"",align:"center",widthAdjust:-44}, +caption:{margin:15,text:"",align:"left",verticalAlign:"bottom"},plotOptions:{},labels:{style:{position:"absolute",color:E.neutralColor80}},legend:{enabled:!0,align:"center",alignColumns:!0,className:"highcharts-no-tooltip",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:E.neutralColor40,borderRadius:0,navigation:{activeColor:E.highlightColor100,inactiveColor:E.neutralColor20},itemStyle:{color:E.neutralColor80,cursor:"pointer",fontSize:"12px",fontWeight:"bold",textOverflow:"ellipsis"}, +itemHoverStyle:{color:E.neutralColor100},itemHiddenStyle:{color:E.neutralColor20},shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:E.backgroundColor,opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:C.svg,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L", +second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},footerFormat:"",headerShape:"callout",hideDelay:500,padding:8,shape:"callout",shared:!1,snap:C.isTouchDevice?25:10,headerFormat:'{point.key}
',pointFormat:'\u25cf {series.name}: {point.y}
',backgroundColor:w(E.neutralColor3).setOpacity(.85).get(),borderWidth:1, +shadow:!0,stickOnContact:!1,style:{color:E.neutralColor80,cursor:"default",fontSize:"12px",whiteSpace:"nowrap"},useHTML:!1},credits:{enabled:!0,href:"https://www.highcharts.com?credits",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:E.neutralColor40,fontSize:"9px"},text:"Highcharts.com"}};u.chart.styledMode=!1;"";var n=new z(r(u.global,u.time));a={defaultOptions:u,defaultTime:n,getOptions:function(){return u},setOptions:function(a){r(!0,u,a);if(a.time||a.global)C.time? +C.time.update(r(u.global,u.time,a.global,a.time)):C.time=n;return u}};"";return a});M(a,"Core/Animation/Fx.js",[a["Core/Color/Color.js"],a["Core/Globals.js"],a["Core/Utilities.js"]],function(a,w,C){var r=a.parse,z=w.win,x=C.isNumber,J=C.objectEach;return function(){function a(a,m,g){this.pos=NaN;this.options=m;this.elem=a;this.prop=g}a.prototype.dSetter=function(){var a=this.paths,m=a&&a[0];a=a&&a[1];var g=this.now||0,c=[];if(1!==g&&m&&a)if(m.length===a.length&&1>g)for(var e=0;e=l+this.startTime){this.now=this.end;this.pos=1;this.update();var v=f[this.prop]=!0;J(f,function(c){!0!==c&&(v=!1)});v&&e&&e.call(c);a=!1}else this.pos=g.easing((m-this.startTime)/l),this.now=this.start+(this.end-this.start)*this.pos,this.update(),a=!0;return a};a.prototype.initPath=function(a,m,g){function c(c,e){for(;c.lengthv[1]){var k=g+ +v[1];0<=k?(v[0]=(+v[0]).toExponential(k).split("e")[0],g=k):(v[0]=v[0].split(".")[0]||0,a=20>g?(v[0]*Math.pow(10,v[1])).toFixed(g):0,v[1]=0)}k=(Math.abs(v[1]?v[0]:a)+Math.pow(10,-Math.max(g,f)-1)).toFixed(g);f=String(n(k));var m=3a?"-":"")+(m?f.substr(0,m)+e:"");a=0>+v[1]&&!q?"0":a+f.substr(m).replace(/(\d{3})(?=\d)/g,"$1"+e);g&&(a+=c+k.slice(-g));v[1]&&0!==+a&&(a+="e"+v[1]);return a}var E=a.defaultOptions,z=a.defaultTime,x=w.getNestedProperty,J=w.isNumber,u=w.pick,n=w.pInt;return{dateFormat:function(a,g,c){return z.dateFormat(a,g,c)},format:function(a,g,c){var e="{",l=!1,f=/f$/,v=/\.([0-9])/,q=E.lang,k=c&&c.time||z;c=c&&c.numberFormatter||r;for(var m=[];a;){var D=a.indexOf(e); +if(-1===D)break;var B=a.slice(0,D);if(l){B=B.split(":");e=x(B.shift()||"",g);if(B.length&&"number"===typeof e)if(B=B.join(":"),f.test(B)){var u=parseInt((B.match(v)||["","-1"])[1],10);null!==e&&(e=c(e,u,q.decimalPoint,-1c){E(a,e);for(k=f=0;k<=c;)k+=a[f].size,f++;q=a.splice(f-1,a.length)}E(a,l);for(a=a.map(function(c){return{size:c.size,targets:[c.target],align:C(c.align,.5)}});v;){for(f=a.length;f--;)c=a[f],e=(Math.min.apply(0,c.targets)+Math.max.apply(0,c.targets))/2,c.pos=r(e-c.size*c.align,0,n-c.size);f=a.length; +for(v=!1;f--;)0a[f].pos&&(a[f-1].size+=a[f].size,a[f-1].targets=a[f-1].targets.concat(a[f].targets),a[f-1].align=.5,a[f-1].pos+a[f-1].size>n&&(a[f-1].pos=n-a[f-1].size),a.splice(f,1),v=!0)}g.push.apply(g,q);f=0;a.some(function(c){var e=0;return(c.targets||[]).some(function(){g[f].pos=c.pos+e;if("undefined"!==typeof m&&Math.abs(g[f].pos-g[f].target)>m)return g.slice(0,f+1).forEach(function(c){return delete c.pos}),g.reducedLen=(g.reducedLen||n)-.1*n,g.reducedLen>.1*n&&x(g, +n,m),!0;e+=g[f].size;f++;return!1})});E(g,l);return g}a.distribute=x})(z||(z={}));return z});M(a,"Core/Renderer/SVG/SVGElement.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/Renderer/HTML/AST.js"],a["Core/Color/Color.js"],a["Core/Globals.js"],a["Core/Color/Palette.js"],a["Core/Utilities.js"]],function(a,w,C,E,z,x){var r=a.animate,u=a.animObject,n=a.stop,m=E.deg2rad,g=E.doc,c=E.noop,e=E.svg,l=E.SVG_NS,f=E.win,v=x.addEvent,q=x.attr,k=x.createElement,I=x.css,D=x.defined,B=x.erase,O=x.extend, +t=x.fireEvent,h=x.isArray,d=x.isFunction,b=x.isNumber,p=x.isString,G=x.merge,y=x.objectEach,L=x.pick,F=x.pInt,P=x.syncTimeout,S=x.uniqueKey;a=function(){function a(){this.element=void 0;this.onEvents={};this.opacity=1;this.renderer=void 0;this.SVG_NS=l;this.symbolCustomAttribs="x y width height r start end innerR anchorX anchorY rounded".split(" ")}a.prototype._defaultGetter=function(b){b=L(this[b+"Value"],this[b],this.element?this.element.getAttribute(b):null,0);/^[\-0-9\.]+$/.test(b)&&(b=parseFloat(b)); +return b};a.prototype._defaultSetter=function(b,d,c){c.setAttribute(d,b)};a.prototype.add=function(b){var d=this.renderer,c=this.element;b&&(this.parentGroup=b);this.parentInverted=b&&b.inverted;"undefined"!==typeof this.textStr&&"text"===this.element.nodeName&&d.buildText(this);this.added=!0;if(!b||b.handleZ||this.zIndex)var K=this.zIndexSetter();K||(b?b.element:d.box).appendChild(c);if(this.onAdd)this.onAdd();return this};a.prototype.addClass=function(b,d){var c=d?"":this.attr("class")||"";b=(b|| +"").split(/ /g).reduce(function(b,d){-1===c.indexOf(d)&&b.push(d);return b},c?[c]:[]).join(" ");b!==c&&this.attr("class",b);return this};a.prototype.afterSetters=function(){this.doTransform&&(this.updateTransform(),this.doTransform=!1)};a.prototype.align=function(b,d,c){var K={},h=this.renderer,H=h.alignedObjects,a,e,A;if(b){if(this.alignOptions=b,this.alignByTranslate=d,!c||p(c))this.alignTo=a=c||"renderer",B(H,this),H.push(this),c=void 0}else b=this.alignOptions,d=this.alignByTranslate,a=this.alignTo; +c=L(c,h[a],"scrollablePlotBox"===a?h.plotBox:void 0,h);a=b.align;var f=b.verticalAlign;h=(c.x||0)+(b.x||0);H=(c.y||0)+(b.y||0);"right"===a?e=1:"center"===a&&(e=2);e&&(h+=(c.width-(b.width||0))/e);K[d?"translateX":"x"]=Math.round(h);"bottom"===f?A=1:"middle"===f&&(A=2);A&&(H+=(c.height-(b.height||0))/A);K[d?"translateY":"y"]=Math.round(H);this[this.placed?"animate":"attr"](K);this.placed=!0;this.alignAttr=K;return this};a.prototype.alignSetter=function(b){var d={left:"start",center:"middle",right:"end"}; +d[b]&&(this.alignValue=b,this.element.setAttribute("text-anchor",d[b]))};a.prototype.animate=function(b,d,c){var h=this,H=u(L(d,this.renderer.globalAnimation,!0));d=H.defer;L(g.hidden,g.msHidden,g.webkitHidden,!1)&&(H.duration=0);0!==H.duration?(c&&(H.complete=c),P(function(){h.element&&r(h,b,H)},d)):(this.attr(b,void 0,c),y(b,function(b,d){H.step&&H.step.call(this,b,{prop:d,pos:1,elem:this})},this));return this};a.prototype.applyTextOutline=function(b){var d=this.element;-1!==b.indexOf("contrast")&& +(b=b.replace(/contrast/g,this.renderer.getContrast(d.style.fill)));var c=b.split(" ");b=c[c.length-1];if((c=c[0])&&"none"!==c&&E.svg){this.fakeTS=!0;this.ySetter=this.xSetter;c=c.replace(/(^[\d\.]+)(.*?)$/g,function(b,d,c){return 2*Number(d)+c});this.removeTextOutline();var h=g.createElementNS(l,"tspan");q(h,{"class":"highcharts-text-outline",fill:b,stroke:b,"stroke-width":c,"stroke-linejoin":"round"});[].forEach.call(d.childNodes,function(b){var d=b.cloneNode(!0);d.removeAttribute&&["fill","stroke", +"stroke-width","stroke"].forEach(function(b){return d.removeAttribute(b)});h.appendChild(d)});var a=g.createElementNS(l,"tspan");a.textContent="\u200b";["x","y"].forEach(function(b){var c=d.getAttribute(b);c&&a.setAttribute(b,c)});h.appendChild(a);d.insertBefore(h,d.firstChild)}};a.prototype.attr=function(b,d,c,h){var K=this.element,H=this.symbolCustomAttribs,a,e=this,A,p;if("string"===typeof b&&"undefined"!==typeof d){var f=b;b={};b[f]=d}"string"===typeof b?e=(this[b+"Getter"]||this._defaultGetter).call(this, +b,K):(y(b,function(d,c){A=!1;h||n(this,c);this.symbolName&&-1!==H.indexOf(c)&&(a||(this.symbolAttr(b),a=!0),A=!0);!this.rotation||"x"!==c&&"y"!==c||(this.doTransform=!0);A||(p=this[c+"Setter"]||this._defaultSetter,p.call(this,d,c,K),!this.styledMode&&this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(c)&&this.updateShadows(c,d,p))},this),this.afterSetters());c&&c.call(this);return e};a.prototype.clip=function(b){return this.attr("clip-path",b?"url("+this.renderer.url+"#"+b.id+ +")":"none")};a.prototype.crisp=function(b,d){d=d||b.strokeWidth||0;var c=Math.round(d)%2/2;b.x=Math.floor(b.x||this.x||0)+c;b.y=Math.floor(b.y||this.y||0)+c;b.width=Math.floor((b.width||this.width||0)-2*c);b.height=Math.floor((b.height||this.height||0)-2*c);D(b.strokeWidth)&&(b.strokeWidth=d);return b};a.prototype.complexColor=function(b,d,c){var K=this.renderer,a,H,e,p,A,f,k,g,l,q,v=[],F;t(this.renderer,"complexColor",{args:arguments},function(){b.radialGradient?H="radialGradient":b.linearGradient&& +(H="linearGradient");if(H){e=b[H];A=K.gradients;f=b.stops;l=c.radialReference;h(e)&&(b[H]=e={x1:e[0],y1:e[1],x2:e[2],y2:e[3],gradientUnits:"userSpaceOnUse"});"radialGradient"===H&&l&&!D(e.gradientUnits)&&(p=e,e=G(e,K.getRadialAttr(l,p),{gradientUnits:"userSpaceOnUse"}));y(e,function(b,d){"id"!==d&&v.push(d,b)});y(f,function(b){v.push(b)});v=v.join(",");if(A[v])q=A[v].attr("id");else{e.id=q=S();var N=A[v]=K.createElement(H).attr(e).add(K.defs);N.radAttr=p;N.stops=[];f.forEach(function(b){0===b[1].indexOf("rgba")? +(a=C.parse(b[1]),k=a.get("rgb"),g=a.get("a")):(k=b[1],g=1);b=K.createElement("stop").attr({offset:b[0],"stop-color":k,"stop-opacity":g}).add(N);N.stops.push(b)})}F="url("+K.url+"#"+q+")";c.setAttribute(d,F);c.gradient=v;b.toString=function(){return F}}})};a.prototype.css=function(b){var d=this.styles,c={},h=this.element,a=["textOutline","textOverflow","width"],p="",f=!d;b&&b.color&&(b.fill=b.color);d&&y(b,function(b,h){d&&d[h]!==b&&(c[h]=b,f=!0)});if(f){d&&(b=O(d,c));if(b)if(null===b.width||"auto"=== +b.width)delete this.textWidth;else if("text"===h.nodeName.toLowerCase()&&b.width)var k=this.textWidth=F(b.width);this.styles=b;k&&!e&&this.renderer.forExport&&delete b.width;if(h.namespaceURI===this.SVG_NS){var A=function(b,d){return"-"+d.toLowerCase()};y(b,function(b,d){-1===a.indexOf(d)&&(p+=d.replace(/([A-Z])/g,A)+":"+b+";")});p&&q(h,"style",p)}else I(h,b);this.added&&("text"===this.element.nodeName&&this.renderer.buildText(this),b&&b.textOutline&&this.applyTextOutline(b.textOutline))}return this}; +a.prototype.dashstyleSetter=function(b){var d=this["stroke-width"];"inherit"===d&&(d=1);if(b=b&&b.toLowerCase()){var c=b.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(b=c.length;b--;)c[b]=""+F(c[b])*L(d,NaN);b=c.join(",").replace(/NaN/g,"none");this.element.setAttribute("stroke-dasharray",b)}};a.prototype.destroy= +function(){var b=this,d=b.element||{},c=b.renderer,h=d.ownerSVGElement,a=c.isSVG&&"SPAN"===d.nodeName&&b.parentGroup||void 0;d.onclick=d.onmouseout=d.onmouseover=d.onmousemove=d.point=null;n(b);if(b.clipPath&&h){var e=b.clipPath;[].forEach.call(h.querySelectorAll("[clip-path],[CLIP-PATH]"),function(b){-1y.width)y={width:0,height:0}}else y=this.htmlGetBBox();h.isSVG&&(b=y.width,h=y.height,A&&(y.height=h={"11px,17":14,"13px,20":16}[e&&e.fontSize+","+Math.round(h)]||h),c&&(e=c*m,y.width=Math.abs(h*Math.sin(e))+Math.abs(b*Math.cos(e)),y.height=Math.abs(h*Math.cos(e))+Math.abs(b*Math.sin(e))));if(G&&(""===p||0]*>/g,"").replace(/</g,"<").replace(/>/g,">")};a.prototype.toFront=function(){var b=this.element;b.parentNode.appendChild(b);return this};a.prototype.translate=function(b,d){return this.attr({translateX:b,translateY:d})};a.prototype.updateShadows=function(b,d,c){var h=this.shadows;if(h)for(var a=h.length;a--;)c.call(h[a], +"height"===b?Math.max(d-(h[a].cutHeight||0),0):"d"===b?this.d:d,b,h[a])};a.prototype.updateTransform=function(){var b=this.scaleX,d=this.scaleY,c=this.inverted,h=this.rotation,a=this.matrix,e=this.element,p=this.translateX||0,f=this.translateY||0;c&&(p+=this.width,f+=this.height);p=["translate("+p+","+f+")"];D(a)&&p.push("matrix("+a.join(",")+")");c?p.push("rotate(90) scale(-1,1)"):h&&p.push("rotate("+h+" "+L(this.rotationOriginX,e.getAttribute("x"),0)+" "+L(this.rotationOriginY,e.getAttribute("y")|| +0)+")");(D(b)||D(d))&&p.push("scale("+L(b,1)+" "+L(d,1)+")");p.length&&e.setAttribute("transform",p.join(" "))};a.prototype.visibilitySetter=function(b,d,c){"inherit"===b?c.removeAttribute(d):this[d]!==b&&c.setAttribute(d,b);this[d]=b};a.prototype.xGetter=function(b){"circle"===this.element.nodeName&&("x"===b?b="cx":"y"===b&&(b="cy"));return this._defaultGetter(b)};a.prototype.zIndexSetter=function(b,d){var c=this.renderer,h=this.parentGroup,a=(h||c).element||c.box,e=this.element;c=a===c.box;var p= +!1;var f=this.added;var A;D(b)?(e.setAttribute("data-z-index",b),b=+b,this[d]===b&&(f=!1)):D(this[d])&&e.removeAttribute("data-z-index");this[d]=b;if(f){(b=this.zIndex)&&h&&(h.handleZ=!0);d=a.childNodes;for(A=d.length-1;0<=A&&!p;A--){h=d[A];f=h.getAttribute("data-z-index");var k=!D(f);if(h!==e)if(0>b&&k&&!c&&!A)a.insertBefore(e,d[A]),p=!0;else if(F(f)<=b||k&&(!D(b)||0<=b))a.insertBefore(e,d[A+1]||null),p=!0}p||(a.insertBefore(e,d[c?3:0]||null),p=!0)}return p};return a}();a.prototype["stroke-widthSetter"]= +a.prototype.strokeSetter;a.prototype.yGetter=a.prototype.xGetter;a.prototype.matrixSetter=a.prototype.rotationOriginXSetter=a.prototype.rotationOriginYSetter=a.prototype.rotationSetter=a.prototype.scaleXSetter=a.prototype.scaleYSetter=a.prototype.translateXSetter=a.prototype.translateYSetter=a.prototype.verticalAlignSetter=function(b,d){this[d]=b;this.doTransform=!0};"";return a});M(a,"Core/Renderer/RendererRegistry.js",[a["Core/Globals.js"]],function(a){var r;(function(r){r.rendererTypes={};var w; +r.getRendererType=function(a){void 0===a&&(a=w);return r.rendererTypes[a]||r.rendererTypes[w]};r.registerRendererType=function(C,x,E){r.rendererTypes[C]=x;if(!w||E)w=C,a.Renderer=x}})(r||(r={}));return r});M(a,"Core/Renderer/SVG/SVGLabel.js",[a["Core/Renderer/SVG/SVGElement.js"],a["Core/Utilities.js"]],function(a,w){var r=this&&this.__extends||function(){var a=function(g,c){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,a){c.__proto__=a}||function(c,a){for(var e in a)a.hasOwnProperty(e)&& +(c[e]=a[e])};return a(g,c)};return function(g,c){function e(){this.constructor=g}a(g,c);g.prototype=null===c?Object.create(c):(e.prototype=c.prototype,new e)}}(),E=w.defined,z=w.extend,x=w.isNumber,J=w.merge,u=w.pick,n=w.removeEvent;return function(m){function g(c,a,l,f,v,q,k,I,D,B){var e=m.call(this)||this;e.paddingLeftSetter=e.paddingSetter;e.paddingRightSetter=e.paddingSetter;e.init(c,"g");e.textStr=a;e.x=l;e.y=f;e.anchorX=q;e.anchorY=k;e.baseline=D;e.className=B;e.addClass("button"===B?"highcharts-no-tooltip": +"highcharts-label");B&&e.addClass("highcharts-"+B);e.text=c.text(void 0,0,0,I).attr({zIndex:1});var t;"string"===typeof v&&((t=/^url\((.*?)\)$/.test(v))||e.renderer.symbols[v])&&(e.symbolKey=v);e.bBox=g.emptyBBox;e.padding=3;e.baselineOffset=0;e.needsBox=c.styledMode||t;e.deferredAttr={};e.alignFactor=0;return e}r(g,m);g.prototype.alignSetter=function(c){c={left:0,center:.5,right:1}[c];c!==this.alignFactor&&(this.alignFactor=c,this.bBox&&x(this.xSetting)&&this.attr({x:this.xSetting}))};g.prototype.anchorXSetter= +function(c,a){this.anchorX=c;this.boxAttr(a,Math.round(c)-this.getCrispAdjust()-this.xSetting)};g.prototype.anchorYSetter=function(c,a){this.anchorY=c;this.boxAttr(a,c-this.ySetting)};g.prototype.boxAttr=function(c,a){this.box?this.box.attr(c,a):this.deferredAttr[c]=a};g.prototype.css=function(c){if(c){var e={};c=J(c);g.textProps.forEach(function(a){"undefined"!==typeof c[a]&&(e[a]=c[a],delete c[a])});this.text.css(e);var l="width"in e;"fontSize"in e||"fontWeight"in e?this.updateTextPadding():l&& +this.updateBoxSize()}return a.prototype.css.call(this,c)};g.prototype.destroy=function(){n(this.element,"mouseenter");n(this.element,"mouseleave");this.text&&this.text.destroy();this.box&&(this.box=this.box.destroy());a.prototype.destroy.call(this)};g.prototype.fillSetter=function(c,a){c&&(this.needsBox=!0);this.fill=c;this.boxAttr(a,c)};g.prototype.getBBox=function(){this.textStr&&0===this.bBox.width&&0===this.bBox.height&&this.updateBoxSize();var c=this.padding,a=u(this.paddingLeft,c);return{width:this.width, +height:this.height,x:this.bBox.x-a,y:this.bBox.y-c}};g.prototype.getCrispAdjust=function(){return this.renderer.styledMode&&this.box?this.box.strokeWidth()%2/2:(this["stroke-width"]?parseInt(this["stroke-width"],10):0)%2/2};g.prototype.heightSetter=function(c){this.heightSetting=c};g.prototype.onAdd=function(){var c=this.textStr;this.text.add(this);this.attr({text:E(c)?c:"",x:this.x,y:this.y});this.box&&E(this.anchorX)&&this.attr({anchorX:this.anchorX,anchorY:this.anchorY})};g.prototype.paddingSetter= +function(c,a){x(c)?c!==this[a]&&(this[a]=c,this.updateTextPadding()):this[a]=void 0};g.prototype.rSetter=function(c,a){this.boxAttr(a,c)};g.prototype.shadow=function(c){c&&!this.renderer.styledMode&&(this.updateBoxSize(),this.box&&this.box.shadow(c));return this};g.prototype.strokeSetter=function(c,a){this.stroke=c;this.boxAttr(a,c)};g.prototype["stroke-widthSetter"]=function(c,a){c&&(this.needsBox=!0);this["stroke-width"]=c;this.boxAttr(a,c)};g.prototype["text-alignSetter"]=function(c){this.textAlign= +c};g.prototype.textSetter=function(c){"undefined"!==typeof c&&this.text.attr({text:c});this.updateTextPadding()};g.prototype.updateBoxSize=function(){var c=this.text.element.style,a={},l=this.padding,f=this.bBox=x(this.widthSetting)&&x(this.heightSetting)&&!this.textAlign||!E(this.text.textStr)?g.emptyBBox:this.text.getBBox();this.width=this.getPaddedWidth();this.height=(this.heightSetting||f.height||0)+2*l;c=this.renderer.fontMetrics(c&&c.fontSize,this.text);this.baselineOffset=l+Math.min((this.text.firstLineMetrics|| +c).b,f.height||Infinity);this.heightSetting&&(this.baselineOffset+=(this.heightSetting-c.h)/2);this.needsBox&&(this.box||(l=this.box=this.symbolKey?this.renderer.symbol(this.symbolKey):this.renderer.rect(),l.addClass(("button"===this.className?"":"highcharts-label-box")+(this.className?" highcharts-"+this.className+"-box":"")),l.add(this)),l=this.getCrispAdjust(),a.x=l,a.y=(this.baseline?-this.baselineOffset:0)+l,a.width=Math.round(this.width),a.height=Math.round(this.height),this.box.attr(z(a,this.deferredAttr)), +this.deferredAttr={})};g.prototype.updateTextPadding=function(){var c=this.text;this.updateBoxSize();var a=this.baseline?0:this.baselineOffset,g=u(this.paddingLeft,this.padding);E(this.widthSetting)&&this.bBox&&("center"===this.textAlign||"right"===this.textAlign)&&(g+={center:.5,right:1}[this.textAlign]*(this.widthSetting-this.bBox.width));if(g!==c.x||a!==c.y)c.attr("x",g),c.hasBoxWidthChanged&&(this.bBox=c.getBBox(!0)),"undefined"!==typeof a&&c.attr("y",a);c.x=g;c.y=a};g.prototype.widthSetter=function(c){this.widthSetting= +x(c)?c:void 0};g.prototype.getPaddedWidth=function(){var c=this.padding,a=u(this.paddingLeft,c);c=u(this.paddingRight,c);return(this.widthSetting||this.bBox.width||0)+a+c};g.prototype.xSetter=function(c){this.x=c;this.alignFactor&&(c-=this.alignFactor*this.getPaddedWidth(),this["forceAnimate:x"]=!0);this.xSetting=Math.round(c);this.attr("translateX",this.xSetting)};g.prototype.ySetter=function(c){this.ySetting=this.y=Math.round(c);this.attr("translateY",this.ySetting)};g.emptyBBox={width:0,height:0, +x:0,y:0};g.textProps="color direction fontFamily fontSize fontStyle fontWeight lineHeight textAlign textDecoration textOutline textOverflow width".split(" ");return g}(a)});M(a,"Core/Renderer/SVG/Symbols.js",[a["Core/Utilities.js"]],function(a){function r(a,n,m,g,c){var e=[];if(c){var l=c.start||0,f=J(c.r,m);m=J(c.r,g||m);var v=(c.end||0)-.001;g=c.innerR;var q=J(c.open,.001>Math.abs((c.end||0)-l-2*Math.PI)),k=Math.cos(l),I=Math.sin(l),D=Math.cos(v),B=Math.sin(v);l=J(c.longArc,.001>v-l-Math.PI?0:1); +e.push(["M",a+f*k,n+m*I],["A",f,m,0,l,J(c.clockwise,1),a+f*D,n+m*B]);z(g)&&e.push(q?["M",a+g*D,n+g*B]:["L",a+g*D,n+g*B],["A",g,g,0,l,z(c.clockwise)?1-c.clockwise:0,a+g*k,n+g*I]);q||e.push(["Z"])}return e}function C(a,n,m,g,c){return c&&c.r?E(a,n,m,g,c):[["M",a,n],["L",a+m,n],["L",a+m,n+g],["L",a,n+g],["Z"]]}function E(a,n,m,g,c){c=c&&c.r||0;return[["M",a+c,n],["L",a+m-c,n],["C",a+m,n,a+m,n,a+m,n+c],["L",a+m,n+g-c],["C",a+m,n+g,a+m,n+g,a+m-c,n+g],["L",a+c,n+g],["C",a,n+g,a,n+g,a,n+g-c],["L",a,n+c], +["C",a,n,a,n,a+c,n]]}var z=a.defined,x=a.isNumber,J=a.pick;return{arc:r,callout:function(a,n,m,g,c){var e=Math.min(c&&c.r||0,m,g),l=e+6,f=c&&c.anchorX;c=c&&c.anchorY||0;var v=E(a,n,m,g,{r:e});if(!x(f))return v;a+f>=m?c>n+l&&c=a+f?c>n+l&&cg&&f>a+l&&fc&&f>a+l&&f/g,k=[l,this.ellipsis,this.noWrap,this.textLineHeight,this.textOutline,this.fontSize,this.width].join();if(k!==g.textCache){g.textCache=k;delete g.actualWidth;for(k=v.length;k--;)c.removeChild(v[k]);f||this.ellipsis|| +this.width||-1!==l.indexOf(" ")&&(!this.noWrap||q.test(l))?""!==l&&(e&&e.appendChild(c),l=new a(l),this.modifyTree(l.nodes),l.addToDOM(g.element),this.modifyDOM(),this.ellipsis&&-1!==(c.textContent||"").indexOf("\u2026")&&g.attr("title",this.unescapeEntities(g.textStr||"",["<",">"])),e&&e.removeChild(c)):c.appendChild(r.createTextNode(this.unescapeEntities(l)));J(this.textOutline)&&g.applyTextOutline&&g.applyTextOutline(this.textOutline)}};m.prototype.modifyDOM=function(){var a=this,c=this.svgElement, +e=x(c.element,"x");c.firstLineMetrics=void 0;for(var l;l=c.element.firstChild;)if(/^[\s\u200B]*$/.test(l.textContent||" "))c.element.removeChild(l);else break;[].forEach.call(c.element.querySelectorAll("tspan.highcharts-br"),function(f,g){f.nextSibling&&f.previousSibling&&(0===g&&1===f.previousSibling.nodeType&&(c.firstLineMetrics=c.renderer.fontMetrics(void 0,f.previousSibling)),x(f,{dy:a.getLineHeight(f.nextSibling),x:e}))});var f=this.width||0;if(f){var v=function(k,g){var l=k.textContent||"", +q=l.replace(/([^\^])-/g,"$1- ").split(" "),v=!a.noWrap&&(1f){for(;B<=n;)t=Math.ceil((B+n)/2),e&&(h=v(e,t)),b=d(t,h&&h.length-1),B===n?B=n+1: +b>f?n=t-1:B=t;0===n?a.textContent="":c&&n===c.length-1||(a.textContent=h||v(c||e,t))}e&&e.splice(0,t);g.actualWidth=b;g.rotation=m};m.prototype.unescapeEntities=function(a,c){u(this.renderer.escapes,function(e,g){c&&-1!==c.indexOf(e)||(a=a.toString().replace(new RegExp(e,"g"),g))});return a};return m}()});M(a,"Core/Renderer/SVG/SVGRenderer.js",[a["Core/Renderer/HTML/AST.js"],a["Core/Color/Color.js"],a["Core/Globals.js"],a["Core/Color/Palette.js"],a["Core/Renderer/RendererRegistry.js"],a["Core/Renderer/SVG/SVGElement.js"], +a["Core/Renderer/SVG/SVGLabel.js"],a["Core/Renderer/SVG/Symbols.js"],a["Core/Renderer/SVG/TextBuilder.js"],a["Core/Utilities.js"]],function(a,w,C,E,z,x,J,u,n,m){var g=C.charts,c=C.deg2rad,e=C.doc,l=C.isFirefox,f=C.isMS,v=C.isWebKit,q=C.noop,k=C.SVG_NS,I=C.symbolSizes,D=C.win,B=m.addEvent,r=m.attr,t=m.createElement,h=m.css,d=m.defined,b=m.destroyObjectProperties,p=m.extend,G=m.isArray,y=m.isNumber,L=m.isObject,F=m.isString,P=m.merge,S=m.pick,Q=m.pInt,V=m.uniqueKey,fa;C=function(){function H(b,d,c, +a,h,e,p){this.width=this.url=this.style=this.isSVG=this.imgCount=this.height=this.gradients=this.globalAnimation=this.defs=this.chartIndex=this.cacheKeys=this.cache=this.boxWrapper=this.box=this.alignedObjects=void 0;this.init(b,d,c,a,h,e,p)}H.prototype.init=function(b,d,c,a,p,A,H){var K=this.createElement("svg").attr({version:"1.1","class":"highcharts-root"}),f=K.element;H||K.css(this.getStyle(a));b.appendChild(f);r(b,"dir","ltr");-1===b.innerHTML.indexOf("xmlns")&&r(f,"xmlns",this.SVG_NS);this.isSVG= +!0;this.box=f;this.boxWrapper=K;this.alignedObjects=[];this.url=this.getReferenceURL();this.createElement("desc").add().element.appendChild(e.createTextNode("Created with Highcharts 9.2.2"));this.defs=this.createElement("defs").add();this.allowHTML=A;this.forExport=p;this.styledMode=H;this.gradients={};this.cache={};this.cacheKeys=[];this.imgCount=0;this.setSize(d,c,!1);var k;l&&b.getBoundingClientRect&&(d=function(){h(b,{left:0,top:0});k=b.getBoundingClientRect();h(b,{left:Math.ceil(k.left)-k.left+ +"px",top:Math.ceil(k.top)-k.top+"px"})},d(),this.unSubPixelFix=B(D,"resize",d))};H.prototype.definition=function(b){return(new a([b])).addToDOM(this.defs.element)};H.prototype.getReferenceURL=function(){if((l||v)&&e.getElementsByTagName("base").length){if(!d(fa)){var b=V();b=(new a([{tagName:"svg",attributes:{width:8,height:8},children:[{tagName:"defs",children:[{tagName:"clipPath",attributes:{id:b},children:[{tagName:"rect",attributes:{width:4,height:4}}]}]},{tagName:"rect",attributes:{id:"hitme", +width:8,height:8,"clip-path":"url(#"+b+")",fill:"rgba(0,0,0,0.001)"}}]}])).addToDOM(e.body);h(b,{position:"fixed",top:0,left:0,zIndex:9E5});var c=e.elementFromPoint(6,6);fa="hitme"===(c&&c.id);e.body.removeChild(b)}if(fa)return D.location.href.split("#")[0].replace(/<[^>]*>/g,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20")}return""};H.prototype.getStyle=function(b){return this.style=p({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},b)};H.prototype.setStyle= +function(b){this.boxWrapper.css(this.getStyle(b))};H.prototype.isHidden=function(){return!this.boxWrapper.getBBox().width};H.prototype.destroy=function(){var d=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();b(this.gradients||{});this.gradients=null;d&&(this.defs=d.destroy());this.unSubPixelFix&&this.unSubPixelFix();return this.alignedObjects=null};H.prototype.createElement=function(b){var d=new this.Element;d.init(this,b);return d};H.prototype.getRadialAttr=function(b,d){return{cx:b[0]- +b[2]/2+(d.cx||0)*b[2],cy:b[1]-b[2]/2+(d.cy||0)*b[2],r:(d.r||0)*b[2]}};H.prototype.buildText=function(b){(new n(b)).buildSVG()};H.prototype.getContrast=function(b){b=w.parse(b).rgba;b[0]*=1;b[1]*=1.2;b[2]*=.5;return 459b?b+3:Math.round(1.2*b);return{h:d,b:Math.round(.8*d),f:b}};H.prototype.rotCorr=function(b,d,a){var h=b;d&&a&&(h=Math.max(h*Math.cos(d*c),4));return{x:-b/3*Math.sin(d*c),y:h}};H.prototype.pathToSegments=function(b){for(var d=[],c=[],a={A:8,C:7,H:2,L:3,M:3,Q:5,S:5,T:3,V:2},h=0;h":">","'":"'",'"':"""},symbols:u,draw:q});z.registerRendererType("svg",C,!0);"";return C});M(a,"Core/Renderer/HTML/HTMLElement.js", +[a["Core/Globals.js"],a["Core/Renderer/SVG/SVGElement.js"],a["Core/Utilities.js"]],function(a,w,C){var r=this&&this.__extends||function(){var c=function(a,e){c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,a){c.__proto__=a}||function(c,a){for(var e in a)a.hasOwnProperty(e)&&(c[e]=a[e])};return c(a,e)};return function(a,e){function f(){this.constructor=a}c(a,e);a.prototype=null===e?Object.create(e):(f.prototype=e.prototype,new f)}}(),z=a.isFirefox,x=a.isMS,J=a.isWebKit,u=a.win, +n=C.css,m=C.defined,g=C.extend,c=C.pick,e=C.pInt;return function(a){function f(){return null!==a&&a.apply(this,arguments)||this}r(f,a);f.compose=function(c){if(-1===f.composedClasses.indexOf(c)){f.composedClasses.push(c);var a=f.prototype,e=c.prototype;e.getSpanCorrection=a.getSpanCorrection;e.htmlCss=a.htmlCss;e.htmlGetBBox=a.htmlGetBBox;e.htmlUpdateTransform=a.htmlUpdateTransform;e.setSpanRotation=a.setSpanRotation}return c};f.prototype.getSpanCorrection=function(c,a,e){this.xCorr=-c*e;this.yCorr= +-a};f.prototype.htmlCss=function(a){var e="SPAN"===this.element.tagName&&a&&"width"in a,f=c(e&&a.width,void 0);if(e){delete a.width;this.textWidth=f;var l=!0}a&&"ellipsis"===a.textOverflow&&(a.whiteSpace="nowrap",a.overflow="hidden");this.styles=g(this.styles,a);n(this.element,a);l&&this.htmlUpdateTransform();return this};f.prototype.htmlGetBBox=function(){var c=this.element;return{x:c.offsetLeft,y:c.offsetTop,width:c.offsetWidth,height:c.offsetHeight}};f.prototype.htmlUpdateTransform=function(){if(this.added){var c= +this.renderer,a=this.element,f=this.translateX||0,g=this.translateY||0,l=this.x||0,B=this.y||0,r=this.textAlign||"left",t={left:0,center:.5,right:1}[r],h=this.styles;h=h&&h.whiteSpace;n(a,{marginLeft:f,marginTop:g});!c.styledMode&&this.shadows&&this.shadows.forEach(function(b){n(b,{marginLeft:f+1,marginTop:g+1})});this.inverted&&[].forEach.call(a.childNodes,function(b){c.invertChild(b,a)});if("SPAN"===a.tagName){var d=this.rotation,b=this.textWidth&&e(this.textWidth),p=[d,r,a.innerHTML,this.textWidth, +this.textAlign].join(),G=void 0;(G=b!==this.oldTextWidth)&&!(G=b>this.oldTextWidth)&&((G=this.textPxLength)||(n(a,{width:"",whiteSpace:h||"nowrap"}),G=a.offsetWidth),G=G>b);G&&(/[ \-]/.test(a.textContent||a.innerText)||"ellipsis"===a.style.textOverflow)?(n(a,{width:b+"px",display:"block",whiteSpace:h||"normal"}),this.oldTextWidth=b,this.hasBoxWidthChanged=!0):this.hasBoxWidthChanged=!1;p!==this.cTT&&(G=c.fontMetrics(a.style.fontSize,a).b,!m(d)||d===(this.oldRotation||0)&&r===this.oldAlign||this.setSpanRotation(d, +t,G),this.getSpanCorrection(!m(d)&&this.textPxLength||a.offsetWidth,G,t,d,r));n(a,{left:l+(this.xCorr||0)+"px",top:B+(this.yCorr||0)+"px"});this.cTT=p;this.oldRotation=d;this.oldAlign=r}}else this.alignOnAdd=!0};f.prototype.setSpanRotation=function(c,a,e){var f={},g=x&&!/Edge/.test(u.navigator.userAgent)?"-ms-transform":J?"-webkit-transform":z?"MozTransform":u.opera?"-o-transform":void 0;g&&(f[g]=f.transform="rotate("+c+"deg)",f[g+(z?"Origin":"-origin")]=f.transformOrigin=100*a+"% "+e+"px",n(this.element, +f))};f.composedClasses=[];return f}(w)});M(a,"Core/Renderer/HTML/HTMLRenderer.js",[a["Core/Renderer/HTML/AST.js"],a["Core/Renderer/SVG/SVGElement.js"],a["Core/Renderer/SVG/SVGRenderer.js"],a["Core/Utilities.js"]],function(a,w,C,E){var r=this&&this.__extends||function(){var a=function(g,c){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var e in c)c.hasOwnProperty(e)&&(a[e]=c[e])};return a(g,c)};return function(g,c){function e(){this.constructor= +g}a(g,c);g.prototype=null===c?Object.create(c):(e.prototype=c.prototype,new e)}}(),x=E.attr,J=E.createElement,u=E.extend,n=E.pick;return function(m){function g(){return null!==m&&m.apply(this,arguments)||this}r(g,m);g.compose=function(c){-1===g.composedClasses.indexOf(c)&&(g.composedClasses.push(c),c.prototype.html=g.prototype.html);return c};g.prototype.html=function(c,e,g){var f=this.createElement("span"),l=f.element,q=f.renderer,k=q.isSVG,m=function(c,a){["opacity","visibility"].forEach(function(e){c[e+ +"Setter"]=function(f,h,d){var b=c.div?c.div.style:a;w.prototype[e+"Setter"].call(this,f,h,d);b&&(b[h]=f)}});c.addedSetters=!0};f.textSetter=function(c){c!==this.textStr&&(delete this.bBox,delete this.oldTextWidth,a.setElementHTML(this.element,n(c,"")),this.textStr=c,f.doTransform=!0)};k&&m(f,f.element.style);f.xSetter=f.ySetter=f.alignSetter=f.rotationSetter=function(c,a){"align"===a?f.alignValue=f.textAlign=c:f[a]=c;f.doTransform=!0};f.afterSetters=function(){this.doTransform&&(this.htmlUpdateTransform(), +this.doTransform=!1)};f.attr({text:c,x:Math.round(e),y:Math.round(g)}).css({position:"absolute"});q.styledMode||f.css({fontFamily:this.style.fontFamily,fontSize:this.style.fontSize});l.style.whiteSpace="nowrap";f.css=f.htmlCss;k&&(f.add=function(c){var a=q.box.parentNode,e=[];if(this.parentGroup=c){var g=c.div;if(!g){for(;c;)e.push(c),c=c.parentGroup;e.reverse().forEach(function(c){function d(b,d){c[d]=b;"translateX"===d?k.left=b+"px":k.top=b+"px";c.doTransform=!0}var b=x(c.element,"class"),h=c.styles|| +{};g=c.div=c.div||J("div",b?{className:b}:void 0,{position:"absolute",left:(c.translateX||0)+"px",top:(c.translateY||0)+"px",display:c.display,opacity:c.opacity,cursor:h.cursor,pointerEvents:h.pointerEvents,visibility:c.visibility},g||a);var k=g.style;u(c,{classSetter:function(b){return function(d){this.element.setAttribute("class",d);b.className=d}}(g),on:function(){e[0].div&&f.on.apply({element:e[0].div,onEvents:c.onEvents},arguments);return c},translateXSetter:d,translateYSetter:d});c.addedSetters|| +m(c)})}}else g=a;g.appendChild(l);f.added=!0;f.alignOnAdd&&f.htmlUpdateTransform();return f});return f};g.composedClasses=[];return g}(C)});M(a,"Core/Axis/AxisDefaults.js",[a["Core/Color/Palette.js"]],function(a){var r;(function(r){r.defaultXAxisOptions={alignTicks:!0,allowDecimals:void 0,panningEnabled:!0,zIndex:2,zoomEnabled:!0,dateTimeLabelFormats:{millisecond:{main:"%H:%M:%S.%L",range:!1},second:{main:"%H:%M:%S",range:!1},minute:{main:"%H:%M",range:!1},hour:{main:"%H:%M",range:!1},day:{main:"%e. %b"}, +week:{main:"%e. %b"},month:{main:"%b '%y"},year:{main:"%Y"}},endOnTick:!1,gridLineDashStyle:"Solid",gridZIndex:1,labels:{autoRotation:void 0,autoRotationLimit:80,distance:void 0,enabled:!0,indentation:10,overflow:"justify",padding:5,reserveSpace:void 0,rotation:void 0,staggerLines:0,step:0,useHTML:!1,x:0,zIndex:7,style:{color:a.neutralColor60,cursor:"default",fontSize:"11px"}},maxPadding:.01,minorGridLineDashStyle:"Solid",minorTickLength:2,minorTickPosition:"outside",minPadding:.01,offset:void 0, +opposite:!1,reversed:void 0,reversedStacks:!1,showEmpty:!0,showFirstLabel:!0,showLastLabel:!0,startOfWeek:1,startOnTick:!1,tickLength:10,tickPixelInterval:100,tickmarkPlacement:"between",tickPosition:"outside",title:{align:"middle",rotation:0,useHTML:!1,x:0,y:0,style:{color:a.neutralColor60}},type:"linear",uniqueNames:!0,visible:!0,minorGridLineColor:a.neutralColor5,minorGridLineWidth:1,minorTickColor:a.neutralColor40,lineColor:a.highlightColor20,lineWidth:1,gridLineColor:a.neutralColor10,gridLineWidth:void 0, +tickColor:a.highlightColor20};r.defaultYAxisOptions={reversedStacks:!0,endOnTick:!0,maxPadding:.05,minPadding:.05,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8},startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{animation:{},allowOverlap:!1,enabled:!1,crop:!0,overflow:"justify",formatter:function(){var a=this.axis.chart.numberFormatter;return a(this.total,-1)},style:{color:a.neutralColor100,fontSize:"11px",fontWeight:"bold",textOutline:"1px contrast"}},gridLineWidth:1,lineWidth:0}; +r.defaultLeftAxisOptions={labels:{x:-15},title:{rotation:270}};r.defaultRightAxisOptions={labels:{x:15},title:{rotation:90}};r.defaultBottomAxisOptions={labels:{autoRotation:[-45],x:0},margin:15,title:{rotation:0}};r.defaultTopAxisOptions={labels:{autoRotation:[-45],x:0},margin:15,title:{rotation:0}}})(r||(r={}));return r});M(a,"Core/Foundation.js",[a["Core/Utilities.js"]],function(a){var r=a.addEvent,C=a.isFunction,E=a.objectEach,z=a.removeEvent;return{registerEventOptions:function(a,w){a.eventOptions= +a.eventOptions||{};E(w.events,function(u,n){a.eventOptions[n]!==u&&(a.eventOptions[n]&&(z(a,n,a.eventOptions[n]),delete a.eventOptions[n]),C(u)&&(a.eventOptions[n]=u,r(a,n,u)))})}}});M(a,"Core/Axis/Tick.js",[a["Core/FormatUtilities.js"],a["Core/Globals.js"],a["Core/Utilities.js"]],function(a,w,C){var r=w.deg2rad,z=C.clamp,x=C.correctFloat,J=C.defined,u=C.destroyObjectProperties,n=C.extend,m=C.fireEvent,g=C.isNumber,c=C.merge,e=C.objectEach,l=C.pick;w=function(){function f(c,a,e,f,g){this.isNewLabel= +this.isNew=!0;this.axis=c;this.pos=a;this.type=e||"";this.parameters=g||{};this.tickmarkOffset=this.parameters.tickmarkOffset;this.options=this.parameters.options;m(this,"init");e||f||this.addLabel()}f.prototype.addLabel=function(){var c=this,e=c.axis,f=e.options,I=e.chart,D=e.categories,B=e.logarithmic,r=e.names,t=c.pos,h=l(c.options&&c.options.labels,f.labels),d=e.tickPositions,b=t===d[0],p=t===d[d.length-1],G=(!h.step||1===h.step)&&1===e.tickInterval;d=d.info;var y=c.label,L;D=this.parameters.category|| +(D?l(D[t],r[t],t):t);B&&g(D)&&(D=x(B.lin2log(D)));if(e.dateTime)if(d){var F=I.time.resolveDTLFormat(f.dateTimeLabelFormats[!f.grid&&d.higherRanks[t]||d.unitName]);var P=F.main}else g(D)&&(P=e.dateTime.getXDateFormat(D,f.dateTimeLabelFormats||{}));c.isFirst=b;c.isLast=p;var S={axis:e,chart:I,dateTimeLabelFormat:P,isFirst:b,isLast:p,pos:t,tick:c,tickPositionInfo:d,value:D};m(this,"labelFormat",S);var Q=function(b){return h.formatter?h.formatter.call(b,b):h.format?(b.text=e.defaultLabelFormatter.call(b), +a.format(h.format,b,I)):e.defaultLabelFormatter.call(b,b)};f=Q.call(S,S);var u=F&&F.list;c.shortenLabel=u?function(){for(L=0;Lh&&f-d*bm&&(F=Math.round((g-f)/Math.cos(h* +r)));else if(g=f+(1-d)*b,f-d*bm&&(y=m-c.x+y*d,L=-1),y=Math.min(p,y),yy||a.autoRotation&&(t.styles||{}).width)F=y;F&&(this.shortenLabel?this.shortenLabel():(G.width=Math.floor(F)+"px",(e.style||{}).textOverflow||(G.textOverflow="ellipsis"),t.css(G)))};f.prototype.moveLabel=function(c,a){var f=this,g=f.label,l=f.axis,m=l.reversed,q=!1;g&&g.textStr===c?(f.movedLabel=g,q=!0,delete f.label):e(l.ticks,function(a){q|| +a.isNew||a===f||!a.label||a.label.textStr!==c||(f.movedLabel=a.label,q=!0,a.labelPos=f.movedLabel.xy,delete a.label)});if(!q&&(f.labelPos||g)){var t=f.labelPos||g.xy;g=l.horiz?m?0:l.width+l.left:t.x;l=l.horiz?t.y:m?l.width+l.left:0;f.movedLabel=f.createLabel({x:g,y:l},c,a);f.movedLabel&&f.movedLabel.attr({opacity:0})}};f.prototype.render=function(a,c,e){var f=this.axis,g=f.horiz,k=this.pos,q=l(this.tickmarkOffset,f.tickmarkOffset);k=this.getPosition(g,k,q,c);q=k.x;var t=k.y;f=g&&q===f.pos+f.len|| +!g&&t===f.pos?-1:1;g=l(e,this.label&&this.label.newOpacity,1);e=l(e,1);this.isActive=!0;this.renderGridLine(c,e,f);this.renderMark(k,e,f);this.renderLabel(k,c,g,a);this.isNew=!1;m(this,"afterRender")};f.prototype.renderGridLine=function(c,a,e){var f=this.axis,g=f.options,k={},m=this.pos,t=this.type,h=l(this.tickmarkOffset,f.tickmarkOffset),d=f.chart.renderer,b=this.gridLine,p=g.gridLineWidth,G=g.gridLineColor,y=g.gridLineDashStyle;"minor"===this.type&&(p=g.minorGridLineWidth,G=g.minorGridLineColor, +y=g.minorGridLineDashStyle);b||(f.chart.styledMode||(k.stroke=G,k["stroke-width"]=p||0,k.dashstyle=y),t||(k.zIndex=1),c&&(a=0),this.gridLine=b=d.path().attr(k).addClass("highcharts-"+(t?t+"-":"")+"grid-line").add(f.gridGroup));if(b&&(e=f.getPlotLinePath({value:m+h,lineWidth:b.strokeWidth()*e,force:"pass",old:c})))b[c||this.isNew?"attr":"animate"]({d:e,opacity:a})};f.prototype.renderMark=function(c,a,e){var f=this.axis,g=f.options,k=f.chart.renderer,m=this.type,t=f.tickSize(m?m+"Tick":"tick"),h=c.x; +c=c.y;var d=l(g["minor"!==m?"tickWidth":"minorTickWidth"],!m&&f.isXAxis?1:0);g=g["minor"!==m?"tickColor":"minorTickColor"];var b=this.mark,p=!b;t&&(f.opposite&&(t[0]=-t[0]),b||(this.mark=b=k.path().addClass("highcharts-"+(m?m+"-":"")+"tick").add(f.axisGroup),f.chart.styledMode||b.attr({stroke:g,"stroke-width":d})),b[p?"attr":"animate"]({d:this.getMarkPath(h,c,t[0],b.strokeWidth()*e,f.horiz,k),opacity:a}))};f.prototype.renderLabel=function(c,a,e,f){var k=this.axis,m=k.horiz,q=k.options,t=this.label, +h=q.labels,d=h.step;k=l(this.tickmarkOffset,k.tickmarkOffset);var b=c.x;c=c.y;var p=!0;t&&g(b)&&(t.xy=c=this.getLabelPosition(b,c,t,m,h,k,f,d),this.isFirst&&!this.isLast&&!q.showFirstLabel||this.isLast&&!this.isFirst&&!q.showLastLabel?p=!1:!m||h.step||h.rotation||a||0===e||this.handleOverflow(c),d&&f%d&&(p=!1),p&&g(c.y)?(c.opacity=e,t[this.isNewLabel?"attr":"animate"](c),this.isNewLabel=!1):(t.attr("y",-9999),this.isNewLabel=!0))};f.prototype.replaceMovedLabel=function(){var c=this.label,a=this.axis, +e=a.reversed;if(c&&!this.isNew){var f=a.horiz?e?a.left:a.width+a.left:c.xy.x;e=a.horiz?c.xy.y:e?a.width+a.top:a.top;c.animate({x:f,y:e,opacity:0},void 0,c.destroy);delete this.label}a.isDirty=!0;this.label=this.movedLabel;delete this.movedLabel};return f}();"";return w});M(a,"Core/Axis/Axis.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/Axis/AxisDefaults.js"],a["Core/Color/Color.js"],a["Core/Color/Palette.js"],a["Core/DefaultOptions.js"],a["Core/Foundation.js"],a["Core/Globals.js"],a["Core/Axis/Tick.js"], +a["Core/Utilities.js"]],function(a,w,C,E,z,x,J,u,n){var m=a.animObject,g=z.defaultOptions,c=x.registerEventOptions,e=J.deg2rad,l=n.arrayMax,f=n.arrayMin,v=n.clamp,q=n.correctFloat,k=n.defined,r=n.destroyObjectProperties,D=n.erase,B=n.error,O=n.extend,t=n.fireEvent,h=n.getMagnitude,d=n.isArray,b=n.isNumber,p=n.isString,G=n.merge,y=n.normalizeTickInterval,L=n.objectEach,F=n.pick,P=n.relativeLength,S=n.removeEvent,Q=n.splat,V=n.syncTimeout;a=function(){function a(b,a){this.zoomEnabled=this.width=this.visible= +this.userOptions=this.translationSlope=this.transB=this.transA=this.top=this.ticks=this.tickRotCorr=this.tickPositions=this.tickmarkOffset=this.tickInterval=this.tickAmount=this.side=this.series=this.right=this.positiveValuesOnly=this.pos=this.pointRangePadding=this.pointRange=this.plotLinesAndBandsGroups=this.plotLinesAndBands=this.paddedTicks=this.overlap=this.options=this.offset=this.names=this.minPixelPadding=this.minorTicks=this.minorTickInterval=this.min=this.maxLabelLength=this.max=this.len= +this.left=this.labelFormatter=this.labelEdge=this.isLinked=this.height=this.hasVisibleSeries=this.hasNames=this.eventOptions=this.coll=this.closestPointRange=this.chart=this.categories=this.bottom=this.alternateBands=void 0;this.init(b,a)}a.prototype.init=function(a,d){var h=d.isX;this.chart=a;this.horiz=a.inverted&&!this.isZAxis?!h:h;this.isXAxis=h;this.coll=this.coll||(h?"xAxis":"yAxis");t(this,"init",{userOptions:d});this.opposite=F(d.opposite,this.opposite);this.side=F(d.side,this.side,this.horiz? +this.opposite?0:2:this.opposite?1:3);this.setOptions(d);var e=this.options,f=e.labels,p=e.type;this.userOptions=d;this.minPixelPadding=0;this.reversed=F(e.reversed,this.reversed);this.visible=e.visible;this.zoomEnabled=e.zoomEnabled;this.hasNames="category"===p||!0===e.categories;this.categories=e.categories||this.hasNames;this.names||(this.names=[],this.names.keys={});this.plotLinesAndBandsGroups={};this.positiveValuesOnly=!!this.logarithmic;this.isLinked=k(e.linkedTo);this.ticks={};this.labelEdge= +[];this.minorTicks={};this.plotLinesAndBands=[];this.alternateBands={};this.len=0;this.minRange=this.userMinRange=e.minRange||e.maxZoom;this.range=e.range;this.offset=e.offset||0;this.min=this.max=null;d=F(e.crosshair,Q(a.options.tooltip.crosshairs)[h?0:1]);this.crosshair=!0===d?{}:d;-1===a.axes.indexOf(this)&&(h?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),a[this.coll].push(this));this.series=this.series||[];a.inverted&&!this.isZAxis&&h&&"undefined"===typeof this.reversed&&(this.reversed= +!0);this.labelRotation=b(f.rotation)?f.rotation:void 0;c(this,e);t(this,"afterInit")};a.prototype.setOptions=function(b){this.options=G(w.defaultXAxisOptions,"yAxis"===this.coll&&w.defaultYAxisOptions,[w.defaultTopAxisOptions,w.defaultRightAxisOptions,w.defaultBottomAxisOptions,w.defaultLeftAxisOptions][this.side],G(g[this.coll],b));t(this,"afterSetOptions",{userOptions:b})};a.prototype.defaultLabelFormatter=function(a){var d=this.axis;a=this.chart.numberFormatter;var c=b(this.value)?this.value:NaN, +e=d.chart.time,h=this.dateTimeLabelFormat,f=g.lang,p=f.numericSymbols;f=f.numericSymbolMagnitude||1E3;var H=d.logarithmic?Math.abs(c):d.tickInterval,y=p&&p.length;if(d.categories)var k=""+this.value;else if(h)k=e.dateFormat(h,c);else if(y&&1E3<=H)for(;y--&&"undefined"===typeof k;)d=Math.pow(f,y+1),H>=d&&0===10*c%d&&null!==p[y]&&0!==c&&(k=a(c/d,-1)+p[y]);"undefined"===typeof k&&(k=1E4<=Math.abs(c)?a(c,-1):a(c,-1,void 0,""));return k};a.prototype.getSeriesExtremes=function(){var a=this,d=a.chart,c; +t(this,"getSeriesExtremes",null,function(){a.hasVisibleSeries=!1;a.dataMin=a.dataMax=a.threshold=null;a.softThreshold=!a.isXAxis;a.stacking&&a.stacking.buildStacks();a.series.forEach(function(e){if(e.visible||!d.options.chart.ignoreHiddenSeries){var h=e.options,f=h.threshold;a.hasVisibleSeries=!0;a.positiveValuesOnly&&0>=f&&(f=null);if(a.isXAxis){if(h=e.xData,h.length){h=a.logarithmic?h.filter(a.validatePositiveValue):h;c=e.getXExtremes(h);var p=c.min;var g=c.max;b(p)||p instanceof Date||(h=h.filter(b), +c=e.getXExtremes(h),p=c.min,g=c.max);h.length&&(a.dataMin=Math.min(F(a.dataMin,p),p),a.dataMax=Math.max(F(a.dataMax,g),g))}}else if(e=e.applyExtremes(),b(e.dataMin)&&(p=e.dataMin,a.dataMin=Math.min(F(a.dataMin,p),p)),b(e.dataMax)&&(g=e.dataMax,a.dataMax=Math.max(F(a.dataMax,g),g)),k(f)&&(a.threshold=f),!h.softThreshold||a.positiveValuesOnly)a.softThreshold=!1}})});t(this,"afterGetSeriesExtremes")};a.prototype.translate=function(a,d,c,e,h,f){var p=this.linkedParent||this,g=e&&p.old?p.old.min:p.min, +H=p.minPixelPadding;h=(p.isOrdinal||p.brokenAxis&&p.brokenAxis.hasBreaks||p.logarithmic&&h)&&p.lin2val;var K=1,y=0;e=e&&p.old?p.old.transA:p.transA;e||(e=p.transA);c&&(K*=-1,y=p.len);p.reversed&&(K*=-1,y-=K*(p.sector||p.len));d?(a=(a*K+y-H)/e+g,h&&(a=p.lin2val(a))):(h&&(a=p.val2lin(a)),a=b(g)?K*(a-g)*e+y+K*H+(b(f)?e*f:0):void 0);return a};a.prototype.toPixels=function(b,a){return this.translate(b,!1,!this.horiz,null,!0)+(a?0:this.pos)};a.prototype.toValue=function(b,a){return this.translate(b-(a? +0:this.pos),!0,!this.horiz,null,!0)};a.prototype.getPlotLinePath=function(a){function d(b,a,d){if("pass"!==m&&bd)m?b=v(b,a,d):r=!0;return b}var c=this,e=c.chart,h=c.left,f=c.top,p=a.old,g=a.value,H=a.lineWidth,y=p&&e.oldChartHeight||e.chartHeight,k=p&&e.oldChartWidth||e.chartWidth,G=c.transB,l=a.translatedValue,m=a.force,L,q,n,B,r;a={value:g,lineWidth:H,old:p,force:m,acrossPanes:a.acrossPanes,translatedValue:l};t(this,"getPlotLinePath",a,function(a){l=F(l,c.translate(g,null,null,p));l=v(l,-1E5, +1E5);L=n=Math.round(l+G);q=B=Math.round(y-l-G);b(l)?c.horiz?(q=f,B=y-c.bottom,L=n=d(L,h,h+c.width)):(L=h,n=k-c.right,q=B=d(q,f,f+c.height)):(r=!0,m=!1);a.path=r&&!m?null:e.renderer.crispLine([["M",L,q],["L",n,B]],H||1)});return a.path};a.prototype.getLinearTickPositions=function(b,a,d){var c=q(Math.floor(a/b)*b);d=q(Math.ceil(d/b)*b);var e=[],h;q(c+b)===c&&(h=20);if(this.single)return[a];for(a=c;a<=d;){e.push(a);a=q(a+b,h);if(a===f)break;var f=a}return e};a.prototype.getMinorTickInterval=function(){var b= +this.options;return!0===b.minorTicks?F(b.minorTickInterval,"auto"):!1===b.minorTicks?null:b.minorTickInterval};a.prototype.getMinorTickPositions=function(){var b=this.options,a=this.tickPositions,d=this.minorTickInterval,c=this.pointRangePadding||0,e=this.min-c;c=this.max+c;var h=c-e,f=[];if(h&&h/d=this.minRange;var t=this.minRange;var m=(t-c+d)/2;m=[d-m,F(b.min,d-m)];G&&(m[2]=this.logarithmic?this.logarithmic.log2lin(this.dataMin):this.dataMin);d=l(m);c=[d+t,F(b.max,d+t)];G&&(c[2]=a?a.log2lin(this.dataMax):this.dataMax);c=f(c);c-d=v)D=v,L=0;else if(d.dataMax<=v){var I=v;m=0}d.min=F(r,D,d.dataMin);d.max=F(P,I,d.dataMax)}e&&(d.positiveValuesOnly&&!a&&0>=Math.min(d.min,F(d.dataMin,d.min))&&B(10,1,c),d.min= +q(e.log2lin(d.min),16),d.max=q(e.log2lin(d.max),16));d.range&&k(d.max)&&(d.userMin=d.min=r=Math.max(d.dataMin,d.minFromRange()),d.userMax=P=d.max,d.range=null);t(d,"foundExtremes");d.beforePadding&&d.beforePadding();d.adjustForMinRange();!(G||d.axisPointRange||d.stacking&&d.stacking.usePercentage||g)&&k(d.min)&&k(d.max)&&(c=d.max-d.min)&&(!k(r)&&L&&(d.min-=c*L),!k(P)&&m&&(d.max+=c*m));b(d.userMin)||(b(f.softMin)&&f.softMind.max&&(d.max=P=f.softMax),b(f.ceiling)&&(d.max=Math.min(d.max,f.ceiling)));H&&k(d.dataMin)&&(v=v||0,!k(r)&&d.min=v?d.min=d.options.minRange?Math.min(v,d.max-d.minRange):v:!k(P)&&d.max>v&&d.dataMax<=v&&(d.max=d.options.minRange?Math.max(v,d.min+d.minRange):v));b(d.min)&&b(d.max)&&!this.chart.polar&&d.min>d.max&&(k(d.options.min)?d.max=d.min:k(d.options.max)&&(d.min=d.max));d.tickInterval=d.min===d.max||"undefined"===typeof d.min||"undefined"===typeof d.max?1: +g&&d.linkedParent&&!n&&l===d.linkedParent.options.tickPixelInterval?n=d.linkedParent.tickInterval:F(n,this.tickAmount?(d.max-d.min)/Math.max(this.tickAmount-1,1):void 0,G?1:(d.max-d.min)*l/Math.max(d.len,l));p&&!a&&(d.series.forEach(function(b){b.forceCrop=b.forceCropping&&b.forceCropping();b.processData(d.min!==(d.old&&d.old.min)||d.max!==(d.old&&d.old.max))}),t(this,"postProcessData"));d.setAxisTranslation();t(this,"initialAxisTranslation");d.pointRange&&!n&&(d.tickInterval=Math.max(d.pointRange, +d.tickInterval));a=F(f.minTickInterval,d.dateTime&&!d.series.some(function(b){return b.noSharedTooltip})?d.closestPointRange:0);!n&&d.tickIntervald.tickInterval||void 0!==this.tickAmount),!!this.tickAmount));this.tickAmount||(d.tickInterval=d.unsquish());this.setTickPositions()};a.prototype.setTickPositions=function(){var b=this.options,d=b.tickPositions,a=this.getMinorTickInterval(), +c=this.hasVerticalPanning(),e="colorAxis"===this.coll,h=(e||!c)&&b.startOnTick;c=(e||!c)&&b.endOnTick;e=b.tickPositioner;this.tickmarkOffset=this.categories&&"between"===b.tickmarkPlacement&&1===this.tickInterval?.5:0;this.minorTickInterval="auto"===a&&this.tickInterval?this.tickInterval/5:a;this.single=this.min===this.max&&k(this.min)&&!this.tickAmount&&(parseInt(this.min,10)===this.min||!1!==b.allowDecimals);this.tickPositions=a=d&&d.slice();!a&&(this.ordinal&&this.ordinal.positions||!((this.max- +this.min)/this.tickInterval>Math.max(2*this.len,200))?a=this.dateTime?this.getTimeTicks(this.dateTime.normalizeTimeTickInterval(this.tickInterval,b.units),this.min,this.max,b.startOfWeek,this.ordinal&&this.ordinal.positions,this.closestPointRange,!0):this.logarithmic?this.logarithmic.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max):(a=[this.min,this.max],B(19,!1,this.chart)),a.length>this.len&&(a=[a[0],a.pop()],a[0]===a[1]&& +(a.length=1)),this.tickPositions=a,e&&(e=e.apply(this,[this.min,this.max])))&&(this.tickPositions=a=e);this.paddedTicks=a.slice(0);this.trimTicks(a,h,c);this.isLinked||(this.single&&2>a.length&&!this.categories&&!this.series.some(function(b){return b.is("heatmap")&&"between"===b.options.pointPlacement})&&(this.min-=.5,this.max+=.5),d||e||this.adjustTickAmount());t(this,"afterSetTickPositions")};a.prototype.trimTicks=function(b,d,a){var c=b[0],e=b[b.length-1],h=!this.isOrdinal&&this.minPointOffset|| +0;t(this,"trimTicks");if(!this.isLinked){if(d&&-Infinity!==c)this.min=c;else for(;this.min-h>b[0];)b.shift();if(a)this.max=e;else for(;this.max+ha&&(this.finalTickAmt=a,a=5);this.tickAmount=a};a.prototype.adjustTickAmount=function(){var d=this.options,a=this.tickInterval,c=this.tickPositions,e=this.tickAmount,h=this.finalTickAmt, +f=c&&c.length,p=F(this.threshold,this.softThreshold?0:null);if(this.hasData()&&b(this.min)&&b(this.max)){if(fe&&(this.tickInterval*=2,this.setTickPositions());if(k(h)){for(a=d=c.length;a--;)(3===h&&1===a%2||2>=h&&0p&&(d=p)),k(e)&&(hp&&(h=p))),a.displayBtn="undefined"!==typeof d||"undefined"!==typeof h,a.setExtremes(d,h,!1,void 0,{trigger:"zoom"});b.zoomed=!0});return b.zoomed};a.prototype.setAxisSize=function(){var b=this.chart,d=this.options,a=d.offsets||[0,0,0,0],c=this.horiz,e=this.width=Math.round(P(F(d.width, +b.plotWidth-a[3]+a[1]),b.plotWidth)),h=this.height=Math.round(P(F(d.height,b.plotHeight-a[0]+a[2]),b.plotHeight)),f=this.top=Math.round(P(F(d.top,b.plotTop+a[0]),b.plotHeight,b.plotTop));d=this.left=Math.round(P(F(d.left,b.plotLeft+a[3]),b.plotWidth,b.plotLeft));this.bottom=b.chartHeight-h-f;this.right=b.chartWidth-e-d;this.len=Math.max(c?e:h,0);this.pos=c?d:f};a.prototype.getExtremes=function(){var b=this.logarithmic;return{min:b?q(b.lin2log(this.min)):this.min,max:b?q(b.lin2log(this.max)):this.max, +dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}};a.prototype.getThreshold=function(b){var d=this.logarithmic,a=d?d.lin2log(this.min):this.min;d=d?d.lin2log(this.max):this.max;null===b||-Infinity===b?b=a:Infinity===b?b=d:a>b?b=a:dd?b.align="right":195d&&(b.align="left")}); +return b.align};a.prototype.tickSize=function(b){var d=this.options,a=F(d["tick"===b?"tickWidth":"minorTickWidth"],"tick"===b&&this.isXAxis&&!this.categories?1:0),c=d["tick"===b?"tickLength":"minorTickLength"];if(a&&c){"inside"===d[b+"Position"]&&(c=-c);var e=[c,a]}b={tickSize:e};t(this,"afterTickSize",b);return b.tickSize};a.prototype.labelMetrics=function(){var b=this.tickPositions&&this.tickPositions[0]||0;return this.chart.renderer.fontMetrics(this.options.labels.style.fontSize,this.ticks[b]&& +this.ticks[b].label)};a.prototype.unsquish=function(){var d=this.options.labels,a=this.horiz,c=this.tickInterval,h=this.len/(((this.categories?1:0)+this.max-this.min)/c),f=d.rotation,p=this.labelMetrics(),g=Math.max(this.max-this.min,0),y=function(b){var d=b/(h||1);d=1g&&Infinity!==b&&Infinity!==h&&g&&(d=Math.ceil(g/c));return q(d*c)},k=c,l,G,t=Number.MAX_VALUE;if(a){if(!d.staggerLines&&!d.step)if(b(f))var m=[f];else h=b){G=y(Math.abs(p.h/Math.sin(e*b)));var d=G+Math.abs(b/360);de.step)return e.rotation?0:(this.staggerLines||1)*this.len/h;if(!c){d=e.style.width;if(void 0!==d)return parseInt(String(d), +10);if(f)return f-a.spacing[3]}return.33*a.chartWidth};a.prototype.renderUnsquish=function(){var b=this.chart,d=b.renderer,a=this.tickPositions,c=this.ticks,e=this.options.labels,h=e.style,f=this.horiz,g=this.getSlotWidth(),y=Math.max(1,Math.round(g-2*e.padding)),k={},G=this.labelMetrics(),l=h.textOverflow,t=0;p(e.rotation)||(k.rotation=e.rotation||0);a.forEach(function(b){b=c[b];b.movedLabel&&b.replaceMovedLabel();b&&b.label&&b.label.textPxLength>t&&(t=b.label.textPxLength)});this.maxLabelLength= +t;if(this.autoRotation)t>y&&t>G.h?k.rotation=this.labelRotation:this.labelRotation=0;else if(g){var m=y;if(!l){var F="clip";for(y=a.length;!f&&y--;){var L=a[y];if(L=c[L].label)L.styles&&"ellipsis"===L.styles.textOverflow?L.css({textOverflow:"clip"}):L.textPxLength>g&&L.css({width:g+"px"}),L.getBBox().height>this.len/a.length-(G.h-G.f)&&(L.specificTextOverflow="ellipsis")}}}k.rotation&&(m=t>.5*b.chartHeight?.33*b.chartHeight:t,l||(F="ellipsis"));if(this.labelAlign=e.align||this.autoLabelAlign(this.labelRotation))k.align= +this.labelAlign;a.forEach(function(b){var d=(b=c[b])&&b.label,a=h.width,e={};d&&(d.attr(k),b.shortenLabel?b.shortenLabel():m&&!a&&"nowrap"!==h.whiteSpace&&(m=this.min&&b<=this.max||this.grid&&this.grid.isColumn)c[b]||(c[b]=new u(this,b)),a&&c[b].isNew&&c[b].render(d,!0,-1),c[b].render(d)};a.prototype.render=function(){var d=this, +a=d.chart,c=d.logarithmic,e=d.options,h=d.isLinked,f=d.tickPositions,p=d.axisTitle,g=d.ticks,y=d.minorTicks,k=d.alternateBands,G=e.stackLabels,l=e.alternateGridColor,F=d.tickmarkOffset,q=d.axisLine,v=d.showAxis,n=m(a.renderer.globalAnimation),B,r;d.labelEdge.length=0;d.overlap=!1;[g,y,k].forEach(function(b){L(b,function(b){b.isActive=!1})});if(d.hasData()||h){var P=d.chart.hasRendered&&d.old&&b(d.old.min);d.minorTickInterval&&!d.categories&&d.getMinorTickPositions().forEach(function(b){d.renderMinorTick(b, +P)});f.length&&(f.forEach(function(b,a){d.renderTick(b,a,P)}),F&&(0===d.min||d.single)&&(g[-1]||(g[-1]=new u(d,-1,null,!0)),g[-1].render(-1)));l&&f.forEach(function(b,e){r="undefined"!==typeof f[e+1]?f[e+1]+F:d.max-F;0===e%2&&bc&&(!g||l<=f)&&"undefined"!==typeof l&&m.push(l);l>f&&(t=!0);l=d}}}else c=this.lin2log(c),f=this.lin2log(f),a=g?e.getMinorTickInterval():l.tickInterval,a=z("auto"===a?null:a,this.minorAutoInterval,l.tickPixelInterval/(g?5:1)*(f-c)/((g?k/e.tickPositions.length: +k)||1)),a=E(a,void 0,C(a)),m=e.getLinearTickPositions(a,c,f).map(this.log2lin),g||(this.minorAutoInterval=a/5);g||(e.tickInterval=a);return m};a.prototype.lin2log=function(a){return Math.pow(10,a)};a.prototype.log2lin=function(a){return Math.log(a)/Math.LN10};return a}();a.Additions=g})(x||(x={}));return x});M(a,"Core/Axis/PlotLineOrBand/PlotLineOrBandAxis.js",[a["Core/Utilities.js"]],function(a){var r=a.erase,C=a.extend,E=a.isNumber,z;(function(a){var x=[],u;a.compose=function(a,g){u||(u=a);-1=== +x.indexOf(g)&&(x.push(g),C(g.prototype,n.prototype));return g};var n=function(){function a(){}a.prototype.getPlotBandPath=function(a,c,e){void 0===e&&(e=this.options);var g=this.getPlotLinePath({value:c,force:!0,acrossPanes:e.acrossPanes}),f=[],m=this.horiz;c=!E(this.min)||!E(this.max)||athis.max&&c>this.max;a=this.getPlotLinePath({value:a,force:!0,acrossPanes:e.acrossPanes});e=1;if(a&&g){if(c){var q=a.toString()===g.toString();e=0}for(c=0;cF-f?F:F-f);else if(m)h[b]=Math.max(k,p+f+d>a?p:p+f);else return!1},D=function(b,a,d,c,f){var g;fa-e?g=!1:h[b]=fa-c/ +2?a-c-2:f-d/2;return g},A=function(b){var a=m;m=q;q=a;n=b},U=function(){!1!==r.apply(0,m)?!1!==D.apply(0,q)||n||(A(!0),U()):n?h.x=h.y=0:(A(!0),U())};(d.inverted||1a})&&(a=a.map(function(b){var a=d(b.anchorX,b.anchorY,b.point.isHeader,b.boxWidth,!1);return f(b,{target:a.y,x:a.x})}));c.cleanSplit();n(a,J);var ba=T,ea=T;a.forEach(function(b){var a=b.x,d=b.boxWidth;b=b.isHeader;b||(c.outside&&T+aea&&(ea=T+a))});a.forEach(function(b){var a= +b.x,d=b.anchorX,e=b.pos,h=b.point.isHeader;e={visibility:"undefined"===typeof e?"hidden":"inherit",x:a,y:e+da,anchorX:d,anchorY:b.anchorY};if(c.outside&&ac[0]?Math.max(Math.abs(c[0]),h.width-c[0]):Math.max(Math.abs(c[0]),h.width);e.height=0>c[1]?Math.max(Math.abs(c[1]),h.height-Math.abs(c[1])):Math.max(Math.abs(c[1]),h.height);this.tracker?this.tracker.attr(e):(this.tracker=b.renderer.rect(e).addClass("highcharts-tracker").add(b), +a.styledMode||this.tracker.attr({fill:"rgba(0,0,0,0)"}))}}};a.prototype.styledModeFormat=function(a){return a.replace('style="font-size: 10px"','class="highcharts-header"').replace(/style="color:{(point|series)\.color}"/g,'class="highcharts-color-{$1.colorIndex}"')};a.prototype.tooltipFooterHeaderFormatter=function(a,b){var d=a.series,c=d.tooltipOptions,e=d.xAxis,h=e&&e.dateTime;e={isFooter:b,labelConfig:a};var f=c.xDateFormat,g=c[b?"footerFormat":"headerFormat"];v(this,"headerFormatter",e,function(b){h&& +!f&&k(a.key)&&(f=h.getXDateFormat(a.key,c.dateTimeLabelFormats));h&&f&&(a.point&&a.point.tooltipDateKeys||["key"]).forEach(function(b){g=g.replace("{point."+b+"}","{point."+b+":"+f+"}")});d.chart.styledMode&&(g=this.styledModeFormat(g));b.text=r(g,{point:a,series:d},this.chart)});return e.text};a.prototype.update=function(a){this.destroy();D(!0,this.chart.options.tooltip.userOptions,a);this.init(this.chart,D(!0,this.options,a))};a.prototype.updatePosition=function(a){var b=this.chart,d=this.options, +e=b.pointer,h=this.getLabel();e=e.getChartPosition();var f=(d.positioner||this.getPosition).call(this,h.width,h.height,a),g=a.plotX+b.plotLeft;a=a.plotY+b.plotTop;if(this.outside){d=d.borderWidth+2*this.distance;this.renderer.setSize(h.width+d,h.height+d,!1);if(1!==e.scaleX||1!==e.scaleY)c(this.container,{transform:"scale("+e.scaleX+", "+e.scaleY+")"}),g*=e.scaleX,a*=e.scaleY;g+=e.left-f.x;a+=e.top-f.y}this.move(Math.round(f.x),Math.round(f.y||0),g,a)};return a}();"";return a});M(a,"Core/Series/Point.js", +[a["Core/Renderer/HTML/AST.js"],a["Core/Animation/AnimationUtilities.js"],a["Core/DefaultOptions.js"],a["Core/FormatUtilities.js"],a["Core/Utilities.js"]],function(a,w,C,E,z){var r=w.animObject,J=C.defaultOptions,u=E.format,n=z.addEvent,m=z.defined,g=z.erase,c=z.extend,e=z.fireEvent,l=z.getNestedProperty,f=z.isArray,v=z.isFunction,q=z.isNumber,k=z.isObject,I=z.merge,D=z.objectEach,B=z.pick,O=z.syncTimeout,t=z.removeEvent,h=z.uniqueKey;w=function(){function d(){this.colorIndex=this.category=void 0; +this.formatPrefix="point";this.id=void 0;this.isNull=!1;this.percentage=this.options=this.name=void 0;this.selected=!1;this.total=this.series=void 0;this.visible=!0;this.x=void 0}d.prototype.animateBeforeDestroy=function(){var b=this,a={x:b.startXPos,opacity:0},d=b.getGraphicalProps();d.singular.forEach(function(d){b[d]=b[d].animate("dataLabel"===d?{x:b[d].startXPos,y:b[d].startYPos,opacity:0}:a)});d.plural.forEach(function(a){b[a].forEach(function(a){a.element&&a.animate(c({x:b.startXPos},a.startYPos? +{x:a.startXPos,y:a.startYPos}:{}))})})};d.prototype.applyOptions=function(b,a){var e=this.series,h=e.options.pointValKey||e.pointValKey;b=d.prototype.optionsToObject.call(this,b);c(this,b);this.options=this.options?c(this.options,b):b;b.group&&delete this.group;b.dataLabels&&delete this.dataLabels;h&&(this.y=d.prototype.getNestedProperty.call(this,h));this.formatPrefix=(this.isNull=B(this.isValid&&!this.isValid(),null===this.x||!q(this.y)))?"null":"point";this.selected&&(this.state="select");"name"in +this&&"undefined"===typeof a&&e.xAxis&&e.xAxis.hasNames&&(this.x=e.xAxis.nameToX(this));"undefined"===typeof this.x&&e?this.x="undefined"===typeof a?e.autoIncrement():a:q(b.x)&&e.options.relativeXValue&&(this.x=e.autoIncrement(b.x));return this};d.prototype.destroy=function(){function b(){if(a.graphic||a.dataLabel||a.dataLabels)t(a),a.destroyElements();for(f in a)a[f]=null}var a=this,d=a.series,c=d.chart;d=d.options.dataSorting;var e=c.hoverPoints,h=r(a.series.chart.renderer.globalAnimation),f;a.legendItem&& +c.legend.destroyItem(a);e&&(a.setState(),g(e,a),e.length||(c.hoverPoints=null));if(a===c.hoverPoint)a.onMouseOut();d&&d.enabled?(this.animateBeforeDestroy(),O(b,h.duration)):b();c.pointCount--};d.prototype.destroyElements=function(b){var a=this;b=a.getGraphicalProps(b);b.singular.forEach(function(b){a[b]=a[b].destroy()});b.plural.forEach(function(b){a[b].forEach(function(b){b.element&&b.destroy()});delete a[b]})};d.prototype.firePointEvent=function(b,a,d){var c=this,h=this.series.options;(h.point.events[b]|| +c.options&&c.options.events&&c.options.events[b])&&c.importEvents();"click"===b&&h.allowPointSelect&&(d=function(b){c.select&&c.select(null,b.ctrlKey||b.metaKey||b.shiftKey)});e(c,b,a,d)};d.prototype.getClassName=function(){return"highcharts-point"+(this.selected?" highcharts-point-select":"")+(this.negative?" highcharts-negative":"")+(this.isNull?" highcharts-null-point":"")+("undefined"!==typeof this.colorIndex?" highcharts-color-"+this.colorIndex:"")+(this.options.className?" "+this.options.className: +"")+(this.zone&&this.zone.className?" "+this.zone.className.replace("highcharts-negative",""):"")};d.prototype.getGraphicalProps=function(b){var a=this,d=[],c={singular:[],plural:[]},e;b=b||{graphic:1,dataLabel:1};b.graphic&&d.push("graphic","upperGraphic","shadowGroup");b.dataLabel&&d.push("dataLabel","dataLabelUpper","connector");for(e=d.length;e--;){var h=d[e];a[h]&&c.singular.push(h)}["dataLabel","connector"].forEach(function(d){var e=d+"s";b[d]&&a[e]&&c.plural.push(e)});return c};d.prototype.getLabelConfig= +function(){return{x:this.category,y:this.y,color:this.color,colorIndex:this.colorIndex,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}};d.prototype.getNestedProperty=function(b){if(b)return 0===b.indexOf("custom.")?l(b,this.options):this[b]};d.prototype.getZone=function(){var b=this.series,a=b.zones;b=b.zoneAxis||"y";var d,c=0;for(d=a[c];this[b]>=d.value;)d=a[++c];this.nonZonedColor||(this.nonZonedColor=this.color);this.color= +d&&d.color&&!this.options.color?d.color:this.nonZonedColor;return d};d.prototype.hasNewShapeType=function(){return(this.graphic&&(this.graphic.symbolName||this.graphic.element.nodeName))!==this.shapeType};d.prototype.init=function(b,a,d){this.series=b;this.applyOptions(a,d);this.id=m(this.id)?this.id:h();this.resolveColor();b.chart.pointCount++;e(this,"afterInit");return this};d.prototype.optionsToObject=function(b){var a=this.series,c=a.options.keys,e=c||a.pointArrayMap||["y"],h=e.length,g={},k= +0,l=0;if(q(b)||null===b)g[e[0]]=b;else if(f(b))for(!c&&b.length>h&&(a=typeof b[0],"string"===a?g.name=b[0]:"number"===a&&(g.x=b[0]),k++);lf+k&&(B=f+k),Dg+l&&(D=g+l),this.hasDragged=Math.sqrt(Math.pow(t-B,2)+Math.pow(m-D,2)),10b.options.findNearestPointBy.indexOf("y");b=b.searchPoint(d,a);if((a=q(b,!0)&&b.series)&&!(a=!q(h,!0))){a=h.distX-b.distX;var e=h.dist-b.dist,f=(b.series.group&& +b.series.group.zIndex)-(h.series.group&&h.series.group.zIndex);a=0<(0!==a&&c?a:0!==e?e:0!==f?f:h.series.index>b.series.index?-1:1)}a&&(h=b)});return h};a.prototype.getChartCoordinatesFromPoint=function(a,c){var d=a.series,b=d.xAxis;d=d.yAxis;var e=a.shapeArgs;if(b&&d){var h=D(a.clientX,a.plotX),f=a.plotY||0;a.isNode&&e&&v(e.x)&&v(e.y)&&(h=e.x,f=e.y);return c?{chartX:d.len+d.pos-f,chartY:b.len+b.pos-h}:{chartX:h+b.pos,chartY:f+d.pos}}if(e&&e.x&&e.y)return{chartX:e.x,chartY:e.y}};a.prototype.getChartPosition= +function(){if(this.chartPosition)return this.chartPosition;var a=this.chart.container,c=I(a);this.chartPosition={left:c.left,top:c.top,scaleX:1,scaleY:1};var d=a.offsetWidth;a=a.offsetHeight;2n.max&&(d=n.max-G,L=!0);L?(N-=.8*(N-g[l][0]),"number"===typeof I&&(I-=.8*(I-g[l][1])),c()):g[l]=[N,I];q||(f[l]=A-t,f[y]=G);f=q?1/D:D;e[y]=G;e[l]=d;b[q?a?"scaleY":"scaleX":"scale"+p]=D;b["translate"+p]=f*t+(N-f*v)};a.prototype.reset= +function(a,c){var d=this.chart,b=d.hoverSeries,e=d.hoverPoint,h=d.hoverPoints,f=d.tooltip,g=f&&f.shared?h:e;a&&g&&B(g).forEach(function(b){b.series.isCartesian&&"undefined"===typeof b.plotX&&(a=!1)});if(a)f&&g&&B(g).length&&(f.refresh(g),f.shared&&h?h.forEach(function(b){b.setState(b.state,!0);b.series.isCartesian&&(b.series.xAxis.crosshair&&b.series.xAxis.drawCrosshair(null,b),b.series.yAxis.crosshair&&b.series.yAxis.drawCrosshair(null,b))}):e&&(e.setState(e.state,!0),d.axes.forEach(function(b){b.crosshair&& +e.series[b.coll]===b&&b.drawCrosshair(null,e)})));else{if(e)e.onMouseOut();h&&h.forEach(function(b){b.setState()});if(b)b.onMouseOut();f&&f.hide(c);this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove());d.axes.forEach(function(b){b.hideCrosshair()});this.hoverX=d.hoverPoints=d.hoverPoint=null}};a.prototype.runPointActions=function(c,e){var d=this.chart,b=d.tooltip&&d.tooltip.options.enabled?d.tooltip:void 0,h=b?b.shared:!1,f=e||d.hoverPoint,g=f&&f.series||d.hoverSeries;e=this.getHoverData(f, +g,d.series,(!c||"touchmove"!==c.type)&&(!!e||g&&g.directTouch&&this.isDirectTouch),h,c);f=e.hoverPoint;g=e.hoverSeries;var k=e.hoverPoints;e=g&&g.tooltipOptions.followPointer&&!g.tooltipOptions.split;h=h&&g&&!g.noSharedTooltip;if(f&&(f!==d.hoverPoint||b&&b.isHidden)){(d.hoverPoints||[]).forEach(function(b){-1===k.indexOf(b)&&b.setState()});if(d.hoverSeries!==g)g.onMouseOver();this.applyInactiveState(k);(k||[]).forEach(function(b){b.setState("hover")});d.hoverPoint&&d.hoverPoint.firePointEvent("mouseOut"); +if(!f.series)return;d.hoverPoints=k;d.hoverPoint=f;f.firePointEvent("mouseOver");b&&b.refresh(h?k:f,c)}else e&&b&&!b.isHidden&&(f=b.getAnchor([{}],c),d.isInsidePlot(f[0],f[1],{visiblePlotOnly:!0})&&b.updatePosition({plotX:f[0],plotY:f[1]}));this.unDocMouseMove||(this.unDocMouseMove=n(d.container.ownerDocument,"mousemove",function(b){var d=J[a.hoverChartIndex];if(d)d.pointer.onDocumentMouseMove(b)}),this.eventsToUnbind.push(this.unDocMouseMove));d.axes.forEach(function(b){var a=D((b.crosshair||{}).snap, +!0),e;a&&((e=d.hoverPoint)&&e.series[b.coll]===b||(e=l(k,function(a){return a.series[b.coll]===b})));e||!a?b.drawCrosshair(c,e):b.hideCrosshair()})};a.prototype.scaleGroups=function(a,c){var d=this.chart;d.series.forEach(function(b){var e=a||b.getPlotBox();b.xAxis&&b.xAxis.zoomEnabled&&b.group&&(b.group.attr(e),b.markerGroup&&(b.markerGroup.attr(e),b.markerGroup.clip(c?d.clipRect:null)),b.dataLabelsGroup&&b.dataLabelsGroup.attr(e))});d.clipRect.attr(c||d.clipBox)};a.prototype.setDOMEvents=function(){var c= +this,e=this.chart.container,d=e.ownerDocument;e.onmousedown=this.onContainerMouseDown.bind(this);e.onmousemove=this.onContainerMouseMove.bind(this);e.onclick=this.onContainerClick.bind(this);this.eventsToUnbind.push(n(e,"mouseenter",this.onContainerMouseEnter.bind(this)));this.eventsToUnbind.push(n(e,"mouseleave",this.onContainerMouseLeave.bind(this)));a.unbindDocumentMouseUp||(a.unbindDocumentMouseUp=n(d,"mouseup",this.onDocumentMouseUp.bind(this)));for(var b=this.chart.renderTo.parentElement;b&& +"BODY"!==b.tagName;)this.eventsToUnbind.push(n(b,"scroll",function(){delete c.chartPosition})),b=b.parentElement;w.hasTouch&&(this.eventsToUnbind.push(n(e,"touchstart",this.onContainerTouchStart.bind(this),{passive:!1})),this.eventsToUnbind.push(n(e,"touchmove",this.onContainerTouchMove.bind(this),{passive:!1})),a.unbindDocumentTouchEnd||(a.unbindDocumentTouchEnd=n(d,"touchend",this.onDocumentTouchEnd.bind(this),{passive:!1})))};a.prototype.setHoverChartIndex=function(){var c=this.chart,e=w.charts[D(a.hoverChartIndex, +-1)];if(e&&e!==c)e.pointer.onContainerMouseLeave({relatedTarget:!0});e&&e.mouseIsDown||(a.hoverChartIndex=c.index)};a.prototype.touch=function(a,c){var d=this.chart,b;this.setHoverChartIndex();if(1===a.touches.length)if(a=this.normalize(a),(b=d.isInsidePlot(a.chartX-d.plotLeft,a.chartY-d.plotTop,{visiblePlotOnly:!0}))&&!d.openMenu){c&&this.runPointActions(a);if("touchmove"===a.type){c=this.pinchDown;var e=c[0]?4<=Math.sqrt(Math.pow(c[0].chartX-a.chartX,2)+Math.pow(c[0].chartY-a.chartY,2)):!1}D(e, +!0)&&this.pinch(a)}else c&&this.reset();else 2===a.touches.length&&this.pinch(a)};a.prototype.touchSelect=function(a){return!(!this.chart.options.chart.zoomBySingleTouch||!a.touches||1!==a.touches.length)};a.prototype.zoomOption=function(a){var c=this.chart,d=c.options.chart;c=c.inverted;var b=d.zoomType||"";/touch/.test(a.type)&&(b=D(d.pinchType,b));this.zoomX=a=/x/.test(b);this.zoomY=d=/y/.test(b);this.zoomHor=a&&!c||d&&c;this.zoomVert=d&&!c||a&&c;this.hasZoom=a||d};return a}();"";return a});M(a, +"Core/MSPointer.js",[a["Core/Globals.js"],a["Core/Pointer.js"],a["Core/Utilities.js"]],function(a,w,C){function r(){var a=[];a.item=function(a){return this[a]};e(f,function(c){a.push({pageX:c.pageX,pageY:c.pageY,target:c.target})});return a}function z(a,c,e,f){var g=J[w.hoverChartIndex||NaN];"touch"!==a.pointerType&&a.pointerType!==a.MSPOINTER_TYPE_TOUCH||!g||(g=g.pointer,f(a),g[c]({type:e,target:a.currentTarget,preventDefault:n,touches:r()}))}var x=this&&this.__extends||function(){var a=function(c, +e){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var e in c)c.hasOwnProperty(e)&&(a[e]=c[e])};return a(c,e)};return function(c,e){function f(){this.constructor=c}a(c,e);c.prototype=null===e?Object.create(e):(f.prototype=e.prototype,new f)}}(),J=a.charts,u=a.doc,n=a.noop,m=a.win,g=C.addEvent,c=C.css,e=C.objectEach,l=C.removeEvent,f={},v=!!m.PointerEvent;return function(e){function k(){return null!==e&&e.apply(this,arguments)||this}x(k,e);k.isRequired= +function(){return!(a.hasTouch||!m.PointerEvent&&!m.MSPointerEvent)};k.prototype.batchMSEvents=function(a){a(this.chart.container,v?"pointerdown":"MSPointerDown",this.onContainerPointerDown);a(this.chart.container,v?"pointermove":"MSPointerMove",this.onContainerPointerMove);a(u,v?"pointerup":"MSPointerUp",this.onDocumentPointerUp)};k.prototype.destroy=function(){this.batchMSEvents(l);e.prototype.destroy.call(this)};k.prototype.init=function(a,f){e.prototype.init.call(this,a,f);this.hasZoom&&c(a.container, +{"-ms-touch-action":"none","touch-action":"none"})};k.prototype.onContainerPointerDown=function(a){z(a,"onContainerTouchStart","touchstart",function(a){f[a.pointerId]={pageX:a.pageX,pageY:a.pageY,target:a.currentTarget}})};k.prototype.onContainerPointerMove=function(a){z(a,"onContainerTouchMove","touchmove",function(a){f[a.pointerId]={pageX:a.pageX,pageY:a.pageY};f[a.pointerId].target||(f[a.pointerId].target=a.currentTarget)})};k.prototype.onDocumentPointerUp=function(a){z(a,"onDocumentTouchEnd", +"touchend",function(a){delete f[a.pointerId]})};k.prototype.setDOMEvents=function(){e.prototype.setDOMEvents.call(this);(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(g)};return k}(w)});M(a,"Core/Legend/Legend.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/FormatUtilities.js"],a["Core/Globals.js"],a["Core/Series/Point.js"],a["Core/Renderer/RendererUtilities.js"],a["Core/Utilities.js"]],function(a,w,C,E,z,x){var r=a.animObject,u=a.setAnimation,n=w.format;a=C.isFirefox;var m=C.marginNames; +C=C.win;var g=z.distribute,c=x.addEvent,e=x.createElement,l=x.css,f=x.defined,v=x.discardElement,q=x.find,k=x.fireEvent,I=x.isNumber,D=x.merge,B=x.pick,O=x.relativeLength,t=x.stableSort,h=x.syncTimeout;z=x.wrap;x=function(){function a(a,d){this.allItems=[];this.contentGroup=this.box=void 0;this.display=!1;this.group=void 0;this.offsetWidth=this.maxLegendWidth=this.maxItemWidth=this.legendWidth=this.legendHeight=this.lastLineHeight=this.lastItemY=this.itemY=this.itemX=this.itemMarginTop=this.itemMarginBottom= +this.itemHeight=this.initialItemY=0;this.options={};this.padding=0;this.pages=[];this.proximate=!1;this.scrollGroup=void 0;this.widthOption=this.totalItemWidth=this.titleHeight=this.symbolWidth=this.symbolHeight=0;this.chart=a;this.init(a,d)}a.prototype.init=function(a,d){this.chart=a;this.setOptions(d);d.enabled&&(this.render(),c(this.chart,"endResize",function(){this.legend.positionCheckboxes()}),this.proximate?this.unchartrender=c(this.chart,"render",function(){this.legend.proximatePositions(); +this.legend.positionItems()}):this.unchartrender&&this.unchartrender())};a.prototype.setOptions=function(a){var b=B(a.padding,8);this.options=a;this.chart.styledMode||(this.itemStyle=a.itemStyle,this.itemHiddenStyle=D(this.itemStyle,a.itemHiddenStyle));this.itemMarginTop=a.itemMarginTop||0;this.itemMarginBottom=a.itemMarginBottom||0;this.padding=b;this.initialItemY=b-5;this.symbolWidth=B(a.symbolWidth,16);this.pages=[];this.proximate="proximate"===a.layout&&!this.chart.inverted;this.baseline=void 0}; +a.prototype.update=function(a,d){var b=this.chart;this.setOptions(D(!0,this.options,a));this.destroy();b.isDirtyLegend=b.isDirtyBox=!0;B(d,!0)&&b.redraw();k(this,"afterUpdate")};a.prototype.colorizeItem=function(a,d){a.legendGroup[d?"removeClass":"addClass"]("highcharts-legend-item-hidden");if(!this.chart.styledMode){var b=this.options,c=a.legendItem,e=a.legendLine,h=a.legendSymbol,f=this.itemHiddenStyle.color;b=d?b.itemStyle.color:f;var g=d?a.color||f:f,l=a.options&&a.options.marker,p={fill:g};c&& +c.css({fill:b,color:b});e&&e.attr({stroke:g});h&&(l&&h.isMarker&&(p=a.pointAttribs(),d||(p.stroke=p.fill=f)),h.attr(p))}k(this,"afterColorizeItem",{item:a,visible:d})};a.prototype.positionItems=function(){this.allItems.forEach(this.positionItem,this);this.chart.isResizing||this.positionCheckboxes()};a.prototype.positionItem=function(a){var b=this,d=this.options,c=d.symbolPadding,e=!d.rtl,h=a._legendItemPos;d=h[0];h=h[1];var g=a.checkbox,l=a.legendGroup;l&&l.element&&(c={translateX:e?d:this.legendWidth- +d-2*c-4,translateY:h},e=function(){k(b,"afterPositionItem",{item:a})},f(l.translateY)?l.animate(c,void 0,e):(l.attr(c),e()));g&&(g.x=d,g.y=h)};a.prototype.destroyItem=function(a){var b=a.checkbox;["legendItem","legendLine","legendSymbol","legendGroup"].forEach(function(b){a[b]&&(a[b]=a[b].destroy())});b&&v(a.checkbox)};a.prototype.destroy=function(){function a(a){this[a]&&(this[a]=this[a].destroy())}this.getAllItems().forEach(function(b){["legendItem","legendGroup"].forEach(a,b)});"clipRect up down pager nav box title group".split(" ").forEach(a, +this);this.display=null};a.prototype.positionCheckboxes=function(){var a=this.group&&this.group.alignAttr,d=this.clipHeight||this.legendHeight,c=this.titleHeight;if(a){var e=a.translateY;this.allItems.forEach(function(b){var h=b.checkbox;if(h){var f=e+c+h.y+(this.scrollOffset||0)+3;l(h,{left:a.translateX+b.checkboxOffset+h.x-20+"px",top:f+"px",display:this.proximate||f>e-6&&fk?this.maxItemWidth:a.itemWidth;c&&this.itemX-d+b>k&&(this.itemX=d,this.lastLineHeight&&(this.itemY+=f+this.lastLineHeight+ +h),this.lastLineHeight=0);this.lastItemY=f+this.itemY+h;this.lastLineHeight=Math.max(e,this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];c?this.itemX+=b:(this.itemY+=f+e+h,this.lastLineHeight=e);this.offsetWidth=this.widthOption||Math.max((c?this.itemX-d-(a.checkbox?0:g):b)+d,this.offsetWidth)};a.prototype.getAllItems=function(){var a=[];this.chart.series.forEach(function(b){var d=b&&b.options;b&&B(d.showInLegend,f(d.linkedTo)?!1:void 0,!0)&&(a=a.concat(b.legendItems||("point"===d.legendType? +b.data:b)))});k(this,"afterGetAllItems",{allItems:a});return a};a.prototype.getAlignment=function(){var a=this.options;return this.proximate?a.align.charAt(0)+"tv":a.floating?"":a.align.charAt(0)+a.verticalAlign.charAt(0)+a.layout.charAt(0)};a.prototype.adjustMargins=function(a,d){var b=this.chart,c=this.options,e=this.getAlignment();e&&[/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/].forEach(function(h,g){h.test(e)&&!f(a[g])&&(b[m[g]]=Math.max(b[m[g]],b.legend[(g+1)%2?"legendHeight": +"legendWidth"]+[1,-1,-1,1][g]*c[g%2?"x":"y"]+B(c.margin,12)+d[g]+(b.titleOffset[g]||0)))})};a.prototype.proximatePositions=function(){var a=this.chart,d=[],c="left"===this.options.align;this.allItems.forEach(function(b){var e;var h=c;if(b.yAxis){b.xAxis.options.reversed&&(h=!h);b.points&&(e=q(h?b.points:b.points.slice(0).reverse(),function(a){return I(a.plotY)}));h=this.itemMarginTop+b.legendItem.getBBox().height+this.itemMarginBottom;var f=b.yAxis.top-a.plotTop;b.visible?(e=e?e.plotY:b.yAxis.height, +e+=f-.3*h):e=f+b.yAxis.height;d.push({target:e,size:h,item:b})}},this);g(d,a.plotHeight).forEach(function(b){b.item._legendItemPos&&(b.item._legendItemPos[1]=a.plotTop-a.spacing[0]+b.pos)})};a.prototype.render=function(){var a=this.chart,d=a.renderer,c=this.options,e=this.padding,h=this.getAllItems(),f=this.group,g=this.box;this.itemX=e;this.itemY=this.initialItemY;this.lastItemY=this.offsetWidth=0;this.widthOption=O(c.width,a.spacingBox.width-e);var l=a.spacingBox.width-2*e-c.x;-1<["rm","lm"].indexOf(this.getAlignment().substring(0, +2))&&(l/=2);this.maxLegendWidth=this.widthOption||l;f||(this.group=f=d.g("legend").addClass(c.className||"").attr({zIndex:7}).add(),this.contentGroup=d.g().attr({zIndex:1}).add(f),this.scrollGroup=d.g().add(this.contentGroup));this.renderTitle();t(h,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)});c.reversed&&h.reverse();this.allItems=h;this.display=l=!!h.length;this.itemHeight=this.totalItemWidth=this.maxItemWidth=this.lastLineHeight=0;h.forEach(this.renderItem, +this);h.forEach(this.layoutItem,this);h=(this.widthOption||this.offsetWidth)+e;var m=this.lastItemY+this.lastLineHeight+this.titleHeight;m=this.handleOverflow(m);m+=e;g||(this.box=g=d.rect().addClass("highcharts-legend-box").attr({r:c.borderRadius}).add(f),g.isNew=!0);a.styledMode||g.attr({stroke:c.borderColor,"stroke-width":c.borderWidth||0,fill:c.backgroundColor||"none"}).shadow(c.shadow);0h&&!1!==l.enabled?(this.clipHeight=I=Math.max(h-20-this.titleHeight-g,0),this.currentPage=B(this.currentPage,1),this.fullHeight=a,t.forEach(function(a, +b){var d=a._legendItemPos[1],c=Math.round(a.legendItem.getBBox().height),e=q.length;if(!e||d-q[e-1]>I&&(A||d)!==q[e-1])q.push(A||d),e++;a.pageIx=e-1;A&&(t[b-1].pageIx=e-1);b===t.length-1&&d+c-q[e-1]>I&&d!==A&&(q.push(d),a.pageIx=e);d!==A&&(A=d)}),N||(N=b.clipRect=c.clipRect(0,g,9999,0),b.contentGroup.clip(N)),v(I),U||(this.nav=U=c.g().attr({zIndex:1}).add(this.group),this.up=c.symbol("triangle",0,0,n,n).add(U),r("upTracker").on("click",function(){b.scroll(-1,m)}),this.pager=c.text("",15,10).addClass("highcharts-legend-navigation"), +d.styledMode||this.pager.css(l.style),this.pager.add(U),this.down=c.symbol("triangle-down",0,0,n,n).add(U),r("downTracker").on("click",function(){b.scroll(1,m)})),b.scroll(0),a=h):U&&(v(),this.nav=U.destroy(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0);return a};a.prototype.scroll=function(a,d){var b=this,c=this.chart,e=this.pages,f=e.length,g=this.clipHeight,l=this.options.navigation,m=this.pager,p=this.padding,n=this.currentPage+a;n>f&&(n=f);0=Math.max(k+h,A.pos)&&g<=Math.min(k+h+e.width,A.pos+A.len)||(a.isInsidePlot=!1)}!d.ignoreY&&a.isInsidePlot&&(c=m&&(c?m.xAxis:m.yAxis)||{pos:f,len:Infinity},d=d.paneCoordinates? +c.pos+b:f+b,d>=Math.max(l+f,c.pos)&&d<=Math.min(l+f+e.height,c.pos+c.len)||(a.isInsidePlot=!1));R(this,"afterIsInsidePlot",a);return a.isInsidePlot};a.prototype.redraw=function(a){R(this,"beforeRedraw");var b=this.hasCartesianSeries?this.axes:this.colorAxis||[],d=this.series,c=this.pointer,e=this.legend,h=this.userOptions.legend,f=this.renderer,g=f.isHidden(),k=[],l=this.isDirtyBox,m=this.isDirtyLegend;this.setResponsive&&this.setResponsive(!1);r(this.hasRendered?a:!1,this);g&&this.temporaryDisplay(); +this.layOutTitles();for(a=d.length;a--;){var A=d[a];if(A.options.stacking||A.options.centerInCategory){var p=!0;if(A.isDirty){var n=!0;break}}}if(n)for(a=d.length;a--;)A=d[a],A.options.stacking&&(A.isDirty=!0);d.forEach(function(a){a.isDirty&&("point"===a.options.legendType?("function"===typeof a.updateTotals&&a.updateTotals(),m=!0):h&&(h.labelFormatter||h.labelFormat)&&(m=!0));a.isDirtyData&&R(a,"updatedData")});m&&e&&e.options.enabled&&(e.render(),this.isDirtyLegend=!1);p&&this.getStacks();b.forEach(function(a){a.updateNames(); +a.setScale()});this.getMargins();b.forEach(function(a){a.isDirty&&(l=!0)});b.forEach(function(a){var b=a.min+","+a.max;a.extKey!==b&&(a.extKey=b,k.push(function(){R(a,"afterSetExtremes",M(a.eventArgs,a.getExtremes()));delete a.eventArgs}));(l||p)&&a.redraw()});l&&this.drawChartBox();R(this,"predraw");d.forEach(function(a){(l||a.isDirty)&&a.visible&&a.redraw();a.isDirtyData=!1});c&&c.reset(!0);f.draw();R(this,"redraw");R(this,"render");g&&this.temporaryDisplay(!0);k.forEach(function(a){a.call()})}; +a.prototype.get=function(a){function b(b){return b.id===a||b.options&&b.options.id===a}for(var d=this.series,c=ha(this.axes,b)||ha(this.series,b),e=0;!c&&e=g&&c<=k||l||!V(c))A=!0;d[l?"zoomX":"zoomY"]&&A&&(h=f.zoom(a.min,a.max),f.displayBtn&&(e=!0))});var f=b.resetZoomButton;e&&!f?b.showResetZoom():!e&&N(f)&&(b.resetZoomButton=f.destroy());h&&b.redraw(T(b.options.chart.animation,a&&a.animation, +100>b.pointCount))};a.prototype.pan=function(a,b){var d=this,c=d.hoverPoints;b="object"===typeof b?b:{enabled:b,type:"x"};var e=d.options.chart,h=d.options.mapNavigation&&d.options.mapNavigation.enabled;e&&e.panning&&(e.panning=b);var f=b.type,g;R(this,"pan",{originalEvent:a},function(){c&&c.forEach(function(a){a.setState()});var b=d.xAxis;"xy"===f?b=b.concat(d.yAxis):"y"===f&&(b=d.yAxis);var e={};b.forEach(function(b){if(b.options.panningEnabled&&!b.options.isInternal){var c=b.horiz,k=a[c?"chartX": +"chartY"];c=c?"mouseDownX":"mouseDownY";var l=d[c],A=b.minPointOffset||0,m=b.reversed&&!d.inverted||!b.reversed&&d.inverted?-1:1,p=b.getExtremes(),n=b.toValue(l-k,!0)+A*m,q=b.toValue(l+b.len-k,!0)-(A*m||b.isXAxis&&b.pointRangePadding||0),t=q=m&&n<=q&&(b.setExtremes(l,n,!1,!1,{trigger:"pan"}), +d.resetZoomButton||h||l===m||n===q||!f.match("y")||(d.showResetZoom(),b.displayBtn=!1),g=!0),e[c]=k)}});Y(e,function(a,b){d[b]=a});g&&d.redraw(!1);Q(d.container,{cursor:"move"})})};return a}();M(a.prototype,{callbacks:[],collectionsWithInit:{xAxis:[a.prototype.addAxis,[!0]],yAxis:[a.prototype.addAxis,[!1]],series:[a.prototype.addSeries]},collectionsWithUpdate:["xAxis","yAxis","series"],propsRequireDirtyBox:"backgroundColor borderColor borderWidth borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "), +propsRequireReflow:"margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft".split(" "),propsRequireUpdateSeries:"chart.inverted chart.polar chart.ignoreHiddenSeries chart.type colors plotOptions time tooltip".split(" ")});"";return a});M(a,"Core/Legend/LegendSymbol.js",[a["Core/Utilities.js"]],function(a){var r=a.merge,C=a.pick,E;(function(a){a.drawLineMarker=function(a){var x=this.options,u=a.symbolWidth,n=a.symbolHeight,m=n/2,g=this.chart.renderer, +c=this.legendGroup;a=a.baseline-Math.round(.3*a.fontMetrics.b);var e={},l=x.marker;this.chart.styledMode||(e={"stroke-width":x.lineWidth||0},x.dashStyle&&(e.dashstyle=x.dashStyle));this.legendLine=g.path([["M",0,a],["L",u,a]]).addClass("highcharts-graph").attr(e).add(c);l&&!1!==l.enabled&&u&&(x=Math.min(C(l.radius,m),m),0===this.symbol.indexOf("url")&&(l=r(l,{width:n,height:n}),x=0),this.legendSymbol=u=g.symbol(this.symbol,u/2-x,a-x,2*x,2*x,l).addClass("highcharts-point").add(c),u.isMarker=!0)};a.drawRectangle= +function(a,r){var u=a.symbolHeight,n=a.options.squareSymbol;r.legendSymbol=this.chart.renderer.rect(n?(a.symbolWidth-u)/2:0,a.baseline-u+1,n?u:a.symbolWidth,u,C(a.options.symbolRadius,u/2)).addClass("highcharts-point").attr({zIndex:3}).add(r.legendGroup)}})(E||(E={}));return E});M(a,"Core/Series/SeriesDefaults.js",[a["Core/Color/Palette.js"]],function(a){return{lineWidth:2,allowPointSelect:!1,crisp:!0,showCheckbox:!1,animation:{duration:1E3},events:{},marker:{enabledThreshold:2,lineColor:a.backgroundColor, +lineWidth:0,radius:4,states:{normal:{animation:!0},hover:{animation:{duration:50},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:a.neutralColor20,lineColor:a.neutralColor100,lineWidth:2}}},point:{events:{}},dataLabels:{animation:{},align:"center",defer:!0,formatter:function(){var a=this.series.chart.numberFormatter;return"number"!==typeof this.y?"":a(this.y,-1)},padding:5,style:{fontSize:"11px",fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",x:0,y:0}, +cropThreshold:300,opacity:1,pointRange:0,softThreshold:!0,states:{normal:{animation:!0},hover:{animation:{duration:50},lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{animation:{duration:0}},inactive:{animation:{duration:50},opacity:.2}},stickyTracking:!0,turboThreshold:1E3,findNearestPointBy:"x"}});M(a,"Core/Series/Series.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/DefaultOptions.js"],a["Core/Foundation.js"],a["Core/Globals.js"],a["Core/Legend/LegendSymbol.js"],a["Core/Color/Palette.js"], +a["Core/Series/Point.js"],a["Core/Series/SeriesDefaults.js"],a["Core/Series/SeriesRegistry.js"],a["Core/Renderer/SVG/SVGElement.js"],a["Core/Utilities.js"]],function(a,w,C,E,z,x,J,u,n,m,g){var c=a.animObject,e=a.setAnimation,l=w.defaultOptions,f=C.registerEventOptions,v=E.hasTouch,q=E.svg,k=E.win,r=n.seriesTypes,D=g.addEvent,B=g.arrayMax,O=g.arrayMin,t=g.clamp,h=g.cleanRecursively,d=g.correctFloat,b=g.defined,p=g.erase,G=g.error,y=g.extend,L=g.find,F=g.fireEvent,P=g.getNestedProperty,S=g.isArray, +Q=g.isNumber,V=g.isString,M=g.merge,H=g.objectEach,K=g.pick,la=g.removeEvent,ha=g.splat,R=g.syncTimeout;a=function(){function a(){this.zones=this.yAxis=this.xAxis=this.userOptions=this.tooltipOptions=this.processedYData=this.processedXData=this.points=this.options=this.linkedSeries=this.index=this.eventsToUnbind=this.eventOptions=this.data=this.chart=this._i=void 0}a.prototype.init=function(a,b){F(this,"init",{options:b});var d=this,c=a.series;this.eventsToUnbind=[];d.chart=a;d.options=d.setOptions(b); +b=d.options;d.linkedSeries=[];d.bindAxes();y(d,{name:b.name,state:"",visible:!1!==b.visible,selected:!0===b.selected});f(this,b);var e=b.events;if(e&&e.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)a.runTrackerClick=!0;d.getColor();d.getSymbol();d.parallelArrays.forEach(function(a){d[a+"Data"]||(d[a+"Data"]=[])});d.isCartesian&&(a.hasCartesianSeries=!0);var h;c.length&&(h=c[c.length-1]);d._i=K(h&&h._i,-1)+1;d.opacity=d.options.opacity;a.orderSeries(this.insert(c));b.dataSorting&& +b.dataSorting.enabled?d.setDataSortingOptions():d.points||d.data||d.setData(b.data,!1);F(this,"afterInit")};a.prototype.is=function(a){return r[a]&&this instanceof r[a]};a.prototype.insert=function(a){var b=this.options.index,d;if(Q(b)){for(d=a.length;d--;)if(b>=K(a[d].options.index,a[d]._i)){a.splice(d+1,0,this);break}-1===d&&a.unshift(this);d+=1}else a.push(this);return K(d,a.length-1)};a.prototype.bindAxes=function(){var a=this,b=a.options,d=a.chart,c;F(this,"bindAxes",null,function(){(a.axisTypes|| +[]).forEach(function(e){var h=0;d[e].forEach(function(d){c=d.options;if(b[e]===h&&!c.isInternal||"undefined"!==typeof b[e]&&b[e]===c.id||"undefined"===typeof b[e]&&0===c.index)a.insert(d.series),a[e]=d,d.isDirty=!0;c.isInternal||h++});a[e]||a.optionalAxis===e||G(18,!0,d)})});F(this,"afterBindAxes")};a.prototype.updateParallelArrays=function(a,b){var d=a.series,c=arguments,e=Q(b)?function(c){var e="y"===c&&d.toYData?d.toYData(a):a[c];d[c+"Data"][b]=e}:function(a){Array.prototype[b].apply(d[a+"Data"], +Array.prototype.slice.call(c,2))};d.parallelArrays.forEach(e)};a.prototype.hasData=function(){return this.visible&&"undefined"!==typeof this.dataMax&&"undefined"!==typeof this.dataMin||this.visible&&this.yData&&0=this.cropStart?k-this.cropStart:k);!g&&Q(k)&&e[k]&&e[k].touched&&(k=void 0);return k};a.prototype.updateData= +function(a,d){var c=this.options,e=c.dataSorting,h=this.points,f=[],g=this.requireSorting,k=a.length===h.length,l,m,A,p=!0;this.xIncrement=null;a.forEach(function(a,d){var m=b(a)&&this.pointClass.prototype.optionsToObject.call({series:this},a)||{},p=m.x;if(m.id||Q(p)){if(m=this.findPointIndex(m,A),-1===m||"undefined"===typeof m?f.push(a):h[m]&&a!==c.data[m]?(h[m].update(a,!1,null,!1),h[m].touched=!0,g&&(A=m+1)):h[m]&&(h[m].touched=!0),!k||d!==m||e&&e.enabled||this.hasDerivedData)l=!0}else f.push(a)}, +this);if(l)for(a=h.length;a--;)(m=h[a])&&!m.touched&&m.remove&&m.remove(!1,d);else!k||e&&e.enabled?p=!1:(a.forEach(function(a,b){a!==h[b].y&&h[b].update&&h[b].update(a,!1,null,!1)}),f.length=0);h.forEach(function(a){a&&(a.touched=!1)});if(!p)return!1;f.forEach(function(a){this.addPoint(a,!1,null,null,!1)},this);null===this.xIncrement&&this.xData&&this.xData.length&&(this.xIncrement=B(this.xData),this.autoIncrement());return!0};a.prototype.setData=function(a,b,d,c){var e=this,h=e.points,f=h&&h.length|| +0,g=e.options,k=e.chart,l=g.dataSorting,m=e.xAxis,A=g.turboThreshold,p=this.xData,n=this.yData,q=e.pointArrayMap;q=q&&q.length;var t=g.keys,v,r=0,B=1,y=null;a=a||[];var N=a.length;b=K(b,!0);l&&l.enabled&&(a=this.sortData(a));!1!==c&&N&&f&&!e.cropped&&!e.hasGroupedData&&e.visible&&!e.isSeriesBoosting&&(v=this.updateData(a,d));if(!v){e.xIncrement=null;e.colorCounter=0;this.parallelArrays.forEach(function(a){e[a+"Data"].length=0});if(A&&N>A)if(y=e.getFirstValidPoint(a),Q(y))for(d=0;da?1:0}).forEach(function(a,b){a.x=b},this);d.linkedSeries&&d.linkedSeries.forEach(function(b){var d= +b.options,c=d.data;d.dataSorting&&d.dataSorting.enabled||!c||(c.forEach(function(d,h){c[h]=e(b,d);a[h]&&(c[h].x=a[h].x,c[h].index=h)}),b.setData(c,!1))});return a};a.prototype.getProcessedData=function(a){var b=this.xAxis,d=this.options,c=d.cropThreshold,e=a||this.getExtremesFromAll||d.getExtremesFromAll,h=this.isCartesian;a=b&&b.val2lin;d=!(!b||!b.logarithmic);var f=0,g=this.xData,k=this.yData,l=this.requireSorting;var m=!1;var A=g.length;if(b){m=b.getExtremes();var p=m.min;var n=m.max;m=b.categories&& +!b.names.length}if(h&&this.sorted&&!e&&(!c||A>c||this.forceCrop))if(g[A-1]n)g=[],k=[];else if(this.yData&&(g[0]n)){var q=this.cropData(this.xData,this.yData,p,n);g=q.xData;k=q.yData;f=q.start;q=!0}for(c=g.length||1;--c;)if(b=d?a(g[c])-a(g[c-1]):g[c]-g[c-1],0b&&l&&!m&&(G(15,!1,this.chart),l=!1);return{xData:g,yData:k,cropped:q,cropStart:f,closestPointRange:t}};a.prototype.processData=function(a){var b=this.xAxis;if(this.isCartesian&& +!this.isDirty&&!b.isDirty&&!this.yAxis.isDirty&&!a)return!1;a=this.getProcessedData();this.cropped=a.cropped;this.cropStart=a.cropStart;this.processedXData=a.xData;this.processedYData=a.yData;this.closestPointRange=this.basePointRange=a.closestPointRange};a.prototype.cropData=function(a,b,d,c,e){var h=a.length,f,g=0,k=h;e=K(e,this.cropShoulder);for(f=0;f=d){g=Math.max(0,f-e);break}for(d=f;dc){k=d+e;break}return{xData:a.slice(g,k),yData:b.slice(g,k),start:g,end:k}};a.prototype.generatePoints= +function(){var a=this.options,b=a.data,d=this.processedXData,c=this.processedYData,e=this.pointClass,h=d.length,f=this.cropStart||0,g=this.hasGroupedData,k=a.keys,l=[];a=a.dataGrouping&&a.dataGrouping.groupAll?f:0;var m,p,n=this.data;if(!n&&!g){var q=[];q.length=b.length;n=this.data=q}k&&g&&(this.options.keys=!1);for(p=0;p=k&&(e[g-f]||A)<=l;if(q&&A)if(q=n.length)for(;q--;)Q(n[q])&&(h[m++]=n[q]);else h[m++]=n}a={dataMin:O(h),dataMax:B(h)};F(this,"afterGetExtremes",{dataExtremes:a}); +return a};a.prototype.applyExtremes=function(){var a=this.getExtremes();this.dataMin=a.dataMin;this.dataMax=a.dataMax;return a};a.prototype.getFirstValidPoint=function(a){for(var b=a.length,d=0,c=null;null===c&&d=L&&(L=null),D.total=D.stackTotal=G.total,D.percentage=G.total&&D.y/G.total*100,D.stackY=w,this.irregularWidths||G.setOffset(this.pointXOffset||0,this.barW||0));D.yBottom=b(L)?t(g.translate(L,0,1,0,1),-1E5,1E5):null;m&&(w=this.modifyValue(w,D));D.plotY=void 0;Q(w)&&(G=g.translate(w,!1,!0,!1,!0),"undefined"!==typeof G&&(D.plotY=t(G,-1E5,1E5)));D.isInside=this.isPointInside(D); +D.clientX=n?d(e.translate(u,0,0,0,1,p)):y;D.negative=D[r]<(a[r+"Threshold"]||q||0);D.category=h&&"undefined"!==typeof h[D.x]?h[D.x]:D.x;if(!D.isNull&&!1!==D.visible){"undefined"!==typeof H&&(I=Math.min(I,Math.abs(y-H)));var H=y}D.zone=this.zones.length&&D.getZone();!D.graphic&&this.group&&f&&(D.isNew=!0)}this.closestPointRangePx=I;F(this,"afterTranslate")};a.prototype.getValidPoints=function(a,b,d){var c=this.chart;return(a||this.points||[]).filter(function(a){return b&&!c.isInsidePlot(a.plotX,a.plotY, +{inverted:c.inverted})?!1:!1!==a.visible&&(d||!a.isNull)})};a.prototype.getClipBox=function(a,b){var d=this.options,c=this.chart,e=c.inverted,h=this.xAxis,f=h&&this.yAxis,g=c.options.chart.scrollablePlotArea||{};a&&!1===d.clip&&f?a=e?{y:-c.chartWidth+f.len+f.pos,height:c.chartWidth,width:c.chartHeight,x:-c.chartHeight+h.len+h.pos}:{y:-f.pos,height:c.chartHeight,width:c.chartWidth,x:-h.pos}:(a=this.clipBox||c.clipBox,b&&(a.width=c.plotSizeX,a.x=(c.scrollablePixelsX||0)*(g.scrollPositionX||0)));return b? +{width:a.width,x:a.x}:a};a.prototype.getSharedClipKey=function(a){if(this.sharedClipKey)return this.sharedClipKey;var b=[a&&a.duration,a&&a.easing,a&&a.defer,this.getClipBox(a).height,this.options.xAxis,this.options.yAxis].join();if(!1!==this.options.clip||a)this.sharedClipKey=b;return b};a.prototype.setClip=function(a){var b=this.chart,d=this.options,c=b.renderer,e=b.inverted,h=this.clipBox,f=this.getClipBox(a),g=this.getSharedClipKey(a),k=b.sharedClips[g],l=b.sharedClips[g+"m"];a&&(f.width=0,e&& +(f.x=b.plotHeight+(!1!==d.clip?0:b.plotTop)));k?b.hasLoaded||k.attr(f):(a&&(b.sharedClips[g+"m"]=l=c.clipRect(e?(b.plotSizeX||0)+99:-99,e?-b.plotLeft:-b.plotTop,99,e?b.chartWidth:b.chartHeight)),b.sharedClips[g]=k=c.clipRect(f),k.count={length:0});a&&!k.count[this.index]&&(k.count[this.index]=!0,k.count.length+=1);if(!1!==d.clip||a)this.group.clip(a||h?k:b.clipRect),this.markerGroup.clip(l);a||(k.count[this.index]&&(delete k.count[this.index],--k.count.length),0===k.count.length&&(h||(b.sharedClips[g]= +k.destroy()),l&&(b.sharedClips[g+"m"]=l.destroy())))};a.prototype.animate=function(a){var b=this.chart,d=c(this.options.animation),e=this.sharedClipKey;if(a)this.setClip(d);else if(e){a=b.sharedClips[e];e=b.sharedClips[e+"m"];var h=this.getClipBox(d,!0);a&&a.animate(h,d);e&&e.animate({width:h.width+99,x:h.x-(b.inverted?0:99)},d)}};a.prototype.afterAnimate=function(){this.setClip();F(this,"afterAnimate");this.finishedAnimating=!0};a.prototype.drawPoints=function(){var a=this.points,b=this.chart,d= +this.options.marker,c=this[this.specialGroup]||this.markerGroup,e=this.xAxis,h=K(d.enabled,!e||e.isRadial?!0:null,this.closestPointRangePx>=d.enabledThreshold*d.radius),f,g;if(!1!==d.enabled||this._hasPointMarkers)for(f=0;f +u.max;a.resetZones&&0===p&&(p=void 0)});this.clips=e}else a.visible&&(h&&h.show(!0),f&&f.show(!0))};a.prototype.invertGroups=function(a){function b(){["group","markerGroup"].forEach(function(b){d[b]&&(c.renderer.isVML&&d[b].attr({width:d.yAxis.len,height:d.xAxis.len}),d[b].width=d.yAxis.len,d[b].height=d.xAxis.len,d[b].invert(d.isRadialSeries?!1:a))})}var d=this,c=d.chart;d.xAxis&&(d.eventsToUnbind.push(D(c,"resize",b)),b(),d.invertGroups=b)};a.prototype.plotGroup=function(a,d,c,e,h){var f=this[a], +g=!f;c={visibility:c,zIndex:e||.1};"undefined"===typeof this.opacity||this.chart.styledMode||"inactive"===this.state||(c.opacity=this.opacity);g&&(this[a]=f=this.chart.renderer.g().add(h));f.addClass("highcharts-"+d+" highcharts-series-"+this.index+" highcharts-"+this.type+"-series "+(b(this.colorIndex)?"highcharts-color-"+this.colorIndex+" ":"")+(this.options.className||"")+(f.hasClass("highcharts-tracker")?" highcharts-tracker":""),!0);f.attr(c)[g?"attr":"animate"](this.getPlotBox());return f}; +a.prototype.getPlotBox=function(){var a=this.chart,b=this.xAxis,d=this.yAxis;a.inverted&&(b=d,d=this.xAxis);return{translateX:b?b.left:a.plotLeft,translateY:d?d.top:a.plotTop,scaleX:1,scaleY:1}};a.prototype.removeEvents=function(a){a||la(this);this.eventsToUnbind.length&&(this.eventsToUnbind.forEach(function(a){a()}),this.eventsToUnbind.length=0)};a.prototype.render=function(){var a=this,b=a.chart,d=a.options,e=c(d.animation),h=a.visible?"inherit":"hidden",f=d.zIndex,g=a.hasRendered,k=b.seriesGroup, +l=b.inverted,m=!a.finishedAnimating&&b.renderer.isSVG&&e.duration;F(this,"render");var p=a.plotGroup("group","series",h,f,k);a.markerGroup=a.plotGroup("markerGroup","markers",h,f,k);m&&a.animate&&a.animate(!0);p.inverted=K(a.invertible,a.isCartesian)?l:!1;a.drawGraph&&(a.drawGraph(),a.applyZones());a.visible&&a.drawPoints();a.drawDataLabels&&a.drawDataLabels();a.redrawPoints&&a.redrawPoints();a.drawTracker&&!1!==a.options.enableMouseTracking&&a.drawTracker();a.invertGroups(l);!1===d.clip||a.sharedClipKey|| +g||p.clip(b.clipRect);m&&a.animate&&a.animate();g||(m&&e.defer&&(m+=e.defer),a.animationTimeout=R(function(){a.afterAnimate()},m||0));a.isDirty=!1;a.hasRendered=!0;F(a,"afterRender")};a.prototype.redraw=function(){var a=this.chart,b=this.isDirty||this.isDirtyData,d=this.group,c=this.xAxis,e=this.yAxis;d&&(a.inverted&&d.attr({width:a.plotWidth,height:a.plotHeight}),d.animate({translateX:K(c&&c.left,a.plotLeft),translateY:K(e&&e.top,a.plotTop)}));this.translate();this.render();b&&delete this.kdTree}; +a.prototype.searchPoint=function(a,b){var d=this.xAxis,c=this.yAxis,e=this.chart.inverted;return this.searchKDTree({clientX:e?d.len-a.chartY+d.pos:a.chartX-d.pos,plotY:e?c.len-a.chartX+c.pos:a.chartY-c.pos},b,a)};a.prototype.buildKDTree=function(a){function b(a,c,e){var h=a&&a.length;if(h){var f=d.kdAxisArray[c%e];a.sort(function(a,b){return a[f]-b[f]});h=Math.floor(h/2);return{point:a[h],left:b(a.slice(0,h),c+1,e),right:b(a.slice(h+1),c+1,e)}}}this.buildingKdTree=!0;var d=this,c=-1p?"left":"right";q=0>p?"right":"left"; +d[t]&&(t=e(a,d[t],c+1,l),n=t[k]q;)t--;this.updateParallelArrays(n,"splice",t,0,0);this.updateParallelArrays(n,t);k&&n.name&&(k[q]=n.name);l.splice(t,0,a);p&&(this.data.splice(t, +0,null),this.processData());"point"===h.legendType&&this.generatePoints();d&&(f[0]&&f[0].remove?f[0].remove(!1):(f.shift(),this.updateParallelArrays(n,"shift"),l.shift()));!1!==e&&F(this,"addPoint",{point:n});this.isDirtyData=this.isDirty=!0;b&&g.redraw(c)};a.prototype.removePoint=function(a,b,d){var c=this,h=c.data,f=h[a],g=c.points,k=c.chart,l=function(){g&&g.length===h.length&&g.splice(a,1);h.splice(a,1);c.options.data.splice(a,1);c.updateParallelArrays(f||{series:c},"splice",a,1);f&&f.destroy(); +c.isDirty=!0;c.isDirtyData=!0;b&&k.redraw()};e(d,k);b=K(b,!0);f?f.firePointEvent("remove",null,l):l()};a.prototype.remove=function(a,b,d,c){function e(){h.destroy(c);f.isDirtyLegend=f.isDirtyBox=!0;f.linkSeries();K(a,!0)&&f.redraw(b)}var h=this,f=h.chart;!1!==d?F(h,"remove",null,e):e()};a.prototype.update=function(a,b){a=h(a,this.userOptions);F(this,"update",{options:a});var d=this,c=d.chart,e=d.userOptions,f=d.initialType||d.type,g=c.options.plotOptions,k=r[f].prototype,l=d.finishedAnimating&&{animation:!1}, +m={},p,n=["eventOptions","navigatorSeries","baseSeries"],q=a.type||e.type||c.options.chart.type,t=!(this.hasDerivedData||q&&q!==this.type||"undefined"!==typeof a.pointStart||"undefined"!==typeof a.pointInterval||"undefined"!==typeof a.relativeXValue||d.hasOptionChanged("dataGrouping")||d.hasOptionChanged("pointStart")||d.hasOptionChanged("pointInterval")||d.hasOptionChanged("pointIntervalUnit")||d.hasOptionChanged("keys"));q=q||f;t&&(n.push("data","isDirtyData","points","processedXData","processedYData", +"xIncrement","cropped","_hasPointMarkers","_hasPointLabels","clips","nodes","layout","mapMap","mapData","minY","maxY","minX","maxX"),!1!==a.visible&&n.push("area","graph"),d.parallelArrays.forEach(function(a){n.push(a+"Data")}),a.data&&(a.dataSorting&&y(d.options.dataSorting,a.dataSorting),this.setData(a.data,!1)));a=M(e,l,{index:"undefined"===typeof e.index?d.index:e.index,pointStart:K(g&&g.series&&g.series.pointStart,e.pointStart,d.xData[0])},!t&&{data:d.options.data},a);t&&a.data&&(a.data=d.options.data); +n=["group","markerGroup","dataLabelsGroup","transformGroup"].concat(n);n.forEach(function(a){n[a]=d[a];delete d[a]});g=!1;if(r[q]){if(g=q!==d.type,d.remove(!1,!1,!1,!0),g)if(Object.setPrototypeOf)Object.setPrototypeOf(d,r[q].prototype);else{l=Object.hasOwnProperty.call(d,"hcEvents")&&d.hcEvents;for(p in k)d[p]=void 0;y(d,r[q].prototype);l?d.hcEvents=l:delete d.hcEvents}}else G(17,!0,c,{missingModuleFor:q});n.forEach(function(a){d[a]=n[a]});d.init(c,a);if(t&&this.points){var v=d.options;!1===v.visible? +(m.graphic=1,m.dataLabel=1):d._hasPointLabels||(a=v.marker,k=v.dataLabels,!a||!1!==a.enabled&&(e.marker&&e.marker.symbol)===a.symbol||(m.graphic=1),k&&!1===k.enabled&&(m.dataLabel=1));this.points.forEach(function(a){a&&a.series&&(a.resolveColor(),Object.keys(m).length&&a.destroyElements(m),!1===v.showInLegend&&a.legendItem&&c.legend.destroyItem(a))},this)}d.initialType=f;c.linkSeries();g&&d.linkedSeries.length&&(d.isDirtyData=!0);F(this,"afterUpdate");K(b,!0)&&c.redraw(t?void 0:!1)};a.prototype.setName= +function(a){this.name=this.options.name=this.userOptions.name=a;this.chart.isDirtyLegend=!0};a.prototype.hasOptionChanged=function(a){var b=this.options[a],d=this.chart.options.plotOptions,c=this.userOptions[a];return c?b!==c:b!==K(d&&d[this.type]&&d[this.type][a],d&&d.series&&d.series[a],b)};a.prototype.onMouseOver=function(){var a=this.chart,b=a.hoverSeries;a.pointer.setHoverChartIndex();if(b&&b!==this)b.onMouseOut();this.options.events.mouseOver&&F(this,"mouseOver");this.setState("hover");a.hoverSeries= +this};a.prototype.onMouseOut=function(){var a=this.options,b=this.chart,d=b.tooltip,c=b.hoverPoint;b.hoverSeries=null;if(c)c.onMouseOut();this&&a.events.mouseOut&&F(this,"mouseOut");!d||this.stickyTracking||d.shared&&!this.noSharedTooltip||d.hide();b.series.forEach(function(a){a.setState("",!0)})};a.prototype.setState=function(a,b){var d=this,c=d.options,e=d.graph,h=c.inactiveOtherPoints,f=c.states,g=K(f[a||"normal"]&&f[a||"normal"].animation,d.chart.options.chart.animation),k=c.lineWidth,l=0,m=c.opacity; +a=a||"";if(d.state!==a&&([d.group,d.markerGroup,d.dataLabelsGroup].forEach(function(b){b&&(d.state&&b.removeClass("highcharts-series-"+d.state),a&&b.addClass("highcharts-series-"+a))}),d.state=a,!d.chart.styledMode)){if(f[a]&&!1===f[a].enabled)return;a&&(k=f[a].lineWidth||k+(f[a].lineWidthPlus||0),m=K(f[a].opacity,m));if(e&&!e.dashstyle)for(c={"stroke-width":k},e.animate(c,g);d["zone-graph-"+l];)d["zone-graph-"+l].animate(c,g),l+=1;h||[d.group,d.markerGroup,d.dataLabelsGroup,d.labelBySeries].forEach(function(a){a&& +a.animate({opacity:m},g)})}b&&h&&d.points&&d.setAllPointsToState(a||void 0)};a.prototype.setAllPointsToState=function(a){this.points.forEach(function(b){b.setState&&b.setState(a)})};a.prototype.setVisible=function(a,b){var d=this,c=d.chart,e=d.legendItem,h=c.options.chart.ignoreHiddenSeries,f=d.visible,g=(d.visible=a=d.options.visible=d.userOptions.visible="undefined"===typeof a?!f:a)?"show":"hide";["group","dataLabelsGroup","markerGroup","tracker","tt"].forEach(function(a){if(d[a])d[a][g]()});if(c.hoverSeries=== +d||(c.hoverPoint&&c.hoverPoint.series)===d)d.onMouseOut();e&&c.legend.colorizeItem(d,a);d.isDirty=!0;d.options.stacking&&c.series.forEach(function(a){a.options.stacking&&a.visible&&(a.isDirty=!0)});d.linkedSeries.forEach(function(b){b.setVisible(a,!1)});h&&(c.isDirtyBox=!0);F(d,g);!1!==b&&c.redraw()};a.prototype.show=function(){this.setVisible(!0)};a.prototype.hide=function(){this.setVisible(!1)};a.prototype.select=function(a){this.selected=a=this.options.selected="undefined"===typeof a?!this.selected: +a;this.checkbox&&(this.checkbox.checked=a);F(this,a?"select":"unselect")};a.prototype.shouldShowTooltip=function(a,b,d){void 0===d&&(d={});d.series=this;d.visiblePlotOnly=!0;return this.chart.isInsidePlot(a,b,d)};a.defaultOptions=u;return a}();y(a.prototype,{axisTypes:["xAxis","yAxis"],coll:"series",colorCounter:0,cropShoulder:1,directTouch:!1,drawLegendSymbol:z.drawLineMarker,isCartesian:!0,kdAxisArray:["clientX","plotY"],parallelArrays:["x","y"],pointClass:J,requireSorting:!0,sorted:!0});n.series= +a;"";"";return a});M(a,"Extensions/ScrollablePlotArea.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/Axis/Axis.js"],a["Core/Chart/Chart.js"],a["Core/Series/Series.js"],a["Core/Renderer/RendererRegistry.js"],a["Core/Utilities.js"]],function(a,w,C,E,z,x){var r=a.stop,u=x.addEvent,n=x.createElement,m=x.merge,g=x.pick;u(C,"afterSetChartSize",function(a){var c=this.options.chart.scrollablePlotArea,g=c&&c.minWidth;c=c&&c.minHeight;if(!this.renderer.forExport){if(g){if(this.scrollablePixelsX=g=Math.max(0, +g-this.chartWidth)){this.scrollablePlotBox=this.renderer.scrollablePlotBox=m(this.plotBox);this.plotBox.width=this.plotWidth+=g;this.inverted?this.clipBox.height+=g:this.clipBox.width+=g;var f={1:{name:"right",value:g}}}}else c&&(this.scrollablePixelsY=g=Math.max(0,c-this.chartHeight))&&(this.scrollablePlotBox=this.renderer.scrollablePlotBox=m(this.plotBox),this.plotBox.height=this.plotHeight+=g,this.inverted?this.clipBox.width+=g:this.clipBox.height+=g,f={2:{name:"bottom",value:g}});f&&!a.skipAxes&& +this.axes.forEach(function(a){f[a.side]?a.getPlotLinePath=function(){var c=f[a.side].name,e=this[c];this[c]=e-f[a.side].value;var g=w.prototype.getPlotLinePath.apply(this,arguments);this[c]=e;return g}:(a.setAxisSize(),a.setAxisTranslation())})}});u(C,"render",function(){this.scrollablePixelsX||this.scrollablePixelsY?(this.setUpScrolling&&this.setUpScrolling(),this.applyFixed()):this.fixedDiv&&this.applyFixed()});C.prototype.setUpScrolling=function(){var a=this,e={WebkitOverflowScrolling:"touch", +overflowX:"hidden",overflowY:"hidden"};this.scrollablePixelsX&&(e.overflowX="auto");this.scrollablePixelsY&&(e.overflowY="auto");this.scrollingParent=n("div",{className:"highcharts-scrolling-parent"},{position:"relative"},this.renderTo);this.scrollingContainer=n("div",{className:"highcharts-scrolling"},e,this.scrollingParent);u(this.scrollingContainer,"scroll",function(){a.pointer&&delete a.pointer.chartPosition});this.innerContainer=n("div",{className:"highcharts-inner-container"},null,this.scrollingContainer); +this.innerContainer.appendChild(this.container);this.setUpScrolling=null};C.prototype.moveFixedElements=function(){var a=this.container,e=this.fixedRenderer,g=".highcharts-contextbutton .highcharts-credits .highcharts-legend .highcharts-legend-checkbox .highcharts-navigator-series .highcharts-navigator-xaxis .highcharts-navigator-yaxis .highcharts-navigator .highcharts-reset-zoom .highcharts-drillup-button .highcharts-scrollbar .highcharts-subtitle .highcharts-title".split(" "),f;this.scrollablePixelsX&& +!this.inverted?f=".highcharts-yaxis":this.scrollablePixelsX&&this.inverted?f=".highcharts-xaxis":this.scrollablePixelsY&&!this.inverted?f=".highcharts-xaxis":this.scrollablePixelsY&&this.inverted&&(f=".highcharts-yaxis");f&&g.push(f+":not(.highcharts-radial-axis)",f+"-labels:not(.highcharts-radial-axis-labels)");g.forEach(function(c){[].forEach.call(a.querySelectorAll(c),function(a){(a.namespaceURI===e.SVG_NS?e.box:e.box.parentNode).appendChild(a);a.style.pointerEvents="auto"})})};C.prototype.applyFixed= +function(){var a=!this.fixedDiv,e=this.options.chart,l=e.scrollablePlotArea,f=z.getRendererType();a?(this.fixedDiv=n("div",{className:"highcharts-fixed"},{position:"absolute",overflow:"hidden",pointerEvents:"none",zIndex:(e.style&&e.style.zIndex||0)+2,top:0},null,!0),this.scrollingContainer&&this.scrollingContainer.parentNode.insertBefore(this.fixedDiv,this.scrollingContainer),this.renderTo.style.overflow="visible",this.fixedRenderer=e=new f(this.fixedDiv,this.chartWidth,this.chartHeight,this.options.chart.style), +this.scrollableMask=e.path().attr({fill:this.options.chart.backgroundColor||"#fff","fill-opacity":g(l.opacity,.85),zIndex:-1}).addClass("highcharts-scrollable-mask").add(),u(this,"afterShowResetZoom",this.moveFixedElements),u(this,"afterDrilldown",this.moveFixedElements),u(this,"afterLayOutTitles",this.moveFixedElements)):this.fixedRenderer.setSize(this.chartWidth,this.chartHeight);if(this.scrollableDirty||a)this.scrollableDirty=!1,this.moveFixedElements();e=this.chartWidth+(this.scrollablePixelsX|| +0);f=this.chartHeight+(this.scrollablePixelsY||0);r(this.container);this.container.style.width=e+"px";this.container.style.height=f+"px";this.renderer.boxWrapper.attr({width:e,height:f,viewBox:[0,0,e,f].join(" ")});this.chartBackground.attr({width:e,height:f});this.scrollingContainer.style.height=this.chartHeight+"px";a&&(l.scrollPositionX&&(this.scrollingContainer.scrollLeft=this.scrollablePixelsX*l.scrollPositionX),l.scrollPositionY&&(this.scrollingContainer.scrollTop=this.scrollablePixelsY*l.scrollPositionY)); +f=this.axisOffset;a=this.plotTop-f[0]-1;l=this.plotLeft-f[3]-1;e=this.plotTop+this.plotHeight+f[2]+1;f=this.plotLeft+this.plotWidth+f[1]+1;var m=this.plotLeft+this.plotWidth-(this.scrollablePixelsX||0),q=this.plotTop+this.plotHeight-(this.scrollablePixelsY||0);a=this.scrollablePixelsX?[["M",0,a],["L",this.plotLeft-1,a],["L",this.plotLeft-1,e],["L",0,e],["Z"],["M",m,a],["L",this.chartWidth,a],["L",this.chartWidth,e],["L",m,e],["Z"]]:this.scrollablePixelsY?[["M",l,0],["L",l,this.plotTop-1],["L",f,this.plotTop- +1],["L",f,0],["Z"],["M",l,q],["L",l,this.chartHeight],["L",f,this.chartHeight],["L",f,q],["Z"]]:[["M",0,0]];"adjustHeight"!==this.redrawTrigger&&this.scrollableMask.attr({d:a})};u(w,"afterInit",function(){this.chart.scrollableDirty=!0});u(E,"show",function(){this.chart.scrollableDirty=!0});""});M(a,"Core/Axis/StackingAxis.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/Axis/Axis.js"],a["Core/Utilities.js"]],function(a,w,C){var r=a.getDeferredAnimation,z=C.addEvent,x=C.destroyObjectProperties, +J=C.fireEvent,u=C.isNumber,n=C.objectEach,m;(function(a){function c(){var a=this.stacking;if(a){var c=a.stacks;n(c,function(a,e){x(a);c[e]=null});a&&a.stackTotalGroup&&a.stackTotalGroup.destroy()}}function e(){this.stacking||(this.stacking=new f(this))}var g=[];a.compose=function(a){-1===g.indexOf(a)&&(g.push(a),z(a,"init",e),z(a,"destroy",c));return a};var f=function(){function a(a){this.oldStacks={};this.stacks={};this.stacksTouched=0;this.axis=a}a.prototype.buildStacks=function(){var a=this.axis, +c=a.series,e=a.options.reversedStacks,f=c.length,g;if(!a.isXAxis){this.usePercentage=!1;for(g=f;g--;){var l=c[e?g:f-g-1];l.setStackedPoints();l.setGroupedPoints()}for(g=0;gl&&g.shadow));k&&(k.startX=c.xMap,k.isArea=c.isArea)})};n.prototype.getGraphPath=function(a,g,c){var e=this,l=e.options,f=[],m=[],n,k=l.step;a=a||e.points;var r=a.reversed;r&&a.reverse(); +(k={right:1,center:2}[k]||k&&3)&&r&&(k=4-k);a=this.getValidPoints(a,!1,!(l.connectNulls&&!g&&!c));a.forEach(function(q,r){var v=q.plotX,t=q.plotY,h=a[r-1];(q.leftCliff||h&&h.rightCliff)&&!c&&(n=!0);q.isNull&&!x(g)&&0a&&k>e?(k=Math.max(a,e),u=2*e-k):kg&&u>e?(u=Math.max(g,e),k=2*e-u):u=Math.abs(b)&&.5a.closestPointRange*a.xAxis.transA;h=a.borderWidth=B(c.borderWidth,h?0:1);var g=a.xAxis,k=a.yAxis,l=c.threshold,m=a.translatedThreshold=k.getThreshold(l),n=B(c.minPointLength,5),r=a.getColumnMetrics(),t=r.width,q=a.pointXOffset=r.offset,v=a.dataMin,u=a.dataMax,w=a.barW=Math.max(t,1+2*h);b.inverted&&(m-=.5);c.pointPadding&&(w=Math.ceil(w)); +x.prototype.translate.apply(a);a.points.forEach(function(d){var h=B(d.yBottom,m),p=999+Math.abs(h),y=d.plotX||0;p=e(d.plotY,-p,k.len+p);var x=Math.min(p,h),F=Math.max(p,h)-x,D=t,G=y+q,z=w;n&&Math.abs(F)n?h-n:m-(y?n:0));f(d.options.pointWidth)&&(D=z=Math.ceil(d.options.pointWidth),G-=Math.round((D-t)/2));c.centerInCategory&&(G=a.adjustForMissingColumns(G, +D,d,r));d.barX=G;d.pointWidth=D;d.tooltipPos=b.inverted?[e(k.len+k.pos-b.plotLeft-p,k.pos-b.plotLeft,k.len+k.pos-b.plotLeft),g.len+g.pos-b.plotTop-G-z/2,F]:[g.left-b.plotLeft+G+z/2,e(p+k.pos-b.plotTop,k.pos-b.plotTop,k.len+k.pos-b.plotTop),F];d.shapeType=a.pointClass.prototype.shapeType||"rect";d.shapeArgs=a.crispCol.apply(a,d.isNull?[G,m,z,0]:[G,x,z,F])})};h.prototype.drawGraph=function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")};h.prototype.pointAttribs=function(a, +b){var d=this.options,c=this.pointAttrToOptions||{},e=c.stroke||"borderColor",h=c["stroke-width"]||"borderWidth",f=a&&a.color||this.color,k=a&&a[e]||d[e]||f;c=a&&a.options.dashStyle||d.dashStyle;var l=a&&a[h]||d[h]||this[h]||0,m=B(a&&a.opacity,d.opacity,1);if(a&&this.zones.length){var n=a.getZone();f=a.options.color||n&&(n.color||a.nonZonedColor)||this.color;n&&(k=n.borderColor||k,c=n.dashStyle||c,l=n.borderWidth||l)}b&&a&&(a=D(d.states[b],a.options.states&&a.options.states[b]||{}),b=a.brightness, +f=a.color||"undefined"!==typeof b&&g(f).brighten(a.brightness).get()||f,k=a[e]||k,l=a[h]||l,c=a.dashStyle||c,m=B(a.opacity,m));e={fill:f,stroke:k,"stroke-width":l,opacity:m};c&&(e.dashstyle=c);return e};h.prototype.drawPoints=function(){var a=this,b=this.chart,c=a.options,e=b.renderer,h=c.animationLimit||250,f;a.points.forEach(function(d){var g=d.graphic,k=!!g,l=g&&b.pointCountv,"left"===t?m.y-=v?p.height:0:"center"===t?(m.x-=p.width/2,m.y-=p.height/2):"right"===t&&(m.x-=p.width,m.y-=v?0:p.height),c.placed=!0,c.alignAttr=m):(v(f),c.align(b,void 0,f),m=c.alignAttr);B&&0<=f.height?this.justifyDataLabel(c, +b,m,p,f,g):e(b.crop,!0)&&(x=h.isInsidePlot(m.x,m.y,{paneCoordinates:!0,series:d})&&h.isInsidePlot(m.x+p.width,m.y+p.height,{paneCoordinates:!0,series:d}));if(b.shape&&!r)c[g?"attr":"animate"]({anchorX:k?h.plotWidth-a.plotY:a.plotX,anchorY:k?h.plotHeight-a.plotX:a.plotY})}g&&l&&(c.placed=!1);x||l&&!B||(c.hide(!0),c.placed=!1)}function k(a,c){var b=c.filter;return b?(c=b.operator,a=a[b.property],b=b.value,">"===c&&a>b||"<"===c&&a="===c&&a>=b||"<="===c&&a<=b||"=="===c&&a==b||"==="===c&&a===b?!0: +!1):!0}function v(){var a=this,d=a.chart,b=a.options,f=a.points,g=a.hasRendered||0,t=d.renderer,q=b.dataLabels,v,u=q.animation;u=q.defer?r(d,u,a):{defer:0,duration:0};q=B(B(d.options.plotOptions&&d.options.plotOptions.series&&d.options.plotOptions.series.dataLabels,d.options.plotOptions&&d.options.plotOptions[a.type]&&d.options.plotOptions[a.type].dataLabels),q);n(this,"drawDataLabels");if(m(q)||q.enabled||a._hasPointLabels){var w=a.plotGroup("dataLabelsGroup","data-labels",g?"inherit":"hidden",q.zIndex|| +6);w.attr({opacity:+g});!g&&(g=a.dataLabelsGroup)&&(a.visible&&w.show(!0),g[b.animation?"animate":"attr"]({opacity:1},u));f.forEach(function(f){v=l(B(q,f.dlOptions||f.options&&f.options.dataLabels));v.forEach(function(h,g){var l=h.enabled&&(!f.isNull||f.dataLabelOnNull)&&k(f,h),m=f.connectors?f.connectors[g]:f.connector,n=f.dataLabels?f.dataLabels[g]:f.dataLabel,p=e(h.distance,f.labelDistance),r=!n;if(l){var q=f.getLabelConfig();var v=e(h[f.formatPrefix+"Format"],h.format);q=J(v)?x(v,q,d):(h[f.formatPrefix+ +"Formatter"]||h.formatter).call(q,h);v=h.style;var u=h.rotation;d.styledMode||(v.color=e(h.color,v.color,a.color,C.neutralColor100),"contrast"===v.color?(f.contrastColor=t.getContrast(f.color||a.color),v.color=!J(p)&&h.inside||0>p||b.stacking?f.contrastColor:C.neutralColor100):delete f.contrastColor,b.cursor&&(v.cursor=b.cursor));var B={r:h.borderRadius||0,rotation:u,padding:h.padding,zIndex:1};d.styledMode||(B.fill=h.backgroundColor,B.stroke=h.borderColor,B["stroke-width"]=h.borderWidth);c(B,function(a, +b){"undefined"===typeof a&&delete B[b]})}!n||l&&J(q)?l&&J(q)&&(n?B.text=q:(f.dataLabels=f.dataLabels||[],n=f.dataLabels[g]=u?t.text(q,0,-9999,h.useHTML).addClass("highcharts-data-label"):t.label(q,0,-9999,h.shape,null,null,h.useHTML,null,"data-label"),g||(f.dataLabel=n),n.addClass(" highcharts-data-label-color-"+f.colorIndex+" "+(h.className||"")+(h.useHTML?" highcharts-tracker":""))),n.options=h,n.attr(B),d.styledMode||n.css(v).shadow(h.shadow),n.added||n.add(w),h.textPath&&!h.useHTML&&(n.setTextPath(f.getDataLabelPath&& +f.getDataLabelPath(n)||f.graphic,h.textPath),f.dataLabelPath&&!h.textPath.enabled&&(f.dataLabelPath=f.dataLabelPath.destroy())),a.alignDataLabel(f,n,h,null,r)):(f.dataLabel=f.dataLabel&&f.dataLabel.destroy(),f.dataLabels&&(1===f.dataLabels.length?delete f.dataLabels:delete f.dataLabels[g]),g||delete f.dataLabel,m&&(f.connector=f.connector.destroy(),f.connectors&&(1===f.connectors.length?delete f.connectors:delete f.connectors[g])))})})}n(this,"afterDrawDataLabels")}function w(a,c,b,e,f,g){var d=this.chart, +h=c.align,k=c.verticalAlign,l=a.box?0:a.padding||0,m=c.x;m=void 0===m?0:m;var n=c.y;n=void 0===n?0:n;var p=(b.x||0)+l;if(0>p){"right"===h&&0<=m?(c.align="left",c.inside=!0):m-=p;var r=!0}p=(b.x||0)+e.width-l;p>d.plotWidth&&("left"===h&&0>=m?(c.align="right",c.inside=!0):m+=d.plotWidth-p,r=!0);p=b.y+l;0>p&&("bottom"===k&&0<=n?(c.verticalAlign="top",c.inside=!0):n-=p,r=!0);p=(b.y||0)+e.height-l;p>d.plotHeight&&("top"===k&&0>=n?(c.verticalAlign="bottom",c.inside=!0):n+=d.plotHeight-p,r=!0);r&&(c.x=m, +c.y=n,a.placed=!g,a.align(c,void 0,f));return r}function B(a,c){var b=[],d;if(m(a)&&!m(c))b=a.map(function(a){return g(a,c)});else if(m(c)&&!m(a))b=c.map(function(b){return g(a,b)});else if(m(a)||m(c))for(d=Math.max(a.length,c.length);d--;)b[d]=g(a[d],c[d]);else b=g(a,c);return b}function z(a,c,b,e,f){var d=this.chart,h=d.inverted,g=this.xAxis,k=g.reversed,l=h?c.height/2:c.width/2;a=(a=a.pointWidth)?a/2:0;c.startXPos=h?f.x:k?-l-a:g.width-l+a;c.startYPos=h?k?this.yAxis.height-l+a:-l-a:f.y;e?"hidden"=== +c.visibility&&(c.show(),c.attr({opacity:0}).animate({opacity:1})):c.attr({opacity:1}).animate({opacity:0},void 0,c.hide);d.hasRendered&&(b&&c.attr({x:c.startXPos,y:c.startYPos}),c.placed=!0)}var t=[];a.compose=function(a){if(-1===t.indexOf(a)){var c=a.prototype;t.push(a);c.alignDataLabel=f;c.drawDataLabels=v;c.justifyDataLabel=w;c.setDataLabelStartPos=z}}})(f||(f={}));"";return f});M(a,"Series/Column/ColumnDataLabel.js",[a["Core/Series/DataLabel.js"],a["Core/Series/SeriesRegistry.js"],a["Core/Utilities.js"]], +function(a,w,C){var r=w.series,z=C.merge,x=C.pick,J;(function(u){function n(a,c,e,l,f){var g=this.chart.inverted,m=a.series,k=a.dlBox||a.shapeArgs,n=x(a.below,a.plotY>x(this.translatedThreshold,m.yAxis.len)),u=x(e.inside,!!this.options.stacking);k&&(l=z(k),0>l.y&&(l.height+=l.y,l.y=0),k=l.y+l.height-m.yAxis.len,0\u25cf {series.name}
', +pointFormat:"x: {point.x}
y: {point.y}
"}});return m}(w);J(E.prototype,{drawTracker:a.prototype.drawTracker,sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1});x(E,"afterTranslate",function(){this.applyJitter()});C.registerSeriesType("scatter",E);"";return E});M(a,"Mixins/CenteredSeries.js",[a["Core/Globals.js"],a["Core/Series/Series.js"],a["Core/Utilities.js"]],function(a,w,C){var r=C.isNumber,z=C.pick, +x=C.relativeLength,J=a.deg2rad;return a.CenteredSeriesMixin={getCenter:function(){var a=this.options,n=this.chart,m=2*(a.slicedOffset||0),g=n.plotWidth-2*m,c=n.plotHeight-2*m,e=a.center,l=Math.min(g,c),f=a.size,r=a.innerSize||0;"string"===typeof f&&(f=parseFloat(f));"string"===typeof r&&(r=parseFloat(r));a=[z(e[0],"50%"),z(e[1],"50%"),z(f&&0>f?void 0:a.size,"100%"),z(r&&0>r?void 0:a.innerSize||0,"0%")];!n.angular||this instanceof w||(a[3]=0);for(e=0;4>e;++e)f=a[e],n=2>e||2===e&&/%$/.test(f),a[e]= +x(f,[g,c,l,a[2]][e])+(n?m:0);a[3]>a[2]&&(a[3]=a[2]);return a},getStartAndEndRadians:function(a,n){a=r(a)?a:0;n=r(n)&&n>a&&360>n-a?n:a+360;return{start:J*(a+-90),end:J*(n+-90)}}}});M(a,"Series/Pie/PiePoint.js",[a["Core/Animation/AnimationUtilities.js"],a["Core/Series/Point.js"],a["Core/Utilities.js"]],function(a,w,C){var r=this&&this.__extends||function(){var a=function(c,e){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var e in c)c.hasOwnProperty(e)&& +(a[e]=c[e])};return a(c,e)};return function(c,e){function g(){this.constructor=c}a(c,e);c.prototype=null===e?Object.create(e):(g.prototype=e.prototype,new g)}}(),z=a.setAnimation,x=C.addEvent,J=C.defined;a=C.extend;var u=C.isNumber,n=C.pick,m=C.relativeLength;w=function(a){function c(){var c=null!==a&&a.apply(this,arguments)||this;c.labelDistance=void 0;c.options=void 0;c.series=void 0;return c}r(c,a);c.prototype.getConnectorPath=function(){var a=this.labelPosition,c=this.series.options.dataLabels, +f=this.connectorShapes,g=c.connectorShape;f[g]&&(g=f[g]);return g.call(this,{x:a.final.x,y:a.final.y,alignment:a.alignment},a.connectorPosition,c)};c.prototype.getTranslate=function(){return this.sliced?this.slicedTranslation:{translateX:0,translateY:0}};c.prototype.haloPath=function(a){var c=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(c.x,c.y,c.r+a,c.r+a,{innerR:c.r-1,start:c.start,end:c.end})};c.prototype.init=function(){var c=this;a.prototype.init.apply(this, +arguments);this.name=n(this.name,"Slice");var g=function(a){c.slice("select"===a.type)};x(this,"select",g);x(this,"unselect",g);return this};c.prototype.isValid=function(){return u(this.y)&&0<=this.y};c.prototype.setVisible=function(a,c){var e=this,g=this.series,l=g.chart,k=g.options.ignoreHiddenPoint;c=n(c,k);a!==this.visible&&(this.visible=this.options.visible=a="undefined"===typeof a?!this.visible:a,g.options.data[g.data.indexOf(this)]=this.options,["graphic","dataLabel","connector","shadowGroup"].forEach(function(c){if(e[c])e[c][a? +"show":"hide"](a)}),this.legendItem&&l.legend.colorizeItem(this,a),a||"hover"!==this.state||this.setState(""),k&&(g.isDirty=!0),c&&l.redraw())};c.prototype.slice=function(a,c,f){var e=this.series;z(f,e.chart);n(c,!0);this.sliced=this.options.sliced=J(a)?a:!this.sliced;e.options.data[e.data.indexOf(this)]=this.options;this.graphic&&this.graphic.animate(this.getTranslate());this.shadowGroup&&this.shadowGroup.animate(this.getTranslate())};return c}(w);a(w.prototype,{connectorShapes:{fixedOffset:function(a, +c,e){var g=c.breakAt;c=c.touchingSliceAt;return[["M",a.x,a.y],e.softConnector?["C",a.x+("left"===a.alignment?-5:5),a.y,2*g.x-c.x,2*g.y-c.y,g.x,g.y]:["L",g.x,g.y],["L",c.x,c.y]]},straight:function(a,c){c=c.touchingSliceAt;return[["M",a.x,a.y],["L",c.x,c.y]]},crookedLine:function(a,c,e){c=c.touchingSliceAt;var g=this.series,f=g.center[0],n=g.chart.plotWidth,r=g.chart.plotLeft;g=a.alignment;var k=this.shapeArgs.r;e=m(e.crookDistance,1);n="left"===g?f+k+(n+r-f-k)*(1-e):r+(f-k)*e;e=["L",n,a.y];f=!0;if("left"=== +g?n>a.x||nc.x)f=!1;a=[["M",a.x,a.y]];f&&a.push(e);a.push(["L",c.x,c.y]);return a}}});return w});M(a,"Series/Pie/PieSeries.js",[a["Mixins/CenteredSeries.js"],a["Series/Column/ColumnSeries.js"],a["Core/Globals.js"],a["Core/Legend/LegendSymbol.js"],a["Core/Color/Palette.js"],a["Series/Pie/PiePoint.js"],a["Core/Series/Series.js"],a["Core/Series/SeriesRegistry.js"],a["Core/Renderer/SVG/Symbols.js"],a["Core/Utilities.js"]],function(a,w,C,E,z,x,J,u,n,m){var g=this&&this.__extends||function(){var a= +function(c,e){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var e in c)c.hasOwnProperty(e)&&(a[e]=c[e])};return a(c,e)};return function(c,e){function f(){this.constructor=c}a(c,e);c.prototype=null===e?Object.create(e):(f.prototype=e.prototype,new f)}}(),c=a.getStartAndEndRadians;C=C.noop;var e=m.clamp,l=m.extend,f=m.fireEvent,r=m.merge,q=m.pick,k=m.relativeLength;m=function(a){function l(){var c=null!==a&&a.apply(this,arguments)||this;c.center= +void 0;c.data=void 0;c.maxLabelDistance=void 0;c.options=void 0;c.points=void 0;return c}g(l,a);l.prototype.animate=function(a){var c=this,e=c.points,f=c.startAngleRad;a||e.forEach(function(a){var b=a.graphic,d=a.shapeArgs;b&&d&&(b.attr({r:q(a.startR,c.center&&c.center[3]/2),start:f,end:f}),b.animate({r:d.r,start:d.start,end:d.end},c.options.animation))})};l.prototype.drawEmpty=function(){var a=this.startAngleRad,c=this.endAngleRad,e=this.options;if(0===this.total&&this.center){var f=this.center[0]; +var d=this.center[1];this.graph||(this.graph=this.chart.renderer.arc(f,d,this.center[1]/2,0,a,c).addClass("highcharts-empty-series").add(this.group));this.graph.attr({d:n.arc(f,d,this.center[2]/2,0,{start:a,end:c,innerR:this.center[3]/2})});this.chart.styledMode||this.graph.attr({"stroke-width":e.borderWidth,fill:e.fillColor||"none",stroke:e.color||z.neutralColor20})}else this.graph&&(this.graph=this.graph.destroy())};l.prototype.drawPoints=function(){var a=this.chart.renderer;this.points.forEach(function(c){c.graphic&& +c.hasNewShapeType()&&(c.graphic=c.graphic.destroy());c.graphic||(c.graphic=a[c.shapeType](c.shapeArgs).add(c.series.group),c.delayedRendering=!0)})};l.prototype.generatePoints=function(){a.prototype.generatePoints.call(this);this.updateTotals()};l.prototype.getX=function(a,c,f){var h=this.center,d=this.radii?this.radii[f.index]||0:h[2]/2;a=Math.asin(e((a-h[1])/(d+f.labelDistance),-1,1));return h[0]+(c?-1:1)*Math.cos(a)*(d+f.labelDistance)+(01.5*Math.PI?w-=2*Math.PI:w<-Math.PI/2&&(w+=2*Math.PI);u.slicedTranslation={translateX:Math.round(Math.cos(w)*g),translateY:Math.round(Math.sin(w)*g)};B=Math.cos(w)*a[2]/2;var z=Math.sin(w)*a[2]/2;u.tooltipPos=[a[0]+.7*B,a[1]+.7*z];u.half=w<-Math.PI/2||w>Math.PI/2?1:0;u.angle= +w;x=Math.min(h,u.labelDistance/5);u.labelPosition={natural:{x:a[0]+B+Math.cos(w)*u.labelDistance,y:a[1]+z+Math.sin(w)*u.labelDistance},"final":{},alignment:0>u.labelDistance?"center":u.half?"right":"left",connectorPosition:{breakAt:{x:a[0]+B+Math.cos(w)*x,y:a[1]+z+Math.sin(w)*x},touchingSliceAt:{x:a[0]+B,y:a[1]+z}}}}f(this,"afterTranslate")};l.prototype.updateTotals=function(){var a=this.points,c=a.length,e=this.options.ignoreHiddenPoint,f,d=0;for(f=0;fv&&(a.dataLabel.css({width:Math.round(.7*v)+"px"}),a.dataLabel.shortened=!0)):(a.dataLabel=a.dataLabel.destroy(),a.dataLabels&&1===a.dataLabels.length&&delete a.dataLabels))}),z.forEach(function(e,f){var h=e.length,m=[],n;if(h){a.sortByAngle(e,f-.5);if(0k-g&&0===f&&(p=Math.round(N+ +Z-k+g),D[1]=Math.max(p,D[1])),0>W-U/2?D[0]=Math.max(Math.round(-W+U/2),D[0]):W+U/2>r&&(D[2]=Math.max(Math.round(W+U/2-r),D[2])),O.sideOverflow=p)}}}),0===m(D)||this.verifyDataLabelOverflow(D))&&(this.placeDataLabels(),this.points.forEach(function(c){T=e(b,c.options.dataLabels);if(J=l(T.connectorWidth,1)){var f;M=c.connector;if((O=c.dataLabel)&&O._pos&&c.visible&&0c.bottom-2?b:d,c.half,c)},justify:function(a,c,d){return d[0]+(a.half?-1:1)*(c+a.labelDistance)},alignToPlotEdges:function(a,c,d,b){a=a.getBBox().width;return c?a+b:d-a-b},alignToConnectors:function(a,c,d,b){var e=0,f;a.forEach(function(a){f=a.dataLabel.getBBox().width;f>e&& +(e=f)});return c?e+b:d-e-b}};q.compose=function(c){a.compose(n);-1===x.indexOf(c)&&(x.push(c),c=c.prototype,c.dataLabelPositioners=z,c.alignDataLabel=r,c.drawDataLabels=k,c.placeDataLabels=v,c.verifyDataLabelOverflow=w)}})(v||(v={}));return v});M(a,"Extensions/OverlappingDataLabels.js",[a["Core/Chart/Chart.js"],a["Core/Utilities.js"]],function(a,w){function r(a,g){var c=!1;if(a){var e=a.newOpacity;a.oldOpacity!==e&&(a.alignAttr&&a.placed?(a[e?"removeClass":"addClass"]("highcharts-data-label-hidden"), +c=!0,a.alignAttr.opacity=e,a[a.isOld?"animate":"attr"](a.alignAttr,null,function(){g.styledMode||a.css({pointerEvents:e?"auto":"none"})}),z(g,"afterHideOverlappingLabel")):a.attr({opacity:e}));a.isOld=!0}return c}var E=w.addEvent,z=w.fireEvent,x=w.isArray,J=w.isNumber,u=w.objectEach,n=w.pick;E(a,"render",function(){var a=this,g=[];(this.labelCollectors||[]).forEach(function(a){g=g.concat(a())});(this.yAxis||[]).forEach(function(a){a.stacking&&a.options.stackLabels&&!a.options.stackLabels.allowOverlap&& +u(a.stacking.stacks,function(a){u(a,function(a){a.label&&"hidden"!==a.label.visibility&&g.push(a.label)})})});(this.series||[]).forEach(function(c){var e=c.options.dataLabels;c.visible&&(!1!==e.enabled||c._hasPointLabels)&&(e=function(c){return c.forEach(function(c){c.visible&&(x(c.dataLabels)?c.dataLabels:c.dataLabel?[c.dataLabel]:[]).forEach(function(e){var f=e.options;e.labelrank=n(f.labelrank,c.labelrank,c.shapeArgs&&c.shapeArgs.height);f.allowOverlap?(e.oldOpacity=e.opacity,e.newOpacity=1,r(e, +a)):g.push(e)})})},e(c.nodes||[]),e(c.points))});this.hideOverlappingLabels(g)});a.prototype.hideOverlappingLabels=function(a){var g=this,c=a.length,e=g.renderer,l,f,m,n=!1;var k=function(a){var c,f=a.box?0:a.padding||0,g=c=0,d;if(a&&(!a.alignAttr||a.placed)){var b=a.alignAttr||{x:a.attr("x"),y:a.attr("y")};var k=a.parentGroup;a.width||(c=a.getBBox(),a.width=c.width,a.height=c.height,c=e.fontMetrics(null,a.element).h);var l=a.width-2*f;(d={left:"0",center:"0.5",right:"1"}[a.alignValue])?g=+d*l:J(a.x)&& +Math.round(a.x)!==a.translateX&&(g=a.x-a.translateX);return{x:b.x+(k.translateX||0)+f-(g||0),y:b.y+(k.translateY||0)+f-c,width:a.width-2*f,height:a.height-2*f}}};for(f=0;f=u.x+u.width||w.x+w.width<=u.x||w.y>=u.y+u.height|| +w.y+w.height<=u.y||((k.labelrank=u(e.minWidth,0)&&this.chartHeight>=u(e.minHeight,0)}).call(this)&&c.push(a._id)};a.prototype.setResponsive=function(a,c){var e=this,f=this.options.responsive,g=this.currentResponsive,l=[];!c&&f&&f.rules&&f.rules.forEach(function(a){"undefined"===typeof a._id&&(a._id=m());e.matchResponsiveRule(a,l)},this);c=x.apply(void 0,l.map(function(a){return C((f||{}).rules||[],function(c){return c._id===a})}).map(function(a){return a&&a.chartOptions})); +c.isResponsiveOptions=!0;l=l.toString()||void 0;l!==(g&&g.ruleIds)&&(g&&this.update(g.undoOptions,a,!0),l?(g=this.currentOptions(c),g.isResponsiveOptions=!0,this.currentResponsive={ruleIds:l,mergedOptions:c,undoOptions:g},this.update(c,a,!0)):this.currentResponsive=void 0)};return a}()})(g||(g={}));"";"";return g});M(a,"masters/highcharts.src.js",[a["Core/Globals.js"],a["Core/Utilities.js"],a["Core/DefaultOptions.js"],a["Core/Animation/Fx.js"],a["Core/Animation/AnimationUtilities.js"],a["Core/Renderer/HTML/AST.js"], +a["Core/FormatUtilities.js"],a["Core/Renderer/RendererUtilities.js"],a["Core/Renderer/SVG/SVGElement.js"],a["Core/Renderer/SVG/SVGRenderer.js"],a["Core/Renderer/HTML/HTMLElement.js"],a["Core/Renderer/HTML/HTMLRenderer.js"],a["Core/Axis/Axis.js"],a["Core/Axis/DateTimeAxis.js"],a["Core/Axis/LogarithmicAxis.js"],a["Core/Axis/PlotLineOrBand/PlotLineOrBand.js"],a["Core/Axis/Tick.js"],a["Core/Tooltip.js"],a["Core/Series/Point.js"],a["Core/Pointer.js"],a["Core/MSPointer.js"],a["Core/Legend/Legend.js"],a["Core/Chart/Chart.js"], +a["Core/Series/Series.js"],a["Core/Series/SeriesRegistry.js"],a["Series/Column/ColumnSeries.js"],a["Series/Column/ColumnDataLabel.js"],a["Series/Pie/PieSeries.js"],a["Series/Pie/PieDataLabel.js"],a["Core/Series/DataLabel.js"],a["Core/Responsive.js"],a["Core/Color/Color.js"],a["Core/Time.js"]],function(a,w,C,E,z,x,J,u,n,m,g,c,e,l,f,v,q,k,I,D,B,M,t,h,d,b,p,G,y,L,F,P,S){a.animate=z.animate;a.animObject=z.animObject;a.getDeferredAnimation=z.getDeferredAnimation;a.setAnimation=z.setAnimation;a.stop=z.stop; +a.timers=E.timers;a.AST=x;a.Axis=e;a.Chart=t;a.chart=t.chart;a.Fx=E;a.Legend=M;a.PlotLineOrBand=v;a.Point=I;a.Pointer=B.isRequired()?B:D;a.Series=h;a.SVGElement=n;a.SVGRenderer=m;a.Tick=q;a.Time=S;a.Tooltip=k;a.Color=P;a.color=P.parse;c.compose(m);g.compose(n);a.defaultOptions=C.defaultOptions;a.getOptions=C.getOptions;a.time=C.defaultTime;a.setOptions=C.setOptions;a.dateFormat=J.dateFormat;a.format=J.format;a.numberFormat=J.numberFormat;a.addEvent=w.addEvent;a.arrayMax=w.arrayMax;a.arrayMin=w.arrayMin; +a.attr=w.attr;a.clearTimeout=w.clearTimeout;a.correctFloat=w.correctFloat;a.createElement=w.createElement;a.css=w.css;a.defined=w.defined;a.destroyObjectProperties=w.destroyObjectProperties;a.discardElement=w.discardElement;a.distribute=u.distribute;a.erase=w.erase;a.error=w.error;a.extend=w.extend;a.extendClass=w.extendClass;a.find=w.find;a.fireEvent=w.fireEvent;a.getMagnitude=w.getMagnitude;a.getStyle=w.getStyle;a.inArray=w.inArray;a.isArray=w.isArray;a.isClass=w.isClass;a.isDOMElement=w.isDOMElement; +a.isFunction=w.isFunction;a.isNumber=w.isNumber;a.isObject=w.isObject;a.isString=w.isString;a.keys=w.keys;a.merge=w.merge;a.normalizeTickInterval=w.normalizeTickInterval;a.objectEach=w.objectEach;a.offset=w.offset;a.pad=w.pad;a.pick=w.pick;a.pInt=w.pInt;a.relativeLength=w.relativeLength;a.removeEvent=w.removeEvent;a.seriesType=d.seriesType;a.splat=w.splat;a.stableSort=w.stableSort;a.syncTimeout=w.syncTimeout;a.timeUnits=w.timeUnits;a.uniqueKey=w.uniqueKey;a.useSerialIds=w.useSerialIds;a.wrap=w.wrap; +p.compose(b);L.compose(h);l.compose(e);f.compose(e);y.compose(G);v.compose(e);F.compose(t);return a});a["masters/highcharts.src.js"]._modules=a;return a["masters/highcharts.src.js"]}); +//# sourceMappingURL=highcharts.js.map diff --git a/js/icsCalendar.js b/js/icsCalendar.js new file mode 100755 index 0000000..ff1c812 --- /dev/null +++ b/js/icsCalendar.js @@ -0,0 +1,814 @@ +function CalendarDate (existingLi) { + if (existingLi) { + this.li = existingLi; + this.fromHTML(); + } else this.li = document.createElement('li'); +} +CalendarDate.prototype = { + lang : { + de : { monthNames:['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'] }, + en : { monthNames:['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] }, + get : function (key) { + if (!this.l) { + this.l = navigator.language; + if (!this[this.l]) this.l = 'en'; + } + return (this[this.l][key])?this[this.l][key]:key; + } + }, + + // public readonly + li : null, + start : null, + end : null, + sourceId : -1, + completeDay : false, + title : '', + location : '', + description : '', + url : '', + status : '', + repeatMode : 0, + repeatNr : 0, + repeatEnd : null, + + parseRrule : /* local */ function (rrule) { + if (rrule == '') return; + rrule = rrule.split(';'); + for (var k = 0; k < rrule.length; k++) { + rrule[k] = rrule[k].toUpperCase().split('='); + if (rrule[k].length == 1) continue; + switch (rrule[k][0]) { + case 'FREQ': + if (rrule[k][1] == 'MONTHLY' && this.repeatMode == 0) this.repeatMode = 1; + if (rrule[k][1] == 'MONTHLY' && this.repeatMode == -3) this.repeatMode = 3; + if (rrule[k][1] == 'DAILY') this.repeatMode = 2; + break; + case 'UNTIL': + if (rrule[k][1].length != 8) break; + var y = parseInt(rrule[k][1].substring(0, rrule[k][1].length-4)); + var m = parseInt(rrule[k][1].substring(rrule[k][1].length-4, rrule[k][1].length-2)); + var d = parseInt(rrule[k][1].substring(rrule[k][1].length-2, rrule[k][1].length)); + this.repeatEnd = new Date(y, m-1, d, 0, 0, 0, 0); + break; + case 'INTERVAL': + if (this.repeatNr == 0) this.repeatNr = parseInt(rrule[k][1]); + else this.repeatNr = -parseInt(rrule[k][1]); + break; + case 'BYDAY': + if (this.repeatMode == 0) this.repeatMode = -3; // will be set to +3 when FREQ is monthly. + else if (this.repeatMode == 1) this.repeatMode = 3; + if (parseInt(rrule[k][1]) < 0) { + if (this.repeatNr == 0) this.repeatNr = -Number.MAX_VALUE; // just remember to make value negative for INTERVAL parsing + else this.repeatNr = -this.repeatNr; + } + break; + } + } + if (this.repeatMode < 0) this.repeatMode = 0; // invalid combination of rules + }, + + getMonthRepetitionI : /* private */ function (currentDateTime) { + if (this.completeDay) var spl = new Array(this.start.getUTCFullYear(), this.start.getUTCMonth()+1, this.start.getUTCDate()); + else var spl = new Array(this.start.getFullYear(), this.start.getMonth()+1, this.start.getDate()); + var repI = spl[0]*32*12 + (spl[1]-1)*32 + spl[2]; + var currI = currentDateTime.getFullYear()*32*12 + (currentDateTime.getMonth()-1)*32 + currentDateTime.getDate(); + if (currI > repI) + repI += Math.ceil((currI - repI + 0.0) / (this.repeatNr*32)) * this.repeatNr*32; + return repI; + }, + + lastDayOfMonth : /* private */ function (Y, m) { + if (m == 4 || m == 6 || m == 9 || m == 11) return 30; + else if (m == 2) { + if ((Y % 4) == 0 && ((Y % 100) != 0 || (Y % 400) == 0)) return 29; + else return 28; + } else return 31; + }, + + getNearestRepetition : /* local */ function (currentDateTime) { + switch (this.repeatMode) { + case 1: // every n month repeating event + if (this.repeatNr <= 0) break; + var repI = this.getMonthRepetitionI(currentDateTime); + for (var i = 0; i < 100; i += this.repeatNr) { // if after adding 8 years, no valid date is found, it may never exist! + var Y = Math.floor((repI >> 5) / 12); + var m = (repI >> 5) % 12 + 1; + var d = repI & 31; + var checkdate = null; + try { + checkdate = new Date(Y, m-1, d, this.start.getHours(), this.start.getMinutes(), 0, 0); + } catch (e) { checkdate = null; } + if (checkdate && checkdate.getFullYear() == Y && checkdate.getMonth() == m-1 && checkdate.getDate() == d) { + if (this.repeatEnd && checkdate > this.repeatEnd) break; + if (checkdate >= currentDateTime) return checkdate; + } + repI += this.repeatNr*32; + } + break; + case 2: // every n days repeating event + if (this.repeatNr <= 0) break; + var result = new Date(this.start); + var th = result.getHours(); + var tm = result.getMinutes(); + result.setHours(12); // set to midday, to prevent day missmatch due to summer/winter time gap + result.setMinutes(0); + if (currentDateTime > this.start) { + var dayDiff = Math.floor((currentDateTime - this.start) / (1000 * 3600 * 24)); + result.setDate(result.getDate() + (Math.ceil((dayDiff+0.1) / this.repeatNr)*this.repeatNr)); + } + if (this.repeatEnd && result > this.repeatEnd) break; + result.setHours(th); + result.setMinutes(tm); + return result; + case 3: + if (this.repeatNr == 0) break; + var weekday = this.start.getDay(); + if (this.repeatNr > 0) { + var ld = 1; + var weekNr = Math.floor((this.start.getDate()-1) / 7); + } else { + var ld = this.lastDayOfMonth(this.start.getFullYear(), this.start.getMonth()+1); + var weekNr = Math.floor((ld - this.start.getDate()) / 7); + } + var repI = this.getMonthRepetitionI(currentDateTime); + for (var i = 0; i < 100; i++) { + var Y = Math.floor((repI >> 5) / 12); + var m = (repI >> 5) % 12 + 1; + if (this.repeatNr < 0) ld = this.lastDayOfMonth(Y, m); + var result = new Date(Y, m-1, ld, this.start.getHours(), this.start.getMinutes(), 0, 0); + if (this.repeatNr > 0) result.setDate(result.getDate() + (((weekday + 7 - result.getDay()) % 7) + weekNr * 7)); + else result.setDate(result.getDate() - (weekNr * 7 + ((result.getDay() - weekday + 7) % 7))); + if (this.repeatEnd && result > this.repeatEnd) break; + if ((result >= currentDateTime) && (result.getMonth()+1 == m)) + return result; + repI += 32 * Math.abs(this.repeatNr); + } + break; + } + result = new Date(this.start); + return result; + }, + + fromHTML : /* private */ function () { + if (this.start) throw 'Date already created!'; + this.completeDay = true; + var span = this.li.getElementsByTagName('span'); + for (var j = 0; j < span.length; j++) { + var className = ' '+span[j].className+' '; + if (className.indexOf(' date ') != -1) { // parse date + d = span[j].textContent.split('.'); + if (d.length != 3) d.unshift('-1'); + d[0] = Number.parseInt(d[0]); + d[1] = Number.parseInt(d[1]); + d[2] = Number.parseInt(d[2]); + if (d[0] > 31) d.reverse(); + this.start = new Date(d[2], d[1]-1, d[0], 0, 0, 0, 0); + } else if (className.indexOf(' title ') != -1) this.title = span[j].textContent; + else if (className.indexOf(' location ') != -1) this.location = span[j].textContent; + else if (className.indexOf(' description ') != -1) this.description = span[j].textContent; + } + if (this.li.getElementsByTagName('a').length > 0) this.url = this.li.getElementsByTagName('a')[0].href; + }, + + updateHTML : /* public */ function () { + var m = this.start.getMinutes().toString(); + if (m.length == 1) m = '0'+m; + var a_begin = ''; + var a_end = ''; + var hostAndProtocol = window.location.href.substring(0, window.location.href.indexOf(window.location.hostname))+window.location.hostname; + if (this.url) { + var target = '_blank'; + if (this.url.indexOf(hostAndProtocol) == 0) target = '_self'; + a_begin = '
'+"\n"; + a_end = '<\/A>'+"\n"; + } + this.li.innerHTML = + a_begin + +'
'+"\n" + +'
'+"\n" + +' '+this.start.getDate()+'. '+this.lang.get('monthNames')[this.start.getMonth()]+' '+this.start.getFullYear()+'<\/SPAN>'+"\n" + +((this.completeDay)?' '+this.start.getHours()+':'+m+'<\/SPAN>'+"\n":'') + +' <\/DIV>'+"\n" + +'
'+"\n" + +' '+this.makeupText(this.title)+'<\/SPAN>'+"\n" + +' '+this.makeupText(this.location)+'<\/SPAN>'+"\n" + +' '+this.makeupText(this.description)+'<\/SPAN>'+"\n" + +' <\/DIV>'+"\n" + +'<\/DIV>'+"\n" + +a_end; + }, + + makeupText : /* private */ function (text) { + if (!text) text = ''; + text = text.replace(/&/g, '&'); + text = text.replace(//g, '>'); + text = text.replace(/\n/g, '
'); + text = text.split(' '); + for (var i = 0; i < text.length; i++) { + if (text[i].substring(0, 8) == 'https:\/\/' || text[i].substring(0, 7) == 'http:\/\/') { + if (i > 0 && text[i-1].substring(text[i-1].length-1, text[i-1].length) == ':') { + text[i-1] = '
'+text[i-1].substring(0, text[i-1].length-1)+'<\/A>'; + text[i] = ''; + } else text[i] = ''+text[i]+'<\/A>'; + } + } + return text.join(' '); + } +}; + + + + +function ICSCalendar (calendarBox) { + var _this = this; + this.calendarBox = calendarBox; + this.dates = new Array(); + this.sources = new Array(); + // find or create ul + if (!this.calendarBox) throw 'No calendar element given!'; + if (calendarBox.calendarObject) throw 'Calendar for given element already created!'; + calendarBox.calendarObject = this; + if (this.calendarBox.getElementsByTagName('ul').length > 0) this.ul = this.calendarBox.getElementsByTagName('ul')[0]; + if (!this.ul) { + this.ul = document.createElement('ul'); + this.calendarBox.appendChild(this.ul); + } else { + for (var i = 0; i < this.ul.getElementsByTagName('li').length; i++) { + var ndate = new CalendarDate(this.ul.getElementsByTagName('li')[i]); + ndate.updateHTML(); + this.dates.push(ndate); + } + this.ul.innerHTML = ''; + } + this.ul.className = 'dates'; + this.filterBox = document.createElement('div'); + this.filterBox.style.display = 'none'; + this.filterLink = document.createElement('a'); + this.filterLink.className = 'button'; + this.filterLink.href = 'javascript: /* show filter */'; + this.filterLink.textContent = this.lang.get('filterlink'); + this.filterLink.cal = this; + this.filterLink.addEventListener('click', function () { + this.cal.filterBox.style.display = 'block'; + this.cal.filterLink.style.display = 'none'; + }, false); + this.calendarBox.insertBefore(this.filterBox, this.ul); + this.calendarBox.insertBefore(this.filterLink, this.ul); + // interpret calendar settings + var srcs = this.calendarBox.getElementsByTagName('source'); + function getAttributeOrEmpty(srcEl, attr) { + var r = srcEl.getAttribute(attr); + if (!r) r = ''; + return r; + } + for (var i = 0; i < srcs.length; i++) { + var nsrc = { + state : 0, // 0=never fetched 1=currently loading 2=successfully fetched, 3=error + src : getAttributeOrEmpty(srcs[i], 'src'), + generator : getAttributeOrEmpty(srcs[i], 'generator'), + user : getAttributeOrEmpty(srcs[i], 'user'), + password : getAttributeOrEmpty(srcs[i], 'password'), + selected : { + promoters : getAttributeOrEmpty(srcs[i], 'filterPromoters').split(','), + categories : getAttributeOrEmpty(srcs[i], 'filterCategories').split(',') + }, + filterTypes : { // 0=no filter 1=whitelist 2=blacklist + promoters : 1, + categories : 1 + } + }; + if (nsrc.src.indexOf('./') == 0) { + var spl = window.location.href.split('?')[0].split('#')[0].split('/'); + if (spl[spl.length-1].lastIndexOf('.htm') >= spl[spl.length-1].length-5 || spl[spl.length-1] == '') + spl.pop(); + nsrc.src = spl.join('/')+'/'+nsrc.src.substring(2); + } + for (var f in nsrc.selected) { + if (nsrc.selected[f][0].indexOf('~') == 0) { + nsrc.selected[f][0] = nsrc.selected[f][0].substring(1); + nsrc.filterTypes[f] = 2; + } + while (nsrc.selected[f].length > 0 && nsrc.selected[f][0] == '') nsrc.selected[f].shift(); + for (var j = 0; j < nsrc.selected[f].length; j++) nsrc.selected[f][j] = parseInt(nsrc.selected[f][j]); + if (nsrc.selected[f].length == 0) nsrc.filterTypes[f] = 0; + } + this.sources.push(nsrc); + if (nsrc.generator == 'phpBB-calendar') { // autodetect nsrc.src.lastIndexOf('\/app.php\/calendar\/') == nsrc.src.length - 18 + if (!this.earlierDatesEl) { + this.earlierDatesEl = document.createElement('a'); + this.earlierDatesEl.href = 'javascript:'; + this.earlierDatesEl.addEventListener('click', function () { _this.loadEarlierDates(); }); + this.earlierDatesEl.className = 'earlierDatesLink button'; + this.earlierDatesEl.textContent = this.lang.get('earlierDates'); + this.calendarBox.appendChild(this.earlierDatesEl); + } + nsrc.shortSrc = nsrc.src; + this.getFilterInfo(this.sources.length-1); + this.updateUrl(this.sources.length-1, false); + } else { // create sync link for fixed url ics + this.getSimpleInfo(this.sources.length-1); + } + } + this.update(); +} +ICSCalendar.prototype = { + lang : { + de : { + filterError:'Fehler beim ermitteln der Filter-Möglichkeiten.', promoters:'Veranstalterinnen', categories:'Kategorien', update:'aktualisieren', all:'alle', whitelist:'nur die Folgenden...', blacklist:'alle außer...', + synchint:'Synchronisieren Sie die folgende URL als iCalendar, um die Termine in andere Anwendungen zu übernehmen.', filterlink:'Filtern und Synchronisieren', + timeRange:'Zeitfenster', timeRangeSince:'Alle ab # Tagen vor heute', timeRangeDates:'Von # bis #', earlierDates:String.fromCharCode(8595)+' frühere Termine '+String.fromCharCode(8595) + }, + en : { + filterError:'Error getting filter information.', promoters:'Promoters', categories:'Categories', update:'update', all:'all', whitelist:'just the following...', blacklist:'all except of...', + synchint:'Synchronize the following URL as a iCalendar, to get the dates into other applications.', filterlink:'filter and synchronize', + timeRange:'time range', timeRangeSince:'All since # days before now', timeRangeDates:'From # til #', earlierDates:String.fromCharCode(8595)+' earlier dates '+String.fromCharCode(8595) + }, + get : function (key) { + if (!this.l) { + this.l = navigator.language; + if (!this[this.l]) this.l = 'en'; + } + return (this[this.l][key])?this[this.l][key]:key; + } + }, + + // private + calendarBox : null, + ul : null, + filterBox : null, + filterLink : null, + dates : null, + sources : null, + earlierDatesEl : null, + + loadEarlierDates : /* private */ function () { + var _this = this; + for (var sid = 0; sid < this.sources.length; sid++) { + if (!this.sources[sid].earliestDate) continue; + var to = this.sources[sid].earliestDate; + var from = new Date(to); + from.setDate(to.getDate() - parseInt(this.sources[sid].filterInfo.maxDays)); + this.sources[sid].earliestDate = from; + var src = this.sources[sid].src.split('?'); + if (src.length == 1) src.push(); + src[1] = src[1].split('&'); + for (var i = src[1].length-1; i >= 0; i--) + if (src[1][i].indexOf('from=') == 0 || src[1][i].indexOf('to=') == 0) + src[1].splice(i, 1); + src[1].push('from='+from.getFullYear()+'-'+(from.getMonth()+1)+'-'+from.getDate()); + src[1].push('to='+to.getFullYear()+'-'+(to.getMonth()+1)+'-'+to.getDate()); + src[1] = src[1].join('&'); + this.sources[sid].src = src.join('?'); + this.loadSource(sid, function (_sid) { + _this.addDatesFromSrc(_sid); + _this.sortAndPrintDates(); + }); + } + }, + + filterHtmlVisualization : /* private */ function (sid, key) { + function radioChange () { + if (this.elementsDeactivate) + for (var i = 0; i < this.elementsDeactivate.length; i++) + for (var j = 0; j < this.elementsDeactivate[i].getElementsByTagName('input').length; j++) + this.elementsDeactivate[i].getElementsByTagName('input')[j].disabled = this.checked; + if (this.elementsActivate) + for (var i = 0; i < this.elementsActivate.length; i++) + for (var j = 0; j < this.elementsActivate[i].getElementsByTagName('input').length; j++) + this.elementsActivate[i].getElementsByTagName('input')[j].disabled = !this.checked; + } + var filter = this.sources[sid].filterInfo[key]; + var col = document.createElement('form'); + col.setAttribute('filterKey', key); + var b = document.createElement('b'); + b.textContent = this.lang.get(key)+':'; + col.appendChild(b); + var radioRow = document.createElement('div'); + radioRow.className = 'radioRow'; + col.appendChild(radioRow); + if (key == 'timeRange') { + var l = document.createElement('label'); + var radio = document.createElement('input'); + radio.checked = true; + radio.setAttribute('name', 'timeRangeType'); + radio.setAttribute('type', 'radio'); + l.appendChild(radio); + var spl = this.lang.get('timeRangeSince').split('#'); + spl.push(''); + l.appendChild(document.createTextNode(spl[0])); + l.style.marginRight = '0px'; + radioRow.appendChild(l); + var inp = document.createElement('input'); + inp.setAttribute('type', 'number'); + inp.setAttribute('name', 'days'); + var maxDays = parseInt(this.sources[sid].filterInfo.maxDays); + inp.setAttribute('max', maxDays); + inp.value = Math.ceil(maxDays/2); + inp.defaultValue = inp.value; + this.sources[sid].earliestDate = new Date(); + this.sources[sid].earliestDate.setDate(this.sources[sid].earliestDate.getDate() - parseInt(inp.value)); + inp.style.width = '30px'; + radioRow.appendChild(inp); + l = document.createElement('label'); + l.textContent = spl[1]; + radioRow.appendChild(l); + radioRow = document.createElement('div'); + radioRow.className = 'radioRow'; + l = document.createElement('label'); + radio = document.createElement('input'); + radio.checked = false; + radio.setAttribute('name', 'timeRangeType'); + radio.setAttribute('type', 'radio'); + l.appendChild(radio); + spl = this.lang.get('timeRangeDates').split('#'); + spl.push(''); + spl.push(''); + l.appendChild(document.createTextNode(spl[0])); + l.style.marginRight = '0px'; + radioRow.appendChild(l); + inp = document.createElement('input'); + inp.setAttribute('type', 'date'); + inp.setAttribute('name', 'dateFrom'); + radioRow.appendChild(inp); + l = document.createElement('label'); + l.textContent = spl[1]; + l.style.marginRight = '0px'; + radioRow.appendChild(l); + inp = document.createElement('input'); + inp.setAttribute('type', 'date'); + inp.setAttribute('name', 'dateTo'); + radioRow.appendChild(inp); + l = document.createElement('label'); + l.textContent = spl[2]; + radioRow.appendChild(l); + col.appendChild(radioRow); + } else { + var list = document.createElement('div'); + var l = document.createElement('label'); + var radio = document.createElement('input'); + radio.setAttribute('name', 'filtertype'); + radio.checked = this.sources[sid].filterTypes[key] == 0; + radio.setAttribute('type', 'radio'); + radio.addEventListener('change', radioChange); + radio.elementsDeactivate = [list]; + l.appendChild(radio); + l.appendChild(document.createTextNode(this.lang.get('all'))); + radioRow.appendChild(l); + l = document.createElement('label'); + radio = document.createElement('input'); + radio.checked = this.sources[sid].filterTypes[key] == 1; + radio.setAttribute('name', 'filtertype'); + radio.setAttribute('type', 'radio'); + radio.addEventListener('change', radioChange); + radio.elementsActivate = [list]; + l.appendChild(radio); + l.appendChild(document.createTextNode(this.lang.get('whitelist'))); + radioRow.appendChild(l); + l = document.createElement('label'); + radio = document.createElement('input'); + radio.checked = this.sources[sid].filterTypes[key] == 2; + radio.setAttribute('name', 'filtertype'); + radio.setAttribute('type', 'radio'); + radio.addEventListener('change', radioChange); + radio.elementsActivate = [list]; + l.appendChild(radio); + l.appendChild(document.createTextNode(this.lang.get('blacklist'))); + radioRow.appendChild(l); + col.appendChild(list); + list.className = 'filterList'; + for (var i = 0; i < filter.length; i++) { + var label = document.createElement('label'); + var cb = document.createElement('input'); + cb.checked = this.sources[sid].selected[key].indexOf(filter[i].id) >= 0; + cb.disabled = true; + cb.type = 'checkbox'; + cb.setAttribute('filterId', filter[i].id); + label.appendChild(cb); + label.appendChild(document.createTextNode(filter[i].title)); + list.appendChild(label); + } + } + return col; + }, + + rmHTTP : /* private */ function (url) { + if (url.toLowerCase().indexOf('http:\/\/') == 0) return url.substr(7); + if (url.toLowerCase().indexOf('https:\/\/') == 0) return url.substr(8); + return url; + }, + + updateUrl : /* private */ function (sid, updateCalendar) { + var url = this.sources[sid].shortSrc+'?action=ics'; + if (this.sources[sid].user != '') url += '&user='+encodeURIComponent(this.sources[sid].user)+'&password='+encodeURIComponent(this.sources[sid].password); + if (this.sources[sid].settingsEl) { + var cols = this.sources[sid].settingsEl.getElementsByTagName('form'); + for (var i = 0; i < cols.length; i++) { + var filterKey = cols[i].getAttribute('filterKey'); + if (filterKey == '') continue; + if (filterKey == 'timeRange') { + if (cols[i].getElementsByTagName('input')[0].checked) { + this.sources[sid].earliestDate = new Date(); + this.sources[sid].earliestDate.setDate(this.sources[sid].earliestDate.getDate() - parseInt(cols[i].days.value)); + if (cols[i].days.defaultValue != cols[i].days.value) + url += '&from=D'+(-parseInt(cols[i].days.value)); + } else { + this.sources[sid].earliestDate = null; + if (cols[i].dateFrom.value != '') { + url += '&from='+cols[i].dateFrom.value; + this.sources[sid].earliestDate = cols[i].dateFrom.valueAsDate; + } + if (!this.sources[sid].earliestDate) { + this.sources[sid].earliestDate = new Date(); + this.sources[sid].earliestDate.setDate(this.sources[sid].earliestDate.getDate() - parseInt(cols[i].days.defaultValue)); + } + var dTo = null; + if (cols[i].dateTo.value != '') { + dTo = cols[i].dateTo.valueAsDate; + url += '&to='+cols[i].dateTo.value; + } + if (!dTo) dTo = new Date(); + var diff = (dTo - this.sources[sid].earliestDate) / (1000 * 60 * 60 * 24); + if (diff > parseInt(cols[i].days.max)) { + this.sources[sid].earliestDate = dTo; + this.sources[sid].earliestDate.setDate(this.sources[sid].earliestDate.getDate() - parseInt(cols[i].days.max)); + } + } + } else { + if (cols[i].getElementsByTagName('input')[0].checked) this.sources[sid].filterTypes[filterKey] = 0; + if (cols[i].getElementsByTagName('input')[1].checked) this.sources[sid].filterTypes[filterKey] = 1; + if (cols[i].getElementsByTagName('input')[2].checked) this.sources[sid].filterTypes[filterKey] = 2; + var filterList = null; + for (var j = 0; j < cols[i].getElementsByTagName('div').length; j++) + if ((' '+cols[i].getElementsByTagName('div')[j].className+' ').indexOf(' filterList ') != -1) { + filterList = cols[i].getElementsByTagName('div')[j].getElementsByTagName('input'); + break; + } + this.sources[sid].selected[filterKey] = new Array(); + if (filterList) + for (var j = 0; j < filterList.length; j++) + if (filterList[j].checked) + this.sources[sid].selected[filterKey].push(filterList[j].getAttribute('filterId')); + } + } + } + for (var f in this.sources[sid].selected) { + if (this.sources[sid].filterTypes[f] == 0 || this.sources[sid].selected[f].length == 0) continue; + url += '&'+f+'='; + if (this.sources[sid].filterTypes[f] == 2) url += '~,'; + url += this.sources[sid].selected[f].join(','); + } + this.sources[sid].syncUrl.textContent = url; + this.sources[sid].syncUrl.href = 'webcal://'+this.rmHTTP(url); + this.sources[sid].src = url; + if (updateCalendar) this.update(); + }, + + getSimpleInfo : /* private */ function (sid) { // creates a settings-block for simple ics-file sources + this.sources[sid].settingsEl = document.createElement('div'); + this.filterBox.appendChild(this.sources[sid].settingsEl); + var syncUrl = document.createElement('a'); + syncUrl.href = this.sources[sid].src; + this.sources[sid].settingsEl.appendChild(syncUrl); + var absUrl = syncUrl.href; // this way, an absoute path is guaranteed + syncUrl.textContent = absUrl; + absUrl = absUrl.split('\/\/'); + if (absUrl.length > 1) absUrl[0] = 'webcal:'; + syncUrl.href = absUrl.join('\/\/'); + }, + + getFilterInfo : /* private */ function (sid) { // creates a settings-block for phpBB-calendar based sources + var _this = this; + this.sources[sid].settingsEl = document.createElement('div'); + this.filterBox.appendChild(this.sources[sid].settingsEl); + var syncUrl = document.createElement('a'); + _this.sources[sid].syncUrl = syncUrl; + var xmlHttp = new XMLHttpRequest(); + xmlHttp.open('GET', this.sources[sid].shortSrc+'?action=filterinfo', true); + xmlHttp.onreadystatechange = function () { + if (xmlHttp.readyState != 4) return; + try { + _this.sources[sid].filterInfo = JSON.parse(xmlHttp.responseText); + } catch (e) { + _this.sources[sid].settingsEl.innerHTML = _this.lang.get('filterError'); + return; + } + if (_this.sources[sid].filterInfo.promoters) _this.sources[sid].settingsEl.appendChild(_this.filterHtmlVisualization(sid, 'promoters')); + if (_this.sources[sid].filterInfo.categories) _this.sources[sid].settingsEl.appendChild(_this.filterHtmlVisualization(sid, 'categories')); + _this.sources[sid].settingsEl.appendChild(_this.filterHtmlVisualization(sid, 'timeRange')); + var syncBox = document.createElement('div'); + var updateBut = document.createElement('a'); + updateBut.href = 'javascript: /* update */'; + updateBut.className = 'button'; + updateBut.textContent = _this.lang.get('update')+' -> '; + updateBut.cal = _this; + updateBut.sid = sid; + updateBut.addEventListener('click', function () { this.cal.updateUrl(this.sid, true); }, false); + var syncHint = document.createElement('p'); + syncHint.innerHTML = _this.lang.get('synchint'); + syncBox.appendChild(syncHint); + syncBox.appendChild(updateBut); + syncBox.appendChild(syncUrl); + _this.sources[sid].settingsEl.appendChild(syncBox); + }; + xmlHttp.onerror = function () { + _this.sources[sid].settingsEl.innerHTML = _this.lang.get('filterError'); + }; + try { + xmlHttp.send(null); + } catch (e) { + this.sources[sid].settingsEl.innerHTML = this.lang.get('filterError'); + } + }, + + sortAndPrintDates : /* private */ function () { + this.ul.innerHTML = ''; + this.dates.sort(function (d1, d2) { return d2.start - d1.start; }); + var now = new Date(); + var reachedNow = false; + for (var i = 0; i < this.dates.length; i++) { + // gray out passed dates + this.dates[i].li.className = ''; + if (this.dates[i].start < now) { + if (this.dates[i].end && this.dates[i].end > now) this.dates[i].li.className += 'current'; + else { + this.dates[i].li.className += 'passed'; + if (!reachedNow && i > 0) this.dates[i].li.className += ' nowLine'; + reachedNow = true; + } + } + if (this.dates[i].status == 'cancelled') this.dates[i].li.className += ' cancelled'; + this.ul.appendChild(this.dates[i].li); + } + }, + + icsToDate : /* private */ function (cal, eventID, endDate) { + if (!endDate || !cal.VEVENT[eventID].DTEND) var d = cal.VEVENT[eventID].DTSTART.split('T'); + else var d = cal.VEVENT[eventID].DTEND.split('T'); + var a = new Array (0, 0, 0, 0, 0, 0, 0); + a[0] = d[0].substring(0, d[0].length-4); + a[1] = parseInt(d[0].substring(d[0].length-4, d[0].length-2))-1; + a[2] = parseInt(d[0].substring(d[0].length-2, d[0].length)); + if (d.length > 1) { + a[3] = parseInt(d[1].substring(0, 2)); + a[4] = parseInt(d[1].substring(2, 4)); + a[5] = parseInt(d[1].substring(4, 6)); + var date = new Date(Date.UTC(a[0], a[1], a[2], a[3], a[4], a[5], a[6])); + } else var date = new Date(a[0], a[1], a[2], a[3], a[4], a[5], a[6]); // Events with complete day begin in the local timezone + if (cal.VEVENT[eventID].DTSTART_TZID && cal.VTIMEZONE) + for (var k = 0; k < cal.VTIMEZONE.length; k++) + if (cal.VTIMEZONE[k].TZID == cal.VEVENT[eventID].DTSTART_TZID) { + var sign = parseInt(cal.VTIMEZONE[k].STANDARD[0].TZOFFSETFROM.substring(0, 1)+'1'); + var dh = parseInt(cal.VTIMEZONE[k].STANDARD[0].TZOFFSETFROM.substring(1, 3)); + var dm = parseInt(cal.VTIMEZONE[k].STANDARD[0].TZOFFSETFROM.substring(3, 5)); + date.setUTCHours(date.getUTCHours() - dh * sign); + date.setUTCMinutes(date.getUTCMinutes() - dm * sign); + break; + } + return date; + }, + + interpretICS : /* private */ function (ics) { + ics = ics.split("\r").join('').split("\n"); + var i = 0; + function readBlock () { + var o = new Object(); + var l = ''; // last variable name in o + while (i < ics.length) { + if (ics[i].charAt(0) == ' ' && l != '') { + o[l] += ics[i].substring(1, ics[i].length).split("\\n").join("\n").split("\\,").join(",").split("\\;").join(";"); + i++; + continue; + } + var s = ics[i].split(':'); + i++; + if (s[0] == 'END') return o; + else if (s[0] == 'BEGIN') { + if (!o[s[1]]) o[s[1]] = new Array(); + o[s[1]].push(readBlock()); + } else { + l = s[0].split(';'); + for (var j = 1; j < l.length; j++) { + l[j] = l[j].split('='); + if (l[j].length == 2) o[l[0]+'_'+l[j][0]] = l[j][1]; + } + l = l[0]; + s.shift(); + o[l] = s.join(':').split("\\n").join("\n").split("\\,").join(",").split("\\;").join(";"); + } + } + return o; + } + return readBlock(); + }, + + loadSource : /* private */ function (sid, callback) { + var _this = this; + this.sources[sid].ics = null; + // compose src + var currentSrc = this.sources[sid].src; + currentSrc += ((this.sources[sid].src.indexOf('?') >= 0)?'&':'?')+'nocache='+Math.trunc(Math.random()*10000); + // get + var xmlHttp = new XMLHttpRequest(); + xmlHttp.open('GET', currentSrc, true); + xmlHttp.onreadystatechange = function () { + if (xmlHttp.readyState != 4) return; + _this.sources[sid].ics = _this.interpretICS(xmlHttp.responseText); + _this.sources[sid].state = 2; + if (callback) callback(sid); + }; + xmlHttp.onerror = function () { + _this.sources[sid].state = 3; + if (callback) callback(sid); + }; + try { + xmlHttp.send(null); + } catch (e) { + _this.sources[sid].state = 3; + if (callback) callback(sid); + } + }, + + addDatesFromSrc : /* private */ function (sid) { + if (!this.sources[sid].ics || !this.sources[sid].ics.VCALENDAR) return; + for (var i = 0; i < this.sources[sid].ics.VCALENDAR.length; i++) + if (this.sources[sid].ics.VCALENDAR[i].VEVENT) + for (var j = 0; j < this.sources[sid].ics.VCALENDAR[i].VEVENT.length; j++) { + if (!this.sources[sid].ics.VCALENDAR[i].VEVENT[j].DTSTART) continue; + var date = new CalendarDate(); + if (this.sources[sid].ics.VCALENDAR[i].VEVENT[j].RRULE) date.parseRrule(this.sources[sid].ics.VCALENDAR[i].VEVENT[j].RRULE); + date.sourceId = sid; + date.start = this.icsToDate(this.sources[sid].ics.VCALENDAR[i], j, false); + date.end = this.icsToDate(this.sources[sid].ics.VCALENDAR[i], j, true); + date.completeDay = this.sources[sid].ics.VCALENDAR[i].VEVENT[j].DTSTART.indexOf('T') >= 0; + date.title = this.sources[sid].ics.VCALENDAR[i].VEVENT[j].SUMMARY; + date.location = this.sources[sid].ics.VCALENDAR[i].VEVENT[j].LOCATION; + date.description = this.sources[sid].ics.VCALENDAR[i].VEVENT[j].DESCRIPTION; + date.url = this.sources[sid].ics.VCALENDAR[i].VEVENT[j].URL; + date.status = this.sources[sid].ics.VCALENDAR[i].VEVENT[j].STATUS; + if (!date.status) date.status = ''; + else date.status = date.status.toLowerCase(); + date.updateHTML(); + this.dates.push(date); + if (date.repeatMode > 0) { + var duration = date.end.getTime() - date.start.getTime(); + var prevRep = date.start; + var nextRep = null; + var nDate = null; + do { + nextRep = new Date(prevRep.getFullYear(), prevRep.getMonth(), prevRep.getDate(), 23, 59, 1, 0); + nextRep = date.getNearestRepetition(nextRep); + if (nextRep <= prevRep) break; + prevRep = nextRep; + nDate = new CalendarDate(); + nDate.sourceId = date.sourceId; + nDate.start = nextRep; + nDate.end = new Date(nextRep); + nDate.end.setMilliseconds(nDate.end.getMilliseconds() + duration); + nDate.completeDay = date.completeDay; + nDate.title = date.title; + nDate.location = date.location; + nDate.description = date.description; + nDate.url = date.url; + nDate.status = date.status; + nDate.updateHTML(); + this.dates.push(nDate); + } while (nextRep <= new Date()); + } + } + }, + + update : /* public */ function () { + var _this = this; + for (var i = 0; i < this.sources.length; i++) + if (this.sources[i].state == 1) return; // a load request is already in work + else this.sources[i].state = 1; // mark all sources as loading + function sourcesLoad () { + // wait until all sources are loaded + for (var i = 0; i < _this.sources.length; i++) + if (_this.sources[i].state == 1) return; + // remove all existing dates, that belong to a successfully (re)loaded source + for (var i = _this.dates.length-1; i >= 0; i--) + if (_this.dates[i].sourceId >= 0 && _this.dates[i].sourceId < _this.sources.length && _this.sources[_this.dates[i].sourceId].state == 2) + _this.dates.splice(i, 1); + // import dates from sources + for (var i = 0; i < _this.sources.length; i++) + if (_this.sources[i].state == 2) _this.addDatesFromSrc(i); + else { + // TODO: Generate error message for load error + } + // update HTML + _this.sortAndPrintDates(); + } + for (var i = 0; i < this.sources.length; i++) this.loadSource(i, sourcesLoad); + sourcesLoad(); // if only dates from HTML exist + } +}; + +// auto-detect calendar in HTML +(function () { + var div = document.getElementsByTagName('div'); + if (div.length > 0 && (' '+div[div.length-1].className+' ').indexOf(' calendar ') != -1) new ICSCalendar(div[div.length-1]); +})(); diff --git a/js/interactivePlayer.js b/js/interactivePlayer.js new file mode 100644 index 0000000..bb4e6c6 --- /dev/null +++ b/js/interactivePlayer.js @@ -0,0 +1,370 @@ +var interactivePlayerSelfScriptPath = document.getElementsByTagName('script')[document.getElementsByTagName('script').length-1].src; + +function loadJsWindows (callback) { + if (window.JSWindow) callback(); + else { + var jswScript = document.getElementById('JSWindowScript'); + if (jswScript) + jswScript.addEventListener('load', callback); + else { + if (interactivePlayerSelfScriptPath.indexOf('\/interactivePlayer.js') < 0) throw 'interactivePlayer.js cannot determine its script path. You have to load it when page loads.'; + var selfScriptPath = interactivePlayerSelfScriptPath.substring(0, interactivePlayerSelfScriptPath.lastIndexOf('\/')+1); + jswScript = document.createElement('script'); + jswScript.setAttribute('type', 'text/javascript'); + jswScript.addEventListener('load', callback); + jswScript.src = selfScriptPath+'JSWindow.js'; + document.getElementsByTagName('head')[0].appendChild(jswScript); + } + } +} + +window.previewVideoWin = null; +window.showPreview = function (preview, video) { + loadJsWindows(function () { + let img = document.createElement('img'); + img.src = preview; + img.style.width = '100%'; + img.style.height = '100%'; + img.style.cursor = 'pointer'; + let previewVideoWin = new JSWindow(); + window.previewVideoWin = previewVideoWin; + previewVideoWin.pos.position = 'fixed'; + previewVideoWin.pos.top = Number.NaN; + previewVideoWin.pos.left = 10; + previewVideoWin.pos.width = 300; + previewVideoWin.pos.height = 220; + previewVideoWin.pos.right = Number.NaN; + previewVideoWin.pos.bottom = 10; + previewVideoWin.minimizable = false; + previewVideoWin.maximizable = false; + previewVideoWin.setTitle('Video'); + previewVideoWin.el['InnerBox'].appendChild(img); + previewVideoWin.el['InnerBox'].style.overflow = 'hidden'; + previewVideoWin.addEventListener('hide', function () { + window.previewVideoWin = null; + }); + previewVideoWin.show(document.body); + img.addEventListener('click', function () { + player.play(video, 0, true); + }, false); + }); +} + + +function InteractivePlayer () { + var _this = this; + this.queryActions = new Array(); + this.playlist = new Array(); + if (interactivePlayerSelfScriptPath.indexOf('\/interactivePlayer.js') < 0) throw 'interactivePlayer.js cannot determine its script path. You have to load it when page loads.'; + this.selfScriptPath = interactivePlayerSelfScriptPath.substring(0, interactivePlayerSelfScriptPath.lastIndexOf('\/')+1); + function videoQualityLoad () { + _this.loading = false; + while (_this.queryActions.length > 0) { + var act = _this.queryActions.shift(); + var fkt = act.shift(); + fkt.apply(_this, act); + } + } + function videojsLoad () { + var qualitySelectScript = document.createElement('script'); + qualitySelectScript.setAttribute('type', 'text/javascript'); + qualitySelectScript.addEventListener('load', videoQualityLoad); + qualitySelectScript.src = _this.selfScriptPath+'silvermine-videojs-quality-selector.min.js'; + document.body.appendChild(qualitySelectScript); + } + loadJsWindows(function () { + if (window.videojs) videojsLoad(); + else { + window.HELP_IMPROVE_VIDEOJS = false; + var videojsStyle = document.createElement('link'); + videojsStyle.setAttribute('rel', 'stylesheet'); + videojsStyle.href = 'system/css/video-js.min.css'; + document.getElementsByTagName('head')[0].appendChild(videojsStyle); + var videoScript = document.createElement('script'); + videoScript.setAttribute('type', 'text/javascript'); + videoScript.addEventListener('load', videojsLoad); + videoScript.src = _this.selfScriptPath+'video.min.js'; + document.body.appendChild(videoScript); + } + }); +} +InteractivePlayer.prototype = { + // private + selfScriptPath : '', + win : null, + video : null, + player : null, + playlist : null, + loading : true, + queryActions : null, + currentVideo : -1, + currentAction : 0, + prevBut : null, + nextBut : null, + timeset : -1, + playall : false, + lastWaiting : null, // contains alternating pairs of video time and real time + + + indexById : /* private */ function (id) { + for (var i = 0; i < this.playlist.length; i++) + if (this.playlist[i].id == id) + return i; + return -1; + }, + + videoByHashtag : /* public */ function (hashtag) { + for (var i = 0; i < this.playlist.length; i++) + if (this.playlist[i].hashtags && this.playlist[i].hashtags.indexOf(hashtag) >= 0) + return this.playlist[i].id; + return ''; + }, + + timeupdate : /* private */ function () { + if (this.timeset >= 0) { + this.video.currentTime = this.timeset; + this.timeset = -1; + } + if (this.currentVideo < 0 || !this.playlist[this.currentVideo].actions) return; + var t = this.video.currentTime; + var stopInd = this.currentAction; + while (stopInd < this.playlist[this.currentVideo].actions.length) + if (this.playlist[this.currentVideo].actions[stopInd].time > t) break; + else stopInd++; + while (this.currentAction < stopInd) { + try { + if ((this.currentAction == stopInd-1 || this.playlist[this.currentVideo].actions[this.currentAction].required) && this.playlist[this.currentVideo].actions[this.currentAction].fkt) + this.playlist[this.currentVideo].actions[this.currentAction].fkt.call(this, this.currentAction == stopInd-1); + } finally { + this.currentAction++; + } + } + }, + + videoended : /* private */ function () { + if (!this.playall) return; + if (this.currentVideo >= this.playlist.length-1) { + this.playall = false; + return; + } + this.currentVideo++; + this.currentAction = 0; + this.loadVideo(this.currentVideo); + try { + this.player.play(); + } catch (e) { } + }, + + getCurrentQuality : /* private */ function () { + var q = null; + var quality = ''; + for (var i = 0; i < this.video.parentElement.getElementsByTagName('div').length; i++) + if (this.video.parentElement.getElementsByTagName('div')[i].className.indexOf('vjs-quality-selector') >= 0) { + q = this.video.parentElement.getElementsByTagName('div')[i]; + break; + } + if (q) { + for (var i = 0; i < q.getElementsByTagName('li').length; i++) + if (q.getElementsByTagName('li')[i].className.indexOf('vjs-menu-item') >= 0) if (q.getElementsByTagName('li')[i].className.indexOf('vjs-selected') >= 0) { + q = q.getElementsByTagName('li')[i]; + break; + } + if (q) { + for (var i = 0; i < q.getElementsByTagName('span').length; i++) + if (q.getElementsByTagName('span')[i].className.indexOf('vjs-menu-item-text') >= 0) { + q = q.getElementsByTagName('span')[i]; + break; + } + if (q) { + quality = q.textContent; + } + } + } + return quality; + }, + + videowaiting : /* private */ function (timerRecall=false) { + var _this = this; + this.lastWaiting.push(this.video.currentTime); + this.lastWaiting.push(Math.floor(Date.now() / 1000)); + if (!timerRecall) + window.setTimeout(function () { _this.videowaiting(true); }, 2000); + var l = this.lastWaiting.length; + if (!timerRecall && l >= 8 || l >= 4 && (this.lastWaiting[l-2] - this.lastWaiting[l-4]) * 2 + 1 < (this.lastWaiting[l-1] - this.lastWaiting[l-3])) { + var quality = this.getCurrentQuality(); + var redQualBegin = '!'; + if (quality.indexOf('1080p') >= 0) + redQualBegin = '720p'; + if (quality.indexOf('720p') >= 0) + redQualBegin = '400p'; + this.lastWaiting = new Array(); + if (redQualBegin == '!') return; + console.log('Reducing video quality to '+redQualBegin); + var q = null; + for (var i = 0; i < this.video.parentElement.getElementsByTagName('div').length; i++) + if (this.video.parentElement.getElementsByTagName('div')[i].className.indexOf('vjs-quality-selector') >= 0) { + q = this.video.parentElement.getElementsByTagName('div')[i]; + break; + } + if (q) { + for (var i = 0; i < q.getElementsByTagName('li').length; i++) + if (q.getElementsByTagName('li')[i].className.indexOf('vjs-menu-item') >= 0) + if (q.getElementsByTagName('li')[i].textContent.indexOf(redQualBegin) >= 0) { + q.getElementsByTagName('li')[i].click(); + break; + } + } + } + }, + + closeWindow : /* private */ function () { + if (this.currentVideo >= 0 || this.playlist[this.currentVideo].actions) + while (this.currentAction < this.playlist[this.currentVideo].actions.length) { + try { + if (this.playlist[this.currentVideo].actions[this.currentAction].final && this.playlist[this.currentVideo].actions[this.currentAction].fkt) + this.playlist[this.currentVideo].actions[this.currentAction].fkt.call(this, false); + } catch (e) { } + this.currentAction++; + } + this.player.dispose(); + this.video = null; + this.player = null; + this.win = null; + this.prevBut = null; + this.nextBut = null; + this.currentVideo = -1; + }, + + createWindow : /* prvate */ function () { + if (this.win) throw 'Window already created!'; + this.playall = false; + var _this = this; + this.win = new JSWindow(); + this.win.pos.position = 'fixed'; + this.win.pos.top = 300; + this.win.pos.left = 150; + this.win.pos.width = Number.NaN; + this.win.pos.height = Number.NaN; + this.win.pos.right = 150; + this.win.pos.bottom = 10; + this.win.excludable = true; + this.win.minimizable = false; + this.win.setTitle('Video'); + this.win.addEventListener('hide', function () { _this.closeWindow(); }); + this.video = document.createElement('video'); + this.video.className = 'video-js'; + this.video.setAttribute('controls', ''); + this.video.disablePictureInPicture = true; + this.video.addEventListener('timeupdate', function () { _this.timeupdate(); }, false); + this.video.addEventListener('ended', function () { _this.videoended(); }, false); + this.video.addEventListener('waiting', function () { _this.videowaiting(); }, false); + this.win.el['InnerBox'].appendChild(this.video); + this.win.show(document.body); + this.player = videojs(this.video); + this.player.controlBar.addChild('QualitySelector'); + var divs = this.video.parentElement.getElementsByTagName('div'); + for (var i = 0; i < divs.length; i++) + if ((' '+divs[i].className+' ').indexOf(' vjs-control-bar ') >= 0) { + this.nextBut = document.createElement('a'); + this.nextBut.href = 'javascript:'; + this.nextBut.className = 'video-next-but'; + this.nextBut.addEventListener('click', function () { + _this.next(); + }); + this.nextBut.innerHTML = 'nächstes Video ▶ ▶'; + divs[i].appendChild(this.nextBut); + this.prevBut = document.createElement('a'); + this.prevBut.href = 'javascript:'; + this.prevBut.className = 'video-prev-but'; + this.prevBut.addEventListener('click', function () { + _this.prev(); + }); + this.prevBut.innerHTML = '◀ ◀ vorheriges Video'; + divs[i].appendChild(this.prevBut); + break; + } + }, + + clearPlaylist : /* public */ function () { + if (this.player) this.player.pause(); + this.playlist = new Array(); + this.currentVideo = -1; + }, + + loadVideo : /* private */ function (nr) { + if (this.prevBut) + this.prevBut.style.visibility = (nr > 0)?'visible':'hidden'; + if (this.nextBut) + this.nextBut.style.visibility = (nr < this.playlist.length - 1)?'visible':'hidden'; + var url = this.playlist[nr].src; + var quality = this.getCurrentQuality(); + this.player.src([ + {type: "video\/mp4", src: url+'-1080p.mp4', label: '1080p 50fps', selected: (quality == '1080p 50fps')}, + {type: "video\/mp4", src: url+'-720p.mp4', label: '720p 25fps', selected: (quality == '720p 25fps')}, + {type: "video\/mp4", src: url+'-400p.mp4', label: '400p 25fps', selected: (quality == '400p 25fps')}, + ]); + this.lastWaiting = [0, Math.floor(Date.now() / 1000)]; + }, + + addVideo : /* public */ function (videoInfo) { + if (videoInfo.actions) + videoInfo.actions.sort(function (a, b) { return a.time - b.time; }); + var absPath = document.createElement('a'); + absPath.style.display = 'none'; + document.body.appendChild(absPath); + absPath.href = videoInfo.src; + videoInfo.src = absPath.href; + document.body.removeChild(absPath); + this.playlist.push(videoInfo); + }, + + play : /* public */ function (id, time=-1, playall=false) { + if (window.previewVideoWin) + window.previewVideoWin.hide(); + var i = this.indexById(id); + if (i < 0) return; + if (this.loading) { + this.queryActions.push([this.play, id, time]); + return; + } + this.currentVideo = i; + this.currentAction = 0; + if (!this.win) + this.createWindow(); + this.loadVideo(i); + this.timeset = time; + try { + this.player.play(); + if (playall) this.playall = true; + } catch (e) { } + }, + + playAll : /* public */ function () { + if (this.playlist.length == 0) return; + if (this.loading) { + this.queryActions.push([this.playAll]); + return; + } + this.play(this.playlist[0].id); + this.playall = true; + }, + + next : /* public */ function () { + if (this.loading) { + this.queryActions.push([this.next]); + return; + } + if (this.currentVideo >= this.playlist.length-1) return; + this.play(this.playlist[this.currentVideo+1].id); + this.playall = this.video.paused; + }, + + prev : /* public */ function () { + if (this.loading) { + this.queryActions.push([this.prev]); + return; + } + if (this.currentVideo <= 0) return; + this.play(this.playlist[this.currentVideo-1].id); + } +}; diff --git a/js/katex.js b/js/katex.js new file mode 100644 index 0000000..e104be9 --- /dev/null +++ b/js/katex.js @@ -0,0 +1,9075 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.katex = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 15) { + left = "…" + input.slice(start - 15, start); + } else { + left = input.slice(0, start); + } + var right; + if (end + 15 < input.length) { + right = input.slice(end, end + 15) + "…"; + } else { + right = input.slice(end); + } + error += left + underlined + right; + } + + // Some hackery to make ParseError a prototype of Error + // See http://stackoverflow.com/a/8460753 + var self = new Error(error); + self.name = "ParseError"; + self.__proto__ = ParseError.prototype; + + self.position = start; + return self; +} + +// More hackery +ParseError.prototype.__proto__ = Error.prototype; + +module.exports = ParseError; + +},{}],7:[function(require,module,exports){ +/* eslint no-constant-condition:0 */ +var functions = require("./functions"); +var environments = require("./environments"); +var MacroExpander = require("./MacroExpander"); +var symbols = require("./symbols"); +var utils = require("./utils"); +var cjkRegex = require("./unicodeRegexes").cjkRegex; + +var parseData = require("./parseData"); +var ParseError = require("./ParseError"); + +/** + * This file contains the parser used to parse out a TeX expression from the + * input. Since TeX isn't context-free, standard parsers don't work particularly + * well. + * + * The strategy of this parser is as such: + * + * The main functions (the `.parse...` ones) take a position in the current + * parse string to parse tokens from. The lexer (found in Lexer.js, stored at + * this.lexer) also supports pulling out tokens at arbitrary places. When + * individual tokens are needed at a position, the lexer is called to pull out a + * token, which is then used. + * + * The parser has a property called "mode" indicating the mode that + * the parser is currently in. Currently it has to be one of "math" or + * "text", which denotes whether the current environment is a math-y + * one or a text-y one (e.g. inside \text). Currently, this serves to + * limit the functions which can be used in text mode. + * + * The main functions then return an object which contains the useful data that + * was parsed at its given point, and a new position at the end of the parsed + * data. The main functions can call each other and continue the parsing by + * using the returned position as a new starting point. + * + * There are also extra `.handle...` functions, which pull out some reused + * functionality into self-contained functions. + * + * The earlier functions return ParseNodes. + * The later functions (which are called deeper in the parse) sometimes return + * ParseFuncOrArgument, which contain a ParseNode as well as some data about + * whether the parsed object is a function which is missing some arguments, or a + * standalone object which can be used as an argument to another function. + */ + +/** + * Main Parser class + */ +function Parser(input, settings) { + // Create a new macro expander (gullet) and (indirectly via that) also a + // new lexer (mouth) for this parser (stomach, in the language of TeX) + this.gullet = new MacroExpander(input, settings.macros); + // Store the settings for use in parsing + this.settings = settings; + // Count leftright depth (for \middle errors) + this.leftrightDepth = 0; +} + +var ParseNode = parseData.ParseNode; + +/** + * An initial function (without its arguments), or an argument to a function. + * The `result` argument should be a ParseNode. + */ +function ParseFuncOrArgument(result, isFunction, token) { + this.result = result; + // Is this a function (i.e. is it something defined in functions.js)? + this.isFunction = isFunction; + this.token = token; +} + +/** + * Checks a result to make sure it has the right type, and throws an + * appropriate error otherwise. + * + * @param {boolean=} consume whether to consume the expected token, + * defaults to true + */ +Parser.prototype.expect = function(text, consume) { + if (this.nextToken.text !== text) { + throw new ParseError( + "Expected '" + text + "', got '" + this.nextToken.text + "'", + this.nextToken + ); + } + if (consume !== false) { + this.consume(); + } +}; + +/** + * Considers the current look ahead token as consumed, + * and fetches the one after that as the new look ahead. + */ +Parser.prototype.consume = function() { + this.nextToken = this.gullet.get(this.mode === "math"); +}; + +Parser.prototype.switchMode = function(newMode) { + this.gullet.unget(this.nextToken); + this.mode = newMode; + this.consume(); +}; + +/** + * Main parsing function, which parses an entire input. + * + * @return {?Array.} + */ +Parser.prototype.parse = function() { + // Try to parse the input + this.mode = "math"; + this.consume(); + var parse = this.parseInput(); + return parse; +}; + +/** + * Parses an entire input tree. + */ +Parser.prototype.parseInput = function() { + // Parse an expression + var expression = this.parseExpression(false); + // If we succeeded, make sure there's an EOF at the end + this.expect("EOF", false); + return expression; +}; + +var endOfExpression = ["}", "\\end", "\\right", "&", "\\\\", "\\cr"]; + +/** + * Parses an "expression", which is a list of atoms. + * + * @param {boolean} breakOnInfix Should the parsing stop when we hit infix + * nodes? This happens when functions have higher precendence + * than infix nodes in implicit parses. + * + * @param {?string} breakOnTokenText The text of the token that the expression + * should end with, or `null` if something else should end the + * expression. + * + * @return {ParseNode} + */ +Parser.prototype.parseExpression = function(breakOnInfix, breakOnTokenText) { + var body = []; + // Keep adding atoms to the body until we can't parse any more atoms (either + // we reached the end, a }, or a \right) + while (true) { + var lex = this.nextToken; + if (endOfExpression.indexOf(lex.text) !== -1) { + break; + } + if (breakOnTokenText && lex.text === breakOnTokenText) { + break; + } + if (breakOnInfix && functions[lex.text] && functions[lex.text].infix) { + break; + } + var atom = this.parseAtom(); + if (!atom) { + if (!this.settings.throwOnError && lex.text[0] === "\\") { + var errorNode = this.handleUnsupportedCmd(); + body.push(errorNode); + continue; + } + + break; + } + body.push(atom); + } + return this.handleInfixNodes(body); +}; + +/** + * Rewrites infix operators such as \over with corresponding commands such + * as \frac. + * + * There can only be one infix operator per group. If there's more than one + * then the expression is ambiguous. This can be resolved by adding {}. + * + * @returns {Array} + */ +Parser.prototype.handleInfixNodes = function(body) { + var overIndex = -1; + var funcName; + + for (var i = 0; i < body.length; i++) { + var node = body[i]; + if (node.type === "infix") { + if (overIndex !== -1) { + throw new ParseError( + "only one infix operator per group", + node.value.token); + } + overIndex = i; + funcName = node.value.replaceWith; + } + } + + if (overIndex !== -1) { + var numerNode; + var denomNode; + + var numerBody = body.slice(0, overIndex); + var denomBody = body.slice(overIndex + 1); + + if (numerBody.length === 1 && numerBody[0].type === "ordgroup") { + numerNode = numerBody[0]; + } else { + numerNode = new ParseNode("ordgroup", numerBody, this.mode); + } + + if (denomBody.length === 1 && denomBody[0].type === "ordgroup") { + denomNode = denomBody[0]; + } else { + denomNode = new ParseNode("ordgroup", denomBody, this.mode); + } + + var value = this.callFunction( + funcName, [numerNode, denomNode], null); + return [new ParseNode(value.type, value, this.mode)]; + } else { + return body; + } +}; + +// The greediness of a superscript or subscript +var SUPSUB_GREEDINESS = 1; + +/** + * Handle a subscript or superscript with nice errors. + */ +Parser.prototype.handleSupSubscript = function(name) { + var symbolToken = this.nextToken; + var symbol = symbolToken.text; + this.consume(); + var group = this.parseGroup(); + + if (!group) { + if (!this.settings.throwOnError && this.nextToken.text[0] === "\\") { + return this.handleUnsupportedCmd(); + } else { + throw new ParseError( + "Expected group after '" + symbol + "'", + symbolToken + ); + } + } else if (group.isFunction) { + // ^ and _ have a greediness, so handle interactions with functions' + // greediness + var funcGreediness = functions[group.result].greediness; + if (funcGreediness > SUPSUB_GREEDINESS) { + return this.parseFunction(group); + } else { + throw new ParseError( + "Got function '" + group.result + "' with no arguments " + + "as " + name, symbolToken); + } + } else { + return group.result; + } +}; + +/** + * Converts the textual input of an unsupported command into a text node + * contained within a color node whose color is determined by errorColor + */ +Parser.prototype.handleUnsupportedCmd = function() { + var text = this.nextToken.text; + var textordArray = []; + + for (var i = 0; i < text.length; i++) { + textordArray.push(new ParseNode("textord", text[i], "text")); + } + + var textNode = new ParseNode( + "text", + { + body: textordArray, + type: "text" + }, + this.mode); + + var colorNode = new ParseNode( + "color", + { + color: this.settings.errorColor, + value: [textNode], + type: "color" + }, + this.mode); + + this.consume(); + return colorNode; +}; + +/** + * Parses a group with optional super/subscripts. + * + * @return {?ParseNode} + */ +Parser.prototype.parseAtom = function() { + // The body of an atom is an implicit group, so that things like + // \left(x\right)^2 work correctly. + var base = this.parseImplicitGroup(); + + // In text mode, we don't have superscripts or subscripts + if (this.mode === "text") { + return base; + } + + // Note that base may be empty (i.e. null) at this point. + + var superscript; + var subscript; + while (true) { + // Lex the first token + var lex = this.nextToken; + + if (lex.text === "\\limits" || lex.text === "\\nolimits") { + // We got a limit control + if (!base || base.type !== "op") { + throw new ParseError( + "Limit controls must follow a math operator", + lex); + } else { + var limits = lex.text === "\\limits"; + base.value.limits = limits; + base.value.alwaysHandleSupSub = true; + } + this.consume(); + } else if (lex.text === "^") { + // We got a superscript start + if (superscript) { + throw new ParseError("Double superscript", lex); + } + superscript = this.handleSupSubscript("superscript"); + } else if (lex.text === "_") { + // We got a subscript start + if (subscript) { + throw new ParseError("Double subscript", lex); + } + subscript = this.handleSupSubscript("subscript"); + } else if (lex.text === "'") { + // We got a prime + var prime = new ParseNode("textord", "\\prime", this.mode); + + // Many primes can be grouped together, so we handle this here + var primes = [prime]; + this.consume(); + // Keep lexing tokens until we get something that's not a prime + while (this.nextToken.text === "'") { + // For each one, add another prime to the list + primes.push(prime); + this.consume(); + } + // Put them into an ordgroup as the superscript + superscript = new ParseNode("ordgroup", primes, this.mode); + } else { + // If it wasn't ^, _, or ', stop parsing super/subscripts + break; + } + } + + if (superscript || subscript) { + // If we got either a superscript or subscript, create a supsub + return new ParseNode("supsub", { + base: base, + sup: superscript, + sub: subscript + }, this.mode); + } else { + // Otherwise return the original body + return base; + } +}; + +// A list of the size-changing functions, for use in parseImplicitGroup +var sizeFuncs = [ + "\\tiny", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", + "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge" +]; + +// A list of the style-changing functions, for use in parseImplicitGroup +var styleFuncs = [ + "\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle" +]; + +/** + * Parses an implicit group, which is a group that starts at the end of a + * specified, and ends right before a higher explicit group ends, or at EOL. It + * is used for functions that appear to affect the current style, like \Large or + * \textrm, where instead of keeping a style we just pretend that there is an + * implicit grouping after it until the end of the group. E.g. + * small text {\Large large text} small text again + * It is also used for \left and \right to get the correct grouping. + * + * @return {?ParseNode} + */ +Parser.prototype.parseImplicitGroup = function() { + var start = this.parseSymbol(); + + if (start == null) { + // If we didn't get anything we handle, fall back to parseFunction + return this.parseFunction(); + } + + var func = start.result; + var body; + + if (func === "\\left") { + // If we see a left: + // Parse the entire left function (including the delimiter) + var left = this.parseFunction(start); + // Parse out the implicit body + ++this.leftrightDepth; + body = this.parseExpression(false); + --this.leftrightDepth; + // Check the next token + this.expect("\\right", false); + var right = this.parseFunction(); + return new ParseNode("leftright", { + body: body, + left: left.value.value, + right: right.value.value + }, this.mode); + } else if (func === "\\begin") { + // begin...end is similar to left...right + var begin = this.parseFunction(start); + var envName = begin.value.name; + if (!environments.hasOwnProperty(envName)) { + throw new ParseError( + "No such environment: " + envName, begin.value.nameGroup); + } + // Build the environment object. Arguments and other information will + // be made available to the begin and end methods using properties. + var env = environments[envName]; + var args = this.parseArguments("\\begin{" + envName + "}", env); + var context = { + mode: this.mode, + envName: envName, + parser: this, + positions: args.pop() + }; + var result = env.handler(context, args); + this.expect("\\end", false); + var endNameToken = this.nextToken; + var end = this.parseFunction(); + if (end.value.name !== envName) { + throw new ParseError( + "Mismatch: \\begin{" + envName + "} matched " + + "by \\end{" + end.value.name + "}", + endNameToken); + } + result.position = end.position; + return result; + } else if (utils.contains(sizeFuncs, func)) { + // If we see a sizing function, parse out the implict body + body = this.parseExpression(false); + return new ParseNode("sizing", { + // Figure out what size to use based on the list of functions above + size: "size" + (utils.indexOf(sizeFuncs, func) + 1), + value: body + }, this.mode); + } else if (utils.contains(styleFuncs, func)) { + // If we see a styling function, parse out the implict body + body = this.parseExpression(true); + return new ParseNode("styling", { + // Figure out what style to use by pulling out the style from + // the function name + style: func.slice(1, func.length - 5), + value: body + }, this.mode); + } else { + // Defer to parseFunction if it's not a function we handle + return this.parseFunction(start); + } +}; + +/** + * Parses an entire function, including its base and all of its arguments. + * The base might either have been parsed already, in which case + * it is provided as an argument, or it's the next group in the input. + * + * @param {ParseFuncOrArgument=} baseGroup optional as described above + * @return {?ParseNode} + */ +Parser.prototype.parseFunction = function(baseGroup) { + if (!baseGroup) { + baseGroup = this.parseGroup(); + } + + if (baseGroup) { + if (baseGroup.isFunction) { + var func = baseGroup.result; + var funcData = functions[func]; + if (this.mode === "text" && !funcData.allowedInText) { + throw new ParseError( + "Can't use function '" + func + "' in text mode", + baseGroup.token); + } + + var args = this.parseArguments(func, funcData); + var token = baseGroup.token; + var result = this.callFunction(func, args, args.pop(), token); + return new ParseNode(result.type, result, this.mode); + } else { + return baseGroup.result; + } + } else { + return null; + } +}; + +/** + * Call a function handler with a suitable context and arguments. + */ +Parser.prototype.callFunction = function(name, args, positions, token) { + var context = { + funcName: name, + parser: this, + positions: positions, + token: token + }; + return functions[name].handler(context, args); +}; + +/** + * Parses the arguments of a function or environment + * + * @param {string} func "\name" or "\begin{name}" + * @param {{numArgs:number,numOptionalArgs:number|undefined}} funcData + * @return the array of arguments, with the list of positions as last element + */ +Parser.prototype.parseArguments = function(func, funcData) { + var totalArgs = funcData.numArgs + funcData.numOptionalArgs; + if (totalArgs === 0) { + return [[this.pos]]; + } + + var baseGreediness = funcData.greediness; + var positions = [this.pos]; + var args = []; + + for (var i = 0; i < totalArgs; i++) { + var nextToken = this.nextToken; + var argType = funcData.argTypes && funcData.argTypes[i]; + var arg; + if (i < funcData.numOptionalArgs) { + if (argType) { + arg = this.parseGroupOfType(argType, true); + } else { + arg = this.parseGroup(true); + } + if (!arg) { + args.push(null); + positions.push(this.pos); + continue; + } + } else { + if (argType) { + arg = this.parseGroupOfType(argType); + } else { + arg = this.parseGroup(); + } + if (!arg) { + if (!this.settings.throwOnError && + this.nextToken.text[0] === "\\") { + arg = new ParseFuncOrArgument( + this.handleUnsupportedCmd(this.nextToken.text), + false); + } else { + throw new ParseError( + "Expected group after '" + func + "'", nextToken); + } + } + } + var argNode; + if (arg.isFunction) { + var argGreediness = + functions[arg.result].greediness; + if (argGreediness > baseGreediness) { + argNode = this.parseFunction(arg); + } else { + throw new ParseError( + "Got function '" + arg.result + "' as " + + "argument to '" + func + "'", nextToken); + } + } else { + argNode = arg.result; + } + args.push(argNode); + positions.push(this.pos); + } + + args.push(positions); + + return args; +}; + + +/** + * Parses a group when the mode is changing. + * + * @return {?ParseFuncOrArgument} + */ +Parser.prototype.parseGroupOfType = function(innerMode, optional) { + var outerMode = this.mode; + // Handle `original` argTypes + if (innerMode === "original") { + innerMode = outerMode; + } + + if (innerMode === "color") { + return this.parseColorGroup(optional); + } + if (innerMode === "size") { + return this.parseSizeGroup(optional); + } + + this.switchMode(innerMode); + if (innerMode === "text") { + // text mode is special because it should ignore the whitespace before + // it + while (this.nextToken.text === " ") { + this.consume(); + } + } + // By the time we get here, innerMode is one of "text" or "math". + // We switch the mode of the parser, recurse, then restore the old mode. + var res = this.parseGroup(optional); + this.switchMode(outerMode); + return res; +}; + +/** + * Parses a group, essentially returning the string formed by the + * brace-enclosed tokens plus some position information. + * + * @param {string} modeName Used to describe the mode in error messages + * @param {boolean=} optional Whether the group is optional or required + */ +Parser.prototype.parseStringGroup = function(modeName, optional) { + if (optional && this.nextToken.text !== "[") { + return null; + } + var outerMode = this.mode; + this.mode = "text"; + this.expect(optional ? "[" : "{"); + var str = ""; + var firstToken = this.nextToken; + var lastToken = firstToken; + while (this.nextToken.text !== (optional ? "]" : "}")) { + if (this.nextToken.text === "EOF") { + throw new ParseError( + "Unexpected end of input in " + modeName, + firstToken.range(this.nextToken, str)); + } + lastToken = this.nextToken; + str += lastToken.text; + this.consume(); + } + this.mode = outerMode; + this.expect(optional ? "]" : "}"); + return firstToken.range(lastToken, str); +}; + +/** + * Parses a regex-delimited group: the largest sequence of tokens + * whose concatenated strings match `regex`. Returns the string + * formed by the tokens plus some position information. + * + * @param {RegExp} regex + * @param {string} modeName Used to describe the mode in error messages + */ +Parser.prototype.parseRegexGroup = function(regex, modeName) { + var outerMode = this.mode; + this.mode = "text"; + var firstToken = this.nextToken; + var lastToken = firstToken; + var str = ""; + while (this.nextToken.text !== "EOF" + && regex.test(str + this.nextToken.text)) { + lastToken = this.nextToken; + str += lastToken.text; + this.consume(); + } + if (str === "") { + throw new ParseError( + "Invalid " + modeName + ": '" + firstToken.text + "'", + firstToken); + } + this.mode = outerMode; + return firstToken.range(lastToken, str); +}; + +/** + * Parses a color description. + */ +Parser.prototype.parseColorGroup = function(optional) { + var res = this.parseStringGroup("color", optional); + if (!res) { + return null; + } + var match = (/^(#[a-z0-9]+|[a-z]+)$/i).exec(res.text); + if (!match) { + throw new ParseError("Invalid color: '" + res.text + "'", res); + } + return new ParseFuncOrArgument( + new ParseNode("color", match[0], this.mode), + false); +}; + +/** + * Parses a size specification, consisting of magnitude and unit. + */ +Parser.prototype.parseSizeGroup = function(optional) { + var res; + if (!optional && this.nextToken.text !== "{") { + res = this.parseRegexGroup( + /^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2}$/, "size"); + } else { + res = this.parseStringGroup("size", optional); + } + if (!res) { + return null; + } + var match = (/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/).exec(res.text); + if (!match) { + throw new ParseError("Invalid size: '" + res.text + "'", res); + } + var data = { + number: +(match[1] + match[2]), // sign + magnitude, cast to number + unit: match[3] + }; + if (data.unit !== "em" && data.unit !== "ex" && data.unit !== "mu") { + throw new ParseError("Invalid unit: '" + data.unit + "'", res); + } + return new ParseFuncOrArgument( + new ParseNode("color", data, this.mode), + false); +}; + +/** + * If the argument is false or absent, this parses an ordinary group, + * which is either a single nucleus (like "x") or an expression + * in braces (like "{x+y}"). + * If the argument is true, it parses either a bracket-delimited expression + * (like "[x+y]") or returns null to indicate the absence of a + * bracket-enclosed group. + * + * @param {boolean=} optional Whether the group is optional or required + * @return {?ParseFuncOrArgument} + */ +Parser.prototype.parseGroup = function(optional) { + var firstToken = this.nextToken; + // Try to parse an open brace + if (this.nextToken.text === (optional ? "[" : "{")) { + // If we get a brace, parse an expression + this.consume(); + var expression = this.parseExpression(false, optional ? "]" : null); + var lastToken = this.nextToken; + // Make sure we get a close brace + this.expect(optional ? "]" : "}"); + if (this.mode === "text") { + this.formLigatures(expression); + } + return new ParseFuncOrArgument( + new ParseNode("ordgroup", expression, this.mode, + firstToken, lastToken), + false); + } else { + // Otherwise, just return a nucleus, or nothing for an optional group + return optional ? null : this.parseSymbol(); + } +}; + +/** + * Form ligature-like combinations of characters for text mode. + * This includes inputs like "--", "---", "``" and "''". + * The result will simply replace multiple textord nodes with a single + * character in each value by a single textord node having multiple + * characters in its value. The representation is still ASCII source. + * + * @param {Array.} group the nodes of this group, + * list will be moified in place + */ +Parser.prototype.formLigatures = function(group) { + var i; + var n = group.length - 1; + for (i = 0; i < n; ++i) { + var a = group[i]; + var v = a.value; + if (v === "-" && group[i + 1].value === "-") { + if (i + 1 < n && group[i + 2].value === "-") { + group.splice(i, 3, new ParseNode( + "textord", "---", "text", a, group[i + 2])); + n -= 2; + } else { + group.splice(i, 2, new ParseNode( + "textord", "--", "text", a, group[i + 1])); + n -= 1; + } + } + if ((v === "'" || v === "`") && group[i + 1].value === v) { + group.splice(i, 2, new ParseNode( + "textord", v + v, "text", a, group[i + 1])); + n -= 1; + } + } +}; + +/** + * Parse a single symbol out of the string. Here, we handle both the functions + * we have defined, as well as the single character symbols + * + * @return {?ParseFuncOrArgument} + */ +Parser.prototype.parseSymbol = function() { + var nucleus = this.nextToken; + + if (functions[nucleus.text]) { + this.consume(); + // If there exists a function with this name, we return the function and + // say that it is a function. + return new ParseFuncOrArgument( + nucleus.text, + true, nucleus); + } else if (symbols[this.mode][nucleus.text]) { + this.consume(); + // Otherwise if this is a no-argument function, find the type it + // corresponds to in the symbols map + return new ParseFuncOrArgument( + new ParseNode(symbols[this.mode][nucleus.text].group, + nucleus.text, this.mode, nucleus), + false, nucleus); + } else if (this.mode === "text" && cjkRegex.test(nucleus.text)) { + this.consume(); + return new ParseFuncOrArgument( + new ParseNode("textord", nucleus.text, this.mode, nucleus), + false, nucleus); + } else { + return null; + } +}; + +Parser.prototype.ParseNode = ParseNode; + +module.exports = Parser; + +},{"./MacroExpander":4,"./ParseError":6,"./environments":16,"./functions":19,"./parseData":21,"./symbols":23,"./unicodeRegexes":24,"./utils":25}],8:[function(require,module,exports){ +/** + * This is a module for storing settings passed into KaTeX. It correctly handles + * default settings. + */ + +/** + * Helper function for getting a default value if the value is undefined + */ +function get(option, defaultValue) { + return option === undefined ? defaultValue : option; +} + +/** + * The main Settings object + * + * The current options stored are: + * - displayMode: Whether the expression should be typeset by default in + * textstyle or displaystyle (default false) + */ +function Settings(options) { + // allow null options + options = options || {}; + this.displayMode = get(options.displayMode, false); + this.throwOnError = get(options.throwOnError, true); + this.errorColor = get(options.errorColor, "#cc0000"); + this.macros = options.macros || {}; +} + +module.exports = Settings; + +},{}],9:[function(require,module,exports){ +/** + * This file contains information and classes for the various kinds of styles + * used in TeX. It provides a generic `Style` class, which holds information + * about a specific style. It then provides instances of all the different kinds + * of styles possible, and provides functions to move between them and get + * information about them. + */ + +var sigmas = require("./fontMetrics.js").sigmas; + +var metrics = [{}, {}, {}]; +var i; +for (var key in sigmas) { + if (sigmas.hasOwnProperty(key)) { + for (i = 0; i < 3; i++) { + metrics[i][key] = sigmas[key][i]; + } + } +} +for (i = 0; i < 3; i++) { + metrics[i].emPerEx = sigmas.xHeight[i] / sigmas.quad[i]; +} + +/** + * The main style class. Contains a unique id for the style, a size (which is + * the same for cramped and uncramped version of a style), a cramped flag, and a + * size multiplier, which gives the size difference between a style and + * textstyle. + */ +function Style(id, size, multiplier, cramped) { + this.id = id; + this.size = size; + this.cramped = cramped; + this.sizeMultiplier = multiplier; + this.metrics = metrics[size > 0 ? size - 1 : 0]; +} + +/** + * Get the style of a superscript given a base in the current style. + */ +Style.prototype.sup = function() { + return styles[sup[this.id]]; +}; + +/** + * Get the style of a subscript given a base in the current style. + */ +Style.prototype.sub = function() { + return styles[sub[this.id]]; +}; + +/** + * Get the style of a fraction numerator given the fraction in the current + * style. + */ +Style.prototype.fracNum = function() { + return styles[fracNum[this.id]]; +}; + +/** + * Get the style of a fraction denominator given the fraction in the current + * style. + */ +Style.prototype.fracDen = function() { + return styles[fracDen[this.id]]; +}; + +/** + * Get the cramped version of a style (in particular, cramping a cramped style + * doesn't change the style). + */ +Style.prototype.cramp = function() { + return styles[cramp[this.id]]; +}; + +/** + * HTML class name, like "displaystyle cramped" + */ +Style.prototype.cls = function() { + return sizeNames[this.size] + (this.cramped ? " cramped" : " uncramped"); +}; + +/** + * HTML Reset class name, like "reset-textstyle" + */ +Style.prototype.reset = function() { + return resetNames[this.size]; +}; + +/** + * Return if this style is tightly spaced (scriptstyle/scriptscriptstyle) + */ +Style.prototype.isTight = function() { + return this.size >= 2; +}; + +// IDs of the different styles +var D = 0; +var Dc = 1; +var T = 2; +var Tc = 3; +var S = 4; +var Sc = 5; +var SS = 6; +var SSc = 7; + +// String names for the different sizes +var sizeNames = [ + "displaystyle textstyle", + "textstyle", + "scriptstyle", + "scriptscriptstyle" +]; + +// Reset names for the different sizes +var resetNames = [ + "reset-textstyle", + "reset-textstyle", + "reset-scriptstyle", + "reset-scriptscriptstyle" +]; + +// Instances of the different styles +var styles = [ + new Style(D, 0, 1.0, false), + new Style(Dc, 0, 1.0, true), + new Style(T, 1, 1.0, false), + new Style(Tc, 1, 1.0, true), + new Style(S, 2, 0.7, false), + new Style(Sc, 2, 0.7, true), + new Style(SS, 3, 0.5, false), + new Style(SSc, 3, 0.5, true) +]; + +// Lookup tables for switching from one style to another +var sup = [S, Sc, S, Sc, SS, SSc, SS, SSc]; +var sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc]; +var fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc]; +var fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc]; +var cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc]; + +// We only export some of the styles. Also, we don't export the `Style` class so +// no more styles can be generated. +module.exports = { + DISPLAY: styles[D], + TEXT: styles[T], + SCRIPT: styles[S], + SCRIPTSCRIPT: styles[SS] +}; + +},{"./fontMetrics.js":17}],10:[function(require,module,exports){ +/* eslint no-console:0 */ +/** + * This module contains general functions that can be used for building + * different kinds of domTree nodes in a consistent manner. + */ + +var domTree = require("./domTree"); +var fontMetrics = require("./fontMetrics"); +var symbols = require("./symbols"); +var utils = require("./utils"); + +var greekCapitals = [ + "\\Gamma", + "\\Delta", + "\\Theta", + "\\Lambda", + "\\Xi", + "\\Pi", + "\\Sigma", + "\\Upsilon", + "\\Phi", + "\\Psi", + "\\Omega" +]; + +// The following have to be loaded from Main-Italic font, using class mainit +var mainitLetters = [ + "\u0131", // dotless i, \imath + "\u0237", // dotless j, \jmath + "\u00a3" // \pounds +]; + +/** + * Makes a symbolNode after translation via the list of symbols in symbols.js. + * Correctly pulls out metrics for the character, and optionally takes a list of + * classes to be attached to the node. + * + * TODO: make argument order closer to makeSpan + * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which + * should if present come first in `classes`. + */ +var makeSymbol = function(value, fontFamily, mode, options, classes) { + // Replace the value with its replaced value from symbol.js + if (symbols[mode][value] && symbols[mode][value].replace) { + value = symbols[mode][value].replace; + } + + var metrics = fontMetrics.getCharacterMetrics(value, fontFamily); + + var symbolNode; + if (metrics) { + var italic = metrics.italic; + if (mode === "text") { + italic = 0; + } + symbolNode = new domTree.symbolNode( + value, metrics.height, metrics.depth, italic, metrics.skew, + classes); + } else { + // TODO(emily): Figure out a good way to only print this in development + typeof console !== "undefined" && console.warn( + "No character metrics for '" + value + "' in style '" + + fontFamily + "'"); + symbolNode = new domTree.symbolNode(value, 0, 0, 0, 0, classes); + } + + if (options) { + if (options.style.isTight()) { + symbolNode.classes.push("mtight"); + } + if (options.getColor()) { + symbolNode.style.color = options.getColor(); + } + } + + return symbolNode; +}; + +/** + * Makes a symbol in Main-Regular or AMS-Regular. + * Used for rel, bin, open, close, inner, and punct. + */ +var mathsym = function(value, mode, options, classes) { + // Decide what font to render the symbol in by its entry in the symbols + // table. + // Have a special case for when the value = \ because the \ is used as a + // textord in unsupported command errors but cannot be parsed as a regular + // text ordinal and is therefore not present as a symbol in the symbols + // table for text + if (value === "\\" || symbols[mode][value].font === "main") { + return makeSymbol(value, "Main-Regular", mode, options, classes); + } else { + return makeSymbol( + value, "AMS-Regular", mode, options, classes.concat(["amsrm"])); + } +}; + +/** + * Makes a symbol in the default font for mathords and textords. + */ +var mathDefault = function(value, mode, options, classes, type) { + if (type === "mathord") { + return mathit(value, mode, options, classes); + } else if (type === "textord") { + return makeSymbol( + value, "Main-Regular", mode, options, classes.concat(["mathrm"])); + } else { + throw new Error("unexpected type: " + type + " in mathDefault"); + } +}; + +/** + * Makes a symbol in the italic math font. + */ +var mathit = function(value, mode, options, classes) { + if (/[0-9]/.test(value.charAt(0)) || + // glyphs for \imath and \jmath do not exist in Math-Italic so we + // need to use Main-Italic instead + utils.contains(mainitLetters, value) || + utils.contains(greekCapitals, value)) { + return makeSymbol( + value, "Main-Italic", mode, options, classes.concat(["mainit"])); + } else { + return makeSymbol( + value, "Math-Italic", mode, options, classes.concat(["mathit"])); + } +}; + +/** + * Makes either a mathord or textord in the correct font and color. + */ +var makeOrd = function(group, options, type) { + var mode = group.mode; + var value = group.value; + if (symbols[mode][value] && symbols[mode][value].replace) { + value = symbols[mode][value].replace; + } + + var classes = ["mord"]; + + var font = options.font; + if (font) { + if (font === "mathit" || utils.contains(mainitLetters, value)) { + return mathit(value, mode, options, classes); + } else { + var fontName = fontMap[font].fontName; + if (fontMetrics.getCharacterMetrics(value, fontName)) { + return makeSymbol( + value, fontName, mode, options, classes.concat([font])); + } else { + return mathDefault(value, mode, options, classes, type); + } + } + } else { + return mathDefault(value, mode, options, classes, type); + } +}; + +/** + * Calculate the height, depth, and maxFontSize of an element based on its + * children. + */ +var sizeElementFromChildren = function(elem) { + var height = 0; + var depth = 0; + var maxFontSize = 0; + + if (elem.children) { + for (var i = 0; i < elem.children.length; i++) { + if (elem.children[i].height > height) { + height = elem.children[i].height; + } + if (elem.children[i].depth > depth) { + depth = elem.children[i].depth; + } + if (elem.children[i].maxFontSize > maxFontSize) { + maxFontSize = elem.children[i].maxFontSize; + } + } + } + + elem.height = height; + elem.depth = depth; + elem.maxFontSize = maxFontSize; +}; + +/** + * Makes a span with the given list of classes, list of children, and options. + * + * TODO: Ensure that `options` is always provided (currently some call sites + * don't pass it). + * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which + * should if present come first in `classes`. + */ +var makeSpan = function(classes, children, options) { + var span = new domTree.span(classes, children, options); + + sizeElementFromChildren(span); + + return span; +}; + +/** + * Prepends the given children to the given span, updating height, depth, and + * maxFontSize. + */ +var prependChildren = function(span, children) { + span.children = children.concat(span.children); + + sizeElementFromChildren(span); +}; + +/** + * Makes a document fragment with the given list of children. + */ +var makeFragment = function(children) { + var fragment = new domTree.documentFragment(children); + + sizeElementFromChildren(fragment); + + return fragment; +}; + +/** + * Makes an element placed in each of the vlist elements to ensure that each + * element has the same max font size. To do this, we create a zero-width space + * with the correct font size. + */ +var makeFontSizer = function(options, fontSize) { + var fontSizeInner = makeSpan([], [new domTree.symbolNode("\u200b")]); + fontSizeInner.style.fontSize = + (fontSize / options.style.sizeMultiplier) + "em"; + + var fontSizer = makeSpan( + ["fontsize-ensurer", "reset-" + options.size, "size5"], + [fontSizeInner]); + + return fontSizer; +}; + +/** + * Makes a vertical list by stacking elements and kerns on top of each other. + * Allows for many different ways of specifying the positioning method. + * + * Arguments: + * - children: A list of child or kern nodes to be stacked on top of each other + * (i.e. the first element will be at the bottom, and the last at + * the top). Element nodes are specified as + * {type: "elem", elem: node} + * while kern nodes are specified as + * {type: "kern", size: size} + * - positionType: The method by which the vlist should be positioned. Valid + * values are: + * - "individualShift": The children list only contains elem + * nodes, and each node contains an extra + * "shift" value of how much it should be + * shifted (note that shifting is always + * moving downwards). positionData is + * ignored. + * - "top": The positionData specifies the topmost point of + * the vlist (note this is expected to be a height, + * so positive values move up) + * - "bottom": The positionData specifies the bottommost point + * of the vlist (note this is expected to be a + * depth, so positive values move down + * - "shift": The vlist will be positioned such that its + * baseline is positionData away from the baseline + * of the first child. Positive values move + * downwards. + * - "firstBaseline": The vlist will be positioned such that + * its baseline is aligned with the + * baseline of the first child. + * positionData is ignored. (this is + * equivalent to "shift" with + * positionData=0) + * - positionData: Data used in different ways depending on positionType + * - options: An Options object + * + */ +var makeVList = function(children, positionType, positionData, options) { + var depth; + var currPos; + var i; + if (positionType === "individualShift") { + var oldChildren = children; + children = [oldChildren[0]]; + + // Add in kerns to the list of children to get each element to be + // shifted to the correct specified shift + depth = -oldChildren[0].shift - oldChildren[0].elem.depth; + currPos = depth; + for (i = 1; i < oldChildren.length; i++) { + var diff = -oldChildren[i].shift - currPos - + oldChildren[i].elem.depth; + var size = diff - + (oldChildren[i - 1].elem.height + + oldChildren[i - 1].elem.depth); + + currPos = currPos + diff; + + children.push({type: "kern", size: size}); + children.push(oldChildren[i]); + } + } else if (positionType === "top") { + // We always start at the bottom, so calculate the bottom by adding up + // all the sizes + var bottom = positionData; + for (i = 0; i < children.length; i++) { + if (children[i].type === "kern") { + bottom -= children[i].size; + } else { + bottom -= children[i].elem.height + children[i].elem.depth; + } + } + depth = bottom; + } else if (positionType === "bottom") { + depth = -positionData; + } else if (positionType === "shift") { + depth = -children[0].elem.depth - positionData; + } else if (positionType === "firstBaseline") { + depth = -children[0].elem.depth; + } else { + depth = 0; + } + + // Make the fontSizer + var maxFontSize = 0; + for (i = 0; i < children.length; i++) { + if (children[i].type === "elem") { + maxFontSize = Math.max(maxFontSize, children[i].elem.maxFontSize); + } + } + var fontSizer = makeFontSizer(options, maxFontSize); + + // Create a new list of actual children at the correct offsets + var realChildren = []; + currPos = depth; + for (i = 0; i < children.length; i++) { + if (children[i].type === "kern") { + currPos += children[i].size; + } else { + var child = children[i].elem; + + var shift = -child.depth - currPos; + currPos += child.height + child.depth; + + var childWrap = makeSpan([], [fontSizer, child]); + childWrap.height -= shift; + childWrap.depth += shift; + childWrap.style.top = shift + "em"; + + realChildren.push(childWrap); + } + } + + // Add in an element at the end with no offset to fix the calculation of + // baselines in some browsers (namely IE, sometimes safari) + var baselineFix = makeSpan( + ["baseline-fix"], [fontSizer, new domTree.symbolNode("\u200b")]); + realChildren.push(baselineFix); + + var vlist = makeSpan(["vlist"], realChildren); + // Fix the final height and depth, in case there were kerns at the ends + // since the makeSpan calculation won't take that in to account. + vlist.height = Math.max(currPos, vlist.height); + vlist.depth = Math.max(-depth, vlist.depth); + return vlist; +}; + +// A table of size -> font size for the different sizing functions +var sizingMultiplier = { + size1: 0.5, + size2: 0.7, + size3: 0.8, + size4: 0.9, + size5: 1.0, + size6: 1.2, + size7: 1.44, + size8: 1.73, + size9: 2.07, + size10: 2.49 +}; + +// A map of spacing functions to their attributes, like size and corresponding +// CSS class +var spacingFunctions = { + "\\qquad": { + size: "2em", + className: "qquad" + }, + "\\quad": { + size: "1em", + className: "quad" + }, + "\\enspace": { + size: "0.5em", + className: "enspace" + }, + "\\;": { + size: "0.277778em", + className: "thickspace" + }, + "\\:": { + size: "0.22222em", + className: "mediumspace" + }, + "\\,": { + size: "0.16667em", + className: "thinspace" + }, + "\\!": { + size: "-0.16667em", + className: "negativethinspace" + } +}; + +/** + * Maps TeX font commands to objects containing: + * - variant: string used for "mathvariant" attribute in buildMathML.js + * - fontName: the "style" parameter to fontMetrics.getCharacterMetrics + */ +// A map between tex font commands an MathML mathvariant attribute values +var fontMap = { + // styles + "mathbf": { + variant: "bold", + fontName: "Main-Bold" + }, + "mathrm": { + variant: "normal", + fontName: "Main-Regular" + }, + "textit": { + variant: "italic", + fontName: "Main-Italic" + }, + + // "mathit" is missing because it requires the use of two fonts: Main-Italic + // and Math-Italic. This is handled by a special case in makeOrd which ends + // up calling mathit. + + // families + "mathbb": { + variant: "double-struck", + fontName: "AMS-Regular" + }, + "mathcal": { + variant: "script", + fontName: "Caligraphic-Regular" + }, + "mathfrak": { + variant: "fraktur", + fontName: "Fraktur-Regular" + }, + "mathscr": { + variant: "script", + fontName: "Script-Regular" + }, + "mathsf": { + variant: "sans-serif", + fontName: "SansSerif-Regular" + }, + "mathtt": { + variant: "monospace", + fontName: "Typewriter-Regular" + } +}; + +module.exports = { + fontMap: fontMap, + makeSymbol: makeSymbol, + mathsym: mathsym, + makeSpan: makeSpan, + makeFragment: makeFragment, + makeVList: makeVList, + makeOrd: makeOrd, + prependChildren: prependChildren, + sizingMultiplier: sizingMultiplier, + spacingFunctions: spacingFunctions +}; + +},{"./domTree":15,"./fontMetrics":17,"./symbols":23,"./utils":25}],11:[function(require,module,exports){ +/* eslint no-console:0 */ +/** + * This file does the main work of building a domTree structure from a parse + * tree. The entry point is the `buildHTML` function, which takes a parse tree. + * Then, the buildExpression, buildGroup, and various groupTypes functions are + * called, to produce a final HTML tree. + */ + +var ParseError = require("./ParseError"); +var Style = require("./Style"); + +var buildCommon = require("./buildCommon"); +var delimiter = require("./delimiter"); +var domTree = require("./domTree"); +var fontMetrics = require("./fontMetrics"); +var utils = require("./utils"); + +var makeSpan = buildCommon.makeSpan; + +var isSpace = function(node) { + return node instanceof domTree.span && node.classes[0] === "mspace"; +}; + +// Binary atoms (first class `mbin`) change into ordinary atoms (`mord`) +// depending on their surroundings. See TeXbook pg. 442-446, Rules 5 and 6, +// and the text before Rule 19. + +var isBin = function(node) { + return node && node.classes[0] === "mbin"; +}; + +var isBinLeftCanceller = function(node, isRealGroup) { + // TODO: This code assumes that a node's math class is the first element + // of its `classes` array. A later cleanup should ensure this, for + // instance by changing the signature of `makeSpan`. + if (node) { + return utils.contains(["mbin", "mopen", "mrel", "mop", "mpunct"], + node.classes[0]); + } else { + return isRealGroup; + } +}; + +var isBinRightCanceller = function(node, isRealGroup) { + if (node) { + return utils.contains(["mrel", "mclose", "mpunct"], node.classes[0]); + } else { + return isRealGroup; + } +}; + +/** + * Take a list of nodes, build them in order, and return a list of the built + * nodes. documentFragments are flattened into their contents, so the + * returned list contains no fragments. `isRealGroup` is true if `expression` + * is a real group (no atoms will be added on either side), as opposed to + * a partial group (e.g. one created by \color). + */ +var buildExpression = function(expression, options, isRealGroup) { + // Parse expressions into `groups`. + var groups = []; + for (var i = 0; i < expression.length; i++) { + var group = expression[i]; + var output = buildGroup(group, options); + if (output instanceof domTree.documentFragment) { + Array.prototype.push.apply(groups, output.children); + } else { + groups.push(output); + } + } + // At this point `groups` consists entirely of `symbolNode`s and `span`s. + + // Explicit spaces (e.g., \;, \,) should be ignored with respect to atom + // spacing (e.g., "add thick space between mord and mrel"). Since CSS + // adjacency rules implement atom spacing, spaces should be invisible to + // CSS. So we splice them out of `groups` and into the atoms themselves. + var spaces = null; + for (i = 0; i < groups.length; i++) { + if (isSpace(groups[i])) { + spaces = spaces || []; + spaces.push(groups[i]); + groups.splice(i, 1); + i--; + } else if (spaces) { + if (groups[i] instanceof domTree.symbolNode) { + groups[i] = makeSpan([].concat(groups[i].classes), [groups[i]]); + } + buildCommon.prependChildren(groups[i], spaces); + spaces = null; + } + } + if (spaces) { + Array.prototype.push.apply(groups, spaces); + } + + // Binary operators change to ordinary symbols in some contexts. + for (i = 0; i < groups.length; i++) { + if (isBin(groups[i]) + && (isBinLeftCanceller(groups[i - 1], isRealGroup) + || isBinRightCanceller(groups[i + 1], isRealGroup))) { + groups[i].classes[0] = "mord"; + } + } + + return groups; +}; + +// Return math atom class (mclass) of a domTree. +var getTypeOfDomTree = function(node) { + if (node instanceof domTree.documentFragment) { + if (node.children.length) { + return getTypeOfDomTree( + node.children[node.children.length - 1]); + } + } else { + if (utils.contains(["mord", "mop", "mbin", "mrel", "mopen", "mclose", + "mpunct", "minner"], node.classes[0])) { + return node.classes[0]; + } + } + return null; +}; + +/** + * Sometimes, groups perform special rules when they have superscripts or + * subscripts attached to them. This function lets the `supsub` group know that + * its inner element should handle the superscripts and subscripts instead of + * handling them itself. + */ +var shouldHandleSupSub = function(group, options) { + if (!group) { + return false; + } else if (group.type === "op") { + // Operators handle supsubs differently when they have limits + // (e.g. `\displaystyle\sum_2^3`) + return group.value.limits && + (options.style.size === Style.DISPLAY.size || + group.value.alwaysHandleSupSub); + } else if (group.type === "accent") { + return isCharacterBox(group.value.base); + } else { + return null; + } +}; + +/** + * Sometimes we want to pull out the innermost element of a group. In most + * cases, this will just be the group itself, but when ordgroups and colors have + * a single element, we want to pull that out. + */ +var getBaseElem = function(group) { + if (!group) { + return false; + } else if (group.type === "ordgroup") { + if (group.value.length === 1) { + return getBaseElem(group.value[0]); + } else { + return group; + } + } else if (group.type === "color") { + if (group.value.value.length === 1) { + return getBaseElem(group.value.value[0]); + } else { + return group; + } + } else if (group.type === "font") { + return getBaseElem(group.value.body); + } else { + return group; + } +}; + +/** + * TeXbook algorithms often reference "character boxes", which are simply groups + * with a single character in them. To decide if something is a character box, + * we find its innermost group, and see if it is a single character. + */ +var isCharacterBox = function(group) { + var baseElem = getBaseElem(group); + + // These are all they types of groups which hold single characters + return baseElem.type === "mathord" || + baseElem.type === "textord" || + baseElem.type === "bin" || + baseElem.type === "rel" || + baseElem.type === "inner" || + baseElem.type === "open" || + baseElem.type === "close" || + baseElem.type === "punct"; +}; + +var makeNullDelimiter = function(options, classes) { + return makeSpan(classes.concat([ + "sizing", "reset-" + options.size, "size5", + options.style.reset(), Style.TEXT.cls(), + "nulldelimiter"])); +}; + +/** + * This is a map of group types to the function used to handle that type. + * Simpler types come at the beginning, while complicated types come afterwards. + */ +var groupTypes = {}; + +groupTypes.mathord = function(group, options) { + return buildCommon.makeOrd(group, options, "mathord"); +}; + +groupTypes.textord = function(group, options) { + return buildCommon.makeOrd(group, options, "textord"); +}; + +groupTypes.bin = function(group, options) { + return buildCommon.mathsym( + group.value, group.mode, options, ["mbin"]); +}; + +groupTypes.rel = function(group, options) { + return buildCommon.mathsym( + group.value, group.mode, options, ["mrel"]); +}; + +groupTypes.open = function(group, options) { + return buildCommon.mathsym( + group.value, group.mode, options, ["mopen"]); +}; + +groupTypes.close = function(group, options) { + return buildCommon.mathsym( + group.value, group.mode, options, ["mclose"]); +}; + +groupTypes.inner = function(group, options) { + return buildCommon.mathsym( + group.value, group.mode, options, ["minner"]); +}; + +groupTypes.punct = function(group, options) { + return buildCommon.mathsym( + group.value, group.mode, options, ["mpunct"]); +}; + +groupTypes.ordgroup = function(group, options) { + return makeSpan( + ["mord", options.style.cls()], + buildExpression(group.value, options.reset(), true), + options + ); +}; + +groupTypes.text = function(group, options) { + var newOptions = options.withFont(group.value.style); + var inner = buildExpression(group.value.body, newOptions, true); + for (var i = 0; i < inner.length - 1; i++) { + if (inner[i].tryCombine(inner[i + 1])) { + inner.splice(i + 1, 1); + i--; + } + } + return makeSpan(["mord", "text", newOptions.style.cls()], + inner, newOptions); +}; + +groupTypes.color = function(group, options) { + var elements = buildExpression( + group.value.value, + options.withColor(group.value.color), + false + ); + + // \color isn't supposed to affect the type of the elements it contains. + // To accomplish this, we wrap the results in a fragment, so the inner + // elements will be able to directly interact with their neighbors. For + // example, `\color{red}{2 +} 3` has the same spacing as `2 + 3` + return new buildCommon.makeFragment(elements); +}; + +groupTypes.supsub = function(group, options) { + // Superscript and subscripts are handled in the TeXbook on page + // 445-446, rules 18(a-f). + + // Here is where we defer to the inner group if it should handle + // superscripts and subscripts itself. + if (shouldHandleSupSub(group.value.base, options)) { + return groupTypes[group.value.base.type](group, options); + } + + var base = buildGroup(group.value.base, options.reset()); + var supmid; + var submid; + var sup; + var sub; + + var style = options.style; + var newOptions; + + if (group.value.sup) { + newOptions = options.withStyle(style.sup()); + sup = buildGroup(group.value.sup, newOptions); + supmid = makeSpan([style.reset(), style.sup().cls()], + [sup], newOptions); + } + + if (group.value.sub) { + newOptions = options.withStyle(style.sub()); + sub = buildGroup(group.value.sub, newOptions); + submid = makeSpan([style.reset(), style.sub().cls()], + [sub], newOptions); + } + + // Rule 18a + var supShift; + var subShift; + if (isCharacterBox(group.value.base)) { + supShift = 0; + subShift = 0; + } else { + supShift = base.height - style.metrics.supDrop; + subShift = base.depth + style.metrics.subDrop; + } + + // Rule 18c + var minSupShift; + if (style === Style.DISPLAY) { + minSupShift = style.metrics.sup1; + } else if (style.cramped) { + minSupShift = style.metrics.sup3; + } else { + minSupShift = style.metrics.sup2; + } + + // scriptspace is a font-size-independent size, so scale it + // appropriately + var multiplier = Style.TEXT.sizeMultiplier * + style.sizeMultiplier; + var scriptspace = + (0.5 / fontMetrics.metrics.ptPerEm) / multiplier + "em"; + + var supsub; + if (!group.value.sup) { + // Rule 18b + subShift = Math.max( + subShift, style.metrics.sub1, + sub.height - 0.8 * style.metrics.xHeight); + + supsub = buildCommon.makeVList([ + {type: "elem", elem: submid} + ], "shift", subShift, options); + + supsub.children[0].style.marginRight = scriptspace; + + // Subscripts shouldn't be shifted by the base's italic correction. + // Account for that by shifting the subscript back the appropriate + // amount. Note we only do this when the base is a single symbol. + if (base instanceof domTree.symbolNode) { + supsub.children[0].style.marginLeft = -base.italic + "em"; + } + } else if (!group.value.sub) { + // Rule 18c, d + supShift = Math.max(supShift, minSupShift, + sup.depth + 0.25 * style.metrics.xHeight); + + supsub = buildCommon.makeVList([ + {type: "elem", elem: supmid} + ], "shift", -supShift, options); + + supsub.children[0].style.marginRight = scriptspace; + } else { + supShift = Math.max( + supShift, minSupShift, sup.depth + 0.25 * style.metrics.xHeight); + subShift = Math.max(subShift, style.metrics.sub2); + + var ruleWidth = fontMetrics.metrics.defaultRuleThickness; + + // Rule 18e + if ((supShift - sup.depth) - (sub.height - subShift) < + 4 * ruleWidth) { + subShift = 4 * ruleWidth - (supShift - sup.depth) + sub.height; + var psi = 0.8 * style.metrics.xHeight - (supShift - sup.depth); + if (psi > 0) { + supShift += psi; + subShift -= psi; + } + } + + supsub = buildCommon.makeVList([ + {type: "elem", elem: submid, shift: subShift}, + {type: "elem", elem: supmid, shift: -supShift} + ], "individualShift", null, options); + + // See comment above about subscripts not being shifted + if (base instanceof domTree.symbolNode) { + supsub.children[0].style.marginLeft = -base.italic + "em"; + } + + supsub.children[0].style.marginRight = scriptspace; + supsub.children[1].style.marginRight = scriptspace; + } + + // We ensure to wrap the supsub vlist in a span.msupsub to reset text-align + var mclass = getTypeOfDomTree(base) || "mord"; + return makeSpan([mclass], + [base, makeSpan(["msupsub"], [supsub])], + options); +}; + +groupTypes.genfrac = function(group, options) { + // Fractions are handled in the TeXbook on pages 444-445, rules 15(a-e). + // Figure out what style this fraction should be in based on the + // function used + var style = options.style; + if (group.value.size === "display") { + style = Style.DISPLAY; + } else if (group.value.size === "text") { + style = Style.TEXT; + } + + var nstyle = style.fracNum(); + var dstyle = style.fracDen(); + var newOptions; + + newOptions = options.withStyle(nstyle); + var numer = buildGroup(group.value.numer, newOptions); + var numerreset = makeSpan([style.reset(), nstyle.cls()], + [numer], newOptions); + + newOptions = options.withStyle(dstyle); + var denom = buildGroup(group.value.denom, newOptions); + var denomreset = makeSpan([style.reset(), dstyle.cls()], + [denom], newOptions); + + var ruleWidth; + if (group.value.hasBarLine) { + ruleWidth = fontMetrics.metrics.defaultRuleThickness / + options.style.sizeMultiplier; + } else { + ruleWidth = 0; + } + + // Rule 15b + var numShift; + var clearance; + var denomShift; + if (style.size === Style.DISPLAY.size) { + numShift = style.metrics.num1; + if (ruleWidth > 0) { + clearance = 3 * ruleWidth; + } else { + clearance = 7 * fontMetrics.metrics.defaultRuleThickness; + } + denomShift = style.metrics.denom1; + } else { + if (ruleWidth > 0) { + numShift = style.metrics.num2; + clearance = ruleWidth; + } else { + numShift = style.metrics.num3; + clearance = 3 * fontMetrics.metrics.defaultRuleThickness; + } + denomShift = style.metrics.denom2; + } + + var frac; + if (ruleWidth === 0) { + // Rule 15c + var candidateClearance = + (numShift - numer.depth) - (denom.height - denomShift); + if (candidateClearance < clearance) { + numShift += 0.5 * (clearance - candidateClearance); + denomShift += 0.5 * (clearance - candidateClearance); + } + + frac = buildCommon.makeVList([ + {type: "elem", elem: denomreset, shift: denomShift}, + {type: "elem", elem: numerreset, shift: -numShift} + ], "individualShift", null, options); + } else { + // Rule 15d + var axisHeight = style.metrics.axisHeight; + + if ((numShift - numer.depth) - (axisHeight + 0.5 * ruleWidth) < + clearance) { + numShift += + clearance - ((numShift - numer.depth) - + (axisHeight + 0.5 * ruleWidth)); + } + + if ((axisHeight - 0.5 * ruleWidth) - (denom.height - denomShift) < + clearance) { + denomShift += + clearance - ((axisHeight - 0.5 * ruleWidth) - + (denom.height - denomShift)); + } + + var mid = makeSpan( + [options.style.reset(), Style.TEXT.cls(), "frac-line"]); + // Manually set the height of the line because its height is + // created in CSS + mid.height = ruleWidth; + + var midShift = -(axisHeight - 0.5 * ruleWidth); + + frac = buildCommon.makeVList([ + {type: "elem", elem: denomreset, shift: denomShift}, + {type: "elem", elem: mid, shift: midShift}, + {type: "elem", elem: numerreset, shift: -numShift} + ], "individualShift", null, options); + } + + // Since we manually change the style sometimes (with \dfrac or \tfrac), + // account for the possible size change here. + frac.height *= style.sizeMultiplier / options.style.sizeMultiplier; + frac.depth *= style.sizeMultiplier / options.style.sizeMultiplier; + + // Rule 15e + var delimSize; + if (style.size === Style.DISPLAY.size) { + delimSize = style.metrics.delim1; + } else { + delimSize = style.metrics.delim2; + } + + var leftDelim; + var rightDelim; + if (group.value.leftDelim == null) { + leftDelim = makeNullDelimiter(options, ["mopen"]); + } else { + leftDelim = delimiter.customSizedDelim( + group.value.leftDelim, delimSize, true, + options.withStyle(style), group.mode, ["mopen"]); + } + if (group.value.rightDelim == null) { + rightDelim = makeNullDelimiter(options, ["mclose"]); + } else { + rightDelim = delimiter.customSizedDelim( + group.value.rightDelim, delimSize, true, + options.withStyle(style), group.mode, ["mclose"]); + } + + return makeSpan( + ["mord", options.style.reset(), style.cls()], + [leftDelim, makeSpan(["mfrac"], [frac]), rightDelim], + options); +}; + +var calculateSize = function(sizeValue, style) { + var x = sizeValue.number; + if (sizeValue.unit === "ex") { + x *= style.metrics.emPerEx; + } else if (sizeValue.unit === "mu") { + x /= 18; + } + return x; +}; + +groupTypes.array = function(group, options) { + var r; + var c; + var nr = group.value.body.length; + var nc = 0; + var body = new Array(nr); + + var style = options.style; + + // Horizontal spacing + var pt = 1 / fontMetrics.metrics.ptPerEm; + var arraycolsep = 5 * pt; // \arraycolsep in article.cls + + // Vertical spacing + var baselineskip = 12 * pt; // see size10.clo + // Default \arraystretch from lttab.dtx + // TODO(gagern): may get redefined once we have user-defined macros + var arraystretch = utils.deflt(group.value.arraystretch, 1); + var arrayskip = arraystretch * baselineskip; + var arstrutHeight = 0.7 * arrayskip; // \strutbox in ltfsstrc.dtx and + var arstrutDepth = 0.3 * arrayskip; // \@arstrutbox in lttab.dtx + + var totalHeight = 0; + for (r = 0; r < group.value.body.length; ++r) { + var inrow = group.value.body[r]; + var height = arstrutHeight; // \@array adds an \@arstrut + var depth = arstrutDepth; // to each tow (via the template) + + if (nc < inrow.length) { + nc = inrow.length; + } + + var outrow = new Array(inrow.length); + for (c = 0; c < inrow.length; ++c) { + var elt = buildGroup(inrow[c], options); + if (depth < elt.depth) { + depth = elt.depth; + } + if (height < elt.height) { + height = elt.height; + } + outrow[c] = elt; + } + + var gap = 0; + if (group.value.rowGaps[r]) { + gap = calculateSize(group.value.rowGaps[r].value, style); + if (gap > 0) { // \@argarraycr + gap += arstrutDepth; + if (depth < gap) { + depth = gap; // \@xargarraycr + } + gap = 0; + } + } + + outrow.height = height; + outrow.depth = depth; + totalHeight += height; + outrow.pos = totalHeight; + totalHeight += depth + gap; // \@yargarraycr + body[r] = outrow; + } + + var offset = totalHeight / 2 + style.metrics.axisHeight; + var colDescriptions = group.value.cols || []; + var cols = []; + var colSep; + var colDescrNum; + for (c = 0, colDescrNum = 0; + // Continue while either there are more columns or more column + // descriptions, so trailing separators don't get lost. + c < nc || colDescrNum < colDescriptions.length; + ++c, ++colDescrNum) { + + var colDescr = colDescriptions[colDescrNum] || {}; + + var firstSeparator = true; + while (colDescr.type === "separator") { + // If there is more than one separator in a row, add a space + // between them. + if (!firstSeparator) { + colSep = makeSpan(["arraycolsep"], []); + colSep.style.width = + fontMetrics.metrics.doubleRuleSep + "em"; + cols.push(colSep); + } + + if (colDescr.separator === "|") { + var separator = makeSpan( + ["vertical-separator"], + []); + separator.style.height = totalHeight + "em"; + separator.style.verticalAlign = + -(totalHeight - offset) + "em"; + + cols.push(separator); + } else { + throw new ParseError( + "Invalid separator type: " + colDescr.separator); + } + + colDescrNum++; + colDescr = colDescriptions[colDescrNum] || {}; + firstSeparator = false; + } + + if (c >= nc) { + continue; + } + + var sepwidth; + if (c > 0 || group.value.hskipBeforeAndAfter) { + sepwidth = utils.deflt(colDescr.pregap, arraycolsep); + if (sepwidth !== 0) { + colSep = makeSpan(["arraycolsep"], []); + colSep.style.width = sepwidth + "em"; + cols.push(colSep); + } + } + + var col = []; + for (r = 0; r < nr; ++r) { + var row = body[r]; + var elem = row[c]; + if (!elem) { + continue; + } + var shift = row.pos - offset; + elem.depth = row.depth; + elem.height = row.height; + col.push({type: "elem", elem: elem, shift: shift}); + } + + col = buildCommon.makeVList(col, "individualShift", null, options); + col = makeSpan( + ["col-align-" + (colDescr.align || "c")], + [col]); + cols.push(col); + + if (c < nc - 1 || group.value.hskipBeforeAndAfter) { + sepwidth = utils.deflt(colDescr.postgap, arraycolsep); + if (sepwidth !== 0) { + colSep = makeSpan(["arraycolsep"], []); + colSep.style.width = sepwidth + "em"; + cols.push(colSep); + } + } + } + body = makeSpan(["mtable"], cols); + return makeSpan(["mord"], [body], options); +}; + +groupTypes.spacing = function(group, options) { + if (group.value === "\\ " || group.value === "\\space" || + group.value === " " || group.value === "~") { + // Spaces are generated by adding an actual space. Each of these + // things has an entry in the symbols table, so these will be turned + // into appropriate outputs. + if (group.mode === "text") { + return buildCommon.makeOrd(group, options, "textord"); + } else { + return makeSpan(["mspace"], + [buildCommon.mathsym(group.value, group.mode, options)], + options); + } + } else { + // Other kinds of spaces are of arbitrary width. We use CSS to + // generate these. + return makeSpan( + ["mspace", + buildCommon.spacingFunctions[group.value].className], + [], options); + } +}; + +groupTypes.llap = function(group, options) { + var inner = makeSpan( + ["inner"], [buildGroup(group.value.body, options.reset())]); + var fix = makeSpan(["fix"], []); + return makeSpan( + ["mord", "llap", options.style.cls()], [inner, fix], options); +}; + +groupTypes.rlap = function(group, options) { + var inner = makeSpan( + ["inner"], [buildGroup(group.value.body, options.reset())]); + var fix = makeSpan(["fix"], []); + return makeSpan( + ["mord", "rlap", options.style.cls()], [inner, fix], options); +}; + +groupTypes.op = function(group, options) { + // Operators are handled in the TeXbook pg. 443-444, rule 13(a). + var supGroup; + var subGroup; + var hasLimits = false; + if (group.type === "supsub") { + // If we have limits, supsub will pass us its group to handle. Pull + // out the superscript and subscript and set the group to the op in + // its base. + supGroup = group.value.sup; + subGroup = group.value.sub; + group = group.value.base; + hasLimits = true; + } + + var style = options.style; + + // Most operators have a large successor symbol, but these don't. + var noSuccessor = [ + "\\smallint" + ]; + + var large = false; + if (style.size === Style.DISPLAY.size && + group.value.symbol && + !utils.contains(noSuccessor, group.value.body)) { + + // Most symbol operators get larger in displaystyle (rule 13) + large = true; + } + + var base; + var baseShift = 0; + var slant = 0; + if (group.value.symbol) { + // If this is a symbol, create the symbol. + var fontName = large ? "Size2-Regular" : "Size1-Regular"; + base = buildCommon.makeSymbol( + group.value.body, fontName, "math", options, + ["mop", "op-symbol", large ? "large-op" : "small-op"]); + + // Shift the symbol so its center lies on the axis (rule 13). It + // appears that our fonts have the centers of the symbols already + // almost on the axis, so these numbers are very small. Note we + // don't actually apply this here, but instead it is used either in + // the vlist creation or separately when there are no limits. + baseShift = (base.height - base.depth) / 2 - + style.metrics.axisHeight * style.sizeMultiplier; + + // The slant of the symbol is just its italic correction. + slant = base.italic; + } else if (group.value.value) { + // If this is a list, compose that list. + var inner = buildExpression(group.value.value, options, true); + + base = makeSpan(["mop"], inner, options); + } else { + // Otherwise, this is a text operator. Build the text from the + // operator's name. + // TODO(emily): Add a space in the middle of some of these + // operators, like \limsup + var output = []; + for (var i = 1; i < group.value.body.length; i++) { + output.push(buildCommon.mathsym(group.value.body[i], group.mode)); + } + base = makeSpan(["mop"], output, options); + } + + if (hasLimits) { + // IE 8 clips \int if it is in a display: inline-block. We wrap it + // in a new span so it is an inline, and works. + base = makeSpan([], [base]); + + var supmid; + var supKern; + var submid; + var subKern; + var newOptions; + // We manually have to handle the superscripts and subscripts. This, + // aside from the kern calculations, is copied from supsub. + if (supGroup) { + newOptions = options.withStyle(style.sup()); + var sup = buildGroup(supGroup, newOptions); + supmid = makeSpan([style.reset(), style.sup().cls()], + [sup], newOptions); + + supKern = Math.max( + fontMetrics.metrics.bigOpSpacing1, + fontMetrics.metrics.bigOpSpacing3 - sup.depth); + } + + if (subGroup) { + newOptions = options.withStyle(style.sub()); + var sub = buildGroup(subGroup, newOptions); + submid = makeSpan([style.reset(), style.sub().cls()], + [sub], newOptions); + + subKern = Math.max( + fontMetrics.metrics.bigOpSpacing2, + fontMetrics.metrics.bigOpSpacing4 - sub.height); + } + + // Build the final group as a vlist of the possible subscript, base, + // and possible superscript. + var finalGroup; + var top; + var bottom; + if (!supGroup) { + top = base.height - baseShift; + + finalGroup = buildCommon.makeVList([ + {type: "kern", size: fontMetrics.metrics.bigOpSpacing5}, + {type: "elem", elem: submid}, + {type: "kern", size: subKern}, + {type: "elem", elem: base} + ], "top", top, options); + + // Here, we shift the limits by the slant of the symbol. Note + // that we are supposed to shift the limits by 1/2 of the slant, + // but since we are centering the limits adding a full slant of + // margin will shift by 1/2 that. + finalGroup.children[0].style.marginLeft = -slant + "em"; + } else if (!subGroup) { + bottom = base.depth + baseShift; + + finalGroup = buildCommon.makeVList([ + {type: "elem", elem: base}, + {type: "kern", size: supKern}, + {type: "elem", elem: supmid}, + {type: "kern", size: fontMetrics.metrics.bigOpSpacing5} + ], "bottom", bottom, options); + + // See comment above about slants + finalGroup.children[1].style.marginLeft = slant + "em"; + } else if (!supGroup && !subGroup) { + // This case probably shouldn't occur (this would mean the + // supsub was sending us a group with no superscript or + // subscript) but be safe. + return base; + } else { + bottom = fontMetrics.metrics.bigOpSpacing5 + + submid.height + submid.depth + + subKern + + base.depth + baseShift; + + finalGroup = buildCommon.makeVList([ + {type: "kern", size: fontMetrics.metrics.bigOpSpacing5}, + {type: "elem", elem: submid}, + {type: "kern", size: subKern}, + {type: "elem", elem: base}, + {type: "kern", size: supKern}, + {type: "elem", elem: supmid}, + {type: "kern", size: fontMetrics.metrics.bigOpSpacing5} + ], "bottom", bottom, options); + + // See comment above about slants + finalGroup.children[0].style.marginLeft = -slant + "em"; + finalGroup.children[2].style.marginLeft = slant + "em"; + } + + return makeSpan(["mop", "op-limits"], [finalGroup], options); + } else { + if (group.value.symbol) { + base.style.top = baseShift + "em"; + } + + return base; + } +}; + +groupTypes.mod = function(group, options) { + var inner = []; + + if (group.value.modType === "bmod") { + // “\nonscript\mskip-\medmuskip\mkern5mu” + if (!options.style.isTight()) { + inner.push(makeSpan( + ["mspace", "negativemediumspace"], [], options)); + } + inner.push(makeSpan(["mspace", "thickspace"], [], options)); + } else if (options.style.size === Style.DISPLAY.size) { + inner.push(makeSpan(["mspace", "quad"], [], options)); + } else if (group.value.modType === "mod") { + inner.push(makeSpan(["mspace", "twelvemuspace"], [], options)); + } else { + inner.push(makeSpan(["mspace", "eightmuspace"], [], options)); + } + + if (group.value.modType === "pod" || group.value.modType === "pmod") { + inner.push(buildCommon.mathsym("(", group.mode)); + } + + if (group.value.modType !== "pod") { + var modInner = [ + buildCommon.mathsym("m", group.mode), + buildCommon.mathsym("o", group.mode), + buildCommon.mathsym("d", group.mode)]; + if (group.value.modType === "bmod") { + inner.push(makeSpan(["mbin"], modInner, options)); + // “\mkern5mu\nonscript\mskip-\medmuskip” + inner.push(makeSpan(["mspace", "thickspace"], [], options)); + if (!options.style.isTight()) { + inner.push(makeSpan( + ["mspace", "negativemediumspace"], [], options)); + } + } else { + Array.prototype.push.apply(inner, modInner); + inner.push(makeSpan(["mspace", "sixmuspace"], [], options)); + } + } + + if (group.value.value) { + Array.prototype.push.apply(inner, + buildExpression(group.value.value, options, false)); + } + + if (group.value.modType === "pod" || group.value.modType === "pmod") { + inner.push(buildCommon.mathsym(")", group.mode)); + } + + return buildCommon.makeFragment(inner); +}; + +groupTypes.katex = function(group, options) { + // The KaTeX logo. The offsets for the K and a were chosen to look + // good, but the offsets for the T, E, and X were taken from the + // definition of \TeX in TeX (see TeXbook pg. 356) + var k = makeSpan( + ["k"], [buildCommon.mathsym("K", group.mode)], options); + var a = makeSpan( + ["a"], [buildCommon.mathsym("A", group.mode)], options); + + a.height = (a.height + 0.2) * 0.75; + a.depth = (a.height - 0.2) * 0.75; + + var t = makeSpan( + ["t"], [buildCommon.mathsym("T", group.mode)], options); + var e = makeSpan( + ["e"], [buildCommon.mathsym("E", group.mode)], options); + + e.height = (e.height - 0.2155); + e.depth = (e.depth + 0.2155); + + var x = makeSpan( + ["x"], [buildCommon.mathsym("X", group.mode)], options); + + return makeSpan( + ["mord", "katex-logo"], [k, a, t, e, x], options); +}; + +groupTypes.overline = function(group, options) { + // Overlines are handled in the TeXbook pg 443, Rule 9. + var style = options.style; + + // Build the inner group in the cramped style. + var innerGroup = buildGroup(group.value.body, + options.withStyle(style.cramp())); + + var ruleWidth = fontMetrics.metrics.defaultRuleThickness / + style.sizeMultiplier; + + // Create the line above the body + var line = makeSpan( + [style.reset(), Style.TEXT.cls(), "overline-line"]); + line.height = ruleWidth; + line.maxFontSize = 1.0; + + // Generate the vlist, with the appropriate kerns + var vlist = buildCommon.makeVList([ + {type: "elem", elem: innerGroup}, + {type: "kern", size: 3 * ruleWidth}, + {type: "elem", elem: line}, + {type: "kern", size: ruleWidth} + ], "firstBaseline", null, options); + + return makeSpan(["mord", "overline"], [vlist], options); +}; + +groupTypes.underline = function(group, options) { + // Underlines are handled in the TeXbook pg 443, Rule 10. + var style = options.style; + + // Build the inner group. + var innerGroup = buildGroup(group.value.body, options); + + var ruleWidth = fontMetrics.metrics.defaultRuleThickness / + style.sizeMultiplier; + + // Create the line above the body + var line = makeSpan([style.reset(), Style.TEXT.cls(), "underline-line"]); + line.height = ruleWidth; + line.maxFontSize = 1.0; + + // Generate the vlist, with the appropriate kerns + var vlist = buildCommon.makeVList([ + {type: "kern", size: ruleWidth}, + {type: "elem", elem: line}, + {type: "kern", size: 3 * ruleWidth}, + {type: "elem", elem: innerGroup} + ], "top", innerGroup.height, options); + + return makeSpan(["mord", "underline"], [vlist], options); +}; + +groupTypes.sqrt = function(group, options) { + // Square roots are handled in the TeXbook pg. 443, Rule 11. + var style = options.style; + + // First, we do the same steps as in overline to build the inner group + // and line + var inner = buildGroup(group.value.body, options.withStyle(style.cramp())); + + var ruleWidth = fontMetrics.metrics.defaultRuleThickness / + style.sizeMultiplier; + + var line = makeSpan( + [style.reset(), Style.TEXT.cls(), "sqrt-line"], [], + options); + line.height = ruleWidth; + line.maxFontSize = 1.0; + + var phi = ruleWidth; + if (style.id < Style.TEXT.id) { + phi = style.metrics.xHeight; + } + + // Calculate the clearance between the body and line + var lineClearance = ruleWidth + phi / 4; + + var innerHeight = (inner.height + inner.depth) * style.sizeMultiplier; + var minDelimiterHeight = innerHeight + lineClearance + ruleWidth; + + // Create a \surd delimiter of the required minimum size + var delim = makeSpan(["sqrt-sign"], [ + delimiter.customSizedDelim("\\surd", minDelimiterHeight, + false, options, group.mode)], + options); + + var delimDepth = (delim.height + delim.depth) - ruleWidth; + + // Adjust the clearance based on the delimiter size + if (delimDepth > inner.height + inner.depth + lineClearance) { + lineClearance = + (lineClearance + delimDepth - inner.height - inner.depth) / 2; + } + + // Shift the delimiter so that its top lines up with the top of the line + var delimShift = -(inner.height + lineClearance + ruleWidth) + delim.height; + delim.style.top = delimShift + "em"; + delim.height -= delimShift; + delim.depth += delimShift; + + // We add a special case here, because even when `inner` is empty, we + // still get a line. So, we use a simple heuristic to decide if we + // should omit the body entirely. (note this doesn't work for something + // like `\sqrt{\rlap{x}}`, but if someone is doing that they deserve for + // it not to work. + var body; + if (inner.height === 0 && inner.depth === 0) { + body = makeSpan(); + } else { + body = buildCommon.makeVList([ + {type: "elem", elem: inner}, + {type: "kern", size: lineClearance}, + {type: "elem", elem: line}, + {type: "kern", size: ruleWidth} + ], "firstBaseline", null, options); + } + + if (!group.value.index) { + return makeSpan(["mord", "sqrt"], [delim, body], options); + } else { + // Handle the optional root index + + // The index is always in scriptscript style + var newOptions = options.withStyle(Style.SCRIPTSCRIPT); + var root = buildGroup(group.value.index, newOptions); + var rootWrap = makeSpan( + [style.reset(), Style.SCRIPTSCRIPT.cls()], + [root], + newOptions); + + // Figure out the height and depth of the inner part + var innerRootHeight = Math.max(delim.height, body.height); + var innerRootDepth = Math.max(delim.depth, body.depth); + + // The amount the index is shifted by. This is taken from the TeX + // source, in the definition of `\r@@t`. + var toShift = 0.6 * (innerRootHeight - innerRootDepth); + + // Build a VList with the superscript shifted up correctly + var rootVList = buildCommon.makeVList( + [{type: "elem", elem: rootWrap}], + "shift", -toShift, options); + // Add a class surrounding it so we can add on the appropriate + // kerning + var rootVListWrap = makeSpan(["root"], [rootVList]); + + return makeSpan(["mord", "sqrt"], + [rootVListWrap, delim, body], options); + } +}; + +groupTypes.sizing = function(group, options) { + // Handle sizing operators like \Huge. Real TeX doesn't actually allow + // these functions inside of math expressions, so we do some special + // handling. + var inner = buildExpression(group.value.value, + options.withSize(group.value.size), false); + + // Compute the correct maxFontSize. + var style = options.style; + var fontSize = buildCommon.sizingMultiplier[group.value.size]; + fontSize = fontSize * style.sizeMultiplier; + + // Add size-resetting classes to the inner list and set maxFontSize + // manually. Handle nested size changes. + for (var i = 0; i < inner.length; i++) { + var pos = utils.indexOf(inner[i].classes, "sizing"); + if (pos < 0) { + inner[i].classes.push("sizing", "reset-" + options.size, + group.value.size, style.cls()); + inner[i].maxFontSize = fontSize; + } else if (inner[i].classes[pos + 1] === "reset-" + group.value.size) { + // This is a nested size change: e.g., inner[i] is the "b" in + // `\Huge a \small b`. Override the old size (the `reset-` class) + // but not the new size. + inner[i].classes[pos + 1] = "reset-" + options.size; + } + } + + return buildCommon.makeFragment(inner); +}; + +groupTypes.styling = function(group, options) { + // Style changes are handled in the TeXbook on pg. 442, Rule 3. + + // Figure out what style we're changing to. + var styleMap = { + "display": Style.DISPLAY, + "text": Style.TEXT, + "script": Style.SCRIPT, + "scriptscript": Style.SCRIPTSCRIPT + }; + + var newStyle = styleMap[group.value.style]; + var newOptions = options.withStyle(newStyle); + + // Build the inner expression in the new style. + var inner = buildExpression( + group.value.value, newOptions, false); + + // Add style-resetting classes to the inner list. Handle nested changes. + for (var i = 0; i < inner.length; i++) { + var pos = utils.indexOf(inner[i].classes, newStyle.reset()); + if (pos < 0) { + inner[i].classes.push(options.style.reset(), newStyle.cls()); + } else { + // This is a nested style change, as `\textstyle a\scriptstyle b`. + // Only override the old style (the reset class). + inner[i].classes[pos] = options.style.reset(); + } + } + + return new buildCommon.makeFragment(inner); +}; + +groupTypes.font = function(group, options) { + var font = group.value.font; + return buildGroup(group.value.body, options.withFont(font)); +}; + +groupTypes.delimsizing = function(group, options) { + var delim = group.value.value; + + if (delim === ".") { + // Empty delimiters still count as elements, even though they don't + // show anything. + return makeSpan([group.value.mclass]); + } + + // Use delimiter.sizedDelim to generate the delimiter. + return delimiter.sizedDelim( + delim, group.value.size, options, group.mode, + [group.value.mclass]); +}; + +groupTypes.leftright = function(group, options) { + // Build the inner expression + var inner = buildExpression(group.value.body, options.reset(), true); + + var innerHeight = 0; + var innerDepth = 0; + var hadMiddle = false; + + // Calculate its height and depth + for (var i = 0; i < inner.length; i++) { + if (inner[i].isMiddle) { + hadMiddle = true; + } else { + innerHeight = Math.max(inner[i].height, innerHeight); + innerDepth = Math.max(inner[i].depth, innerDepth); + } + } + + var style = options.style; + + // The size of delimiters is the same, regardless of what style we are + // in. Thus, to correctly calculate the size of delimiter we need around + // a group, we scale down the inner size based on the size. + innerHeight *= style.sizeMultiplier; + innerDepth *= style.sizeMultiplier; + + var leftDelim; + if (group.value.left === ".") { + // Empty delimiters in \left and \right make null delimiter spaces. + leftDelim = makeNullDelimiter(options, ["mopen"]); + } else { + // Otherwise, use leftRightDelim to generate the correct sized + // delimiter. + leftDelim = delimiter.leftRightDelim( + group.value.left, innerHeight, innerDepth, options, + group.mode, ["mopen"]); + } + // Add it to the beginning of the expression + inner.unshift(leftDelim); + + // Handle middle delimiters + if (hadMiddle) { + for (i = 1; i < inner.length; i++) { + if (inner[i].isMiddle) { + // Apply the options that were active when \middle was called + inner[i] = delimiter.leftRightDelim( + inner[i].isMiddle.value, innerHeight, innerDepth, + inner[i].isMiddle.options, group.mode, []); + } + } + } + + var rightDelim; + // Same for the right delimiter + if (group.value.right === ".") { + rightDelim = makeNullDelimiter(options, ["mclose"]); + } else { + rightDelim = delimiter.leftRightDelim( + group.value.right, innerHeight, innerDepth, options, + group.mode, ["mclose"]); + } + // Add it to the end of the expression. + inner.push(rightDelim); + + return makeSpan( + ["minner", style.cls()], inner, options); +}; + +groupTypes.middle = function(group, options) { + var middleDelim; + if (group.value.value === ".") { + middleDelim = makeNullDelimiter(options, []); + } else { + middleDelim = delimiter.sizedDelim( + group.value.value, 1, options, + group.mode, []); + middleDelim.isMiddle = {value: group.value.value, options: options}; + } + return middleDelim; +}; + +groupTypes.rule = function(group, options) { + // Make an empty span for the rule + var rule = makeSpan(["mord", "rule"], [], options); + var style = options.style; + + // Calculate the shift, width, and height of the rule, and account for units + var shift = 0; + if (group.value.shift) { + shift = calculateSize(group.value.shift, style); + } + + var width = calculateSize(group.value.width, style); + var height = calculateSize(group.value.height, style); + + // The sizes of rules are absolute, so make it larger if we are in a + // smaller style. + shift /= style.sizeMultiplier; + width /= style.sizeMultiplier; + height /= style.sizeMultiplier; + + // Style the rule to the right size + rule.style.borderRightWidth = width + "em"; + rule.style.borderTopWidth = height + "em"; + rule.style.bottom = shift + "em"; + + // Record the height and width + rule.width = width; + rule.height = height + shift; + rule.depth = -shift; + + return rule; +}; + +groupTypes.kern = function(group, options) { + // Make an empty span for the rule + var rule = makeSpan(["mord", "rule"], [], options); + var style = options.style; + + var dimension = 0; + if (group.value.dimension) { + dimension = calculateSize(group.value.dimension, style); + } + + dimension /= style.sizeMultiplier; + + rule.style.marginLeft = dimension + "em"; + + return rule; +}; + +groupTypes.accent = function(group, options) { + // Accents are handled in the TeXbook pg. 443, rule 12. + var base = group.value.base; + var style = options.style; + + var supsubGroup; + if (group.type === "supsub") { + // If our base is a character box, and we have superscripts and + // subscripts, the supsub will defer to us. In particular, we want + // to attach the superscripts and subscripts to the inner body (so + // that the position of the superscripts and subscripts won't be + // affected by the height of the accent). We accomplish this by + // sticking the base of the accent into the base of the supsub, and + // rendering that, while keeping track of where the accent is. + + // The supsub group is the group that was passed in + var supsub = group; + // The real accent group is the base of the supsub group + group = supsub.value.base; + // The character box is the base of the accent group + base = group.value.base; + // Stick the character box into the base of the supsub group + supsub.value.base = base; + + // Rerender the supsub group with its new base, and store that + // result. + supsubGroup = buildGroup( + supsub, options.reset()); + } + + // Build the base group + var body = buildGroup( + base, options.withStyle(style.cramp())); + + // Calculate the skew of the accent. This is based on the line "If the + // nucleus is not a single character, let s = 0; otherwise set s to the + // kern amount for the nucleus followed by the \skewchar of its font." + // Note that our skew metrics are just the kern between each character + // and the skewchar. + var skew; + if (isCharacterBox(base)) { + // If the base is a character box, then we want the skew of the + // innermost character. To do that, we find the innermost character: + var baseChar = getBaseElem(base); + // Then, we render its group to get the symbol inside it + var baseGroup = buildGroup( + baseChar, options.withStyle(style.cramp())); + // Finally, we pull the skew off of the symbol. + skew = baseGroup.skew; + // Note that we now throw away baseGroup, because the layers we + // removed with getBaseElem might contain things like \color which + // we can't get rid of. + // TODO(emily): Find a better way to get the skew + } else { + skew = 0; + } + + // calculate the amount of space between the body and the accent + var clearance = Math.min( + body.height, + style.metrics.xHeight); + + // Build the accent + var accent = buildCommon.makeSymbol( + group.value.accent, "Main-Regular", "math", options); + // Remove the italic correction of the accent, because it only serves to + // shift the accent over to a place we don't want. + accent.italic = 0; + + // The \vec character that the fonts use is a combining character, and + // thus shows up much too far to the left. To account for this, we add a + // specific class which shifts the accent over to where we want it. + // TODO(emily): Fix this in a better way, like by changing the font + var vecClass = group.value.accent === "\\vec" ? "accent-vec" : null; + + var accentBody = makeSpan(["accent-body", vecClass], [ + makeSpan([], [accent])]); + + accentBody = buildCommon.makeVList([ + {type: "elem", elem: body}, + {type: "kern", size: -clearance}, + {type: "elem", elem: accentBody} + ], "firstBaseline", null, options); + + // Shift the accent over by the skew. Note we shift by twice the skew + // because we are centering the accent, so by adding 2*skew to the left, + // we shift it to the right by 1*skew. + accentBody.children[1].style.marginLeft = 2 * skew + "em"; + + var accentWrap = makeSpan(["mord", "accent"], [accentBody], options); + + if (supsubGroup) { + // Here, we replace the "base" child of the supsub with our newly + // generated accent. + supsubGroup.children[0] = accentWrap; + + // Since we don't rerun the height calculation after replacing the + // accent, we manually recalculate height. + supsubGroup.height = Math.max(accentWrap.height, supsubGroup.height); + + // Accents should always be ords, even when their innards are not. + supsubGroup.classes[0] = "mord"; + + return supsubGroup; + } else { + return accentWrap; + } +}; + +groupTypes.phantom = function(group, options) { + var elements = buildExpression( + group.value.value, + options.withPhantom(), + false + ); + + // \phantom isn't supposed to affect the elements it contains. + // See "color" for more details. + return new buildCommon.makeFragment(elements); +}; + +groupTypes.mclass = function(group, options) { + var elements = buildExpression(group.value.value, options, true); + + return makeSpan([group.value.mclass], elements, options); +}; + +/** + * buildGroup is the function that takes a group and calls the correct groupType + * function for it. It also handles the interaction of size and style changes + * between parents and children. + */ +var buildGroup = function(group, options) { + if (!group) { + return makeSpan(); + } + + if (groupTypes[group.type]) { + // Call the groupTypes function + var groupNode = groupTypes[group.type](group, options); + var multiplier; + + // If the style changed between the parent and the current group, + // account for the size difference + if (options.style !== options.parentStyle) { + multiplier = options.style.sizeMultiplier / + options.parentStyle.sizeMultiplier; + + groupNode.height *= multiplier; + groupNode.depth *= multiplier; + } + + // If the size changed between the parent and the current group, account + // for that size difference. + if (options.size !== options.parentSize) { + multiplier = buildCommon.sizingMultiplier[options.size] / + buildCommon.sizingMultiplier[options.parentSize]; + + groupNode.height *= multiplier; + groupNode.depth *= multiplier; + } + + return groupNode; + } else { + throw new ParseError( + "Got group of unknown type: '" + group.type + "'"); + } +}; + +/** + * Take an entire parse tree, and build it into an appropriate set of HTML + * nodes. + */ +var buildHTML = function(tree, options) { + // buildExpression is destructive, so we need to make a clone + // of the incoming tree so that it isn't accidentally changed + tree = JSON.parse(JSON.stringify(tree)); + + // Build the expression contained in the tree + var expression = buildExpression(tree, options, true); + var body = makeSpan(["base", options.style.cls()], expression, options); + + // Add struts, which ensure that the top of the HTML element falls at the + // height of the expression, and the bottom of the HTML element falls at the + // depth of the expression. + var topStrut = makeSpan(["strut"]); + var bottomStrut = makeSpan(["strut", "bottom"]); + + topStrut.style.height = body.height + "em"; + bottomStrut.style.height = (body.height + body.depth) + "em"; + // We'd like to use `vertical-align: top` but in IE 9 this lowers the + // baseline of the box to the bottom of this strut (instead staying in the + // normal place) so we use an absolute value for vertical-align instead + bottomStrut.style.verticalAlign = -body.depth + "em"; + + // Wrap the struts and body together + var htmlNode = makeSpan(["katex-html"], [topStrut, bottomStrut, body]); + + htmlNode.setAttribute("aria-hidden", "true"); + + return htmlNode; +}; + +module.exports = buildHTML; + +},{"./ParseError":6,"./Style":9,"./buildCommon":10,"./delimiter":14,"./domTree":15,"./fontMetrics":17,"./utils":25}],12:[function(require,module,exports){ +/** + * This file converts a parse tree into a cooresponding MathML tree. The main + * entry point is the `buildMathML` function, which takes a parse tree from the + * parser. + */ + +var buildCommon = require("./buildCommon"); +var fontMetrics = require("./fontMetrics"); +var mathMLTree = require("./mathMLTree"); +var ParseError = require("./ParseError"); +var symbols = require("./symbols"); +var utils = require("./utils"); + +var makeSpan = buildCommon.makeSpan; +var fontMap = buildCommon.fontMap; + +/** + * Takes a symbol and converts it into a MathML text node after performing + * optional replacement from symbols.js. + */ +var makeText = function(text, mode) { + if (symbols[mode][text] && symbols[mode][text].replace) { + text = symbols[mode][text].replace; + } + + return new mathMLTree.TextNode(text); +}; + +/** + * Returns the math variant as a string or null if none is required. + */ +var getVariant = function(group, options) { + var font = options.font; + if (!font) { + return null; + } + + var mode = group.mode; + if (font === "mathit") { + return "italic"; + } + + var value = group.value; + if (utils.contains(["\\imath", "\\jmath"], value)) { + return null; + } + + if (symbols[mode][value] && symbols[mode][value].replace) { + value = symbols[mode][value].replace; + } + + var fontName = fontMap[font].fontName; + if (fontMetrics.getCharacterMetrics(value, fontName)) { + return fontMap[options.font].variant; + } + + return null; +}; + +/** + * Functions for handling the different types of groups found in the parse + * tree. Each function should take a parse group and return a MathML node. + */ +var groupTypes = {}; + +groupTypes.mathord = function(group, options) { + var node = new mathMLTree.MathNode( + "mi", + [makeText(group.value, group.mode)]); + + var variant = getVariant(group, options); + if (variant) { + node.setAttribute("mathvariant", variant); + } + return node; +}; + +groupTypes.textord = function(group, options) { + var text = makeText(group.value, group.mode); + + var variant = getVariant(group, options) || "normal"; + + var node; + if (/[0-9]/.test(group.value)) { + // TODO(kevinb) merge adjacent nodes + // do it as a post processing step + node = new mathMLTree.MathNode("mn", [text]); + if (options.font) { + node.setAttribute("mathvariant", variant); + } + } else { + node = new mathMLTree.MathNode("mi", [text]); + node.setAttribute("mathvariant", variant); + } + + return node; +}; + +groupTypes.bin = function(group) { + var node = new mathMLTree.MathNode( + "mo", [makeText(group.value, group.mode)]); + + return node; +}; + +groupTypes.rel = function(group) { + var node = new mathMLTree.MathNode( + "mo", [makeText(group.value, group.mode)]); + + return node; +}; + +groupTypes.open = function(group) { + var node = new mathMLTree.MathNode( + "mo", [makeText(group.value, group.mode)]); + + return node; +}; + +groupTypes.close = function(group) { + var node = new mathMLTree.MathNode( + "mo", [makeText(group.value, group.mode)]); + + return node; +}; + +groupTypes.inner = function(group) { + var node = new mathMLTree.MathNode( + "mo", [makeText(group.value, group.mode)]); + + return node; +}; + +groupTypes.punct = function(group) { + var node = new mathMLTree.MathNode( + "mo", [makeText(group.value, group.mode)]); + + node.setAttribute("separator", "true"); + + return node; +}; + +groupTypes.ordgroup = function(group, options) { + var inner = buildExpression(group.value, options); + + var node = new mathMLTree.MathNode("mrow", inner); + + return node; +}; + +groupTypes.text = function(group, options) { + var inner = buildExpression(group.value.body, options); + + var node = new mathMLTree.MathNode("mtext", inner); + + return node; +}; + +groupTypes.color = function(group, options) { + var inner = buildExpression(group.value.value, options); + + var node = new mathMLTree.MathNode("mstyle", inner); + + node.setAttribute("mathcolor", group.value.color); + + return node; +}; + +groupTypes.supsub = function(group, options) { + var children = [buildGroup(group.value.base, options)]; + + if (group.value.sub) { + children.push(buildGroup(group.value.sub, options)); + } + + if (group.value.sup) { + children.push(buildGroup(group.value.sup, options)); + } + + var nodeType; + if (!group.value.sub) { + nodeType = "msup"; + } else if (!group.value.sup) { + nodeType = "msub"; + } else { + nodeType = "msubsup"; + } + + var node = new mathMLTree.MathNode(nodeType, children); + + return node; +}; + +groupTypes.genfrac = function(group, options) { + var node = new mathMLTree.MathNode( + "mfrac", + [buildGroup(group.value.numer, options), + buildGroup(group.value.denom, options)]); + + if (!group.value.hasBarLine) { + node.setAttribute("linethickness", "0px"); + } + + if (group.value.leftDelim != null || group.value.rightDelim != null) { + var withDelims = []; + + if (group.value.leftDelim != null) { + var leftOp = new mathMLTree.MathNode( + "mo", [new mathMLTree.TextNode(group.value.leftDelim)]); + + leftOp.setAttribute("fence", "true"); + + withDelims.push(leftOp); + } + + withDelims.push(node); + + if (group.value.rightDelim != null) { + var rightOp = new mathMLTree.MathNode( + "mo", [new mathMLTree.TextNode(group.value.rightDelim)]); + + rightOp.setAttribute("fence", "true"); + + withDelims.push(rightOp); + } + + var outerNode = new mathMLTree.MathNode("mrow", withDelims); + + return outerNode; + } + + return node; +}; + +groupTypes.array = function(group, options) { + return new mathMLTree.MathNode( + "mtable", group.value.body.map(function(row) { + return new mathMLTree.MathNode( + "mtr", row.map(function(cell) { + return new mathMLTree.MathNode( + "mtd", [buildGroup(cell, options)]); + })); + })); +}; + +groupTypes.sqrt = function(group, options) { + var node; + if (group.value.index) { + node = new mathMLTree.MathNode( + "mroot", [ + buildGroup(group.value.body, options), + buildGroup(group.value.index, options) + ]); + } else { + node = new mathMLTree.MathNode( + "msqrt", [buildGroup(group.value.body, options)]); + } + + return node; +}; + +groupTypes.leftright = function(group, options) { + var inner = buildExpression(group.value.body, options); + + if (group.value.left !== ".") { + var leftNode = new mathMLTree.MathNode( + "mo", [makeText(group.value.left, group.mode)]); + + leftNode.setAttribute("fence", "true"); + + inner.unshift(leftNode); + } + + if (group.value.right !== ".") { + var rightNode = new mathMLTree.MathNode( + "mo", [makeText(group.value.right, group.mode)]); + + rightNode.setAttribute("fence", "true"); + + inner.push(rightNode); + } + + var outerNode = new mathMLTree.MathNode("mrow", inner); + + return outerNode; +}; + +groupTypes.middle = function(group, options) { + var middleNode = new mathMLTree.MathNode( + "mo", [makeText(group.value.middle, group.mode)]); + middleNode.setAttribute("fence", "true"); + return middleNode; +}; + +groupTypes.accent = function(group, options) { + var accentNode = new mathMLTree.MathNode( + "mo", [makeText(group.value.accent, group.mode)]); + + var node = new mathMLTree.MathNode( + "mover", + [buildGroup(group.value.base, options), + accentNode]); + + node.setAttribute("accent", "true"); + + return node; +}; + +groupTypes.spacing = function(group) { + var node; + + if (group.value === "\\ " || group.value === "\\space" || + group.value === " " || group.value === "~") { + node = new mathMLTree.MathNode( + "mtext", [new mathMLTree.TextNode("\u00a0")]); + } else { + node = new mathMLTree.MathNode("mspace"); + + node.setAttribute( + "width", buildCommon.spacingFunctions[group.value].size); + } + + return node; +}; + +groupTypes.op = function(group, options) { + var node; + + // TODO(emily): handle big operators using the `largeop` attribute + + if (group.value.symbol) { + // This is a symbol. Just add the symbol. + node = new mathMLTree.MathNode( + "mo", [makeText(group.value.body, group.mode)]); + } else if (group.value.value) { + // This is an operator with children. Add them. + node = new mathMLTree.MathNode( + "mo", buildExpression(group.value.value, options)); + } else { + // This is a text operator. Add all of the characters from the + // operator's name. + // TODO(emily): Add a space in the middle of some of these + // operators, like \limsup. + node = new mathMLTree.MathNode( + "mi", [new mathMLTree.TextNode(group.value.body.slice(1))]); + } + + return node; +}; + +groupTypes.mod = function(group, options) { + var inner = []; + + if (group.value.modType === "pod" || group.value.modType === "pmod") { + inner.push(new mathMLTree.MathNode( + "mo", [makeText("(", group.mode)])); + } + if (group.value.modType !== "pod") { + inner.push(new mathMLTree.MathNode( + "mo", [makeText("mod", group.mode)])); + } + if (group.value.value) { + var space = new mathMLTree.MathNode("mspace"); + space.setAttribute("width", "0.333333em"); + inner.push(space); + inner = inner.concat(buildExpression(group.value.value, options)); + } + if (group.value.modType === "pod" || group.value.modType === "pmod") { + inner.push(new mathMLTree.MathNode( + "mo", [makeText(")", group.mode)])); + } + + return new mathMLTree.MathNode("mo", inner); +}; + +groupTypes.katex = function(group) { + var node = new mathMLTree.MathNode( + "mtext", [new mathMLTree.TextNode("KaTeX")]); + + return node; +}; + +groupTypes.font = function(group, options) { + var font = group.value.font; + return buildGroup(group.value.body, options.withFont(font)); +}; + +groupTypes.delimsizing = function(group) { + var children = []; + + if (group.value.value !== ".") { + children.push(makeText(group.value.value, group.mode)); + } + + var node = new mathMLTree.MathNode("mo", children); + + if (group.value.mclass === "mopen" || + group.value.mclass === "mclose") { + // Only some of the delimsizing functions act as fences, and they + // return "mopen" or "mclose" mclass. + node.setAttribute("fence", "true"); + } else { + // Explicitly disable fencing if it's not a fence, to override the + // defaults. + node.setAttribute("fence", "false"); + } + + return node; +}; + +groupTypes.styling = function(group, options) { + var inner = buildExpression(group.value.value, options); + + var node = new mathMLTree.MathNode("mstyle", inner); + + var styleAttributes = { + "display": ["0", "true"], + "text": ["0", "false"], + "script": ["1", "false"], + "scriptscript": ["2", "false"] + }; + + var attr = styleAttributes[group.value.style]; + + node.setAttribute("scriptlevel", attr[0]); + node.setAttribute("displaystyle", attr[1]); + + return node; +}; + +groupTypes.sizing = function(group, options) { + var inner = buildExpression(group.value.value, options); + + var node = new mathMLTree.MathNode("mstyle", inner); + + // TODO(emily): This doesn't produce the correct size for nested size + // changes, because we don't keep state of what style we're currently + // in, so we can't reset the size to normal before changing it. Now + // that we're passing an options parameter we should be able to fix + // this. + node.setAttribute( + "mathsize", buildCommon.sizingMultiplier[group.value.size] + "em"); + + return node; +}; + +groupTypes.overline = function(group, options) { + var operator = new mathMLTree.MathNode( + "mo", [new mathMLTree.TextNode("\u203e")]); + operator.setAttribute("stretchy", "true"); + + var node = new mathMLTree.MathNode( + "mover", + [buildGroup(group.value.body, options), + operator]); + node.setAttribute("accent", "true"); + + return node; +}; + +groupTypes.underline = function(group, options) { + var operator = new mathMLTree.MathNode( + "mo", [new mathMLTree.TextNode("\u203e")]); + operator.setAttribute("stretchy", "true"); + + var node = new mathMLTree.MathNode( + "munder", + [buildGroup(group.value.body, options), + operator]); + node.setAttribute("accentunder", "true"); + + return node; +}; + +groupTypes.rule = function(group) { + // TODO(emily): Figure out if there's an actual way to draw black boxes + // in MathML. + var node = new mathMLTree.MathNode("mrow"); + + return node; +}; + +groupTypes.kern = function(group) { + // TODO(kevin): Figure out if there's a way to add space in MathML + var node = new mathMLTree.MathNode("mrow"); + + return node; +}; + +groupTypes.llap = function(group, options) { + var node = new mathMLTree.MathNode( + "mpadded", [buildGroup(group.value.body, options)]); + + node.setAttribute("lspace", "-1width"); + node.setAttribute("width", "0px"); + + return node; +}; + +groupTypes.rlap = function(group, options) { + var node = new mathMLTree.MathNode( + "mpadded", [buildGroup(group.value.body, options)]); + + node.setAttribute("width", "0px"); + + return node; +}; + +groupTypes.phantom = function(group, options) { + var inner = buildExpression(group.value.value, options); + return new mathMLTree.MathNode("mphantom", inner); +}; + +groupTypes.mclass = function(group, options) { + var inner = buildExpression(group.value.value, options); + return new mathMLTree.MathNode("mstyle", inner); +}; + +/** + * Takes a list of nodes, builds them, and returns a list of the generated + * MathML nodes. A little simpler than the HTML version because we don't do any + * previous-node handling. + */ +var buildExpression = function(expression, options) { + var groups = []; + for (var i = 0; i < expression.length; i++) { + var group = expression[i]; + groups.push(buildGroup(group, options)); + } + return groups; +}; + +/** + * Takes a group from the parser and calls the appropriate groupTypes function + * on it to produce a MathML node. + */ +var buildGroup = function(group, options) { + if (!group) { + return new mathMLTree.MathNode("mrow"); + } + + if (groupTypes[group.type]) { + // Call the groupTypes function + return groupTypes[group.type](group, options); + } else { + throw new ParseError( + "Got group of unknown type: '" + group.type + "'"); + } +}; + +/** + * Takes a full parse tree and settings and builds a MathML representation of + * it. In particular, we put the elements from building the parse tree into a + * tag so we can also include that TeX source as an annotation. + * + * Note that we actually return a domTree element with a `` inside it so + * we can do appropriate styling. + */ +var buildMathML = function(tree, texExpression, options) { + var expression = buildExpression(tree, options); + + // Wrap up the expression in an mrow so it is presented in the semantics + // tag correctly. + var wrapper = new mathMLTree.MathNode("mrow", expression); + + // Build a TeX annotation of the source + var annotation = new mathMLTree.MathNode( + "annotation", [new mathMLTree.TextNode(texExpression)]); + + annotation.setAttribute("encoding", "application/x-tex"); + + var semantics = new mathMLTree.MathNode( + "semantics", [wrapper, annotation]); + + var math = new mathMLTree.MathNode("math", [semantics]); + + // You can't style nodes, so we wrap the node in a span. + return makeSpan(["katex-mathml"], [math]); +}; + +module.exports = buildMathML; + +},{"./ParseError":6,"./buildCommon":10,"./fontMetrics":17,"./mathMLTree":20,"./symbols":23,"./utils":25}],13:[function(require,module,exports){ +var buildHTML = require("./buildHTML"); +var buildMathML = require("./buildMathML"); +var buildCommon = require("./buildCommon"); +var Options = require("./Options"); +var Settings = require("./Settings"); +var Style = require("./Style"); + +var makeSpan = buildCommon.makeSpan; + +var buildTree = function(tree, expression, settings) { + settings = settings || new Settings({}); + + var startStyle = Style.TEXT; + if (settings.displayMode) { + startStyle = Style.DISPLAY; + } + + // Setup the default options + var options = new Options({ + style: startStyle, + size: "size5" + }); + + // `buildHTML` sometimes messes with the parse tree (like turning bins -> + // ords), so we build the MathML version first. + var mathMLNode = buildMathML(tree, expression, options); + var htmlNode = buildHTML(tree, options); + + var katexNode = makeSpan(["katex"], [ + mathMLNode, htmlNode + ]); + + if (settings.displayMode) { + return makeSpan(["katex-display"], [katexNode]); + } else { + return katexNode; + } +}; + +module.exports = buildTree; + +},{"./Options":5,"./Settings":8,"./Style":9,"./buildCommon":10,"./buildHTML":11,"./buildMathML":12}],14:[function(require,module,exports){ +/** + * This file deals with creating delimiters of various sizes. The TeXbook + * discusses these routines on page 441-442, in the "Another subroutine sets box + * x to a specified variable delimiter" paragraph. + * + * There are three main routines here. `makeSmallDelim` makes a delimiter in the + * normal font, but in either text, script, or scriptscript style. + * `makeLargeDelim` makes a delimiter in textstyle, but in one of the Size1, + * Size2, Size3, or Size4 fonts. `makeStackedDelim` makes a delimiter out of + * smaller pieces that are stacked on top of one another. + * + * The functions take a parameter `center`, which determines if the delimiter + * should be centered around the axis. + * + * Then, there are three exposed functions. `sizedDelim` makes a delimiter in + * one of the given sizes. This is used for things like `\bigl`. + * `customSizedDelim` makes a delimiter with a given total height+depth. It is + * called in places like `\sqrt`. `leftRightDelim` makes an appropriate + * delimiter which surrounds an expression of a given height an depth. It is + * used in `\left` and `\right`. + */ + +var ParseError = require("./ParseError"); +var Style = require("./Style"); + +var buildCommon = require("./buildCommon"); +var fontMetrics = require("./fontMetrics"); +var symbols = require("./symbols"); +var utils = require("./utils"); + +var makeSpan = buildCommon.makeSpan; + +/** + * Get the metrics for a given symbol and font, after transformation (i.e. + * after following replacement from symbols.js) + */ +var getMetrics = function(symbol, font) { + if (symbols.math[symbol] && symbols.math[symbol].replace) { + return fontMetrics.getCharacterMetrics( + symbols.math[symbol].replace, font); + } else { + return fontMetrics.getCharacterMetrics( + symbol, font); + } +}; + +/** + * Builds a symbol in the given font size (note size is an integer) + */ +var mathrmSize = function(value, size, mode, options) { + return buildCommon.makeSymbol(value, "Size" + size + "-Regular", + mode, options); +}; + +/** + * Puts a delimiter span in a given style, and adds appropriate height, depth, + * and maxFontSizes. + */ +var styleWrap = function(delim, toStyle, options, classes) { + classes = classes || []; + var span = makeSpan( + classes.concat(["style-wrap", options.style.reset(), toStyle.cls()]), + [delim], options); + + var multiplier = toStyle.sizeMultiplier / options.style.sizeMultiplier; + + span.height *= multiplier; + span.depth *= multiplier; + span.maxFontSize = toStyle.sizeMultiplier; + + return span; +}; + +/** + * Makes a small delimiter. This is a delimiter that comes in the Main-Regular + * font, but is restyled to either be in textstyle, scriptstyle, or + * scriptscriptstyle. + */ +var makeSmallDelim = function(delim, style, center, options, mode, classes) { + var text = buildCommon.makeSymbol(delim, "Main-Regular", mode, options); + + var span = styleWrap(text, style, options, classes); + + if (center) { + var shift = + (1 - options.style.sizeMultiplier / style.sizeMultiplier) * + options.style.metrics.axisHeight; + + span.style.top = shift + "em"; + span.height -= shift; + span.depth += shift; + } + + return span; +}; + +/** + * Makes a large delimiter. This is a delimiter that comes in the Size1, Size2, + * Size3, or Size4 fonts. It is always rendered in textstyle. + */ +var makeLargeDelim = function(delim, size, center, options, mode, classes) { + var inner = mathrmSize(delim, size, mode, options); + + var span = styleWrap( + makeSpan(["delimsizing", "size" + size], [inner], options), + Style.TEXT, options, classes); + + if (center) { + var shift = (1 - options.style.sizeMultiplier) * + options.style.metrics.axisHeight; + + span.style.top = shift + "em"; + span.height -= shift; + span.depth += shift; + } + + return span; +}; + +/** + * Make an inner span with the given offset and in the given font. This is used + * in `makeStackedDelim` to make the stacking pieces for the delimiter. + */ +var makeInner = function(symbol, font, mode) { + var sizeClass; + // Apply the correct CSS class to choose the right font. + if (font === "Size1-Regular") { + sizeClass = "delim-size1"; + } else if (font === "Size4-Regular") { + sizeClass = "delim-size4"; + } + + var inner = makeSpan( + ["delimsizinginner", sizeClass], + [makeSpan([], [buildCommon.makeSymbol(symbol, font, mode)])]); + + // Since this will be passed into `makeVList` in the end, wrap the element + // in the appropriate tag that VList uses. + return {type: "elem", elem: inner}; +}; + +/** + * Make a stacked delimiter out of a given delimiter, with the total height at + * least `heightTotal`. This routine is mentioned on page 442 of the TeXbook. + */ +var makeStackedDelim = function(delim, heightTotal, center, options, mode, + classes) { + // There are four parts, the top, an optional middle, a repeated part, and a + // bottom. + var top; + var middle; + var repeat; + var bottom; + top = repeat = bottom = delim; + middle = null; + // Also keep track of what font the delimiters are in + var font = "Size1-Regular"; + + // We set the parts and font based on the symbol. Note that we use + // '\u23d0' instead of '|' and '\u2016' instead of '\\|' for the + // repeats of the arrows + if (delim === "\\uparrow") { + repeat = bottom = "\u23d0"; + } else if (delim === "\\Uparrow") { + repeat = bottom = "\u2016"; + } else if (delim === "\\downarrow") { + top = repeat = "\u23d0"; + } else if (delim === "\\Downarrow") { + top = repeat = "\u2016"; + } else if (delim === "\\updownarrow") { + top = "\\uparrow"; + repeat = "\u23d0"; + bottom = "\\downarrow"; + } else if (delim === "\\Updownarrow") { + top = "\\Uparrow"; + repeat = "\u2016"; + bottom = "\\Downarrow"; + } else if (delim === "[" || delim === "\\lbrack") { + top = "\u23a1"; + repeat = "\u23a2"; + bottom = "\u23a3"; + font = "Size4-Regular"; + } else if (delim === "]" || delim === "\\rbrack") { + top = "\u23a4"; + repeat = "\u23a5"; + bottom = "\u23a6"; + font = "Size4-Regular"; + } else if (delim === "\\lfloor") { + repeat = top = "\u23a2"; + bottom = "\u23a3"; + font = "Size4-Regular"; + } else if (delim === "\\lceil") { + top = "\u23a1"; + repeat = bottom = "\u23a2"; + font = "Size4-Regular"; + } else if (delim === "\\rfloor") { + repeat = top = "\u23a5"; + bottom = "\u23a6"; + font = "Size4-Regular"; + } else if (delim === "\\rceil") { + top = "\u23a4"; + repeat = bottom = "\u23a5"; + font = "Size4-Regular"; + } else if (delim === "(") { + top = "\u239b"; + repeat = "\u239c"; + bottom = "\u239d"; + font = "Size4-Regular"; + } else if (delim === ")") { + top = "\u239e"; + repeat = "\u239f"; + bottom = "\u23a0"; + font = "Size4-Regular"; + } else if (delim === "\\{" || delim === "\\lbrace") { + top = "\u23a7"; + middle = "\u23a8"; + bottom = "\u23a9"; + repeat = "\u23aa"; + font = "Size4-Regular"; + } else if (delim === "\\}" || delim === "\\rbrace") { + top = "\u23ab"; + middle = "\u23ac"; + bottom = "\u23ad"; + repeat = "\u23aa"; + font = "Size4-Regular"; + } else if (delim === "\\lgroup") { + top = "\u23a7"; + bottom = "\u23a9"; + repeat = "\u23aa"; + font = "Size4-Regular"; + } else if (delim === "\\rgroup") { + top = "\u23ab"; + bottom = "\u23ad"; + repeat = "\u23aa"; + font = "Size4-Regular"; + } else if (delim === "\\lmoustache") { + top = "\u23a7"; + bottom = "\u23ad"; + repeat = "\u23aa"; + font = "Size4-Regular"; + } else if (delim === "\\rmoustache") { + top = "\u23ab"; + bottom = "\u23a9"; + repeat = "\u23aa"; + font = "Size4-Regular"; + } else if (delim === "\\surd") { + top = "\ue001"; + bottom = "\u23b7"; + repeat = "\ue000"; + font = "Size4-Regular"; + } + + // Get the metrics of the four sections + var topMetrics = getMetrics(top, font); + var topHeightTotal = topMetrics.height + topMetrics.depth; + var repeatMetrics = getMetrics(repeat, font); + var repeatHeightTotal = repeatMetrics.height + repeatMetrics.depth; + var bottomMetrics = getMetrics(bottom, font); + var bottomHeightTotal = bottomMetrics.height + bottomMetrics.depth; + var middleHeightTotal = 0; + var middleFactor = 1; + if (middle !== null) { + var middleMetrics = getMetrics(middle, font); + middleHeightTotal = middleMetrics.height + middleMetrics.depth; + middleFactor = 2; // repeat symmetrically above and below middle + } + + // Calcuate the minimal height that the delimiter can have. + // It is at least the size of the top, bottom, and optional middle combined. + var minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal; + + // Compute the number of copies of the repeat symbol we will need + var repeatCount = Math.ceil( + (heightTotal - minHeight) / (middleFactor * repeatHeightTotal)); + + // Compute the total height of the delimiter including all the symbols + var realHeightTotal = + minHeight + repeatCount * middleFactor * repeatHeightTotal; + + // The center of the delimiter is placed at the center of the axis. Note + // that in this context, "center" means that the delimiter should be + // centered around the axis in the current style, while normally it is + // centered around the axis in textstyle. + var axisHeight = options.style.metrics.axisHeight; + if (center) { + axisHeight *= options.style.sizeMultiplier; + } + // Calculate the depth + var depth = realHeightTotal / 2 - axisHeight; + + // Now, we start building the pieces that will go into the vlist + + // Keep a list of the inner pieces + var inners = []; + + // Add the bottom symbol + inners.push(makeInner(bottom, font, mode)); + + var i; + if (middle === null) { + // Add that many symbols + for (i = 0; i < repeatCount; i++) { + inners.push(makeInner(repeat, font, mode)); + } + } else { + // When there is a middle bit, we need the middle part and two repeated + // sections + for (i = 0; i < repeatCount; i++) { + inners.push(makeInner(repeat, font, mode)); + } + inners.push(makeInner(middle, font, mode)); + for (i = 0; i < repeatCount; i++) { + inners.push(makeInner(repeat, font, mode)); + } + } + + // Add the top symbol + inners.push(makeInner(top, font, mode)); + + // Finally, build the vlist + var inner = buildCommon.makeVList(inners, "bottom", depth, options); + + return styleWrap( + makeSpan(["delimsizing", "mult"], [inner], options), + Style.TEXT, options, classes); +}; + +// There are three kinds of delimiters, delimiters that stack when they become +// too large +var stackLargeDelimiters = [ + "(", ")", "[", "\\lbrack", "]", "\\rbrack", + "\\{", "\\lbrace", "\\}", "\\rbrace", + "\\lfloor", "\\rfloor", "\\lceil", "\\rceil", + "\\surd" +]; + +// delimiters that always stack +var stackAlwaysDelimiters = [ + "\\uparrow", "\\downarrow", "\\updownarrow", + "\\Uparrow", "\\Downarrow", "\\Updownarrow", + "|", "\\|", "\\vert", "\\Vert", + "\\lvert", "\\rvert", "\\lVert", "\\rVert", + "\\lgroup", "\\rgroup", "\\lmoustache", "\\rmoustache" +]; + +// and delimiters that never stack +var stackNeverDelimiters = [ + "<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt" +]; + +// Metrics of the different sizes. Found by looking at TeX's output of +// $\bigl| // \Bigl| \biggl| \Biggl| \showlists$ +// Used to create stacked delimiters of appropriate sizes in makeSizedDelim. +var sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3.0]; + +/** + * Used to create a delimiter of a specific size, where `size` is 1, 2, 3, or 4. + */ +var makeSizedDelim = function(delim, size, options, mode, classes) { + // < and > turn into \langle and \rangle in delimiters + if (delim === "<" || delim === "\\lt") { + delim = "\\langle"; + } else if (delim === ">" || delim === "\\gt") { + delim = "\\rangle"; + } + + // Sized delimiters are never centered. + if (utils.contains(stackLargeDelimiters, delim) || + utils.contains(stackNeverDelimiters, delim)) { + return makeLargeDelim(delim, size, false, options, mode, classes); + } else if (utils.contains(stackAlwaysDelimiters, delim)) { + return makeStackedDelim( + delim, sizeToMaxHeight[size], false, options, mode, classes); + } else { + throw new ParseError("Illegal delimiter: '" + delim + "'"); + } +}; + +/** + * There are three different sequences of delimiter sizes that the delimiters + * follow depending on the kind of delimiter. This is used when creating custom + * sized delimiters to decide whether to create a small, large, or stacked + * delimiter. + * + * In real TeX, these sequences aren't explicitly defined, but are instead + * defined inside the font metrics. Since there are only three sequences that + * are possible for the delimiters that TeX defines, it is easier to just encode + * them explicitly here. + */ + +// Delimiters that never stack try small delimiters and large delimiters only +var stackNeverDelimiterSequence = [ + {type: "small", style: Style.SCRIPTSCRIPT}, + {type: "small", style: Style.SCRIPT}, + {type: "small", style: Style.TEXT}, + {type: "large", size: 1}, + {type: "large", size: 2}, + {type: "large", size: 3}, + {type: "large", size: 4} +]; + +// Delimiters that always stack try the small delimiters first, then stack +var stackAlwaysDelimiterSequence = [ + {type: "small", style: Style.SCRIPTSCRIPT}, + {type: "small", style: Style.SCRIPT}, + {type: "small", style: Style.TEXT}, + {type: "stack"} +]; + +// Delimiters that stack when large try the small and then large delimiters, and +// stack afterwards +var stackLargeDelimiterSequence = [ + {type: "small", style: Style.SCRIPTSCRIPT}, + {type: "small", style: Style.SCRIPT}, + {type: "small", style: Style.TEXT}, + {type: "large", size: 1}, + {type: "large", size: 2}, + {type: "large", size: 3}, + {type: "large", size: 4}, + {type: "stack"} +]; + +/** + * Get the font used in a delimiter based on what kind of delimiter it is. + */ +var delimTypeToFont = function(type) { + if (type.type === "small") { + return "Main-Regular"; + } else if (type.type === "large") { + return "Size" + type.size + "-Regular"; + } else if (type.type === "stack") { + return "Size4-Regular"; + } +}; + +/** + * Traverse a sequence of types of delimiters to decide what kind of delimiter + * should be used to create a delimiter of the given height+depth. + */ +var traverseSequence = function(delim, height, sequence, options) { + // Here, we choose the index we should start at in the sequences. In smaller + // sizes (which correspond to larger numbers in style.size) we start earlier + // in the sequence. Thus, scriptscript starts at index 3-3=0, script starts + // at index 3-2=1, text starts at 3-1=2, and display starts at min(2,3-0)=2 + var start = Math.min(2, 3 - options.style.size); + for (var i = start; i < sequence.length; i++) { + if (sequence[i].type === "stack") { + // This is always the last delimiter, so we just break the loop now. + break; + } + + var metrics = getMetrics(delim, delimTypeToFont(sequence[i])); + var heightDepth = metrics.height + metrics.depth; + + // Small delimiters are scaled down versions of the same font, so we + // account for the style change size. + + if (sequence[i].type === "small") { + heightDepth *= sequence[i].style.sizeMultiplier; + } + + // Check if the delimiter at this size works for the given height. + if (heightDepth > height) { + return sequence[i]; + } + } + + // If we reached the end of the sequence, return the last sequence element. + return sequence[sequence.length - 1]; +}; + +/** + * Make a delimiter of a given height+depth, with optional centering. Here, we + * traverse the sequences, and create a delimiter that the sequence tells us to. + */ +var makeCustomSizedDelim = function(delim, height, center, options, mode, + classes) { + if (delim === "<" || delim === "\\lt") { + delim = "\\langle"; + } else if (delim === ">" || delim === "\\gt") { + delim = "\\rangle"; + } + + // Decide what sequence to use + var sequence; + if (utils.contains(stackNeverDelimiters, delim)) { + sequence = stackNeverDelimiterSequence; + } else if (utils.contains(stackLargeDelimiters, delim)) { + sequence = stackLargeDelimiterSequence; + } else { + sequence = stackAlwaysDelimiterSequence; + } + + // Look through the sequence + var delimType = traverseSequence(delim, height, sequence, options); + + // Depending on the sequence element we decided on, call the appropriate + // function. + if (delimType.type === "small") { + return makeSmallDelim(delim, delimType.style, center, options, mode, + classes); + } else if (delimType.type === "large") { + return makeLargeDelim(delim, delimType.size, center, options, mode, + classes); + } else if (delimType.type === "stack") { + return makeStackedDelim(delim, height, center, options, mode, classes); + } +}; + +/** + * Make a delimiter for use with `\left` and `\right`, given a height and depth + * of an expression that the delimiters surround. + */ +var makeLeftRightDelim = function(delim, height, depth, options, mode, + classes) { + // We always center \left/\right delimiters, so the axis is always shifted + var axisHeight = + options.style.metrics.axisHeight * options.style.sizeMultiplier; + + // Taken from TeX source, tex.web, function make_left_right + var delimiterFactor = 901; + var delimiterExtend = 5.0 / fontMetrics.metrics.ptPerEm; + + var maxDistFromAxis = Math.max( + height - axisHeight, depth + axisHeight); + + var totalHeight = Math.max( + // In real TeX, calculations are done using integral values which are + // 65536 per pt, or 655360 per em. So, the division here truncates in + // TeX but doesn't here, producing different results. If we wanted to + // exactly match TeX's calculation, we could do + // Math.floor(655360 * maxDistFromAxis / 500) * + // delimiterFactor / 655360 + // (To see the difference, compare + // x^{x^{\left(\rule{0.1em}{0.68em}\right)}} + // in TeX and KaTeX) + maxDistFromAxis / 500 * delimiterFactor, + 2 * maxDistFromAxis - delimiterExtend); + + // Finally, we defer to `makeCustomSizedDelim` with our calculated total + // height + return makeCustomSizedDelim(delim, totalHeight, true, options, mode, + classes); +}; + +module.exports = { + sizedDelim: makeSizedDelim, + customSizedDelim: makeCustomSizedDelim, + leftRightDelim: makeLeftRightDelim +}; + +},{"./ParseError":6,"./Style":9,"./buildCommon":10,"./fontMetrics":17,"./symbols":23,"./utils":25}],15:[function(require,module,exports){ +/** + * These objects store the data about the DOM nodes we create, as well as some + * extra data. They can then be transformed into real DOM nodes with the + * `toNode` function or HTML markup using `toMarkup`. They are useful for both + * storing extra properties on the nodes, as well as providing a way to easily + * work with the DOM. + * + * Similar functions for working with MathML nodes exist in mathMLTree.js. + */ +var unicodeRegexes = require("./unicodeRegexes"); +var utils = require("./utils"); + +/** + * Create an HTML className based on a list of classes. In addition to joining + * with spaces, we also remove null or empty classes. + */ +var createClass = function(classes) { + classes = classes.slice(); + for (var i = classes.length - 1; i >= 0; i--) { + if (!classes[i]) { + classes.splice(i, 1); + } + } + + return classes.join(" "); +}; + +/** + * This node represents a span node, with a className, a list of children, and + * an inline style. It also contains information about its height, depth, and + * maxFontSize. + */ +function span(classes, children, options) { + this.classes = classes || []; + this.children = children || []; + this.height = 0; + this.depth = 0; + this.maxFontSize = 0; + this.style = {}; + this.attributes = {}; + if (options) { + if (options.style.isTight()) { + this.classes.push("mtight"); + } + if (options.getColor()) { + this.style.color = options.getColor(); + } + } +} + +/** + * Sets an arbitrary attribute on the span. Warning: use this wisely. Not all + * browsers support attributes the same, and having too many custom attributes + * is probably bad. + */ +span.prototype.setAttribute = function(attribute, value) { + this.attributes[attribute] = value; +}; + +span.prototype.tryCombine = function(sibling) { + return false; +}; + +/** + * Convert the span into an HTML node + */ +span.prototype.toNode = function() { + var span = document.createElement("span"); + + // Apply the class + span.className = createClass(this.classes); + + // Apply inline styles + for (var style in this.style) { + if (Object.prototype.hasOwnProperty.call(this.style, style)) { + span.style[style] = this.style[style]; + } + } + + // Apply attributes + for (var attr in this.attributes) { + if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { + span.setAttribute(attr, this.attributes[attr]); + } + } + + // Append the children, also as HTML nodes + for (var i = 0; i < this.children.length; i++) { + span.appendChild(this.children[i].toNode()); + } + + return span; +}; + +/** + * Convert the span into an HTML markup string + */ +span.prototype.toMarkup = function() { + var markup = " 0 + || createClass(this.classes) !== createClass(sibling.classes) + || this.skew !== sibling.skew + || this.maxFontSize !== sibling.maxFontSize) { + return false; + } + for (var style in this.style) { + if (this.style.hasOwnProperty(style) + && this.style[style] !== sibling.style[style]) { + return false; + } + } + for (style in sibling.style) { + if (sibling.style.hasOwnProperty(style) + && this.style[style] !== sibling.style[style]) { + return false; + } + } + this.value += sibling.value; + this.height = Math.max(this.height, sibling.height); + this.depth = Math.max(this.depth, sibling.depth); + this.italic = sibling.italic; + return true; +}; + +/** + * Creates a text node or span from a symbol node. Note that a span is only + * created if it is needed. + */ +symbolNode.prototype.toNode = function() { + var node = document.createTextNode(this.value); + var span = null; + + if (this.italic > 0) { + span = document.createElement("span"); + span.style.marginRight = this.italic + "em"; + } + + if (this.classes.length > 0) { + span = span || document.createElement("span"); + span.className = createClass(this.classes); + } + + for (var style in this.style) { + if (this.style.hasOwnProperty(style)) { + span = span || document.createElement("span"); + span.style[style] = this.style[style]; + } + } + + if (span) { + span.appendChild(node); + return span; + } else { + return node; + } +}; + +/** + * Creates markup for a symbol node. + */ +symbolNode.prototype.toMarkup = function() { + // TODO(alpert): More duplication than I'd like from + // span.prototype.toMarkup and symbolNode.prototype.toNode... + var needsSpan = false; + + var markup = " 0) { + styles += "margin-right:" + this.italic + "em;"; + } + for (var style in this.style) { + if (this.style.hasOwnProperty(style)) { + styles += utils.hyphenate(style) + ":" + this.style[style] + ";"; + } + } + + if (styles) { + needsSpan = true; + markup += " style=\"" + utils.escape(styles) + "\""; + } + + var escaped = utils.escape(this.value); + if (needsSpan) { + markup += ">"; + markup += escaped; + markup += ""; + return markup; + } else { + return escaped; + } +}; + +module.exports = { + span: span, + documentFragment: documentFragment, + symbolNode: symbolNode +}; + +},{"./unicodeRegexes":24,"./utils":25}],16:[function(require,module,exports){ +/* eslint no-constant-condition:0 */ +var parseData = require("./parseData"); +var ParseError = require("./ParseError"); +var Style = require("./Style"); + +var ParseNode = parseData.ParseNode; + +/** + * Parse the body of the environment, with rows delimited by \\ and + * columns delimited by &, and create a nested list in row-major order + * with one group per cell. + */ +function parseArray(parser, result) { + var row = []; + var body = [row]; + var rowGaps = []; + while (true) { + var cell = parser.parseExpression(false, null); + row.push(new ParseNode("ordgroup", cell, parser.mode)); + var next = parser.nextToken.text; + if (next === "&") { + parser.consume(); + } else if (next === "\\end") { + break; + } else if (next === "\\\\" || next === "\\cr") { + var cr = parser.parseFunction(); + rowGaps.push(cr.value.size); + row = []; + body.push(row); + } else { + throw new ParseError("Expected & or \\\\ or \\end", + parser.nextToken); + } + } + result.body = body; + result.rowGaps = rowGaps; + return new ParseNode(result.type, result, parser.mode); +} + +/* + * An environment definition is very similar to a function definition: + * it is declared with a name or a list of names, a set of properties + * and a handler containing the actual implementation. + * + * The properties include: + * - numArgs: The number of arguments after the \begin{name} function. + * - argTypes: (optional) Just like for a function + * - allowedInText: (optional) Whether or not the environment is allowed inside + * text mode (default false) (not enforced yet) + * - numOptionalArgs: (optional) Just like for a function + * A bare number instead of that object indicates the numArgs value. + * + * The handler function will receive two arguments + * - context: information and references provided by the parser + * - args: an array of arguments passed to \begin{name} + * The context contains the following properties: + * - envName: the name of the environment, one of the listed names. + * - parser: the parser object + * - lexer: the lexer object + * - positions: the positions associated with these arguments from args. + * The handler must return a ParseResult. + */ + +function defineEnvironment(names, props, handler) { + if (typeof names === "string") { + names = [names]; + } + if (typeof props === "number") { + props = { numArgs: props }; + } + // Set default values of environments + var data = { + numArgs: props.numArgs || 0, + argTypes: props.argTypes, + greediness: 1, + allowedInText: !!props.allowedInText, + numOptionalArgs: props.numOptionalArgs || 0, + handler: handler + }; + for (var i = 0; i < names.length; ++i) { + module.exports[names[i]] = data; + } +} + +// Arrays are part of LaTeX, defined in lttab.dtx so its documentation +// is part of the source2e.pdf file of LaTeX2e source documentation. +defineEnvironment("array", { + numArgs: 1 +}, function(context, args) { + var colalign = args[0]; + colalign = colalign.value.map ? colalign.value : [colalign]; + var cols = colalign.map(function(node) { + var ca = node.value; + if ("lcr".indexOf(ca) !== -1) { + return { + type: "align", + align: ca + }; + } else if (ca === "|") { + return { + type: "separator", + separator: "|" + }; + } + throw new ParseError( + "Unknown column alignment: " + node.value, + node); + }); + var res = { + type: "array", + cols: cols, + hskipBeforeAndAfter: true // \@preamble in lttab.dtx + }; + res = parseArray(context.parser, res); + return res; +}); + +// The matrix environments of amsmath builds on the array environment +// of LaTeX, which is discussed above. +defineEnvironment([ + "matrix", + "pmatrix", + "bmatrix", + "Bmatrix", + "vmatrix", + "Vmatrix" +], { +}, function(context) { + var delimiters = { + "matrix": null, + "pmatrix": ["(", ")"], + "bmatrix": ["[", "]"], + "Bmatrix": ["\\{", "\\}"], + "vmatrix": ["|", "|"], + "Vmatrix": ["\\Vert", "\\Vert"] + }[context.envName]; + var res = { + type: "array", + hskipBeforeAndAfter: false // \hskip -\arraycolsep in amsmath + }; + res = parseArray(context.parser, res); + if (delimiters) { + res = new ParseNode("leftright", { + body: [res], + left: delimiters[0], + right: delimiters[1] + }, context.mode); + } + return res; +}); + +// A cases environment (in amsmath.sty) is almost equivalent to +// \def\arraystretch{1.2}% +// \left\{\begin{array}{@{}l@{\quad}l@{}} … \end{array}\right. +defineEnvironment("cases", { +}, function(context) { + var res = { + type: "array", + arraystretch: 1.2, + cols: [{ + type: "align", + align: "l", + pregap: 0, + // TODO(kevinb) get the current style. + // For now we use the metrics for TEXT style which is what we were + // doing before. Before attempting to get the current style we + // should look at TeX's behavior especially for \over and matrices. + postgap: Style.TEXT.metrics.quad + }, { + type: "align", + align: "l", + pregap: 0, + postgap: 0 + }] + }; + res = parseArray(context.parser, res); + res = new ParseNode("leftright", { + body: [res], + left: "\\{", + right: "." + }, context.mode); + return res; +}); + +// An aligned environment is like the align* environment +// except it operates within math mode. +// Note that we assume \nomallineskiplimit to be zero, +// so that \strut@ is the same as \strut. +defineEnvironment("aligned", { +}, function(context) { + var res = { + type: "array", + cols: [] + }; + res = parseArray(context.parser, res); + var emptyGroup = new ParseNode("ordgroup", [], context.mode); + var numCols = 0; + res.value.body.forEach(function(row) { + var i; + for (i = 1; i < row.length; i += 2) { + row[i].value.unshift(emptyGroup); + } + if (numCols < row.length) { + numCols = row.length; + } + }); + for (var i = 0; i < numCols; ++i) { + var align = "r"; + var pregap = 0; + if (i % 2 === 1) { + align = "l"; + } else if (i > 0) { + pregap = 2; // one \qquad between columns + } + res.value.cols[i] = { + type: "align", + align: align, + pregap: pregap, + postgap: 0 + }; + } + return res; +}); + +},{"./ParseError":6,"./Style":9,"./parseData":21}],17:[function(require,module,exports){ +/* eslint no-unused-vars:0 */ + +var Style = require("./Style"); +var cjkRegex = require("./unicodeRegexes").cjkRegex; + +/** + * This file contains metrics regarding fonts and individual symbols. The sigma + * and xi variables, as well as the metricMap map contain data extracted from + * TeX, TeX font metrics, and the TTF files. These data are then exposed via the + * `metrics` variable and the getCharacterMetrics function. + */ + +// In TeX, there are actually three sets of dimensions, one for each of +// textstyle, scriptstyle, and scriptscriptstyle. These are provided in the +// the arrays below, in that order. +// +// The font metrics are stored in fonts cmsy10, cmsy7, and cmsy5 respsectively. +// This was determined by running the folllowing script: +// +// latex -interaction=nonstopmode \ +// '\documentclass{article}\usepackage{amsmath}\begin{document}' \ +// '$a$ \expandafter\show\the\textfont2' \ +// '\expandafter\show\the\scriptfont2' \ +// '\expandafter\show\the\scriptscriptfont2' \ +// '\stop' +// +// The metrics themselves were retreived using the following commands: +// +// tftopl cmsy10 +// tftopl cmsy7 +// tftopl cmsy5 +// +// The output of each of these commands is quite lengthy. The only part we +// care about is the FONTDIMEN section. Each value is measured in EMs. +var sigmas = { + slant: [0.250, 0.250, 0.250], // sigma1 + space: [0.000, 0.000, 0.000], // sigma2 + stretch: [0.000, 0.000, 0.000], // sigma3 + shrink: [0.000, 0.000, 0.000], // sigma4 + xHeight: [0.431, 0.431, 0.431], // sigma5 + quad: [1.000, 1.171, 1.472], // sigma6 + extraSpace: [0.000, 0.000, 0.000], // sigma7 + num1: [0.677, 0.732, 0.925], // sigma8 + num2: [0.394, 0.384, 0.387], // sigma9 + num3: [0.444, 0.471, 0.504], // sigma10 + denom1: [0.686, 0.752, 1.025], // sigma11 + denom2: [0.345, 0.344, 0.532], // sigma12 + sup1: [0.413, 0.503, 0.504], // sigma13 + sup2: [0.363, 0.431, 0.404], // sigma14 + sup3: [0.289, 0.286, 0.294], // sigma15 + sub1: [0.150, 0.143, 0.200], // sigma16 + sub2: [0.247, 0.286, 0.400], // sigma17 + supDrop: [0.386, 0.353, 0.494], // sigma18 + subDrop: [0.050, 0.071, 0.100], // sigma19 + delim1: [2.390, 1.700, 1.980], // sigma20 + delim2: [1.010, 1.157, 1.420], // sigma21 + axisHeight: [0.250, 0.250, 0.250] // sigma22 +}; + +// These font metrics are extracted from TeX by using +// \font\a=cmex10 +// \showthe\fontdimenX\a +// where X is the corresponding variable number. These correspond to the font +// parameters of the extension fonts (family 3). See the TeXbook, page 441. +var xi1 = 0; +var xi2 = 0; +var xi3 = 0; +var xi4 = 0; +var xi5 = 0.431; +var xi6 = 1; +var xi7 = 0; +var xi8 = 0.04; +var xi9 = 0.111; +var xi10 = 0.166; +var xi11 = 0.2; +var xi12 = 0.6; +var xi13 = 0.1; + +// This value determines how large a pt is, for metrics which are defined in +// terms of pts. +// This value is also used in katex.less; if you change it make sure the values +// match. +var ptPerEm = 10.0; + +// The space between adjacent `|` columns in an array definition. From +// `\showthe\doublerulesep` in LaTeX. +var doubleRuleSep = 2.0 / ptPerEm; + +/** + * This is just a mapping from common names to real metrics + */ +var metrics = { + defaultRuleThickness: xi8, + bigOpSpacing1: xi9, + bigOpSpacing2: xi10, + bigOpSpacing3: xi11, + bigOpSpacing4: xi12, + bigOpSpacing5: xi13, + ptPerEm: ptPerEm, + doubleRuleSep: doubleRuleSep +}; + +// This map contains a mapping from font name and character code to character +// metrics, including height, depth, italic correction, and skew (kern from the +// character to the corresponding \skewchar) +// This map is generated via `make metrics`. It should not be changed manually. +var metricMap = require("./fontMetricsData"); + +// These are very rough approximations. We default to Times New Roman which +// should have Latin-1 and Cyrillic characters, but may not depending on the +// operating system. The metrics do not account for extra height from the +// accents. In the case of Cyrillic characters which have both ascenders and +// descenders we prefer approximations with ascenders, primarily to prevent +// the fraction bar or root line from intersecting the glyph. +// TODO(kevinb) allow union of multiple glyph metrics for better accuracy. +var extraCharacterMap = { + // Latin-1 + 'À': 'A', + 'Á': 'A', + 'Â': 'A', + 'Ã': 'A', + 'Ä': 'A', + 'Å': 'A', + 'Æ': 'A', + 'Ç': 'C', + 'È': 'E', + 'É': 'E', + 'Ê': 'E', + 'Ë': 'E', + 'Ì': 'I', + 'Í': 'I', + 'Î': 'I', + 'Ï': 'I', + 'Ð': 'D', + 'Ñ': 'N', + 'Ò': 'O', + 'Ó': 'O', + 'Ô': 'O', + 'Õ': 'O', + 'Ö': 'O', + 'Ø': 'O', + 'Ù': 'U', + 'Ú': 'U', + 'Û': 'U', + 'Ü': 'U', + 'Ý': 'Y', + 'Þ': 'o', + 'ß': 'B', + 'à': 'a', + 'á': 'a', + 'â': 'a', + 'ã': 'a', + 'ä': 'a', + 'å': 'a', + 'æ': 'a', + 'ç': 'c', + 'è': 'e', + 'é': 'e', + 'ê': 'e', + 'ë': 'e', + 'ì': 'i', + 'í': 'i', + 'î': 'i', + 'ï': 'i', + 'ð': 'd', + 'ñ': 'n', + 'ò': 'o', + 'ó': 'o', + 'ô': 'o', + 'õ': 'o', + 'ö': 'o', + 'ø': 'o', + 'ù': 'u', + 'ú': 'u', + 'û': 'u', + 'ü': 'u', + 'ý': 'y', + 'þ': 'o', + 'ÿ': 'y', + + // Cyrillic + 'А': 'A', + 'Б': 'B', + 'В': 'B', + 'Г': 'F', + 'Д': 'A', + 'Е': 'E', + 'Ж': 'K', + 'З': '3', + 'И': 'N', + 'Й': 'N', + 'К': 'K', + 'Л': 'N', + 'М': 'M', + 'Н': 'H', + 'О': 'O', + 'П': 'N', + 'Р': 'P', + 'С': 'C', + 'Т': 'T', + 'У': 'y', + 'Ф': 'O', + 'Х': 'X', + 'Ц': 'U', + 'Ч': 'h', + 'Ш': 'W', + 'Щ': 'W', + 'Ъ': 'B', + 'Ы': 'X', + 'Ь': 'B', + 'Э': '3', + 'Ю': 'X', + 'Я': 'R', + 'а': 'a', + 'б': 'b', + 'в': 'a', + 'г': 'r', + 'д': 'y', + 'е': 'e', + 'ж': 'm', + 'з': 'e', + 'и': 'n', + 'й': 'n', + 'к': 'n', + 'л': 'n', + 'м': 'm', + 'н': 'n', + 'о': 'o', + 'п': 'n', + 'р': 'p', + 'с': 'c', + 'т': 'o', + 'у': 'y', + 'ф': 'b', + 'х': 'x', + 'ц': 'n', + 'ч': 'n', + 'ш': 'w', + 'щ': 'w', + 'ъ': 'a', + 'ы': 'm', + 'ь': 'a', + 'э': 'e', + 'ю': 'm', + 'я': 'r' +}; + +/** + * This function is a convenience function for looking up information in the + * metricMap table. It takes a character as a string, and a style. + * + * Note: the `width` property may be undefined if fontMetricsData.js wasn't + * built using `Make extended_metrics`. + */ +var getCharacterMetrics = function(character, style) { + var ch = character.charCodeAt(0); + if (character[0] in extraCharacterMap) { + ch = extraCharacterMap[character[0]].charCodeAt(0); + } else if (cjkRegex.test(character[0])) { + ch = 'M'.charCodeAt(0); + } + var metrics = metricMap[style][ch]; + if (metrics) { + return { + depth: metrics[0], + height: metrics[1], + italic: metrics[2], + skew: metrics[3], + width: metrics[4] + }; + } +}; + +module.exports = { + metrics: metrics, + sigmas: sigmas, + getCharacterMetrics: getCharacterMetrics +}; + +},{"./Style":9,"./fontMetricsData":18,"./unicodeRegexes":24}],18:[function(require,module,exports){ +module.exports = { + "AMS-Regular": { + "65": [0, 0.68889, 0, 0], + "66": [0, 0.68889, 0, 0], + "67": [0, 0.68889, 0, 0], + "68": [0, 0.68889, 0, 0], + "69": [0, 0.68889, 0, 0], + "70": [0, 0.68889, 0, 0], + "71": [0, 0.68889, 0, 0], + "72": [0, 0.68889, 0, 0], + "73": [0, 0.68889, 0, 0], + "74": [0.16667, 0.68889, 0, 0], + "75": [0, 0.68889, 0, 0], + "76": [0, 0.68889, 0, 0], + "77": [0, 0.68889, 0, 0], + "78": [0, 0.68889, 0, 0], + "79": [0.16667, 0.68889, 0, 0], + "80": [0, 0.68889, 0, 0], + "81": [0.16667, 0.68889, 0, 0], + "82": [0, 0.68889, 0, 0], + "83": [0, 0.68889, 0, 0], + "84": [0, 0.68889, 0, 0], + "85": [0, 0.68889, 0, 0], + "86": [0, 0.68889, 0, 0], + "87": [0, 0.68889, 0, 0], + "88": [0, 0.68889, 0, 0], + "89": [0, 0.68889, 0, 0], + "90": [0, 0.68889, 0, 0], + "107": [0, 0.68889, 0, 0], + "165": [0, 0.675, 0.025, 0], + "174": [0.15559, 0.69224, 0, 0], + "240": [0, 0.68889, 0, 0], + "295": [0, 0.68889, 0, 0], + "710": [0, 0.825, 0, 0], + "732": [0, 0.9, 0, 0], + "770": [0, 0.825, 0, 0], + "771": [0, 0.9, 0, 0], + "989": [0.08167, 0.58167, 0, 0], + "1008": [0, 0.43056, 0.04028, 0], + "8245": [0, 0.54986, 0, 0], + "8463": [0, 0.68889, 0, 0], + "8487": [0, 0.68889, 0, 0], + "8498": [0, 0.68889, 0, 0], + "8502": [0, 0.68889, 0, 0], + "8503": [0, 0.68889, 0, 0], + "8504": [0, 0.68889, 0, 0], + "8513": [0, 0.68889, 0, 0], + "8592": [-0.03598, 0.46402, 0, 0], + "8594": [-0.03598, 0.46402, 0, 0], + "8602": [-0.13313, 0.36687, 0, 0], + "8603": [-0.13313, 0.36687, 0, 0], + "8606": [0.01354, 0.52239, 0, 0], + "8608": [0.01354, 0.52239, 0, 0], + "8610": [0.01354, 0.52239, 0, 0], + "8611": [0.01354, 0.52239, 0, 0], + "8619": [0, 0.54986, 0, 0], + "8620": [0, 0.54986, 0, 0], + "8621": [-0.13313, 0.37788, 0, 0], + "8622": [-0.13313, 0.36687, 0, 0], + "8624": [0, 0.69224, 0, 0], + "8625": [0, 0.69224, 0, 0], + "8630": [0, 0.43056, 0, 0], + "8631": [0, 0.43056, 0, 0], + "8634": [0.08198, 0.58198, 0, 0], + "8635": [0.08198, 0.58198, 0, 0], + "8638": [0.19444, 0.69224, 0, 0], + "8639": [0.19444, 0.69224, 0, 0], + "8642": [0.19444, 0.69224, 0, 0], + "8643": [0.19444, 0.69224, 0, 0], + "8644": [0.1808, 0.675, 0, 0], + "8646": [0.1808, 0.675, 0, 0], + "8647": [0.1808, 0.675, 0, 0], + "8648": [0.19444, 0.69224, 0, 0], + "8649": [0.1808, 0.675, 0, 0], + "8650": [0.19444, 0.69224, 0, 0], + "8651": [0.01354, 0.52239, 0, 0], + "8652": [0.01354, 0.52239, 0, 0], + "8653": [-0.13313, 0.36687, 0, 0], + "8654": [-0.13313, 0.36687, 0, 0], + "8655": [-0.13313, 0.36687, 0, 0], + "8666": [0.13667, 0.63667, 0, 0], + "8667": [0.13667, 0.63667, 0, 0], + "8669": [-0.13313, 0.37788, 0, 0], + "8672": [-0.064, 0.437, 0, 0], + "8674": [-0.064, 0.437, 0, 0], + "8705": [0, 0.825, 0, 0], + "8708": [0, 0.68889, 0, 0], + "8709": [0.08167, 0.58167, 0, 0], + "8717": [0, 0.43056, 0, 0], + "8722": [-0.03598, 0.46402, 0, 0], + "8724": [0.08198, 0.69224, 0, 0], + "8726": [0.08167, 0.58167, 0, 0], + "8733": [0, 0.69224, 0, 0], + "8736": [0, 0.69224, 0, 0], + "8737": [0, 0.69224, 0, 0], + "8738": [0.03517, 0.52239, 0, 0], + "8739": [0.08167, 0.58167, 0, 0], + "8740": [0.25142, 0.74111, 0, 0], + "8741": [0.08167, 0.58167, 0, 0], + "8742": [0.25142, 0.74111, 0, 0], + "8756": [0, 0.69224, 0, 0], + "8757": [0, 0.69224, 0, 0], + "8764": [-0.13313, 0.36687, 0, 0], + "8765": [-0.13313, 0.37788, 0, 0], + "8769": [-0.13313, 0.36687, 0, 0], + "8770": [-0.03625, 0.46375, 0, 0], + "8774": [0.30274, 0.79383, 0, 0], + "8776": [-0.01688, 0.48312, 0, 0], + "8778": [0.08167, 0.58167, 0, 0], + "8782": [0.06062, 0.54986, 0, 0], + "8783": [0.06062, 0.54986, 0, 0], + "8785": [0.08198, 0.58198, 0, 0], + "8786": [0.08198, 0.58198, 0, 0], + "8787": [0.08198, 0.58198, 0, 0], + "8790": [0, 0.69224, 0, 0], + "8791": [0.22958, 0.72958, 0, 0], + "8796": [0.08198, 0.91667, 0, 0], + "8806": [0.25583, 0.75583, 0, 0], + "8807": [0.25583, 0.75583, 0, 0], + "8808": [0.25142, 0.75726, 0, 0], + "8809": [0.25142, 0.75726, 0, 0], + "8812": [0.25583, 0.75583, 0, 0], + "8814": [0.20576, 0.70576, 0, 0], + "8815": [0.20576, 0.70576, 0, 0], + "8816": [0.30274, 0.79383, 0, 0], + "8817": [0.30274, 0.79383, 0, 0], + "8818": [0.22958, 0.72958, 0, 0], + "8819": [0.22958, 0.72958, 0, 0], + "8822": [0.1808, 0.675, 0, 0], + "8823": [0.1808, 0.675, 0, 0], + "8828": [0.13667, 0.63667, 0, 0], + "8829": [0.13667, 0.63667, 0, 0], + "8830": [0.22958, 0.72958, 0, 0], + "8831": [0.22958, 0.72958, 0, 0], + "8832": [0.20576, 0.70576, 0, 0], + "8833": [0.20576, 0.70576, 0, 0], + "8840": [0.30274, 0.79383, 0, 0], + "8841": [0.30274, 0.79383, 0, 0], + "8842": [0.13597, 0.63597, 0, 0], + "8843": [0.13597, 0.63597, 0, 0], + "8847": [0.03517, 0.54986, 0, 0], + "8848": [0.03517, 0.54986, 0, 0], + "8858": [0.08198, 0.58198, 0, 0], + "8859": [0.08198, 0.58198, 0, 0], + "8861": [0.08198, 0.58198, 0, 0], + "8862": [0, 0.675, 0, 0], + "8863": [0, 0.675, 0, 0], + "8864": [0, 0.675, 0, 0], + "8865": [0, 0.675, 0, 0], + "8872": [0, 0.69224, 0, 0], + "8873": [0, 0.69224, 0, 0], + "8874": [0, 0.69224, 0, 0], + "8876": [0, 0.68889, 0, 0], + "8877": [0, 0.68889, 0, 0], + "8878": [0, 0.68889, 0, 0], + "8879": [0, 0.68889, 0, 0], + "8882": [0.03517, 0.54986, 0, 0], + "8883": [0.03517, 0.54986, 0, 0], + "8884": [0.13667, 0.63667, 0, 0], + "8885": [0.13667, 0.63667, 0, 0], + "8888": [0, 0.54986, 0, 0], + "8890": [0.19444, 0.43056, 0, 0], + "8891": [0.19444, 0.69224, 0, 0], + "8892": [0.19444, 0.69224, 0, 0], + "8901": [0, 0.54986, 0, 0], + "8903": [0.08167, 0.58167, 0, 0], + "8905": [0.08167, 0.58167, 0, 0], + "8906": [0.08167, 0.58167, 0, 0], + "8907": [0, 0.69224, 0, 0], + "8908": [0, 0.69224, 0, 0], + "8909": [-0.03598, 0.46402, 0, 0], + "8910": [0, 0.54986, 0, 0], + "8911": [0, 0.54986, 0, 0], + "8912": [0.03517, 0.54986, 0, 0], + "8913": [0.03517, 0.54986, 0, 0], + "8914": [0, 0.54986, 0, 0], + "8915": [0, 0.54986, 0, 0], + "8916": [0, 0.69224, 0, 0], + "8918": [0.0391, 0.5391, 0, 0], + "8919": [0.0391, 0.5391, 0, 0], + "8920": [0.03517, 0.54986, 0, 0], + "8921": [0.03517, 0.54986, 0, 0], + "8922": [0.38569, 0.88569, 0, 0], + "8923": [0.38569, 0.88569, 0, 0], + "8926": [0.13667, 0.63667, 0, 0], + "8927": [0.13667, 0.63667, 0, 0], + "8928": [0.30274, 0.79383, 0, 0], + "8929": [0.30274, 0.79383, 0, 0], + "8934": [0.23222, 0.74111, 0, 0], + "8935": [0.23222, 0.74111, 0, 0], + "8936": [0.23222, 0.74111, 0, 0], + "8937": [0.23222, 0.74111, 0, 0], + "8938": [0.20576, 0.70576, 0, 0], + "8939": [0.20576, 0.70576, 0, 0], + "8940": [0.30274, 0.79383, 0, 0], + "8941": [0.30274, 0.79383, 0, 0], + "8994": [0.19444, 0.69224, 0, 0], + "8995": [0.19444, 0.69224, 0, 0], + "9416": [0.15559, 0.69224, 0, 0], + "9484": [0, 0.69224, 0, 0], + "9488": [0, 0.69224, 0, 0], + "9492": [0, 0.37788, 0, 0], + "9496": [0, 0.37788, 0, 0], + "9585": [0.19444, 0.68889, 0, 0], + "9586": [0.19444, 0.74111, 0, 0], + "9632": [0, 0.675, 0, 0], + "9633": [0, 0.675, 0, 0], + "9650": [0, 0.54986, 0, 0], + "9651": [0, 0.54986, 0, 0], + "9654": [0.03517, 0.54986, 0, 0], + "9660": [0, 0.54986, 0, 0], + "9661": [0, 0.54986, 0, 0], + "9664": [0.03517, 0.54986, 0, 0], + "9674": [0.11111, 0.69224, 0, 0], + "9733": [0.19444, 0.69224, 0, 0], + "10003": [0, 0.69224, 0, 0], + "10016": [0, 0.69224, 0, 0], + "10731": [0.11111, 0.69224, 0, 0], + "10846": [0.19444, 0.75583, 0, 0], + "10877": [0.13667, 0.63667, 0, 0], + "10878": [0.13667, 0.63667, 0, 0], + "10885": [0.25583, 0.75583, 0, 0], + "10886": [0.25583, 0.75583, 0, 0], + "10887": [0.13597, 0.63597, 0, 0], + "10888": [0.13597, 0.63597, 0, 0], + "10889": [0.26167, 0.75726, 0, 0], + "10890": [0.26167, 0.75726, 0, 0], + "10891": [0.48256, 0.98256, 0, 0], + "10892": [0.48256, 0.98256, 0, 0], + "10901": [0.13667, 0.63667, 0, 0], + "10902": [0.13667, 0.63667, 0, 0], + "10933": [0.25142, 0.75726, 0, 0], + "10934": [0.25142, 0.75726, 0, 0], + "10935": [0.26167, 0.75726, 0, 0], + "10936": [0.26167, 0.75726, 0, 0], + "10937": [0.26167, 0.75726, 0, 0], + "10938": [0.26167, 0.75726, 0, 0], + "10949": [0.25583, 0.75583, 0, 0], + "10950": [0.25583, 0.75583, 0, 0], + "10955": [0.28481, 0.79383, 0, 0], + "10956": [0.28481, 0.79383, 0, 0], + "57350": [0.08167, 0.58167, 0, 0], + "57351": [0.08167, 0.58167, 0, 0], + "57352": [0.08167, 0.58167, 0, 0], + "57353": [0, 0.43056, 0.04028, 0], + "57356": [0.25142, 0.75726, 0, 0], + "57357": [0.25142, 0.75726, 0, 0], + "57358": [0.41951, 0.91951, 0, 0], + "57359": [0.30274, 0.79383, 0, 0], + "57360": [0.30274, 0.79383, 0, 0], + "57361": [0.41951, 0.91951, 0, 0], + "57366": [0.25142, 0.75726, 0, 0], + "57367": [0.25142, 0.75726, 0, 0], + "57368": [0.25142, 0.75726, 0, 0], + "57369": [0.25142, 0.75726, 0, 0], + "57370": [0.13597, 0.63597, 0, 0], + "57371": [0.13597, 0.63597, 0, 0] + }, + "Caligraphic-Regular": { + "48": [0, 0.43056, 0, 0], + "49": [0, 0.43056, 0, 0], + "50": [0, 0.43056, 0, 0], + "51": [0.19444, 0.43056, 0, 0], + "52": [0.19444, 0.43056, 0, 0], + "53": [0.19444, 0.43056, 0, 0], + "54": [0, 0.64444, 0, 0], + "55": [0.19444, 0.43056, 0, 0], + "56": [0, 0.64444, 0, 0], + "57": [0.19444, 0.43056, 0, 0], + "65": [0, 0.68333, 0, 0.19445], + "66": [0, 0.68333, 0.03041, 0.13889], + "67": [0, 0.68333, 0.05834, 0.13889], + "68": [0, 0.68333, 0.02778, 0.08334], + "69": [0, 0.68333, 0.08944, 0.11111], + "70": [0, 0.68333, 0.09931, 0.11111], + "71": [0.09722, 0.68333, 0.0593, 0.11111], + "72": [0, 0.68333, 0.00965, 0.11111], + "73": [0, 0.68333, 0.07382, 0], + "74": [0.09722, 0.68333, 0.18472, 0.16667], + "75": [0, 0.68333, 0.01445, 0.05556], + "76": [0, 0.68333, 0, 0.13889], + "77": [0, 0.68333, 0, 0.13889], + "78": [0, 0.68333, 0.14736, 0.08334], + "79": [0, 0.68333, 0.02778, 0.11111], + "80": [0, 0.68333, 0.08222, 0.08334], + "81": [0.09722, 0.68333, 0, 0.11111], + "82": [0, 0.68333, 0, 0.08334], + "83": [0, 0.68333, 0.075, 0.13889], + "84": [0, 0.68333, 0.25417, 0], + "85": [0, 0.68333, 0.09931, 0.08334], + "86": [0, 0.68333, 0.08222, 0], + "87": [0, 0.68333, 0.08222, 0.08334], + "88": [0, 0.68333, 0.14643, 0.13889], + "89": [0.09722, 0.68333, 0.08222, 0.08334], + "90": [0, 0.68333, 0.07944, 0.13889] + }, + "Fraktur-Regular": { + "33": [0, 0.69141, 0, 0], + "34": [0, 0.69141, 0, 0], + "38": [0, 0.69141, 0, 0], + "39": [0, 0.69141, 0, 0], + "40": [0.24982, 0.74947, 0, 0], + "41": [0.24982, 0.74947, 0, 0], + "42": [0, 0.62119, 0, 0], + "43": [0.08319, 0.58283, 0, 0], + "44": [0, 0.10803, 0, 0], + "45": [0.08319, 0.58283, 0, 0], + "46": [0, 0.10803, 0, 0], + "47": [0.24982, 0.74947, 0, 0], + "48": [0, 0.47534, 0, 0], + "49": [0, 0.47534, 0, 0], + "50": [0, 0.47534, 0, 0], + "51": [0.18906, 0.47534, 0, 0], + "52": [0.18906, 0.47534, 0, 0], + "53": [0.18906, 0.47534, 0, 0], + "54": [0, 0.69141, 0, 0], + "55": [0.18906, 0.47534, 0, 0], + "56": [0, 0.69141, 0, 0], + "57": [0.18906, 0.47534, 0, 0], + "58": [0, 0.47534, 0, 0], + "59": [0.12604, 0.47534, 0, 0], + "61": [-0.13099, 0.36866, 0, 0], + "63": [0, 0.69141, 0, 0], + "65": [0, 0.69141, 0, 0], + "66": [0, 0.69141, 0, 0], + "67": [0, 0.69141, 0, 0], + "68": [0, 0.69141, 0, 0], + "69": [0, 0.69141, 0, 0], + "70": [0.12604, 0.69141, 0, 0], + "71": [0, 0.69141, 0, 0], + "72": [0.06302, 0.69141, 0, 0], + "73": [0, 0.69141, 0, 0], + "74": [0.12604, 0.69141, 0, 0], + "75": [0, 0.69141, 0, 0], + "76": [0, 0.69141, 0, 0], + "77": [0, 0.69141, 0, 0], + "78": [0, 0.69141, 0, 0], + "79": [0, 0.69141, 0, 0], + "80": [0.18906, 0.69141, 0, 0], + "81": [0.03781, 0.69141, 0, 0], + "82": [0, 0.69141, 0, 0], + "83": [0, 0.69141, 0, 0], + "84": [0, 0.69141, 0, 0], + "85": [0, 0.69141, 0, 0], + "86": [0, 0.69141, 0, 0], + "87": [0, 0.69141, 0, 0], + "88": [0, 0.69141, 0, 0], + "89": [0.18906, 0.69141, 0, 0], + "90": [0.12604, 0.69141, 0, 0], + "91": [0.24982, 0.74947, 0, 0], + "93": [0.24982, 0.74947, 0, 0], + "94": [0, 0.69141, 0, 0], + "97": [0, 0.47534, 0, 0], + "98": [0, 0.69141, 0, 0], + "99": [0, 0.47534, 0, 0], + "100": [0, 0.62119, 0, 0], + "101": [0, 0.47534, 0, 0], + "102": [0.18906, 0.69141, 0, 0], + "103": [0.18906, 0.47534, 0, 0], + "104": [0.18906, 0.69141, 0, 0], + "105": [0, 0.69141, 0, 0], + "106": [0, 0.69141, 0, 0], + "107": [0, 0.69141, 0, 0], + "108": [0, 0.69141, 0, 0], + "109": [0, 0.47534, 0, 0], + "110": [0, 0.47534, 0, 0], + "111": [0, 0.47534, 0, 0], + "112": [0.18906, 0.52396, 0, 0], + "113": [0.18906, 0.47534, 0, 0], + "114": [0, 0.47534, 0, 0], + "115": [0, 0.47534, 0, 0], + "116": [0, 0.62119, 0, 0], + "117": [0, 0.47534, 0, 0], + "118": [0, 0.52396, 0, 0], + "119": [0, 0.52396, 0, 0], + "120": [0.18906, 0.47534, 0, 0], + "121": [0.18906, 0.47534, 0, 0], + "122": [0.18906, 0.47534, 0, 0], + "8216": [0, 0.69141, 0, 0], + "8217": [0, 0.69141, 0, 0], + "58112": [0, 0.62119, 0, 0], + "58113": [0, 0.62119, 0, 0], + "58114": [0.18906, 0.69141, 0, 0], + "58115": [0.18906, 0.69141, 0, 0], + "58116": [0.18906, 0.47534, 0, 0], + "58117": [0, 0.69141, 0, 0], + "58118": [0, 0.62119, 0, 0], + "58119": [0, 0.47534, 0, 0] + }, + "Main-Bold": { + "33": [0, 0.69444, 0, 0], + "34": [0, 0.69444, 0, 0], + "35": [0.19444, 0.69444, 0, 0], + "36": [0.05556, 0.75, 0, 0], + "37": [0.05556, 0.75, 0, 0], + "38": [0, 0.69444, 0, 0], + "39": [0, 0.69444, 0, 0], + "40": [0.25, 0.75, 0, 0], + "41": [0.25, 0.75, 0, 0], + "42": [0, 0.75, 0, 0], + "43": [0.13333, 0.63333, 0, 0], + "44": [0.19444, 0.15556, 0, 0], + "45": [0, 0.44444, 0, 0], + "46": [0, 0.15556, 0, 0], + "47": [0.25, 0.75, 0, 0], + "48": [0, 0.64444, 0, 0], + "49": [0, 0.64444, 0, 0], + "50": [0, 0.64444, 0, 0], + "51": [0, 0.64444, 0, 0], + "52": [0, 0.64444, 0, 0], + "53": [0, 0.64444, 0, 0], + "54": [0, 0.64444, 0, 0], + "55": [0, 0.64444, 0, 0], + "56": [0, 0.64444, 0, 0], + "57": [0, 0.64444, 0, 0], + "58": [0, 0.44444, 0, 0], + "59": [0.19444, 0.44444, 0, 0], + "60": [0.08556, 0.58556, 0, 0], + "61": [-0.10889, 0.39111, 0, 0], + "62": [0.08556, 0.58556, 0, 0], + "63": [0, 0.69444, 0, 0], + "64": [0, 0.69444, 0, 0], + "65": [0, 0.68611, 0, 0], + "66": [0, 0.68611, 0, 0], + "67": [0, 0.68611, 0, 0], + "68": [0, 0.68611, 0, 0], + "69": [0, 0.68611, 0, 0], + "70": [0, 0.68611, 0, 0], + "71": [0, 0.68611, 0, 0], + "72": [0, 0.68611, 0, 0], + "73": [0, 0.68611, 0, 0], + "74": [0, 0.68611, 0, 0], + "75": [0, 0.68611, 0, 0], + "76": [0, 0.68611, 0, 0], + "77": [0, 0.68611, 0, 0], + "78": [0, 0.68611, 0, 0], + "79": [0, 0.68611, 0, 0], + "80": [0, 0.68611, 0, 0], + "81": [0.19444, 0.68611, 0, 0], + "82": [0, 0.68611, 0, 0], + "83": [0, 0.68611, 0, 0], + "84": [0, 0.68611, 0, 0], + "85": [0, 0.68611, 0, 0], + "86": [0, 0.68611, 0.01597, 0], + "87": [0, 0.68611, 0.01597, 0], + "88": [0, 0.68611, 0, 0], + "89": [0, 0.68611, 0.02875, 0], + "90": [0, 0.68611, 0, 0], + "91": [0.25, 0.75, 0, 0], + "92": [0.25, 0.75, 0, 0], + "93": [0.25, 0.75, 0, 0], + "94": [0, 0.69444, 0, 0], + "95": [0.31, 0.13444, 0.03194, 0], + "96": [0, 0.69444, 0, 0], + "97": [0, 0.44444, 0, 0], + "98": [0, 0.69444, 0, 0], + "99": [0, 0.44444, 0, 0], + "100": [0, 0.69444, 0, 0], + "101": [0, 0.44444, 0, 0], + "102": [0, 0.69444, 0.10903, 0], + "103": [0.19444, 0.44444, 0.01597, 0], + "104": [0, 0.69444, 0, 0], + "105": [0, 0.69444, 0, 0], + "106": [0.19444, 0.69444, 0, 0], + "107": [0, 0.69444, 0, 0], + "108": [0, 0.69444, 0, 0], + "109": [0, 0.44444, 0, 0], + "110": [0, 0.44444, 0, 0], + "111": [0, 0.44444, 0, 0], + "112": [0.19444, 0.44444, 0, 0], + "113": [0.19444, 0.44444, 0, 0], + "114": [0, 0.44444, 0, 0], + "115": [0, 0.44444, 0, 0], + "116": [0, 0.63492, 0, 0], + "117": [0, 0.44444, 0, 0], + "118": [0, 0.44444, 0.01597, 0], + "119": [0, 0.44444, 0.01597, 0], + "120": [0, 0.44444, 0, 0], + "121": [0.19444, 0.44444, 0.01597, 0], + "122": [0, 0.44444, 0, 0], + "123": [0.25, 0.75, 0, 0], + "124": [0.25, 0.75, 0, 0], + "125": [0.25, 0.75, 0, 0], + "126": [0.35, 0.34444, 0, 0], + "168": [0, 0.69444, 0, 0], + "172": [0, 0.44444, 0, 0], + "175": [0, 0.59611, 0, 0], + "176": [0, 0.69444, 0, 0], + "177": [0.13333, 0.63333, 0, 0], + "180": [0, 0.69444, 0, 0], + "215": [0.13333, 0.63333, 0, 0], + "247": [0.13333, 0.63333, 0, 0], + "305": [0, 0.44444, 0, 0], + "567": [0.19444, 0.44444, 0, 0], + "710": [0, 0.69444, 0, 0], + "711": [0, 0.63194, 0, 0], + "713": [0, 0.59611, 0, 0], + "714": [0, 0.69444, 0, 0], + "715": [0, 0.69444, 0, 0], + "728": [0, 0.69444, 0, 0], + "729": [0, 0.69444, 0, 0], + "730": [0, 0.69444, 0, 0], + "732": [0, 0.69444, 0, 0], + "768": [0, 0.69444, 0, 0], + "769": [0, 0.69444, 0, 0], + "770": [0, 0.69444, 0, 0], + "771": [0, 0.69444, 0, 0], + "772": [0, 0.59611, 0, 0], + "774": [0, 0.69444, 0, 0], + "775": [0, 0.69444, 0, 0], + "776": [0, 0.69444, 0, 0], + "778": [0, 0.69444, 0, 0], + "779": [0, 0.69444, 0, 0], + "780": [0, 0.63194, 0, 0], + "824": [0.19444, 0.69444, 0, 0], + "915": [0, 0.68611, 0, 0], + "916": [0, 0.68611, 0, 0], + "920": [0, 0.68611, 0, 0], + "923": [0, 0.68611, 0, 0], + "926": [0, 0.68611, 0, 0], + "928": [0, 0.68611, 0, 0], + "931": [0, 0.68611, 0, 0], + "933": [0, 0.68611, 0, 0], + "934": [0, 0.68611, 0, 0], + "936": [0, 0.68611, 0, 0], + "937": [0, 0.68611, 0, 0], + "8211": [0, 0.44444, 0.03194, 0], + "8212": [0, 0.44444, 0.03194, 0], + "8216": [0, 0.69444, 0, 0], + "8217": [0, 0.69444, 0, 0], + "8220": [0, 0.69444, 0, 0], + "8221": [0, 0.69444, 0, 0], + "8224": [0.19444, 0.69444, 0, 0], + "8225": [0.19444, 0.69444, 0, 0], + "8242": [0, 0.55556, 0, 0], + "8407": [0, 0.72444, 0.15486, 0], + "8463": [0, 0.69444, 0, 0], + "8465": [0, 0.69444, 0, 0], + "8467": [0, 0.69444, 0, 0], + "8472": [0.19444, 0.44444, 0, 0], + "8476": [0, 0.69444, 0, 0], + "8501": [0, 0.69444, 0, 0], + "8592": [-0.10889, 0.39111, 0, 0], + "8593": [0.19444, 0.69444, 0, 0], + "8594": [-0.10889, 0.39111, 0, 0], + "8595": [0.19444, 0.69444, 0, 0], + "8596": [-0.10889, 0.39111, 0, 0], + "8597": [0.25, 0.75, 0, 0], + "8598": [0.19444, 0.69444, 0, 0], + "8599": [0.19444, 0.69444, 0, 0], + "8600": [0.19444, 0.69444, 0, 0], + "8601": [0.19444, 0.69444, 0, 0], + "8636": [-0.10889, 0.39111, 0, 0], + "8637": [-0.10889, 0.39111, 0, 0], + "8640": [-0.10889, 0.39111, 0, 0], + "8641": [-0.10889, 0.39111, 0, 0], + "8656": [-0.10889, 0.39111, 0, 0], + "8657": [0.19444, 0.69444, 0, 0], + "8658": [-0.10889, 0.39111, 0, 0], + "8659": [0.19444, 0.69444, 0, 0], + "8660": [-0.10889, 0.39111, 0, 0], + "8661": [0.25, 0.75, 0, 0], + "8704": [0, 0.69444, 0, 0], + "8706": [0, 0.69444, 0.06389, 0], + "8707": [0, 0.69444, 0, 0], + "8709": [0.05556, 0.75, 0, 0], + "8711": [0, 0.68611, 0, 0], + "8712": [0.08556, 0.58556, 0, 0], + "8715": [0.08556, 0.58556, 0, 0], + "8722": [0.13333, 0.63333, 0, 0], + "8723": [0.13333, 0.63333, 0, 0], + "8725": [0.25, 0.75, 0, 0], + "8726": [0.25, 0.75, 0, 0], + "8727": [-0.02778, 0.47222, 0, 0], + "8728": [-0.02639, 0.47361, 0, 0], + "8729": [-0.02639, 0.47361, 0, 0], + "8730": [0.18, 0.82, 0, 0], + "8733": [0, 0.44444, 0, 0], + "8734": [0, 0.44444, 0, 0], + "8736": [0, 0.69224, 0, 0], + "8739": [0.25, 0.75, 0, 0], + "8741": [0.25, 0.75, 0, 0], + "8743": [0, 0.55556, 0, 0], + "8744": [0, 0.55556, 0, 0], + "8745": [0, 0.55556, 0, 0], + "8746": [0, 0.55556, 0, 0], + "8747": [0.19444, 0.69444, 0.12778, 0], + "8764": [-0.10889, 0.39111, 0, 0], + "8768": [0.19444, 0.69444, 0, 0], + "8771": [0.00222, 0.50222, 0, 0], + "8776": [0.02444, 0.52444, 0, 0], + "8781": [0.00222, 0.50222, 0, 0], + "8801": [0.00222, 0.50222, 0, 0], + "8804": [0.19667, 0.69667, 0, 0], + "8805": [0.19667, 0.69667, 0, 0], + "8810": [0.08556, 0.58556, 0, 0], + "8811": [0.08556, 0.58556, 0, 0], + "8826": [0.08556, 0.58556, 0, 0], + "8827": [0.08556, 0.58556, 0, 0], + "8834": [0.08556, 0.58556, 0, 0], + "8835": [0.08556, 0.58556, 0, 0], + "8838": [0.19667, 0.69667, 0, 0], + "8839": [0.19667, 0.69667, 0, 0], + "8846": [0, 0.55556, 0, 0], + "8849": [0.19667, 0.69667, 0, 0], + "8850": [0.19667, 0.69667, 0, 0], + "8851": [0, 0.55556, 0, 0], + "8852": [0, 0.55556, 0, 0], + "8853": [0.13333, 0.63333, 0, 0], + "8854": [0.13333, 0.63333, 0, 0], + "8855": [0.13333, 0.63333, 0, 0], + "8856": [0.13333, 0.63333, 0, 0], + "8857": [0.13333, 0.63333, 0, 0], + "8866": [0, 0.69444, 0, 0], + "8867": [0, 0.69444, 0, 0], + "8868": [0, 0.69444, 0, 0], + "8869": [0, 0.69444, 0, 0], + "8900": [-0.02639, 0.47361, 0, 0], + "8901": [-0.02639, 0.47361, 0, 0], + "8902": [-0.02778, 0.47222, 0, 0], + "8968": [0.25, 0.75, 0, 0], + "8969": [0.25, 0.75, 0, 0], + "8970": [0.25, 0.75, 0, 0], + "8971": [0.25, 0.75, 0, 0], + "8994": [-0.13889, 0.36111, 0, 0], + "8995": [-0.13889, 0.36111, 0, 0], + "9651": [0.19444, 0.69444, 0, 0], + "9657": [-0.02778, 0.47222, 0, 0], + "9661": [0.19444, 0.69444, 0, 0], + "9667": [-0.02778, 0.47222, 0, 0], + "9711": [0.19444, 0.69444, 0, 0], + "9824": [0.12963, 0.69444, 0, 0], + "9825": [0.12963, 0.69444, 0, 0], + "9826": [0.12963, 0.69444, 0, 0], + "9827": [0.12963, 0.69444, 0, 0], + "9837": [0, 0.75, 0, 0], + "9838": [0.19444, 0.69444, 0, 0], + "9839": [0.19444, 0.69444, 0, 0], + "10216": [0.25, 0.75, 0, 0], + "10217": [0.25, 0.75, 0, 0], + "10815": [0, 0.68611, 0, 0], + "10927": [0.19667, 0.69667, 0, 0], + "10928": [0.19667, 0.69667, 0, 0] + }, + "Main-Italic": { + "33": [0, 0.69444, 0.12417, 0], + "34": [0, 0.69444, 0.06961, 0], + "35": [0.19444, 0.69444, 0.06616, 0], + "37": [0.05556, 0.75, 0.13639, 0], + "38": [0, 0.69444, 0.09694, 0], + "39": [0, 0.69444, 0.12417, 0], + "40": [0.25, 0.75, 0.16194, 0], + "41": [0.25, 0.75, 0.03694, 0], + "42": [0, 0.75, 0.14917, 0], + "43": [0.05667, 0.56167, 0.03694, 0], + "44": [0.19444, 0.10556, 0, 0], + "45": [0, 0.43056, 0.02826, 0], + "46": [0, 0.10556, 0, 0], + "47": [0.25, 0.75, 0.16194, 0], + "48": [0, 0.64444, 0.13556, 0], + "49": [0, 0.64444, 0.13556, 0], + "50": [0, 0.64444, 0.13556, 0], + "51": [0, 0.64444, 0.13556, 0], + "52": [0.19444, 0.64444, 0.13556, 0], + "53": [0, 0.64444, 0.13556, 0], + "54": [0, 0.64444, 0.13556, 0], + "55": [0.19444, 0.64444, 0.13556, 0], + "56": [0, 0.64444, 0.13556, 0], + "57": [0, 0.64444, 0.13556, 0], + "58": [0, 0.43056, 0.0582, 0], + "59": [0.19444, 0.43056, 0.0582, 0], + "61": [-0.13313, 0.36687, 0.06616, 0], + "63": [0, 0.69444, 0.1225, 0], + "64": [0, 0.69444, 0.09597, 0], + "65": [0, 0.68333, 0, 0], + "66": [0, 0.68333, 0.10257, 0], + "67": [0, 0.68333, 0.14528, 0], + "68": [0, 0.68333, 0.09403, 0], + "69": [0, 0.68333, 0.12028, 0], + "70": [0, 0.68333, 0.13305, 0], + "71": [0, 0.68333, 0.08722, 0], + "72": [0, 0.68333, 0.16389, 0], + "73": [0, 0.68333, 0.15806, 0], + "74": [0, 0.68333, 0.14028, 0], + "75": [0, 0.68333, 0.14528, 0], + "76": [0, 0.68333, 0, 0], + "77": [0, 0.68333, 0.16389, 0], + "78": [0, 0.68333, 0.16389, 0], + "79": [0, 0.68333, 0.09403, 0], + "80": [0, 0.68333, 0.10257, 0], + "81": [0.19444, 0.68333, 0.09403, 0], + "82": [0, 0.68333, 0.03868, 0], + "83": [0, 0.68333, 0.11972, 0], + "84": [0, 0.68333, 0.13305, 0], + "85": [0, 0.68333, 0.16389, 0], + "86": [0, 0.68333, 0.18361, 0], + "87": [0, 0.68333, 0.18361, 0], + "88": [0, 0.68333, 0.15806, 0], + "89": [0, 0.68333, 0.19383, 0], + "90": [0, 0.68333, 0.14528, 0], + "91": [0.25, 0.75, 0.1875, 0], + "93": [0.25, 0.75, 0.10528, 0], + "94": [0, 0.69444, 0.06646, 0], + "95": [0.31, 0.12056, 0.09208, 0], + "97": [0, 0.43056, 0.07671, 0], + "98": [0, 0.69444, 0.06312, 0], + "99": [0, 0.43056, 0.05653, 0], + "100": [0, 0.69444, 0.10333, 0], + "101": [0, 0.43056, 0.07514, 0], + "102": [0.19444, 0.69444, 0.21194, 0], + "103": [0.19444, 0.43056, 0.08847, 0], + "104": [0, 0.69444, 0.07671, 0], + "105": [0, 0.65536, 0.1019, 0], + "106": [0.19444, 0.65536, 0.14467, 0], + "107": [0, 0.69444, 0.10764, 0], + "108": [0, 0.69444, 0.10333, 0], + "109": [0, 0.43056, 0.07671, 0], + "110": [0, 0.43056, 0.07671, 0], + "111": [0, 0.43056, 0.06312, 0], + "112": [0.19444, 0.43056, 0.06312, 0], + "113": [0.19444, 0.43056, 0.08847, 0], + "114": [0, 0.43056, 0.10764, 0], + "115": [0, 0.43056, 0.08208, 0], + "116": [0, 0.61508, 0.09486, 0], + "117": [0, 0.43056, 0.07671, 0], + "118": [0, 0.43056, 0.10764, 0], + "119": [0, 0.43056, 0.10764, 0], + "120": [0, 0.43056, 0.12042, 0], + "121": [0.19444, 0.43056, 0.08847, 0], + "122": [0, 0.43056, 0.12292, 0], + "126": [0.35, 0.31786, 0.11585, 0], + "163": [0, 0.69444, 0, 0], + "305": [0, 0.43056, 0, 0.02778], + "567": [0.19444, 0.43056, 0, 0.08334], + "768": [0, 0.69444, 0, 0], + "769": [0, 0.69444, 0.09694, 0], + "770": [0, 0.69444, 0.06646, 0], + "771": [0, 0.66786, 0.11585, 0], + "772": [0, 0.56167, 0.10333, 0], + "774": [0, 0.69444, 0.10806, 0], + "775": [0, 0.66786, 0.11752, 0], + "776": [0, 0.66786, 0.10474, 0], + "778": [0, 0.69444, 0, 0], + "779": [0, 0.69444, 0.1225, 0], + "780": [0, 0.62847, 0.08295, 0], + "915": [0, 0.68333, 0.13305, 0], + "916": [0, 0.68333, 0, 0], + "920": [0, 0.68333, 0.09403, 0], + "923": [0, 0.68333, 0, 0], + "926": [0, 0.68333, 0.15294, 0], + "928": [0, 0.68333, 0.16389, 0], + "931": [0, 0.68333, 0.12028, 0], + "933": [0, 0.68333, 0.11111, 0], + "934": [0, 0.68333, 0.05986, 0], + "936": [0, 0.68333, 0.11111, 0], + "937": [0, 0.68333, 0.10257, 0], + "8211": [0, 0.43056, 0.09208, 0], + "8212": [0, 0.43056, 0.09208, 0], + "8216": [0, 0.69444, 0.12417, 0], + "8217": [0, 0.69444, 0.12417, 0], + "8220": [0, 0.69444, 0.1685, 0], + "8221": [0, 0.69444, 0.06961, 0], + "8463": [0, 0.68889, 0, 0] + }, + "Main-Regular": { + "32": [0, 0, 0, 0], + "33": [0, 0.69444, 0, 0], + "34": [0, 0.69444, 0, 0], + "35": [0.19444, 0.69444, 0, 0], + "36": [0.05556, 0.75, 0, 0], + "37": [0.05556, 0.75, 0, 0], + "38": [0, 0.69444, 0, 0], + "39": [0, 0.69444, 0, 0], + "40": [0.25, 0.75, 0, 0], + "41": [0.25, 0.75, 0, 0], + "42": [0, 0.75, 0, 0], + "43": [0.08333, 0.58333, 0, 0], + "44": [0.19444, 0.10556, 0, 0], + "45": [0, 0.43056, 0, 0], + "46": [0, 0.10556, 0, 0], + "47": [0.25, 0.75, 0, 0], + "48": [0, 0.64444, 0, 0], + "49": [0, 0.64444, 0, 0], + "50": [0, 0.64444, 0, 0], + "51": [0, 0.64444, 0, 0], + "52": [0, 0.64444, 0, 0], + "53": [0, 0.64444, 0, 0], + "54": [0, 0.64444, 0, 0], + "55": [0, 0.64444, 0, 0], + "56": [0, 0.64444, 0, 0], + "57": [0, 0.64444, 0, 0], + "58": [0, 0.43056, 0, 0], + "59": [0.19444, 0.43056, 0, 0], + "60": [0.0391, 0.5391, 0, 0], + "61": [-0.13313, 0.36687, 0, 0], + "62": [0.0391, 0.5391, 0, 0], + "63": [0, 0.69444, 0, 0], + "64": [0, 0.69444, 0, 0], + "65": [0, 0.68333, 0, 0], + "66": [0, 0.68333, 0, 0], + "67": [0, 0.68333, 0, 0], + "68": [0, 0.68333, 0, 0], + "69": [0, 0.68333, 0, 0], + "70": [0, 0.68333, 0, 0], + "71": [0, 0.68333, 0, 0], + "72": [0, 0.68333, 0, 0], + "73": [0, 0.68333, 0, 0], + "74": [0, 0.68333, 0, 0], + "75": [0, 0.68333, 0, 0], + "76": [0, 0.68333, 0, 0], + "77": [0, 0.68333, 0, 0], + "78": [0, 0.68333, 0, 0], + "79": [0, 0.68333, 0, 0], + "80": [0, 0.68333, 0, 0], + "81": [0.19444, 0.68333, 0, 0], + "82": [0, 0.68333, 0, 0], + "83": [0, 0.68333, 0, 0], + "84": [0, 0.68333, 0, 0], + "85": [0, 0.68333, 0, 0], + "86": [0, 0.68333, 0.01389, 0], + "87": [0, 0.68333, 0.01389, 0], + "88": [0, 0.68333, 0, 0], + "89": [0, 0.68333, 0.025, 0], + "90": [0, 0.68333, 0, 0], + "91": [0.25, 0.75, 0, 0], + "92": [0.25, 0.75, 0, 0], + "93": [0.25, 0.75, 0, 0], + "94": [0, 0.69444, 0, 0], + "95": [0.31, 0.12056, 0.02778, 0], + "96": [0, 0.69444, 0, 0], + "97": [0, 0.43056, 0, 0], + "98": [0, 0.69444, 0, 0], + "99": [0, 0.43056, 0, 0], + "100": [0, 0.69444, 0, 0], + "101": [0, 0.43056, 0, 0], + "102": [0, 0.69444, 0.07778, 0], + "103": [0.19444, 0.43056, 0.01389, 0], + "104": [0, 0.69444, 0, 0], + "105": [0, 0.66786, 0, 0], + "106": [0.19444, 0.66786, 0, 0], + "107": [0, 0.69444, 0, 0], + "108": [0, 0.69444, 0, 0], + "109": [0, 0.43056, 0, 0], + "110": [0, 0.43056, 0, 0], + "111": [0, 0.43056, 0, 0], + "112": [0.19444, 0.43056, 0, 0], + "113": [0.19444, 0.43056, 0, 0], + "114": [0, 0.43056, 0, 0], + "115": [0, 0.43056, 0, 0], + "116": [0, 0.61508, 0, 0], + "117": [0, 0.43056, 0, 0], + "118": [0, 0.43056, 0.01389, 0], + "119": [0, 0.43056, 0.01389, 0], + "120": [0, 0.43056, 0, 0], + "121": [0.19444, 0.43056, 0.01389, 0], + "122": [0, 0.43056, 0, 0], + "123": [0.25, 0.75, 0, 0], + "124": [0.25, 0.75, 0, 0], + "125": [0.25, 0.75, 0, 0], + "126": [0.35, 0.31786, 0, 0], + "160": [0, 0, 0, 0], + "168": [0, 0.66786, 0, 0], + "172": [0, 0.43056, 0, 0], + "175": [0, 0.56778, 0, 0], + "176": [0, 0.69444, 0, 0], + "177": [0.08333, 0.58333, 0, 0], + "180": [0, 0.69444, 0, 0], + "215": [0.08333, 0.58333, 0, 0], + "247": [0.08333, 0.58333, 0, 0], + "305": [0, 0.43056, 0, 0], + "567": [0.19444, 0.43056, 0, 0], + "710": [0, 0.69444, 0, 0], + "711": [0, 0.62847, 0, 0], + "713": [0, 0.56778, 0, 0], + "714": [0, 0.69444, 0, 0], + "715": [0, 0.69444, 0, 0], + "728": [0, 0.69444, 0, 0], + "729": [0, 0.66786, 0, 0], + "730": [0, 0.69444, 0, 0], + "732": [0, 0.66786, 0, 0], + "768": [0, 0.69444, 0, 0], + "769": [0, 0.69444, 0, 0], + "770": [0, 0.69444, 0, 0], + "771": [0, 0.66786, 0, 0], + "772": [0, 0.56778, 0, 0], + "774": [0, 0.69444, 0, 0], + "775": [0, 0.66786, 0, 0], + "776": [0, 0.66786, 0, 0], + "778": [0, 0.69444, 0, 0], + "779": [0, 0.69444, 0, 0], + "780": [0, 0.62847, 0, 0], + "824": [0.19444, 0.69444, 0, 0], + "915": [0, 0.68333, 0, 0], + "916": [0, 0.68333, 0, 0], + "920": [0, 0.68333, 0, 0], + "923": [0, 0.68333, 0, 0], + "926": [0, 0.68333, 0, 0], + "928": [0, 0.68333, 0, 0], + "931": [0, 0.68333, 0, 0], + "933": [0, 0.68333, 0, 0], + "934": [0, 0.68333, 0, 0], + "936": [0, 0.68333, 0, 0], + "937": [0, 0.68333, 0, 0], + "8211": [0, 0.43056, 0.02778, 0], + "8212": [0, 0.43056, 0.02778, 0], + "8216": [0, 0.69444, 0, 0], + "8217": [0, 0.69444, 0, 0], + "8220": [0, 0.69444, 0, 0], + "8221": [0, 0.69444, 0, 0], + "8224": [0.19444, 0.69444, 0, 0], + "8225": [0.19444, 0.69444, 0, 0], + "8230": [0, 0.12, 0, 0], + "8242": [0, 0.55556, 0, 0], + "8407": [0, 0.71444, 0.15382, 0], + "8463": [0, 0.68889, 0, 0], + "8465": [0, 0.69444, 0, 0], + "8467": [0, 0.69444, 0, 0.11111], + "8472": [0.19444, 0.43056, 0, 0.11111], + "8476": [0, 0.69444, 0, 0], + "8501": [0, 0.69444, 0, 0], + "8592": [-0.13313, 0.36687, 0, 0], + "8593": [0.19444, 0.69444, 0, 0], + "8594": [-0.13313, 0.36687, 0, 0], + "8595": [0.19444, 0.69444, 0, 0], + "8596": [-0.13313, 0.36687, 0, 0], + "8597": [0.25, 0.75, 0, 0], + "8598": [0.19444, 0.69444, 0, 0], + "8599": [0.19444, 0.69444, 0, 0], + "8600": [0.19444, 0.69444, 0, 0], + "8601": [0.19444, 0.69444, 0, 0], + "8614": [0.011, 0.511, 0, 0], + "8617": [0.011, 0.511, 0, 0], + "8618": [0.011, 0.511, 0, 0], + "8636": [-0.13313, 0.36687, 0, 0], + "8637": [-0.13313, 0.36687, 0, 0], + "8640": [-0.13313, 0.36687, 0, 0], + "8641": [-0.13313, 0.36687, 0, 0], + "8652": [0.011, 0.671, 0, 0], + "8656": [-0.13313, 0.36687, 0, 0], + "8657": [0.19444, 0.69444, 0, 0], + "8658": [-0.13313, 0.36687, 0, 0], + "8659": [0.19444, 0.69444, 0, 0], + "8660": [-0.13313, 0.36687, 0, 0], + "8661": [0.25, 0.75, 0, 0], + "8704": [0, 0.69444, 0, 0], + "8706": [0, 0.69444, 0.05556, 0.08334], + "8707": [0, 0.69444, 0, 0], + "8709": [0.05556, 0.75, 0, 0], + "8711": [0, 0.68333, 0, 0], + "8712": [0.0391, 0.5391, 0, 0], + "8715": [0.0391, 0.5391, 0, 0], + "8722": [0.08333, 0.58333, 0, 0], + "8723": [0.08333, 0.58333, 0, 0], + "8725": [0.25, 0.75, 0, 0], + "8726": [0.25, 0.75, 0, 0], + "8727": [-0.03472, 0.46528, 0, 0], + "8728": [-0.05555, 0.44445, 0, 0], + "8729": [-0.05555, 0.44445, 0, 0], + "8730": [0.2, 0.8, 0, 0], + "8733": [0, 0.43056, 0, 0], + "8734": [0, 0.43056, 0, 0], + "8736": [0, 0.69224, 0, 0], + "8739": [0.25, 0.75, 0, 0], + "8741": [0.25, 0.75, 0, 0], + "8743": [0, 0.55556, 0, 0], + "8744": [0, 0.55556, 0, 0], + "8745": [0, 0.55556, 0, 0], + "8746": [0, 0.55556, 0, 0], + "8747": [0.19444, 0.69444, 0.11111, 0], + "8764": [-0.13313, 0.36687, 0, 0], + "8768": [0.19444, 0.69444, 0, 0], + "8771": [-0.03625, 0.46375, 0, 0], + "8773": [-0.022, 0.589, 0, 0], + "8776": [-0.01688, 0.48312, 0, 0], + "8781": [-0.03625, 0.46375, 0, 0], + "8784": [-0.133, 0.67, 0, 0], + "8800": [0.215, 0.716, 0, 0], + "8801": [-0.03625, 0.46375, 0, 0], + "8804": [0.13597, 0.63597, 0, 0], + "8805": [0.13597, 0.63597, 0, 0], + "8810": [0.0391, 0.5391, 0, 0], + "8811": [0.0391, 0.5391, 0, 0], + "8826": [0.0391, 0.5391, 0, 0], + "8827": [0.0391, 0.5391, 0, 0], + "8834": [0.0391, 0.5391, 0, 0], + "8835": [0.0391, 0.5391, 0, 0], + "8838": [0.13597, 0.63597, 0, 0], + "8839": [0.13597, 0.63597, 0, 0], + "8846": [0, 0.55556, 0, 0], + "8849": [0.13597, 0.63597, 0, 0], + "8850": [0.13597, 0.63597, 0, 0], + "8851": [0, 0.55556, 0, 0], + "8852": [0, 0.55556, 0, 0], + "8853": [0.08333, 0.58333, 0, 0], + "8854": [0.08333, 0.58333, 0, 0], + "8855": [0.08333, 0.58333, 0, 0], + "8856": [0.08333, 0.58333, 0, 0], + "8857": [0.08333, 0.58333, 0, 0], + "8866": [0, 0.69444, 0, 0], + "8867": [0, 0.69444, 0, 0], + "8868": [0, 0.69444, 0, 0], + "8869": [0, 0.69444, 0, 0], + "8872": [0.249, 0.75, 0, 0], + "8900": [-0.05555, 0.44445, 0, 0], + "8901": [-0.05555, 0.44445, 0, 0], + "8902": [-0.03472, 0.46528, 0, 0], + "8904": [0.005, 0.505, 0, 0], + "8942": [0.03, 0.9, 0, 0], + "8943": [-0.19, 0.31, 0, 0], + "8945": [-0.1, 0.82, 0, 0], + "8968": [0.25, 0.75, 0, 0], + "8969": [0.25, 0.75, 0, 0], + "8970": [0.25, 0.75, 0, 0], + "8971": [0.25, 0.75, 0, 0], + "8994": [-0.14236, 0.35764, 0, 0], + "8995": [-0.14236, 0.35764, 0, 0], + "9136": [0.244, 0.744, 0, 0], + "9137": [0.244, 0.744, 0, 0], + "9651": [0.19444, 0.69444, 0, 0], + "9657": [-0.03472, 0.46528, 0, 0], + "9661": [0.19444, 0.69444, 0, 0], + "9667": [-0.03472, 0.46528, 0, 0], + "9711": [0.19444, 0.69444, 0, 0], + "9824": [0.12963, 0.69444, 0, 0], + "9825": [0.12963, 0.69444, 0, 0], + "9826": [0.12963, 0.69444, 0, 0], + "9827": [0.12963, 0.69444, 0, 0], + "9837": [0, 0.75, 0, 0], + "9838": [0.19444, 0.69444, 0, 0], + "9839": [0.19444, 0.69444, 0, 0], + "10216": [0.25, 0.75, 0, 0], + "10217": [0.25, 0.75, 0, 0], + "10222": [0.244, 0.744, 0, 0], + "10223": [0.244, 0.744, 0, 0], + "10229": [0.011, 0.511, 0, 0], + "10230": [0.011, 0.511, 0, 0], + "10231": [0.011, 0.511, 0, 0], + "10232": [0.024, 0.525, 0, 0], + "10233": [0.024, 0.525, 0, 0], + "10234": [0.024, 0.525, 0, 0], + "10236": [0.011, 0.511, 0, 0], + "10815": [0, 0.68333, 0, 0], + "10927": [0.13597, 0.63597, 0, 0], + "10928": [0.13597, 0.63597, 0, 0] + }, + "Math-BoldItalic": { + "47": [0.19444, 0.69444, 0, 0], + "65": [0, 0.68611, 0, 0], + "66": [0, 0.68611, 0.04835, 0], + "67": [0, 0.68611, 0.06979, 0], + "68": [0, 0.68611, 0.03194, 0], + "69": [0, 0.68611, 0.05451, 0], + "70": [0, 0.68611, 0.15972, 0], + "71": [0, 0.68611, 0, 0], + "72": [0, 0.68611, 0.08229, 0], + "73": [0, 0.68611, 0.07778, 0], + "74": [0, 0.68611, 0.10069, 0], + "75": [0, 0.68611, 0.06979, 0], + "76": [0, 0.68611, 0, 0], + "77": [0, 0.68611, 0.11424, 0], + "78": [0, 0.68611, 0.11424, 0], + "79": [0, 0.68611, 0.03194, 0], + "80": [0, 0.68611, 0.15972, 0], + "81": [0.19444, 0.68611, 0, 0], + "82": [0, 0.68611, 0.00421, 0], + "83": [0, 0.68611, 0.05382, 0], + "84": [0, 0.68611, 0.15972, 0], + "85": [0, 0.68611, 0.11424, 0], + "86": [0, 0.68611, 0.25555, 0], + "87": [0, 0.68611, 0.15972, 0], + "88": [0, 0.68611, 0.07778, 0], + "89": [0, 0.68611, 0.25555, 0], + "90": [0, 0.68611, 0.06979, 0], + "97": [0, 0.44444, 0, 0], + "98": [0, 0.69444, 0, 0], + "99": [0, 0.44444, 0, 0], + "100": [0, 0.69444, 0, 0], + "101": [0, 0.44444, 0, 0], + "102": [0.19444, 0.69444, 0.11042, 0], + "103": [0.19444, 0.44444, 0.03704, 0], + "104": [0, 0.69444, 0, 0], + "105": [0, 0.69326, 0, 0], + "106": [0.19444, 0.69326, 0.0622, 0], + "107": [0, 0.69444, 0.01852, 0], + "108": [0, 0.69444, 0.0088, 0], + "109": [0, 0.44444, 0, 0], + "110": [0, 0.44444, 0, 0], + "111": [0, 0.44444, 0, 0], + "112": [0.19444, 0.44444, 0, 0], + "113": [0.19444, 0.44444, 0.03704, 0], + "114": [0, 0.44444, 0.03194, 0], + "115": [0, 0.44444, 0, 0], + "116": [0, 0.63492, 0, 0], + "117": [0, 0.44444, 0, 0], + "118": [0, 0.44444, 0.03704, 0], + "119": [0, 0.44444, 0.02778, 0], + "120": [0, 0.44444, 0, 0], + "121": [0.19444, 0.44444, 0.03704, 0], + "122": [0, 0.44444, 0.04213, 0], + "915": [0, 0.68611, 0.15972, 0], + "916": [0, 0.68611, 0, 0], + "920": [0, 0.68611, 0.03194, 0], + "923": [0, 0.68611, 0, 0], + "926": [0, 0.68611, 0.07458, 0], + "928": [0, 0.68611, 0.08229, 0], + "931": [0, 0.68611, 0.05451, 0], + "933": [0, 0.68611, 0.15972, 0], + "934": [0, 0.68611, 0, 0], + "936": [0, 0.68611, 0.11653, 0], + "937": [0, 0.68611, 0.04835, 0], + "945": [0, 0.44444, 0, 0], + "946": [0.19444, 0.69444, 0.03403, 0], + "947": [0.19444, 0.44444, 0.06389, 0], + "948": [0, 0.69444, 0.03819, 0], + "949": [0, 0.44444, 0, 0], + "950": [0.19444, 0.69444, 0.06215, 0], + "951": [0.19444, 0.44444, 0.03704, 0], + "952": [0, 0.69444, 0.03194, 0], + "953": [0, 0.44444, 0, 0], + "954": [0, 0.44444, 0, 0], + "955": [0, 0.69444, 0, 0], + "956": [0.19444, 0.44444, 0, 0], + "957": [0, 0.44444, 0.06898, 0], + "958": [0.19444, 0.69444, 0.03021, 0], + "959": [0, 0.44444, 0, 0], + "960": [0, 0.44444, 0.03704, 0], + "961": [0.19444, 0.44444, 0, 0], + "962": [0.09722, 0.44444, 0.07917, 0], + "963": [0, 0.44444, 0.03704, 0], + "964": [0, 0.44444, 0.13472, 0], + "965": [0, 0.44444, 0.03704, 0], + "966": [0.19444, 0.44444, 0, 0], + "967": [0.19444, 0.44444, 0, 0], + "968": [0.19444, 0.69444, 0.03704, 0], + "969": [0, 0.44444, 0.03704, 0], + "977": [0, 0.69444, 0, 0], + "981": [0.19444, 0.69444, 0, 0], + "982": [0, 0.44444, 0.03194, 0], + "1009": [0.19444, 0.44444, 0, 0], + "1013": [0, 0.44444, 0, 0] + }, + "Math-Italic": { + "47": [0.19444, 0.69444, 0, 0], + "65": [0, 0.68333, 0, 0.13889], + "66": [0, 0.68333, 0.05017, 0.08334], + "67": [0, 0.68333, 0.07153, 0.08334], + "68": [0, 0.68333, 0.02778, 0.05556], + "69": [0, 0.68333, 0.05764, 0.08334], + "70": [0, 0.68333, 0.13889, 0.08334], + "71": [0, 0.68333, 0, 0.08334], + "72": [0, 0.68333, 0.08125, 0.05556], + "73": [0, 0.68333, 0.07847, 0.11111], + "74": [0, 0.68333, 0.09618, 0.16667], + "75": [0, 0.68333, 0.07153, 0.05556], + "76": [0, 0.68333, 0, 0.02778], + "77": [0, 0.68333, 0.10903, 0.08334], + "78": [0, 0.68333, 0.10903, 0.08334], + "79": [0, 0.68333, 0.02778, 0.08334], + "80": [0, 0.68333, 0.13889, 0.08334], + "81": [0.19444, 0.68333, 0, 0.08334], + "82": [0, 0.68333, 0.00773, 0.08334], + "83": [0, 0.68333, 0.05764, 0.08334], + "84": [0, 0.68333, 0.13889, 0.08334], + "85": [0, 0.68333, 0.10903, 0.02778], + "86": [0, 0.68333, 0.22222, 0], + "87": [0, 0.68333, 0.13889, 0], + "88": [0, 0.68333, 0.07847, 0.08334], + "89": [0, 0.68333, 0.22222, 0], + "90": [0, 0.68333, 0.07153, 0.08334], + "97": [0, 0.43056, 0, 0], + "98": [0, 0.69444, 0, 0], + "99": [0, 0.43056, 0, 0.05556], + "100": [0, 0.69444, 0, 0.16667], + "101": [0, 0.43056, 0, 0.05556], + "102": [0.19444, 0.69444, 0.10764, 0.16667], + "103": [0.19444, 0.43056, 0.03588, 0.02778], + "104": [0, 0.69444, 0, 0], + "105": [0, 0.65952, 0, 0], + "106": [0.19444, 0.65952, 0.05724, 0], + "107": [0, 0.69444, 0.03148, 0], + "108": [0, 0.69444, 0.01968, 0.08334], + "109": [0, 0.43056, 0, 0], + "110": [0, 0.43056, 0, 0], + "111": [0, 0.43056, 0, 0.05556], + "112": [0.19444, 0.43056, 0, 0.08334], + "113": [0.19444, 0.43056, 0.03588, 0.08334], + "114": [0, 0.43056, 0.02778, 0.05556], + "115": [0, 0.43056, 0, 0.05556], + "116": [0, 0.61508, 0, 0.08334], + "117": [0, 0.43056, 0, 0.02778], + "118": [0, 0.43056, 0.03588, 0.02778], + "119": [0, 0.43056, 0.02691, 0.08334], + "120": [0, 0.43056, 0, 0.02778], + "121": [0.19444, 0.43056, 0.03588, 0.05556], + "122": [0, 0.43056, 0.04398, 0.05556], + "915": [0, 0.68333, 0.13889, 0.08334], + "916": [0, 0.68333, 0, 0.16667], + "920": [0, 0.68333, 0.02778, 0.08334], + "923": [0, 0.68333, 0, 0.16667], + "926": [0, 0.68333, 0.07569, 0.08334], + "928": [0, 0.68333, 0.08125, 0.05556], + "931": [0, 0.68333, 0.05764, 0.08334], + "933": [0, 0.68333, 0.13889, 0.05556], + "934": [0, 0.68333, 0, 0.08334], + "936": [0, 0.68333, 0.11, 0.05556], + "937": [0, 0.68333, 0.05017, 0.08334], + "945": [0, 0.43056, 0.0037, 0.02778], + "946": [0.19444, 0.69444, 0.05278, 0.08334], + "947": [0.19444, 0.43056, 0.05556, 0], + "948": [0, 0.69444, 0.03785, 0.05556], + "949": [0, 0.43056, 0, 0.08334], + "950": [0.19444, 0.69444, 0.07378, 0.08334], + "951": [0.19444, 0.43056, 0.03588, 0.05556], + "952": [0, 0.69444, 0.02778, 0.08334], + "953": [0, 0.43056, 0, 0.05556], + "954": [0, 0.43056, 0, 0], + "955": [0, 0.69444, 0, 0], + "956": [0.19444, 0.43056, 0, 0.02778], + "957": [0, 0.43056, 0.06366, 0.02778], + "958": [0.19444, 0.69444, 0.04601, 0.11111], + "959": [0, 0.43056, 0, 0.05556], + "960": [0, 0.43056, 0.03588, 0], + "961": [0.19444, 0.43056, 0, 0.08334], + "962": [0.09722, 0.43056, 0.07986, 0.08334], + "963": [0, 0.43056, 0.03588, 0], + "964": [0, 0.43056, 0.1132, 0.02778], + "965": [0, 0.43056, 0.03588, 0.02778], + "966": [0.19444, 0.43056, 0, 0.08334], + "967": [0.19444, 0.43056, 0, 0.05556], + "968": [0.19444, 0.69444, 0.03588, 0.11111], + "969": [0, 0.43056, 0.03588, 0], + "977": [0, 0.69444, 0, 0.08334], + "981": [0.19444, 0.69444, 0, 0.08334], + "982": [0, 0.43056, 0.02778, 0], + "1009": [0.19444, 0.43056, 0, 0.08334], + "1013": [0, 0.43056, 0, 0.05556] + }, + "Math-Regular": { + "65": [0, 0.68333, 0, 0.13889], + "66": [0, 0.68333, 0.05017, 0.08334], + "67": [0, 0.68333, 0.07153, 0.08334], + "68": [0, 0.68333, 0.02778, 0.05556], + "69": [0, 0.68333, 0.05764, 0.08334], + "70": [0, 0.68333, 0.13889, 0.08334], + "71": [0, 0.68333, 0, 0.08334], + "72": [0, 0.68333, 0.08125, 0.05556], + "73": [0, 0.68333, 0.07847, 0.11111], + "74": [0, 0.68333, 0.09618, 0.16667], + "75": [0, 0.68333, 0.07153, 0.05556], + "76": [0, 0.68333, 0, 0.02778], + "77": [0, 0.68333, 0.10903, 0.08334], + "78": [0, 0.68333, 0.10903, 0.08334], + "79": [0, 0.68333, 0.02778, 0.08334], + "80": [0, 0.68333, 0.13889, 0.08334], + "81": [0.19444, 0.68333, 0, 0.08334], + "82": [0, 0.68333, 0.00773, 0.08334], + "83": [0, 0.68333, 0.05764, 0.08334], + "84": [0, 0.68333, 0.13889, 0.08334], + "85": [0, 0.68333, 0.10903, 0.02778], + "86": [0, 0.68333, 0.22222, 0], + "87": [0, 0.68333, 0.13889, 0], + "88": [0, 0.68333, 0.07847, 0.08334], + "89": [0, 0.68333, 0.22222, 0], + "90": [0, 0.68333, 0.07153, 0.08334], + "97": [0, 0.43056, 0, 0], + "98": [0, 0.69444, 0, 0], + "99": [0, 0.43056, 0, 0.05556], + "100": [0, 0.69444, 0, 0.16667], + "101": [0, 0.43056, 0, 0.05556], + "102": [0.19444, 0.69444, 0.10764, 0.16667], + "103": [0.19444, 0.43056, 0.03588, 0.02778], + "104": [0, 0.69444, 0, 0], + "105": [0, 0.65952, 0, 0], + "106": [0.19444, 0.65952, 0.05724, 0], + "107": [0, 0.69444, 0.03148, 0], + "108": [0, 0.69444, 0.01968, 0.08334], + "109": [0, 0.43056, 0, 0], + "110": [0, 0.43056, 0, 0], + "111": [0, 0.43056, 0, 0.05556], + "112": [0.19444, 0.43056, 0, 0.08334], + "113": [0.19444, 0.43056, 0.03588, 0.08334], + "114": [0, 0.43056, 0.02778, 0.05556], + "115": [0, 0.43056, 0, 0.05556], + "116": [0, 0.61508, 0, 0.08334], + "117": [0, 0.43056, 0, 0.02778], + "118": [0, 0.43056, 0.03588, 0.02778], + "119": [0, 0.43056, 0.02691, 0.08334], + "120": [0, 0.43056, 0, 0.02778], + "121": [0.19444, 0.43056, 0.03588, 0.05556], + "122": [0, 0.43056, 0.04398, 0.05556], + "915": [0, 0.68333, 0.13889, 0.08334], + "916": [0, 0.68333, 0, 0.16667], + "920": [0, 0.68333, 0.02778, 0.08334], + "923": [0, 0.68333, 0, 0.16667], + "926": [0, 0.68333, 0.07569, 0.08334], + "928": [0, 0.68333, 0.08125, 0.05556], + "931": [0, 0.68333, 0.05764, 0.08334], + "933": [0, 0.68333, 0.13889, 0.05556], + "934": [0, 0.68333, 0, 0.08334], + "936": [0, 0.68333, 0.11, 0.05556], + "937": [0, 0.68333, 0.05017, 0.08334], + "945": [0, 0.43056, 0.0037, 0.02778], + "946": [0.19444, 0.69444, 0.05278, 0.08334], + "947": [0.19444, 0.43056, 0.05556, 0], + "948": [0, 0.69444, 0.03785, 0.05556], + "949": [0, 0.43056, 0, 0.08334], + "950": [0.19444, 0.69444, 0.07378, 0.08334], + "951": [0.19444, 0.43056, 0.03588, 0.05556], + "952": [0, 0.69444, 0.02778, 0.08334], + "953": [0, 0.43056, 0, 0.05556], + "954": [0, 0.43056, 0, 0], + "955": [0, 0.69444, 0, 0], + "956": [0.19444, 0.43056, 0, 0.02778], + "957": [0, 0.43056, 0.06366, 0.02778], + "958": [0.19444, 0.69444, 0.04601, 0.11111], + "959": [0, 0.43056, 0, 0.05556], + "960": [0, 0.43056, 0.03588, 0], + "961": [0.19444, 0.43056, 0, 0.08334], + "962": [0.09722, 0.43056, 0.07986, 0.08334], + "963": [0, 0.43056, 0.03588, 0], + "964": [0, 0.43056, 0.1132, 0.02778], + "965": [0, 0.43056, 0.03588, 0.02778], + "966": [0.19444, 0.43056, 0, 0.08334], + "967": [0.19444, 0.43056, 0, 0.05556], + "968": [0.19444, 0.69444, 0.03588, 0.11111], + "969": [0, 0.43056, 0.03588, 0], + "977": [0, 0.69444, 0, 0.08334], + "981": [0.19444, 0.69444, 0, 0.08334], + "982": [0, 0.43056, 0.02778, 0], + "1009": [0.19444, 0.43056, 0, 0.08334], + "1013": [0, 0.43056, 0, 0.05556] + }, + "SansSerif-Regular": { + "33": [0, 0.69444, 0, 0], + "34": [0, 0.69444, 0, 0], + "35": [0.19444, 0.69444, 0, 0], + "36": [0.05556, 0.75, 0, 0], + "37": [0.05556, 0.75, 0, 0], + "38": [0, 0.69444, 0, 0], + "39": [0, 0.69444, 0, 0], + "40": [0.25, 0.75, 0, 0], + "41": [0.25, 0.75, 0, 0], + "42": [0, 0.75, 0, 0], + "43": [0.08333, 0.58333, 0, 0], + "44": [0.125, 0.08333, 0, 0], + "45": [0, 0.44444, 0, 0], + "46": [0, 0.08333, 0, 0], + "47": [0.25, 0.75, 0, 0], + "48": [0, 0.65556, 0, 0], + "49": [0, 0.65556, 0, 0], + "50": [0, 0.65556, 0, 0], + "51": [0, 0.65556, 0, 0], + "52": [0, 0.65556, 0, 0], + "53": [0, 0.65556, 0, 0], + "54": [0, 0.65556, 0, 0], + "55": [0, 0.65556, 0, 0], + "56": [0, 0.65556, 0, 0], + "57": [0, 0.65556, 0, 0], + "58": [0, 0.44444, 0, 0], + "59": [0.125, 0.44444, 0, 0], + "61": [-0.13, 0.37, 0, 0], + "63": [0, 0.69444, 0, 0], + "64": [0, 0.69444, 0, 0], + "65": [0, 0.69444, 0, 0], + "66": [0, 0.69444, 0, 0], + "67": [0, 0.69444, 0, 0], + "68": [0, 0.69444, 0, 0], + "69": [0, 0.69444, 0, 0], + "70": [0, 0.69444, 0, 0], + "71": [0, 0.69444, 0, 0], + "72": [0, 0.69444, 0, 0], + "73": [0, 0.69444, 0, 0], + "74": [0, 0.69444, 0, 0], + "75": [0, 0.69444, 0, 0], + "76": [0, 0.69444, 0, 0], + "77": [0, 0.69444, 0, 0], + "78": [0, 0.69444, 0, 0], + "79": [0, 0.69444, 0, 0], + "80": [0, 0.69444, 0, 0], + "81": [0.125, 0.69444, 0, 0], + "82": [0, 0.69444, 0, 0], + "83": [0, 0.69444, 0, 0], + "84": [0, 0.69444, 0, 0], + "85": [0, 0.69444, 0, 0], + "86": [0, 0.69444, 0.01389, 0], + "87": [0, 0.69444, 0.01389, 0], + "88": [0, 0.69444, 0, 0], + "89": [0, 0.69444, 0.025, 0], + "90": [0, 0.69444, 0, 0], + "91": [0.25, 0.75, 0, 0], + "93": [0.25, 0.75, 0, 0], + "94": [0, 0.69444, 0, 0], + "95": [0.35, 0.09444, 0.02778, 0], + "97": [0, 0.44444, 0, 0], + "98": [0, 0.69444, 0, 0], + "99": [0, 0.44444, 0, 0], + "100": [0, 0.69444, 0, 0], + "101": [0, 0.44444, 0, 0], + "102": [0, 0.69444, 0.06944, 0], + "103": [0.19444, 0.44444, 0.01389, 0], + "104": [0, 0.69444, 0, 0], + "105": [0, 0.67937, 0, 0], + "106": [0.19444, 0.67937, 0, 0], + "107": [0, 0.69444, 0, 0], + "108": [0, 0.69444, 0, 0], + "109": [0, 0.44444, 0, 0], + "110": [0, 0.44444, 0, 0], + "111": [0, 0.44444, 0, 0], + "112": [0.19444, 0.44444, 0, 0], + "113": [0.19444, 0.44444, 0, 0], + "114": [0, 0.44444, 0.01389, 0], + "115": [0, 0.44444, 0, 0], + "116": [0, 0.57143, 0, 0], + "117": [0, 0.44444, 0, 0], + "118": [0, 0.44444, 0.01389, 0], + "119": [0, 0.44444, 0.01389, 0], + "120": [0, 0.44444, 0, 0], + "121": [0.19444, 0.44444, 0.01389, 0], + "122": [0, 0.44444, 0, 0], + "126": [0.35, 0.32659, 0, 0], + "305": [0, 0.44444, 0, 0], + "567": [0.19444, 0.44444, 0, 0], + "768": [0, 0.69444, 0, 0], + "769": [0, 0.69444, 0, 0], + "770": [0, 0.69444, 0, 0], + "771": [0, 0.67659, 0, 0], + "772": [0, 0.60889, 0, 0], + "774": [0, 0.69444, 0, 0], + "775": [0, 0.67937, 0, 0], + "776": [0, 0.67937, 0, 0], + "778": [0, 0.69444, 0, 0], + "779": [0, 0.69444, 0, 0], + "780": [0, 0.63194, 0, 0], + "915": [0, 0.69444, 0, 0], + "916": [0, 0.69444, 0, 0], + "920": [0, 0.69444, 0, 0], + "923": [0, 0.69444, 0, 0], + "926": [0, 0.69444, 0, 0], + "928": [0, 0.69444, 0, 0], + "931": [0, 0.69444, 0, 0], + "933": [0, 0.69444, 0, 0], + "934": [0, 0.69444, 0, 0], + "936": [0, 0.69444, 0, 0], + "937": [0, 0.69444, 0, 0], + "8211": [0, 0.44444, 0.02778, 0], + "8212": [0, 0.44444, 0.02778, 0], + "8216": [0, 0.69444, 0, 0], + "8217": [0, 0.69444, 0, 0], + "8220": [0, 0.69444, 0, 0], + "8221": [0, 0.69444, 0, 0] + }, + "Script-Regular": { + "65": [0, 0.7, 0.22925, 0], + "66": [0, 0.7, 0.04087, 0], + "67": [0, 0.7, 0.1689, 0], + "68": [0, 0.7, 0.09371, 0], + "69": [0, 0.7, 0.18583, 0], + "70": [0, 0.7, 0.13634, 0], + "71": [0, 0.7, 0.17322, 0], + "72": [0, 0.7, 0.29694, 0], + "73": [0, 0.7, 0.19189, 0], + "74": [0.27778, 0.7, 0.19189, 0], + "75": [0, 0.7, 0.31259, 0], + "76": [0, 0.7, 0.19189, 0], + "77": [0, 0.7, 0.15981, 0], + "78": [0, 0.7, 0.3525, 0], + "79": [0, 0.7, 0.08078, 0], + "80": [0, 0.7, 0.08078, 0], + "81": [0, 0.7, 0.03305, 0], + "82": [0, 0.7, 0.06259, 0], + "83": [0, 0.7, 0.19189, 0], + "84": [0, 0.7, 0.29087, 0], + "85": [0, 0.7, 0.25815, 0], + "86": [0, 0.7, 0.27523, 0], + "87": [0, 0.7, 0.27523, 0], + "88": [0, 0.7, 0.26006, 0], + "89": [0, 0.7, 0.2939, 0], + "90": [0, 0.7, 0.24037, 0] + }, + "Size1-Regular": { + "40": [0.35001, 0.85, 0, 0], + "41": [0.35001, 0.85, 0, 0], + "47": [0.35001, 0.85, 0, 0], + "91": [0.35001, 0.85, 0, 0], + "92": [0.35001, 0.85, 0, 0], + "93": [0.35001, 0.85, 0, 0], + "123": [0.35001, 0.85, 0, 0], + "125": [0.35001, 0.85, 0, 0], + "710": [0, 0.72222, 0, 0], + "732": [0, 0.72222, 0, 0], + "770": [0, 0.72222, 0, 0], + "771": [0, 0.72222, 0, 0], + "8214": [-0.00099, 0.601, 0, 0], + "8593": [1e-05, 0.6, 0, 0], + "8595": [1e-05, 0.6, 0, 0], + "8657": [1e-05, 0.6, 0, 0], + "8659": [1e-05, 0.6, 0, 0], + "8719": [0.25001, 0.75, 0, 0], + "8720": [0.25001, 0.75, 0, 0], + "8721": [0.25001, 0.75, 0, 0], + "8730": [0.35001, 0.85, 0, 0], + "8739": [-0.00599, 0.606, 0, 0], + "8741": [-0.00599, 0.606, 0, 0], + "8747": [0.30612, 0.805, 0.19445, 0], + "8748": [0.306, 0.805, 0.19445, 0], + "8749": [0.306, 0.805, 0.19445, 0], + "8750": [0.30612, 0.805, 0.19445, 0], + "8896": [0.25001, 0.75, 0, 0], + "8897": [0.25001, 0.75, 0, 0], + "8898": [0.25001, 0.75, 0, 0], + "8899": [0.25001, 0.75, 0, 0], + "8968": [0.35001, 0.85, 0, 0], + "8969": [0.35001, 0.85, 0, 0], + "8970": [0.35001, 0.85, 0, 0], + "8971": [0.35001, 0.85, 0, 0], + "9168": [-0.00099, 0.601, 0, 0], + "10216": [0.35001, 0.85, 0, 0], + "10217": [0.35001, 0.85, 0, 0], + "10752": [0.25001, 0.75, 0, 0], + "10753": [0.25001, 0.75, 0, 0], + "10754": [0.25001, 0.75, 0, 0], + "10756": [0.25001, 0.75, 0, 0], + "10758": [0.25001, 0.75, 0, 0] + }, + "Size2-Regular": { + "40": [0.65002, 1.15, 0, 0], + "41": [0.65002, 1.15, 0, 0], + "47": [0.65002, 1.15, 0, 0], + "91": [0.65002, 1.15, 0, 0], + "92": [0.65002, 1.15, 0, 0], + "93": [0.65002, 1.15, 0, 0], + "123": [0.65002, 1.15, 0, 0], + "125": [0.65002, 1.15, 0, 0], + "710": [0, 0.75, 0, 0], + "732": [0, 0.75, 0, 0], + "770": [0, 0.75, 0, 0], + "771": [0, 0.75, 0, 0], + "8719": [0.55001, 1.05, 0, 0], + "8720": [0.55001, 1.05, 0, 0], + "8721": [0.55001, 1.05, 0, 0], + "8730": [0.65002, 1.15, 0, 0], + "8747": [0.86225, 1.36, 0.44445, 0], + "8748": [0.862, 1.36, 0.44445, 0], + "8749": [0.862, 1.36, 0.44445, 0], + "8750": [0.86225, 1.36, 0.44445, 0], + "8896": [0.55001, 1.05, 0, 0], + "8897": [0.55001, 1.05, 0, 0], + "8898": [0.55001, 1.05, 0, 0], + "8899": [0.55001, 1.05, 0, 0], + "8968": [0.65002, 1.15, 0, 0], + "8969": [0.65002, 1.15, 0, 0], + "8970": [0.65002, 1.15, 0, 0], + "8971": [0.65002, 1.15, 0, 0], + "10216": [0.65002, 1.15, 0, 0], + "10217": [0.65002, 1.15, 0, 0], + "10752": [0.55001, 1.05, 0, 0], + "10753": [0.55001, 1.05, 0, 0], + "10754": [0.55001, 1.05, 0, 0], + "10756": [0.55001, 1.05, 0, 0], + "10758": [0.55001, 1.05, 0, 0] + }, + "Size3-Regular": { + "40": [0.95003, 1.45, 0, 0], + "41": [0.95003, 1.45, 0, 0], + "47": [0.95003, 1.45, 0, 0], + "91": [0.95003, 1.45, 0, 0], + "92": [0.95003, 1.45, 0, 0], + "93": [0.95003, 1.45, 0, 0], + "123": [0.95003, 1.45, 0, 0], + "125": [0.95003, 1.45, 0, 0], + "710": [0, 0.75, 0, 0], + "732": [0, 0.75, 0, 0], + "770": [0, 0.75, 0, 0], + "771": [0, 0.75, 0, 0], + "8730": [0.95003, 1.45, 0, 0], + "8968": [0.95003, 1.45, 0, 0], + "8969": [0.95003, 1.45, 0, 0], + "8970": [0.95003, 1.45, 0, 0], + "8971": [0.95003, 1.45, 0, 0], + "10216": [0.95003, 1.45, 0, 0], + "10217": [0.95003, 1.45, 0, 0] + }, + "Size4-Regular": { + "40": [1.25003, 1.75, 0, 0], + "41": [1.25003, 1.75, 0, 0], + "47": [1.25003, 1.75, 0, 0], + "91": [1.25003, 1.75, 0, 0], + "92": [1.25003, 1.75, 0, 0], + "93": [1.25003, 1.75, 0, 0], + "123": [1.25003, 1.75, 0, 0], + "125": [1.25003, 1.75, 0, 0], + "710": [0, 0.825, 0, 0], + "732": [0, 0.825, 0, 0], + "770": [0, 0.825, 0, 0], + "771": [0, 0.825, 0, 0], + "8730": [1.25003, 1.75, 0, 0], + "8968": [1.25003, 1.75, 0, 0], + "8969": [1.25003, 1.75, 0, 0], + "8970": [1.25003, 1.75, 0, 0], + "8971": [1.25003, 1.75, 0, 0], + "9115": [0.64502, 1.155, 0, 0], + "9116": [1e-05, 0.6, 0, 0], + "9117": [0.64502, 1.155, 0, 0], + "9118": [0.64502, 1.155, 0, 0], + "9119": [1e-05, 0.6, 0, 0], + "9120": [0.64502, 1.155, 0, 0], + "9121": [0.64502, 1.155, 0, 0], + "9122": [-0.00099, 0.601, 0, 0], + "9123": [0.64502, 1.155, 0, 0], + "9124": [0.64502, 1.155, 0, 0], + "9125": [-0.00099, 0.601, 0, 0], + "9126": [0.64502, 1.155, 0, 0], + "9127": [1e-05, 0.9, 0, 0], + "9128": [0.65002, 1.15, 0, 0], + "9129": [0.90001, 0, 0, 0], + "9130": [0, 0.3, 0, 0], + "9131": [1e-05, 0.9, 0, 0], + "9132": [0.65002, 1.15, 0, 0], + "9133": [0.90001, 0, 0, 0], + "9143": [0.88502, 0.915, 0, 0], + "10216": [1.25003, 1.75, 0, 0], + "10217": [1.25003, 1.75, 0, 0], + "57344": [-0.00499, 0.605, 0, 0], + "57345": [-0.00499, 0.605, 0, 0], + "57680": [0, 0.12, 0, 0], + "57681": [0, 0.12, 0, 0], + "57682": [0, 0.12, 0, 0], + "57683": [0, 0.12, 0, 0] + }, + "Typewriter-Regular": { + "33": [0, 0.61111, 0, 0], + "34": [0, 0.61111, 0, 0], + "35": [0, 0.61111, 0, 0], + "36": [0.08333, 0.69444, 0, 0], + "37": [0.08333, 0.69444, 0, 0], + "38": [0, 0.61111, 0, 0], + "39": [0, 0.61111, 0, 0], + "40": [0.08333, 0.69444, 0, 0], + "41": [0.08333, 0.69444, 0, 0], + "42": [0, 0.52083, 0, 0], + "43": [-0.08056, 0.53055, 0, 0], + "44": [0.13889, 0.125, 0, 0], + "45": [-0.08056, 0.53055, 0, 0], + "46": [0, 0.125, 0, 0], + "47": [0.08333, 0.69444, 0, 0], + "48": [0, 0.61111, 0, 0], + "49": [0, 0.61111, 0, 0], + "50": [0, 0.61111, 0, 0], + "51": [0, 0.61111, 0, 0], + "52": [0, 0.61111, 0, 0], + "53": [0, 0.61111, 0, 0], + "54": [0, 0.61111, 0, 0], + "55": [0, 0.61111, 0, 0], + "56": [0, 0.61111, 0, 0], + "57": [0, 0.61111, 0, 0], + "58": [0, 0.43056, 0, 0], + "59": [0.13889, 0.43056, 0, 0], + "60": [-0.05556, 0.55556, 0, 0], + "61": [-0.19549, 0.41562, 0, 0], + "62": [-0.05556, 0.55556, 0, 0], + "63": [0, 0.61111, 0, 0], + "64": [0, 0.61111, 0, 0], + "65": [0, 0.61111, 0, 0], + "66": [0, 0.61111, 0, 0], + "67": [0, 0.61111, 0, 0], + "68": [0, 0.61111, 0, 0], + "69": [0, 0.61111, 0, 0], + "70": [0, 0.61111, 0, 0], + "71": [0, 0.61111, 0, 0], + "72": [0, 0.61111, 0, 0], + "73": [0, 0.61111, 0, 0], + "74": [0, 0.61111, 0, 0], + "75": [0, 0.61111, 0, 0], + "76": [0, 0.61111, 0, 0], + "77": [0, 0.61111, 0, 0], + "78": [0, 0.61111, 0, 0], + "79": [0, 0.61111, 0, 0], + "80": [0, 0.61111, 0, 0], + "81": [0.13889, 0.61111, 0, 0], + "82": [0, 0.61111, 0, 0], + "83": [0, 0.61111, 0, 0], + "84": [0, 0.61111, 0, 0], + "85": [0, 0.61111, 0, 0], + "86": [0, 0.61111, 0, 0], + "87": [0, 0.61111, 0, 0], + "88": [0, 0.61111, 0, 0], + "89": [0, 0.61111, 0, 0], + "90": [0, 0.61111, 0, 0], + "91": [0.08333, 0.69444, 0, 0], + "92": [0.08333, 0.69444, 0, 0], + "93": [0.08333, 0.69444, 0, 0], + "94": [0, 0.61111, 0, 0], + "95": [0.09514, 0, 0, 0], + "96": [0, 0.61111, 0, 0], + "97": [0, 0.43056, 0, 0], + "98": [0, 0.61111, 0, 0], + "99": [0, 0.43056, 0, 0], + "100": [0, 0.61111, 0, 0], + "101": [0, 0.43056, 0, 0], + "102": [0, 0.61111, 0, 0], + "103": [0.22222, 0.43056, 0, 0], + "104": [0, 0.61111, 0, 0], + "105": [0, 0.61111, 0, 0], + "106": [0.22222, 0.61111, 0, 0], + "107": [0, 0.61111, 0, 0], + "108": [0, 0.61111, 0, 0], + "109": [0, 0.43056, 0, 0], + "110": [0, 0.43056, 0, 0], + "111": [0, 0.43056, 0, 0], + "112": [0.22222, 0.43056, 0, 0], + "113": [0.22222, 0.43056, 0, 0], + "114": [0, 0.43056, 0, 0], + "115": [0, 0.43056, 0, 0], + "116": [0, 0.55358, 0, 0], + "117": [0, 0.43056, 0, 0], + "118": [0, 0.43056, 0, 0], + "119": [0, 0.43056, 0, 0], + "120": [0, 0.43056, 0, 0], + "121": [0.22222, 0.43056, 0, 0], + "122": [0, 0.43056, 0, 0], + "123": [0.08333, 0.69444, 0, 0], + "124": [0.08333, 0.69444, 0, 0], + "125": [0.08333, 0.69444, 0, 0], + "126": [0, 0.61111, 0, 0], + "127": [0, 0.61111, 0, 0], + "305": [0, 0.43056, 0, 0], + "567": [0.22222, 0.43056, 0, 0], + "768": [0, 0.61111, 0, 0], + "769": [0, 0.61111, 0, 0], + "770": [0, 0.61111, 0, 0], + "771": [0, 0.61111, 0, 0], + "772": [0, 0.56555, 0, 0], + "774": [0, 0.61111, 0, 0], + "776": [0, 0.61111, 0, 0], + "778": [0, 0.61111, 0, 0], + "780": [0, 0.56597, 0, 0], + "915": [0, 0.61111, 0, 0], + "916": [0, 0.61111, 0, 0], + "920": [0, 0.61111, 0, 0], + "923": [0, 0.61111, 0, 0], + "926": [0, 0.61111, 0, 0], + "928": [0, 0.61111, 0, 0], + "931": [0, 0.61111, 0, 0], + "933": [0, 0.61111, 0, 0], + "934": [0, 0.61111, 0, 0], + "936": [0, 0.61111, 0, 0], + "937": [0, 0.61111, 0, 0], + "2018": [0, 0.61111, 0, 0], + "2019": [0, 0.61111, 0, 0], + "8242": [0, 0.61111, 0, 0] + } +}; + +},{}],19:[function(require,module,exports){ +var utils = require("./utils"); +var ParseError = require("./ParseError"); +var parseData = require("./parseData"); +var ParseNode = parseData.ParseNode; + +/* This file contains a list of functions that we parse, identified by + * the calls to defineFunction. + * + * The first argument to defineFunction is a single name or a list of names. + * All functions named in such a list will share a single implementation. + * + * Each declared function can have associated properties, which + * include the following: + * + * - numArgs: The number of arguments the function takes. + * If this is the only property, it can be passed as a number + * instead of an element of a properties object. + * - argTypes: (optional) An array corresponding to each argument of the + * function, giving the type of argument that should be parsed. Its + * length should be equal to `numArgs + numOptionalArgs`. Valid + * types: + * - "size": A size-like thing, such as "1em" or "5ex" + * - "color": An html color, like "#abc" or "blue" + * - "original": The same type as the environment that the + * function being parsed is in (e.g. used for the + * bodies of functions like \color where the first + * argument is special and the second argument is + * parsed normally) + * Other possible types (probably shouldn't be used) + * - "text": Text-like (e.g. \text) + * - "math": Normal math + * If undefined, this will be treated as an appropriate length + * array of "original" strings + * - greediness: (optional) The greediness of the function to use ungrouped + * arguments. + * + * E.g. if you have an expression + * \sqrt \frac 1 2 + * since \frac has greediness=2 vs \sqrt's greediness=1, \frac + * will use the two arguments '1' and '2' as its two arguments, + * then that whole function will be used as the argument to + * \sqrt. On the other hand, the expressions + * \frac \frac 1 2 3 + * and + * \frac \sqrt 1 2 + * will fail because \frac and \frac have equal greediness + * and \sqrt has a lower greediness than \frac respectively. To + * make these parse, we would have to change them to: + * \frac {\frac 1 2} 3 + * and + * \frac {\sqrt 1} 2 + * + * The default value is `1` + * - allowedInText: (optional) Whether or not the function is allowed inside + * text mode (default false) + * - numOptionalArgs: (optional) The number of optional arguments the function + * should parse. If the optional arguments aren't found, + * `null` will be passed to the handler in their place. + * (default 0) + * - infix: (optional) Must be true if the function is an infix operator. + * + * The last argument is that implementation, the handler for the function(s). + * It is called to handle these functions and their arguments. + * It receives two arguments: + * - context contains information and references provided by the parser + * - args is an array of arguments obtained from TeX input + * The context contains the following properties: + * - funcName: the text (i.e. name) of the function, including \ + * - parser: the parser object + * - lexer: the lexer object + * - positions: the positions in the overall string of the function + * and the arguments. + * The latter three should only be used to produce error messages. + * + * The function should return an object with the following keys: + * - type: The type of element that this is. This is then used in + * buildHTML/buildMathML to determine which function + * should be called to build this node into a DOM node + * Any other data can be added to the object, which will be passed + * in to the function in buildHTML/buildMathML as `group.value`. + */ + +function defineFunction(names, props, handler) { + if (typeof names === "string") { + names = [names]; + } + if (typeof props === "number") { + props = { numArgs: props }; + } + // Set default values of functions + var data = { + numArgs: props.numArgs, + argTypes: props.argTypes, + greediness: (props.greediness === undefined) ? 1 : props.greediness, + allowedInText: !!props.allowedInText, + numOptionalArgs: props.numOptionalArgs || 0, + infix: !!props.infix, + handler: handler + }; + for (var i = 0; i < names.length; ++i) { + module.exports[names[i]] = data; + } +} + +// Since the corresponding buildHTML/buildMathML function expects a +// list of elements, we normalize for different kinds of arguments +var ordargument = function(arg) { + if (arg.type === "ordgroup") { + return arg.value; + } else { + return [arg]; + } +}; + +// A normal square root +defineFunction("\\sqrt", { + numArgs: 1, + numOptionalArgs: 1 +}, function(context, args) { + var index = args[0]; + var body = args[1]; + return { + type: "sqrt", + body: body, + index: index + }; +}); + +// Non-mathy text, possibly in a font +var textFunctionStyles = { + "\\text": undefined, "\\textrm": "mathrm", "\\textsf": "mathsf", + "\\texttt": "mathtt", "\\textnormal": "mathrm", "\\textbf": "mathbf", + "\\textit": "textit" +}; + +defineFunction([ + "\\text", "\\textrm", "\\textsf", "\\texttt", "\\textnormal", + "\\textbf", "\\textit" +], { + numArgs: 1, + argTypes: ["text"], + greediness: 2, + allowedInText: true +}, function(context, args) { + var body = args[0]; + return { + type: "text", + body: ordargument(body), + style: textFunctionStyles[context.funcName] + }; +}); + +// A two-argument custom color +defineFunction("\\color", { + numArgs: 2, + allowedInText: true, + greediness: 3, + argTypes: ["color", "original"] +}, function(context, args) { + var color = args[0]; + var body = args[1]; + return { + type: "color", + color: color.value, + value: ordargument(body) + }; +}); + +// An overline +defineFunction("\\overline", { + numArgs: 1 +}, function(context, args) { + var body = args[0]; + return { + type: "overline", + body: body + }; +}); + +// An underline +defineFunction("\\underline", { + numArgs: 1 +}, function(context, args) { + var body = args[0]; + return { + type: "underline", + body: body + }; +}); + +// A box of the width and height +defineFunction("\\rule", { + numArgs: 2, + numOptionalArgs: 1, + argTypes: ["size", "size", "size"] +}, function(context, args) { + var shift = args[0]; + var width = args[1]; + var height = args[2]; + return { + type: "rule", + shift: shift && shift.value, + width: width.value, + height: height.value + }; +}); + +// TODO: In TeX, \mkern only accepts mu-units, and \kern does not accept +// mu-units. In current KaTeX we relax this; both commands accept any unit. +defineFunction(["\\kern", "\\mkern"], { + numArgs: 1, + argTypes: ["size"] +}, function(context, args) { + return { + type: "kern", + dimension: args[0].value + }; +}); + +// A KaTeX logo +defineFunction("\\KaTeX", { + numArgs: 0 +}, function(context) { + return { + type: "katex" + }; +}); + +defineFunction("\\phantom", { + numArgs: 1 +}, function(context, args) { + var body = args[0]; + return { + type: "phantom", + value: ordargument(body) + }; +}); + +// Math class commands except \mathop +defineFunction([ + "\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", + "\\mathclose", "\\mathpunct", "\\mathinner" +], { + numArgs: 1 +}, function(context, args) { + var body = args[0]; + return { + type: "mclass", + mclass: "m" + context.funcName.substr(5), + value: ordargument(body) + }; +}); + +// Build a relation by placing one symbol on top of another +defineFunction("\\stackrel", { + numArgs: 2 +}, function(context, args) { + var top = args[0]; + var bottom = args[1]; + + var bottomop = new ParseNode("op", { + type: "op", + limits: true, + alwaysHandleSupSub: true, + symbol: false, + value: ordargument(bottom) + }, bottom.mode); + + var supsub = new ParseNode("supsub", { + base: bottomop, + sup: top, + sub: null + }, top.mode); + + return { + type: "mclass", + mclass: "mrel", + value: [supsub] + }; +}); + +// \mod-type functions +defineFunction("\\bmod", { + numArgs: 0 +}, function(context, args) { + return { + type: "mod", + modType: "bmod", + value: null + }; +}); + +defineFunction(["\\pod", "\\pmod", "\\mod"], { + numArgs: 1 +}, function(context, args) { + var body = args[0]; + return { + type: "mod", + modType: context.funcName.substr(1), + value: ordargument(body) + }; +}); + +// Extra data needed for the delimiter handler down below +var delimiterSizes = { + "\\bigl" : {mclass: "mopen", size: 1}, + "\\Bigl" : {mclass: "mopen", size: 2}, + "\\biggl": {mclass: "mopen", size: 3}, + "\\Biggl": {mclass: "mopen", size: 4}, + "\\bigr" : {mclass: "mclose", size: 1}, + "\\Bigr" : {mclass: "mclose", size: 2}, + "\\biggr": {mclass: "mclose", size: 3}, + "\\Biggr": {mclass: "mclose", size: 4}, + "\\bigm" : {mclass: "mrel", size: 1}, + "\\Bigm" : {mclass: "mrel", size: 2}, + "\\biggm": {mclass: "mrel", size: 3}, + "\\Biggm": {mclass: "mrel", size: 4}, + "\\big" : {mclass: "mord", size: 1}, + "\\Big" : {mclass: "mord", size: 2}, + "\\bigg" : {mclass: "mord", size: 3}, + "\\Bigg" : {mclass: "mord", size: 4} +}; + +var delimiters = [ + "(", ")", "[", "\\lbrack", "]", "\\rbrack", + "\\{", "\\lbrace", "\\}", "\\rbrace", + "\\lfloor", "\\rfloor", "\\lceil", "\\rceil", + "<", ">", "\\langle", "\\rangle", "\\lt", "\\gt", + "\\lvert", "\\rvert", "\\lVert", "\\rVert", + "\\lgroup", "\\rgroup", "\\lmoustache", "\\rmoustache", + "/", "\\backslash", + "|", "\\vert", "\\|", "\\Vert", + "\\uparrow", "\\Uparrow", + "\\downarrow", "\\Downarrow", + "\\updownarrow", "\\Updownarrow", + "." +]; + +var fontAliases = { + "\\Bbb": "\\mathbb", + "\\bold": "\\mathbf", + "\\frak": "\\mathfrak" +}; + +// Single-argument color functions +defineFunction([ + "\\blue", "\\orange", "\\pink", "\\red", + "\\green", "\\gray", "\\purple", + "\\blueA", "\\blueB", "\\blueC", "\\blueD", "\\blueE", + "\\tealA", "\\tealB", "\\tealC", "\\tealD", "\\tealE", + "\\greenA", "\\greenB", "\\greenC", "\\greenD", "\\greenE", + "\\goldA", "\\goldB", "\\goldC", "\\goldD", "\\goldE", + "\\redA", "\\redB", "\\redC", "\\redD", "\\redE", + "\\maroonA", "\\maroonB", "\\maroonC", "\\maroonD", "\\maroonE", + "\\purpleA", "\\purpleB", "\\purpleC", "\\purpleD", "\\purpleE", + "\\mintA", "\\mintB", "\\mintC", + "\\grayA", "\\grayB", "\\grayC", "\\grayD", "\\grayE", + "\\grayF", "\\grayG", "\\grayH", "\\grayI", + "\\kaBlue", "\\kaGreen" +], { + numArgs: 1, + allowedInText: true, + greediness: 3 +}, function(context, args) { + var body = args[0]; + return { + type: "color", + color: "katex-" + context.funcName.slice(1), + value: ordargument(body) + }; +}); + +// There are 2 flags for operators; whether they produce limits in +// displaystyle, and whether they are symbols and should grow in +// displaystyle. These four groups cover the four possible choices. + +// No limits, not symbols +defineFunction([ + "\\arcsin", "\\arccos", "\\arctan", "\\arg", "\\cos", "\\cosh", + "\\cot", "\\coth", "\\csc", "\\deg", "\\dim", "\\exp", "\\hom", + "\\ker", "\\lg", "\\ln", "\\log", "\\sec", "\\sin", "\\sinh", + "\\tan", "\\tanh" +], { + numArgs: 0 +}, function(context) { + return { + type: "op", + limits: false, + symbol: false, + body: context.funcName + }; +}); + +// Limits, not symbols +defineFunction([ + "\\det", "\\gcd", "\\inf", "\\lim", "\\liminf", "\\limsup", "\\max", + "\\min", "\\Pr", "\\sup" +], { + numArgs: 0 +}, function(context) { + return { + type: "op", + limits: true, + symbol: false, + body: context.funcName + }; +}); + +// No limits, symbols +defineFunction([ + "\\int", "\\iint", "\\iiint", "\\oint" +], { + numArgs: 0 +}, function(context) { + return { + type: "op", + limits: false, + symbol: true, + body: context.funcName + }; +}); + +// Limits, symbols +defineFunction([ + "\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", + "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", + "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint" +], { + numArgs: 0 +}, function(context) { + return { + type: "op", + limits: true, + symbol: true, + body: context.funcName + }; +}); + +// \mathop class command +defineFunction("\\mathop", { + numArgs: 1 +}, function(context, args) { + var body = args[0]; + return { + type: "op", + limits: false, + symbol: false, + value: ordargument(body) + }; +}); + +// Fractions +defineFunction([ + "\\dfrac", "\\frac", "\\tfrac", + "\\dbinom", "\\binom", "\\tbinom", + "\\\\atopfrac" // can’t be entered directly +], { + numArgs: 2, + greediness: 2 +}, function(context, args) { + var numer = args[0]; + var denom = args[1]; + var hasBarLine; + var leftDelim = null; + var rightDelim = null; + var size = "auto"; + + switch (context.funcName) { + case "\\dfrac": + case "\\frac": + case "\\tfrac": + hasBarLine = true; + break; + case "\\\\atopfrac": + hasBarLine = false; + break; + case "\\dbinom": + case "\\binom": + case "\\tbinom": + hasBarLine = false; + leftDelim = "("; + rightDelim = ")"; + break; + default: + throw new Error("Unrecognized genfrac command"); + } + + switch (context.funcName) { + case "\\dfrac": + case "\\dbinom": + size = "display"; + break; + case "\\tfrac": + case "\\tbinom": + size = "text"; + break; + } + + return { + type: "genfrac", + numer: numer, + denom: denom, + hasBarLine: hasBarLine, + leftDelim: leftDelim, + rightDelim: rightDelim, + size: size + }; +}); + +// Left and right overlap functions +defineFunction(["\\llap", "\\rlap"], { + numArgs: 1, + allowedInText: true +}, function(context, args) { + var body = args[0]; + return { + type: context.funcName.slice(1), + body: body + }; +}); + +// Delimiter functions +var checkDelimiter = function(delim, context) { + if (utils.contains(delimiters, delim.value)) { + return delim; + } else { + throw new ParseError( + "Invalid delimiter: '" + delim.value + "' after '" + + context.funcName + "'", delim); + } +}; + +defineFunction([ + "\\bigl", "\\Bigl", "\\biggl", "\\Biggl", + "\\bigr", "\\Bigr", "\\biggr", "\\Biggr", + "\\bigm", "\\Bigm", "\\biggm", "\\Biggm", + "\\big", "\\Big", "\\bigg", "\\Bigg" +], { + numArgs: 1 +}, function(context, args) { + var delim = checkDelimiter(args[0], context); + + return { + type: "delimsizing", + size: delimiterSizes[context.funcName].size, + mclass: delimiterSizes[context.funcName].mclass, + value: delim.value + }; +}); + +defineFunction([ + "\\left", "\\right" +], { + numArgs: 1 +}, function(context, args) { + var delim = checkDelimiter(args[0], context); + + // \left and \right are caught somewhere in Parser.js, which is + // why this data doesn't match what is in buildHTML. + return { + type: "leftright", + value: delim.value + }; +}); + +defineFunction("\\middle", { + numArgs: 1 +}, function(context, args) { + var delim = checkDelimiter(args[0], context); + if (!context.parser.leftrightDepth) { + throw new ParseError("\\middle without preceding \\left", delim); + } + + return { + type: "middle", + value: delim.value + }; +}); + +// Sizing functions (handled in Parser.js explicitly, hence no handler) +defineFunction([ + "\\tiny", "\\scriptsize", "\\footnotesize", "\\small", + "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge" +], 0, null); + +// Style changing functions (handled in Parser.js explicitly, hence no +// handler) +defineFunction([ + "\\displaystyle", "\\textstyle", "\\scriptstyle", + "\\scriptscriptstyle" +], 0, null); + +defineFunction([ + // styles + "\\mathrm", "\\mathit", "\\mathbf", + + // families + "\\mathbb", "\\mathcal", "\\mathfrak", "\\mathscr", "\\mathsf", + "\\mathtt", + + // aliases + "\\Bbb", "\\bold", "\\frak" +], { + numArgs: 1, + greediness: 2 +}, function(context, args) { + var body = args[0]; + var func = context.funcName; + if (func in fontAliases) { + func = fontAliases[func]; + } + return { + type: "font", + font: func.slice(1), + body: body + }; +}); + +// Accents +defineFunction([ + "\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", + "\\check", "\\hat", "\\vec", "\\dot" + // We don't support expanding accents yet + // "\\widetilde", "\\widehat" +], { + numArgs: 1 +}, function(context, args) { + var base = args[0]; + return { + type: "accent", + accent: context.funcName, + base: base + }; +}); + +// Infix generalized fractions +defineFunction(["\\over", "\\choose", "\\atop"], { + numArgs: 0, + infix: true +}, function(context) { + var replaceWith; + switch (context.funcName) { + case "\\over": + replaceWith = "\\frac"; + break; + case "\\choose": + replaceWith = "\\binom"; + break; + case "\\atop": + replaceWith = "\\\\atopfrac"; + break; + default: + throw new Error("Unrecognized infix genfrac command"); + } + return { + type: "infix", + replaceWith: replaceWith, + token: context.token + }; +}); + +// Row breaks for aligned data +defineFunction(["\\\\", "\\cr"], { + numArgs: 0, + numOptionalArgs: 1, + argTypes: ["size"] +}, function(context, args) { + var size = args[0]; + return { + type: "cr", + size: size + }; +}); + +// Environment delimiters +defineFunction(["\\begin", "\\end"], { + numArgs: 1, + argTypes: ["text"] +}, function(context, args) { + var nameGroup = args[0]; + if (nameGroup.type !== "ordgroup") { + throw new ParseError("Invalid environment name", nameGroup); + } + var name = ""; + for (var i = 0; i < nameGroup.value.length; ++i) { + name += nameGroup.value[i].value; + } + return { + type: "environment", + name: name, + nameGroup: nameGroup + }; +}); + +},{"./ParseError":6,"./parseData":21,"./utils":25}],20:[function(require,module,exports){ +/** + * These objects store data about MathML nodes. This is the MathML equivalent + * of the types in domTree.js. Since MathML handles its own rendering, and + * since we're mainly using MathML to improve accessibility, we don't manage + * any of the styling state that the plain DOM nodes do. + * + * The `toNode` and `toMarkup` functions work simlarly to how they do in + * domTree.js, creating namespaced DOM nodes and HTML text markup respectively. + */ + +var utils = require("./utils"); + +/** + * This node represents a general purpose MathML node of any type. The + * constructor requires the type of node to create (for example, `"mo"` or + * `"mspace"`, corresponding to `` and `` tags). + */ +function MathNode(type, children) { + this.type = type; + this.attributes = {}; + this.children = children || []; +} + +/** + * Sets an attribute on a MathML node. MathML depends on attributes to convey a + * semantic content, so this is used heavily. + */ +MathNode.prototype.setAttribute = function(name, value) { + this.attributes[name] = value; +}; + +/** + * Converts the math node into a MathML-namespaced DOM element. + */ +MathNode.prototype.toNode = function() { + var node = document.createElementNS( + "http://www.w3.org/1998/Math/MathML", this.type); + + for (var attr in this.attributes) { + if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { + node.setAttribute(attr, this.attributes[attr]); + } + } + + for (var i = 0; i < this.children.length; i++) { + node.appendChild(this.children[i].toNode()); + } + + return node; +}; + +/** + * Converts the math node into an HTML markup string. + */ +MathNode.prototype.toMarkup = function() { + var markup = "<" + this.type; + + // Add the attributes + for (var attr in this.attributes) { + if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { + markup += " " + attr + "=\""; + markup += utils.escape(this.attributes[attr]); + markup += "\""; + } + } + + markup += ">"; + + for (var i = 0; i < this.children.length; i++) { + markup += this.children[i].toMarkup(); + } + + markup += ""; + + return markup; +}; + +/** + * This node represents a piece of text. + */ +function TextNode(text) { + this.text = text; +} + +/** + * Converts the text node into a DOM text node. + */ +TextNode.prototype.toNode = function() { + return document.createTextNode(this.text); +}; + +/** + * Converts the text node into HTML markup (which is just the text itself). + */ +TextNode.prototype.toMarkup = function() { + return utils.escape(this.text); +}; + +module.exports = { + MathNode: MathNode, + TextNode: TextNode +}; + +},{"./utils":25}],21:[function(require,module,exports){ +/** + * The resulting parse tree nodes of the parse tree. + * + * It is possible to provide position information, so that a ParseNode can + * fulfil a role similar to a Token in error reporting. + * For details on the corresponding properties see Token constructor. + * Providing such information can lead to better error reporting. + * + * @param {string} type type of node, like e.g. "ordgroup" + * @param {?object} value type-specific representation of the node + * @param {string} mode parse mode in action for this node, + * "math" or "text" + * @param {Token=} firstToken first token of the input for this node, + * will omit position information if unset + * @param {Token=} lastToken last token of the input for this node, + * will default to firstToken if unset + */ +function ParseNode(type, value, mode, firstToken, lastToken) { + this.type = type; + this.value = value; + this.mode = mode; + if (firstToken && (!lastToken || lastToken.lexer === firstToken.lexer)) { + this.lexer = firstToken.lexer; + this.start = firstToken.start; + this.end = (lastToken || firstToken).end; + } +} + +module.exports = { + ParseNode: ParseNode +}; + + +},{}],22:[function(require,module,exports){ +/** + * Provides a single function for parsing an expression using a Parser + * TODO(emily): Remove this + */ + +var Parser = require("./Parser"); + +/** + * Parses an expression using a Parser, then returns the parsed result. + */ +var parseTree = function(toParse, settings) { + if (!(typeof toParse === 'string' || toParse instanceof String)) { + throw new TypeError('KaTeX can only parse string typed expression'); + } + var parser = new Parser(toParse, settings); + + return parser.parse(); +}; + +module.exports = parseTree; + +},{"./Parser":7}],23:[function(require,module,exports){ +/** + * This file holds a list of all no-argument functions and single-character + * symbols (like 'a' or ';'). + * + * For each of the symbols, there are three properties they can have: + * - font (required): the font to be used for this symbol. Either "main" (the + normal font), or "ams" (the ams fonts). + * - group (required): the ParseNode group type the symbol should have (i.e. + "textord", "mathord", etc). + See https://github.com/Khan/KaTeX/wiki/Examining-TeX#group-types + * - replace: the character that this symbol or function should be + * replaced with (i.e. "\phi" has a replace value of "\u03d5", the phi + * character in the main font). + * + * The outermost map in the table indicates what mode the symbols should be + * accepted in (e.g. "math" or "text"). + */ + +module.exports = { + math: {}, + text: {} +}; + +function defineSymbol(mode, font, group, replace, name) { + module.exports[mode][name] = { + font: font, + group: group, + replace: replace + }; +} + +// Some abbreviations for commonly used strings. +// This helps minify the code, and also spotting typos using jshint. + +// modes: +var math = "math"; +var text = "text"; + +// fonts: +var main = "main"; +var ams = "ams"; + +// groups: +var accent = "accent"; +var bin = "bin"; +var close = "close"; +var inner = "inner"; +var mathord = "mathord"; +var op = "op"; +var open = "open"; +var punct = "punct"; +var rel = "rel"; +var spacing = "spacing"; +var textord = "textord"; + +// Now comes the symbol table + +// Relation Symbols +defineSymbol(math, main, rel, "\u2261", "\\equiv"); +defineSymbol(math, main, rel, "\u227a", "\\prec"); +defineSymbol(math, main, rel, "\u227b", "\\succ"); +defineSymbol(math, main, rel, "\u223c", "\\sim"); +defineSymbol(math, main, rel, "\u22a5", "\\perp"); +defineSymbol(math, main, rel, "\u2aaf", "\\preceq"); +defineSymbol(math, main, rel, "\u2ab0", "\\succeq"); +defineSymbol(math, main, rel, "\u2243", "\\simeq"); +defineSymbol(math, main, rel, "\u2223", "\\mid"); +defineSymbol(math, main, rel, "\u226a", "\\ll"); +defineSymbol(math, main, rel, "\u226b", "\\gg"); +defineSymbol(math, main, rel, "\u224d", "\\asymp"); +defineSymbol(math, main, rel, "\u2225", "\\parallel"); +defineSymbol(math, main, rel, "\u22c8", "\\bowtie"); +defineSymbol(math, main, rel, "\u2323", "\\smile"); +defineSymbol(math, main, rel, "\u2291", "\\sqsubseteq"); +defineSymbol(math, main, rel, "\u2292", "\\sqsupseteq"); +defineSymbol(math, main, rel, "\u2250", "\\doteq"); +defineSymbol(math, main, rel, "\u2322", "\\frown"); +defineSymbol(math, main, rel, "\u220b", "\\ni"); +defineSymbol(math, main, rel, "\u221d", "\\propto"); +defineSymbol(math, main, rel, "\u22a2", "\\vdash"); +defineSymbol(math, main, rel, "\u22a3", "\\dashv"); +defineSymbol(math, main, rel, "\u220b", "\\owns"); + +// Punctuation +defineSymbol(math, main, punct, "\u002e", "\\ldotp"); +defineSymbol(math, main, punct, "\u22c5", "\\cdotp"); + +// Misc Symbols +defineSymbol(math, main, textord, "\u0023", "\\#"); +defineSymbol(text, main, textord, "\u0023", "\\#"); +defineSymbol(math, main, textord, "\u0026", "\\&"); +defineSymbol(text, main, textord, "\u0026", "\\&"); +defineSymbol(math, main, textord, "\u2135", "\\aleph"); +defineSymbol(math, main, textord, "\u2200", "\\forall"); +defineSymbol(math, main, textord, "\u210f", "\\hbar"); +defineSymbol(math, main, textord, "\u2203", "\\exists"); +defineSymbol(math, main, textord, "\u2207", "\\nabla"); +defineSymbol(math, main, textord, "\u266d", "\\flat"); +defineSymbol(math, main, textord, "\u2113", "\\ell"); +defineSymbol(math, main, textord, "\u266e", "\\natural"); +defineSymbol(math, main, textord, "\u2663", "\\clubsuit"); +defineSymbol(math, main, textord, "\u2118", "\\wp"); +defineSymbol(math, main, textord, "\u266f", "\\sharp"); +defineSymbol(math, main, textord, "\u2662", "\\diamondsuit"); +defineSymbol(math, main, textord, "\u211c", "\\Re"); +defineSymbol(math, main, textord, "\u2661", "\\heartsuit"); +defineSymbol(math, main, textord, "\u2111", "\\Im"); +defineSymbol(math, main, textord, "\u2660", "\\spadesuit"); + +// Math and Text +defineSymbol(math, main, textord, "\u2020", "\\dag"); +defineSymbol(math, main, textord, "\u2021", "\\ddag"); + +// Large Delimiters +defineSymbol(math, main, close, "\u23b1", "\\rmoustache"); +defineSymbol(math, main, open, "\u23b0", "\\lmoustache"); +defineSymbol(math, main, close, "\u27ef", "\\rgroup"); +defineSymbol(math, main, open, "\u27ee", "\\lgroup"); + +// Binary Operators +defineSymbol(math, main, bin, "\u2213", "\\mp"); +defineSymbol(math, main, bin, "\u2296", "\\ominus"); +defineSymbol(math, main, bin, "\u228e", "\\uplus"); +defineSymbol(math, main, bin, "\u2293", "\\sqcap"); +defineSymbol(math, main, bin, "\u2217", "\\ast"); +defineSymbol(math, main, bin, "\u2294", "\\sqcup"); +defineSymbol(math, main, bin, "\u25ef", "\\bigcirc"); +defineSymbol(math, main, bin, "\u2219", "\\bullet"); +defineSymbol(math, main, bin, "\u2021", "\\ddagger"); +defineSymbol(math, main, bin, "\u2240", "\\wr"); +defineSymbol(math, main, bin, "\u2a3f", "\\amalg"); + +// Arrow Symbols +defineSymbol(math, main, rel, "\u27f5", "\\longleftarrow"); +defineSymbol(math, main, rel, "\u21d0", "\\Leftarrow"); +defineSymbol(math, main, rel, "\u27f8", "\\Longleftarrow"); +defineSymbol(math, main, rel, "\u27f6", "\\longrightarrow"); +defineSymbol(math, main, rel, "\u21d2", "\\Rightarrow"); +defineSymbol(math, main, rel, "\u27f9", "\\Longrightarrow"); +defineSymbol(math, main, rel, "\u2194", "\\leftrightarrow"); +defineSymbol(math, main, rel, "\u27f7", "\\longleftrightarrow"); +defineSymbol(math, main, rel, "\u21d4", "\\Leftrightarrow"); +defineSymbol(math, main, rel, "\u27fa", "\\Longleftrightarrow"); +defineSymbol(math, main, rel, "\u21a6", "\\mapsto"); +defineSymbol(math, main, rel, "\u27fc", "\\longmapsto"); +defineSymbol(math, main, rel, "\u2197", "\\nearrow"); +defineSymbol(math, main, rel, "\u21a9", "\\hookleftarrow"); +defineSymbol(math, main, rel, "\u21aa", "\\hookrightarrow"); +defineSymbol(math, main, rel, "\u2198", "\\searrow"); +defineSymbol(math, main, rel, "\u21bc", "\\leftharpoonup"); +defineSymbol(math, main, rel, "\u21c0", "\\rightharpoonup"); +defineSymbol(math, main, rel, "\u2199", "\\swarrow"); +defineSymbol(math, main, rel, "\u21bd", "\\leftharpoondown"); +defineSymbol(math, main, rel, "\u21c1", "\\rightharpoondown"); +defineSymbol(math, main, rel, "\u2196", "\\nwarrow"); +defineSymbol(math, main, rel, "\u21cc", "\\rightleftharpoons"); + +// AMS Negated Binary Relations +defineSymbol(math, ams, rel, "\u226e", "\\nless"); +defineSymbol(math, ams, rel, "\ue010", "\\nleqslant"); +defineSymbol(math, ams, rel, "\ue011", "\\nleqq"); +defineSymbol(math, ams, rel, "\u2a87", "\\lneq"); +defineSymbol(math, ams, rel, "\u2268", "\\lneqq"); +defineSymbol(math, ams, rel, "\ue00c", "\\lvertneqq"); +defineSymbol(math, ams, rel, "\u22e6", "\\lnsim"); +defineSymbol(math, ams, rel, "\u2a89", "\\lnapprox"); +defineSymbol(math, ams, rel, "\u2280", "\\nprec"); +defineSymbol(math, ams, rel, "\u22e0", "\\npreceq"); +defineSymbol(math, ams, rel, "\u22e8", "\\precnsim"); +defineSymbol(math, ams, rel, "\u2ab9", "\\precnapprox"); +defineSymbol(math, ams, rel, "\u2241", "\\nsim"); +defineSymbol(math, ams, rel, "\ue006", "\\nshortmid"); +defineSymbol(math, ams, rel, "\u2224", "\\nmid"); +defineSymbol(math, ams, rel, "\u22ac", "\\nvdash"); +defineSymbol(math, ams, rel, "\u22ad", "\\nvDash"); +defineSymbol(math, ams, rel, "\u22ea", "\\ntriangleleft"); +defineSymbol(math, ams, rel, "\u22ec", "\\ntrianglelefteq"); +defineSymbol(math, ams, rel, "\u228a", "\\subsetneq"); +defineSymbol(math, ams, rel, "\ue01a", "\\varsubsetneq"); +defineSymbol(math, ams, rel, "\u2acb", "\\subsetneqq"); +defineSymbol(math, ams, rel, "\ue017", "\\varsubsetneqq"); +defineSymbol(math, ams, rel, "\u226f", "\\ngtr"); +defineSymbol(math, ams, rel, "\ue00f", "\\ngeqslant"); +defineSymbol(math, ams, rel, "\ue00e", "\\ngeqq"); +defineSymbol(math, ams, rel, "\u2a88", "\\gneq"); +defineSymbol(math, ams, rel, "\u2269", "\\gneqq"); +defineSymbol(math, ams, rel, "\ue00d", "\\gvertneqq"); +defineSymbol(math, ams, rel, "\u22e7", "\\gnsim"); +defineSymbol(math, ams, rel, "\u2a8a", "\\gnapprox"); +defineSymbol(math, ams, rel, "\u2281", "\\nsucc"); +defineSymbol(math, ams, rel, "\u22e1", "\\nsucceq"); +defineSymbol(math, ams, rel, "\u22e9", "\\succnsim"); +defineSymbol(math, ams, rel, "\u2aba", "\\succnapprox"); +defineSymbol(math, ams, rel, "\u2246", "\\ncong"); +defineSymbol(math, ams, rel, "\ue007", "\\nshortparallel"); +defineSymbol(math, ams, rel, "\u2226", "\\nparallel"); +defineSymbol(math, ams, rel, "\u22af", "\\nVDash"); +defineSymbol(math, ams, rel, "\u22eb", "\\ntriangleright"); +defineSymbol(math, ams, rel, "\u22ed", "\\ntrianglerighteq"); +defineSymbol(math, ams, rel, "\ue018", "\\nsupseteqq"); +defineSymbol(math, ams, rel, "\u228b", "\\supsetneq"); +defineSymbol(math, ams, rel, "\ue01b", "\\varsupsetneq"); +defineSymbol(math, ams, rel, "\u2acc", "\\supsetneqq"); +defineSymbol(math, ams, rel, "\ue019", "\\varsupsetneqq"); +defineSymbol(math, ams, rel, "\u22ae", "\\nVdash"); +defineSymbol(math, ams, rel, "\u2ab5", "\\precneqq"); +defineSymbol(math, ams, rel, "\u2ab6", "\\succneqq"); +defineSymbol(math, ams, rel, "\ue016", "\\nsubseteqq"); +defineSymbol(math, ams, bin, "\u22b4", "\\unlhd"); +defineSymbol(math, ams, bin, "\u22b5", "\\unrhd"); + +// AMS Negated Arrows +defineSymbol(math, ams, rel, "\u219a", "\\nleftarrow"); +defineSymbol(math, ams, rel, "\u219b", "\\nrightarrow"); +defineSymbol(math, ams, rel, "\u21cd", "\\nLeftarrow"); +defineSymbol(math, ams, rel, "\u21cf", "\\nRightarrow"); +defineSymbol(math, ams, rel, "\u21ae", "\\nleftrightarrow"); +defineSymbol(math, ams, rel, "\u21ce", "\\nLeftrightarrow"); + +// AMS Misc +defineSymbol(math, ams, rel, "\u25b3", "\\vartriangle"); +defineSymbol(math, ams, textord, "\u210f", "\\hslash"); +defineSymbol(math, ams, textord, "\u25bd", "\\triangledown"); +defineSymbol(math, ams, textord, "\u25ca", "\\lozenge"); +defineSymbol(math, ams, textord, "\u24c8", "\\circledS"); +defineSymbol(math, ams, textord, "\u00ae", "\\circledR"); +defineSymbol(math, ams, textord, "\u2221", "\\measuredangle"); +defineSymbol(math, ams, textord, "\u2204", "\\nexists"); +defineSymbol(math, ams, textord, "\u2127", "\\mho"); +defineSymbol(math, ams, textord, "\u2132", "\\Finv"); +defineSymbol(math, ams, textord, "\u2141", "\\Game"); +defineSymbol(math, ams, textord, "\u006b", "\\Bbbk"); +defineSymbol(math, ams, textord, "\u2035", "\\backprime"); +defineSymbol(math, ams, textord, "\u25b2", "\\blacktriangle"); +defineSymbol(math, ams, textord, "\u25bc", "\\blacktriangledown"); +defineSymbol(math, ams, textord, "\u25a0", "\\blacksquare"); +defineSymbol(math, ams, textord, "\u29eb", "\\blacklozenge"); +defineSymbol(math, ams, textord, "\u2605", "\\bigstar"); +defineSymbol(math, ams, textord, "\u2222", "\\sphericalangle"); +defineSymbol(math, ams, textord, "\u2201", "\\complement"); +defineSymbol(math, ams, textord, "\u00f0", "\\eth"); +defineSymbol(math, ams, textord, "\u2571", "\\diagup"); +defineSymbol(math, ams, textord, "\u2572", "\\diagdown"); +defineSymbol(math, ams, textord, "\u25a1", "\\square"); +defineSymbol(math, ams, textord, "\u25a1", "\\Box"); +defineSymbol(math, ams, textord, "\u25ca", "\\Diamond"); +defineSymbol(math, ams, textord, "\u00a5", "\\yen"); +defineSymbol(math, ams, textord, "\u2713", "\\checkmark"); + +// AMS Hebrew +defineSymbol(math, ams, textord, "\u2136", "\\beth"); +defineSymbol(math, ams, textord, "\u2138", "\\daleth"); +defineSymbol(math, ams, textord, "\u2137", "\\gimel"); + +// AMS Greek +defineSymbol(math, ams, textord, "\u03dd", "\\digamma"); +defineSymbol(math, ams, textord, "\u03f0", "\\varkappa"); + +// AMS Delimiters +defineSymbol(math, ams, open, "\u250c", "\\ulcorner"); +defineSymbol(math, ams, close, "\u2510", "\\urcorner"); +defineSymbol(math, ams, open, "\u2514", "\\llcorner"); +defineSymbol(math, ams, close, "\u2518", "\\lrcorner"); + +// AMS Binary Relations +defineSymbol(math, ams, rel, "\u2266", "\\leqq"); +defineSymbol(math, ams, rel, "\u2a7d", "\\leqslant"); +defineSymbol(math, ams, rel, "\u2a95", "\\eqslantless"); +defineSymbol(math, ams, rel, "\u2272", "\\lesssim"); +defineSymbol(math, ams, rel, "\u2a85", "\\lessapprox"); +defineSymbol(math, ams, rel, "\u224a", "\\approxeq"); +defineSymbol(math, ams, bin, "\u22d6", "\\lessdot"); +defineSymbol(math, ams, rel, "\u22d8", "\\lll"); +defineSymbol(math, ams, rel, "\u2276", "\\lessgtr"); +defineSymbol(math, ams, rel, "\u22da", "\\lesseqgtr"); +defineSymbol(math, ams, rel, "\u2a8b", "\\lesseqqgtr"); +defineSymbol(math, ams, rel, "\u2251", "\\doteqdot"); +defineSymbol(math, ams, rel, "\u2253", "\\risingdotseq"); +defineSymbol(math, ams, rel, "\u2252", "\\fallingdotseq"); +defineSymbol(math, ams, rel, "\u223d", "\\backsim"); +defineSymbol(math, ams, rel, "\u22cd", "\\backsimeq"); +defineSymbol(math, ams, rel, "\u2ac5", "\\subseteqq"); +defineSymbol(math, ams, rel, "\u22d0", "\\Subset"); +defineSymbol(math, ams, rel, "\u228f", "\\sqsubset"); +defineSymbol(math, ams, rel, "\u227c", "\\preccurlyeq"); +defineSymbol(math, ams, rel, "\u22de", "\\curlyeqprec"); +defineSymbol(math, ams, rel, "\u227e", "\\precsim"); +defineSymbol(math, ams, rel, "\u2ab7", "\\precapprox"); +defineSymbol(math, ams, rel, "\u22b2", "\\vartriangleleft"); +defineSymbol(math, ams, rel, "\u22b4", "\\trianglelefteq"); +defineSymbol(math, ams, rel, "\u22a8", "\\vDash"); +defineSymbol(math, ams, rel, "\u22aa", "\\Vvdash"); +defineSymbol(math, ams, rel, "\u2323", "\\smallsmile"); +defineSymbol(math, ams, rel, "\u2322", "\\smallfrown"); +defineSymbol(math, ams, rel, "\u224f", "\\bumpeq"); +defineSymbol(math, ams, rel, "\u224e", "\\Bumpeq"); +defineSymbol(math, ams, rel, "\u2267", "\\geqq"); +defineSymbol(math, ams, rel, "\u2a7e", "\\geqslant"); +defineSymbol(math, ams, rel, "\u2a96", "\\eqslantgtr"); +defineSymbol(math, ams, rel, "\u2273", "\\gtrsim"); +defineSymbol(math, ams, rel, "\u2a86", "\\gtrapprox"); +defineSymbol(math, ams, bin, "\u22d7", "\\gtrdot"); +defineSymbol(math, ams, rel, "\u22d9", "\\ggg"); +defineSymbol(math, ams, rel, "\u2277", "\\gtrless"); +defineSymbol(math, ams, rel, "\u22db", "\\gtreqless"); +defineSymbol(math, ams, rel, "\u2a8c", "\\gtreqqless"); +defineSymbol(math, ams, rel, "\u2256", "\\eqcirc"); +defineSymbol(math, ams, rel, "\u2257", "\\circeq"); +defineSymbol(math, ams, rel, "\u225c", "\\triangleq"); +defineSymbol(math, ams, rel, "\u223c", "\\thicksim"); +defineSymbol(math, ams, rel, "\u2248", "\\thickapprox"); +defineSymbol(math, ams, rel, "\u2ac6", "\\supseteqq"); +defineSymbol(math, ams, rel, "\u22d1", "\\Supset"); +defineSymbol(math, ams, rel, "\u2290", "\\sqsupset"); +defineSymbol(math, ams, rel, "\u227d", "\\succcurlyeq"); +defineSymbol(math, ams, rel, "\u22df", "\\curlyeqsucc"); +defineSymbol(math, ams, rel, "\u227f", "\\succsim"); +defineSymbol(math, ams, rel, "\u2ab8", "\\succapprox"); +defineSymbol(math, ams, rel, "\u22b3", "\\vartriangleright"); +defineSymbol(math, ams, rel, "\u22b5", "\\trianglerighteq"); +defineSymbol(math, ams, rel, "\u22a9", "\\Vdash"); +defineSymbol(math, ams, rel, "\u2223", "\\shortmid"); +defineSymbol(math, ams, rel, "\u2225", "\\shortparallel"); +defineSymbol(math, ams, rel, "\u226c", "\\between"); +defineSymbol(math, ams, rel, "\u22d4", "\\pitchfork"); +defineSymbol(math, ams, rel, "\u221d", "\\varpropto"); +defineSymbol(math, ams, rel, "\u25c0", "\\blacktriangleleft"); +defineSymbol(math, ams, rel, "\u2234", "\\therefore"); +defineSymbol(math, ams, rel, "\u220d", "\\backepsilon"); +defineSymbol(math, ams, rel, "\u25b6", "\\blacktriangleright"); +defineSymbol(math, ams, rel, "\u2235", "\\because"); +defineSymbol(math, ams, rel, "\u22d8", "\\llless"); +defineSymbol(math, ams, rel, "\u22d9", "\\gggtr"); +defineSymbol(math, ams, bin, "\u22b2", "\\lhd"); +defineSymbol(math, ams, bin, "\u22b3", "\\rhd"); +defineSymbol(math, ams, rel, "\u2242", "\\eqsim"); +defineSymbol(math, main, rel, "\u22c8", "\\Join"); +defineSymbol(math, ams, rel, "\u2251", "\\Doteq"); + +// AMS Binary Operators +defineSymbol(math, ams, bin, "\u2214", "\\dotplus"); +defineSymbol(math, ams, bin, "\u2216", "\\smallsetminus"); +defineSymbol(math, ams, bin, "\u22d2", "\\Cap"); +defineSymbol(math, ams, bin, "\u22d3", "\\Cup"); +defineSymbol(math, ams, bin, "\u2a5e", "\\doublebarwedge"); +defineSymbol(math, ams, bin, "\u229f", "\\boxminus"); +defineSymbol(math, ams, bin, "\u229e", "\\boxplus"); +defineSymbol(math, ams, bin, "\u22c7", "\\divideontimes"); +defineSymbol(math, ams, bin, "\u22c9", "\\ltimes"); +defineSymbol(math, ams, bin, "\u22ca", "\\rtimes"); +defineSymbol(math, ams, bin, "\u22cb", "\\leftthreetimes"); +defineSymbol(math, ams, bin, "\u22cc", "\\rightthreetimes"); +defineSymbol(math, ams, bin, "\u22cf", "\\curlywedge"); +defineSymbol(math, ams, bin, "\u22ce", "\\curlyvee"); +defineSymbol(math, ams, bin, "\u229d", "\\circleddash"); +defineSymbol(math, ams, bin, "\u229b", "\\circledast"); +defineSymbol(math, ams, bin, "\u22c5", "\\centerdot"); +defineSymbol(math, ams, bin, "\u22ba", "\\intercal"); +defineSymbol(math, ams, bin, "\u22d2", "\\doublecap"); +defineSymbol(math, ams, bin, "\u22d3", "\\doublecup"); +defineSymbol(math, ams, bin, "\u22a0", "\\boxtimes"); + +// AMS Arrows +defineSymbol(math, ams, rel, "\u21e2", "\\dashrightarrow"); +defineSymbol(math, ams, rel, "\u21e0", "\\dashleftarrow"); +defineSymbol(math, ams, rel, "\u21c7", "\\leftleftarrows"); +defineSymbol(math, ams, rel, "\u21c6", "\\leftrightarrows"); +defineSymbol(math, ams, rel, "\u21da", "\\Lleftarrow"); +defineSymbol(math, ams, rel, "\u219e", "\\twoheadleftarrow"); +defineSymbol(math, ams, rel, "\u21a2", "\\leftarrowtail"); +defineSymbol(math, ams, rel, "\u21ab", "\\looparrowleft"); +defineSymbol(math, ams, rel, "\u21cb", "\\leftrightharpoons"); +defineSymbol(math, ams, rel, "\u21b6", "\\curvearrowleft"); +defineSymbol(math, ams, rel, "\u21ba", "\\circlearrowleft"); +defineSymbol(math, ams, rel, "\u21b0", "\\Lsh"); +defineSymbol(math, ams, rel, "\u21c8", "\\upuparrows"); +defineSymbol(math, ams, rel, "\u21bf", "\\upharpoonleft"); +defineSymbol(math, ams, rel, "\u21c3", "\\downharpoonleft"); +defineSymbol(math, ams, rel, "\u22b8", "\\multimap"); +defineSymbol(math, ams, rel, "\u21ad", "\\leftrightsquigarrow"); +defineSymbol(math, ams, rel, "\u21c9", "\\rightrightarrows"); +defineSymbol(math, ams, rel, "\u21c4", "\\rightleftarrows"); +defineSymbol(math, ams, rel, "\u21a0", "\\twoheadrightarrow"); +defineSymbol(math, ams, rel, "\u21a3", "\\rightarrowtail"); +defineSymbol(math, ams, rel, "\u21ac", "\\looparrowright"); +defineSymbol(math, ams, rel, "\u21b7", "\\curvearrowright"); +defineSymbol(math, ams, rel, "\u21bb", "\\circlearrowright"); +defineSymbol(math, ams, rel, "\u21b1", "\\Rsh"); +defineSymbol(math, ams, rel, "\u21ca", "\\downdownarrows"); +defineSymbol(math, ams, rel, "\u21be", "\\upharpoonright"); +defineSymbol(math, ams, rel, "\u21c2", "\\downharpoonright"); +defineSymbol(math, ams, rel, "\u21dd", "\\rightsquigarrow"); +defineSymbol(math, ams, rel, "\u21dd", "\\leadsto"); +defineSymbol(math, ams, rel, "\u21db", "\\Rrightarrow"); +defineSymbol(math, ams, rel, "\u21be", "\\restriction"); + +defineSymbol(math, main, textord, "\u2018", "`"); +defineSymbol(math, main, textord, "$", "\\$"); +defineSymbol(text, main, textord, "$", "\\$"); +defineSymbol(math, main, textord, "%", "\\%"); +defineSymbol(text, main, textord, "%", "\\%"); +defineSymbol(math, main, textord, "_", "\\_"); +defineSymbol(text, main, textord, "_", "\\_"); +defineSymbol(math, main, textord, "\u2220", "\\angle"); +defineSymbol(math, main, textord, "\u221e", "\\infty"); +defineSymbol(math, main, textord, "\u2032", "\\prime"); +defineSymbol(math, main, textord, "\u25b3", "\\triangle"); +defineSymbol(math, main, textord, "\u0393", "\\Gamma"); +defineSymbol(math, main, textord, "\u0394", "\\Delta"); +defineSymbol(math, main, textord, "\u0398", "\\Theta"); +defineSymbol(math, main, textord, "\u039b", "\\Lambda"); +defineSymbol(math, main, textord, "\u039e", "\\Xi"); +defineSymbol(math, main, textord, "\u03a0", "\\Pi"); +defineSymbol(math, main, textord, "\u03a3", "\\Sigma"); +defineSymbol(math, main, textord, "\u03a5", "\\Upsilon"); +defineSymbol(math, main, textord, "\u03a6", "\\Phi"); +defineSymbol(math, main, textord, "\u03a8", "\\Psi"); +defineSymbol(math, main, textord, "\u03a9", "\\Omega"); +defineSymbol(math, main, textord, "\u00ac", "\\neg"); +defineSymbol(math, main, textord, "\u00ac", "\\lnot"); +defineSymbol(math, main, textord, "\u22a4", "\\top"); +defineSymbol(math, main, textord, "\u22a5", "\\bot"); +defineSymbol(math, main, textord, "\u2205", "\\emptyset"); +defineSymbol(math, ams, textord, "\u2205", "\\varnothing"); +defineSymbol(math, main, mathord, "\u03b1", "\\alpha"); +defineSymbol(math, main, mathord, "\u03b2", "\\beta"); +defineSymbol(math, main, mathord, "\u03b3", "\\gamma"); +defineSymbol(math, main, mathord, "\u03b4", "\\delta"); +defineSymbol(math, main, mathord, "\u03f5", "\\epsilon"); +defineSymbol(math, main, mathord, "\u03b6", "\\zeta"); +defineSymbol(math, main, mathord, "\u03b7", "\\eta"); +defineSymbol(math, main, mathord, "\u03b8", "\\theta"); +defineSymbol(math, main, mathord, "\u03b9", "\\iota"); +defineSymbol(math, main, mathord, "\u03ba", "\\kappa"); +defineSymbol(math, main, mathord, "\u03bb", "\\lambda"); +defineSymbol(math, main, mathord, "\u03bc", "\\mu"); +defineSymbol(math, main, mathord, "\u03bd", "\\nu"); +defineSymbol(math, main, mathord, "\u03be", "\\xi"); +defineSymbol(math, main, mathord, "o", "\\omicron"); +defineSymbol(math, main, mathord, "\u03c0", "\\pi"); +defineSymbol(math, main, mathord, "\u03c1", "\\rho"); +defineSymbol(math, main, mathord, "\u03c3", "\\sigma"); +defineSymbol(math, main, mathord, "\u03c4", "\\tau"); +defineSymbol(math, main, mathord, "\u03c5", "\\upsilon"); +defineSymbol(math, main, mathord, "\u03d5", "\\phi"); +defineSymbol(math, main, mathord, "\u03c7", "\\chi"); +defineSymbol(math, main, mathord, "\u03c8", "\\psi"); +defineSymbol(math, main, mathord, "\u03c9", "\\omega"); +defineSymbol(math, main, mathord, "\u03b5", "\\varepsilon"); +defineSymbol(math, main, mathord, "\u03d1", "\\vartheta"); +defineSymbol(math, main, mathord, "\u03d6", "\\varpi"); +defineSymbol(math, main, mathord, "\u03f1", "\\varrho"); +defineSymbol(math, main, mathord, "\u03c2", "\\varsigma"); +defineSymbol(math, main, mathord, "\u03c6", "\\varphi"); +defineSymbol(math, main, bin, "\u2217", "*"); +defineSymbol(math, main, bin, "+", "+"); +defineSymbol(math, main, bin, "\u2212", "-"); +defineSymbol(math, main, bin, "\u22c5", "\\cdot"); +defineSymbol(math, main, bin, "\u2218", "\\circ"); +defineSymbol(math, main, bin, "\u00f7", "\\div"); +defineSymbol(math, main, bin, "\u00b1", "\\pm"); +defineSymbol(math, main, bin, "\u00d7", "\\times"); +defineSymbol(math, main, bin, "\u2229", "\\cap"); +defineSymbol(math, main, bin, "\u222a", "\\cup"); +defineSymbol(math, main, bin, "\u2216", "\\setminus"); +defineSymbol(math, main, bin, "\u2227", "\\land"); +defineSymbol(math, main, bin, "\u2228", "\\lor"); +defineSymbol(math, main, bin, "\u2227", "\\wedge"); +defineSymbol(math, main, bin, "\u2228", "\\vee"); +defineSymbol(math, main, textord, "\u221a", "\\surd"); +defineSymbol(math, main, open, "(", "("); +defineSymbol(math, main, open, "[", "["); +defineSymbol(math, main, open, "\u27e8", "\\langle"); +defineSymbol(math, main, open, "\u2223", "\\lvert"); +defineSymbol(math, main, open, "\u2225", "\\lVert"); +defineSymbol(math, main, close, ")", ")"); +defineSymbol(math, main, close, "]", "]"); +defineSymbol(math, main, close, "?", "?"); +defineSymbol(math, main, close, "!", "!"); +defineSymbol(math, main, close, "\u27e9", "\\rangle"); +defineSymbol(math, main, close, "\u2223", "\\rvert"); +defineSymbol(math, main, close, "\u2225", "\\rVert"); +defineSymbol(math, main, rel, "=", "="); +defineSymbol(math, main, rel, "<", "<"); +defineSymbol(math, main, rel, ">", ">"); +defineSymbol(math, main, rel, ":", ":"); +defineSymbol(math, main, rel, "\u2248", "\\approx"); +defineSymbol(math, main, rel, "\u2245", "\\cong"); +defineSymbol(math, main, rel, "\u2265", "\\ge"); +defineSymbol(math, main, rel, "\u2265", "\\geq"); +defineSymbol(math, main, rel, "\u2190", "\\gets"); +defineSymbol(math, main, rel, ">", "\\gt"); +defineSymbol(math, main, rel, "\u2208", "\\in"); +defineSymbol(math, main, rel, "\u2209", "\\notin"); +defineSymbol(math, main, rel, "\u2282", "\\subset"); +defineSymbol(math, main, rel, "\u2283", "\\supset"); +defineSymbol(math, main, rel, "\u2286", "\\subseteq"); +defineSymbol(math, main, rel, "\u2287", "\\supseteq"); +defineSymbol(math, ams, rel, "\u2288", "\\nsubseteq"); +defineSymbol(math, ams, rel, "\u2289", "\\nsupseteq"); +defineSymbol(math, main, rel, "\u22a8", "\\models"); +defineSymbol(math, main, rel, "\u2190", "\\leftarrow"); +defineSymbol(math, main, rel, "\u2264", "\\le"); +defineSymbol(math, main, rel, "\u2264", "\\leq"); +defineSymbol(math, main, rel, "<", "\\lt"); +defineSymbol(math, main, rel, "\u2260", "\\ne"); +defineSymbol(math, main, rel, "\u2260", "\\neq"); +defineSymbol(math, main, rel, "\u2192", "\\rightarrow"); +defineSymbol(math, main, rel, "\u2192", "\\to"); +defineSymbol(math, ams, rel, "\u2271", "\\ngeq"); +defineSymbol(math, ams, rel, "\u2270", "\\nleq"); +defineSymbol(math, main, spacing, null, "\\!"); +defineSymbol(math, main, spacing, "\u00a0", "\\ "); +defineSymbol(math, main, spacing, "\u00a0", "~"); +defineSymbol(math, main, spacing, null, "\\,"); +defineSymbol(math, main, spacing, null, "\\:"); +defineSymbol(math, main, spacing, null, "\\;"); +defineSymbol(math, main, spacing, null, "\\enspace"); +defineSymbol(math, main, spacing, null, "\\qquad"); +defineSymbol(math, main, spacing, null, "\\quad"); +defineSymbol(math, main, spacing, "\u00a0", "\\space"); +defineSymbol(math, main, punct, ",", ","); +defineSymbol(math, main, punct, ";", ";"); +defineSymbol(math, main, punct, ":", "\\colon"); +defineSymbol(math, ams, bin, "\u22bc", "\\barwedge"); +defineSymbol(math, ams, bin, "\u22bb", "\\veebar"); +defineSymbol(math, main, bin, "\u2299", "\\odot"); +defineSymbol(math, main, bin, "\u2295", "\\oplus"); +defineSymbol(math, main, bin, "\u2297", "\\otimes"); +defineSymbol(math, main, textord, "\u2202", "\\partial"); +defineSymbol(math, main, bin, "\u2298", "\\oslash"); +defineSymbol(math, ams, bin, "\u229a", "\\circledcirc"); +defineSymbol(math, ams, bin, "\u22a1", "\\boxdot"); +defineSymbol(math, main, bin, "\u25b3", "\\bigtriangleup"); +defineSymbol(math, main, bin, "\u25bd", "\\bigtriangledown"); +defineSymbol(math, main, bin, "\u2020", "\\dagger"); +defineSymbol(math, main, bin, "\u22c4", "\\diamond"); +defineSymbol(math, main, bin, "\u22c6", "\\star"); +defineSymbol(math, main, bin, "\u25c3", "\\triangleleft"); +defineSymbol(math, main, bin, "\u25b9", "\\triangleright"); +defineSymbol(math, main, open, "{", "\\{"); +defineSymbol(text, main, textord, "{", "\\{"); +defineSymbol(math, main, close, "}", "\\}"); +defineSymbol(text, main, textord, "}", "\\}"); +defineSymbol(math, main, open, "{", "\\lbrace"); +defineSymbol(math, main, close, "}", "\\rbrace"); +defineSymbol(math, main, open, "[", "\\lbrack"); +defineSymbol(math, main, close, "]", "\\rbrack"); +defineSymbol(math, main, open, "\u230a", "\\lfloor"); +defineSymbol(math, main, close, "\u230b", "\\rfloor"); +defineSymbol(math, main, open, "\u2308", "\\lceil"); +defineSymbol(math, main, close, "\u2309", "\\rceil"); +defineSymbol(math, main, textord, "\\", "\\backslash"); +defineSymbol(math, main, textord, "\u2223", "|"); +defineSymbol(math, main, textord, "\u2223", "\\vert"); +defineSymbol(math, main, textord, "\u2225", "\\|"); +defineSymbol(math, main, textord, "\u2225", "\\Vert"); +defineSymbol(math, main, rel, "\u2191", "\\uparrow"); +defineSymbol(math, main, rel, "\u21d1", "\\Uparrow"); +defineSymbol(math, main, rel, "\u2193", "\\downarrow"); +defineSymbol(math, main, rel, "\u21d3", "\\Downarrow"); +defineSymbol(math, main, rel, "\u2195", "\\updownarrow"); +defineSymbol(math, main, rel, "\u21d5", "\\Updownarrow"); +defineSymbol(math, math, op, "\u2210", "\\coprod"); +defineSymbol(math, math, op, "\u22c1", "\\bigvee"); +defineSymbol(math, math, op, "\u22c0", "\\bigwedge"); +defineSymbol(math, math, op, "\u2a04", "\\biguplus"); +defineSymbol(math, math, op, "\u22c2", "\\bigcap"); +defineSymbol(math, math, op, "\u22c3", "\\bigcup"); +defineSymbol(math, math, op, "\u222b", "\\int"); +defineSymbol(math, math, op, "\u222b", "\\intop"); +defineSymbol(math, math, op, "\u222c", "\\iint"); +defineSymbol(math, math, op, "\u222d", "\\iiint"); +defineSymbol(math, math, op, "\u220f", "\\prod"); +defineSymbol(math, math, op, "\u2211", "\\sum"); +defineSymbol(math, math, op, "\u2a02", "\\bigotimes"); +defineSymbol(math, math, op, "\u2a01", "\\bigoplus"); +defineSymbol(math, math, op, "\u2a00", "\\bigodot"); +defineSymbol(math, math, op, "\u222e", "\\oint"); +defineSymbol(math, math, op, "\u2a06", "\\bigsqcup"); +defineSymbol(math, math, op, "\u222b", "\\smallint"); +defineSymbol(text, main, inner, "\u2026", "\\textellipsis"); +defineSymbol(math, main, inner, "\u2026", "\\mathellipsis"); +defineSymbol(text, main, inner, "\u2026", "\\ldots"); +defineSymbol(math, main, inner, "\u2026", "\\ldots"); +defineSymbol(math, main, inner, "\u22ef", "\\cdots"); +defineSymbol(math, main, inner, "\u22f1", "\\ddots"); +defineSymbol(math, main, textord, "\u22ee", "\\vdots"); +defineSymbol(math, main, accent, "\u00b4", "\\acute"); +defineSymbol(math, main, accent, "\u0060", "\\grave"); +defineSymbol(math, main, accent, "\u00a8", "\\ddot"); +defineSymbol(math, main, accent, "\u007e", "\\tilde"); +defineSymbol(math, main, accent, "\u00af", "\\bar"); +defineSymbol(math, main, accent, "\u02d8", "\\breve"); +defineSymbol(math, main, accent, "\u02c7", "\\check"); +defineSymbol(math, main, accent, "\u005e", "\\hat"); +defineSymbol(math, main, accent, "\u20d7", "\\vec"); +defineSymbol(math, main, accent, "\u02d9", "\\dot"); +defineSymbol(math, main, mathord, "\u0131", "\\imath"); +defineSymbol(math, main, mathord, "\u0237", "\\jmath"); + +defineSymbol(text, main, textord, "\u2013", "--"); +defineSymbol(text, main, textord, "\u2014", "---"); +defineSymbol(text, main, textord, "\u2018", "`"); +defineSymbol(text, main, textord, "\u2019", "'"); +defineSymbol(text, main, textord, "\u201c", "``"); +defineSymbol(text, main, textord, "\u201d", "''"); +defineSymbol(math, main, textord, "\u00b0", "\\degree"); +defineSymbol(text, main, textord, "\u00b0", "\\degree"); +defineSymbol(math, main, mathord, "\u00a3", "\\pounds"); +defineSymbol(math, ams, textord, "\u2720", "\\maltese"); +defineSymbol(text, ams, textord, "\u2720", "\\maltese"); + +defineSymbol(text, main, spacing, "\u00a0", "\\ "); +defineSymbol(text, main, spacing, "\u00a0", " "); +defineSymbol(text, main, spacing, "\u00a0", "~"); + +// There are lots of symbols which are the same, so we add them in afterwards. +var i; +var ch; + +// All of these are textords in math mode +var mathTextSymbols = "0123456789/@.\""; +for (i = 0; i < mathTextSymbols.length; i++) { + ch = mathTextSymbols.charAt(i); + defineSymbol(math, main, textord, ch, ch); +} + +// All of these are textords in text mode +var textSymbols = "0123456789!@*()-=+[]\";:?/.,"; +for (i = 0; i < textSymbols.length; i++) { + ch = textSymbols.charAt(i); + defineSymbol(text, main, textord, ch, ch); +} + +// All of these are textords in text mode, and mathords in math mode +var letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; +for (i = 0; i < letters.length; i++) { + ch = letters.charAt(i); + defineSymbol(math, main, mathord, ch, ch); + defineSymbol(text, main, textord, ch, ch); +} + +// Latin-1 letters +for (i = 0x00C0; i <= 0x00D6; i++) { + ch = String.fromCharCode(i); + defineSymbol(text, main, textord, ch, ch); +} + +for (i = 0x00D8; i <= 0x00F6; i++) { + ch = String.fromCharCode(i); + defineSymbol(text, main, textord, ch, ch); +} + +for (i = 0x00F8; i <= 0x00FF; i++) { + ch = String.fromCharCode(i); + defineSymbol(text, main, textord, ch, ch); +} + +// Cyrillic +for (i = 0x0410; i <= 0x044F; i++) { + ch = String.fromCharCode(i); + defineSymbol(text, main, textord, ch, ch); +} + +// Unicode versions of existing characters +defineSymbol(text, main, textord, "\u2013", "–"); +defineSymbol(text, main, textord, "\u2014", "—"); +defineSymbol(text, main, textord, "\u2018", "‘"); +defineSymbol(text, main, textord, "\u2019", "’"); +defineSymbol(text, main, textord, "\u201c", "“"); +defineSymbol(text, main, textord, "\u201d", "”"); + +},{}],24:[function(require,module,exports){ +var hangulRegex = /[\uAC00-\uD7AF]/; + +// This regex combines +// - Hiragana: [\u3040-\u309F] +// - Katakana: [\u30A0-\u30FF] +// - CJK ideograms: [\u4E00-\u9FAF] +// - Hangul syllables: [\uAC00-\uD7AF] +// Notably missing are halfwidth Katakana and Romanji glyphs. +var cjkRegex = + /[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/; + +module.exports = { + cjkRegex: cjkRegex, + hangulRegex: hangulRegex +}; + +},{}],25:[function(require,module,exports){ +/** + * This file contains a list of utility functions which are useful in other + * files. + */ + +/** + * Provide an `indexOf` function which works in IE8, but defers to native if + * possible. + */ +var nativeIndexOf = Array.prototype.indexOf; +var indexOf = function(list, elem) { + if (list == null) { + return -1; + } + if (nativeIndexOf && list.indexOf === nativeIndexOf) { + return list.indexOf(elem); + } + var i = 0; + var l = list.length; + for (; i < l; i++) { + if (list[i] === elem) { + return i; + } + } + return -1; +}; + +/** + * Return whether an element is contained in a list + */ +var contains = function(list, elem) { + return indexOf(list, elem) !== -1; +}; + +/** + * Provide a default value if a setting is undefined + */ +var deflt = function(setting, defaultIfUndefined) { + return setting === undefined ? defaultIfUndefined : setting; +}; + +// hyphenate and escape adapted from Facebook's React under Apache 2 license + +var uppercase = /([A-Z])/g; +var hyphenate = function(str) { + return str.replace(uppercase, "-$1").toLowerCase(); +}; + +var ESCAPE_LOOKUP = { + "&": "&", + ">": ">", + "<": "<", + "\"": """, + "'": "'" +}; + +var ESCAPE_REGEX = /[&><"']/g; + +function escaper(match) { + return ESCAPE_LOOKUP[match]; +} + +/** + * Escapes text to prevent scripting attacks. + * + * @param {*} text Text value to escape. + * @return {string} An escaped string. + */ +function escape(text) { + return ("" + text).replace(ESCAPE_REGEX, escaper); +} + +/** + * A function to set the text content of a DOM element in all supported + * browsers. Note that we don't define this if there is no document. + */ +var setTextContent; +if (typeof document !== "undefined") { + var testNode = document.createElement("span"); + if ("textContent" in testNode) { + setTextContent = function(node, text) { + node.textContent = text; + }; + } else { + setTextContent = function(node, text) { + node.innerText = text; + }; + } +} + +/** + * A function to clear a node. + */ +function clearNode(node) { + setTextContent(node, ""); +} + +module.exports = { + contains: contains, + deflt: deflt, + escape: escape, + hyphenate: hyphenate, + indexOf: indexOf, + setTextContent: setTextContent, + clearNode: clearNode +}; + +},{}]},{},[1])(1) +}); \ No newline at end of file diff --git a/js/remarkable.min.js b/js/remarkable.min.js new file mode 100644 index 0000000..72e72e3 --- /dev/null +++ b/js/remarkable.min.js @@ -0,0 +1,4 @@ +/*! remarkable 1.7.1 https://github.com/jonschlinkert/remarkable @license MIT */ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Remarkable=e()}}(function(){var e;return function t(e,r,n){function s(i,l){if(!r[i]){if(!e[i]){var a="function"==typeof require&&require;if(!l&&a)return a(i,!0);if(o)return o(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[i]={exports:{}};e[i][0].call(u.exports,function(t){var r=e[i][1][t];return s(r?r:t)},u,u.exports,t,e,r,n)}return r[i].exports}for(var o="function"==typeof require&&require,i=0;i",Gt:"≫",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒","in":"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬","int":"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",LT:"<",Lt:"≪",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}},{}],2:[function(e,t){"use strict";var r={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach(function(e){r[e]=!0}),t.exports=r},{}],3:[function(e,t){"use strict";function r(e,t){return e=e.source,t=t||"",function r(n,s){return n?(s=s.source||s,e=e.replace(n,s),r):new RegExp(e,t)}}var n=/[a-zA-Z_:][a-zA-Z0-9:._-]*/,s=/[^"'=<>`\x00-\x20]+/,o=/'[^']*'/,i=/"[^"]*"/,l=r(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",s)("single_quoted",o)("double_quoted",i)(),a=r(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",n)("attr_value",l)(),c=r(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",a)(),u=/<\/[A-Za-z][A-Za-z0-9]*\s*>/,p=//,h=/<[?].*?[?]>/,f=/]*>/,d=/])*\]\]>/,g=r(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",c)("close_tag",u)("comment",p)("processing",h)("declaration",f)("cdata",d)();t.exports.HTML_TAG_RE=g},{}],4:[function(e,t){"use strict";t.exports=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"]},{}],5:[function(e,t,r){"use strict";function n(e){return Object.prototype.toString.call(e)}function s(e){return"[object String]"===n(e)}function o(e,t){return e?d.call(e,t):!1}function i(e){var t=[].slice.call(arguments,1);return t.forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(r){e[r]=t[r]})}}),e}function l(e){return e.indexOf("\\")<0?e:e.replace(g,"$1")}function a(e){return e>=55296&&57343>=e?!1:e>=64976&&65007>=e?!1:65535===(65535&e)||65534===(65535&e)?!1:e>=0&&8>=e?!1:11===e?!1:e>=14&&31>=e?!1:e>=127&&159>=e?!1:e>1114111?!1:!0}function c(e){if(e>65535){e-=65536;var t=55296+(e>>10),r=56320+(1023&e);return String.fromCharCode(t,r)}return String.fromCharCode(e)}function u(e,t){var r=0;return o(v,t)?v[t]:35===t.charCodeAt(0)&&b.test(t)&&(r="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10),a(r))?c(r):e}function p(e){return e.indexOf("&")<0?e:e.replace(m,u)}function h(e){return y[e]}function f(e){return k.test(e)?e.replace(_,h):e}var d=Object.prototype.hasOwnProperty,g=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g,m=/&([a-z#][a-z0-9]{1,31});/gi,b=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,v=e("./entities"),k=/[&<>"]/,_=/[&<>"]/g,y={"&":"&","<":"<",">":">",'"':"""};r.assign=i,r.isString=s,r.has=o,r.unescapeMd=l,r.isValidEntityCode=a,r.fromCodePoint=c,r.replaceEntities=p,r.escapeHtml=f},{"./entities":1}],6:[function(e,t){"use strict";t.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}},{}],7:[function(e,t){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","linkify","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","footnote","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}}},{}],8:[function(e,t){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}}},{}],9:[function(e,t){"use strict";var r=e("../common/utils").replaceEntities;t.exports=function(e){var t=r(e);try{t=decodeURI(t)}catch(n){}return encodeURI(t)}},{"../common/utils":5}],10:[function(e,t){"use strict";t.exports=function(e){return e.trim().replace(/\s+/g," ").toUpperCase()}},{}],11:[function(e,t){"use strict";var r=e("./normalize_link"),n=e("../common/utils").unescapeMd;t.exports=function(e,t){var s,o,i,l=t,a=e.posMax;if(60===e.src.charCodeAt(t)){for(t++;a>t;){if(s=e.src.charCodeAt(t),10===s)return!1;if(62===s)return i=r(n(e.src.slice(l+1,t))),e.parser.validateLink(i)?(e.pos=t+1,e.linkContent=i,!0):!1;92===s&&a>t+1?t+=2:t++}return!1}for(o=0;a>t&&(s=e.src.charCodeAt(t),32!==s)&&!(s>8&&14>s);)if(92===s&&a>t+1)t+=2;else{if(40===s&&(o++,o>1))break;if(41===s&&(o--,0>o))break;t++}return l===t?!1:(i=n(e.src.slice(l,t)),e.parser.validateLink(i)?(e.linkContent=i,e.pos=t,!0):!1)}},{"../common/utils":5,"./normalize_link":9}],12:[function(e,t){"use strict";t.exports=function(e,t){ +var r,n,s,o=-1,i=e.posMax,l=e.pos,a=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,r=1;e.post;){if(n=e.src.charCodeAt(t),n===i)return e.pos=t+1,e.linkContent=r(e.src.slice(s+1,t)),!0;92===n&&o>t+1?t+=2:t++}return!1}},{"../common/utils":5}],14:[function(e,t){"use strict";function r(e,t,r){this.src=t,this.env=r,this.options=e.options,this.tokens=[],this.inlineMode=!1,this.inline=e.inline,this.block=e.block,this.renderer=e.renderer,this.typographer=e.typographer}function n(e,t){"string"!=typeof e&&(t=e,e="default"),this.inline=new a,this.block=new l,this.core=new i,this.renderer=new o,this.ruler=new c,this.options={},this.configure(u[e]),this.set(t||{})}var s=e("./common/utils").assign,o=e("./renderer"),i=e("./parser_core"),l=e("./parser_block"),a=e("./parser_inline"),c=e("./ruler"),u={"default":e("./configs/default"),full:e("./configs/full"),commonmark:e("./configs/commonmark")};n.prototype.set=function(e){s(this.options,e)},n.prototype.configure=function(e){var t=this;if(!e)throw new Error("Wrong `remarkable` preset, check name/content");e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(r){e.components[r].rules&&t[r].ruler.enable(e.components[r].rules,!0)})},n.prototype.use=function(e,t){return e(this,t),this},n.prototype.parse=function(e,t){var n=new r(this,e,t);return this.core.process(n),n.tokens},n.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},n.prototype.parseInline=function(e,t){var n=new r(this,e,t);return n.inlineMode=!0,this.core.process(n),n.tokens},n.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},t.exports=n,t.exports.utils=e("./common/utils")},{"./common/utils":5,"./configs/commonmark":6,"./configs/default":7,"./configs/full":8,"./parser_block":15,"./parser_core":16,"./parser_inline":17,"./renderer":18,"./ruler":19}],15:[function(e,t){"use strict";function r(){this.ruler=new n;for(var e=0;el&&(e.line=l=e.skipEmptyLines(l),!(l>=r))&&!(e.tShift[l]s&&!(n=o[s](e,l,r,!1));s++);if(e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),l=e.line,r>l&&e.isEmpty(l)){if(a=!0,l++,r>l&&"list"===e.parentType&&e.isEmpty(l))break;e.line=l}}};var i=/[\n\t]/g,l=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,a=/\u00a0/g;r.prototype.parse=function(e,t,r,n){var o,c=0,u=0;return e?(e=e.replace(a," "),e=e.replace(l,"\n"),e.indexOf(" ")>=0&&(e=e.replace(i,function(t,r){var n;return 10===e.charCodeAt(r)?(c=r+1,u=0,t):(n=" ".slice((r-c-u)%4),u=r-c+1,n)})),o=new s(e,this,t,r,n),void this.tokenize(o,o.line,o.lineMax)):[]},t.exports=r},{"./ruler":19,"./rules_block/blockquote":21,"./rules_block/code":22,"./rules_block/deflist":23,"./rules_block/fences":24,"./rules_block/footnote":25,"./rules_block/heading":26,"./rules_block/hr":27,"./rules_block/htmlblock":28,"./rules_block/lheading":29,"./rules_block/list":30,"./rules_block/paragraph":31,"./rules_block/state_block":32,"./rules_block/table":33}],16:[function(e,t){"use strict";function r(){this.options={},this.ruler=new n;for(var e=0;et;t++)n[t](e)},t.exports=r},{"./ruler":19,"./rules_core/abbr":34,"./rules_core/abbr2":35,"./rules_core/block":36,"./rules_core/footnote_tail":37,"./rules_core/inline":38,"./rules_core/linkify":39,"./rules_core/references":40,"./rules_core/replacements":41,"./rules_core/smartquotes":42}],17:[function(e,t){"use strict";function r(){this.ruler=new s;for(var e=0;e0)return void(e.pos=r);for(t=0;s>t;t++)if(n[t](e,!0))return void e.cacheSet(o,e.pos);e.pos++,e.cacheSet(o,e.pos)},r.prototype.tokenize=function(e){for(var t,r,n=this.ruler.getRules(""),s=n.length,o=e.posMax;e.posr&&!(t=n[r](e,!1));r++);if(t){if(e.pos>=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},r.prototype.parse=function(e,t,r,n){var s=new o(e,this,t,r,n);this.tokenize(s)},t.exports=r},{"./common/utils":5,"./ruler":19,"./rules_inline/autolink":43,"./rules_inline/backticks":44,"./rules_inline/del":45,"./rules_inline/emphasis":46,"./rules_inline/entity":47,"./rules_inline/escape":48,"./rules_inline/footnote_inline":49,"./rules_inline/footnote_ref":50,"./rules_inline/htmltag":51,"./rules_inline/ins":52,"./rules_inline/links":53,"./rules_inline/mark":54,"./rules_inline/newline":55,"./rules_inline/state_inline":56,"./rules_inline/sub":57,"./rules_inline/sup":58,"./rules_inline/text":59}],18:[function(e,t){"use strict";function r(){this.rules=n.assign({},s),this.getBreak=s.getBreak}var n=e("./common/utils"),s=e("./rules");t.exports=r,r.prototype.renderInline=function(e,t,r){for(var n=this.rules,s=e.length,o=0,i="";s--;)i+=n[e[o].type](e,o++,t,r,this);return i},r.prototype.render=function(e,t,r){for(var n=this.rules,s=e.length,o=-1,i="";++ot)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!0},this),this.__cache__=null},r.prototype.disable=function(e){e=Array.isArray(e)?e:[e],e.forEach(function(e){var t=this.__find__(e);if(0>t)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!1},this),this.__cache__=null},r.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},t.exports=r},{}],20:[function(e,t){"use strict";function r(e,t){return++t>=e.length-2?t:"paragraph_open"===e[t].type&&e[t].tight&&"inline"===e[t+1].type&&0===e[t+1].content.length&&"paragraph_close"===e[t+2].type&&e[t+2].tight?r(e,t+2):t}var n=e("./common/utils").has,s=e("./common/utils").unescapeMd,o=e("./common/utils").replaceEntities,i=e("./common/utils").escapeHtml,l={};l.blockquote_open=function(){return"
\n"},l.blockquote_close=function(e,t){return"
"+a(e,t)},l.code=function(e,t){return e[t].block?"
"+i(e[t].content)+"
"+a(e,t):""+i(e[t].content)+""},l.fence=function(e,t,r,l,c){var u,p,h,f=e[t],d="",g=r.langPrefix,m="";if(f.params){if(u=f.params.split(/\s+/g),p=u.join(" "),n(c.rules.fence_custom,u[0]))return c.rules.fence_custom[u[0]](e,t,r,l,c);m=i(o(s(p))),d=' class="'+g+m+'"'}return h=r.highlight?r.highlight.apply(r.highlight,[f.content].concat(u))||i(f.content):i(f.content),"
"+h+"
"+a(e,t)},l.fence_custom={},l.heading_open=function(e,t){return""},l.heading_close=function(e,t){return"\n"},l.hr=function(e,t,r){return(r.xhtmlOut?"
":"
")+a(e,t)},l.bullet_list_open=function(){return"
    \n"},l.bullet_list_close=function(e,t){return"
"+a(e,t)},l.list_item_open=function(){return"
  • "},l.list_item_close=function(){return"
  • \n"},l.ordered_list_open=function(e,t){var r=e[t],n=r.order>1?' start="'+r.order+'"':"";return"\n"},l.ordered_list_close=function(e,t){return""+a(e,t)},l.paragraph_open=function(e,t){return e[t].tight?"":"

    "},l.paragraph_close=function(e,t){var r=!(e[t].tight&&t&&"inline"===e[t-1].type&&!e[t-1].content);return(e[t].tight?"":"

    ")+(r?a(e,t):"")},l.link_open=function(e,t,r){var n=e[t].title?' title="'+i(o(e[t].title))+'"':"",s=r.linkTarget?' target="'+r.linkTarget+'"':"";return'"},l.link_close=function(){return""},l.image=function(e,t,r){var n=' src="'+i(e[t].src)+'"',l=e[t].title?' title="'+i(o(e[t].title))+'"':"",a=' alt="'+(e[t].alt?i(o(s(e[t].alt))):"")+'"',c=r.xhtmlOut?" /":"";return""},l.table_open=function(){return"\n"},l.table_close=function(){return"
    \n"},l.thead_open=function(){return"\n"},l.thead_close=function(){return"\n"},l.tbody_open=function(){return"\n"},l.tbody_close=function(){return"\n"},l.tr_open=function(){return""},l.tr_close=function(){return"\n"},l.th_open=function(e,t){var r=e[t];return""},l.th_close=function(){return""},l.td_open=function(e,t){var r=e[t];return""},l.td_close=function(){return""},l.strong_open=function(){return""},l.strong_close=function(){return""},l.em_open=function(){return""},l.em_close=function(){return""},l.del_open=function(){return""},l.del_close=function(){return""},l.ins_open=function(){return""},l.ins_close=function(){return""},l.mark_open=function(){return""},l.mark_close=function(){return""},l.sub=function(e,t){return""+i(e[t].content)+""},l.sup=function(e,t){return""+i(e[t].content)+""},l.hardbreak=function(e,t,r){return r.xhtmlOut?"
    \n":"
    \n"},l.softbreak=function(e,t,r){return r.breaks?r.xhtmlOut?"
    \n":"
    \n":"\n"},l.text=function(e,t){return i(e[t].content)},l.htmlblock=function(e,t){return e[t].content},l.htmltag=function(e,t){return e[t].content},l.abbr_open=function(e,t){return''},l.abbr_close=function(){return""},l.footnote_ref=function(e,t){var r=Number(e[t].id+1).toString(),n="fnref"+r;return e[t].subId>0&&(n+=":"+e[t].subId),'['+r+"]"},l.footnote_block_open=function(e,t,r){var n=r.xhtmlOut?'
    \n':'
    \n';return n+'
    \n
      \n'},l.footnote_block_close=function(){return"
    \n
    \n"},l.footnote_open=function(e,t){var r=Number(e[t].id+1).toString();return'
  • '},l.footnote_close=function(){return"
  • \n"},l.footnote_anchor=function(e,t){var r=Number(e[t].id+1).toString(),n="fnref"+r;return e[t].subId>0&&(n+=":"+e[t].subId),' '},l.dl_open=function(){return"
    \n"},l.dt_open=function(){return"
    "},l.dd_open=function(){return"
    "},l.dl_close=function(){return"
    \n"},l.dt_close=function(){return"\n"},l.dd_close=function(){return"\n"};var a=l.getBreak=function(e,t){return t=r(e,t),tm)return!1;if(62!==e.src.charCodeAt(g++))return!1;if(e.level>=e.options.maxNesting)return!1;if(n)return!0;for(32===e.src.charCodeAt(g)&&g++,a=e.blkIndent,e.blkIndent=0,l=[e.bMarks[t]],e.bMarks[t]=g,g=m>g?e.skipSpaces(g):g,o=g>=m,i=[e.tShift[t]],e.tShift[t]=g-e.bMarks[t],p=e.parser.ruler.getRules("blockquote"),s=t+1;r>s&&(g=e.bMarks[s]+e.tShift[s],m=e.eMarks[s],!(g>=m));s++)if(62!==e.src.charCodeAt(g++)){if(o)break;for(d=!1,h=0,f=p.length;f>h;h++)if(p[h](e,s,r,!0)){d=!0;break}if(d)break;l.push(e.bMarks[s]),i.push(e.tShift[s]),e.tShift[s]=-1337}else 32===e.src.charCodeAt(g)&&g++,l.push(e.bMarks[s]),e.bMarks[s]=g,g=m>g?e.skipSpaces(g):g,o=g>=m,i.push(e.tShift[s]),e.tShift[s]=g-e.bMarks[s];for(c=e.parentType,e.parentType="blockquote",e.tokens.push({type:"blockquote_open",lines:u=[t,0],level:e.level++}),e.parser.tokenize(e,t,s),e.tokens.push({type:"blockquote_close",level:--e.level}),e.parentType=c,u[1]=e.line,h=0;hn;)if(e.isEmpty(n))n++;else{if(!(e.tShift[n]-e.blkIndent>=4))break;n++,s=n}return e.line=n,e.tokens.push({type:"code",content:e.getLines(t,s,4+e.blkIndent,!0),block:!0,lines:[t,e.line],level:e.level}),!0}},{}],23:[function(e,t){"use strict";function r(e,t){var r,n,s=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return s>=o?-1:(n=e.src.charCodeAt(s++),126!==n&&58!==n?-1:(r=e.skipSpaces(s),s===r?-1:r>=o?-1:r))}function n(e,t){var r,n,s=e.level+2;for(r=t+2,n=e.tokens.length-2;n>r;r++)e.tokens[r].level===s&&"paragraph_open"===e.tokens[r].type&&(e.tokens[r+2].tight=!0,e.tokens[r].tight=!0,r+=2)}t.exports=function(e,t,s,o){var i,l,a,c,u,p,h,f,d,g,m,b,v,k;if(o)return e.ddIndent<0?!1:r(e,t)>=0;if(h=t+1,e.isEmpty(h)&&++h>s)return!1;if(e.tShift[h]i)return!1;if(e.level>=e.options.maxNesting)return!1;p=e.tokens.length,e.tokens.push({type:"dl_open",lines:u=[t,0],level:e.level++}),a=t,l=h;e:for(;;){for(k=!0,v=!1,e.tokens.push({type:"dt_open",lines:[a,a],level:e.level++}),e.tokens.push({type:"inline",content:e.getLines(a,a+1,e.blkIndent,!1).trim(),level:e.level+1,lines:[a,a],children:[]}),e.tokens.push({type:"dt_close",level:--e.level});;){if(e.tokens.push({type:"dd_open",lines:c=[h,0],level:e.level++}),b=e.tight,d=e.ddIndent,f=e.blkIndent,m=e.tShift[l],g=e.parentType,e.blkIndent=e.ddIndent=e.tShift[l]+2,e.tShift[l]=i-e.bMarks[l],e.tight=!0,e.parentType="deflist",e.parser.tokenize(e,l,s,!0),(!e.tight||v)&&(k=!1),v=e.line-l>1&&e.isEmpty(e.line-1),e.tShift[l]=m,e.tight=b,e.parentType=g,e.blkIndent=f,e.ddIndent=d,e.tokens.push({type:"dd_close",level:--e.level}),c[1]=h=e.line,h>=s)break e;if(e.tShift[h]i)break;l=h}if(h>=s)break;if(a=h,e.isEmpty(a))break;if(e.tShift[a]=s)break;if(e.isEmpty(l)&&l++,l>=s)break;if(e.tShift[l]i)break}return e.tokens.push({type:"dl_close",level:--e.level}),u[1]=h,e.line=h,k&&n(e,p),!0}},{}],24:[function(e,t){"use strict";t.exports=function(e,t,r,n){var s,o,i,l,a,c=!1,u=e.bMarks[t]+e.tShift[t],p=e.eMarks[t];if(u+3>p)return!1;if(s=e.src.charCodeAt(u),126!==s&&96!==s)return!1;if(a=u,u=e.skipChars(u,s),o=u-a,3>o)return!1;if(i=e.src.slice(u,p).trim(),i.indexOf("`")>=0)return!1;if(n)return!0;for(l=t;(l++,!(l>=r))&&(u=a=e.bMarks[l]+e.tShift[l],p=e.eMarks[l],!(p>u&&e.tShift[l]=4||(u=e.skipChars(u,s),o>u-a||(u=e.skipSpaces(u),p>u)))){c=!0;break}return o=e.tShift[t],e.line=l+(c?1:0),e.tokens.push({type:"fence",params:i,content:e.getLines(t+1,l,o,!0),lines:[t,e.line],level:e.level}),!0}},{}],25:[function(e,t){"use strict";t.exports=function(e,t,r,n){var s,o,i,l,a,c=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(c+4>u)return!1;if(91!==e.src.charCodeAt(c))return!1;if(94!==e.src.charCodeAt(c+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(l=c+2;u>l;l++){if(32===e.src.charCodeAt(l))return!1;if(93===e.src.charCodeAt(l))break}return l===c+2?!1:l+1>=u||58!==e.src.charCodeAt(++l)?!1:n?!0:(l++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={}),a=e.src.slice(c+2,l-2),e.env.footnotes.refs[":"+a]=-1,e.tokens.push({type:"footnote_reference_open",label:a,level:e.level++}),s=e.bMarks[t],o=e.tShift[t],i=e.parentType,e.tShift[t]=e.skipSpaces(l)-l,e.bMarks[t]=l,e.blkIndent+=4,e.parentType="footnote",e.tShift[t]=a)return!1;if(s=e.src.charCodeAt(l),35!==s||l>=a)return!1;for(o=1,s=e.src.charCodeAt(++l);35===s&&a>l&&6>=o;)o++,s=e.src.charCodeAt(++l);return o>6||a>l&&32!==s?!1:n?!0:(a=e.skipCharsBack(a,32,l),i=e.skipCharsBack(a,35,l),i>l&&32===e.src.charCodeAt(i-1)&&(a=i),e.line=t+1,e.tokens.push({type:"heading_open",hLevel:o,lines:[t,e.line],level:e.level}),a>l&&e.tokens.push({type:"inline",content:e.src.slice(l,a).trim(),level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"heading_close",hLevel:o,level:e.level}),!0)}},{}],27:[function(e,t){"use strict";t.exports=function(e,t,r,n){var s,o,i,l=e.bMarks[t],a=e.eMarks[t];if(l+=e.tShift[t],l>a)return!1;if(s=e.src.charCodeAt(l++),42!==s&&45!==s&&95!==s)return!1;for(o=1;a>l;){if(i=e.src.charCodeAt(l++),i!==s&&32!==i)return!1;i===s&&o++}return 3>o?!1:n?!0:(e.line=t+1,e.tokens.push({type:"hr",lines:[t,e.line],level:e.level}),!0)}},{}],28:[function(e,t){"use strict";function r(e){var t=32|e;return t>=97&&122>=t}var n=e("../common/html_blocks"),s=/^<([a-zA-Z]{1,15})[\s\/>]/,o=/^<\/([a-zA-Z]{1,15})[\s>]/;t.exports=function(e,t,i,l){var a,c,u,p=e.bMarks[t],h=e.eMarks[t],f=e.tShift[t];if(p+=f,!e.options.html)return!1;if(f>3||p+2>=h)return!1;if(60!==e.src.charCodeAt(p))return!1;if(a=e.src.charCodeAt(p+1),33===a||63===a){if(l)return!0}else{if(47!==a&&!r(a))return!1;if(47===a){if(c=e.src.slice(p,h).match(o),!c)return!1}else if(c=e.src.slice(p,h).match(s),!c)return!1;if(n[c[1].toLowerCase()]!==!0)return!1;if(l)return!0}for(u=t+1;u=r?!1:e.tShift[i]3?!1:(s=e.bMarks[i]+e.tShift[i],o=e.eMarks[i],s>=o?!1:(n=e.src.charCodeAt(s),45!==n&&61!==n?!1:(s=e.skipChars(s,n),s=e.skipSpaces(s),o>s?!1:(s=e.bMarks[t]+e.tShift[t],e.line=i+1,e.tokens.push({type:"heading_open",hLevel:61===n?1:2,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:e.src.slice(s,e.eMarks[t]).trim(),level:e.level+1,lines:[t,e.line-1],children:[]}),e.tokens.push({type:"heading_close",hLevel:61===n?1:2,level:e.level}),!0))))}},{}],30:[function(e,t){"use strict";function r(e,t){var r,n,s;return n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],n>=s?-1:(r=e.src.charCodeAt(n++),42!==r&&45!==r&&43!==r?-1:s>n&&32!==e.src.charCodeAt(n)?-1:n)}function n(e,t){var r,n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(n+1>=s)return-1;if(r=e.src.charCodeAt(n++),48>r||r>57)return-1;for(;;){if(n>=s)return-1;if(r=e.src.charCodeAt(n++),!(r>=48&&57>=r)){if(41===r||46===r)break;return-1}}return s>n&&32!==e.src.charCodeAt(n)?-1:n}function s(e,t){var r,n,s=e.level+2;for(r=t+2,n=e.tokens.length-2;n>r;r++)e.tokens[r].level===s&&"paragraph_open"===e.tokens[r].type&&(e.tokens[r+2].tight=!0,e.tokens[r].tight=!0,r+=2)}t.exports=function(e,t,o,i){var l,a,c,u,p,h,f,d,g,m,b,v,k,_,y,x,w,A,q,C,S,E,M=!0;if((d=n(e,t))>=0)k=!0;else{if(!((d=r(e,t))>=0))return!1;k=!1}if(e.level>=e.options.maxNesting)return!1;if(v=e.src.charCodeAt(d-1),i)return!0;for(y=e.tokens.length,k?(f=e.bMarks[t]+e.tShift[t],b=Number(e.src.substr(f,d-f-1)),e.tokens.push({type:"ordered_list_open",order:b,lines:w=[t,0],level:e.level++})):e.tokens.push({type:"bullet_list_open",lines:w=[t,0],level:e.level++}),l=t,x=!1,q=e.parser.ruler.getRules("list");!(!(o>l)||(_=e.skipSpaces(d),g=e.eMarks[l],m=_>=g?1:_-d,m>4&&(m=1),1>m&&(m=1),a=d-e.bMarks[l]+m,e.tokens.push({type:"list_item_open",lines:A=[t,0],level:e.level++}),u=e.blkIndent,p=e.tight,c=e.tShift[t],h=e.parentType,e.tShift[t]=_-e.bMarks[t],e.blkIndent=a,e.tight=!0,e.parentType="list",e.parser.tokenize(e,t,o,!0),(!e.tight||x)&&(M=!1),x=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=u,e.tShift[t]=c,e.tight=p,e.parentType=h,e.tokens.push({type:"list_item_close",level:--e.level}),l=t=e.line,A[1]=l,_=e.bMarks[t],l>=o)||e.isEmpty(l)||e.tShift[l]C;C++)if(q[C](e,l,o,!0)){E=!0;break}if(E)break;if(k){if(d=n(e,l),0>d)break}else if(d=r(e,l),0>d)break;if(v!==e.src.charCodeAt(d-1))break}return e.tokens.push({type:k?"ordered_list_close":"bullet_list_close",level:--e.level}),w[1]=l,e.line=l,M&&s(e,y),!0}},{}],31:[function(e,t){"use strict";t.exports=function(e,t){var r,n,s,o,i,l,a=t+1;if(r=e.lineMax,r>a&&!e.isEmpty(a))for(l=e.parser.ruler.getRules("paragraph");r>a&&!e.isEmpty(a);a++)if(!(e.tShift[a]-e.blkIndent>3)){for(s=!1,o=0,i=l.length;i>o;o++)if(l[o](e,a,r,!0)){s=!0;break}if(s)break}return n=e.getLines(t,a,e.blkIndent,!1).trim(),e.line=a,n.length&&(e.tokens.push({type:"paragraph_open",tight:!1,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:n,level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"paragraph_close",tight:!1,level:e.level})),!0}},{}],32:[function(e,t){"use strict";function r(e,t,r,n,s){var o,i,l,a,c,u,p;for(this.src=e,this.parser=t,this.options=r,this.env=n,this.tokens=s,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",i=this.src,u=0,p=!1,l=a=u=0,c=i.length;c>a;a++){if(o=i.charCodeAt(a),!p){if(32===o){u++;continue}p=!0}(10===o||a===c-1)&&(10!==o&&a++,this.bMarks.push(l),this.eMarks.push(a),this.tShift.push(u),p=!1,u=0,l=a+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}r.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},r.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;t>e&&!(this.bMarks[e]+this.tShift[e]e&&32===this.src.charCodeAt(e);e++);return e},r.prototype.skipChars=function(e,t){for(var r=this.src.length;r>e&&this.src.charCodeAt(e)===t;e++);return e},r.prototype.skipCharsBack=function(e,t,r){if(r>=e)return e;for(;e>r;)if(t!==this.src.charCodeAt(--e))return e+1;return e},r.prototype.getLines=function(e,t,r,n){var s,o,i,l,a,c=e;if(e>=t)return"";if(c+1===t)return o=this.bMarks[c]+Math.min(this.tShift[c],r),i=n?this.eMarks[c]+1:this.eMarks[c],this.src.slice(o,i);for(l=new Array(t-e),s=0;t>c;c++,s++)a=this.tShift[c],a>r&&(a=r),0>a&&(a=0),o=this.bMarks[c]+a,i=t>c+1||n?this.eMarks[c]+1:this.eMarks[c],l[s]=this.src.slice(o,i);return l.join("")},t.exports=r},{}],33:[function(e,t){"use strict";function r(e,t){var r=e.bMarks[t]+e.blkIndent,n=e.eMarks[t];return e.src.substr(r,n-r)}t.exports=function(e,t,n,s){var o,i,l,a,c,u,p,h,f,d,g;if(t+2>n)return!1;if(c=t+1,e.tShift[c]=e.eMarks[c])return!1;if(o=e.src.charCodeAt(l),124!==o&&45!==o&&58!==o)return!1;if(i=r(e,t+1),!/^[-:| ]+$/.test(i))return!1;if(u=i.split("|"),2>=u)return!1;for(h=[],a=0;ac&&!(e.tShift[c]l||58!==e.charCodeAt(l+1))return-1;for(c=i.posMax,a=l+2;c>a&&10!==i.src.charCodeAt(a);a++);return u=e.slice(2,l),p=e.slice(l+2,a).trim(),0===p.length?-1:(o.abbreviations||(o.abbreviations={}),"undefined"==typeof o.abbreviations[":"+u]&&(o.abbreviations[":"+u]=p),a)}var n=e("../rules_inline/state_inline"),s=e("../helpers/parse_link_label");t.exports=function(e){var t,n,s,o,i=e.tokens;if(!e.inlineMode)for(t=1,n=i.length-1;n>t;t++)if("paragraph_open"===i[t-1].type&&"inline"===i[t].type&&"paragraph_close"===i[t+1].type){for(s=i[t].content;s.length&&(o=r(s,e.inline,e.options,e.env),!(0>o));)s=s.slice(o).trim();i[t].content=s,s.length||(i[t-1].tight=!0,i[t+1].tight=!0)}}},{"../helpers/parse_link_label":12,"../rules_inline/state_inline":56}],35:[function(e,t){"use strict";function r(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#s;s++)if("inline"===g[s].type)for(i=g[s].children,t=i.length-1;t>=0;t--)if(l=i[t],"text"===l.type){for(u=0,a=l.content,h.lastIndex=0,p=l.level,c=[];f=h.exec(a);)h.lastIndex>u&&c.push({type:"text",content:a.slice(u,f.index+f[1].length),level:p}),c.push({type:"abbr_open",title:e.env.abbreviations[":"+f[2]],level:p++}),c.push({type:"text",content:f[2],level:p}),c.push({type:"abbr_close",level:--p}),u=h.lastIndex-f[3].length;c.length&&(ut;t++){for(e.tokens.push({type:"footnote_open",id:t,level:u++}),i[t].tokens?(l=[],l.push({type:"paragraph_open",tight:!1,level:u++}),l.push({type:"inline",content:"",level:u,children:i[t].tokens}),l.push({type:"paragraph_close",tight:!1,level:--u})):i[t].label&&(l=h[":"+i[t].label]),e.tokens=e.tokens.concat(l),o="paragraph_close"===e.tokens[e.tokens.length-1].type?e.tokens.pop():null,s=i[t].count>0?i[t].count:1,n=0;s>n;n++)e.tokens.push({type:"footnote_anchor",id:t,subId:n,level:u});o&&e.tokens.push(o),e.tokens.push({type:"footnote_close",level:--u})}e.tokens.push({type:"footnote_block_close",level:--u})}}},{}],38:[function(e,t){"use strict";t.exports=function(e){var t,r,n,s=e.tokens;for(r=0,n=s.length;n>r;r++)t=s[r],"inline"===t.type&&e.inline.parse(t.content,e.options,e.env,t.children)}},{}],39:[function(e,t){"use strict";function r(e){return/^\s]/i.test(e)}function n(e){return/^<\/a\s*>/i.test(e)}function s(){var e=[],t=new o({stripPrefix:!1,url:!0,email:!0,twitter:!1,replaceFn:function(t,r){switch(r.getType()){case"url":e.push({text:r.matchedText,url:r.getUrl()});break;case"email":e.push({text:r.matchedText,url:"mailto:"+r.getEmail().replace(/^mailto:/i,"")})}return!1}});return{links:e,autolinker:t}}var o=e("autolinker"),i=/www|@|\:\/\//;t.exports=function(e){var t,o,l,a,c,u,p,h,f,d,g,m,b,v=e.tokens,k=null;if(e.options.linkify)for(o=0,l=v.length;l>o;o++)if("inline"===v[o].type)for(a=v[o].children, +g=0,t=a.length-1;t>=0;t--)if(c=a[t],"link_close"!==c.type){if("htmltag"===c.type&&(r(c.content)&&g>0&&g--,n(c.content)&&g++),!(g>0)&&"text"===c.type&&i.test(c.content)){if(k||(k=s(),m=k.links,b=k.autolinker),u=c.content,m.length=0,b.link(u),!m.length)continue;for(p=[],d=c.level,h=0;hu||58!==e.charCodeAt(u+1))return-1;for(h=c.posMax,p=u+2;h>p&&(f=c.src.charCodeAt(p),32===f||10===f);p++);if(!o(c,p))return-1;for(g=c.linkContent,p=c.pos,d=p,p+=1;h>p&&(f=c.src.charCodeAt(p),32===f||10===f);p++);for(h>p&&d!==p&&i(c,p)?(m=c.linkContent,p=c.pos):(m="",p=d);h>p&&32===c.src.charCodeAt(p);)p++;return h>p&&10!==c.src.charCodeAt(p)?-1:(b=l(e.slice(1,u)),"undefined"==typeof a.references[b]&&(a.references[b]={title:m,href:g}),p)}var n=e("../rules_inline/state_inline"),s=e("../helpers/parse_link_label"),o=e("../helpers/parse_link_destination"),i=e("../helpers/parse_link_title"),l=e("../helpers/normalize_reference");t.exports=function(e){var t,n,s,o,i=e.tokens;if(e.env.references=e.env.references||{},!e.inlineMode)for(t=1,n=i.length-1;n>t;t++)if("inline"===i[t].type&&"paragraph_open"===i[t-1].type&&"paragraph_close"===i[t+1].type){for(s=i[t].content;s.length&&(o=r(s,e.inline,e.options,e.env),!(0>o));)s=s.slice(o).trim();i[t].content=s,s.length||(i[t-1].tight=!0,i[t+1].tight=!0)}}},{"../helpers/normalize_reference":10,"../helpers/parse_link_destination":11,"../helpers/parse_link_label":12,"../helpers/parse_link_title":13,"../rules_inline/state_inline":56}],41:[function(e,t){"use strict";function r(e){return e.indexOf("(")<0?e:e.replace(s,function(e,t){return o[t.toLowerCase()]})}var n=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,s=/\((c|tm|r|p)\)/gi,o={c:"©",r:"®",p:"§",tm:"™"};t.exports=function(e){var t,s,o,i,l;if(e.options.typographer)for(l=e.tokens.length-1;l>=0;l--)if("inline"===e.tokens[l].type)for(i=e.tokens[l].children,t=i.length-1;t>=0;t--)s=i[t],"text"===s.type&&(o=s.content,o=r(o),n.test(o)&&(o=o.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),s.content=o)}},{}],42:[function(e,t){"use strict";function r(e,t){return 0>t||t>=e.length?!1:!i.test(e[t])}function n(e,t,r){return e.substr(0,t)+r+e.substr(t+1)}var s=/['"]/,o=/['"]/g,i=/[-\s()\[\]]/,l="’";t.exports=function(e){var t,i,a,c,u,p,h,f,d,g,m,b,v,k,_,y,x;if(e.options.typographer)for(x=[],_=e.tokens.length-1;_>=0;_--)if("inline"===e.tokens[_].type)for(y=e.tokens[_].children,x.length=0,t=0;t=0&&!(x[v].level<=h);v--);x.length=v+1,a=i.content,u=0,p=a.length;e:for(;p>u&&(o.lastIndex=u,c=o.exec(a));)if(f=!r(a,c.index-1),u=c.index+1,k="'"===c[0],d=!r(a,u),d||f){if(m=!d,b=!f)for(v=x.length-1;v>=0&&(g=x[v],!(x[v].level/,o=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;t.exports=function(e,t){var i,l,a,c,u,p=e.pos;return 60!==e.src.charCodeAt(p)?!1:(i=e.src.slice(p),i.indexOf(">")<0?!1:(l=i.match(o))?r.indexOf(l[1].toLowerCase())<0?!1:(c=l[0].slice(1,-1),u=n(c),e.parser.validateLink(c)?(t||(e.push({type:"link_open",href:u,level:e.level}),e.push({type:"text",content:c,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=l[0].length,!0):!1):(a=i.match(s),a?(c=a[0].slice(1,-1),u=n("mailto:"+c),e.parser.validateLink(u)?(t||(e.push({type:"link_open",href:u,level:e.level}),e.push({type:"text",content:c,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=a[0].length,!0):!1):!1))}},{"../common/url_schemas":4,"../helpers/normalize_link":9}],44:[function(e,t){"use strict";t.exports=function(e,t){var r,n,s,o,i,l=e.pos,a=e.src.charCodeAt(l);if(96!==a)return!1;for(r=l,l++,n=e.posMax;n>l&&96===e.src.charCodeAt(l);)l++;for(s=e.src.slice(r,l),o=i=l;-1!==(o=e.src.indexOf("`",i));){for(i=o+1;n>i&&96===e.src.charCodeAt(i);)i++;if(i-o===s.length)return t||e.push({type:"code",content:e.src.slice(l,o).replace(/[ \n]+/g," ").trim(),block:!1,level:e.level}),e.pos=i,!0}return t||(e.pending+=s),e.pos+=s.length,!0}},{}],45:[function(e,t){"use strict";t.exports=function(e,t){var r,n,s,o,i,l=e.posMax,a=e.pos;if(126!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+4>=l)return!1;if(126!==e.src.charCodeAt(a+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=a>0?e.src.charCodeAt(a-1):-1,i=e.src.charCodeAt(a+2),126===o)return!1;if(126===i)return!1;if(32===i||10===i)return!1;for(n=a+2;l>n&&126===e.src.charCodeAt(n);)n++;if(n>a+3)return e.pos+=n-a,t||(e.pending+=e.src.slice(a,n)),!0;for(e.pos=a+2,s=1;e.pos+1=s))){r=!0;break}e.parser.skipToken(e)}return r?(e.posMax=e.pos,e.pos=a+2,t||(e.push({type:"del_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"del_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=l,!0):(e.pos=a,!1)}},{}],46:[function(e,t){"use strict";function r(e){return e>=48&&57>=e||e>=65&&90>=e||e>=97&&122>=e}function n(e,t){var n,s,o,i=t,l=!0,a=!0,c=e.posMax,u=e.src.charCodeAt(t);for(n=t>0?e.src.charCodeAt(t-1):-1;c>i&&e.src.charCodeAt(i)===u;)i++;return i>=c&&(l=!1),o=i-t,o>=4?l=a=!1:(s=c>i?e.src.charCodeAt(i):-1,(32===s||10===s)&&(l=!1),(32===n||10===n)&&(a=!1),95===u&&(r(n)&&(l=!1),r(s)&&(a=!1))),{can_open:l,can_close:a,delims:o}}t.exports=function(e,t){var r,s,o,i,l,a,c,u=e.posMax,p=e.pos,h=e.src.charCodeAt(p);if(95!==h&&42!==h)return!1;if(t)return!1;if(c=n(e,p),r=c.delims,!c.can_open)return e.pos+=r,t||(e.pending+=e.src.slice(p,e.pos)),!0;if(e.level>=e.options.maxNesting)return!1;for(e.pos=p+r,a=[r];e.posl){a.push(i-l);break}if(l-=i,0===a.length)break;e.pos+=i,i=a.pop()}if(0===a.length){r=i,o=!0;break}e.pos+=s;continue}c.can_open&&a.push(s),e.pos+=s}return o?(e.posMax=e.pos,e.pos=p+r,t||((2===r||3===r)&&e.push({type:"strong_open",level:e.level++}),(1===r||3===r)&&e.push({type:"em_open",level:e.level++}),e.parser.tokenize(e),(1===r||3===r)&&e.push({type:"em_close",level:--e.level}),(2===r||3===r)&&e.push({type:"strong_close",level:--e.level})),e.pos=e.posMax+r,e.posMax=u,!0):(e.pos=p,!1)}},{}],47:[function(e,t){"use strict";var r=e("../common/entities"),n=e("../common/utils").has,s=e("../common/utils").isValidEntityCode,o=e("../common/utils").fromCodePoint,i=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,l=/^&([a-z][a-z0-9]{1,31});/i;t.exports=function(e,t){var a,c,u,p=e.pos,h=e.posMax;if(38!==e.src.charCodeAt(p))return!1;if(h>p+1)if(a=e.src.charCodeAt(p+1),35===a){if(u=e.src.slice(p).match(i))return t||(c="x"===u[1][0].toLowerCase()?parseInt(u[1].slice(1),16):parseInt(u[1],10),e.pending+=o(s(c)?c:65533)),e.pos+=u[0].length,!0}else if(u=e.src.slice(p).match(l),u&&n(r,u[1]))return t||(e.pending+=r[u[1]]),e.pos+=u[0].length,!0;return t||(e.pending+="&"),e.pos++,!0}},{"../common/entities":1,"../common/utils":5}],48:[function(e,t){"use strict";for(var r=[],n=0;256>n;n++)r.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){r[e.charCodeAt(0)]=1}),t.exports=function(e,t){var n,s=e.pos,o=e.posMax;if(92!==e.src.charCodeAt(s))return!1;if(s++,o>s){if(n=e.src.charCodeAt(s),256>n&&0!==r[n])return t||(e.pending+=e.src[s]),e.pos+=2,!0;if(10===n){for(t||e.push({type:"hardbreak",level:e.level}),s++;o>s&&32===e.src.charCodeAt(s);)s++;return e.pos=s,!0}}return t||(e.pending+="\\"),e.pos++,!0}},{}],49:[function(e,t){"use strict";var r=e("../helpers/parse_link_label");t.exports=function(e,t){var n,s,o,i,l=e.posMax,a=e.pos;return a+2>=l?!1:94!==e.src.charCodeAt(a)?!1:91!==e.src.charCodeAt(a+1)?!1:e.level>=e.options.maxNesting?!1:(n=a+2,s=r(e,a+1),0>s?!1:(t||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),o=e.env.footnotes.list.length,e.pos=n,e.posMax=s,e.push({type:"footnote_ref",id:o,level:e.level}),e.linkLevel++,i=e.tokens.length,e.parser.tokenize(e),e.env.footnotes.list[o]={tokens:e.tokens.splice(i)},e.linkLevel--),e.pos=s+1,e.posMax=l,!0))}},{"../helpers/parse_link_label":12}],50:[function(e,t){"use strict";t.exports=function(e,t){var r,n,s,o,i=e.posMax,l=e.pos;if(l+3>i)return!1;if(!e.env.footnotes||!e.env.footnotes.refs)return!1;if(91!==e.src.charCodeAt(l))return!1;if(94!==e.src.charCodeAt(l+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(n=l+2;i>n;n++){if(32===e.src.charCodeAt(n))return!1;if(10===e.src.charCodeAt(n))return!1;if(93===e.src.charCodeAt(n))break}return n===l+2?!1:n>=i?!1:(n++,r=e.src.slice(l+2,n-1),"undefined"==typeof e.env.footnotes.refs[":"+r]?!1:(t||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[":"+r]<0?(s=e.env.footnotes.list.length,e.env.footnotes.list[s]={label:r,count:0},e.env.footnotes.refs[":"+r]=s):s=e.env.footnotes.refs[":"+r],o=e.env.footnotes.list[s].count,e.env.footnotes.list[s].count++,e.push({type:"footnote_ref",id:s,subId:o,level:e.level})),e.pos=n,e.posMax=i,!0))}},{}],51:[function(e,t){"use strict";function r(e){var t=32|e;return t>=97&&122>=t}var n=e("../common/html_re").HTML_TAG_RE;t.exports=function(e,t){var s,o,i,l=e.pos;return e.options.html?(i=e.posMax,60!==e.src.charCodeAt(l)||l+2>=i?!1:(s=e.src.charCodeAt(l+1),(33===s||63===s||47===s||r(s))&&(o=e.src.slice(l).match(n))?(t||e.push({type:"htmltag",content:e.src.slice(l,l+o[0].length),level:e.level}),e.pos+=o[0].length,!0):!1)):!1}},{"../common/html_re":3}],52:[function(e,t){"use strict";t.exports=function(e,t){var r,n,s,o,i,l=e.posMax,a=e.pos;if(43!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+4>=l)return!1;if(43!==e.src.charCodeAt(a+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=a>0?e.src.charCodeAt(a-1):-1,i=e.src.charCodeAt(a+2),43===o)return!1;if(43===i)return!1;if(32===i||10===i)return!1;for(n=a+2;l>n&&43===e.src.charCodeAt(n);)n++;if(n!==a+2)return e.pos+=n-a,t||(e.pending+=e.src.slice(a,n)),!0;for(e.pos=a+2,s=1;e.pos+1=s))){r=!0;break}e.parser.skipToken(e)}return r?(e.posMax=e.pos,e.pos=a+2,t||(e.push({type:"ins_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"ins_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=l,!0):(e.pos=a,!1)}},{}],53:[function(e,t){"use strict";var r=e("../helpers/parse_link_label"),n=e("../helpers/parse_link_destination"),s=e("../helpers/parse_link_title"),o=e("../helpers/normalize_reference");t.exports=function(e,t){var i,l,a,c,u,p,h,f,d=!1,g=e.pos,m=e.posMax,b=e.pos,v=e.src.charCodeAt(b);if(33===v&&(d=!0,v=e.src.charCodeAt(++b)),91!==v)return!1;if(e.level>=e.options.maxNesting)return!1;if(i=b+1,l=r(e,b),0>l)return!1;if(p=l+1,m>p&&40===e.src.charCodeAt(p)){for(p++;m>p&&(f=e.src.charCodeAt(p),32===f||10===f);p++);if(p>=m)return!1;for(b=p,n(e,p)?(c=e.linkContent,p=e.pos):c="",b=p;m>p&&(f=e.src.charCodeAt(p),32===f||10===f);p++);if(m>p&&b!==p&&s(e,p))for(u=e.linkContent,p=e.pos;m>p&&(f=e.src.charCodeAt(p),32===f||10===f);p++);else u="";if(p>=m||41!==e.src.charCodeAt(p))return e.pos=g,!1;p++}else{if(e.linkLevel>0)return!1;for(;m>p&&(f=e.src.charCodeAt(p),32===f||10===f);p++);if(m>p&&91===e.src.charCodeAt(p)&&(b=p+1,p=r(e,p),p>=0?a=e.src.slice(b,p++):p=b-1),a||("undefined"==typeof a&&(p=l+1),a=e.src.slice(i,l)),h=e.env.references[o(a)],!h)return e.pos=g,!1;c=h.href,u=h.title}return t||(e.pos=i,e.posMax=l,d?e.push({type:"image",src:c,title:u,alt:e.src.substr(i,l-i),level:e.level}):(e.push({type:"link_open",href:c,title:u,level:e.level++}),e.linkLevel++,e.parser.tokenize(e),e.linkLevel--,e.push({type:"link_close",level:--e.level}))),e.pos=p,e.posMax=m,!0}},{"../helpers/normalize_reference":10,"../helpers/parse_link_destination":11,"../helpers/parse_link_label":12,"../helpers/parse_link_title":13}],54:[function(e,t){"use strict";t.exports=function(e,t){var r,n,s,o,i,l=e.posMax,a=e.pos;if(61!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+4>=l)return!1;if(61!==e.src.charCodeAt(a+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(o=a>0?e.src.charCodeAt(a-1):-1,i=e.src.charCodeAt(a+2),61===o)return!1;if(61===i)return!1;if(32===i||10===i)return!1;for(n=a+2;l>n&&61===e.src.charCodeAt(n);)n++;if(n!==a+2)return e.pos+=n-a,t||(e.pending+=e.src.slice(a,n)),!0;for(e.pos=a+2,s=1;e.pos+1=s))){r=!0;break}e.parser.skipToken(e)}return r?(e.posMax=e.pos,e.pos=a+2,t||(e.push({type:"mark_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"mark_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=l,!0):(e.pos=a,!1)}},{}],55:[function(e,t){"use strict";t.exports=function(e,t){var r,n,s=e.pos;if(10!==e.src.charCodeAt(s))return!1;if(r=e.pending.length-1,n=e.posMax,!t)if(r>=0&&32===e.pending.charCodeAt(r))if(r>=1&&32===e.pending.charCodeAt(r-1)){for(var o=r-2;o>=0;o--)if(32!==e.pending.charCodeAt(o)){e.pending=e.pending.substring(0,o+1);break}e.push({type:"hardbreak",level:e.level})}else e.pending=e.pending.slice(0,-1),e.push({type:"softbreak",level:e.level});else e.push({type:"softbreak",level:e.level});for(s++;n>s&&32===e.src.charCodeAt(s);)s++;return e.pos=s,!0}},{}],56:[function(e,t){"use strict";function r(e,t,r,n,s){this.src=e,this.env=n,this.options=r,this.parser=t,this.tokens=s,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}r.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},r.prototype.push=function(e){this.pending&&this.pushPending(),this.tokens.push(e),this.pendingLevel=this.level},r.prototype.cacheSet=function(e,t){for(var r=this.cache.length;e>=r;r++)this.cache.push(0);this.cache[e]=t},r.prototype.cacheGet=function(e){return e?@[\]^_`{|}~-])/g;t.exports=function(e,t){var n,s,o=e.posMax,i=e.pos;if(126!==e.src.charCodeAt(i))return!1;if(t)return!1;if(i+2>=o)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=i+1;e.pos?@[\]^_`{|}~-])/g;t.exports=function(e,t){var n,s,o=e.posMax,i=e.pos;if(94!==e.src.charCodeAt(i))return!1;if(t)return!1;if(i+2>=o)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=i+1;e.poso;o++){var l=r[o],a=l.getType(),c=l.getText();if("element"===a)"a"===l.getTagName()&&(l.isClosing()?n=Math.max(n-1,0):n++),s.push(c);else if("entity"===a)s.push(c);else if(0===n){var u=this.linkifyStr(c);s.push(u)}else s.push(c)}return s.join("")},linkifyStr:function(e){return this.getMatchParser().replace(e,this.createMatchReturnVal,this)},createMatchReturnVal:function(t){var r;if(this.replaceFn&&(r=this.replaceFn.call(this,this,t)),"string"==typeof r)return r;if(r===!1)return t.getMatchedText();if(r instanceof e.HtmlTag)return r.toString();var n=this.getTagBuilder(),s=n.build(t);return s.toString()},getHtmlParser:function(){var t=this.htmlParser;return t||(t=this.htmlParser=new e.htmlParser.HtmlParser),t},getMatchParser:function(){var t=this.matchParser;return t||(t=this.matchParser=new e.matchParser.MatchParser({urls:this.urls,email:this.email,twitter:this.twitter,stripPrefix:this.stripPrefix})),t},getTagBuilder:function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new e.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t}},e.link=function(t,r){var n=new e(r);return n.link(t)},e.match={},e.htmlParser={},e.matchParser={},e.Util={abstractMethod:function(){throw"abstract"},assign:function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},extend:function(t,r){var n=t.prototype,s=function(){};s.prototype=n;var o;o=r.hasOwnProperty("constructor")?r.constructor:function(){n.constructor.apply(this,arguments)};var i=o.prototype=new s;return i.constructor=o,i.superclass=n,delete r.constructor,e.Util.assign(i,r),o},ellipsis:function(e,t,r){return e.length>t&&(r=null==r?"..":r,e=e.substring(0,t-r.length)+r),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var r=0,n=e.length;n>r;r++)if(e[r]===t)return r;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var r,n=[],s=0;r=t.exec(e);)n.push(e.substring(s,r.index)),n.push(r[0]),s=r.index+r[0].length;return n.push(e.substring(s)),n}},e.HtmlTag=e.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(t){e.Util.assign(this,t),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){var r=this.getAttrs();return r[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(t){var r=this.getAttrs();return e.Util.assign(r,t),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(t){for(var r,n=this.getClass(),s=this.whitespaceRegex,o=e.Util.indexOf,i=n?n.split(s):[],l=t.split(s);r=l.shift();)-1===o(i,r)&&i.push(r);return this.getAttrs()["class"]=i.join(" "),this},removeClass:function(t){for(var r,n=this.getClass(),s=this.whitespaceRegex,o=e.Util.indexOf,i=n?n.split(s):[],l=t.split(s);i.length&&(r=l.shift());){var a=o(i,r);-1!==a&&i.splice(a,1)}return this.getAttrs()["class"]=i.join(" "),this},getClass:function(){return this.getAttrs()["class"]||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return t=t?" "+t:"",["<",e,t,">",this.getInnerHtml(),""].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")}}),e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){var r=new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())});return r},createAttrs:function(e,t){var r={href:t},n=this.createCssClass(e);return n&&(r["class"]=n),this.newWindow&&(r.target="_blank"),r},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}}),e.htmlParser.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/[0-9a-zA-Z][0-9a-zA-Z:]*/,t=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,r=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,n=t.source+"(?:\\s*=\\s*"+r.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",n,"|",r.source+")",")*",">",")","|","(?:","<(/)?","("+e.source+")","(?:","\\s+",n,")*","\\s*/?",">",")"].join(""),"gi")}(),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,r,n=this.htmlRegex,s=0,o=[];null!==(t=n.exec(e));){var i=t[0],l=t[1]||t[3],a=!!t[2],c=e.substring(s,t.index);c&&(r=this.parseTextAndEntityNodes(c),o.push.apply(o,r)),o.push(this.createElementNode(i,l,a)),s=t.index+i.length}if(ss;s+=2){var i=n[s],l=n[s+1];i&&r.push(this.createTextNode(i)),l&&r.push(this.createEntityNode(l))}return r},createElementNode:function(t,r,n){return new e.htmlParser.ElementNode({text:t,tagName:r.toLowerCase(),closing:n})},createEntityNode:function(t){return new e.htmlParser.EntityNode({text:t})},createTextNode:function(t){return new e.htmlParser.TextNode({text:t})}}),e.htmlParser.HtmlNode=e.Util.extend(Object,{text:"",constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getText:function(){return this.text}}),e.htmlParser.ElementNode=e.Util.extend(e.htmlParser.HtmlNode,{tagName:"",closing:!1,getType:function(){return"element"},getTagName:function(){return this.tagName},isClosing:function(){return this.closing}}),e.htmlParser.EntityNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"entity"}}),e.htmlParser.TextNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"text"}}),e.matchParser.MatchParser=e.Util.extend(Object,{urls:!0,email:!0,twitter:!0,stripPrefix:!0,matcherRegex:function(){var e=/(^|[^\w])@(\w{1,15})/,t=/(?:[\-;:&=\+\$,\w\.]+@)/,r=/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/,n=/(?:www\.)/,s=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,o=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,i=/[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/;return new RegExp(["(",e.source,")","|","(",t.source,s.source,o.source,")","|","(","(?:","(",r.source,s.source,")","|","(?:","(.?//)?",n.source,s.source,")","|","(?:","(.?//)?",s.source,o.source,")",")","(?:"+i.source+")?",")"].join(""),"gi")}(),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,constructor:function(t){e.Util.assign(this,t),this.matchValidator=new e.MatchValidator},replace:function(e,t,r){var n=this;return e.replace(this.matcherRegex,function(e,s,o,i,l,a,c,u,p){var h=n.processCandidateMatch(e,s,o,i,l,a,c,u,p);if(h){var f=t.call(r,h.match);return h.prefixStr+f+h.suffixStr}return e})},processCandidateMatch:function(t,r,n,s,o,i,l,a,c){var u,p=a||c,h="",f="";if(r&&!this.twitter||o&&!this.email||i&&!this.urls||!this.matchValidator.isValidMatch(i,l,p))return null;if(this.matchHasUnbalancedClosingParen(t)&&(t=t.substr(0,t.length-1),f=")"),o)u=new e.match.Email({matchedText:t,email:o});else if(r)n&&(h=n,t=t.slice(1)),u=new e.match.Twitter({matchedText:t,twitterHandle:s});else{if(p){var d=p.match(this.charBeforeProtocolRelMatchRegex)[1]||"";d&&(h=d,t=t.slice(1))}u=new e.match.Url({matchedText:t,url:t,protocolUrlMatch:!!l,protocolRelativeMatch:!!p,stripPrefix:this.stripPrefix})}return{prefixStr:h,suffixStr:f,match:u}},matchHasUnbalancedClosingParen:function(e){var t=e.charAt(e.length-1);if(")"===t){var r=e.match(/\(/g),n=e.match(/\)/g),s=r&&r.length||0,o=n&&n.length||0;if(o>s)return!0}return!1}}),e.MatchValidator=e.Util.extend(Object,{invalidProtocolRelMatchRegex:/^[\w]\/\//,hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]+:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]+:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z]/,isValidMatch:function(e,t,r){return t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)||this.isInvalidProtocolRelativeMatch(r)?!1:!0},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0].toLowerCase();return"javascript:"!==t&&"vbscript:"!==t},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return e&&t?!this.hasWordCharAfterProtocolRegex.test(e):!1},isInvalidProtocolRelativeMatch:function(e){return!!e&&this.invalidProtocolRelMatchRegex.test(e)}}),e.match.Match=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getMatchedText:function(){return this.matchedText},getAnchorHref:e.Util.abstractMethod,getAnchorText:e.Util.abstractMethod}),e.match.Email=e.Util.extend(e.match.Match,{getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),e.match.Twitter=e.Util.extend(e.match.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),e.match.Url=e.Util.extend(e.match.Match,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrl:function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},getAnchorHref:function(){var e=this.getUrl();return e.replace(/&/g,"&")},getAnchorText:function(){var e=this.getUrl();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix&&(e=this.stripUrlPrefix(e)),e=this.removeTrailingSlash(e)},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e}}),e})},{}],"/":[function(e,t){"use strict";t.exports=e("./lib/")},{"./lib/":14}]},{},[])("/")}); \ No newline at end of file diff --git a/js/scanForFootnotes.js b/js/scanForFootnotes.js new file mode 100755 index 0000000..b8e21cc --- /dev/null +++ b/js/scanForFootnotes.js @@ -0,0 +1,109 @@ +document.addEventListener("DOMContentLoaded", function () { + var footnotes = new Array(); + + function makeLinksKlickable (el) { + if (el.nodeType == 3) { + let links = new Array(); + let spl = el.textContent.split(' '); + for (let i = 0; i < spl.length; i++) + if (spl[i].indexOf('http:\/\/') == 0 || spl[i].indexOf('https:\/\/') == 0) + links.push(i); + if (links.length > 0) { + let pos = 0; + let tn; + for (let i = 0; i < links.length; i++) { + tn = document.createTextNode(''); + while (pos < links[i]) { + tn.textContent += spl[pos]+' '; + pos++; + } + if (tn.textContent != '') + el.parentElement.insertBefore(tn, el); + let a = document.createElement('a'); + a.href = spl[pos]; + a.target = '_blank'; + a.textContent = spl[pos]; + el.parentElement.insertBefore(a, el); + pos++; + } + tn = document.createTextNode(''); + while (pos < spl.length) { + tn.textContent += spl[pos]; + if (pos < spl.length-1) tn.textContent += ' '; + pos++; + } + if (tn.textContent != '') + el.parentElement.insertBefore(tn, el); + el.parentElement.removeChild(el); + } + } else if (el.nodeType == 1 && el.tagName.toLowerCase() != 'a') + for (let i = el.childNodes.length-1; i >= 0; i--) + makeLinksKlickable(el.childNodes[i]); + } + + function createFootnoteRef (note, firstref) { + let el = document.createElement('sup'); + el.className = 'footnotelink'; + var link = document.createElement('a'); + link.href = '#footnote'+note.notenumber; + link.addEventListener('click', function () { + for (let j = 0; j < footnotes.length; j++) + footnotes[j].className = 'footnote'; + note.className = 'footnote active'; + }); + link.innerHTML = note.notenumber; + el.appendChild(link); + if (firstref) + el.id = 'footnotelink'+note.notenumber; + return el; + } + + let a; + let namednotes = new Object(); + let noterefs = new Array(); + for (let repeat = 0; repeat < 2; repeat++) { + if (repeat == 0) a = document.getElementsByTagName('span'); + else a = document.getElementsByTagName('footnote'); + for (let i = 0; i < a.length; i++) { + if ((repeat == 0 && (' '+a[i].className+' ').indexOf(' footnote ') == -1) || a[i].processed) continue; + a[i].processed = true; + if (a[i].getAttribute('notename')) namednotes[a[i].getAttribute('notename')] = a[i]; + if (a[i].getAttribute('noteref')) { + noterefs.push(a[i]); + continue; + } + a[i].notenumber = footnotes.length+1; + makeLinksKlickable(a[i]); + a[i].parentElement.insertBefore(createFootnoteRef(a[i], true), a[i]); + let el = document.createElement('a'); + el.className = 'number'; + el.href = '#footnotelink'+(footnotes.length + 1); + el.id = 'footnote'+(footnotes.length + 1); + el.innerHTML = '['+(footnotes.length + 1)+']'; + a[i].insertBefore(el, a[i].firstChild); + footnotes.push(a[i]); + } + } + if (footnotes.length == 0) return; + + for (let i = 0; i < noterefs.length; i++) { + let target = namednotes[noterefs[i].getAttribute('noteref')]; + if (target) + noterefs[i].parentElement.insertBefore(createFootnoteRef(target, false), noterefs[i]); + noterefs[i].parentElement.removeChild(noterefs[i]); + } + + let el2 = document.getElementById('footer'); + let b = false; + if (!el2) { + b = true; + document.createElement('div'); + } + el2.className = 'footer'; + el2.id = 'footer'; + el = document.createElement('hr'); + el2.appendChild(el); + for (let i = 0; i < footnotes.length; i++) + el2.appendChild(footnotes[i]); + if (b) document.body.appendChild(el2); +}, true); diff --git a/js/silvermine-videojs-quality-selector.min.js b/js/silvermine-videojs-quality-selector.min.js new file mode 100644 index 0000000..ddd62ff --- /dev/null +++ b/js/silvermine-videojs-quality-selector.min.js @@ -0,0 +1,4 @@ +/*! @silvermine/videojs-quality-selector 2020-04-26 v1.2.4 */ + +!function u(o,c,a){function l(e,n){if(!c[e]){if(!o[e]){var t="function"==typeof require&&require;if(!n&&t)return t(e,!0);if(s)return s(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var i=c[e]={exports:{}};o[e][0].call(i.exports,function(n){return l(o[e][1][n]||n)},i,i.exports,u,o,c,a)}return c[e].exports}for(var s="function"==typeof require&&require,n=0;n":">",'"':""","'":"'","`":"`"},W=h.invert(P);h.escape=D(P),h.unescape=D(W),h.result=function(n,e,t){h.isArray(e)||(e=[e]);var r=e.length;if(!r)return h.isFunction(t)?t.call(n):t;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};function Y(n){return"\\"+K[n]}var z=/(.)^/,K={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G=/\\|'|\r|\n|\u2028|\u2029/g;h.template=function(u,n,e){!n&&e&&(n=e),n=h.defaults({},n,h.templateSettings);var t,r=RegExp([(n.escape||z).source,(n.interpolate||z).source,(n.evaluate||z).source].join("|")+"|$","g"),o=0,c="__p+='";u.replace(r,function(n,e,t,r,i){return c+=u.slice(o,i).replace(G,Y),o=i+n.length,e?c+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":t?c+="'+\n((__t=("+t+"))==null?'':__t)+\n'":r&&(c+="';\n"+r+"\n__p+='"),n}),c+="';\n",n.variable||(c="with(obj||{}){\n"+c+"}\n"),c="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+c+"return __p;\n";try{t=new Function(n.variable||"obj","_",c)}catch(n){throw n.source=c,n}function i(n){return t.call(this,n,h)}var a=n.variable||"obj";return i.source="function("+a+"){\n"+c+"}",i},h.chain=function(n){var e=h(n);return e._chain=!0,e};function H(n,e){return n._chain?h(e).chain():e}h.mixin=function(t){return h.each(h.functions(t),function(n){var e=h[n]=t[n];h.prototype[n]=function(){var n=[this._wrapped];return i.apply(n,arguments),H(this,e.apply(h,n))}}),h},h.mixin(h),h.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];h.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],H(this,n)}}),h.each(["concat","join","slice"],function(n){var e=r[n];h.prototype[n]=function(){return H(this,e.apply(this._wrapped,arguments))}}),h.prototype.value=function(){return this._wrapped},h.prototype.valueOf=h.prototype.toJSON=h.prototype.value,h.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return h})}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(n,e,t){"use strict";var i=n("underscore"),u=n("../events");e.exports=function(n){var r=n.getComponent("MenuItem");return n.extend(r,{constructor:function(n,e){var t=e.source;if(!i.isObject(t))throw new Error('was not provided a "source" object, but rather: '+typeof t);e=i.extend({selectable:!0,label:t.label},e),r.call(this,n,e),this.source=t},handleClick:function(n){r.prototype.handleClick.call(this,n),this.player().trigger(u.QUALITY_REQUESTED,this.source)}})}},{"../events":5,underscore:2}],4:[function(n,e,t){"use strict";var i=n("underscore"),u=n("../events"),o=n("./QualityOption"),c="vjs-quality-changing";e.exports=function(n){var e,r=n.getComponent("MenuButton"),t=o(n);return e=n.extend(r,{constructor:function(t,n){r.call(this,t,n),t.on(u.QUALITY_REQUESTED,function(n,e){this.setSelectedSource(e),t.addClass(c),t.one("loadeddata",function(){t.removeClass(c)})}.bind(this)),t.on(u.PLAYER_SOURCES_CHANGED,function(){this.update()}.bind(this)),t.on(u.QUALITY_SELECTED,function(n,e){this.setSelectedSource(e)}.bind(this)),t.one("ready",function(){this.selectedSrc=t.src(),this.update()}.bind(this)),this.controlText("Open quality selector menu")},setSelectedSource:function(n){var e=n?n.src:void 0;this.selectedSrc!==e&&(this.selectedSrc=e,i.each(this.items,function(n){n.selected(n.source.src===e)}))},createItems:function(){var e=this.player(),n=e.currentSources();return!n||n.length<2?[]:i.map(n,function(n){return new t(e,{source:n,selected:n.src===this.selectedSrc})}.bind(this))},buildWrapperCSSClass:function(){return"vjs-quality-selector "+r.prototype.buildWrapperCSSClass.call(this)}}),n.registerComponent("QualitySelector",e),e}},{"../events":5,"./QualityOption":3,underscore:2}],5:[function(n,e,t){"use strict";e.exports={QUALITY_REQUESTED:"qualityRequested",QUALITY_SELECTED:"qualitySelected",PLAYER_SOURCES_CHANGED:"playerSourcesChanged"}},{}],6:[function(n,e,t){"use strict";var c=n("underscore"),r=n("./events"),i=n("./components/QualitySelector"),u=n("./middleware/SourceInterceptor"),a=n("./util/SafeSeek");e.exports=function(n){n=n||window.videojs,i(n),u(n),n.hook("setup",function(o){o.on(r.QUALITY_REQUESTED,function(n,e){var t=o.currentSources(),r=o.currentTime(),i=o.playbackRate(),u=o.paused();c.each(t,function(n){n.selected=!1}),c.findWhere(t,{src:e.src}).selected=!0,o._qualitySelectorSafeSeek&&o._qualitySelectorSafeSeek.onQualitySelectionChange(),o.src(t),o.ready(function(){o._qualitySelectorSafeSeek&&!o._qualitySelectorSafeSeek.hasFinished()||(o._qualitySelectorSafeSeek=new a(o,r),o.playbackRate(i)),u||o.play()})})})},e.exports.EVENTS=r},{"./components/QualitySelector":4,"./events":5,"./middleware/SourceInterceptor":7,"./util/SafeSeek":9,underscore:2}],7:[function(n,e,t){"use strict";var u=n("underscore"),o=n("../events");e.exports=function(n){n.use("*",function(i){return{setSource:function(n,e){var t,r=i.currentSources();i._qualitySelectorSafeSeek&&i._qualitySelectorSafeSeek.onPlayerSourcesChange(),u.isEqual(r,i._qualitySelectorPreviousSources)||(i.trigger(o.PLAYER_SOURCES_CHANGED,r),i._qualitySelectorPreviousSources=r),t=u.find(r,function(n){return!0===n.selected||"true"===n.selected||"selected"===n.selected})||n,i.trigger(o.QUALITY_SELECTED,t),e(null,t)}}})}},{"../events":5,underscore:2}],8:[function(n,e,t){"use strict";n("./index")()},{"./index":6}],9:[function(n,e,t){"use strict";var r=n("class.extend");e.exports=r.extend({init:function(n,e){this._player=n,this._seekToTime=e,this._hasFinished=!1,this._keepThisInstanceWhenPlayerSourcesChange=!1,this._seekWhenSafe()},_seekWhenSafe:function(){this._player.readyState()<3?(this._seekFn=this._seek.bind(this),this._player.one("canplay",this._seekFn)):this._seek()},onPlayerSourcesChange:function(){this._keepThisInstanceWhenPlayerSourcesChange?this._keepThisInstanceWhenPlayerSourcesChange=!1:this.cancel()},onQualitySelectionChange:function(){this.hasFinished()||(this._keepThisInstanceWhenPlayerSourcesChange=!0)},_seek:function(){this._player.currentTime(this._seekToTime),this._keepThisInstanceWhenPlayerSourcesChange=!1,this._hasFinished=!0},hasFinished:function(){return this._hasFinished},cancel:function(){this._player.off("canplay",this._seekFn),this._keepThisInstanceWhenPlayerSourcesChange=!1,this._hasFinished=!0}})},{"class.extend":1}]},{},[8]); +//# sourceMappingURL=silvermine-videojs-quality-selector.min.js.map \ No newline at end of file diff --git a/js/video.min.js b/js/video.min.js new file mode 100644 index 0000000..b4f8d62 --- /dev/null +++ b/js/video.min.js @@ -0,0 +1,25 @@ +/** + * @license + * Video.js 7.10.2 + * Copyright Brightcove, Inc. + * Available under Apache License Version 2.0 + * + * + * Includes vtt.js + * Available under Apache License Version 2.0 + * + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("global/window"),require("global/document")):"function"==typeof define&&define.amd?define(["global/window","global/document"],t):(e=e||self).videojs=t(e.window,e.document)}(this,function(T,d){"use strict";T=T&&Object.prototype.hasOwnProperty.call(T,"default")?T.default:T,d=d&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d;var h="7.10.2",l=[],e=function(o,u){return function(e,t,i){var n=u.levels[t],r=new RegExp("^("+n+")$");if("log"!==e&&i.unshift(e.toUpperCase()+":"),i.unshift(o+":"),l){l.push([].concat(i));var a=l.length-1e3;l.splice(0,0',i=n.firstChild,n.setAttribute("style","display:none; position:absolute;"),d.body.appendChild(n));for(var a={},s=0;sx',e=t.firstChild.href}return e}function Vt(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""}function qt(e,t){void 0===t&&(t=T.location);var i=Bt(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host}var Ht=function(n){function e(e){var t;void 0===e&&(e=[]);for(var i=e.length-1;0<=i;i--)if(e[i].enabled){Ut(e,e[i]);break}return(t=n.call(this,e)||this).changing_=!1,t}Ge(e,n);var t=e.prototype;return t.addTrack=function(e){var t=this;e.enabled&&Ut(this,e),n.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){t.changing_||(t.changing_=!0,Ut(t,e),t.changing_=!1,t.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},t.removeTrack=function(e){n.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},e}(Rt),Wt=function(n){function e(e){var t;void 0===e&&(e=[]);for(var i=e.length-1;0<=i;i--)if(e[i].selected){Ft(e,e[i]);break}return(t=n.call(this,e)||this).changing_=!1,Object.defineProperty(Ve(t),"selectedIndex",{get:function(){for(var e=0;e + * Copyright (c) 2014 David Björklund + * Available under the MIT license + * + */,ti=Object.prototype.toString;var ii=function(e){var r={};return e&&e.trim().split("\n").forEach(function(e){var t=e.indexOf(":"),i=e.slice(0,t).trim().toLowerCase(),n=e.slice(t+1).trim();"undefined"==typeof r[i]?r[i]=n:Array.isArray(r[i])?r[i].push(n):r[i]=[r[i],n]}),r},ni=si,ri=si;function ai(e,t,i){var n=e;return ei(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=m({},t,{uri:e}),n.callback=i,n}function si(e,t,i){return oi(t=ai(e,t,i))}function oi(n){if("undefined"==typeof n.callback)throw new Error("callback argument missing");var r=!1,a=function(e,t,i){r||(r=!0,n.callback(e,t,i))};function t(e){return clearTimeout(o),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,a(e,m)}function e(){if(!s){var e;clearTimeout(o),e=n.useXDR&&void 0===u.status?200:1223===u.status?204:u.status;var t=m,i=null;return 0!==e?(t={body:function(){var e=void 0;if(e=u.response?u.response:u.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(u),f)try{e=JSON.parse(e)}catch(e){}return e}(),statusCode:e,method:c,headers:{},url:l,rawRequest:u},u.getAllResponseHeaders&&(t.headers=ii(u.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),a(i,t,t.body)}}var i,s,o,u=n.xhr||null,l=(u=u||(n.cors||n.useXDR?new si.XDomainRequest:new si.XMLHttpRequest)).url=n.uri||n.url,c=u.method=n.method||"GET",d=n.body||n.data,h=u.headers=n.headers||{},p=!!n.sync,f=!1,m={body:void 0,headers:{},statusCode:0,method:c,url:l,rawRequest:u};if("json"in n&&!1!==n.json&&(f=!0,h.accept||h.Accept||(h.Accept="application/json"),"GET"!==c&&"HEAD"!==c&&(h["content-type"]||h["Content-Type"]||(h["Content-Type"]="application/json"),d=JSON.stringify(!0===n.json?d:n.json))),u.onreadystatechange=function(){4===u.readyState&&setTimeout(e,0)},u.onload=e,u.onerror=t,u.onprogress=function(){},u.onabort=function(){s=!0},u.ontimeout=t,u.open(c,l,!p,n.username,n.password),p||(u.withCredentials=!!n.withCredentials),!p&&0=e?t.push(r):r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e&&t.push(r)}if(o=!1,t.length!==this.activeCues_.length)o=!0;else for(var a=0;a]*>?)?/);return e=t[1]?t[1]:t[2],i=i.substr(e.length),e}function t(e,t){var i=Ei[e];if(!i)return null;var n=a.document.createElement(i),r=Ii[e];return r&&t&&(n[r]=t.trim()),n}for(var n,r,s,o,u=a.document.createElement("div"),l=u,c=[];null!==(n=e());)if("<"!==n[0])l.appendChild(a.document.createTextNode((r=n,Ci.innerHTML=r,r=Ci.textContent,Ci.textContent="",r)));else{if("/"===n[1]){c.length&&c[c.length-1]===n.substr(2).replace(">","")&&(c.pop(),l=l.parentNode);continue}var d,h=bi(n.substr(1,n.length-2));if(h){d=a.document.createProcessingInstruction("timestamp",h),l.appendChild(d);continue}var p=n.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!p)continue;if(!(d=t(p[1],p[3])))continue;if(s=l,Ai[(o=d).localName]&&Ai[o.localName]!==s.localName)continue;if(p[2]){var f=p[2].split(".");f.forEach(function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(wi.hasOwnProperty(i)){var n=t?"background-color":"color",r=wi[i];d.style[n]=r}}),d.className=f.join(" ")}c.push(p[1]),l.appendChild(d),l=d}return u}var Pi=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function Li(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function Oi(){}function Di(e,t,i){Oi.call(this),this.cue=t,this.cueDiv=xi(e,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:function(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function r(e,t){for(var i=t.childNodes.length-1;0<=i;i--)e.push(t.childNodes[i])}function a(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var n=i.match(/^.*(\n|\r)/);return n?n[e.length=0]:i}return"ruby"===t.tagName?a(e):t.childNodes?(r(e,t),a(e)):void 0}for(r(t,e);i=a(t);)for(var n=0;nd&&(c=c<0?-1:1,c*=Math.ceil(d/l)*l),r<0&&(c+=""===n.vertical?o.height:o.width,a=a.reverse()),i.move(h,c)}else{var p=i.lineHeight/o.height*100;switch(n.lineAlign){case"center":r-=p/2;break;case"end":r-=p}switch(n.vertical){case"":t.applyStyles({top:t.formatStyle(r,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(r,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(r,"%")})}a=["+y","-x","+x","-y"],i=new Mi(t)}var f=function(e,t){for(var i,n=new Mi(e),r=1,a=0;ae.left&&this.tope.top},Mi.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},Mi.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},Mi.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},Mi.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},Mi.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},Ni.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},Ni.convertCueToDOMTree=function(e,t){return e&&t?xi(e,t):null};Ni.processCues=function(n,r,e){if(!n||!r||!e)return null;for(;e.firstChild;)e.removeChild(e.firstChild);var a=n.document.createElement("div");if(a.style.position="absolute",a.style.left="0",a.style.right="0",a.style.top="0",a.style.bottom="0",a.style.margin="1.5%",e.appendChild(a),function(e){for(var t=0;t